Nikerabbit has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/389927 )
Change subject: Convert to extension registration
......................................................................
Convert to extension registration
Change-Id: Ie0354ec44649d0225b151c0f2069fb3775ec8fc7
---
A Hooks.php
M MixedNamespaceSearchSuggestions.php
D Resources.php
A extension.json
4 files changed, 47 insertions(+), 45 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MixedNamespaceSearchSuggestions
refs/changes/27/389927/1
diff --git a/Hooks.php b/Hooks.php
new file mode 100644
index 0000000..24c0e7f
--- /dev/null
+++ b/Hooks.php
@@ -0,0 +1,11 @@
+<?php
+/**
+ * @author Niklas Laxström
+ * @license MIT
+ */
+
+class MixedNamespaceSearchSuggestionsHooks {
+ public function onBeforePageDisplay ( OutputPage $out ) {
+ $out->addModules( 'ext.mnss.search' );
+ }
+}
diff --git a/MixedNamespaceSearchSuggestions.php
b/MixedNamespaceSearchSuggestions.php
index 83df25a..f9971a0 100644
--- a/MixedNamespaceSearchSuggestions.php
+++ b/MixedNamespaceSearchSuggestions.php
@@ -1,28 +1,3 @@
<?php
-/**
- * @author Niklas Laxström
- * @license MIT
- */
-if ( !defined( 'MEDIAWIKI' ) ) {
- die();
-}
-
-$wgExtensionCredits['other'][] = [
- 'path' => __FILE__,
- 'name' => 'MixedNamespaceSearchSuggestions',
- 'version' => '2015-12-04',
- 'author' => 'Niklas Laxström',
- 'descriptionmsg' => 'mnss-desc',
- 'url' =>
'https://www.mediawiki.org/wiki/Extension:MixedNamespaceSearchSuggestions',
- 'license-name' => 'MIT',
-];
-
-$dir = __DIR__;
-require_once "$dir/Resources.php";
-
-$wgMessagesDirs['MNSS'] = "$dir/i18n";
-
-$wgHooks['BeforePageDisplay'][] = function ( OutputPage $out ) {
- $out->addModules( 'ext.mnss.search' );
-};
+wfLoadExtension( 'MixedNamespaceSearchSuggestions' );
diff --git a/Resources.php b/Resources.php
deleted file mode 100644
index 9f58037..0000000
--- a/Resources.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-/**
- * @author Niklas Laxström
- * @license MIT
- */
-
-$resourcePaths = [
- 'localBasePath' => __DIR__,
- 'remoteExtPath' => 'MixedNamespaceSearchSuggestions'
-];
-
-$wgResourceModules['ext.mnss.search'] = [
- 'styles' => 'resources/ext.mnss.search.less',
- 'scripts' => 'resources/ext.mnss.search.js',
- 'dependencies' => [
- 'mediawiki.searchSuggest',
- 'mediawiki.Title',
- ],
-] + $resourcePaths;
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..9498644
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,35 @@
+{
+ "name": "MixedNamespaceSearchSuggestions",
+ "version": "2017-11-08",
+ "author": "Niklas Laxström",
+ "url":
"https://www.mediawiki.org/wiki/Extension:MixedNamespaceSearchSuggestions",
+ "descriptionmsg": "mnss-desc",
+ "license-name": "MIT",
+ "type": "other",
+ "Hooks": {
+ "BeforePageDisplay":
"MixedNamespaceSearchSuggestionsHooks::onBeforePageDisplay"
+ },
+ "MessagesDirs": {
+ "MNSS": [
+ "i18n"
+ ]
+ },
+ "AutoloadClasses": {
+ "MixedNamespaceSearchSuggestionsHooks": "Hooks.php"
+ },
+ "ResourceModules": {
+ "ext.mnss.search": {
+ "styles": "resources/ext.mnss.search.less",
+ "scripts": "resources/ext.mnss.search.js",
+ "dependencies": [
+ "mediawiki.searchSuggest",
+ "mediawiki.Title"
+ ]
+ }
+ },
+ "ResourceFileModulePaths": {
+ "localBasePath": "",
+ "remoteExtPath": "MixedNamespaceSearchSuggestions"
+ },
+ "manifest_version": 2
+}
--
To view, visit https://gerrit.wikimedia.org/r/389927
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0354ec44649d0225b151c0f2069fb3775ec8fc7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MixedNamespaceSearchSuggestions
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits