jenkins-bot has submitted this change and it was merged.
Change subject: Improve extension entry point
......................................................................
Improve extension entry point
Simplify the ResourceLoader module definitions and
avoid leaking variables into global scope.
Change-Id: I19334e84c4cd065324f45005a61c525271a9a769
---
M InputBox.php
1 file changed, 15 insertions(+), 18 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/InputBox.php b/InputBox.php
index cef4775..39e4bae 100644
--- a/InputBox.php
+++ b/InputBox.php
@@ -26,8 +26,6 @@
die( -1 );
}
-/* Configuration */
-
// Credits
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
@@ -39,34 +37,33 @@
'descriptionmsg' => 'inputbox-desc',
);
-// Shortcut to this extension directory
-$dir = __DIR__ . '/';
-
// Internationalization
$wgMessagesDirs['InputBox'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['InputBox'] = $dir . 'InputBox.i18n.php';
+$wgExtensionMessagesFiles['InputBox'] = __DIR__ . '/InputBox.i18n.php';
// Register auto load for the special page class
-$wgAutoloadClasses['InputBoxHooks'] = $dir . 'InputBox.hooks.php';
-$wgAutoloadClasses['InputBox'] = $dir . 'InputBox.classes.php';
+$wgAutoloadClasses['InputBoxHooks'] = __DIR__ . '/InputBox.hooks.php';
+$wgAutoloadClasses['InputBox'] = __DIR__ . '/InputBox.classes.php';
// Register parser hook
$wgHooks['ParserFirstCallInit'][] = 'InputBoxHooks::register';
$wgHooks['MediaWikiPerformAction'][] =
'InputBoxHooks::onMediaWikiPerformAction';
$wgHooks['SpecialPageBeforeExecute'][] =
'InputBoxHooks::onSpecialPageBeforeExecute';
-$wgResourceModules['ext.inputBox.styles'] = array(
- 'localBasePath' => dirname( __FILE__ ) . '/resources',
- 'remoteExtPath' => 'InputBox/resources',
+$resourcePaths = array(
+ 'localBasePath' => __DIR__ . '/resources',
+ 'remoteExtPath' => 'InputBox/resources'
+);
+
+$wgResourceModules['ext.inputBox.styles'] = $resourcePaths + array(
'styles' => 'ext.inputBox.styles.css',
);
-$resourcePaths = array(
- 'localBasePath' => __DIR__,
- 'remoteExtPath' => 'InputBox'
- );
-$wgResourceModules['ext.inputBox'] = array(
- 'scripts' => 'resources/ext.inputBox.js',
+
+$wgResourceModules['ext.inputBox'] = $resourcePaths + array(
+ 'scripts' => 'ext.inputBox.js',
'dependencies' => array(
'jquery.throttle-debounce'
)
-) + $resourcePaths;
+);
+
+unset( $resourcePaths );
--
To view, visit https://gerrit.wikimedia.org/r/164729
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I19334e84c4cd065324f45005a61c525271a9a769
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/InputBox
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits