jenkins-bot has submitted this change and it was merged.
Change subject: Bug 48485: Stop mobile leaking into Special:Nearby on desktop
......................................................................
Bug 48485: Stop mobile leaking into Special:Nearby on desktop
Shuffle around dependencies.
Init watch star module in initialize function
Change-Id: I0c33637d491ac5d436c30a0a958ea5ecb9b86226
---
M MobileFrontend.php
M includes/skins/SkinMinerva.php
M includes/specials/SpecialNearby.php
A javascripts/specials/nearby-watchstar.js
M javascripts/specials/nearby.js
5 files changed, 43 insertions(+), 17 deletions(-)
Approvals:
awjrichards: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/MobileFrontend.php b/MobileFrontend.php
index 234b2a3..b78bc93 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -301,17 +301,26 @@
'class' => 'MFResourceLoaderModule',
);
+$wgResourceModules['mobile.beta.common'] = $wgMFMobileResourceBoilerplate +
array(
+ 'dependencies' => array(
+ 'mobile.beta.plumbing',
+ 'mobile.stable.common',
+ ),
+ 'scripts' => array(
+ 'javascripts/common/history-beta.js',
+ 'javascripts/views/page.js',
+ 'javascripts/common/application-beta.js',
+ ),
+);
+
$wgResourceModules['mobile.beta'] = $wgMFMobileResourceBoilerplate + array(
'dependencies' => array(
'mobile.stable',
- 'mobile.beta.plumbing',
+ 'mobile.beta.common',
),
'scripts' => array(
'javascripts/modules/mf-languages.js',
- 'javascripts/common/history-beta.js',
- 'javascripts/views/page.js',
'javascripts/modules/mf-toggle-dynamic.js',
- 'javascripts/common/application-beta.js',
),
'position' => 'bottom',
'messages' => array(
@@ -411,7 +420,7 @@
),
);
-$wgResourceModules['mobile.notifications'] = $wgMFMobileResourceBoilerplate +
array(
+$wgResourceModules['mobile.notifications.styles'] =
$wgMFMobileResourceBoilerplate + array(
'styles' => array(
'stylesheets/common/notifications.css',
),
@@ -431,11 +440,12 @@
);
// Important: This module is loaded on both mobile and desktop skin
-$wgResourceModules['mobile.stable.universal'] = $wgMFMobileResourceBoilerplate
+ array(
+$wgResourceModules['mobile.stable.common'] = $wgMFMobileResourceBoilerplate +
array(
'dependencies' => array(
'mobile.startup',
'mobile.stable.dependencies',
- 'mobile.notifications',
+ 'mobile.notifications.styles',
+ 'mediawiki.jqueryMsg',
),
'scripts' => array(
'javascripts/externals/hogan.js',
@@ -460,9 +470,8 @@
$wgResourceModules['mobile.stable'] = $wgMFMobileResourceBoilerplate + array(
'dependencies' => array(
- 'mediawiki.jqueryMsg',
'mobile.startup',
- 'mobile.stable.universal',
+ 'mobile.stable.common',
'mediawiki.util',
'mobile.stable.styles',
),
@@ -624,12 +633,21 @@
),
);
+$wgResourceModules['mobile.nearby.watchstar'] = $wgMFMobileResourceBoilerplate
+ array(
+ 'dependencies' => array(
+ 'mobile.nearby.scripts',
+ 'mobile.stable',
+ ),
+ 'scripts' => array(
+ 'javascripts/specials/nearby-watchstar.js',
+ ),
+);
+
$wgResourceModules['mobile.nearby.scripts'] = $wgMFMobileResourceBoilerplate +
array(
'dependencies' => array(
'mobile.nearby.plumbing',
- 'mobile.stable',
'jquery.json',
- 'mobile.beta',
+ 'mobile.beta.common',
),
'messages' => array(
'mobile-frontend-nearby-error',
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 5b2ab6b..6b0b4d9 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -18,7 +18,7 @@
parent::initPage( $out );
$modules = array(
'mobile.startup',
- 'mobile.stable.universal',
+ 'mobile.stable.common',
);
$out->addModules( $modules );
$out->addJsConfigVars( $this->getSkinConfigVariables() );
diff --git a/includes/specials/SpecialNearby.php
b/includes/specials/SpecialNearby.php
index 3ceeb41..ea774c7 100644
--- a/includes/specials/SpecialNearby.php
+++ b/includes/specials/SpecialNearby.php
@@ -13,6 +13,9 @@
$ctx = MobileContext::singleton();
if ( $ctx->shouldDisplayMobileView() &&
$ctx->isBetaGroupMember() ) {
$output->addModules( 'mobile.nearby.previews' );
+ if ( $ctx->isAlphaGroupMember() ) {
+ $output->addModules( 'mobile.nearby.watchstar'
);
+ }
};
$output->setPageTitle( wfMessage(
'mobile-frontend-nearby-title' )->escaped() );
diff --git a/javascripts/specials/nearby-watchstar.js
b/javascripts/specials/nearby-watchstar.js
new file mode 100644
index 0000000..510bac8
--- /dev/null
+++ b/javascripts/specials/nearby-watchstar.js
@@ -0,0 +1,9 @@
+( function( M ) {
+var nearby = M.require( 'nearby' ),
+ watchstar = M.require( 'watchstar' );
+
+nearby.overlay.on( 'postRender', function( $el ) {
+ watchstar.initWatchListIconList( $el.find( 'ul' ) );
+} );
+
+}( mw.mobileFrontend ) );
diff --git a/javascripts/specials/nearby.js b/javascripts/specials/nearby.js
index b38c29c..ac187cc 100644
--- a/javascripts/specials/nearby.js
+++ b/javascripts/specials/nearby.js
@@ -4,7 +4,6 @@
( function() {
var supported = M.supportsGeoLocation(),
- watchstar = M.require( 'watchstar' ),
popup = M.require( 'notifications' ),
nav = M.require( 'navigation' ),
View = M.require( 'view' ),
@@ -13,7 +12,6 @@
lastKnownLocation = M.settings.getUserSetting(
CACHE_KEY_LAST_LOCATION ),
cache = M.settings.saveUserSetting,
lastSearchResult = M.settings.getUserSetting( CACHE_KEY_RESULTS
),
- inAlpha = mw.config.get( 'wgMFMode' ) === 'alpha', // FIXME:
sandbox before pushing nearby to stable
Nearby = View.extend( {
template: M.template.get( 'articleList' ),
initialize: function() {
@@ -23,9 +21,7 @@
$.cookie( 'mwUploadsFunnel', 'nearby',
{ expires: new Date( new Date().getTime() + 60000) } );
self.emit( 'page-click', ev );
} );
- if ( inAlpha ) {
- watchstar.initWatchListIconList(
this.$( 'ul' ) );
- }
+ self.emit( 'postRender', this.$el );
}
} ),
pendingQuery = false, btn, menu,
--
To view, visit https://gerrit.wikimedia.org/r/63863
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0c33637d491ac5d436c30a0a958ea5ecb9b86226
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: awjrichards <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits