Ananay has uploaded a new change for review.
https://gerrit.wikimedia.org/r/262740
Change subject: Convert MobileApp extension to use extension.json
......................................................................
Convert MobileApp extension to use extension.json
Bug: T88056
Change-Id: Ife8101919ebcb168addfb3b43885a696751b7391
---
M MobileApp.php
A extension.json
2 files changed, 84 insertions(+), 67 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileApp
refs/changes/40/262740/1
diff --git a/MobileApp.php b/MobileApp.php
index 978fc94..58c31f0 100644
--- a/MobileApp.php
+++ b/MobileApp.php
@@ -8,72 +8,11 @@
* @copyright © 2014 Yuvi Panda
* @licence GNU General Public Licence 2.0 or later
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- echo( "This is an extension to the MediaWiki package and cannot be run
standalone.\n" );
- die( -1 );
+
+if ( function_exists( 'wfLoadExtension' ) ) {
+ wfLoadExtension( 'MobileApp' );
+ $wgMessagesDirs['MobileApp'] = __DIR__ . '/i18n';
+} else {
+ die( 'This version of the MobileApp extension requires MediaWiki 1.25+'
);
}
-$localBasePath = __DIR__;
-$remoteExtPath = 'MobileApp';
-
-// Extension credits that will show up on Special:Version
-$wgExtensionCredits['other'][] = array(
- 'path' => __FILE__,
- 'name' => 'MobileApp',
- 'author' => array( 'Yuvi Panda' ),
- 'url' => 'https://www.mediawiki.org/wiki/Extension:MobileApp',
- 'descriptionmsg' => 'mobileapp-desc',
- 'license-name' => 'GPL-2.0+',
-);
-
-$wgMessagesDirs['MobileApp'] = __DIR__ . "/i18n";
-
-$wgAutoloadClasses['MobileAppResourceLoaderModule'] = __DIR__ .
'/MobileAppResourceLoaderModule.php';
-$wgAutoloadClasses['MobileAppHooks'] = __DIR__ . '/MobileApp.hooks.php';
-
-$wgHooks['ListDefinedTags'][] = 'MobileAppHooks::onListDefinedTags';
-$wgHooks['ChangeTagsListActive'][] = 'MobileAppHooks::onListDefinedTags';
-$wgHooks['RecentChange_save'][] = 'MobileAppHooks::onRecentChange_save';
-
-$wgResourceModules['mobile.app.site'] = array( 'class' =>
'MobileAppResourceLoaderModule' );
-
-$wgCommonMobileAppModuleDef = array(
- 'localBasePath' => $localBasePath,
- 'remoteExtPath' => $remoteExtPath
-);
-
-$wgResourceModules['mobile.app.pagestyles.android'] = array(
- 'styles' => array(
- 'styles/android.less',
- 'styles/editlinks.less',
- 'styles/issues.less',
- 'styles/disambig.less',
- 'styles/tables.less',
- 'styles/ipa.less',
- 'styles/enwiki.less',
- 'styles/parsoid.less',
- 'styles/widenImages.less'
- )
-) + $wgCommonMobileAppModuleDef;
-
-$wgResourceModules['mobile.app.pagestyles.android.night'] = array(
- 'styles' => array(
- 'styles/night.less',
- )
-) + $wgCommonMobileAppModuleDef;
-
-$wgResourceModules['mobile.app.pagestyles.ios'] = array(
- 'styles' => array(
- 'styles/editlinks.less',
- 'styles/enwiki.less',
- 'styles/issues.less',
- 'styles/disambig.less'
- )
-) + $wgCommonMobileAppModuleDef;
-
-$wgResourceModules['mobile.app.preview'] = array(
- 'styles' => array(
- 'styles/preview.less',
- 'styles/enwiki.less'
- )
-) + $wgCommonMobileAppModuleDef;
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..42ef58c
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,78 @@
+{
+ "name": "MobileApp",
+ "author": [
+ "Yuvi Panda"
+ ],
+ "url": "https://www.mediawiki.org/wiki/Extension:MobileApp",
+ "descriptionmsg": "mobileapp-desc",
+ "license-name": "GPL-2.0+",
+ "type": "other",
+ "MessagesDirs": {
+ "MobileApp": [
+ "i18n"
+ ]
+ },
+ "AutoloadClasses": {
+ "MobileAppResourceLoaderModule":
"MobileAppResourceLoaderModule.php",
+ "MobileAppHooks": "MobileApp.hooks.php"
+ },
+ "ResourceModules": {
+ "mobile.app.site": {
+ "class": "MobileAppResourceLoaderModule"
+ },
+ "mobile.app.pagestyles.android": {
+ "styles": [
+ "styles/android.less",
+ "styles/editlinks.less",
+ "styles/issues.less",
+ "styles/disambig.less",
+ "styles/tables.less",
+ "styles/ipa.less",
+ "styles/enwiki.less",
+ "styles/parsoid.less",
+ "styles/widenImages.less"
+ ]
+ },
+ "mobile.app.pagestyles.android.night": {
+ "styles": [
+ "styles/night.less"
+ ]
+ },
+ "mobile.app.pagestyles.ios": {
+ "styles": [
+ "styles/editlinks.less",
+ "styles/enwiki.less",
+ "styles/issues.less",
+ "styles/disambig.less"
+ ]
+ },
+ "mobile.app.preview": {
+ "styles": [
+ "styles/preview.less",
+ "styles/enwiki.less"
+ ]
+ }
+ },
+ "ResourceFileModulePaths": {
+ "localBasePath": "",
+ "remoteExtPath": "MobileApp"
+ },
+ "Hooks": {
+ "ListDefinedTags": [
+ "MobileAppHooks::onListDefinedTags"
+ ],
+ "ChangeTagsListActive": [
+ "MobileAppHooks::onListDefinedTags"
+ ],
+ "RecentChange_save": [
+ "MobileAppHooks::onRecentChange_save"
+ ]
+ },
+ "config": {
+ "CommonMobileAppModuleDef": {
+ "localBasePath":
"/Users/ananayarora/Documents/www/gci/extensions/MobileApp",
+ "remoteExtPath": "MobileApp"
+ }
+ },
+ "manifest_version": 1
+}
--
To view, visit https://gerrit.wikimedia.org/r/262740
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife8101919ebcb168addfb3b43885a696751b7391
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileApp
Gerrit-Branch: master
Gerrit-Owner: Ananay <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits