Commit 21d667dc authored by Greg Rundlett's avatar Greg Rundlett

remove dynamic ResourceModules

parent 544a463f
Pipeline #34481848 failed with stages
in 1 minute and 21 seconds
......@@ -18,27 +18,15 @@ class TreeAndMenu {
* Called at extension setup time, install hooks and module resources
*/
public function setup() {
global $wgOut, $wgParser, $wgExtensionAssetsPath, $wgAutoloadClasses, $IP, $wgResourceModules;
global $wgOut, $wgParser, $wgExtensionAssetsPath;
// Add parser hooks
$wgParser->setFunctionHook( 'tree', array( $this, 'expandTree' ) );
$wgParser->setFunctionHook( 'menu', array( $this, 'expandMenu' ) );
// This gets the remote path even if it's a symlink (MW1.25+)
$path = $wgExtensionAssetsPath . str_replace( "$IP/extensions", '', dirname( $wgAutoloadClasses[__CLASS__] ) );
// Fancytree script and styles
$wgResourceModules['ext.fancytree']['localBasePath'] = __DIR__ . '/fancytree';
$wgResourceModules['ext.fancytree']['remoteExtPath'] = "$path/fancytree";
$wgOut->addModules( 'ext.fancytree' );
$wgOut->addStyle( "$path/fancytree/fancytree.css" );
$wgOut->addJsConfigVars( 'fancytree_path', "$path/fancytree" );
// Suckerfish menu script and styles
$wgResourceModules['ext.suckerfish']['localBasePath'] = __DIR__ . '/suckerfish';
$wgResourceModules['ext.suckerfish']['remoteExtPath'] = "$path/suckerfish";
$wgOut->addModules( 'ext.suckerfish' );
$wgOut->addStyle( "$path/suckerfish/suckerfish.css" );
// Fancytree js vars
$wgOut->addJsConfigVars( 'fancytree_path', "$wgExtensionAssetsPath/FancyTree/fancytree" );
}
/**
......
{
"name": "TreeAndMenu",
"version": "4.2.2, 2018-01-31",
"author": ["[http://www.organicdesign.co.nz/aran Aran Dunkley]"],
"version": "4.3.0, 2018-10-26",
"author": ["[http://www.organicdesign.co.nz/aran Aran Dunkley]", "[https://equality-tech.com Greg Rundlett]"],
"url": "http://www.mediawiki.org/wiki/Extension:TreeAndMenu",
"descriptionmsg": "treeandmenu-desc",
"license-name": "[https://www.gnu.org/licenses/gpl-2.0.html GNU General Public Licence 2.0] or later",
"type": "parserhook",
"callback": "TreeAndMenu::onRegistration",
"config": {
"TreeAndMenuPersistIfId": false, "@": "Makes trees with id attributes have persistent state"
"TreeAndMenuPersistIfId": false,
"@": "Makes trees with id attributes have persistent state"
},
"AutoloadClasses": {
"TreeAndMenu": "TreeAndMenu_body.php"
......@@ -17,15 +18,15 @@
"TreeAndMenuMagic": "TreeAndMenu.i18n.magic.php"
},
"MessagesDirs": {
"TreeAndMenu": ["i18n"]
"TreeAndMenu": "i18n"
},
"ResourceModules": {
"ext.fancytree": {
"scripts": [
"jquery.fancytree.js",
"jquery.fancytree.persist.js",
"jquery.fancytree.mediawiki.js",
"fancytree.js"
"fancytree/jquery.fancytree.js",
"fancytree/jquery.fancytree.persist.js",
"fancytree/jquery.fancytree.mediawiki.js",
"fancytree/fancytree.js"
],
"dependencies": [
"jquery.ui.core",
......@@ -35,13 +36,13 @@
]
},
"ext.suckerfish": {
"scripts": ["suckerfish.js"],
"scripts": "suckerfish/suckerfish.js",
"styles": "suckerfish/suckerfish.css"
"dependencies": ["jquery.client"]
}
},
"@": "The paths will be populated later as it needs be calculated",
"ResourceFileModulePaths": {
"localBasePath": "",
"remoteExtPath": ""
"remoteExtPath": "TreeAndMenu/"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment