Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/96882
Change subject: Beta Feature: Switch from + to * in regex
......................................................................
Beta Feature: Switch from + to * in regex
In Commons for example geo coordinates render in the forn
37.9782663;-119.1324739 with no space between the semicolon and -
sign
Change-Id: Ic1610d0fc1a98d749927306eded8589144556745
---
M javascripts/loggingSchemas/MobileWebInfobox.js
M javascripts/modules/nearbypages.js
2 files changed, 13 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/82/96882/1
diff --git a/javascripts/loggingSchemas/MobileWebInfobox.js
b/javascripts/loggingSchemas/MobileWebInfobox.js
index bbb97f9..2e0e1ac 100644
--- a/javascripts/loggingSchemas/MobileWebInfobox.js
+++ b/javascripts/loggingSchemas/MobileWebInfobox.js
@@ -5,10 +5,20 @@
viewportHeight = $( window ).height(),
scrollingHasCommenced = false,
userScrolledToInfobox = false,
- userScrolledPastInfobox = false;
+ userScrolledPastInfobox = false,
+ recorded = false;
function attemptLogEvent() {
- return $.Deferred().resolve();
+ if ( logData['in'] && logData.out && !recorded ) {
+ recorded = true;
+ clearInterval( interval );
+ return M.log( 'MobileWebInfobox', logData );
+ } else {
+ /* Hijack below expects a deferred object. We should only log
on the first click to MobileWebInfobox
+ In the situation where you click a link in the infobox then
click another the always handler should
+ still be able to fire so that the link can be navigated to.*/
+ return $.Deferred().resolve();
+ }
}
function detectInfobox() {
diff --git a/javascripts/modules/nearbypages.js
b/javascripts/modules/nearbypages.js
index 4ee0438..67f8bc6 100644
--- a/javascripts/modules/nearbypages.js
+++ b/javascripts/modules/nearbypages.js
@@ -35,7 +35,7 @@
// in form 37.783; -122.417 - take the first one
latLng = $( '.geo' ).eq( 0 ).text();
// Matches <number>;<spaces><number> where number can be
negative or positive and a float or integer
- latLng = latLng.match( /([\-]?[\-0-9]+[\.]?[0-9]*);[
]+([\-]?[0-9]+[\.]?[0-9]*)/ );
+ latLng = latLng.match( /([\-]?[\-0-9]+[\.]?[0-9]*);[
]*([\-]?[0-9]+[\.]?[0-9]*)/ );
if ( latLng ) {
lat = latLng[1];
lng = latLng[2];
--
To view, visit https://gerrit.wikimedia.org/r/96882
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1610d0fc1a98d749927306eded8589144556745
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits