From 767275fdf5c364d20030ee6d9ba52e844f9acba4 Mon Sep 17 00:00:00 2001 From: fkloft Date: Wed, 16 Oct 2013 17:24:20 +0200 Subject: [PATCH 01/12] Show detailed portal level in tooltip --- code/portal_detail_display.js | 13 ++++++++++++- style.css | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index 5004ce1c..b2771d3f 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -90,6 +90,17 @@ window.renderPortalDetails = function(guid) { portalDetailedDescription += ''; } + var levelDetails = getPortalLevel(d); + if(levelDetails != 8) { + if(levelDetails==Math.ceil(levelDetails)) + levelDetails += "\n8"; + else + levelDetails += "\n" + (Math.ceil(levelDetails) - levelDetails)*8; + levelDetails += " resonator level(s) needed for next portal level"; + } else { + levelDetails += "\nfully upgraded"; + } + levelDetails = "Level " + levelDetails; $('#portaldetails') .attr('class', TEAM_TO_CSS[getTeam(d)]) @@ -98,7 +109,7 @@ window.renderPortalDetails = function(guid) { + 'X' // help cursor via ".imgpreview img" + '
' - + ''+Math.floor(getPortalLevel(d))+'' + + ''+Math.floor(getPortalLevel(d))+'' + '
'+ portalDetailedDescription + '
' + '
' + '' diff --git a/style.css b/style.css index 3b886151..8758b7de 100644 --- a/style.css +++ b/style.css @@ -526,6 +526,7 @@ h3 { display: block; margin-right: 15px; text-align:right; + float: right; } /* portal mods */ From a33bdcbf3843b49b1052c1a6dabbf1b8d50dfe62 Mon Sep 17 00:00:00 2001 From: fkloft Date: Wed, 16 Oct 2013 19:03:39 +0200 Subject: [PATCH 02/12] Show link range details for partially deployed portals. Calculates the link range for portals with <8 resonators as well, but uses a dashed circle and a striked-through range value for those. The tooltip over the range value in the details pane shows base range, link amp boost and total range. The range for portals with missing resonators can be important because links with shorter lengths might originate here. Those will collapse when the total link range drops below their length, but not as soon as a resonator is destroyed. --- code/portal_detail_display.js | 9 +++++++-- code/portal_detail_display_tools.js | 17 +++++++++++++---- code/portal_info.js | 14 ++++++++------ 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index b2771d3f..f2f513bd 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -145,8 +145,13 @@ window.setPortalIndicators = function(d) { var range = getPortalRange(d); var coord = [d.locationE6.latE6/1E6, d.locationE6.lngE6/1E6]; - portalRangeIndicator = (range > 0 - ? L.geodesicCircle(coord, range, { fill: false, color: RANGE_INDICATOR_COLOR, weight: 3, clickable: false }) + portalRangeIndicator = (range.range > 0 + ? L.geodesicCircle(coord, range.range, { + fill: false, + color: RANGE_INDICATOR_COLOR, + weight: 3, + dashArray: range.isLinkable ? undefined : "10,10", + clickable: false }) : L.circle(coord, range, { fill: false, stroke: false, clickable: false }) ).addTo(map); diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js index a1196d60..353189d9 100644 --- a/code/portal_detail_display_tools.js +++ b/code/portal_detail_display_tools.js @@ -5,11 +5,20 @@ // returns displayable text+link about portal range window.getRangeText = function(d) { var range = getPortalRange(d); + + var title = 'Base range:\t' + digits(Math.floor(range.base))+'m' + + '\nLink amp boost:\t×'+range.boost + + '\nRange:\t'+digits(Math.floor(range.range))+'m'; + + if(!range.isLinkable) title += '\nPortal is missing resonators,\nno new links can be made'; + return ['range', - '' - + (range > 1000 - ? Math.floor(range/1000) + ' km' - : Math.floor(range) + ' m') + '' + + (range.range > 1000 + ? Math.floor(range.range/1000) + ' km' + : Math.floor(range.range) + ' m') + '']; } diff --git a/code/portal_info.js b/code/portal_info.js index a6a5bc01..569f8f0f 100644 --- a/code/portal_info.js +++ b/code/portal_info.js @@ -47,18 +47,20 @@ window.getPortalRange = function(d) { $.each(d.resonatorArray.resonators, function(ind, reso) { if(!reso) { resoMissing = true; - return false; + return; } lvl += parseInt(reso.level); }); - if(resoMissing) return 0; - var range = 160*Math.pow(getPortalLevel(d), 4); + var range = { + base: 160*Math.pow(getPortalLevel(d), 4), + boost: getLinkAmpRangeBoost(d) + }; - var boost = getLinkAmpRangeBoost(d); - - return range*boost; + range.range = range.boost * range.base; + range.isLinkable = !resoMissing; + return range; } window.getLinkAmpRangeBoost = function(d) { From 4055bb86384d25985634908ccfb884a574d4c1cc Mon Sep 17 00:00:00 2001 From: fkloft Date: Wed, 16 Oct 2013 21:34:41 +0200 Subject: [PATCH 03/12] Implement per faction player tracker Fixes #604 --- plugins/player-tracker.user.js | 56 ++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index 07520a1a..06f4ff99 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -45,11 +45,18 @@ window.plugin.playerTracker.setup = function() { iconRetinaUrl: iconResRetImage }}); - plugin.playerTracker.drawnTraces = new L.LayerGroup(); - window.addLayerGroup('Player Tracker', plugin.playerTracker.drawnTraces, true); + plugin.playerTracker.drawnTracesEnl = new L.LayerGroup(); + plugin.playerTracker.drawnTracesRes = new L.LayerGroup(); + // to avoid any favouritism, we'll put the player's own faction layer first + if (PLAYER.team == 'RESISTANCE') { + window.addLayerGroup('Player Tracker Resistance', plugin.playerTracker.drawnTracesRes, true); + window.addLayerGroup('Player Tracker Enlightened', plugin.playerTracker.drawnTracesEnl, true); + } else { + window.addLayerGroup('Player Tracker Enlightened', plugin.playerTracker.drawnTracesEnl, true); + window.addLayerGroup('Player Tracker Resistance', plugin.playerTracker.drawnTracesRes, true); + } map.on('layeradd',function(obj) { - if(obj.layer === plugin.playerTracker.drawnTraces) - { + if(obj.layer === plugin.playerTracker.drawnTracesEnl || obj.layer === plugin.playerTracker.drawnTracesRes) { obj.layer.eachLayer(function(marker) { if(marker._icon) window.setupTooltips($(marker._icon)); }); @@ -77,7 +84,8 @@ window.plugin.playerTracker.stored = {}; window.plugin.playerTracker.zoomListener = function() { var ctrl = $('.leaflet-control-layers-selector + span:contains("Player Tracker")').parent(); if(window.map.getZoom() < window.PLAYER_TRACKER_MIN_ZOOM) { - window.plugin.playerTracker.drawnTraces.clearLayers(); + window.plugin.playerTracker.drawnTracesEnl.clearLayers(); + window.plugin.playerTracker.drawnTracesRes.clearLayers(); ctrl.addClass('disabled').attr('title', 'Zoom in to show those.'); } else { ctrl.removeClass('disabled').attr('title', ''); @@ -241,9 +249,10 @@ window.plugin.playerTracker.ago = function(time, now) { window.plugin.playerTracker.drawData = function() { var gllfe = plugin.playerTracker.getLatLngFromEvent; - var layer = plugin.playerTracker.drawnTraces; - var polyLineByAge = [[], [], [], []]; + var polyLineByAgeEnl = [[], [], [], []]; + var polyLineByAgeRes = [[], [], [], []]; + var split = PLAYER_TRACKER_MAX_TIME / 4; var now = new Date().getTime(); $.each(plugin.playerTracker.stored, function(pguid, playerData) { @@ -259,7 +268,11 @@ window.plugin.playerTracker.drawData = function() { var p = playerData.events[i]; var ageBucket = Math.min(parseInt((now - p.time) / split), 4-1); var line = [gllfe(p), gllfe(playerData.events[i-1])]; - polyLineByAge[ageBucket].push(line); + + if(playerData.team === 'RESISTANCE') + polyLineByAgeRes[ageBucket].push(line); + else + polyLineByAgeEnl[ageBucket].push(line); } // tooltip for marker @@ -315,14 +328,14 @@ window.plugin.playerTracker.drawData = function() { var m = L.marker(gllfe(last), {title: title, icon: icon, referenceToPortal: closestPortal}); // ensure tooltips are closed, sometimes they linger m.on('mouseout', function() { $(this._icon).tooltip('close'); }); - m.addTo(layer); + m.addTo(playerData.team === 'RESISTANCE' ? plugin.playerTracker.drawnTracesRes : plugin.playerTracker.drawnTracesEnl); plugin.playerTracker.oms.addMarker(m); // jQueryUI doesn’t automatically notice the new markers window.setupTooltips($(m._icon)); }); // draw the poly lines to the map - $.each(polyLineByAge, function(i, polyLine) { + $.each(polyLineByAgeEnl, function(i, polyLine) { if(polyLine.length === 0) return true; var opts = { @@ -333,7 +346,20 @@ window.plugin.playerTracker.drawData = function() { dashArray: "5,8" }; - L.multiPolyline(polyLine, opts).addTo(layer); + L.multiPolyline(polyLine, opts).addTo(plugin.playerTracker.drawnTracesEnl); + }); + $.each(polyLineByAgeRes, function(i, polyLine) { + if(polyLine.length === 0) return true; + + var opts = { + weight: 2-0.25*i, + color: PLAYER_TRACKER_LINE_COLOUR, + clickable: false, + opacity: 1-0.2*i, + dashArray: "5,8" + }; + + L.multiPolyline(polyLine, opts).addTo(plugin.playerTracker.drawnTracesRes); }); } @@ -343,11 +369,15 @@ window.plugin.playerTracker.handleData = function(data) { plugin.playerTracker.discardOldData(); plugin.playerTracker.processNewData(data); // remove old popups - plugin.playerTracker.drawnTraces.eachLayer(function(layer) { + plugin.playerTracker.drawnTracesEnl.eachLayer(function(layer) { + if(layer._icon) $(layer._icon).tooltip('destroy'); + }); + plugin.playerTracker.drawnTracesRes.eachLayer(function(layer) { if(layer._icon) $(layer._icon).tooltip('destroy'); }); plugin.playerTracker.oms.clearMarkers(); - plugin.playerTracker.drawnTraces.clearLayers(); + plugin.playerTracker.drawnTracesEnl.clearLayers(); + plugin.playerTracker.drawnTracesRes.clearLayers(); plugin.playerTracker.drawData(); } From 27b7573a23e7c0a694483552570ab7ae66135fa1 Mon Sep 17 00:00:00 2001 From: fkloft Date: Wed, 16 Oct 2013 21:37:05 +0200 Subject: [PATCH 04/12] Tweak to zaprange: put the player's own faction layer first --- plugins/zaprange.user.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/zaprange.user.js b/plugins/zaprange.user.js index 8f72383b..6057aef5 100644 --- a/plugins/zaprange.user.js +++ b/plugins/zaprange.user.js @@ -102,8 +102,14 @@ window.plugin.zaprange.zapLayerEnlHolderGroup.addLayer(window.plugin.zaprange.zapCircleEnlHolderGroup); window.plugin.zaprange.zapLayerResHolderGroup.addLayer(window.plugin.zaprange.zapCircleResHolderGroup); - window.addLayerGroup('Zaprange Enlightened', window.plugin.zaprange.zapLayerEnlHolderGroup, true); - window.addLayerGroup('Zaprange Resistance', window.plugin.zaprange.zapLayerResHolderGroup, true); + // to avoid any favouritism, we'll put the player's own faction layer first + if (PLAYER.team == 'RESISTANCE') { + window.addLayerGroup('Zaprange Resistance', window.plugin.zaprange.zapLayerResHolderGroup, true); + window.addLayerGroup('Zaprange Enlightened', window.plugin.zaprange.zapLayerEnlHolderGroup, true); + } else { + window.addLayerGroup('Zaprange Enlightened', window.plugin.zaprange.zapLayerEnlHolderGroup, true); + window.addLayerGroup('Zaprange Resistance', window.plugin.zaprange.zapLayerResHolderGroup, true); + } window.addHook('portalAdded', window.plugin.zaprange.portalAdded); From 2dd77a20573173ea6fbf201a5d508695a744320e Mon Sep 17 00:00:00 2001 From: fkloft Date: Wed, 16 Oct 2013 23:12:05 +0200 Subject: [PATCH 05/12] player tracker: use opacity to indicate last activity --- plugins/player-tracker.user.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index 06f4ff99..f79e382a 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -19,7 +19,7 @@ // PLUGIN START //////////////////////////////////////////////////////// window.PLAYER_TRACKER_MAX_TIME = 3*60*60*1000; // in milliseconds window.PLAYER_TRACKER_MIN_ZOOM = 9; - +window.PLAYER_TRACKER_MIN_OPACITY = 0.3; window.PLAYER_TRACKER_LINE_COLOUR = '#FF00FD'; @@ -323,9 +323,13 @@ window.plugin.playerTracker.drawData = function() { } }); + // marker opacity + var relOpacity = 1 - (now - last.time) / window.PLAYER_TRACKER_MAX_TIME + var absOpacity = window.PLAYER_TRACKER_MIN_OPACITY + (1 - window.PLAYER_TRACKER_MIN_OPACITY) * relOpacity; + // marker itself var icon = playerData.team === 'RESISTANCE' ? new plugin.playerTracker.iconRes() : new plugin.playerTracker.iconEnl(); - var m = L.marker(gllfe(last), {title: title, icon: icon, referenceToPortal: closestPortal}); + var m = L.marker(gllfe(last), {title: title, icon: icon, referenceToPortal: closestPortal, opacity: absOpacity}); // ensure tooltips are closed, sometimes they linger m.on('mouseout', function() { $(this._icon).tooltip('close'); }); m.addTo(playerData.team === 'RESISTANCE' ? plugin.playerTracker.drawnTracesRes : plugin.playerTracker.drawnTracesEnl); From 69234ef063a476afc9ad850e9c09b0480c463313 Mon Sep 17 00:00:00 2001 From: fkloft Date: Thu, 17 Oct 2013 21:56:46 +0200 Subject: [PATCH 06/12] Small bugfix (it was impossible to select a neutral portal) --- code/portal_detail_display.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index f2f513bd..47967e57 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -152,7 +152,7 @@ window.setPortalIndicators = function(d) { weight: 3, dashArray: range.isLinkable ? undefined : "10,10", clickable: false }) - : L.circle(coord, range, { fill: false, stroke: false, clickable: false }) + : L.circle(coord, range.range, { fill: false, stroke: false, clickable: false }) ).addTo(map); portalAccessIndicator = L.circle(coord, HACK_RANGE, From de621000cea0de7f58c8d6f934f4062ed0a7613c Mon Sep 17 00:00:00 2001 From: fkloft Date: Sat, 19 Oct 2013 14:06:59 +0200 Subject: [PATCH 07/12] Debug pane: Show error message in log --- code/chat.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/code/chat.js b/code/chat.js index 71d0196c..fc88c670 100644 --- a/code/chat.js +++ b/code/chat.js @@ -680,7 +680,18 @@ window.chat.postMsg = function() { var msg = $.trim($('#chatinput input').val()); if(!msg || msg === '') return; - if(c === 'debug') return new Function (msg)(); + if(c === 'debug') { + var result; + try { + result = eval(msg); + } catch(e) { + if(e.stack) console.error(e.stack); + throw e; // to trigger native error message + } + if(result !== undefined) + console.log(result.toString()); + return result; + } var publik = c === 'public'; var latlng = map.getCenter(); From 53874ab8875f4a77a23649680e719f9ffe13a866 Mon Sep 17 00:00:00 2001 From: fkloft Date: Sat, 19 Oct 2013 15:14:56 +0200 Subject: [PATCH 08/12] Avoid errors in stock JS --- code/utils_misc.js | 9 +++++++++ main.js | 4 +++- style.css | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index a8f2048f..dc55c6b4 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -602,3 +602,12 @@ window.clampLatLng = function(latlng) { window.clampLatLngBounds = function(bounds) { return new L.LatLngBounds ( clampLatLng(bounds.getSouthWest()), clampLatLng(bounds.getNorthEast()) ); } + +// avoid error in stock JS +if(goog && goog.style) { + goog.style.showElement = function(a, b) { + if(a && a.style) + a.style.display = b ? "" : "none" + }; +} + diff --git a/main.js b/main.js index 72f96f7e..4e5a6ebf 100644 --- a/main.js +++ b/main.js @@ -100,7 +100,9 @@ document.getElementsByTagName('body')[0].innerHTML = '' + ' ' + ' ' + '' - + '
'; + + '
' + // avoid error by stock JS + + '
'; // putting everything in a wrapper function that in turn is placed in a // script tag on the website allows us to execute in the site’s context diff --git a/style.css b/style.css index 3b886151..d32df69c 100644 --- a/style.css +++ b/style.css @@ -969,3 +969,8 @@ td + td { .portal_details tr.padding-top th, .portal_details tr.padding-top td { padding-top: 0.7em; } + +#play_button { + display: none; +} + From a13c91dc8238d6268bb3740f1cf8a2551d94a449 Mon Sep 17 00:00:00 2001 From: fkloft Date: Sat, 19 Oct 2013 15:29:18 +0200 Subject: [PATCH 09/12] Pass console messages from debug pane to native console (Removed android.util.Log call since the default implementation does this already) --- code/debugging.js | 18 ++++++++++++++---- .../com/cradle/iitc_mobile/IITC_WebView.java | 1 - 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/code/debugging.js b/code/debugging.js index b1d2bbe8..c72b3163 100644 --- a/code/debugging.js +++ b/code/debugging.js @@ -84,10 +84,20 @@ window.debug.console.error = function(text) { window.debug.console.overwriteNative = function() { window.debug.console.create(); - window.console = function() {} - window.console.log = window.debug.console.log; - window.console.warn = window.debug.console.warn; - window.console.error = window.debug.console.error; + + var nativeConsole = window.console; + window.console = {}; + + function overwrite(which) { + window.console[which] = function() { + nativeConsole[which].apply(nativeConsole, arguments); + window.debug.console[which].apply(window.debug.console, arguments); + } + } + + overwrite("log"); + overwrite("warn"); + overwrite("error"); } window.debug.console.overwriteNativeIfRequired = function() { diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java index 1941a116..d677c4bc 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java @@ -84,7 +84,6 @@ public class IITC_WebView extends WebView { @Override public boolean onConsoleMessage(ConsoleMessage consoleMessage) { if (consoleMessage.messageLevel() == ConsoleMessage.MessageLevel.ERROR) { - Log.d("iitcm", consoleMessage.message()); ((IITC_Mobile) getContext()).setLoadingState(false); } return super.onConsoleMessage(consoleMessage); From fd90f44defc503dc34550462a8821f61c1071b26 Mon Sep 17 00:00:00 2001 From: fkloft Date: Sat, 19 Oct 2013 15:42:01 +0200 Subject: [PATCH 10/12] Change Android title *after* switching panges. Android ist faster. --- code/panes.js | 103 +++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/code/panes.js b/code/panes.js index 5fd037fe..cf904f49 100644 --- a/code/panes.js +++ b/code/panes.js @@ -1,65 +1,66 @@ // created to start cleaning up "window" interaction // window.show = function(id) { - if (typeof android !== 'undefined' && android && android.switchToPane) { - android.switchToPane(id); - } - /* - * disable all map properties when switching to another pane - * because sometimes (bug?) touch events are passed to the map when - * other panes are focussed - */ - window.disableMapProperties(); - window.hideall(); + /* + * disable all map properties when switching to another pane + * because sometimes (bug?) touch events are passed to the map when + * other panes are focussed + */ + window.disableMapProperties(); + window.hideall(); - switch(id) { - case 'full': - window.chat.show('full'); - break; - case 'compact': - window.chat.show('compact'); - break; - case 'public': - window.chat.show('public'); - break; - case 'faction': - window.chat.show('faction'); - break; - case 'debug': - window.debug.console.show(); - break; - case 'map': - window.enableMapProperties(); - window.smartphone.mapButton.click(); - $('#portal_highlight_select').show(); - $('#farm_level_select').show(); - break; - case 'info': - window.smartphone.sideButton.click(); - break; - default: - window.smartphone.mapButton.click(); - break; - } + switch(id) { + case 'full': + window.chat.show('full'); + break; + case 'compact': + window.chat.show('compact'); + break; + case 'public': + window.chat.show('public'); + break; + case 'faction': + window.chat.show('faction'); + break; + case 'debug': + window.debug.console.show(); + break; + case 'map': + window.enableMapProperties(); + window.smartphone.mapButton.click(); + $('#portal_highlight_select').show(); + $('#farm_level_select').show(); + break; + case 'info': + window.smartphone.sideButton.click(); + break; + default: + window.smartphone.mapButton.click(); + break; + } + + if (typeof android !== 'undefined' && android && android.switchToPane) { + android.switchToPane(id); + } } window.enableMapProperties = function() { - window.map.tap.enable(); - window.map.dragging.enable(); - window.map.touchZoom.enable(); - window.map.doubleClickZoom.enable(); + window.map.tap.enable(); + window.map.dragging.enable(); + window.map.touchZoom.enable(); + window.map.doubleClickZoom.enable(); } window.disableMapProperties = function() { - window.map.tap.disable(); - window.map.dragging.disable(); - window.map.touchZoom.disable(); - window.map.doubleClickZoom.disable(); + window.map.tap.disable(); + window.map.dragging.disable(); + window.map.touchZoom.disable(); + window.map.doubleClickZoom.disable(); } window.hideall = function() { - $('#chatcontrols, #chat, #chatinput, #sidebartoggle, #scrollwrapper, #updatestatus, #portal_highlight_select').hide(); - $('#farm_level_select').hide(); - $('#map').css('visibility', 'hidden'); - $('.ui-tooltip').remove(); + $('#chatcontrols, #chat, #chatinput, #sidebartoggle, #scrollwrapper, #updatestatus, #portal_highlight_select').hide(); + $('#farm_level_select').hide(); + $('#map').css('visibility', 'hidden'); + $('.ui-tooltip').remove(); } From 8be3c99abf1684c2e2d5b5551051e5fb1ef0642f Mon Sep 17 00:00:00 2001 From: fkloft Date: Sat, 19 Oct 2013 19:04:42 +0200 Subject: [PATCH 11/12] Add workaround for touch events (and remove other workaround that didn't work) Leaflet doesn't handle touchcancel events in L.Draggable._onDown. Workaround is similar to 1cecbe7f440249ca68f4f6fef3948032e61843ac --- code/panes.js | 21 --------------------- code/utils_misc.js | 10 ++++++++++ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/code/panes.js b/code/panes.js index cf904f49..4c3898d4 100644 --- a/code/panes.js +++ b/code/panes.js @@ -1,12 +1,6 @@ // created to start cleaning up "window" interaction // window.show = function(id) { - /* - * disable all map properties when switching to another pane - * because sometimes (bug?) touch events are passed to the map when - * other panes are focussed - */ - window.disableMapProperties(); window.hideall(); switch(id) { @@ -26,7 +20,6 @@ window.show = function(id) { window.debug.console.show(); break; case 'map': - window.enableMapProperties(); window.smartphone.mapButton.click(); $('#portal_highlight_select').show(); $('#farm_level_select').show(); @@ -44,20 +37,6 @@ window.show = function(id) { } } -window.enableMapProperties = function() { - window.map.tap.enable(); - window.map.dragging.enable(); - window.map.touchZoom.enable(); - window.map.doubleClickZoom.enable(); -} - -window.disableMapProperties = function() { - window.map.tap.disable(); - window.map.dragging.disable(); - window.map.touchZoom.disable(); - window.map.doubleClickZoom.disable(); -} - window.hideall = function() { $('#chatcontrols, #chat, #chatinput, #sidebartoggle, #scrollwrapper, #updatestatus, #portal_highlight_select').hide(); $('#farm_level_select').hide(); diff --git a/code/utils_misc.js b/code/utils_misc.js index dc55c6b4..fa34ee5e 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -611,3 +611,13 @@ if(goog && goog.style) { }; } +// Fix Leaflet: handle touchcancel events in Draggable +L.Draggable.prototype._onDownOrig = L.Draggable.prototype._onDown; +L.Draggable.prototype._onDown = function(e) { + L.Draggable.prototype._onDownOrig.apply(this, arguments); + + if(e.type === "touchstart") { + L.DomEvent.on(document, "touchcancel", this._onUp, this); + } +} + From 1b791b36feadb67e23d88f38778fb44d932c21c4 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Sun, 20 Oct 2013 12:52:52 +0200 Subject: [PATCH 12/12] bumped version number --- mobile/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index bfe5e003..2bf270c2 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="56" + android:versionName="0.7.6">