From 22491157f9c4e0307b5d4eacb5219f6296b7ee0c Mon Sep 17 00:00:00 2001 From: winkelement Date: Thu, 28 Feb 2013 20:46:20 +0100 Subject: [PATCH 1/4] Update README.md Update Information about Tampermonkey auto update not working due to TM stable release which fixes that. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 4cb66b4e..0aa40d4b 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,7 @@ Current version is 0.7.8. [See NEWS.md for details](https://github.com/breunigs/ - Confirm once again. - Reload page. -**NOTE: You still need to manually update IITC with Tampermonkey.** There is a bug in the current stable release. It has been fixed in Tampermonkey’s development version. Until it is released, you need to manually update IITC. - -*Note:* Tampermonkey is optional. However, it ~~offers auto-update~~, shows correct version numbers and installing user scripts is much easier. If you have installed the scripts directly into Chrome before, I recommend you switch to Tampermonkey. To do so, uninstall the IITC scripts and click each install link again. Follow the procedure explained above. +*Note:* Tampermonkey is optional. However, it offers auto-update, shows correct version numbers and installing user scripts is much easier. If you have installed the scripts directly into Chrome before, I recommend you switch to Tampermonkey. To do so, uninstall the IITC scripts and click each install link again. Follow the procedure explained above. ### Opera - Download the script: [download](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js) From 573562dffd7bac30a757496b4bc996f6538aeafb Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Thu, 28 Feb 2013 22:03:12 +0100 Subject: [PATCH 2/4] undo always using https for the portal image because some images are taken from panoramio which do not support https properly --- 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 c47a4eee..7ef28a6b 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -45,7 +45,7 @@ window.renderPortalDetails = function(guid) { setPortalIndicators(d); var img = d.imageByUrl && d.imageByUrl.imageUrl - ? d.imageByUrl.imageUrl.replace(/^http:/, 'https:') + ? d.imageByUrl.imageUrl : DEFAULT_PORTAL_IMG; var lat = d.locationE6.latE6; From 6a2603d56609e022447bddc16674dc08be856f29 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Thu, 28 Feb 2013 23:49:21 +0100 Subject: [PATCH 3/4] allow quickly (de)selecting all layers by shift/ctrl/alt/meta clicking an entry in the layer chooser (fixes #232) --- USERGUIDE.md | 5 ++++- code/boot.js | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/USERGUIDE.md b/USERGUIDE.md index 7810daec..cb5497d1 100644 --- a/USERGUIDE.md +++ b/USERGUIDE.md @@ -45,7 +45,10 @@ The chat is split up into several categories. It usually only shows messages for Map Display ----------- -You can customize many aspects of how the map is rendered in the layer chooser. The layer chooser is available from the icon in the top right corner, left of the sidebar. +You can customize many aspects of how the map is rendered in the layer chooser. + +**Layer Chooser:** +The layer chooser is available from the icon in the top right corner, left of the sidebar. The top entries are background maps and you can only have one of them active at a time. The entries on the bottom can be displayed in any combination you like. *Hint:* Modifier-click an entry to quickly hide all other layers. The modifier may be either of these: shift, ctrl, alt, meta. Modifier-click the entry again to select all layers. **Background / Street Map / Base Layer:** All these refer to the same thing. The base layer is stored across sessions. The default one uses OpenStreetMap data with a style that resembles the default Ingress one. There are other styles available. diff --git a/code/boot.js b/code/boot.js index d75d1914..fcb76729 100644 --- a/code/boot.js +++ b/code/boot.js @@ -23,6 +23,25 @@ window.setupLargeImagePreview = function() { }); } +// adds listeners to the layer chooser such that a long press hides +// all custom layers except the long pressed one. +window.setupLayerChooserSelectOne = function() { + $('.leaflet-control-layers-overlays').on('click', 'label', function(e) { + if(!e || !(e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)) return; + + var isChecked = $(this).find('input').is(':checked'); + var checkSize = $('.leaflet-control-layers-overlays input:checked').length; + if((isChecked && checkSize === 1) || checkSize === 0) { + // if nothing is selected or the users long-clicks the only + // selected element, assume all boxes should be checked again + $('.leaflet-control-layers-overlays input:not(:checked)').click(); + } else { + // uncheck all + $('.leaflet-control-layers-overlays input:checked').click(); + $(this).find('input').click(); + } + }); +} window.setupStyles = function() { $('head').append('