Yaron Koren has submitted this change and it was merged.
Change subject: Added extension registration via extension.json
......................................................................
Added extension registration via extension.json
Change-Id: I3e10e62677dfafbcb3a8e7968c664894840e0397
---
M HeaderTabs.php
A extension.json
2 files changed, 102 insertions(+), 22 deletions(-)
Approvals:
Yaron Koren: Checked; Looks good to me, approved
jenkins-bot: Verified
diff --git a/HeaderTabs.php b/HeaderTabs.php
index bee19c5..7c7cbde 100644
--- a/HeaderTabs.php
+++ b/HeaderTabs.php
@@ -10,18 +10,34 @@
* @author Olivier Finlay Beaton
*/
-if ( !defined( 'MEDIAWIKI' ) ) die();
+if ( !defined( 'MEDIAWIKI' ) ) {
+ die();
+}
+
+$dir = dirname( __FILE__ );
+$wgHeaderTabsScriptPath = $wgScriptPath . "/extensions/HeaderTabs";
+
+if ( function_exists( 'wfLoadExtension' ) ) {
+ wfLoadExtension( 'HeaderTabs' );
+ // Keep i18n globals so mergeMessageFileList.php doesn't break
+ $wgMessagesDirs['HeaderTabs'] = $dir . '/i18n';
+ $wgExtensionMessagesFiles['HeaderTabsMagic'] = $dir .
'/HeaderTabs.i18n.magic.php';
+ /* wfWarn(
+ 'Deprecated PHP entry point used for Semanti Forms extension.
Please use wfLoadExtension instead, ' .
+ 'see https://www.mediawiki.org/wiki/Extension_registration for
more details.'
+ ); */
+ return;
+}
+
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'Header Tabs',
'descriptionmsg' => 'headertabs-desc',
- 'version' => '1.0.2',
+ 'version' => '1.1-alpha',
'author' => array( '[http://www.sergeychernyshev.com Sergey
Chernyshev]', 'Yaron Koren', '[http://olivierbeaton.com Olivier Finlay Beaton]'
),
'url' => 'https://www.mediawiki.org/wiki/Extension:Header_Tabs'
);
-
-$dir = dirname( __FILE__ );
// Translations
$wgMessagesDirs['HeaderTabs'] = $dir . '/i18n';
@@ -35,7 +51,6 @@
$wgExtensionMessagesFiles['HeaderTabsMagic'] = $dir .
'/HeaderTabs.i18n.magic.php';
// Config
-$wgHeaderTabsScriptPath = $wgScriptPath . "/extensions/HeaderTabs";
$wgHeaderTabsUseHistory = true;
$wgHeaderTabsRenderSingleTab = false;
$wgHeaderTabsAutomaticNamespaces = array();
@@ -56,23 +71,23 @@
* @since 2011-09-22, 0.2
*/
$wgConfigureAdditionalExtensions[] = array(
- 'name' => 'HeaderTabs',
- 'settings' => array(
- 'wgHeaderTabsUseHistory' => 'bool',
- 'wgHeaderTabsRenderSingleTab' => 'bool',
- 'wgHeaderTabsAutomaticNamespaces' =>
'array',
- 'wgHeaderTabsDefaultFirstTab' =>
'string',
- 'wgHeaderTabsDisableDefaultToc' =>
'bool',
- 'wgHeaderTabsGenerateTabTocs' => 'bool',
- 'wgHeaderTabsStyle' => 'string',
- 'wgHeaderTabsEditTabLink' => 'bool',
- ),
- 'array' => array(
- 'wgHeaderTabsAutomaticNamespaces' =>
'simple',
- ),
- 'schema' => false,
- 'url' =>
'https://www.mediawiki.org/wiki/Extension:Header_Tabs',
- );
+ 'name' => 'HeaderTabs',
+ 'settings' => array(
+ 'wgHeaderTabsUseHistory' => 'bool',
+ 'wgHeaderTabsRenderSingleTab' => 'bool',
+ 'wgHeaderTabsAutomaticNamespaces' => 'array',
+ 'wgHeaderTabsDefaultFirstTab' => 'string',
+ 'wgHeaderTabsDisableDefaultToc' => 'bool',
+ 'wgHeaderTabsGenerateTabTocs' => 'bool',
+ 'wgHeaderTabsStyle' => 'string',
+ 'wgHeaderTabsEditTabLink' => 'bool',
+ ),
+ 'array' => array(
+ 'wgHeaderTabsAutomaticNamespaces' => 'simple',
+ ),
+ 'schema' => false,
+ 'url' => 'https://www.mediawiki.org/wiki/Extension:Header_Tabs',
+ );
} // $wgConfigureAdditionalExtensions exists
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..c152d02
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,65 @@
+{
+ "name": "Header Tabs",
+ "version": "1.1-alpha",
+ "author": [
+ "[http://www.sergeychernyshev.com Sergey Chernyshev]",
+ "Yaron Koren",
+ "[http://olivierbeaton.com Olivier Finlay Beaton]"
+ ],
+ "url": "https://www.mediawiki.org/wiki/Extension:Header_Tabs",
+ "descriptionmsg": "headertabs-desc",
+ "type": "parserhook",
+ "MessagesDirs": {
+ "HeaderTabs": [
+ "i18n"
+ ]
+ },
+ "ExtensionMessagesFiles": {
+ "HeaderTabsMagic": "HeaderTabs.i18n.magic.php"
+ },
+ "AutoloadClasses": {
+ "HeaderTabsHooks": "HeaderTabs.hooks.php",
+ "HeaderTabs": "HeaderTabs_body.php"
+ },
+ "ResourceModules": {
+ "ext.headertabs": {
+ "scripts": "skins/ext.headertabs.core.js",
+ "dependencies": [
+ "jquery.ui.tabs"
+ ]
+ }
+ },
+ "ResourceFileModulePaths": {
+ "localBasePath": "",
+ "remoteExtPath": "HeaderTabs"
+ },
+ "Hooks": {
+ "ParserFirstCallInit": [
+ "HeaderTabsHooks::registerParserFunctions"
+ ],
+ "BeforePageDisplay": [
+ "HeaderTabsHooks::addHTMLHeader"
+ ],
+ "ParserAfterTidy": [
+ "HeaderTabsHooks::replaceFirstLevelHeaders"
+ ],
+ "ResourceLoaderGetConfigVars": [
+ "HeaderTabsHooks::addConfigVarsToJS"
+ ],
+ "MakeGlobalVariablesScript": [
+ "HeaderTabsHooks::setGlobalJSVariables"
+ ]
+ },
+ "config": {
+ "HeaderTabsUseHistory": true,
+ "HeaderTabsRenderSingleTab": false,
+ "HeaderTabsAutomaticNamespaces": [],
+ "HeaderTabsDefaultFirstTab": false,
+ "HeaderTabsDisableDefaultToc": true,
+ "HeaderTabsGenerateTabTocs": false,
+ "HeaderTabsStyle": "large",
+ "HeaderTabsEditTabLink": true,
+ "HeaderTabsTabIndexes": []
+ },
+ "manifest_version": 1
+}
--
To view, visit https://gerrit.wikimedia.org/r/259878
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3e10e62677dfafbcb3a8e7968c664894840e0397
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/HeaderTabs
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits