specifically, rather than all ZIP files being blocked.
* (bug 2429) Allow selection of associated namespace in recent changes
* (bug 26995) File size is now checked before uploading in HTML5 browsers
+* CSS stylesheet MediaWiki:Noscript.css is now loaded for users with JavaScript
+ disabled (enclosed in the head in a <noscript> tag)
=== Bug fixes in 1.18 ===
* (bug 23119) WikiError class and subclasses are now marked as deprecated
'ResourceLoaderWikiModule' => 'includes/resourceloader/ResourceLoaderWikiModule.php',
'ResourceLoaderFileModule' => 'includes/resourceloader/ResourceLoaderFileModule.php',
'ResourceLoaderSiteModule' => 'includes/resourceloader/ResourceLoaderSiteModule.php',
+ 'ResourceLoaderNoscriptModule' => 'includes/resourceloader/ResourceLoaderNoscriptModule.php',
'ResourceLoaderUserModule' => 'includes/resourceloader/ResourceLoaderUserModule.php',
'ResourceLoaderUserGroupsModule' => 'includes/resourceloader/ResourceLoaderUserGroupsModule.php',
'ResourceLoaderUserOptionsModule' => 'includes/resourceloader/ResourceLoaderUserOptionsModule.php',
if ( $useESI && $wgResourceLoaderUseESI ) {
$esi = Xml::element( 'esi:include', array( 'src' => $url ) );
if ( $only == ResourceLoaderModule::TYPE_STYLES ) {
- $links .= Html::inlineStyle( $esi );
+ $link = Html::inlineStyle( $esi );
} else {
- $links .= Html::inlineScript( $esi );
+ $link = Html::inlineScript( $esi );
}
} else {
// Automatically select style/script elements
if ( $only === ResourceLoaderModule::TYPE_STYLES ) {
- $links .= Html::linkedStyle( wfAppendQuery( $wgLoadScript, $query ) ) . "\n";
+ $link = Html::linkedStyle( wfAppendQuery( $wgLoadScript, $query ) );
} else {
- $links .= Html::linkedScript( wfAppendQuery( $wgLoadScript, $query ) ) . "\n";
+ $link = Html::linkedScript( wfAppendQuery( $wgLoadScript, $query ) );
}
}
+
+ if( $group == 'noscript' ){
+ $links .= Html::rawElement( 'noscript', array(), $link ) . "\n";
+ } else {
+ $links .= $link . "\n";
+ }
}
return $links;
}
$ret = '';
// Add ResourceLoader styles
// Split the styles into four groups
- $styles = array( 'other' => array(), 'user' => array(), 'site' => array(), 'private' => array() );
+ $styles = array( 'other' => array(), 'user' => array(), 'site' => array(), 'private' => array(), 'noscript' => array() );
$resourceLoader = $this->getResourceLoader();
foreach ( $this->getModuleStyles() as $name ) {
$group = $resourceLoader->getModule( $name )->getGroup();
$ret .= implode( "\n", $this->buildCssLinksArray() ) . $this->mInlineStyles;
// Add marker tag to mark the place where the client-side loader should inject dynamic styles
// We use a <meta> tag with a made-up name for this because that's valid HTML
- $ret .= Html::element( 'meta', array( 'name' => 'ResourceLoaderDynamicStyles', 'content' => '' ) );
+ $ret .= Html::element( 'meta', array( 'name' => 'ResourceLoaderDynamicStyles', 'content' => '' ) ) . "\n";
// Add site, private and user styles
// 'private' at present only contains user.options, so put that before 'user'
// Any future private modules will likely have a similar user-specific character
- foreach ( array( 'site', 'private', 'user' ) as $group ) {
+ foreach ( array( 'site', 'noscript', 'private', 'user' ) as $group ) {
$ret .= $this->makeResourceLoaderLink( $sk, $styles[$group],
ResourceLoaderModule::TYPE_STYLES
);
// Per-site custom styles
if ( $wgUseSiteCss ) {
- $out->addModuleStyles( 'site' );
+ $out->addModuleStyles( array( 'site', 'noscript' ) );
if( $wgUser->isLoggedIn() ){
$out->addModuleStyles( 'user.groups' );
}
--- /dev/null
+<?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @author Trevor Parscal
+ * @author Roan Kattouw
+ */
+
+/**
+ * Module for site customizations
+ */
+class ResourceLoaderNoscriptModule extends ResourceLoaderWikiModule {
+
+ /* Protected Methods */
+
+ /**
+ * Gets list of pages used by this module. Obviously, it makes absolutely no
+ * sense to include JavaScript files here... :D
+ *
+ * @return Array: List of pages
+ */
+ protected function getPages( ResourceLoaderContext $context ) {
+ return array( 'MediaWiki:Noscript.css' => array( 'type' => 'style' ) );
+ }
+
+ /* Methods */
+
+ /**
+ * Gets group name
+ *
+ * @return String: Name of group
+ */
+ public function getGroup() {
+ return 'noscript';
+ }
+}
'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
'print.css' => '/* CSS placed here will affect the print output */', # only translate this message to other languages if you have to change it
'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
+'noscript.css' => '/* CSS placed here will affect users with JavaScript disabled */', # only translate this message to other languages if you have to change it
'autoconfirmed.css' => '/* CSS placed here will affect autoconfirmed users only */', # only translate this message to other languages if you have to change it
'bot.css' => '/* CSS placed here will affect bots only */', # only translate this message to other languages if you have to change it
'sysop.css' => '/* CSS placed here will affect sysops only */', # only translate this message to other languages if you have to change it
/* Special resources who have their own classes */
'site' => array( 'class' => 'ResourceLoaderSiteModule' ),
+ 'noscript' => array( 'class' => 'ResourceLoaderNoscriptModule' ),
'startup' => array( 'class' => 'ResourceLoaderStartUpModule' ),
'user' => array( 'class' => 'ResourceLoaderUserModule' ),
'user.options' => array( 'class' => 'ResourceLoaderUserOptionsModule' ),