From 0decd89a66b798b3756b59669d5ac616a84497f0 Mon Sep 17 00:00:00 2001 From: adostes Date: Thu, 26 Feb 2015 14:59:16 -0500 Subject: [PATCH 1/8] export CSV --- plugins/bookmarks-by-zaso.user.js | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index 6ab48e410..80b20e955 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -637,6 +637,43 @@ } } + window.plugin.bookmarks.optCSV = function() { + if(typeof android !== 'undefined' && android && android.shareString) { + return android.shareString(localStorage[window.plugin.bookmarks.KEY_STORAGE]); + } else { + + var portals = JSON.parse(localStorage['plugin-bookmarks']).portals, + output = '\n\n*********** INGRESS ROUTE PLANNER ***********\n'; + for (var key in portals) { + if (!portals.hasOwnProperty(key)) { + continue; + } + var bkmrk = portals[key].bkmrk; + for (var key in bkmrk) { + output += 'https://www.ingress.com/intel?ll=' + bkmrk[key].latlng + '&z=17&pll=' + bkmrk[key].latlng + '\n'; + } + } + + output += '\n\n*********** INGRESS MAX FIELD ***********\n'; + + for (var key in portals) { + if (!portals.hasOwnProperty(key)) { + continue; + } + var bkmrk = portals[key].bkmrk; + for (var key in bkmrk) { + output += bkmrk[key].label + ';' + 'https://www.ingress.com/intel?ll=' + bkmrk[key].latlng + '&z=17&pll=' + bkmrk[key].latlng + ';0\n'; + } + } + + dialog({ + html: '

Select all and press CTRL+C to copy it.

', + dialogClass: 'ui-dialog-bkmrksSet-csv', + title: 'Bookmarks to CSV' + }); + } + } + window.plugin.bookmarks.optExport = function() { if(typeof android !== 'undefined' && android && android.saveFile) { android.saveFile("IITC-bookmarks.json", "application/json", localStorage[window.plugin.bookmarks.KEY_STORAGE]); @@ -1204,6 +1241,7 @@ var actions = ''; actions += 'Reset bookmarks'; actions += 'Copy bookmarks'; + actions += 'Bookmarks to CSV'; actions += 'Paste bookmarks'; if(plugin.bookmarks.isAndroid()) { From 529e19d64ad875f6fedee2d05b93dde91b74e1f6 Mon Sep 17 00:00:00 2001 From: adostes Date: Thu, 26 Feb 2015 15:16:33 -0500 Subject: [PATCH 2/8] Differentiate two exports --- plugins/bookmarks-by-zaso.user.js | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index 80b20e955..dc6cb934a 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -637,39 +637,53 @@ } } - window.plugin.bookmarks.optCSV = function() { + window.plugin.bookmarks.optMaxfield = function() { if(typeof android !== 'undefined' && android && android.shareString) { return android.shareString(localStorage[window.plugin.bookmarks.KEY_STORAGE]); } else { var portals = JSON.parse(localStorage['plugin-bookmarks']).portals, - output = '\n\n*********** INGRESS ROUTE PLANNER ***********\n'; + output = ''; + for (var key in portals) { if (!portals.hasOwnProperty(key)) { continue; } var bkmrk = portals[key].bkmrk; for (var key in bkmrk) { - output += 'https://www.ingress.com/intel?ll=' + bkmrk[key].latlng + '&z=17&pll=' + bkmrk[key].latlng + '\n'; + output += bkmrk[key].label + ';' + 'https://www.ingress.com/intel?ll=' + bkmrk[key].latlng + '&z=17&pll=' + bkmrk[key].latlng + ';0\n'; } } - output += '\n\n*********** INGRESS MAX FIELD ***********\n'; + dialog({ + html: '

Select all and press CTRL+C to copy it.

', + dialogClass: 'ui-dialog-bkmrksSet-copy', + title: 'Ingress Maxfield' + }); + } + } + window.plugin.bookmarks.optRoutePlanner = function() { + if(typeof android !== 'undefined' && android && android.shareString) { + return android.shareString(localStorage[window.plugin.bookmarks.KEY_STORAGE]); + } else { + + var portals = JSON.parse(localStorage['plugin-bookmarks']).portals, + output = ''; for (var key in portals) { if (!portals.hasOwnProperty(key)) { continue; } var bkmrk = portals[key].bkmrk; for (var key in bkmrk) { - output += bkmrk[key].label + ';' + 'https://www.ingress.com/intel?ll=' + bkmrk[key].latlng + '&z=17&pll=' + bkmrk[key].latlng + ';0\n'; + output += 'https://www.ingress.com/intel?ll=' + bkmrk[key].latlng + '&z=17&pll=' + bkmrk[key].latlng + '\n'; } } dialog({ html: '

Select all and press CTRL+C to copy it.

', - dialogClass: 'ui-dialog-bkmrksSet-csv', - title: 'Bookmarks to CSV' + dialogClass: 'ui-dialog-bkmrksSet-copy', + title: 'Ingress Maxfield' }); } } @@ -1241,7 +1255,8 @@ var actions = ''; actions += 'Reset bookmarks'; actions += 'Copy bookmarks'; - actions += 'Bookmarks to CSV'; + actions += 'Bookmarks to Maxfield'; + actions += 'Bookmarks to Route Planner'; actions += 'Paste bookmarks'; if(plugin.bookmarks.isAndroid()) { From 1b9c0e90018c1780d17454e554be588ab9e4c3bb Mon Sep 17 00:00:00 2001 From: adostes Date: Thu, 26 Feb 2015 16:06:59 -0500 Subject: [PATCH 3/8] changed order and title --- plugins/bookmarks-by-zaso.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index dc6cb934a..8b57062f5 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -683,7 +683,7 @@ dialog({ html: '

Select all and press CTRL+C to copy it.

', dialogClass: 'ui-dialog-bkmrksSet-copy', - title: 'Ingress Maxfield' + title: 'Ingress Route Panner' }); } } @@ -1255,9 +1255,9 @@ var actions = ''; actions += 'Reset bookmarks'; actions += 'Copy bookmarks'; + actions += 'Paste bookmarks'; actions += 'Bookmarks to Maxfield'; actions += 'Bookmarks to Route Planner'; - actions += 'Paste bookmarks'; if(plugin.bookmarks.isAndroid()) { actions += 'Import bookmarks'; From 92dea098365da764800a5b5d362689bfe5ee73a1 Mon Sep 17 00:00:00 2001 From: adostes Date: Sat, 28 Feb 2015 13:12:29 -0500 Subject: [PATCH 4/8] export to CSV --- plugins/bookmarks-by-zaso.user.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index 8b57062f5..588ad80de 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -688,6 +688,34 @@ } } + window.plugin.bookmarks.optCSV = function() { + if(typeof android !== 'undefined' && android && android.shareString) { + return android.shareString(localStorage[window.plugin.bookmarks.KEY_STORAGE]); + } else { + + var portals = JSON.parse(localStorage['plugin-bookmarks']).portals, + output = ''; + for (var key in portals) { + if (!portals.hasOwnProperty(key)) { + continue; + } + output += '\n\nFolder: ' + portals[key].label + '\n'; + output += 'ID|GUID|Name|Latitude Longitude|URL\n'; + + var bkmrk = portals[key].bkmrk; + for (var key in bkmrk) { + output += key+'|'+bkmrk[key].guid + '|' + bkmrk[key].label + '|' + bkmrk[key].latlng +'|'+ 'https://www.ingress.com/intel?ll=' + bkmrk[key].latlng + '&z=17&pll=' + bkmrk[key].latlng + '\n'; + } + } + + dialog({ + html: '

Select all and press CTRL+C to copy it.

', + dialogClass: 'ui-dialog-bkmrksSet-copy', + title: 'Ingress Route Panner' + }); + } + } + window.plugin.bookmarks.optExport = function() { if(typeof android !== 'undefined' && android && android.saveFile) { android.saveFile("IITC-bookmarks.json", "application/json", localStorage[window.plugin.bookmarks.KEY_STORAGE]); @@ -1258,6 +1286,7 @@ actions += 'Paste bookmarks'; actions += 'Bookmarks to Maxfield'; actions += 'Bookmarks to Route Planner'; + actions += 'Bookmarks to CSV'; if(plugin.bookmarks.isAndroid()) { actions += 'Import bookmarks'; From 24c5e54a512d3ff09922d3fbe159bc7b6f783f8c Mon Sep 17 00:00:00 2001 From: "Dostes, Arnaud X" Date: Mon, 16 Mar 2015 16:20:50 -0400 Subject: [PATCH 5/8] Added console output for export to excel --- plugins/max-links.user.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/max-links.user.js b/plugins/max-links.user.js index 91143952c..e16ef56c9 100644 --- a/plugins/max-links.user.js +++ b/plugins/max-links.user.js @@ -69,6 +69,7 @@ window.plugin.maxLinks.updateLayer = function() { window.plugin.maxLinks.layer.clearLayers(); var locations = []; + var myPortals = {}; var bounds = map.getBounds(); $.each(window.portals, function(guid, portal) { @@ -76,6 +77,7 @@ window.plugin.maxLinks.updateLayer = function() { if (bounds.contains(ll)) { var p = map.project (portal.getLatLng(), window.plugin.maxLinks.PROJECT_ZOOM); locations.push(p); + myPortals[(p.x+':'+p.y)] = {'x':p.x,'y':p.y,'title':portal.options.data.title,'guid':portal.options.guid}; if (locations.length > window.plugin.maxLinks.MAX_PORTALS_TO_LINK) return false; //$.each break } }); @@ -95,9 +97,12 @@ window.plugin.maxLinks.updateLayer = function() { return [b,a]; } var drawnLinks = {}; + var drawnLog = ''; //draw a link, but only if it hasn't already been drawn var drawLink = function(a,b) { + drawnLog+= (myPortals[a.x+':'+a.y].title+'\tto\t' + myPortals[b.x+':'+b.y].title+'\n'); + drawnLog+= (myPortals[b.x+':'+b.y].title+'\tto\t' + myPortals[a.x+':'+a.y].title+'\n'); //order the points, so a pair of coordinates in any order is handled in one direction only var points = orderedPoints(a,b); a=points[0]; @@ -130,6 +135,7 @@ window.plugin.maxLinks.updateLayer = function() { drawLink(triangle.b,triangle.c); drawLink(triangle.c,triangle.a); }); + console.log(drawnLog); } window.plugin.maxLinks.setup = function() { From 6b2d4da4d89089f09abb19de23d598248a2aa7af Mon Sep 17 00:00:00 2001 From: ARNAUD DOSTES Date: Sat, 9 May 2015 16:01:50 -0400 Subject: [PATCH 6/8] plugins/bookmarks-by-zaso.user.js --- plugins/bookmarks-by-zaso.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index 4e08ff754..0ef3ca49f 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -704,11 +704,11 @@ continue; } output += '\n\nFolder: ' + portals[key].label + '\n'; - output += 'ID|GUID|Name|Latitude Longitude|URL\n'; + output += 'ID\tGUID\tName\tLatitude Longitude\tURL\n'; var bkmrk = portals[key].bkmrk; for (var key in bkmrk) { - output += key+'|'+bkmrk[key].guid + '|' + bkmrk[key].label + '|' + bkmrk[key].latlng +'|'+ 'https://www.ingress.com/intel?ll=' + bkmrk[key].latlng + '&z=17&pll=' + bkmrk[key].latlng + '\n'; + output += key+'\t'+bkmrk[key].guid + '\t' + bkmrk[key].label + '\t' + bkmrk[key].latlng +'\t'+ 'https://www.ingress.com/intel?ll=' + bkmrk[key].latlng + '&z=17&pll=' + bkmrk[key].latlng + '\n'; } } From f0e25636e9f8dc2800c443507d3bd2f021f4723f Mon Sep 17 00:00:00 2001 From: "Dostes, Arnaud X" Date: Mon, 1 Jun 2015 17:11:48 -0400 Subject: [PATCH 7/8] changes to README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 509ecd940..61b1dae03 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,18 @@ ingress intel total conversion (IITC) ===================================== +## What this fork is + +This is me messing around with IITC. + +Changes to Maxfield plugin: +- Display in console the names of the portals + +Changes to Bookmarks plugin: +- Export to Tab Separated Values +- Export bookmarks to a list of URLS for http://www.ingress-maxfield.com/ +- Export bookmarks to a list of URLS for http://www.ingressrouteplanner.com/ + Since the [breunigs](https://github.com/breunigs/ingress-intel-total-conversion) IITC branch was deleted, I've created this one to continue some development. From b9e6e4d762fde6a5abf0db6f34984b79c6786aa8 Mon Sep 17 00:00:00 2001 From: "Dostes, Arnaud X" Date: Mon, 1 Jun 2015 17:13:54 -0400 Subject: [PATCH 8/8] README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 61b1dae03..f6a30a5f7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -ingress intel total conversion (IITC) -===================================== - ## What this fork is This is me messing around with IITC. @@ -13,6 +10,9 @@ Changes to Bookmarks plugin: - Export bookmarks to a list of URLS for http://www.ingress-maxfield.com/ - Export bookmarks to a list of URLS for http://www.ingressrouteplanner.com/ +ingress intel total conversion (IITC) +===================================== + Since the [breunigs](https://github.com/breunigs/ingress-intel-total-conversion) IITC branch was deleted, I've created this one to continue some development.