diff --git a/install.php b/install.php index 5b4e3f8654f828569833224daf9dbd72ed5a891a..87ac52bc5da99950fded4ae18656c3a5bddb6462 100644 --- a/install.php +++ b/install.php @@ -728,13 +728,7 @@ function install_tasks($profile, $task) { // We add these strings as settings because JavaScript translation does not // work on install time. drupal_add_js(array('copyFieldValue' => array('edit-site-mail' => array('edit-account-mail'))), 'setting'); - drupal_add_js(' -// Global Killswitch -if (Drupal.jsEnabled) { - jQuery(document).ready(function() { - Drupal.cleanURLsInstallCheck(); - }); -}', 'inline'); + drupal_add_js('jQuery(function() { Drupal.cleanURLsInstallCheck(); });', 'inline'); // Build menu to allow clean URL check. menu_rebuild(); diff --git a/misc/drupal.js b/misc/drupal.js index 9e6d9c40614d84af6208756ebee49b6f47a65cfe..b0cf64ce179c969049c2f32c28b268448a03f7d0 100644 --- a/misc/drupal.js +++ b/misc/drupal.js @@ -15,11 +15,6 @@ if ($ === undefined) { (function($) { -/** - * Set the variable that indicates if JavaScript behaviors should be applied. - */ -Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById; - /** * Attach all registered behaviors to a page element. * @@ -317,17 +312,16 @@ Drupal.ahahError = function(xmlhttp, uri) { return message.replace(/\n/g, '<br />'); }; -// Global Killswitch on the <html> element. -if (Drupal.jsEnabled) { - // Global Killswitch on the <html> element. - $(document.documentElement).addClass('js'); - // 'js enabled' cookie. - document.cookie = 'has_js=1; path=/'; - // Attach all behaviors. - $(document).ready(function() { - Drupal.attachBehaviors(this, Drupal.settings); - }); -} +// Class indicating that JS is enabled; used for styling purpose. +$('html').addClass('js'); + +// 'js enabled' cookie. +document.cookie = 'has_js=1; path=/'; + +// Attach all behaviors. +$(function() { + Drupal.attachBehaviors(document, Drupal.settings); +}); /** * The default themes.