From: Timo Tijhof Date: Wed, 13 May 2015 18:23:26 +0000 (+0100) Subject: resourceloader: Implement ResourceLoaderRawFileModule for 'mediawiki.js' X-Git-Tag: 1.31.0-rc.0~11405^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=d9fbce0b76994d06f6a6ce166485e0ce44a9525d;p=lhc%2Fweb%2Fwiklou.git resourceloader: Implement ResourceLoaderRawFileModule for 'mediawiki.js' When adding files to this module, they all imply a global scope. While most files have their own closure, it is still inconsistent with normal modules which always have a closure via mw.loader.implement. Base modules like 'mediawiki' are lacking such a closure, thus making it hard to share variables within the different files that make up the module without making it a globally public. The use case is 13203c0a2180e5, where we could expose the sha1() library within the scope of this module only. Change-Id: I93fcd045f47ec6a595b26f739939e1d371832ac9 --- diff --git a/autoload.php b/autoload.php index d158481c14..8b80295b54 100644 --- a/autoload.php +++ b/autoload.php @@ -1009,6 +1009,7 @@ $wgAutoloadLocalClasses = array( 'ResourceLoaderLanguageDataModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderLanguageDataModule.php', 'ResourceLoaderLanguageNamesModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderLanguageNamesModule.php', 'ResourceLoaderModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderModule.php', + 'ResourceLoaderRawFileModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderRawFileModule.php', 'ResourceLoaderSiteModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderSiteModule.php', 'ResourceLoaderSkinModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderSkinModule.php', 'ResourceLoaderSpecialCharacterDataModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderSpecialCharacterDataModule.php', diff --git a/includes/resourceloader/ResourceLoaderRawFileModule.php b/includes/resourceloader/ResourceLoaderRawFileModule.php new file mode 100644 index 0000000000..d9005fa5e2 --- /dev/null +++ b/includes/resourceloader/ResourceLoaderRawFileModule.php @@ -0,0 +1,52 @@ + array( + 'class' => 'ResourceLoaderRawFileModule', // Keep maintenance/jsduck/eg-iframe.html in sync 'scripts' => array( 'resources/src/mediawiki/mediawiki.js', @@ -780,7 +781,6 @@ return array( 'resources/src/mediawiki/mediawiki.startUp.js', ), 'debugScripts' => 'resources/src/mediawiki/mediawiki.log.js', - 'raw' => true, 'targets' => array( 'desktop', 'mobile' ), ), 'mediawiki.apihelp' => array(