* (bug 30497) Add client-nojs and client-js classes on document element to let styles...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 23 Aug 2011 18:33:28 +0000 (18:33 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 23 Aug 2011 18:33:28 +0000 (18:33 +0000)
Patch by John Du Hart - https://bugzilla.wikimedia.org/attachment.cgi?id=8956

RELEASE-NOTES-1.19
includes/OutputPage.php
resources/mediawiki.page/mediawiki.page.startup.js

index a59e47d..3ab5850 100644 (file)
@@ -16,6 +16,8 @@ production.
 * Default cookie lifetime ($wgCookieExpiration) is increased to 180 days.
 
 === New features in 1.19 ===
+* (bug 30497) Add client-nojs and client-js classes on document element
+  to let styles easily hide or show things based on general JS availability
 * (bug 19838) Possibility to get all interwiki prefixes if the interwiki
   cache is used.
 * $wgDnsBlacklistUrls now accepts an array with url and key as the
index 0a6af95..a80e315 100644 (file)
@@ -2223,7 +2223,7 @@ $templates
                        $this->addModuleStyles( 'mediawiki.legacy.wikiprintable' );
                }
 
-               $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir ) );
+               $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) );
 
                if ( $this->getHTMLTitle() == '' ) {
                        $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) );
index 163dbf3..c601c29 100644 (file)
@@ -5,11 +5,13 @@
        /* Client profile classes for <html> */
 
        var prof = $.client.profile();
-       $( 'html' ).addClass(
-               'client-' + prof.name
-               + ' client-' + prof.name + '-' + prof.versionBase
-               + ' client-' + prof.layout
-               + ' client-' + prof.platform
-       );
+       $( 'html' )
+               .addClass(
+                       'client-' + prof.name
+                       + ' client-' + prof.name + '-' + prof.versionBase
+                       + ' client-' + prof.layout
+                       + ' client-' + prof.platform
+                       + ' client-js' )
+               .removeClass( 'client-nojs' );
 
 } )( jQuery );