jenkins-bot has submitted this change and it was merged.
Change subject: Remove Language and Nearby Beta features
......................................................................
Remove Language and Nearby Beta features
* Language selector as image in beta removed
* Nearby Beat Features removed
Bug: 65907
Change-Id: I6033ed78c9b00fb938241294482f22fa1ed484f5
---
M MobileFrontend.php
M i18n/en.json
D images/BetaFeatures/nearby-ltr.svg
D images/BetaFeatures/nearby-rtl.svg
M includes/MobileFrontend.hooks.php
M includes/Resources.php
M includes/skins/MinervaTemplate.php
M includes/skins/MinervaTemplateBeta.php
M includes/skins/SkinMinervaBeta.php
M includes/specials/SpecialNearby.php
D javascripts/desktop/mobileBridge.js
M javascripts/modules/nearby/Nearby.js
D javascripts/modules/nearby/NearbyOverlay.js
D javascripts/modules/nearby/PagePreviewOverlay.js
D javascripts/modules/nearbypages.js
D less/common/images/secondaryPageActions/geo.png
D less/common/images/secondaryPageActions/languages.png
D less/common/secondaryPageActions.less
D templates/overlays/nearby.hogan
M templates/page.hogan
D tests/browser/features/geonotahack.feature
M tests/browser/features/step_definitions/create_page_api_steps.rb
D tests/browser/features/step_definitions/geonotahack_steps.rb
23 files changed, 7 insertions(+), 469 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MobileFrontend.php b/MobileFrontend.php
index d84afef..c974719 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -484,11 +484,6 @@
$wgMFEnableMinervaBetaFeature = false;
/**
- * Controls whether the "Nearby pages" beta feature is enabled
- */
-$wgMFEnableNearbyPagesBetaFeature = false;
-
-/**
* Controls whether to collapse sections by default.
*
* Leave at default true for "encyclopedia style", where the section 0 lead
text will
diff --git a/i18n/en.json b/i18n/en.json
index 0644aa8..2dab99d 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -4,8 +4,6 @@
},
"abusefilter-edit-builder-vars-user-mobile": "Whether or not a user is
editing through the mobile interface",
"action-mf-uploadbutton": "use the upload button on mobile pages.",
- "beta-feature-geonotahack": "Near this page",
- "beta-feature-geonotahack-description": "Discover pages which are
geographically nearby to the content page you are currently reading.",
"beta-feature-minerva": "Enable mobile skin ({{int:skinname-minerva}}) on
desktop",
"beta-feature-minerva-description": "Make the skin used on mobile devices
a selectable desktop skin under the \"{{int:prefs-rendering}}\" preferences
tab.",
"mobile-frontend-account-create-captcha-placeholder": "Enter confirmation
code",
@@ -111,7 +109,6 @@
"mobile-frontend-generic-login": "{{SITENAME}} is made by people like
you.",
"mobile-frontend-generic-login-action": "Log in to contribute.",
"mobile-frontend-generic-signup-action": "Sign up to contribute.",
- "mobile-frontend-geonotahack": "Near this page",
"mobile-frontend-history": "View edit history of this page.",
"mobile-frontend-history-404-desc": "Cannot look at history for a page
that doesn't exist. It may have been deleted or you may have followed a bad
link.",
"mobile-frontend-history-404-title": "No such page",
@@ -173,12 +170,10 @@
"mobile-frontend-meta-data-issues-header": "Issues",
"mobile-frontend-meta-data-issues-header-talk": "About this page",
"mobile-frontend-missing-image": "Image",
- "mobile-frontend-nearby-directions": "Navigate here",
"mobile-frontend-nearby-distance": "{{PLURAL:$1|$1 km}}",
"mobile-frontend-nearby-distance-meters": "{{PLURAL:$1|$1 m}}",
"mobile-frontend-nearby-error": "{{SITENAME}} Nearby is having some
issues.",
"mobile-frontend-nearby-error-guidance": "Try refreshing your location.",
- "mobile-frontend-nearby-link": "Read this page in full",
"mobile-frontend-nearby-loading": "Loading topics near your current
location",
"mobile-frontend-nearby-lookup-ui-error": "{{SITENAME}} Nearby can't
figure out where you are... try again?",
"mobile-frontend-nearby-lookup-ui-error-guidance": "Try an open area with
a better signal.",
@@ -190,7 +185,6 @@
"mobile-frontend-nearby-requirements": "Sorry! Your web browser doesn't
support {{SITENAME}} Nearby.",
"mobile-frontend-nearby-requirements-guidance": "Try a different browser
or enable JavaScript if you've disabled it.",
"mobile-frontend-nearby-title": "Nearby",
- "mobile-frontend-nearby-to-page": "Near $1:",
"mobile-frontend-news-items": "In the news",
"mobile-frontend-off": "OFF",
"mobile-frontend-on": "ON",
diff --git a/images/BetaFeatures/nearby-ltr.svg
b/images/BetaFeatures/nearby-ltr.svg
deleted file mode 100644
index edd625c..0000000
--- a/images/BetaFeatures/nearby-ltr.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg"
width="264" height="162" viewBox="0, 0, 264, 162"><g><path d="M24.833
151.362l-11.467 9.995-12.866-9.608v-151.249h263v151.749l-9
6.705v-116.454h-39v112.6l-4.393-3.73-7.607 5.33v-114.2h-155v110.849l-9.751
8.031-13.916-10.018zm0 0" fill="#fff"/><path d="M263 1v150.998l-8
5.96v-115.958h-40v112.019l-3.274-2.778-.589-.499-.633.439-6.504
4.557v-113.738h-156v111.099l-9.257 7.661-13.295-9.568-.644-.466-.598.521-10.864
9.47-12.342-9.218v-150.499h262zm1-1h-264v152l13.391 10 11.473-10 13.891 10
10.245-8.4v-110.6h154v114.66l8.078-5.66 4.922
4.18v-113.18h38v116.95l10-7.45v-152.5zm0 0M203 43h-154v110.6l2.145-1.6 12.555
10 13.809-10 14.229 10 12.972-10 12.973 10 13.811-10 12.136 10 13.392-10 14.229
10 12.972-10 12.975 10 5.804-4.34v-114.66h-.002zm0 0M11 36c0-7.732 6.268-14
14-14s14 6.268 14 14-6.268 14-14 14-14-6.268-14-14zm0 0" fill="#E4E4E4"/><path
d="M224.738 162l12.972-10 12.974 10 3.316-2.401v-116.599h-38v112.859z"
fill="#F1F1F1"/><path d="M38 107v-35h-25v35h25zm0 0M232.51 5h26v6h-26v-6zm0
0M208.51 5v6h22v-6h-22zm0 0M142 6v4h-92v-4h92zm1-1h-94v6h94v-6zm0 0M184.51
5v6h22v-6h-22zm0 0M161.51 5v6h13v-6h-13zm0 0M176.51 5v6h6v-6h-6zm0 0M153.51
5v6h6v-6h-6zm0 0M9 5v6h32v-6h-32zm0 0" fill="#E4E4E4"/><path d="M2 14.5h260"
stroke="#E4E4E4" stroke-miterlimit="10" fill="none"/><path d="M52
7v2h2v-2h-2zm0 0M13 54h25v5h-25v-5zm0 0" fill="#E4E4E4"/><path d="M141
16h58v59h-58v-59zm0 0" fill="#1480F7"/><path d="M179.005
34.506c-4.69-4.7-12.27-4.663-16.96.038-4.69 4.7-4.725 12.312-.034 17.012l8.475
8.444 8.493-8.511c4.691-4.7 4.716-12.282.026-16.983zm-8.495 13.494c-3.313
0-6-2.462-6-5.5s2.687-5.5 6-5.5c3.314 0 6 2.462 6 5.5s-2.686 5.5-6 5.5zm0 0"
fill="#fff"/></g></svg>
\ No newline at end of file
diff --git a/images/BetaFeatures/nearby-rtl.svg
b/images/BetaFeatures/nearby-rtl.svg
deleted file mode 100644
index 56bb45a..0000000
--- a/images/BetaFeatures/nearby-rtl.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg"
width="264" height="162" viewBox="0, 0, 264, 162"><g><path d="M239.167
151.362l11.467 9.995 12.866-9.608v-151.249h-263v151.749l9
6.705v-116.454h39v112.6l4.393-3.73 7.607 5.33v-114.2h155v110.849l9.751 8.031
13.916-10.018zm0 0" fill="#fff"/><path d="M1 1v150.998l8
5.96v-115.958h40v112.019l3.274-2.778.589-.499.633.439 6.504
4.557v-113.738h156v111.099l9.257 7.661 13.295-9.568.644-.466.598.521 10.864
9.47 12.342-9.218v-150.499h-262zm-1-1h264v152l-13.391 10-11.473-10-13.891
10-10.245-8.4v-110.6h-154v114.66l-8.078-5.66-4.922
4.18v-113.18h-38v116.95l-10-7.45v-152.5zm0 0M61 43h154v110.6l-2.145-1.6-12.555
10-13.809-10-14.229 10-12.972-10-12.973 10-13.811-10-12.136 10-13.392-10-14.229
10-12.972-10-12.975 10-5.804-4.34v-114.66h.002zm0 0M253
36c0-7.732-6.268-14-14-14s-14 6.268-14 14 6.268 14 14 14 14-6.268 14-14zm0 0"
fill="#E4E4E4"/><path d="M39.262 162l-12.972-10-12.974
10-3.316-2.401v-116.599h38v112.859z" fill="#F1F1F1"/><path d="M226
107v-35h25v35h-25zm0 0M31.49 5h-26v6h26v-6zm0 0M55.49 5v6h-22v-6h22zm0 0M122
6v4h92v-4h-92zm-1-1h94v6h-94v-6zm0 0M79.49 5v6h-22v-6h22zm0 0M102.49
5v6h-13v-6h13zm0 0M87.49 5v6h-6v-6h6zm0 0M110.49 5v6h-6v-6h6zm0 0M255
5v6h-32v-6h32zm0 0" fill="#E4E4E4"/><path d="M262 14.5h-260" stroke="#E4E4E4"
stroke-miterlimit="10" fill="none"/><path d="M212 7v2h-2v-2h2zm0 0M251
54h-25v5h25v-5zm0 0" fill="#E4E4E4"/><path d="M123 16h-58v59h58v-59zm0 0"
fill="#1480F7"/><path d="M84.995 34.506c4.69-4.7 12.27-4.663 16.96.038 4.69 4.7
4.725 12.312.034 17.012l-8.475
8.444-8.493-8.511c-4.691-4.7-4.716-12.282-.026-16.983zm8.495 13.494c3.313 0
6-2.462 6-5.5s-2.687-5.5-6-5.5c-3.314 0-6 2.462-6 5.5s2.686 5.5 6 5.5zm0 0"
fill="#fff"/></g></svg>
\ No newline at end of file
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 12a82e8..7cec1de 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -543,8 +543,7 @@
* @return bool
*/
public static function onBeforePageDisplay( &$out, &$sk ) {
- global $wgMFEnableXAnalyticsLogging, $wgMFAppPackageId,
$wgMFAppScheme,
- $wgMFEnableNearbyPagesBetaFeature;
+ global $wgMFEnableXAnalyticsLogging, $wgMFAppPackageId,
$wgMFAppScheme;
wfProfileIn( __METHOD__ );
$context = MobileContext::singleton();
@@ -574,15 +573,6 @@
}
if ( !$context->shouldDisplayMobileView() ) {
- if ( class_exists( 'BetaFeatures' ) &&
- $wgMFEnableNearbyPagesBetaFeature &&
- BetaFeatures::isFeatureEnabled(
$out->getSkin()->getUser(), 'betafeatures-geonotahack' ) ) {
- // @todo FIXME: Remove need for this module
- $out->addModules( array( 'mobile.bridge' ) );
- // @todo FIXME: Find better way to deal with
wgMFMode in desktop
- // (maybe standardise BetaFeatures to use the
same variable).
- $out->addJsConfigVars( 'wgMFMode',
'desktop-beta' );
- }
wfProfileOut( __METHOD__);
return true;
}
@@ -675,24 +665,7 @@
* @return bool
*/
public static function onGetBetaFeaturePreferences( $user,
&$preferences ) {
- global $wgExtensionAssetsPath, $wgMFNearby,
$wgMFEnableMinervaBetaFeature,
- $wgMFEnableNearbyPagesBetaFeature;
-
- if ( $wgMFNearby && $wgMFEnableNearbyPagesBetaFeature ) {
- $preferences['betafeatures-geonotahack'] = array(
- 'requirements' => array(
- 'skins' => array( 'vector' ),
- ),
- 'label-message' => 'beta-feature-geonotahack',
- 'desc-message' =>
'beta-feature-geonotahack-description',
- 'info-link' =>
'//www.mediawiki.org/wiki/Beta_Features/Nearby_Pages',
- 'discussion-link' =>
'//www.mediawiki.org/wiki/Talk:Beta_Features/Nearby_Pages',
- 'screenshot' => array(
- 'ltr' =>
"$wgExtensionAssetsPath/MobileFrontend/images/BetaFeatures/nearby-ltr.svg",
- 'rtl' =>
"$wgExtensionAssetsPath/MobileFrontend/images/BetaFeatures/nearby-rtl.svg",
- ),
- );
- }
+ global $wgExtensionAssetsPath, $wgMFEnableMinervaBetaFeature;
if ( $wgMFEnableMinervaBetaFeature ) {
// Enable the mobile skin on desktop
diff --git a/includes/Resources.php b/includes/Resources.php
index 27e1c2c..50707bf 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -35,19 +35,6 @@
'targets' => array( 'mobile', 'desktop' ),
),
- // @todo FIXME: Remove need for this module
- // Mobile Bridge - Tweaks the desktop UI so mobile code can run on it
- 'mobile.bridge' => $wgMFMobileResourceBoilerplate + array(
- 'skinStyles' => array(
- 'vector' => array(
- 'less/desktop/mobileBridge.less',
- ),
- ),
- 'scripts' => array(
- 'javascripts/desktop/mobileBridge.js',
- ),
- ),
-
'mobile.file.scripts' => $wgMFMobileResourceBoilerplate + array(
'dependencies' => array( 'mobile.startup' ),
'scripts' => array(
@@ -131,7 +118,6 @@
'skins.minerva.chrome.styles.beta' => $wgMFMobileResourceBoilerplate +
array(
'styles' => array(
'less/common/uiNew.less',
- 'less/common/secondaryPageActions.less',
),
'position' => 'top',
),
@@ -414,22 +400,6 @@
'mobile.loggingSchemas',
'mobile.templates',
),
- ),
-
- 'mobile.geonotahack' => $wgMFMobileResourceBoilerplate + array(
- 'dependencies' => array(
- 'mobile.startup',
- 'mobile.loggingSchemas',
- // Needs LoadingOverlay
- 'mobile.stable.common',
- 'mobile.overlays',
- ),
- 'messages' => array(
- 'mobile-frontend-geonotahack',
- ),
- 'scripts' => array(
- 'javascripts/modules/nearbypages.js',
- )
),
'mobile.talk' => $wgMFMobileResourceBoilerplate + array(
@@ -1023,31 +993,6 @@
'vector' => 'less/desktop/special/nearby.less',
'monobook' => 'less/desktop/special/nearby.less',
),
- ),
-
- // @todo FIXME: Merge with mobile.nearby when geonotahack moves to
stable
- 'mobile.special.nearby.beta' => $wgMFMobileResourceBoilerplate + array(
- 'messages' => array(
- // NearbyOverlay.js
- 'mobile-frontend-nearby-to-page',
- 'mobile-frontend-nearby-title',
-
- // PagePreviewOverlay
- 'mobile-frontend-nearby-directions',
- 'mobile-frontend-nearby-link',
- ),
- 'templates' => array(
- 'overlays/nearby.hogan',
- ),
- 'dependencies' => array(
- 'mobile.stable.common',
- 'mobile.nearby',
- 'mobile.beta.common',
- ),
- 'scripts' => array(
- 'javascripts/modules/nearby/PagePreviewOverlay.js',
- 'javascripts/modules/nearby/NearbyOverlay.js',
- )
),
'mobile.special.nearby.scripts' => $wgMFMobileResourceBoilerplate +
array(
diff --git a/includes/skins/MinervaTemplate.php
b/includes/skins/MinervaTemplate.php
index 5adfa8f..dce1a4f 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -7,11 +7,6 @@
* Extended Template class of BaseTemplate for mobile devices
*/
class MinervaTemplate extends BaseTemplate {
- /**
- * @var string $languageButtonClassName Class names of language selector
- * @todo: Remove variable when secondary page actions menu moves to
stable
- */
- protected $languageButtonClassName = 'mw-ui-button mw-ui-progressive
button languageSelector';
/** @var string $searchPlaceHolderMsg Message used as placeholder in
search input */
protected $searchPlaceHolderMsg = 'mobile-frontend-placeholder';
@@ -195,7 +190,7 @@
$languageLabel = wfMessage(
'mobile-frontend-language-article-heading' )->text();
echo Html::element( 'a', array(
- 'class' => $this->languageButtonClassName,
+ 'class' => 'mw-ui-button mw-ui-progressive
button languageSelector',
'href' => $languageUrl
), $languageLabel );
}
diff --git a/includes/skins/MinervaTemplateBeta.php
b/includes/skins/MinervaTemplateBeta.php
index edc3002..cafa440 100644
--- a/includes/skins/MinervaTemplateBeta.php
+++ b/includes/skins/MinervaTemplateBeta.php
@@ -14,14 +14,6 @@
protected $searchPlaceHolderMsg = 'mobile-frontend-placeholder-beta';
/**
- * CSS classes for language button
- * @var string $languageButtonClassName
- * @todo Remove variable when secondary page actions menu moves to
stable
- */
- protected $languageButtonClassName = 'mw-ui-button mw-ui-progressive
button
- languageSelector icon icon-32px';
-
- /**
* Render available page actions
* @param array $data Data used to build page actions
*/
diff --git a/includes/skins/SkinMinervaBeta.php
b/includes/skins/SkinMinervaBeta.php
index 83ea7ee..682d702 100644
--- a/includes/skins/SkinMinervaBeta.php
+++ b/includes/skins/SkinMinervaBeta.php
@@ -77,7 +77,6 @@
$modules['talk'] = array( 'mobile.talk' );
}
$modules['beta'] = array( 'mobile.beta' );
- $modules['beta'][] = 'mobile.geonotahack';
wfRunHooks( 'SkinMinervaDefaultModules', array( $this,
&$modules ) );
return $modules;
}
diff --git a/includes/specials/SpecialNearby.php
b/includes/specials/SpecialNearby.php
index 2584246..a635b97 100644
--- a/includes/specials/SpecialNearby.php
+++ b/includes/specials/SpecialNearby.php
@@ -31,15 +31,8 @@
// set config
$output->addJsConfigVars( 'wgMFNearbyRange', $wgMFNearbyRange );
-
- // add previews to mobile only
- $ctx = MobileContext::singleton();
- if ( $ctx->shouldDisplayMobileView() &&
$ctx->isBetaGroupMember() ) {
- $output->addModules( 'mobile.special.nearby.beta' );
- } else {
- // Only the Minerva skin loads this module so make sure
we load it for desktop
- $output->addModuleStyles( 'mobile.pagelist.styles' );
- }
+ // Only the Minerva skin loads this module so make sure we load
it for desktop
+ $output->addModuleStyles( 'mobile.pagelist.styles' );
$output->setPageTitle( wfMessage(
'mobile-frontend-nearby-title' )->escaped() );
diff --git a/javascripts/desktop/mobileBridge.js
b/javascripts/desktop/mobileBridge.js
deleted file mode 100644
index 3dd9b25..0000000
--- a/javascripts/desktop/mobileBridge.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// The mobile bridge 'decorates' desktop skin so that the environment looks
similar to mobile
-jQuery( function( $ ) {
- // FIXME: Nasty hack so that Overlay's correctly show. Find better way
to make this work.
- $( 'body' ).attr( 'id', 'mw-mf-viewport' );
- $( '<li id="page-secondary-actions">').appendTo( '#p-views ul' );
- mw.loader.using( 'mobile.geonotahack' );
-} );
diff --git a/javascripts/modules/nearby/Nearby.js
b/javascripts/modules/nearby/Nearby.js
index 61e3c78..ec244bb 100644
--- a/javascripts/modules/nearby/Nearby.js
+++ b/javascripts/modules/nearby/Nearby.js
@@ -1,8 +1,5 @@
( function( M, $ ) {
var NearbyApi = M.require( 'modules/nearby/NearbyApi' ),
- MobileWebClickTracking = M.require(
'loggingSchemas/MobileWebClickTracking' ),
- LoadingOverlay = M.require( 'LoadingOverlay' ),
- loader = new LoadingOverlay(),
PageList = M.require( 'modules/PageList' ),
Nearby;
@@ -132,28 +129,10 @@
this._postRenderLinks();
},
_postRenderLinks: function() {
- var self = this;
this.$( 'a' ).on( 'click', function( ev ) {
- var $a = $( ev.currentTarget ),
- title = $a.find( 'h2' ).text();
-
// name funnel for watchlists to catch
subsequent uploads
$.cookie( 'mwUploadsFunnel', 'nearby', {
expires: new Date( new Date().getTime() + 60000) } );
- // Note router support required for page
previews in beta
- if ( !M.isBetaGroupMember() ||
!M.router.isSupported() ) {
- window.location.hash = '#' + $(
ev.currentTarget ).attr( 'name' );
- } else {
- ev.preventDefault();
-
- // Trigger preview mode ensure preview
code has fully loaded first!
- MobileWebClickTracking.log( self.source
+ '-preview', title );
- loader.show();
- mw.loader.using(
'mobile.special.nearby.beta', function() {
- loader.hide();
- // FIXME: [API] should be able
to determine longitude/latitude from title
- window.location.hash =
'#preview/' + self.source + '/' + $a.data( 'latlng' ) + '/' + $a.data( 'title'
);
- } );
- }
+ window.location.hash = '#' + $(
ev.currentTarget ).attr( 'name' );
} );
}
} );
diff --git a/javascripts/modules/nearby/NearbyOverlay.js
b/javascripts/modules/nearby/NearbyOverlay.js
deleted file mode 100644
index 81770f5..0000000
--- a/javascripts/modules/nearby/NearbyOverlay.js
+++ /dev/null
@@ -1,41 +0,0 @@
-( function( M ) {
- M.assertMode( [ 'beta', 'alpha', 'desktop-beta' ] );
- var Nearby = M.require( 'modules/nearby/Nearby' ),
- Overlay = M.require( 'Overlay' ),
- NearbyOverlay;
-
- /*
- * @class NearbyOverlay
- */
- NearbyOverlay = Overlay.extend( {
- active: false,
- closeOnBack: true,
- templatePartials: {
- content: M.template.get(
'overlays/nearby.hogan' )
- },
- defaults: {
- heading: mw.message(
'mobile-frontend-nearby-title' )
- },
- initialize: function( options ) {
- options.pretext = mw.message(
'mobile-frontend-nearby-to-page', options.title );
- this._super( options );
- this.latLngString = options.latitude + ',' +
options.longitude;
- },
- postRender: function( options ) {
- var widget;
-
- this._super( options );
- widget = new Nearby( {
- source: options.source,
- range: 2000,
- parentOverlay: this,
- exclude: options.title,
- longitude: options.longitude,
- latitude: options.latitude,
- el: this.$( '.container' )
- } );
- }
- } );
- M.define( 'modules/nearby/NearbyOverlay', NearbyOverlay );
-
-}( mw.mobileFrontend ) );
diff --git a/javascripts/modules/nearby/PagePreviewOverlay.js
b/javascripts/modules/nearby/PagePreviewOverlay.js
deleted file mode 100644
index af75235..0000000
--- a/javascripts/modules/nearby/PagePreviewOverlay.js
+++ /dev/null
@@ -1,134 +0,0 @@
-( function( M, $ ) {
- M.assertMode( [ 'beta', 'alpha', 'desktop-beta' ] );
- var Overlay = M.require( 'Overlay' ),
- MobileWebClickTracking = M.require(
'loggingSchemas/MobileWebClickTracking' ),
- api = M.require( 'api' ),
- ua = window.navigator.userAgent,
- device = 'unknown',
- Page = M.require( 'Page' ),
- LoadingOverlay = M.require( 'LoadingOverlay' ),
- /*
- * @class PagePreviewOverlay
- */
- PagePreviewOverlay = Overlay.extend( {
- closeOnBack: true,
- defaults: {
- source: 'nearby'
- },
- templatePartials: {
- content: M.template.get(
'overlays/pagePreview.hogan' )
- },
- initialize: function( options ) {
- var self = this, loader = new LoadingOverlay(),
- optionalArgs,
- endpoint = options.endpoint;
-
- // When $wgMFNearbyEndpoint is set we need to
assume JSONP mode and override the default URL
- if ( endpoint ) {
- optionalArgs = { url: endpoint,
dataType: 'jsonp' };
- }
-
- this._super( options );
- loader.show();
- M.pageApi.getPage( options.title,
options.endpoint, true ).done( function( page ) {
- options.page = new Page( page );
- // FIXME [API]: This additional ajax
request should be unnecessary.
- // FIXME: and if necessary, reuse
PageImageApi that search uses
- api.get( {
- action : 'query',
- prop: 'pageimages',
- piprop: 'thumbnail',
- // keep consistent with
Special:Watchlist::THUMB_SIZE
- pithumbsize: 150,
- titles: options.title
- }, optionalArgs ).done(
function ( resp ) {
- var thumb;
- // FIXME [API] more
terrible MediaWiki API fun
- if ( resp.query &&
resp.query.pages ) {
- thumb = $.map(
resp.query.pages, function( page ) {
- return
page;
- }
)[0].thumbnail;
- if ( thumb ) {
-
options.imageUrl = thumb.source;
-
options.imgClass = thumb.width > thumb.height ? 'icon icon-max-y' : 'icon
icon-max-x';
- } else {
-
options.imgClass = 'needsPhoto icon icon-max-x';
- }
- } else {
-
options.imgClass = 'needsPhoto icon icon-max-x';
- }
- loader.hide();
- self.render( options
).show();
- } );
- } ).fail( function() {
- loader.hide(); // FIXME: do something
more meaningful e.g. error overlay
- } );
- },
- preRender: function( options ) {
- if ( !options.page ) {
- return;
- }
- var directionUrl;
- options.heading = '<span>' + options.page.title
+ '</span>';
- options.preview = options.page.lead;
- options.url = mw.util.getUrl(
options.page.title );
- options.readMoreLink = mw.msg(
'mobile-frontend-nearby-link' );
-
- if ( options.latLngString ) {
- // Yeeyyy no standards!
- // FIXME: would be nice to provide an
opensource alternative
- if ( device === 'iphone' ) {
- directionUrl =
'http://maps.apple.com/?daddr=' + options.latLngString;
- } else if ( device === 'android' ) {
- directionUrl = 'geo:' +
options.latLngString + '?q=' + options.latLngString + '(' + encodeURIComponent(
options.page.title ) + ')&z=20';
- } else if ( device === 'wp' ) {
- directionUrl = 'maps:' +
options.latLngString;
- } // FIXME: what in other cases?!
-
- if ( directionUrl ) {
- options.directionUrl =
directionUrl;
- options.directionLabel =
mw.msg( 'mobile-frontend-nearby-directions' );
- }
- }
- },
- postRender: function( options ) {
- if ( !options.page ) {
- return;
- }
- var $preview, nodes;
- this._super( options );
- $preview = this.$( '.preview' );
- // Remove tables, infoboxes, navboxes, message
boxes, hatnotes, and images.
- $preview.find( 'table, .dablink, .rellink,
.thumb' ).remove();
- // FIXME: IMO meta data should remain hidden
from output
- // Build an array of content nodes, excluding
coordinates
- nodes = $preview.find( 'p, div' ).map(
function( i, el ) {
- if ( $( el ).find( '#coordinates'
).length === 0 ) {
- return el;
- }
- } );
- $preview.empty();
- // Display the first content node
- $preview.append( nodes[0] );
- MobileWebClickTracking.hijackLink( this.$(
'.read-in-full' ), options.source + '-view-full' );
- }
- } );
-
- if ( ua.match( /OS [0-9]+_[0-9]+ like Mac OS X/ ) ) {
- device = 'iphone';
- } else if ( ua.match( /Android/ ) ) {
- device = 'android';
- } else if ( ua.match( /Windows Phone/ ) ) {
- device = 'wp';
- }
-
- M.router.route( /^preview\/(.*)\/(.*)\/(.*)$/, function( source,
latLngString, title ) {
- // FIXME: API doesn't return pageimage or longitude latitude
properties (yet)
- new PagePreviewOverlay( {
- title: title,
- latLngString: latLngString,
- source: source,
- endpoint: mw.config.get( 'wgMFNearbyEndpoint' )
- } );
- } );
-}( mw.mobileFrontend, jQuery ) );
diff --git a/javascripts/modules/nearbypages.js
b/javascripts/modules/nearbypages.js
deleted file mode 100644
index cc8518e..0000000
--- a/javascripts/modules/nearbypages.js
+++ /dev/null
@@ -1,61 +0,0 @@
-( function( M, $ ) {
- var latLng, lat, lng,
- MobileWebClickTracking = M.require(
'loggingSchemas/MobileWebClickTracking' ),
- LoadingOverlay = M.require( 'LoadingOverlay' ),
- loader = new LoadingOverlay(),
- overlay;
-
- function initNearbyButton( title, latitude, longitude ) {
- function loadGeoNotAHack() {
- loader.show();
- mw.loader.using( 'mobile.special.nearby.beta',
function() {
- var NearbyOverlay = M.require(
'modules/nearby/NearbyOverlay' );
- if ( !overlay ) {
- MobileWebClickTracking.log(
'geonotahack-clicked' );
- overlay = new NearbyOverlay( { title:
title, latitude: latitude, longitude: longitude, source: 'geonotahack' } );
- }
- loader.hide();
- overlay.show();
- } );
- }
-
- var $btn;
- if ( M.router.isSupported() ) {
- $btn = $( '<a class="mw-ui-button mw-ui-progressive
button nearby icon icon-32px">' ).attr( 'href', '#geonotahack' );
- M.router.route( /^geonotahack$/, loadGeoNotAHack );
- } else {
- $btn = $( '<button class="mw-ui-button
mw-ui-progressive nearby icon icon-32px">' ).on( 'click', loadGeoNotAHack );
- }
- $btn.text( mw.msg( 'mobile-frontend-geonotahack' ) ).appendTo(
'#page-secondary-actions' );
- }
-
- function init( page ) {
- // reset the overlay in case a new page was loaded
- overlay = null;
- latLng = mw.config.get( 'wgCoordinates' );
- if ( latLng ) {
- lat = latLng.lat;
- lng = latLng.lon;
- } else {
- // TODO: kill this b/c code when
https://gerrit.wikimedia.org/r/104679
- // gets deployed everywhere and old Varnish cache
expires
-
- // in form 37.783; -122.417 - take the first one
- latLng = $( '.geo' ).eq( 0 ).text();
- // Matches <Number>;<optional space(s)}><Number> where
Number can be negative or positive and a float or Number
- latLng = latLng.match( /([\-]?[\-0-9]+[\.]?[0-9]*);[
]*([\-]?[0-9]+[\.]?[0-9]*)/ );
- if ( latLng ) {
- lat = latLng[1];
- lng = latLng[2];
- }
- }
-
- if ( lat && lng ) {
- // in business!
- initNearbyButton( page ? page.title : mw.config.get(
'wgTitle' ), lat, lng );
- }
- }
- init();
- M.on( 'page-loaded', init );
-
-}( mw.mobileFrontend, jQuery ) );
diff --git a/less/common/images/secondaryPageActions/geo.png
b/less/common/images/secondaryPageActions/geo.png
deleted file mode 100644
index 4620bf7..0000000
--- a/less/common/images/secondaryPageActions/geo.png
+++ /dev/null
Binary files differ
diff --git a/less/common/images/secondaryPageActions/languages.png
b/less/common/images/secondaryPageActions/languages.png
deleted file mode 100644
index e9ae058..0000000
--- a/less/common/images/secondaryPageActions/languages.png
+++ /dev/null
Binary files differ
diff --git a/less/common/secondaryPageActions.less
b/less/common/secondaryPageActions.less
deleted file mode 100644
index 1aa11b1..0000000
--- a/less/common/secondaryPageActions.less
+++ /dev/null
@@ -1,26 +0,0 @@
-@import "minerva.variables";
-@import "minerva.mixins";
-
-
-.client-js {
- #page-secondary-actions {
- text-align: center;
- margin-top: 45px;
- button,
- .button {
- width: 70px;
- // buttons are inline-block so ensure that we avoid the
whitespace above 2nd button due to default value baseline
- vertical-align: top;
-
- &.nearby {
-
.background-image('images/secondaryPageActions/geo.png');
- }
-
- &.languageSelector {
-
.background-image('images/secondaryPageActions/languages.png');
- // FIXME: Temporary override of one in
languages.less
- margin-top: 0;
- }
- }
- }
-}
diff --git a/templates/overlays/nearby.hogan b/templates/overlays/nearby.hogan
deleted file mode 100644
index 1797a98..0000000
--- a/templates/overlays/nearby.hogan
+++ /dev/null
@@ -1,10 +0,0 @@
-<p class="content-header">{{pretext}}</p>
-<div class="container">
- <ul>
- {{#sections}}
- <li>
- <a data-id="{{id}}">{{heading}}</a>
- </li>
- {{/sections}}
- </ul>
-</div>
diff --git a/templates/page.hogan b/templates/page.hogan
index dfae864..8219e16 100644
--- a/templates/page.hogan
+++ b/templates/page.hogan
@@ -19,22 +19,12 @@
</{{tag}}>
<div>{{{text}}}</div>
{{/sections}}
- {{#inBetaOrAlpha}}
{{#hasLanguages}}
<div id="page-secondary-actions">
<a href="{{languageUrl}}"
- class="mw-ui-button mw-ui-progressive button
languageSelector icon icon-32px icon-text">
+ class="mw-ui-button mw-ui-progressive button
languageSelector">
{{languageLabel}}
</a>
</div>
{{/hasLanguages}}
- {{/inBetaOrAlpha}}
- {{^inBetaOrAlpha}}
- {{#hasLanguages}}
- <a href="{{languageUrl}}"
- class="mw-ui-button mw-ui-progressive button languageSelector
icon icon-32px icon-text">
- {{languageLabel}}
- </a>
- {{/hasLanguages}}
- {{/inBetaOrAlpha}}
</div>
diff --git a/tests/browser/features/geonotahack.feature
b/tests/browser/features/geonotahack.feature
deleted file mode 100644
index 7e9e798..0000000
--- a/tests/browser/features/geonotahack.feature
+++ /dev/null
@@ -1,20 +0,0 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @extension-geodata @firefox
-Feature: Nearby pages
-
- Background:
- Given I am logged into the mobile website
- And I am in beta mode
- And I am on a page with geodata
-
- Scenario: Nearby button visible
- Then I see the nearby button
-
- Scenario: Nearby button visible
- When I click the nearby button
- Then I see the nearby overlay
-
- Scenario: Page preview
- Given I click the nearby button
- And I see the nearby overlay
- When I click a nearby result
- Then I see the page preview overlay
diff --git a/tests/browser/features/step_definitions/create_page_api_steps.rb
b/tests/browser/features/step_definitions/create_page_api_steps.rb
index c760679..becabd2 100644
--- a/tests/browser/features/step_definitions/create_page_api_steps.rb
+++ b/tests/browser/features/step_definitions/create_page_api_steps.rb
@@ -60,11 +60,6 @@
end
end
-Given(/^I am on a page with geodata$/) do
- step 'at least one article exists with geodata'
- step 'I am on the "Selenium geo test page" page'
-end
-
Given(/^I go to a page that has languages$/) do
wikitext = 'This page is used by Selenium to test language related features.
diff --git a/tests/browser/features/step_definitions/geonotahack_steps.rb
b/tests/browser/features/step_definitions/geonotahack_steps.rb
deleted file mode 100644
index e28bdf7..0000000
--- a/tests/browser/features/step_definitions/geonotahack_steps.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-Then(/^I see the nearby button$/) do
- on(ArticlePage).nearby_button_element.when_present.should be_visible
-end
-
-When(/^I click the nearby button$/) do
- on(ArticlePage).nearby_button_element.when_present.click
-end
-
-Then(/^I see the nearby overlay$/) do
- on(ArticlePage).overlay_heading_element.when_present.text.should match
"Nearby"
-end
--
To view, visit https://gerrit.wikimedia.org/r/161025
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6033ed78c9b00fb938241294482f22fa1ed484f5
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits