Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/193015
Change subject: Hijack watchstar behaviour in alpha
......................................................................
Hijack watchstar behaviour in alpha
Note: This doesn't override search watchstar. Not sure how best
to do that.
Dependency: I00d83f28f88cd3ae63a0858b7b48c5765fe35c20
Change-Id: Iac6df0166e12a19acbce44aa23f201ce4e050ce8
---
M Gather.php
M includes/Gather.hooks.php
M includes/Resources.php
A resources/ext.gather.watchstar/init.js
4 files changed, 14 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather
refs/changes/15/193015/1
diff --git a/Gather.php b/Gather.php
index 87bd2eb..a0fd271 100644
--- a/Gather.php
+++ b/Gather.php
@@ -72,6 +72,7 @@
$wgHooks['MobilePersonalTools'][] = 'Gather\Hooks::onMobilePersonalTools';
$wgHooks['UnitTestsList'][] = 'Gather\Hooks::onUnitTestsList';
$wgHooks['getUserPermissionsErrors'][] =
'Gather\Hooks::onGetUserPermissionsErrors';
+$wgHooks['SkinMinervaDefaultModules'][] =
'Gather\Hooks::onSkinMinervaDefaultModules';
// ResourceLoader modules
require_once __DIR__ . "/includes/Resources.php";
diff --git a/includes/Gather.hooks.php b/includes/Gather.hooks.php
index 143b023..b7e15eb 100644
--- a/includes/Gather.hooks.php
+++ b/includes/Gather.hooks.php
@@ -26,6 +26,13 @@
die( -1 );
}
}
+
+ public static function onSkinMinervaDefaultModules( $skin, &$modules ) {
+ if ( MobileContext::singleton()->isAlphaGroupMember() ) {
+ $modules['watch'] = array( 'ext.gather.watchstar' );
+ }
+ return true;
+ }
/**
* Add collections link in personal tools menu
* @param array &$items Items array to be added to menu
diff --git a/includes/Resources.php b/includes/Resources.php
index 07c419a..d240a2f 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -76,4 +76,9 @@
'group' => 'other',
),
+ 'ext.gather.watchstar' => $wgGatherResourceFileModuleBoilerplate +
array(
+ 'scripts' => array(
+ 'ext.gather.watchstar/init.js',
+ ),
+ ),
) );
diff --git a/resources/ext.gather.watchstar/init.js
b/resources/ext.gather.watchstar/init.js
new file mode 100644
index 0000000..ba036e5
--- /dev/null
+++ b/resources/ext.gather.watchstar/init.js
@@ -0,0 +1 @@
+alert('HAHA!');
--
To view, visit https://gerrit.wikimedia.org/r/193015
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac6df0166e12a19acbce44aa23f201ce4e050ce8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits