Remove JavaScript global variable wgLoadScript
Use mw.util.wikiScript( 'load' ) instead of mw.config.get( 'wgLoadScript' ) The module 'mediawiki.util' now gets the value from a private config variable. Change-Id: Iae4f4754f40999ba9d7c7161e9a37820c4b5931c
This commit is contained in:
parent
509d40ab9d
commit
bac0e0160f
5 changed files with 12 additions and 7 deletions
|
|
@ -258,6 +258,8 @@ because of Phabricator reports.
|
|||
all deprecated in 1.25 and ignored, have been removed.
|
||||
* The API module method getDescriptionMessage(), deprecated in 1.30, has been
|
||||
removed.
|
||||
* The JavaScript global variable wgLoadScript has been removed. Use
|
||||
mw.util.wikiScript( 'load' ) instead.
|
||||
* …
|
||||
|
||||
=== Deprecations in 1.34 ===
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
|
|||
// Build list of variables
|
||||
$skin = $context->getSkin();
|
||||
$vars = [
|
||||
'wgLoadScript' => $conf->get( 'LoadScript' ),
|
||||
'debug' => $context->getDebug(),
|
||||
'skin' => $skin,
|
||||
'stylepath' => $conf->get( 'StylePath' ),
|
||||
|
|
|
|||
|
|
@ -1262,7 +1262,10 @@ return [
|
|||
'remoteBasePath' => "$wgResourceBasePath/resources/src",
|
||||
'packageFiles' => [
|
||||
'mediawiki.util.js',
|
||||
[ 'name' => 'config.json', 'config' => [ 'FragmentMode' ] ],
|
||||
[ 'name' => 'config.json', 'config' => [
|
||||
'FragmentMode',
|
||||
'LoadScript',
|
||||
] ],
|
||||
],
|
||||
'dependencies' => [
|
||||
'jquery.accessKeyLabel',
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@
|
|||
if ( str === 'index' ) {
|
||||
return mw.config.get( 'wgScript' );
|
||||
} else if ( str === 'load' ) {
|
||||
return mw.config.get( 'wgLoadScript' );
|
||||
return config.LoadScript;
|
||||
} else {
|
||||
return mw.config.get( 'wgScriptPath' ) + '/' + str + '.php';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,11 +232,12 @@
|
|||
} );
|
||||
|
||||
QUnit.test( 'wikiScript', function ( assert ) {
|
||||
mw.util.setOptionsForTest( {
|
||||
LoadScript: '/w/l.php'
|
||||
} );
|
||||
mw.config.set( {
|
||||
// customized wgScript for T41103
|
||||
wgScript: '/w/i.php',
|
||||
// customized wgLoadScript for T41103
|
||||
wgLoadScript: '/w/l.php',
|
||||
wgScriptPath: '/w'
|
||||
} );
|
||||
|
||||
|
|
@ -246,8 +247,8 @@
|
|||
assert.strictEqual( util.wikiScript( 'index' ), mw.config.get( 'wgScript' ),
|
||||
'wikiScript( index ) returns wgScript'
|
||||
);
|
||||
assert.strictEqual( util.wikiScript( 'load' ), mw.config.get( 'wgLoadScript' ),
|
||||
'wikiScript( load ) returns wgLoadScript'
|
||||
assert.strictEqual( util.wikiScript( 'load' ), '/w/l.php',
|
||||
'wikiScript( load ) returns /w/l.php'
|
||||
);
|
||||
assert.strictEqual( util.wikiScript( 'api' ), '/w/api.php', 'API path' );
|
||||
} );
|
||||
|
|
|
|||
Loading…
Reference in a new issue