diff options
Diffstat (limited to 'resources/Resources.php')
-rw-r--r-- | resources/Resources.php | 118 |
1 files changed, 103 insertions, 15 deletions
diff --git a/resources/Resources.php b/resources/Resources.php index 0a70c5a2..6205bb91 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1,8 +1,34 @@ <?php +/** + * Definition of core ResourceLoader modules. + * + * 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 + */ + +if( !defined( 'MEDIAWIKI' ) ) { + die( 'Not an entry point.' ); +} return array( - /* Special modules who have their own classes */ + /** + * Special modules who have their own classes + */ // Scripts managed by the local wiki (stored in the MediaWiki namespace) 'site' => array( 'class' => 'ResourceLoaderSiteModule' ), @@ -24,7 +50,16 @@ return array( // Scripts for the dynamic language specific data, like grammar forms. 'mediawiki.language.data' => array( 'class' => 'ResourceLoaderLanguageDataModule' ), - /* Skins */ + /** + * Skins + * Be careful not to add 'scripts' to these modules, + * since they are loaded with OutputPage::addModuleStyles so that the skin styles + * apply without javascript. + * If a skin needs custom js in the interface, register a separate module + * and add it to the load queue with OutputPage::addModules. + * + * See Vector for an example. + */ 'skins.chick' => array( 'styles' => array( 'chick/main.css' => array( 'media' => 'screen, handheld' ) ), @@ -91,6 +126,10 @@ return array( 'vector/screen.css' => array( 'media' => 'screen' ), 'vector/screen-hd.css' => array( 'media' => 'screen and (min-width: 982px)' ), ), + 'remoteBasePath' => $GLOBALS['wgStylePath'], + 'localBasePath' => $GLOBALS['wgStyleDirectory'], + ), + 'skins.vector.js' => array( 'scripts' => 'vector/vector.js', 'remoteBasePath' => $GLOBALS['wgStylePath'], 'localBasePath' => $GLOBALS['wgStyleDirectory'], @@ -101,6 +140,7 @@ return array( 'jquery' => array( 'scripts' => 'resources/jquery/jquery.js', 'debugRaw' => false, + 'targets' => array( 'desktop', 'mobile' ), ), /* jQuery Plugins */ @@ -122,6 +162,7 @@ return array( 'jquery.badge' => array( 'scripts' => 'resources/jquery/jquery.badge.js', 'styles' => 'resources/jquery/jquery.badge.css', + 'dependencies' => 'mediawiki.language', ), 'jquery.byteLength' => array( 'scripts' => 'resources/jquery/jquery.byteLength.js', @@ -135,9 +176,7 @@ return array( ), 'jquery.client' => array( 'scripts' => 'resources/jquery/jquery.client.js', - ), - 'jquery.collapsibleTabs' => array( - 'scripts' => 'resources/jquery/jquery.collapsibleTabs.js', + 'targets' => array( 'desktop', 'mobile' ), ), 'jquery.color' => array( 'scripts' => 'resources/jquery/jquery.color.js', @@ -148,6 +187,7 @@ return array( ), 'jquery.cookie' => array( 'scripts' => 'resources/jquery/jquery.cookie.js', + 'targets' => array( 'desktop', 'mobile' ), ), 'jquery.delayedBind' => array( 'scripts' => 'resources/jquery/jquery.delayedBind.js', @@ -171,6 +211,10 @@ return array( 'jquery.getAttrs' => array( 'scripts' => 'resources/jquery/jquery.getAttrs.js', ), + 'jquery.hidpi' => array( + 'scripts' => 'resources/jquery/jquery.hidpi.js', + 'targets' => array( 'desktop', 'mobile' ), + ), 'jquery.highlightText' => array( 'scripts' => 'resources/jquery/jquery.highlightText.js', 'dependencies' => 'jquery.mwExtension', @@ -180,6 +224,7 @@ return array( ), 'jquery.json' => array( 'scripts' => 'resources/jquery/jquery.json.js', + 'targets' => array( 'mobile', 'desktop' ), ), 'jquery.localize' => array( 'scripts' => 'resources/jquery/jquery.localize.js', @@ -197,6 +242,7 @@ return array( ), 'jquery.mwExtension' => array( 'scripts' => 'resources/jquery/jquery.mwExtension.js', + 'targets' => array( 'desktop', 'mobile' ), ), 'jquery.placeholder' => array( 'scripts' => 'resources/jquery/jquery.placeholder.js', @@ -539,6 +585,7 @@ return array( 'scripts' => 'resources/mediawiki/mediawiki.js', 'debugScripts' => 'resources/mediawiki/mediawiki.log.js', 'debugRaw' => false, + 'targets' => array( 'desktop', 'mobile' ), ), 'mediawiki.api' => array( 'scripts' => 'resources/mediawiki.api/mediawiki.api.js', @@ -562,13 +609,6 @@ return array( 'scripts' => 'resources/mediawiki.api/mediawiki.api.parse.js', 'dependencies' => 'mediawiki.api', ), - 'mediawiki.api.titleblacklist' => array( - 'scripts' => 'resources/mediawiki.api/mediawiki.api.titleblacklist.js', - 'dependencies' => array( - 'mediawiki.api', - 'mediawiki.Title', - ), - ), 'mediawiki.api.watch' => array( 'scripts' => 'resources/mediawiki.api/mediawiki.api.watch.js', 'dependencies' => array( @@ -614,6 +654,13 @@ return array( 'feedback-bugnew', ), ), + 'mediawiki.hidpi' => array( + 'scripts' => 'resources/mediawiki/mediawiki.hidpi.js', + 'dependencies' => array( + 'jquery.hidpi', + ), + 'targets' => array( 'desktop', 'mobile' ), + ), 'mediawiki.htmlform' => array( 'scripts' => 'resources/mediawiki/mediawiki.htmlform.js', ), @@ -626,9 +673,11 @@ return array( ), 'mediawiki.notify' => array( 'scripts' => 'resources/mediawiki/mediawiki.notify.js', + 'targets' => array( 'desktop', 'mobile' ), ), 'mediawiki.searchSuggest' => array( 'scripts' => 'resources/mediawiki/mediawiki.searchSuggest.js', + 'styles' => 'resources/mediawiki/mediawiki.searchSuggest.css', 'messages' => array( 'searchsuggest-search', 'searchsuggest-containing', @@ -652,6 +701,8 @@ return array( 'dependencies' => array( 'jquery.cookie', 'mediawiki.api', + 'user.options', + 'user.tokens', ), ), 'mediawiki.util' => array( @@ -664,6 +715,7 @@ return array( ), 'messages' => array( 'showtoc', 'hidetoc' ), 'position' => 'top', // For $wgPreloadJavaScriptMwUtil + 'targets' => array( 'desktop', 'mobile' ), ), /* MediaWiki Action */ @@ -693,7 +745,10 @@ return array( ), 'mediawiki.action.view.dblClickEdit' => array( 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.dblClickEdit.js', - 'dependencies' => 'mediawiki.util', + 'dependencies' => array( + 'mediawiki.util', + 'mediawiki.page.startup', + ), ), 'mediawiki.action.view.metadata' => array( 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.metadata.js', @@ -702,6 +757,10 @@ return array( 'metadata-collapse', ), ), + 'mediawiki.action.view.postEdit' => array( + 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.postEdit.js', + 'dependencies' => 'jquery.cookie' + ), 'mediawiki.action.view.rightClickEdit' => array( 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.rightClickEdit.js', ), @@ -713,7 +772,10 @@ return array( /* MediaWiki Language */ 'mediawiki.language' => array( - 'scripts' => 'resources/mediawiki.language/mediawiki.language.js', + 'scripts' => array( + 'resources/mediawiki.language/mediawiki.language.js', + 'resources/mediawiki.language/mediawiki.language.numbers.js' + ), 'languageScripts' => array( 'bs' => 'resources/mediawiki.language/languages/bs.js', 'dsb' => 'resources/mediawiki.language/languages/dsb.js', @@ -731,8 +793,9 @@ return array( ), 'dependencies' => array( 'mediawiki.language.data', - 'mediawiki.cldr' + 'mediawiki.cldr', ), + 'targets' => array( 'desktop', 'mobile' ), ), 'mediawiki.cldr' => array( @@ -740,14 +803,17 @@ return array( 'dependencies' => array( 'mediawiki.libs.pluralruleparser', ), + 'targets' => array( 'desktop', 'mobile' ), ), 'mediawiki.libs.pluralruleparser' => array( 'scripts' => 'resources/mediawiki.libs/CLDRPluralRuleParser.js', + 'targets' => array( 'desktop', 'mobile' ), ), 'mediawiki.language.init' => array( 'scripts' => 'resources/mediawiki.language/mediawiki.language.init.js', + 'targets' => array( 'desktop', 'mobile' ), ), 'mediawiki.jqueryMsg' => array( @@ -756,6 +822,7 @@ return array( 'mediawiki.util', 'mediawiki.language', ), + 'targets' => array( 'desktop', 'mobile' ), ), /* MediaWiki Libs */ @@ -784,6 +851,23 @@ return array( ), 'position' => 'top', ), + 'mediawiki.page.patrol.ajax' => array( + 'scripts' => 'resources/mediawiki.page/mediawiki.page.patrol.ajax.js', + 'dependencies' => array( + 'mediawiki.page.startup', + 'mediawiki.api', + 'mediawiki.util', + 'mediawiki.Title', + 'mediawiki.notify', + 'jquery.spinner', + 'user.tokens' + ), + 'messages' => array( + 'markedaspatrollednotify', + 'markedaspatrollederrornotify', + 'markedaspatrollederror-noautopatrol' + ), + ), 'mediawiki.page.watch.ajax' => array( 'scripts' => 'resources/mediawiki.page/mediawiki.page.watch.ajax.js', 'dependencies' => array( @@ -869,6 +953,9 @@ return array( ), 'dependencies' => array( 'mediawiki.libs.jpegmeta', 'mediawiki.util' ), ), + 'mediawiki.special.userlogin.signup' => array( + 'scripts' => 'resources/mediawiki.special/mediawiki.special.userLogin.signup.js', + ), 'mediawiki.special.javaScriptTest' => array( 'scripts' => 'resources/mediawiki.special/mediawiki.special.javaScriptTest.js', 'messages' => array_merge( Skin::getSkinNameMessages(), array( @@ -884,6 +971,7 @@ return array( 'mediawiki.tests.qunit.testrunner' => array( 'scripts' => 'tests/qunit/data/testrunner.js', 'dependencies' => array( + 'jquery.getAttrs', 'jquery.qunit', 'jquery.qunit.completenessTest', 'mediawiki.page.startup', |