From 4f8164ffd74fa4a9ffa0e6901e652781d3dd1050 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Tue, 21 May 2013 05:36:15 +0100
Subject: [PATCH 01/35] add direction arrows after compas direction
---
code/portal_detail_display_tools.js | 4 ++--
main.js | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js
index 6fd989b2..446f141f 100644
--- a/code/portal_detail_display_tools.js
+++ b/code/portal_detail_display_tools.js
@@ -111,7 +111,7 @@ window.getResonatorDetails = function(d) {
// rotates clockwise. So, last one is 7 (southeast).
window.renderResonatorDetails = function(slot, level, nrg, dist, nick) {
if(level === 0) {
- var meter = ' ';
+ var meter = ' ';
} else {
var max = RESO_NRG[level];
var fillGrade = nrg/max*100;
@@ -120,7 +120,7 @@ window.renderResonatorDetails = function(slot, level, nrg, dist, nick) {
+ 'level:\t' + level + '\n'
+ 'distance:\t' + dist + 'm\n'
+ 'owner:\t' + nick + '\n'
- + 'octant:\t' + OCTANTS[slot];
+ + 'octant:\t' + OCTANTS[slot] + ' ' + OCTANTS_ARROW[slot];
var style = 'width:'+fillGrade+'%; background:'+COLORS_LVL[level]+';';
diff --git a/main.js b/main.js
index 1416fe94..217daa77 100644
--- a/main.js
+++ b/main.js
@@ -199,6 +199,7 @@ window.MAX_XM_PER_LEVEL = [0, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000];
window.MIN_AP_FOR_LEVEL = [0, 10000, 30000, 70000, 150000, 300000, 600000, 1200000];
window.HACK_RANGE = 40; // in meters, max. distance from portal to be able to access it
window.OCTANTS = ['E', 'NE', 'N', 'NW', 'W', 'SW', 'S', 'SE'];
+window.OCTANTS_ARROW = ['→', '↗', '↑', '↖', '←', '↙', '↓', '↘'];
window.DESTROY_RESONATOR = 75; //AP for destroying portal
window.DESTROY_LINK = 187; //AP for destroying link
window.DESTROY_FIELD = 750; //AP for destroying field
From 5e4e8fee6bc489dd4978047092a473564bb7c9ca Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Wed, 22 May 2013 14:31:08 +0100
Subject: [PATCH 02/35] portals list plugin only includes portals in the view -
to match portals-count
---
plugins/portals-list.user.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js
index 5fe38471..7f5f0b65 100644
--- a/plugins/portals-list.user.js
+++ b/plugins/portals-list.user.js
@@ -1,7 +1,7 @@
// ==UserScript==
// @id iitc-plugin-portals-list@teo96
// @name IITC plugin: show list of portals
-// @version 0.0.12.@@DATETIMEVERSION@@
+// @version 0.0.13.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -54,9 +54,13 @@ window.plugin.portalslist.getPortals = function() {
//console.log('** getPortals');
var retval=false;
+ var displayBounds = map.getBounds();
+
window.plugin.portalslist.listPortals = [];
//get portals informations from IITC
$.each(window.portals, function(i, portal) {
+ // eliminate offscreen portals (selected, and in padding)
+ if(!displayBounds.contains(portal.getLatLng())) return true;
retval=true;
var d = portal.options.details;
From 140c5c2cb91c3adde8c8da505e6ea83c3f473ae6 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Wed, 22 May 2013 17:35:59 +0100
Subject: [PATCH 03/35] re-do request bucket handling - instead of grouping up
to four requests together, so large window sizes make more requests, group
requests into max 4 blocks I think this is closer to the stock intel site
behaviour, and should vastly reduce requests, especially at high resolutions
---
code/map_data.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/code/map_data.js b/code/map_data.js
index 10372b77..1edd99bc 100644
--- a/code/map_data.js
+++ b/code/map_data.js
@@ -29,7 +29,7 @@ window.requestData = function() {
for (var x = x1; x <= x2; x++) {
for (var y = y1; y <= y2; y++) {
var tile_id = pointToTileId(z, x, y);
- var bucket = Math.floor(x / 2) + "" + Math.floor(y / 2);
+ var bucket = (x % 2) + ":" + (y % 2);
if (!tiles[bucket])
tiles[bucket] = [];
tiles[bucket].push(generateBoundsParams(
@@ -44,6 +44,7 @@ window.requestData = function() {
// Reset previous result of Portal Render Limit handler
portalRenderLimit.init();
+
// finally send ajax requests
$.each(tiles, function(ind, tls) {
data = { zoom: z };
From b05554e0fc2816d329c5618d04700de660704a18 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Wed, 22 May 2013 18:55:41 +0100
Subject: [PATCH 04/35] bump IITC mobile version to 0.4.0
---
mobile/AndroidManifest.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
index 5c3b887b..c40ad029 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -1,8 +1,8 @@
+ android:versionCode="21"
+ android:versionName="0.4.0" >
Date: Wed, 22 May 2013 19:21:50 +0100
Subject: [PATCH 05/35] add news entry for new 0.12.0 + 0.4.0 releases
---
website/page/home.php | 26 ++++++++++++--------------
website/page/news.php | 15 +++++++++++++++
2 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/website/page/home.php b/website/page/home.php
index 7bdff5c4..29855a9a 100644
--- a/website/page/home.php
+++ b/website/page/home.php
@@ -13,22 +13,20 @@ offers many more features. It is available for
Latest news
-2nd May 2013
-
-IITC version 0.11.3 has been released. This should vastly reduce the chance of getting REQUEST_FAILED errors
-while scrolling/zooming the map frequently. The passcode redemption code has been updated, and there are improvements
-to the URL link handling. The portals-list plugin has been updated, and bug fixes made to the
-player tracker. A new plugin to show portal levels as numbers has been added too.
-
-
-IITC Mobile 0.3.2 is also available. Along with the above, this includes a new option to show your current
-position on the map.
-
-28th April 2013
+22nd May 2013
-New website launched! A major revamp of the website has been made. Thanks to the various users who contributed
-logos and site templates.
+IITC version 0.12.0 has been released. This contains quite a few changes and new features, including
+
+Portal highlighter system - and many portal highlighter plugins
+Dialogs - can be kept open and dragged while viewing the map
+Layers - the enabled layers are now remembered when you next load the intel site
+Improved request limits - more improvements have been made in this area
+Sync plugin - to sync data from the 'Keys' addon to multiple computers via Google Drive
+... and many other tweaks, bug fixes, etc
+
+IITC Mobile 0.4.0 is also released. THis has also had major work. Along with the above, it includes a
+new in-app layer chooser and chat/map switcher.
Older news
diff --git a/website/page/news.php b/website/page/news.php
index 9084745f..6efedfee 100644
--- a/website/page/news.php
+++ b/website/page/news.php
@@ -1,5 +1,20 @@
News
+22nd May 2013
+
+IITC version 0.12.0 has been released. This contains quite a few changes and new features, including
+
+Portal highlighter system - and many portal highlighter plugins
+Dialogs - can be kept open and dragged while viewing the map
+Layers - the enabled layers are now remembered when you next load the intel site
+Improved request limits - more improvements have been made in this area
+Sync plugin - to sync data from the 'Keys' addon to multiple computers via Google Drive
+... and many other tweaks, bug fixes, etc
+
+IITC Mobile 0.4.0 is also released. THis has also had major work. Along with the above, it includes a
+new in-app layer chooser and chat/map switcher.
+
+
2nd May 2013
IITC version 0.11.3 has been released. This should vastly reduce the chance of getting REQUEST_FAILED errors
From 6a292d895554987a265268d0e04459a76ffbda53 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Wed, 22 May 2013 19:26:30 +0100
Subject: [PATCH 06/35] website update - one important thing missed from mobile
section
---
website/page/home.php | 3 ++-
website/page/news.php | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/website/page/home.php b/website/page/home.php
index 29855a9a..07a8b8e1 100644
--- a/website/page/home.php
+++ b/website/page/home.php
@@ -26,7 +26,8 @@ IITC version 0.12.0 has been released. This contains quite a few changes and new
... and many other tweaks, bug fixes, etc
IITC Mobile 0.4.0 is also released. THis has also had major work. Along with the above, it includes a
-new in-app layer chooser and chat/map switcher.
+new in-app layer chooser and chat/map switcher, and authentication has been revamped to use the native
+Android authentication rather than entering your password.
Older news
diff --git a/website/page/news.php b/website/page/news.php
index 6efedfee..fdec6933 100644
--- a/website/page/news.php
+++ b/website/page/news.php
@@ -12,7 +12,8 @@ IITC version 0.12.0 has been released. This contains quite a few changes and new
... and many other tweaks, bug fixes, etc
IITC Mobile 0.4.0 is also released. THis has also had major work. Along with the above, it includes a
-new in-app layer chooser and chat/map switcher.
+new in-app layer chooser and chat/map switcher, and authentication has been revamped to use the native
+Android authentication rather than entering your password.
2nd May 2013
From d31d010c875ddf0a93091cb69f236ebf9cf5a8b5 Mon Sep 17 00:00:00 2001
From: Philipp Schaefer
Date: Wed, 22 May 2013 21:25:00 +0200
Subject: [PATCH 07/35] removed the layer chooser issue from webpage. with v0.4
it's not an issue anymore
---
website/page/mobile.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/website/page/mobile.php b/website/page/mobile.php
index 51a8cbe3..a5af10dc 100644
--- a/website/page/mobile.php
+++ b/website/page/mobile.php
@@ -26,7 +26,6 @@ install from the link below.
IITC Mobile is still in the early stages of development. Many things do not yet work right. Major known issues are:
-The layer chooser selects the first map layer every time it's opened.
Some plugins do not work well, or at all, at this time.
Serious issues exist on Android 4.0 devices.
details .
From f428e3037c02d6b0e4a1930754eca91e5140ff39 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 23 May 2013 05:31:46 +0100
Subject: [PATCH 08/35] base map plugins - openstreetmap - not suitable for
high load use, but an optional layer in an optional plugin should be ok for
them - thunderforest opencyclemap, etc - free for use, no api key or
notification required
---
plugins/basemap-opencyclemap.user.js | 58 +++++++++++++++++++++++++++
plugins/basemap-openstreetmap.user.js | 55 +++++++++++++++++++++++++
2 files changed, 113 insertions(+)
create mode 100644 plugins/basemap-opencyclemap.user.js
create mode 100644 plugins/basemap-openstreetmap.user.js
diff --git a/plugins/basemap-opencyclemap.user.js b/plugins/basemap-opencyclemap.user.js
new file mode 100644
index 00000000..a024ec00
--- /dev/null
+++ b/plugins/basemap-opencyclemap.user.js
@@ -0,0 +1,58 @@
+// ==UserScript==
+// @id iitc-plugin-basemap-opencyclepam@jonatkins
+// @name IITC plugin: OpenCycleMap.org map tiles
+// @version 0.1.0.@@DATETIMEVERSION@@
+// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
+// @updateURL @@UPDATEURL@@
+// @downloadURL @@DOWNLOADURL@@
+// @description [@@BUILDNAME@@-@@BUILDDATE@@] Add the OpenCycleMap.org map tiles as an optional layer
+// @include https://www.ingress.com/intel*
+// @include http://www.ingress.com/intel*
+// @match https://www.ingress.com/intel*
+// @match http://www.ingress.com/intel*
+// @grant none
+// ==/UserScript==
+
+function wrapper() {
+// ensure plugin framework is there, even if iitc is not yet loaded
+if(typeof window.plugin !== 'function') window.plugin = function() {};
+
+
+// PLUGIN START ////////////////////////////////////////////////////////
+
+
+// use own namespace for plugin
+window.plugin.mapTileOpenCycleMap = function() {};
+
+window.plugin.mapTileOpenCycleMap.addLayer = function() {
+
+ //the Thunderforest (OpenCycleMap) tiles are free to use - http://www.thunderforest.com/terms/
+
+ osmAttribution = 'Map data © OpenStreetMap';
+ var ocmOpt = {attribution: 'Tiles © OpenCycleMap, '+osmAttribution, maxZoom: 18};
+ var ocmCycle = new L.TileLayer('http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', ocmOpt);
+ var ocmTransport = new L.TileLayer('http://{s}.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png', ocmOpt);
+ var ocmLandscape = new L.TileLayer('http://{s}.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png', ocmOpt);
+
+ layerChooser.addBaseLayer(ocmCycle, "Thunderforest OpenCycleMap");
+ layerChooser.addBaseLayer(ocmTransport, "Thunderforest Transport");
+ layerChooser.addBaseLayer(ocmLandscape, "Thunderforest Landscape");
+};
+
+var setup = window.plugin.mapTileOpenCycleMap.addLayer;
+
+// PLUGIN END //////////////////////////////////////////////////////////
+
+if(window.iitcLoaded && typeof setup === 'function') {
+ setup();
+} else {
+ if(window.bootPlugins)
+ window.bootPlugins.push(setup);
+ else
+ window.bootPlugins = [setup];
+}
+} // wrapper end
+// inject code into site context
+var script = document.createElement('script');
+script.appendChild(document.createTextNode('('+ wrapper +')();'));
+(document.body || document.head || document.documentElement).appendChild(script);
diff --git a/plugins/basemap-openstreetmap.user.js b/plugins/basemap-openstreetmap.user.js
new file mode 100644
index 00000000..57122fb8
--- /dev/null
+++ b/plugins/basemap-openstreetmap.user.js
@@ -0,0 +1,55 @@
+// ==UserScript==
+// @id iitc-plugin-basemap-openstreetpam@jonatkins
+// @name IITC plugin: OpenStreetMap.org map tiles
+// @version 0.1.0.@@DATETIMEVERSION@@
+// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
+// @updateURL @@UPDATEURL@@
+// @downloadURL @@DOWNLOADURL@@
+// @description [@@BUILDNAME@@-@@BUILDDATE@@] Add the native OpenStreetMap.org map tiles as an optional layer
+// @include https://www.ingress.com/intel*
+// @include http://www.ingress.com/intel*
+// @match https://www.ingress.com/intel*
+// @match http://www.ingress.com/intel*
+// @grant none
+// ==/UserScript==
+
+function wrapper() {
+// ensure plugin framework is there, even if iitc is not yet loaded
+if(typeof window.plugin !== 'function') window.plugin = function() {};
+
+
+// PLUGIN START ////////////////////////////////////////////////////////
+
+
+// use own namespace for plugin
+window.plugin.mapTileOpenStreetMap = function() {};
+
+window.plugin.mapTileOpenStreetMap.addLayer = function() {
+
+ //OpenStreetMap tiles - we shouldn't use these by default - https://wiki.openstreetmap.org/wiki/Tile_usage_policy
+ // "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators"
+
+ osmAttribution = 'Map data © OpenStreetMap contributors';
+ var osmOpt = {attribution: osmAttribution, maxZoom: 18};
+ var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt);
+
+ layerChooser.addBaseLayer(osm, "OpenStreetMap");
+};
+
+var setup = window.plugin.mapTileOpenStreetMap.addLayer;
+
+// PLUGIN END //////////////////////////////////////////////////////////
+
+if(window.iitcLoaded && typeof setup === 'function') {
+ setup();
+} else {
+ if(window.bootPlugins)
+ window.bootPlugins.push(setup);
+ else
+ window.bootPlugins = [setup];
+}
+} // wrapper end
+// inject code into site context
+var script = document.createElement('script');
+script.appendChild(document.createTextNode('('+ wrapper +')();'));
+(document.body || document.head || document.documentElement).appendChild(script);
From cd59eb0ecec746d7ab8de40eac6914fddb5e5cae Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 23 May 2013 05:44:01 +0100
Subject: [PATCH 09/35] add blank map layer - for #220
---
plugins/basemap-blank-tile.png | Bin 0 -> 562 bytes
plugins/basemap-blank.user.js | 51 +++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
create mode 100644 plugins/basemap-blank-tile.png
create mode 100644 plugins/basemap-blank.user.js
diff --git a/plugins/basemap-blank-tile.png b/plugins/basemap-blank-tile.png
new file mode 100644
index 0000000000000000000000000000000000000000..a33849557dcd503f6dd045f78f7f70a809ce915e
GIT binary patch
literal 562
zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911L)MWvCLm=m;r;B4q#jUrO4S5+Dcn)v)
zq<;6_VFPKWB}+a;s2pHOU@%~iVBle3V_
Date: Thu, 23 May 2013 05:50:44 +0100
Subject: [PATCH 10/35] remove now redundant commented out map layers - OSM
tiles are now in a plugin
---
code/boot.js | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/code/boot.js b/code/boot.js
index 6c4f64c9..aa3ee313 100644
--- a/code/boot.js
+++ b/code/boot.js
@@ -125,13 +125,9 @@ window.setupMap = function() {
//OpenStreetMap attribution - required by several of the layers
osmAttribution = 'Map data © OpenStreetMap contributors';
- //OpenStreetMap tiles - we shouldn't use these by default, or even an option - https://wiki.openstreetmap.org/wiki/Tile_usage_policy
- // "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators"
- //var osmOpt = {attribution: osmAttribution, maxZoom: 18, detectRetina: true};
- //var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmOpt);
//CloudMade layers - only 500,000 tiles/month in their free plan. nowhere near enough for IITC
- var cmOpt = {attribution: osmAttribution+', Imagery © CloudMade', maxZoom: 18, detectRetina: true};
+ //var cmOpt = {attribution: osmAttribution+', Imagery © CloudMade', maxZoom: 18, detectRetina: true};
//var cmMin = new L.TileLayer('http://{s}.tile.cloudmade.com/{your api key here}/22677/256/{z}/{x}/{y}.png', cmOpt);
//var cmMid = new L.TileLayer('http://{s}.tile.cloudmade.com/{your api key here}/999/256/{z}/{x}/{y}.png', cmOpt);
From ab8018c795425d6d30afe92b44bc2e9bd9d143bb Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 15:49:33 +1000
Subject: [PATCH 11/35] Setup support for Android Studio Preview
---
.gitignore | 32 ++++++++++++++++--
mobile/.idea/.name | 1 +
mobile/.idea/compiler.xml | 23 +++++++++++++
mobile/.idea/copyright/profiles_settings.xml | 5 +++
mobile/.idea/encodings.xml | 5 +++
mobile/.idea/misc.xml | 7 ++++
mobile/.idea/modules.xml | 9 +++++
mobile/.idea/scopes/scope_settings.xml | 5 +++
mobile/.idea/vcs.xml | 8 +++++
mobile/build.gradle | 35 ++++++++++++++++++++
mobile/mobile.iml | 24 ++++++++++++++
11 files changed, 152 insertions(+), 2 deletions(-)
create mode 100644 mobile/.idea/.name
create mode 100644 mobile/.idea/compiler.xml
create mode 100644 mobile/.idea/copyright/profiles_settings.xml
create mode 100644 mobile/.idea/encodings.xml
create mode 100644 mobile/.idea/misc.xml
create mode 100644 mobile/.idea/modules.xml
create mode 100644 mobile/.idea/scopes/scope_settings.xml
create mode 100644 mobile/.idea/vcs.xml
create mode 100644 mobile/build.gradle
create mode 100644 mobile/mobile.iml
diff --git a/.gitignore b/.gitignore
index d2d07c24..60ba8b97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,35 @@
-mobile/IngressIntelTC/bin
build
localbuildsettings.py
*.pyc
*.swp
*~
-*.bak
+
+# built application files
+*.apk
+*.ap_
+
+# files for the dex VM
+*.dex
+
+# Java class files
+*.class
+
+# generated files
+mobile/bin/
+mobile/gen/
+mobile/out/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Eclipse project files
+.classpath
+.project
+
+# IntelliJ IDEA user settings
+*.iws
+mobile/.idea/workspace.xml
+mobile/.idea/tasks.xml
+
+# Proguard logs
+mobile/proguard_logs/
diff --git a/mobile/.idea/.name b/mobile/.idea/.name
new file mode 100644
index 00000000..f01786c6
--- /dev/null
+++ b/mobile/.idea/.name
@@ -0,0 +1 @@
+IITC Mobile
\ No newline at end of file
diff --git a/mobile/.idea/compiler.xml b/mobile/.idea/compiler.xml
new file mode 100644
index 00000000..217af471
--- /dev/null
+++ b/mobile/.idea/compiler.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mobile/.idea/copyright/profiles_settings.xml b/mobile/.idea/copyright/profiles_settings.xml
new file mode 100644
index 00000000..3572571a
--- /dev/null
+++ b/mobile/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/.idea/encodings.xml b/mobile/.idea/encodings.xml
new file mode 100644
index 00000000..e206d70d
--- /dev/null
+++ b/mobile/.idea/encodings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/mobile/.idea/misc.xml b/mobile/.idea/misc.xml
new file mode 100644
index 00000000..1e86ba3b
--- /dev/null
+++ b/mobile/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/mobile/.idea/modules.xml b/mobile/.idea/modules.xml
new file mode 100644
index 00000000..16ec7d18
--- /dev/null
+++ b/mobile/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/mobile/.idea/scopes/scope_settings.xml b/mobile/.idea/scopes/scope_settings.xml
new file mode 100644
index 00000000..922003b8
--- /dev/null
+++ b/mobile/.idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/.idea/vcs.xml b/mobile/.idea/vcs.xml
new file mode 100644
index 00000000..2e0588cc
--- /dev/null
+++ b/mobile/.idea/vcs.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/mobile/build.gradle b/mobile/build.gradle
new file mode 100644
index 00000000..2fa22689
--- /dev/null
+++ b/mobile/build.gradle
@@ -0,0 +1,35 @@
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.4'
+ }
+}
+apply plugin: 'android'
+
+dependencies {
+}
+
+android {
+ compileSdkVersion 17
+ buildToolsVersion "17"
+
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 17
+ }
+ sourceSets {
+ main {
+ manifest.srcFile 'AndroidManifest.xml'
+ java.srcDirs = ['src']
+ resources.srcDirs = ['src']
+ aidl.srcDirs = ['src']
+ renderscript.srcDirs = ['src']
+ res.srcDirs = ['res']
+ assets.srcDirs = ['assets']
+ }
+
+ instrumentTest.setRoot('tests')
+ }
+}
diff --git a/mobile/mobile.iml b/mobile/mobile.iml
new file mode 100644
index 00000000..33d9962c
--- /dev/null
+++ b/mobile/mobile.iml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ MANIFEST_FILE_PATH
+ RESOURCES_DIR_PATH
+ ASSETS_DIR_PATH
+ NATIVE_LIBS_DIR_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 009691c81309219c52cad3562efdcac6c8d41e2a Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 16:02:54 +1000
Subject: [PATCH 12/35] Restored *.bak to .gitignore
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 60ba8b97..9db43cbc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@ localbuildsettings.py
*.pyc
*.swp
*~
+*.bak
# built application files
*.apk
From 98c90d4b16c0efe3a3d482bead54eb0de95eda98 Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 16:42:41 +1000
Subject: [PATCH 13/35] Fixed output APK name to be the same as ADT
---
mobile/.idea/modules.xml | 2 +-
mobile/IITC-Mobile.iml | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 mobile/IITC-Mobile.iml
diff --git a/mobile/.idea/modules.xml b/mobile/.idea/modules.xml
index 16ec7d18..c7429177 100644
--- a/mobile/.idea/modules.xml
+++ b/mobile/.idea/modules.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/mobile/IITC-Mobile.iml b/mobile/IITC-Mobile.iml
new file mode 100644
index 00000000..33d9962c
--- /dev/null
+++ b/mobile/IITC-Mobile.iml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ MANIFEST_FILE_PATH
+ RESOURCES_DIR_PATH
+ ASSETS_DIR_PATH
+ NATIVE_LIBS_DIR_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 83e324f8aa3a66fdd44431c7ca3fbdf854def835 Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 16:44:09 +1000
Subject: [PATCH 14/35] Forgot to delete old iml file
---
mobile/mobile.iml | 24 ------------------------
1 file changed, 24 deletions(-)
delete mode 100644 mobile/mobile.iml
diff --git a/mobile/mobile.iml b/mobile/mobile.iml
deleted file mode 100644
index 33d9962c..00000000
--- a/mobile/mobile.iml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
- MANIFEST_FILE_PATH
- RESOURCES_DIR_PATH
- ASSETS_DIR_PATH
- NATIVE_LIBS_DIR_PATH
-
-
-
-
-
-
-
-
-
-
-
-
-
-
From b2376676c429aea8a1e545caf524302652e72f9d Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 17:01:20 +1000
Subject: [PATCH 15/35] Fixed build not including src files.
---
mobile/IITC-Mobile.iml | 1 +
1 file changed, 1 insertion(+)
diff --git a/mobile/IITC-Mobile.iml b/mobile/IITC-Mobile.iml
index 33d9962c..26779940 100644
--- a/mobile/IITC-Mobile.iml
+++ b/mobile/IITC-Mobile.iml
@@ -16,6 +16,7 @@
+
From a808434fd439eda21935d3be56ae164fe99acdda Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 17:22:59 +1000
Subject: [PATCH 16/35] Tried to recreate things.
---
mobile/.idea/.name | 2 +-
mobile/.idea/misc.xml | 143 +++++++++++++++++++++++++++++++++++++++
mobile/.idea/modules.xml | 2 +-
mobile/mobile.iml | 18 +++++
4 files changed, 163 insertions(+), 2 deletions(-)
create mode 100644 mobile/mobile.iml
diff --git a/mobile/.idea/.name b/mobile/.idea/.name
index f01786c6..d884b924 100644
--- a/mobile/.idea/.name
+++ b/mobile/.idea/.name
@@ -1 +1 @@
-IITC Mobile
\ No newline at end of file
+IITC-Mobile
\ No newline at end of file
diff --git a/mobile/.idea/misc.xml b/mobile/.idea/misc.xml
index 1e86ba3b..f6c044c7 100644
--- a/mobile/.idea/misc.xml
+++ b/mobile/.idea/misc.xml
@@ -1,7 +1,150 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ localhost
+ 5050
+
+
+
+
+
+
+ Android 4.2.2 Platform
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mobile/.idea/modules.xml b/mobile/.idea/modules.xml
index c7429177..16ec7d18 100644
--- a/mobile/.idea/modules.xml
+++ b/mobile/.idea/modules.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/mobile/mobile.iml b/mobile/mobile.iml
new file mode 100644
index 00000000..4606c0df
--- /dev/null
+++ b/mobile/mobile.iml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From c584315010206b03dbd3d94b5e7f7af9a7c09fa1 Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 17:28:04 +1000
Subject: [PATCH 17/35] Finally working and tested. *blush*
---
mobile/.idea/misc.xml | 16 ----------------
mobile/mobile.iml | 9 ++++++++-
2 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/mobile/.idea/misc.xml b/mobile/.idea/misc.xml
index f6c044c7..5997eabb 100644
--- a/mobile/.idea/misc.xml
+++ b/mobile/.idea/misc.xml
@@ -130,21 +130,5 @@
5050
-
-
-
-
- Android 4.2.2 Platform
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mobile/mobile.iml b/mobile/mobile.iml
index 4606c0df..25a68b77 100644
--- a/mobile/mobile.iml
+++ b/mobile/mobile.iml
@@ -2,7 +2,14 @@
-
+
+
+ MANIFEST_FILE_PATH
+ RESOURCES_DIR_PATH
+ ASSETS_DIR_PATH
+ NATIVE_LIBS_DIR_PATH
+
+
From ed0e1be9e1dceb6f31a57ae9617c2a79ce7f8f4a Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 17:54:08 +1000
Subject: [PATCH 18/35] Added proguard-project file back as building with it
requires it. Moved .gitignore changes to mobile/.gitignore
---
.gitignore | 26 --------------------------
mobile/.gitignore | 33 ++++++++++++++++++++++++++-------
mobile/proguard-project.txt | 11 +++++++++++
3 files changed, 37 insertions(+), 33 deletions(-)
create mode 100644 mobile/proguard-project.txt
diff --git a/.gitignore b/.gitignore
index 9db43cbc..10a79255 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,29 +8,3 @@ localbuildsettings.py
# built application files
*.apk
*.ap_
-
-# files for the dex VM
-*.dex
-
-# Java class files
-*.class
-
-# generated files
-mobile/bin/
-mobile/gen/
-mobile/out/
-
-# Local configuration file (sdk path, etc)
-local.properties
-
-# Eclipse project files
-.classpath
-.project
-
-# IntelliJ IDEA user settings
-*.iws
-mobile/.idea/workspace.xml
-mobile/.idea/tasks.xml
-
-# Proguard logs
-mobile/proguard_logs/
diff --git a/mobile/.gitignore b/mobile/.gitignore
index 42e4ba7c..d03e2a28 100644
--- a/mobile/.gitignore
+++ b/mobile/.gitignore
@@ -1,11 +1,30 @@
-.classpath
-.project
.settings/
-bin/
-gen/
-libs/
-proguard-project.txt
-local.properties
assets/total-conversion-build.user.js
assets/user-location.user.js
assets/plugins/
+
+# files for the dex VM
+*.dex
+
+# Java class files
+*.class
+
+# generated files
+bin/
+gen/
+out/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Eclipse project files
+.classpath
+.project
+
+# IntelliJ IDEA user settings
+*.iws
+.idea/workspace.xml
+.idea/tasks.xml
+
+# Proguard logs
+proguard_logs/
diff --git a/mobile/proguard-project.txt b/mobile/proguard-project.txt
new file mode 100644
index 00000000..f165b3bd
--- /dev/null
+++ b/mobile/proguard-project.txt
@@ -0,0 +1,11 @@
+# view res/xml/preferences.xml #generated:4
+-keep class com.cradle.iitc_mobile.IITC_AboutDialogPreference { (...); }
+
+# view AndroidManifest.xml #generated:23
+-keep class com.cradle.iitc_mobile.IITC_Mobile { (...); }
+
+# view AndroidManifest.xml #generated:40
+-keep class com.cradle.iitc_mobile.IITC_Settings { (...); }
+
+# view res/layout/activity_main.xml #generated:6
+-keep class com.cradle.iitc_mobile.IITC_WebView { (...); }
From dfc18e84f5be3f448e6b408b070a7ee5e244f105 Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 18:14:01 +1000
Subject: [PATCH 19/35] Forgot to move some settings in gitignores.
---
.gitignore | 4 ----
mobile/.gitignore | 4 ++++
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index 10a79255..af7e35cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,3 @@ localbuildsettings.py
*.swp
*~
*.bak
-
-# built application files
-*.apk
-*.ap_
diff --git a/mobile/.gitignore b/mobile/.gitignore
index d03e2a28..2f94c701 100644
--- a/mobile/.gitignore
+++ b/mobile/.gitignore
@@ -3,6 +3,10 @@ assets/total-conversion-build.user.js
assets/user-location.user.js
assets/plugins/
+# built application files
+*.apk
+*.ap_
+
# files for the dex VM
*.dex
From 04d2e60d75176ddc377417c77aff39cfce86ca66 Mon Sep 17 00:00:00 2001
From: hastarin
Date: Thu, 23 May 2013 20:32:52 +1000
Subject: [PATCH 20/35] This is a version of the multi window patch minus
Android Studio changes. Proguard changes are excluded since there is no
config in the master branch
---
mobile/AndroidManifest.xml | 62 +++++++++++++++++++++++++++---------
mobile/res/values/dimens.xml | 4 +++
2 files changed, 51 insertions(+), 15 deletions(-)
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
index c40ad029..894d0d6f 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -1,18 +1,18 @@
+ package="com.cradle.iitc_mobile"
+ android:versionCode="21"
+ android:versionName="0.4.0">
+ android:targetSdkVersion="17"/>
-
-
-
-
-
+
+
+
+
+
+ android:configChanges="orientation|keyboard|keyboardHidden|screenSize">
-
-
+
+
+
+
+
-
-
+
+
+
+ android:configChanges="orientation|keyboard|keyboardHidden|screenSize">
+
+
+
+
+
+
+
+
+
+
diff --git a/mobile/res/values/dimens.xml b/mobile/res/values/dimens.xml
index a6dd1403..4fb5f825 100644
--- a/mobile/res/values/dimens.xml
+++ b/mobile/res/values/dimens.xml
@@ -3,5 +3,9 @@
16dp
16dp
+ 640dip
+ 400dip
+ 400dip
+ 200dip
\ No newline at end of file
From d61c5cc752320836a7227461c0eace14f86f0bba Mon Sep 17 00:00:00 2001
From: Philipp Schaefer
Date: Thu, 23 May 2013 13:18:01 +0200
Subject: [PATCH 21/35] 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 894d0d6f..f9fc9e4d 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -1,8 +1,8 @@
+ android:versionCode="22"
+ android:versionName="0.4.1">
Date: Thu, 23 May 2013 13:44:00 +0200
Subject: [PATCH 22/35] fixed typo in API
---
mobile/src/com/cradle/iitc_mobile/IITC_DeviceAccountLogin.java | 2 +-
mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_DeviceAccountLogin.java b/mobile/src/com/cradle/iitc_mobile/IITC_DeviceAccountLogin.java
index ba0ce3d1..db9511ff 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_DeviceAccountLogin.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_DeviceAccountLogin.java
@@ -153,7 +153,7 @@ public class IITC_DeviceAccountLogin implements AccountManagerCallback {
if (result != null) {
// authentication succeded, we can load the given url, which will redirect back to the intel map
mWebView.loadUrl(result);
- mActivity.loginSucceded();
+ mActivity.loginSucceeded();
} else {
onLoginFailed();
}
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
index 2af11b89..88604777 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
@@ -399,7 +399,7 @@ public class IITC_Mobile extends Activity {
/**
* called after successful login
*/
- public void loginSucceded() {
+ public void loginSucceeded() {
// garbage collection
mLogin = null;
}
From 9e540bb4570d8dc657ed418da054335d47e39cf6 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 23 May 2013 18:07:59 +0100
Subject: [PATCH 23/35] add a template plugin for the old cloudmade.com maps.
users need to register to get their own API key for this
---
plugins/basemap-cloudmade.user.js | 96 +++++++++++++++++++++++++++++++
1 file changed, 96 insertions(+)
create mode 100755 plugins/basemap-cloudmade.user.js
diff --git a/plugins/basemap-cloudmade.user.js b/plugins/basemap-cloudmade.user.js
new file mode 100755
index 00000000..41470b89
--- /dev/null
+++ b/plugins/basemap-cloudmade.user.js
@@ -0,0 +1,96 @@
+//******************************
+//******************************
+//******** INSTRUCTIONS ********
+//******************************
+//******************************
+
+// 1. Go to the www.cloudmade.com website and register an account
+// 2. Get an API Key
+// 3. Edit the clode below, replace YOUR_API_KEY with the API key from CloudMade.com
+// 4. Reload the page
+// optional: browse their map styles, add/modify any you like to the cmStyles list
+
+//******************************
+//******************************
+//******************************
+
+
+// ==UserScript==
+// @id iitc-plugin-cloudmade-maps
+// @name IITC plugin: CloudMade.com maps
+// @version 0.0.1
+// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
+// @description TEMPLATE PLUGIN - add back the CloudMade.com map layers. YOU WILL NEED TO EDIT THIS PLUGIN BEFORE IT WILL RUN
+// @include https://www.ingress.com/intel*
+// @include http://www.ingress.com/intel*
+// @match https://www.ingress.com/intel*
+// @match http://www.ingress.com/intel*
+// ==/UserScript==
+
+function wrapper() {
+// ensure plugin framework is there, even if iitc is not yet loaded
+if(typeof window.plugin !== 'function') window.plugin = function() {};
+
+
+// PLUGIN START ////////////////////////////////////////////////////////
+
+window.plugin.mapTileCloudMade = function() {};
+
+window.plugin.mapTileCloudMade.setup = function() {
+ //**********************************
+ //**********************************
+ //**** CloudMade settings start ****
+ //**********************************
+ //**********************************
+
+ //set this to your API key - get an API key by registering at www.cloudmade.com
+ //e.g. var cmApiKey = '8ee2a50541944fb9bcedded5165f09d9';
+ var cmApiKey = 'YOUR_API_KEY';
+
+ //the list of styles you'd like to see
+ var cmStyles = {
+ '999': "Midnight",
+ '22677': "Minimal",
+ '78603': "Armageddon",
+ };
+
+ //**********************************
+ //**********************************
+ //**** CloudMade settings end ****
+ //**********************************
+ //**********************************
+
+
+ if(cmApiKey=='YOUR_API_KEY') {
+ dialog({title: 'CloudMade.com map plugin', text: 'The CloudMade.com plugin needs manual configuration. Edit the plugin code to do this.'});
+ return;
+ }
+
+ var osmAttribution = 'Map data © OpenStreetMap contributors';
+ var cmOpt = {attribution: osmAttribution+', Imagery © CloudMade', maxZoom: 18, apikey: cmApiKey};
+
+ $.each(cmStyles, function(key,value) {
+ cmOpt['style'] = key;
+ var cmMap = new L.TileLayer('http://{s}.tile.cloudmade.com/{apikey}/{style}/256/{z}/{x}/{y}.png', cmOpt);
+ layerChooser.addBaseLayer(cmMap, 'CloudMade '+value);
+ });
+
+};
+
+var setup = window.plugin.mapTileCloudMade.setup;
+
+// PLUGIN END //////////////////////////////////////////////////////////
+
+if(window.iitcLoaded && typeof setup === 'function') {
+ setup();
+} else {
+ if(window.bootPlugins)
+ window.bootPlugins.push(setup);
+ else
+ window.bootPlugins = [setup];
+}
+} // wrapper end
+// inject code into site context
+var script = document.createElement('script');
+script.appendChild(document.createTextNode('('+ wrapper +')();'));
+(document.body || document.head || document.documentElement).appendChild(script);
From f4027881b4d22287f83083a574810bfda645bae7 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 23 May 2013 18:12:39 +0100
Subject: [PATCH 24/35] add some disclaimers to the CloudMade map plugin
comments
---
plugins/basemap-cloudmade.user.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/plugins/basemap-cloudmade.user.js b/plugins/basemap-cloudmade.user.js
index 41470b89..b6857696 100755
--- a/plugins/basemap-cloudmade.user.js
+++ b/plugins/basemap-cloudmade.user.js
@@ -10,6 +10,12 @@
// 4. Reload the page
// optional: browse their map styles, add/modify any you like to the cmStyles list
+// You take your own responsibility for any API key you register and use. Please read
+// any relevant terms and conditions. At the time of writing, Cloudmade offer a reasonable
+// number of free requests, which should be more than enough for personal use. You could
+// probably share a key with a group of people without issues, but it is your responsibility
+// to remain within any terms and usage limits.
+
//******************************
//******************************
//******************************
From 98e927fb0f760a0315873fc826abe7790ec38fbe Mon Sep 17 00:00:00 2001
From: hastarin
Date: Fri, 24 May 2013 12:04:23 +1000
Subject: [PATCH 25/35] Have everything working now if you don't enable
ProGuard. It will take time to determine how it needs to be configured but
that's low priority really.
---
mobile/.idea/misc.xml | 124 ------------------------------------
mobile/.idea/modules.xml | 2 +-
mobile/IITC-Mobile.iml | 2 +-
mobile/proguard-project.txt | 2 +
4 files changed, 4 insertions(+), 126 deletions(-)
diff --git a/mobile/.idea/misc.xml b/mobile/.idea/misc.xml
index 5997eabb..e0d90dd8 100644
--- a/mobile/.idea/misc.xml
+++ b/mobile/.idea/misc.xml
@@ -1,134 +1,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- localhost
- 5050
-
-
diff --git a/mobile/.idea/modules.xml b/mobile/.idea/modules.xml
index 16ec7d18..c7429177 100644
--- a/mobile/.idea/modules.xml
+++ b/mobile/.idea/modules.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/mobile/IITC-Mobile.iml b/mobile/IITC-Mobile.iml
index 26779940..57c35466 100644
--- a/mobile/IITC-Mobile.iml
+++ b/mobile/IITC-Mobile.iml
@@ -15,8 +15,8 @@
+
-
diff --git a/mobile/proguard-project.txt b/mobile/proguard-project.txt
index f165b3bd..b77c728c 100644
--- a/mobile/proguard-project.txt
+++ b/mobile/proguard-project.txt
@@ -9,3 +9,5 @@
# view res/layout/activity_main.xml #generated:6
-keep class com.cradle.iitc_mobile.IITC_WebView { (...); }
+
+-keep class com.cradle.iitc_mobile.IITC_JSInterface { (...); }
\ No newline at end of file
From 9ce25e7e57340e0e24c3d1e0add16e84e619d060 Mon Sep 17 00:00:00 2001
From: hastarin
Date: Fri, 24 May 2013 15:52:25 +1000
Subject: [PATCH 26/35] Initial commit of a working Search View.
---
code/geosearch.js | 35 ++++----
mobile/AndroidManifest.xml | 20 +++++
mobile/proguard-project.txt | 5 +-
mobile/res/menu/main.xml | 6 +-
mobile/res/values/strings.xml | 2 +
mobile/res/xml/searchable.xml | 8 ++
.../com/cradle/iitc_mobile/IITC_Mobile.java | 81 +++++++++++++------
.../com/cradle/iitc_mobile/IITC_WebView.java | 2 +
8 files changed, 117 insertions(+), 42 deletions(-)
create mode 100644 mobile/res/xml/searchable.xml
diff --git a/code/geosearch.js b/code/geosearch.js
index 7bd7d1ee..c877564a 100644
--- a/code/geosearch.js
+++ b/code/geosearch.js
@@ -6,24 +6,29 @@ window.setupGeosearch = function() {
if((e.keyCode ? e.keyCode : e.which) != 13) return;
var search = $(this).val();
-
- if (!runHooks('geoSearch', search)) {
- return;
- }
-
- $.getJSON(NOMINATIM + encodeURIComponent(search), function(data) {
- if(!data || !data[0]) return;
- var b = data[0].boundingbox;
- if(!b) return;
- var southWest = new L.LatLng(b[0], b[2]),
- northEast = new L.LatLng(b[1], b[3]),
- bounds = new L.LatLngBounds(southWest, northEast);
- window.map.fitBounds(bounds);
- if(window.isSmartphone()) window.smartphone.mapButton.click();
- });
+
+ if ( window.search(search) ) return;
+
e.preventDefault();
});
$('#geosearchwrapper img').click(function(){
map.locate({setView : true, maxZoom: 13});;
});
}
+
+window.search = function(search) {
+ if (!runHooks('geoSearch', search)) {
+ return true;
+ }
+
+ $.getJSON(NOMINATIM + encodeURIComponent(search), function(data) {
+ if(!data || !data[0]) return true;
+ var b = data[0].boundingbox;
+ if(!b) return true;
+ var southWest = new L.LatLng(b[0], b[2]),
+ northEast = new L.LatLng(b[1], b[3]),
+ bounds = new L.LatLngBounds(southWest, northEast);
+ window.map.fitBounds(bounds);
+ if(window.isSmartphone()) window.smartphone.mapButton.click();
+ });
+}
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
index f9fc9e4d..b0fa5c5a 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -24,13 +24,23 @@
android:name="com.cradle.iitc_mobile.IITC_Mobile"
android:theme="@style/AppBaseTheme"
android:label="@string/app_name"
+ android:launchMode="singleTop"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize">
+
+
+
+
+
+
+
+
+
@@ -46,6 +56,10 @@
android:scheme="http"
android:pathPrefix="/intel">
+
+
+
+
@@ -74,7 +89,12 @@
+
+
+
diff --git a/mobile/proguard-project.txt b/mobile/proguard-project.txt
index b77c728c..34f9866f 100644
--- a/mobile/proguard-project.txt
+++ b/mobile/proguard-project.txt
@@ -4,7 +4,10 @@
# view AndroidManifest.xml #generated:23
-keep class com.cradle.iitc_mobile.IITC_Mobile { (...); }
-# view AndroidManifest.xml #generated:40
+# view AndroidManifest.xml #generated:56
+-keep class com.cradle.iitc_mobile.IITC_SearchableActivity { (...); }
+
+# view AndroidManifest.xml #generated:50
-keep class com.cradle.iitc_mobile.IITC_Settings { (...); }
# view res/layout/activity_main.xml #generated:6
diff --git a/mobile/res/menu/main.xml b/mobile/res/menu/main.xml
index eba307b5..854cc598 100644
--- a/mobile/res/menu/main.xml
+++ b/mobile/res/menu/main.xml
@@ -1,5 +1,9 @@
-
+
- Debug
Choose account to login
Login failed.
+ Search Locations
+ Search
\ No newline at end of file
diff --git a/mobile/res/xml/searchable.xml b/mobile/res/xml/searchable.xml
new file mode 100644
index 00000000..19c27279
--- /dev/null
+++ b/mobile/res/xml/searchable.xml
@@ -0,0 +1,8 @@
+
+
+
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
index 88604777..10450861 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
@@ -4,6 +4,7 @@ import java.io.IOException;
import android.app.ActionBar;
import android.app.Activity;
+import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -20,11 +21,9 @@ import android.os.Handler;
import android.os.StrictMode;
import android.preference.PreferenceManager;
import android.util.Log;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.Window;
-import android.view.WindowManager;
+import android.view.*;
import android.webkit.WebView;
+import android.widget.SearchView;
import android.widget.Toast;
public class IITC_Mobile extends Activity {
@@ -98,7 +97,7 @@ public class IITC_Mobile extends Activity {
}
public void onStatusChanged(String provider, int status,
- Bundle extras) {
+ Bundle extras) {
}
public void onProviderEnabled(String provider) {
@@ -120,8 +119,17 @@ public class IITC_Mobile extends Activity {
fullscreen_actionbar = sharedPref.getBoolean("pref_fullscreen_actionbar", false);
+ handleIntent(getIntent());
+ }
+
+ @Override
+ protected void onNewIntent(Intent intent) {
+ setIntent(intent);
+ handleIntent(intent);
+ }
+
+ private void handleIntent(Intent intent) {
// load new iitc web view with ingress intel page
- Intent intent = getIntent();
String action = intent.getAction();
if (Intent.ACTION_VIEW.equals(action)) {
Uri uri = intent.getData();
@@ -133,6 +141,10 @@ public class IITC_Mobile extends Activity {
Log.d("iitcm", "loading url...");
this.loadUrl(url);
}
+ } else if (Intent.ACTION_SEARCH.equals(action)) {
+ String query = intent.getStringExtra(SearchManager.QUERY);
+ query = query.replace("'", "''");
+ iitc_view.loadUrl("javascript:search('" + query + "');");
} else {
this.loadUrl(intel_url);
}
@@ -238,7 +250,23 @@ public class IITC_Mobile extends Activity {
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
-
+ // Get the SearchView and set the searchable configuration
+ SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
+ final MenuItem searchMenuItem = menu.findItem(R.id.menu_search);
+ final SearchView searchView =
+ (SearchView) searchMenuItem.getActionView();
+ // Assumes current activity is the searchable activity
+ searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
+ searchView.setIconifiedByDefault(false); // Do not iconify the widget; expand it by default
+ searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
+ @Override
+ public void onFocusChange(View view, boolean queryTextFocused) {
+ if(!queryTextFocused) {
+ searchMenuItem.collapseActionView();
+ searchView.setQuery("", false);
+ }
+ }
+ });
return true;
}
@@ -246,63 +274,66 @@ public class IITC_Mobile extends Activity {
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
- case android.R.id.home :
+ case android.R.id.home:
iitc_view.loadUrl("javascript: window.show('map');");
actionBar.setTitle(getString(R.string.menu_map));
return true;
- case R.id.menu_map :
+ case R.id.menu_map:
iitc_view.loadUrl("javascript: window.show('map');");
actionBar.setTitle(getString(R.string.menu_map));
return true;
- case R.id.reload_button :
+ case R.id.reload_button:
this.loadUrl(intel_url);
actionBar.setTitle(getString(R.string.menu_map));
return true;
- case R.id.toggle_fullscreen :
+ case R.id.toggle_fullscreen:
toggleFullscreen();
return true;
case R.id.layer_chooser:
// the getLayers function calls the setLayers method of IITC_JSInterface
iitc_view.loadUrl("javascript: window.layerChooser.getLayers()");
return true;
- // get the users current location and focus it on map
- case R.id.locate :
+ // get the users current location and focus it on map
+ case R.id.locate:
iitc_view.loadUrl("javascript: window.show('map');");
iitc_view.loadUrl("javascript: window.map.locate({setView : true, maxZoom: 15});");
actionBar.setTitle(getString(R.string.menu_map));
return true;
- // start settings activity
- case R.id.action_settings :
+ // start settings activity
+ case R.id.action_settings:
Intent intent = new Intent(this, IITC_Settings.class);
intent.putExtra("iitc_version", iitc_view.getWebViewClient()
.getIITCVersion());
startActivity(intent);
return true;
- case R.id.menu_info :
+ case R.id.menu_info:
iitc_view.loadUrl("javascript: window.show('info');");
actionBar.setTitle(getString(R.string.menu_info));
return true;
- case R.id.menu_full :
+ case R.id.menu_full:
iitc_view.loadUrl("javascript: window.show('full');");
actionBar.setTitle(getString(R.string.menu_full));
return true;
- case R.id.menu_compact :
+ case R.id.menu_compact:
iitc_view.loadUrl("javascript: window.show('compact');");
actionBar.setTitle(getString(R.string.menu_compact));
return true;
- case R.id.menu_public :
+ case R.id.menu_public:
iitc_view.loadUrl("javascript: window.show('public');");
actionBar.setTitle(getString(R.string.menu_public));
return true;
- case R.id.menu_faction :
+ case R.id.menu_faction:
iitc_view.loadUrl("javascript: window.show('faction');");
actionBar.setTitle(getString(R.string.menu_faction));
return true;
- case R.id.menu_debug :
+ case R.id.menu_debug:
iitc_view.loadUrl("javascript: window.show('debug')");
actionBar.setTitle(getString(R.string.menu_debug));
return true;
- default :
+ case R.id.menu_search:
+ onSearchRequested();
+ return true;
+ default:
return super.onOptionsItemSelected(item);
}
}
@@ -377,12 +408,12 @@ public class IITC_Mobile extends Activity {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
- case REQUEST_LOGIN :
+ case REQUEST_LOGIN:
// authentication activity has returned. mLogin will continue authentication
mLogin.onActivityResult(resultCode, data);
break;
- default :
+ default:
super.onActivityResult(requestCode, resultCode, data);
}
}
@@ -391,7 +422,7 @@ public class IITC_Mobile extends Activity {
* called by IITC_WebViewClient when the Google login form is opened.
*/
public void onReceivedLoginRequest(IITC_WebViewClient client, WebView view,
- String realm, String account, String args) {
+ String realm, String account, String args) {
mLogin = new IITC_DeviceAccountLogin(this, view, client);
mLogin.startLogin(realm, account, args);
}
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java
index b3a752a3..056bdfe8 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java
@@ -11,6 +11,7 @@ import android.os.Build;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.util.Log;
+import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
@@ -26,6 +27,7 @@ public class IITC_WebView extends WebView {
// init web view
private void iitc_init(Context c) {
+ if ( this.isInEditMode() ) return;
settings = this.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
From dd8ceaf934ac229fe0505eef1d928fcf957de350 Mon Sep 17 00:00:00 2001
From: hastarin
Date: Fri, 24 May 2013 16:15:56 +1000
Subject: [PATCH 27/35] Reordered menu items. IMO Layers is used more than My
Location.
---
mobile/res/menu/main.xml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/mobile/res/menu/main.xml b/mobile/res/menu/main.xml
index 854cc598..99c9715e 100644
--- a/mobile/res/menu/main.xml
+++ b/mobile/res/menu/main.xml
@@ -51,13 +51,6 @@
- -
-
-
+ -
+
-
Date: Fri, 24 May 2013 17:04:06 +1000
Subject: [PATCH 28/35] Removed menu selection handling for search due to
double search.
---
mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
index 10450861..ee097570 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
@@ -330,9 +330,6 @@ public class IITC_Mobile extends Activity {
iitc_view.loadUrl("javascript: window.show('debug')");
actionBar.setTitle(getString(R.string.menu_debug));
return true;
- case R.id.menu_search:
- onSearchRequested();
- return true;
default:
return super.onOptionsItemSelected(item);
}
From a56272f2609a62a57b000d1bddaa359306d63ddd Mon Sep 17 00:00:00 2001
From: Philipp Schaefer
Date: Fri, 24 May 2013 15:48:37 +0200
Subject: [PATCH 29/35] some tweaks for the new search * distinguish between
onCreate intent and resume intent (do not always reload) * handle voice
search correct
---
.../com/cradle/iitc_mobile/IITC_Mobile.java | 32 ++++++++++---------
.../com/cradle/iitc_mobile/IITC_WebView.java | 1 -
2 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
index ee097570..aa67c802 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
@@ -5,6 +5,7 @@ import java.io.IOException;
import android.app.ActionBar;
import android.app.Activity;
import android.app.SearchManager;
+import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -21,7 +22,12 @@ import android.os.Handler;
import android.os.StrictMode;
import android.preference.PreferenceManager;
import android.util.Log;
-import android.view.*;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import android.widget.SearchView;
import android.widget.Toast;
@@ -41,6 +47,7 @@ public class IITC_Mobile extends Activity {
private boolean fullscreen_actionbar = false;
private ActionBar actionBar;
private IITC_DeviceAccountLogin mLogin;
+ private MenuItem searchMenuItem;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -119,16 +126,16 @@ public class IITC_Mobile extends Activity {
fullscreen_actionbar = sharedPref.getBoolean("pref_fullscreen_actionbar", false);
- handleIntent(getIntent());
+ handleIntent(getIntent(), true);
}
@Override
protected void onNewIntent(Intent intent) {
setIntent(intent);
- handleIntent(intent);
+ handleIntent(intent, false);
}
- private void handleIntent(Intent intent) {
+ private void handleIntent(Intent intent, boolean onCreate) {
// load new iitc web view with ingress intel page
String action = intent.getAction();
if (Intent.ACTION_VIEW.equals(action)) {
@@ -144,8 +151,12 @@ public class IITC_Mobile extends Activity {
} else if (Intent.ACTION_SEARCH.equals(action)) {
String query = intent.getStringExtra(SearchManager.QUERY);
query = query.replace("'", "''");
+ final SearchView searchView =
+ (SearchView) searchMenuItem.getActionView();
+ searchView.setQuery(query, false);
+ searchView.clearFocus();
iitc_view.loadUrl("javascript:search('" + query + "');");
- } else {
+ } else if (onCreate){
this.loadUrl(intel_url);
}
}
@@ -252,21 +263,12 @@ public class IITC_Mobile extends Activity {
getMenuInflater().inflate(R.menu.main, menu);
// Get the SearchView and set the searchable configuration
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
- final MenuItem searchMenuItem = menu.findItem(R.id.menu_search);
+ this.searchMenuItem = menu.findItem(R.id.menu_search);
final SearchView searchView =
(SearchView) searchMenuItem.getActionView();
// Assumes current activity is the searchable activity
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setIconifiedByDefault(false); // Do not iconify the widget; expand it by default
- searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
- @Override
- public void onFocusChange(View view, boolean queryTextFocused) {
- if(!queryTextFocused) {
- searchMenuItem.collapseActionView();
- searchView.setQuery("", false);
- }
- }
- });
return true;
}
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java
index 056bdfe8..2a910f2a 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java
@@ -11,7 +11,6 @@ import android.os.Build;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.util.Log;
-import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
From 3245ca01d478d5f9412dbcd281e444cf7797dd8a Mon Sep 17 00:00:00 2001
From: Philipp Schaefer
Date: Fri, 24 May 2013 15:52:36 +0200
Subject: [PATCH 30/35] removed not used imports
---
mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
index aa67c802..d98ca631 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
@@ -5,7 +5,6 @@ import java.io.IOException;
import android.app.ActionBar;
import android.app.Activity;
import android.app.SearchManager;
-import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -24,10 +23,8 @@ import android.preference.PreferenceManager;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
-import android.view.View;
import android.view.Window;
import android.view.WindowManager;
-import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import android.widget.SearchView;
import android.widget.Toast;
From 58faf2e2ba66e4adb48f35c36aaae2aa5989508f Mon Sep 17 00:00:00 2001
From: Philipp Schaefer
Date: Fri, 24 May 2013 15:54:56 +0200
Subject: [PATCH 31/35] removed speech-search plugin from mobile. it is not
working and iitcm brings its own voice search
---
build.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.py b/build.py
index 5c2e3cb9..2a3eb7d9 100755
--- a/build.py
+++ b/build.py
@@ -225,7 +225,7 @@ if buildMobile:
except:
pass
shutil.rmtree("mobile/assets/plugins")
- shutil.copytree(os.path.join(outDir,"plugins"), "mobile/assets/plugins", ignore=shutil.ignore_patterns('*.meta.js', 'force-https*', 'privacy-view*'))
+ shutil.copytree(os.path.join(outDir,"plugins"), "mobile/assets/plugins", ignore=shutil.ignore_patterns('*.meta.js', 'force-https*', 'privacy-view*', 'speech-search*'))
if buildMobile != 'copyonly':
From 7e35c95e2c32483c314461f2c9293fa1e31fb20a Mon Sep 17 00:00:00 2001
From: Philipp Schaefer
Date: Fri, 24 May 2013 15:58:19 +0200
Subject: [PATCH 32/35] reordered layer and location buttons correctly ;)
---
mobile/res/menu/main.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mobile/res/menu/main.xml b/mobile/res/menu/main.xml
index 99c9715e..e203e4fb 100644
--- a/mobile/res/menu/main.xml
+++ b/mobile/res/menu/main.xml
@@ -54,14 +54,14 @@
-
-
From e7a296b2b38393f52b6a021c07ad62ffe56267e1 Mon Sep 17 00:00:00 2001
From: Philipp Schaefer
Date: Fri, 24 May 2013 16:03:24 +0200
Subject: [PATCH 33/35] removed wrong semicolon
---
code/geosearch.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/geosearch.js b/code/geosearch.js
index c877564a..ab67a56c 100644
--- a/code/geosearch.js
+++ b/code/geosearch.js
@@ -12,7 +12,7 @@ window.setupGeosearch = function() {
e.preventDefault();
});
$('#geosearchwrapper img').click(function(){
- map.locate({setView : true, maxZoom: 13});;
+ map.locate({setView : true, maxZoom: 13});
});
}
From 9dffadada63b55f3b3cd031bba8600cc8fd9085c Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 24 May 2013 15:54:05 +0100
Subject: [PATCH 34/35] plugins - ensure they pass a default for shown/hidden
when being added to the map
---
plugins/draw-tools.user.js | 4 ++--
plugins/max-links.user.js | 4 ++--
plugins/player-tracker.user.js | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/plugins/draw-tools.user.js b/plugins/draw-tools.user.js
index 91f9d25d..44531abf 100644
--- a/plugins/draw-tools.user.js
+++ b/plugins/draw-tools.user.js
@@ -1,7 +1,7 @@
// ==UserScript==
// @id iitc-plugin-draw-tools@breunigs
// @name IITC plugin: draw tools
-// @version 0.4.0.@@DATETIMEVERSION@@
+// @version 0.4.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -141,7 +141,7 @@ window.plugin.drawTools.boot = function() {
});
//add the layer
- window.addLayerGroup('Drawn Items', window.plugin.drawTools.drawnItems);
+ window.addLayerGroup('Drawn Items', window.plugin.drawTools.drawnItems, true);
//place created items into the specific layer
diff --git a/plugins/max-links.user.js b/plugins/max-links.user.js
index 9aed5f10..d096a6d4 100644
--- a/plugins/max-links.user.js
+++ b/plugins/max-links.user.js
@@ -1,7 +1,7 @@
// ==UserScript==
// @id max-links@boombuler
// @name IITC plugin: Max Links
-// @version 0.3.0.@@DATETIMEVERSION@@
+// @version 0.3.1.@@DATETIMEVERSION@@
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Calculates how to link the portals to create the maximum number of fields.
@@ -117,7 +117,7 @@ window.plugin.maxLinks.setup = function() {
window.plugin.maxLinks.updateLayer();
});
window.map.on('zoomend moveend', window.plugin.maxLinks.updateLayer);
- window.addLayerGroup('Maximum Links', window.plugin.maxLinks.layer);
+ window.addLayerGroup('Maximum Links', window.plugin.maxLinks.layer, false);
}
var setup = window.plugin.maxLinks.setup;
diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js
index 3b2013f3..9fc5fdbd 100644
--- a/plugins/player-tracker.user.js
+++ b/plugins/player-tracker.user.js
@@ -1,7 +1,7 @@
// ==UserScript==
// @id iitc-plugin-player-tracker@breunigs
// @name IITC Plugin: Player tracker
-// @version 0.9.3.@@DATETIMEVERSION@@
+// @version 0.9.4.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -48,7 +48,7 @@ window.plugin.playerTracker.setup = function() {
}});
plugin.playerTracker.drawnTraces = new L.LayerGroup();
- window.addLayerGroup('Player Tracker', plugin.playerTracker.drawnTraces);
+ window.addLayerGroup('Player Tracker', plugin.playerTracker.drawnTraces, true);
map.on('layeradd',function(obj) {
if(obj.layer === plugin.playerTracker.drawnTraces)
{
From 045279a265165beaaa81bb2b967983708f04feb5 Mon Sep 17 00:00:00 2001
From: Philipp Schaefer
Date: Fri, 24 May 2013 17:24:02 +0200
Subject: [PATCH 35/35] extended JSInterface to finish app via js (see #312)
---
.../cradle/iitc_mobile/IITC_JSInterface.java | 7 +++++++
.../src/com/cradle/iitc_mobile/IITC_Mobile.java | 17 -----------------
2 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java b/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java
index 8aff9177..e0dc6cff 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java
@@ -64,6 +64,13 @@ public class IITC_JSInterface {
.show();
}
+ // exit IITC Mobile
+ @JavascriptInterface
+ public void exitIITC() {
+ Log.d("iitcm","no back stack...finishing iitc");
+ ((IITC_Mobile) context).finish();
+ }
+
// get layers and list them in a dialog
@JavascriptInterface
public void setLayers(String base_layer, String overlay_layer) {
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
index d98ca631..1f86fe77 100644
--- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
@@ -17,7 +17,6 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Handler;
import android.os.StrictMode;
import android.preference.PreferenceManager;
import android.util.Log;
@@ -34,7 +33,6 @@ public class IITC_Mobile extends Activity {
private static final int REQUEST_LOGIN = 1;
private IITC_WebView iitc_view;
- private boolean back_button_pressed = false;
private OnSharedPreferenceChangeListener listener;
private String intel_url = "https://www.ingress.com/intel";
private boolean user_loc = false;
@@ -236,22 +234,7 @@ public class IITC_Mobile extends Activity {
this.toggleFullscreen();
return;
}
- if (this.back_button_pressed) {
- super.onBackPressed();
- return;
- }
-
iitc_view.loadUrl("javascript: window.goBack();");
- this.back_button_pressed = true;
- Toast.makeText(this, "Press twice to exit", Toast.LENGTH_SHORT).show();
-
- // reset back button after 0.5 seconds
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run() {
- back_button_pressed = false;
- }
- }, 500);
}
@Override