Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2524,18 +2524,24 @@ |
2525 | 2525 | if ( $useESI && $wgResourceLoaderUseESI ) { |
2526 | 2526 | $esi = Xml::element( 'esi:include', array( 'src' => $url ) ); |
2527 | 2527 | if ( $only == ResourceLoaderModule::TYPE_STYLES ) { |
2528 | | - $links .= Html::inlineStyle( $esi ); |
| 2528 | + $link = Html::inlineStyle( $esi ); |
2529 | 2529 | } else { |
2530 | | - $links .= Html::inlineScript( $esi ); |
| 2530 | + $link = Html::inlineScript( $esi ); |
2531 | 2531 | } |
2532 | 2532 | } else { |
2533 | 2533 | // Automatically select style/script elements |
2534 | 2534 | if ( $only === ResourceLoaderModule::TYPE_STYLES ) { |
2535 | | - $links .= Html::linkedStyle( wfAppendQuery( $wgLoadScript, $query ) ) . "\n"; |
| 2535 | + $link = Html::linkedStyle( wfAppendQuery( $wgLoadScript, $query ) ); |
2536 | 2536 | } else { |
2537 | | - $links .= Html::linkedScript( wfAppendQuery( $wgLoadScript, $query ) ) . "\n"; |
| 2537 | + $link = Html::linkedScript( wfAppendQuery( $wgLoadScript, $query ) ); |
2538 | 2538 | } |
2539 | 2539 | } |
| 2540 | + |
| 2541 | + if( $group == 'noscript' ){ |
| 2542 | + $links .= Html::rawElement( 'noscript', array(), $link ) . "\n"; |
| 2543 | + } else { |
| 2544 | + $links .= $link . "\n"; |
| 2545 | + } |
2540 | 2546 | } |
2541 | 2547 | return $links; |
2542 | 2548 | } |
— | — | @@ -2829,7 +2835,7 @@ |
2830 | 2836 | $ret = ''; |
2831 | 2837 | // Add ResourceLoader styles |
2832 | 2838 | // Split the styles into four groups |
2833 | | - $styles = array( 'other' => array(), 'user' => array(), 'site' => array(), 'private' => array() ); |
| 2839 | + $styles = array( 'other' => array(), 'user' => array(), 'site' => array(), 'private' => array(), 'noscript' => array() ); |
2834 | 2840 | $resourceLoader = $this->getResourceLoader(); |
2835 | 2841 | foreach ( $this->getModuleStyles() as $name ) { |
2836 | 2842 | $group = $resourceLoader->getModule( $name )->getGroup(); |
— | — | @@ -2847,12 +2853,12 @@ |
2848 | 2854 | $ret .= implode( "\n", $this->buildCssLinksArray() ) . $this->mInlineStyles; |
2849 | 2855 | // Add marker tag to mark the place where the client-side loader should inject dynamic styles |
2850 | 2856 | // We use a <meta> tag with a made-up name for this because that's valid HTML |
2851 | | - $ret .= Html::element( 'meta', array( 'name' => 'ResourceLoaderDynamicStyles', 'content' => '' ) ); |
| 2857 | + $ret .= Html::element( 'meta', array( 'name' => 'ResourceLoaderDynamicStyles', 'content' => '' ) ) . "\n"; |
2852 | 2858 | |
2853 | 2859 | // Add site, private and user styles |
2854 | 2860 | // 'private' at present only contains user.options, so put that before 'user' |
2855 | 2861 | // Any future private modules will likely have a similar user-specific character |
2856 | | - foreach ( array( 'site', 'private', 'user' ) as $group ) { |
| 2862 | + foreach ( array( 'site', 'noscript', 'private', 'user' ) as $group ) { |
2857 | 2863 | $ret .= $this->makeResourceLoaderLink( $sk, $styles[$group], |
2858 | 2864 | ResourceLoaderModule::TYPE_STYLES |
2859 | 2865 | ); |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderNoscriptModule.php |
— | — | @@ -0,0 +1,50 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * This program is free software; you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU General Public License as published by |
| 6 | + * the Free Software Foundation; either version 2 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * This program is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU General Public License along |
| 15 | + * with this program; if not, write to the Free Software Foundation, Inc., |
| 16 | + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | + * http://www.gnu.org/copyleft/gpl.html |
| 18 | + * |
| 19 | + * @file |
| 20 | + * @author Trevor Parscal |
| 21 | + * @author Roan Kattouw |
| 22 | + */ |
| 23 | + |
| 24 | +/** |
| 25 | + * Module for site customizations |
| 26 | + */ |
| 27 | +class ResourceLoaderNoscriptModule extends ResourceLoaderWikiModule { |
| 28 | + |
| 29 | + /* Protected Methods */ |
| 30 | + |
| 31 | + /** |
| 32 | + * Gets list of pages used by this module. Obviously, it makes absolutely no |
| 33 | + * sense to include JavaScript files here... :D |
| 34 | + * |
| 35 | + * @return Array: List of pages |
| 36 | + */ |
| 37 | + protected function getPages( ResourceLoaderContext $context ) { |
| 38 | + return array( 'MediaWiki:Noscript.css' => array( 'type' => 'style' ) ); |
| 39 | + } |
| 40 | + |
| 41 | + /* Methods */ |
| 42 | + |
| 43 | + /** |
| 44 | + * Gets group name |
| 45 | + * |
| 46 | + * @return String: Name of group |
| 47 | + */ |
| 48 | + public function getGroup() { |
| 49 | + return 'noscript'; |
| 50 | + } |
| 51 | +} |
Property changes on: trunk/phase3/includes/resourceloader/ResourceLoaderNoscriptModule.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 52 | + native |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -201,6 +201,7 @@ |
202 | 202 | 'ResourceLoaderWikiModule' => 'includes/resourceloader/ResourceLoaderWikiModule.php', |
203 | 203 | 'ResourceLoaderFileModule' => 'includes/resourceloader/ResourceLoaderFileModule.php', |
204 | 204 | 'ResourceLoaderSiteModule' => 'includes/resourceloader/ResourceLoaderSiteModule.php', |
| 205 | + 'ResourceLoaderNoscriptModule' => 'includes/resourceloader/ResourceLoaderNoscriptModule.php', |
205 | 206 | 'ResourceLoaderUserModule' => 'includes/resourceloader/ResourceLoaderUserModule.php', |
206 | 207 | 'ResourceLoaderUserGroupsModule' => 'includes/resourceloader/ResourceLoaderUserGroupsModule.php', |
207 | 208 | 'ResourceLoaderUserOptionsModule' => 'includes/resourceloader/ResourceLoaderUserOptionsModule.php', |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -565,7 +565,7 @@ |
566 | 566 | |
567 | 567 | // Per-site custom styles |
568 | 568 | if ( $wgUseSiteCss ) { |
569 | | - $out->addModuleStyles( 'site' ); |
| 569 | + $out->addModuleStyles( array( 'site', 'noscript' ) ); |
570 | 570 | if( $wgUser->isLoggedIn() ){ |
571 | 571 | $out->addModuleStyles( 'user.groups' ); |
572 | 572 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -3508,6 +3508,7 @@ |
3509 | 3509 | 'vector.css' => '/* CSS placed here will affect users of the Vector skin */', # only translate this message to other languages if you have to change it |
3510 | 3510 | 'print.css' => '/* CSS placed here will affect the print output */', # only translate this message to other languages if you have to change it |
3511 | 3511 | 'handheld.css' => '/* CSS placed here will affect handheld devices based on the skin configured in $wgHandheldStyle */', # only translate this message to other languages if you have to change it |
| 3512 | +'noscript.css' => '/* CSS placed here will affect users with JavaScript disabled */', # only translate this message to other languages if you have to change it |
3512 | 3513 | 'autoconfirmed.css' => '/* CSS placed here will affect autoconfirmed users only */', # only translate this message to other languages if you have to change it |
3513 | 3514 | 'bot.css' => '/* CSS placed here will affect bots only */', # only translate this message to other languages if you have to change it |
3514 | 3515 | 'sysop.css' => '/* CSS placed here will affect sysops only */', # only translate this message to other languages if you have to change it |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -87,6 +87,8 @@ |
88 | 88 | specifically, rather than all ZIP files being blocked. |
89 | 89 | * (bug 2429) Allow selection of associated namespace in recent changes |
90 | 90 | * (bug 26995) File size is now checked before uploading in HTML5 browsers |
| 91 | +* CSS stylesheet MediaWiki:Noscript.css is now loaded for users with JavaScript |
| 92 | + disabled (enclosed in the head in a <noscript> tag) |
91 | 93 | |
92 | 94 | === Bug fixes in 1.18 === |
93 | 95 | * (bug 23119) WikiError class and subclasses are now marked as deprecated |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -5,6 +5,7 @@ |
6 | 6 | /* Special resources who have their own classes */ |
7 | 7 | |
8 | 8 | 'site' => array( 'class' => 'ResourceLoaderSiteModule' ), |
| 9 | + 'noscript' => array( 'class' => 'ResourceLoaderNoscriptModule' ), |
9 | 10 | 'startup' => array( 'class' => 'ResourceLoaderStartUpModule' ), |
10 | 11 | 'user' => array( 'class' => 'ResourceLoaderUserModule' ), |
11 | 12 | 'user.options' => array( 'class' => 'ResourceLoaderUserOptionsModule' ), |