From 5101e9fd5783f9321835ef7b9b80623d948b3f79 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 30 Oct 2013 02:04:54 +0000 Subject: [PATCH 01/72] website: add changelog for 0.14.4 release --- website/page/home.php | 21 ++++++++++++++++++++- website/page/news.php | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/website/page/home.php b/website/page/home.php index dbe5518d..1eda08fc 100644 --- a/website/page/home.php +++ b/website/page/home.php @@ -16,7 +16,26 @@ offers many more features. It is available for

29th October 2013

IITC 0.14.4 and IITC Mobile 0.7.7 have just been released. A critical update required to work with changes made to the -standard intel site. +standard intel site. Changes include +

+

+

+3RD PARTY PLUGIN AUTHORS: The plugin wrapper code has been modified to pass through the additioal version +information. While existing plugins should continue to work, I highly recommend updating the wrapper code in your +scripts to match.

16th October 2013

diff --git a/website/page/news.php b/website/page/news.php index 569be174..e2e63673 100644 --- a/website/page/news.php +++ b/website/page/news.php @@ -3,7 +3,26 @@

29th October 2013

IITC 0.14.4 and IITC Mobile 0.7.7 have just been released. A critical update required to work with changes made to the -standard intel site. +standard intel site. Changes include +

+

+

+3RD PARTY PLUGIN AUTHORS: The plugin wrapper code has been modified to pass through the additioal version +information. While existing plugins should continue to work, I highly recommend updating the wrapper code in your +scripts to match.

16th October 2013

From c9f81807784e6daa09fa2ed05418eff47b26fc24 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 30 Oct 2013 03:35:14 +0000 Subject: [PATCH 02/72] website: fix warnings when no popularity for an entry, and whitespace removal --- website/page/code/desktop-download.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/page/code/desktop-download.php b/website/page/code/desktop-download.php index 7b18901d..6dab80da 100644 --- a/website/page/code/desktop-download.php +++ b/website/page/code/desktop-download.php @@ -25,7 +25,7 @@ function loadPopularity() { $items = explode ( ' ', $line ); $popularity[$items[0]] = (int)$items[1]; - } + } } return $popularity; @@ -33,7 +33,7 @@ function loadPopularity() function popularity_cmp ( $a, $b ) { - if ( $a['popularity'] == $b['popularity'] ) + if ( @$a['popularity'] == @$b['popularity'] ) return 0; // sort from highest to lowest return ($a['popularity'] > $b['popularity']) ? -1 : 1; From 932cdcd842f619ec53897ac407ba9c1fc422a0bf Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 30 Oct 2013 03:44:35 +0000 Subject: [PATCH 03/72] website: move page/code folder up a level --- website/{page => }/code/apk/ApkParser.php | 0 website/{page => }/code/apk/lib/ApkAndroidPlatform.php | 0 website/{page => }/code/apk/lib/ApkArchive.php | 0 website/{page => }/code/apk/lib/ApkManifest.php | 0 website/{page => }/code/apk/lib/ApkManifestXmlElement.php | 0 website/{page => }/code/apk/lib/ApkStream.php | 0 website/{page => }/code/apk/lib/ApkXml.php | 0 website/{page => }/code/apk/lib/ApkXmlParser.php | 0 website/{page => }/code/desktop-download.php | 0 website/{page => }/code/mobile-download.php | 0 website/{page => }/code/url/CHANGELOG.txt | 0 website/{page => }/code/url/README.txt | 0 website/{page => }/code/url/url_to_absolute.php | 0 website/{page => }/code/userscript.php | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename website/{page => }/code/apk/ApkParser.php (100%) rename website/{page => }/code/apk/lib/ApkAndroidPlatform.php (100%) rename website/{page => }/code/apk/lib/ApkArchive.php (100%) rename website/{page => }/code/apk/lib/ApkManifest.php (100%) rename website/{page => }/code/apk/lib/ApkManifestXmlElement.php (100%) rename website/{page => }/code/apk/lib/ApkStream.php (100%) rename website/{page => }/code/apk/lib/ApkXml.php (100%) rename website/{page => }/code/apk/lib/ApkXmlParser.php (100%) rename website/{page => }/code/desktop-download.php (100%) rename website/{page => }/code/mobile-download.php (100%) rename website/{page => }/code/url/CHANGELOG.txt (100%) rename website/{page => }/code/url/README.txt (100%) rename website/{page => }/code/url/url_to_absolute.php (100%) rename website/{page => }/code/userscript.php (100%) diff --git a/website/page/code/apk/ApkParser.php b/website/code/apk/ApkParser.php similarity index 100% rename from website/page/code/apk/ApkParser.php rename to website/code/apk/ApkParser.php diff --git a/website/page/code/apk/lib/ApkAndroidPlatform.php b/website/code/apk/lib/ApkAndroidPlatform.php similarity index 100% rename from website/page/code/apk/lib/ApkAndroidPlatform.php rename to website/code/apk/lib/ApkAndroidPlatform.php diff --git a/website/page/code/apk/lib/ApkArchive.php b/website/code/apk/lib/ApkArchive.php similarity index 100% rename from website/page/code/apk/lib/ApkArchive.php rename to website/code/apk/lib/ApkArchive.php diff --git a/website/page/code/apk/lib/ApkManifest.php b/website/code/apk/lib/ApkManifest.php similarity index 100% rename from website/page/code/apk/lib/ApkManifest.php rename to website/code/apk/lib/ApkManifest.php diff --git a/website/page/code/apk/lib/ApkManifestXmlElement.php b/website/code/apk/lib/ApkManifestXmlElement.php similarity index 100% rename from website/page/code/apk/lib/ApkManifestXmlElement.php rename to website/code/apk/lib/ApkManifestXmlElement.php diff --git a/website/page/code/apk/lib/ApkStream.php b/website/code/apk/lib/ApkStream.php similarity index 100% rename from website/page/code/apk/lib/ApkStream.php rename to website/code/apk/lib/ApkStream.php diff --git a/website/page/code/apk/lib/ApkXml.php b/website/code/apk/lib/ApkXml.php similarity index 100% rename from website/page/code/apk/lib/ApkXml.php rename to website/code/apk/lib/ApkXml.php diff --git a/website/page/code/apk/lib/ApkXmlParser.php b/website/code/apk/lib/ApkXmlParser.php similarity index 100% rename from website/page/code/apk/lib/ApkXmlParser.php rename to website/code/apk/lib/ApkXmlParser.php diff --git a/website/page/code/desktop-download.php b/website/code/desktop-download.php similarity index 100% rename from website/page/code/desktop-download.php rename to website/code/desktop-download.php diff --git a/website/page/code/mobile-download.php b/website/code/mobile-download.php similarity index 100% rename from website/page/code/mobile-download.php rename to website/code/mobile-download.php diff --git a/website/page/code/url/CHANGELOG.txt b/website/code/url/CHANGELOG.txt similarity index 100% rename from website/page/code/url/CHANGELOG.txt rename to website/code/url/CHANGELOG.txt diff --git a/website/page/code/url/README.txt b/website/code/url/README.txt similarity index 100% rename from website/page/code/url/README.txt rename to website/code/url/README.txt diff --git a/website/page/code/url/url_to_absolute.php b/website/code/url/url_to_absolute.php similarity index 100% rename from website/page/code/url/url_to_absolute.php rename to website/code/url/url_to_absolute.php diff --git a/website/page/code/userscript.php b/website/code/userscript.php similarity index 100% rename from website/page/code/userscript.php rename to website/code/userscript.php From 2303ab193ef90d717f1dd08586b6636f337b663f Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 30 Oct 2013 04:16:13 +0000 Subject: [PATCH 04/72] website: 1st pass at backend for version check plugin --- .../index.php => versioncheck.php} | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) rename website/{versioncheck/index.php => versioncheck.php} (70%) diff --git a/website/versioncheck/index.php b/website/versioncheck.php similarity index 70% rename from website/versioncheck/index.php rename to website/versioncheck.php index 831e199f..479d371c 100644 --- a/website/versioncheck/index.php +++ b/website/versioncheck.php @@ -1,8 +1,11 @@ Array ( # live release 'path' => 'release', 'name' => 'Stable release build', + 'web' => 'http://iitc.jonatkins.com/?page=download', ), 'jonatkins-test' => Array ( # public test builds 'path' => 'test', 'name' => 'Test build', + 'web' => 'http://iitc.jonatkins.com/?page=test', ), 'jonatkins-experimental' => Array ( # rarely used, for features not quite ready for 'test' 'path' => 'experimental', 'name' => 'Experimental build', + 'web' => 'http://iitc.jonatkins.com/?page=test&build=experimental', ), 'jonatkins-dev' => Array ( # personal 'path' => 'dev', 'name' => 'Development builds - not for public use', + 'web' => 'http://iitc.jonatkins.com/?page=test&build=dev', ), 'local' => Array ( # not a real build, but often the default for local development @@ -37,9 +44,35 @@ if ( array_key_exists ( $build, $details ) ) { $info = $details[$build]; - $response['buildPath'] = $info['path']; + $pageurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? "https" : "http")."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; + $response['name'] = $info['name']; + $dir = $info['path']; + + // load main script version + $iitc_details = loadUserScriptHeader ( "$dir/total-conversion-build.user.js" ); + $response['iitc'] = Array ( + 'version' => $iitc_details['@version'], + 'downloadUrl' => url_to_absolute ( $pageurl, "$dir/total-conversion-build.user.js" ), + 'pageUrl' => url_to_absolute ( $pageurl, $info['web'] ), + ); + + // and now the plugins + + $response['plugins'] = Array(); + + foreach ( glob ( "$dir/plugins/*.user.js" ) as $path ) + { + $basename = basename ( $path, ".user.js" ); + $details = loadUserScriptHeader ( $path ); + + $response['plugins'][$basename] = Array ( + 'version' => $details['@version'], + 'downloadUrl' => url_to_absolute ( $pageurl, "$dir/plugins/$basename.user.js" ), + 'pageUrl' => url_to_absolute ( $pageurl, $info['web']."#plugin-$basename" ), + ); + } } else From cc259b2da2d747956bd8e917930160357f3f8503 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 30 Oct 2013 04:34:39 +0000 Subject: [PATCH 05/72] website: fix another warning that clutters the logs --- website/code/desktop-download.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/code/desktop-download.php b/website/code/desktop-download.php index 6dab80da..5f1046e1 100644 --- a/website/code/desktop-download.php +++ b/website/code/desktop-download.php @@ -36,7 +36,7 @@ function popularity_cmp ( $a, $b ) if ( @$a['popularity'] == @$b['popularity'] ) return 0; // sort from highest to lowest - return ($a['popularity'] > $b['popularity']) ? -1 : 1; + return (@$a['popularity'] > @$b['popularity']) ? -1 : 1; } From 0401d5dcc8957cb6680696a2cc209af134e64a2b Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 30 Oct 2013 06:43:12 +0000 Subject: [PATCH 06/72] work in progress - update-check plugin data retrieved - work on comparing with local version info started --- plugins/update-check.user.js | 167 +++++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 plugins/update-check.user.js diff --git a/plugins/update-check.user.js b/plugins/update-check.user.js new file mode 100644 index 00000000..29ea1a3a --- /dev/null +++ b/plugins/update-check.user.js @@ -0,0 +1,167 @@ +// ==UserScript== +// @id iitc-plugin-update-check@jonatkins +// @name IITC plugin: Check for updates +// @category Tweaks +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Check for updates for IITC and plugins against http://iitc.jonatkins.com/. Can also report status messages for known IITC issues. +// @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== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + + +// use own namespace for plugin +window.plugin.updateCheck = function() {}; + +window.plugin.updateCheck.url = 'http://iitc.jonatkins.com/versioncheck.php?build=@@BUILDNAME@@'; +window.plugin.updateCheck.versionDataLoading = false; + + +window.plugin.updateCheck.versionCompare = function(a,b) { + a = a.split('.'); + b = b.split('.'); + + // adding dummy -1 entries to both split arrays simplifies comparisons + a.push(-1); + b.push(-1); + + var minlen = Math.min(a.length, b.length); + + for (var i=0; i0; + result.upToDate = result.comp==0; + result.localNewer = result.comp<0; + + + } + + if (!result.localVersion) { + + } else if (!result.webVersion) { + } + + return result; +} + + +window.plugin.updateCheck.showReport = function(data) { + var result = 'WORK IN PROGRESS - NOT YET FUNCTIONAL'; + + if (data.error) { + result += '
Error checking for updates
'+data.error+'
'; + } else { + if (data.name) { + result += '
IITC update check: '+data.name+'
'; + } + + if (data.iitc && window.script_info) { + + var compare = window.plugin.updateCheck.compareDetails(data.iitc, window.script_info); + + result += '
IITC Main script: '+JSON.stringify(compare)+'
'; + + } else { + if (!data.iitc) { + result += '
Warning: no version information for main IITC script found in response
'; + } + if (!window.script_info) { + result += '
Warning: your IITC script does not contain version data
'; + } + } + + + } + + dialog({ + width: 500, + title: 'Update check', + html: result + }); +} + + +window.plugin.updateCheck.open = function() { + + // TODO? open a dialog/show a message indicating that the update check is in progress, before the data is loaded? + // TODO? prevent loading the version data every time - cache it, with a user option to force fresh data + + window.plugin.updateCheck.loadVersionData(); +} + + + +window.plugin.updateCheck.setup = function() { + $('#toolbox').append(' Update check'); +}; + +var setup = window.plugin.updateCheck.setup; + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@ From 6ddbaf49591a2b53615ac7873cca8b9a0aa9a1dd Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 30 Oct 2013 21:11:25 +0000 Subject: [PATCH 07/72] update check plugin - basic functionality now done --- plugins/update-check.user.js | 71 ++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/plugins/update-check.user.js b/plugins/update-check.user.js index 29ea1a3a..f58cc1f3 100644 --- a/plugins/update-check.user.js +++ b/plugins/update-check.user.js @@ -71,15 +71,19 @@ window.plugin.updateCheck.versionDataCallback = function(data) { s.parentNode.removeChild(s); } - dialog({ - text: JSON.stringify(data,null,2), - title: 'debug version check', - width: 700 - }); - window.plugin.updateCheck.showReport(data); } +window.plugin.updateCheck.versionHTML = function(ver) { + var re = new RegExp ('^([0-9]+\\.[0-9]+\\.[0-9]+)(\\.2[0-9][0-9][0-9][01][0-9][0123][0-9]\\.[0-9]+)$'); + var match = ver.match(re); + if (match) { + return match[1]+''+match[2]+''; + } else { + return ver; + } +} + window.plugin.updateCheck.compareDetails = function(web_version, script_version) { // compare the local script version data with the website version data // and return an object with the results @@ -101,9 +105,27 @@ window.plugin.updateCheck.compareDetails = function(web_version, script_version) } + var webVerHTML = result.webVersion && window.plugin.updateCheck.versionHTML(result.webVersion); + var localVerHTML = result.localVersion && window.plugin.updateCheck.versionHTML(result.localVersion); + var webLinkInstallHTML = ''; + if (result.downloadUrl && result.webUrl) { + webLinkInstallHTML = 'web ' + + 'install'; + } + if (!result.localVersion) { - + result.html = 'version check failed '+webLinkInstallHTML; } else if (!result.webVersion) { + result.html = 'version check failed'; + } else if (result.upToDate) { + result.html = 'up to date'; + } else if (result.outOfDate) { + result.html = 'out of date '+webLinkInstallHTML; + } else if (result.localNewer) { + result.html = localVerHTML+' is newer than '+webVerHTML+'(?!)'; + } else { + console.warn ('Unknown case of version combinations!'); + result.html = 'version check failed(!?)'; } return result; @@ -111,7 +133,7 @@ window.plugin.updateCheck.compareDetails = function(web_version, script_version) window.plugin.updateCheck.showReport = function(data) { - var result = 'WORK IN PROGRESS - NOT YET FUNCTIONAL'; + var result = 'WORK IN PROGRESS'; if (data.error) { result += '
Error checking for updates
'+data.error+'
'; @@ -121,10 +143,8 @@ window.plugin.updateCheck.showReport = function(data) { } if (data.iitc && window.script_info) { - var compare = window.plugin.updateCheck.compareDetails(data.iitc, window.script_info); - - result += '
IITC Main script: '+JSON.stringify(compare)+'
'; + result += '
IITC Main script: '+compare.html+'
'; } else { if (!data.iitc) { @@ -135,11 +155,38 @@ window.plugin.updateCheck.showReport = function(data) { } } + if (data.plugins && window.bootPlugins) { + result += '
Plugins:
    '; + + if (window.bootPlugins.length == 0) { + result += '
  • No plugins installed
  • '; + } else { + for (var i=0; i'; + } else { + result += '
  • '+name+': no version data on server(!?)
  • '; + } + } else { + result += '
  • '+name+': non-standard plugin - cannot check version
  • '; + } + } + } + + result += '
'; + } } dialog({ - width: 500, + width: 700, title: 'Update check', html: result }); From f074085f22ec15e00e2496b44e53d35c9d2b1ff9 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 30 Oct 2013 21:22:04 +0000 Subject: [PATCH 08/72] website: version check backend: remove json formatting - was only used for debugging --- website/versioncheck.php | 61 ---------------------------------------- 1 file changed, 61 deletions(-) diff --git a/website/versioncheck.php b/website/versioncheck.php index 479d371c..35e24574 100644 --- a/website/versioncheck.php +++ b/website/versioncheck.php @@ -82,7 +82,6 @@ else $data = json_encode ( $response ); -$data = indent($data); # send the response - allow either jsonp (using a 'callback' parameter), or regular json @@ -106,63 +105,3 @@ else } -// http://www.daveperrett.com/articles/2008/03/11/format-json-with-php/ -/** - * Indents a flat JSON string to make it more human-readable. - * - * @param string $json The original JSON string to process. - * - * @return string Indented version of the original JSON string. - */ -function indent($json) { - - $result = ''; - $pos = 0; - $strLen = strlen($json); - $indentStr = ' '; - $newLine = "\n"; - $prevChar = ''; - $outOfQuotes = true; - - for ($i=0; $i<=$strLen; $i++) { - - // Grab the next character in the string. - $char = substr($json, $i, 1); - - // Are we inside a quoted string? - if ($char == '"' && $prevChar != '\\') { - $outOfQuotes = !$outOfQuotes; - - // If this character is the end of an element, - // output a new line and indent the next line. - } else if(($char == '}' || $char == ']') && $outOfQuotes) { - $result .= $newLine; - $pos --; - for ($j=0; $j<$pos; $j++) { - $result .= $indentStr; - } - } - - // Add the character to the result string. - $result .= $char; - - // If the last character was the beginning of an element, - // output a new line and indent the next line. - if (($char == ',' || $char == '{' || $char == '[') && $outOfQuotes) { - $result .= $newLine; - if ($char == '{' || $char == '[') { - $pos ++; - } - - for ($j = 0; $j < $pos; $j++) { - $result .= $indentStr; - } - } - - $prevChar = $char; - } - - return $result; -} - -?> From c349991f53a49a939acacd1d33a1f34019e1ada1 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Wed, 30 Oct 2013 23:18:56 +0100 Subject: [PATCH 09/72] fake GM_info object --- .../iitc_mobile/IITC_WebViewClient.java | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java index 69a361d1..38f3e5ba 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java @@ -18,11 +18,15 @@ import android.widget.Toast; import com.cradle.iitc_mobile.async.UrlContentToString; +import org.json.JSONObject; + import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.net.URL; +import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Scanner; import java.util.concurrent.ExecutionException; @@ -48,23 +52,40 @@ public class IITC_WebViewClient extends WebViewClient { } public String getIITCVersion() { + HashMap map = getScriptInfo(mIitcScript); + return map.get("version"); + } + + public HashMap getScriptInfo(String js) { + HashMap map = new HashMap(); String header = ""; - if (mIitcScript != null) { - header = mIitcScript.substring(mIitcScript.indexOf("==UserScript=="), - mIitcScript.indexOf("==/UserScript==")); + if (js != null) { + header = js.substring(js.indexOf("==UserScript=="), + js.indexOf("==/UserScript==")); } // remove new line comments - header = header.replace("\n//", ""); + header = header.replace("\n//", " "); // get a list of key-value - String[] attributes = header.split(" +"); + String[] attributes = header.split(" +"); String iitc_version = "not found"; for (int i = 0; i < attributes.length; i++) { - // search for version and use the value + // search for attributes and use the value if (attributes[i].equals("@version")) { - iitc_version = attributes[i + 1]; + map.put("version", attributes[i + 1]); + } + if (attributes[i].equals("@name")) { + map.put("name", attributes[i + 1]); + } + if (attributes[i].equals("@description")) { + map.put("description", attributes[i + 1]); } } - return iitc_version; + return map; + } + + public String getGmInfoJson(HashMap map) { + JSONObject jObject = new JSONObject(map); + return "{\"script\":" + jObject.toString() + "}"; } public void loadIITC_JS(Context c) throws java.io.IOException { @@ -131,9 +152,8 @@ public class IITC_WebViewClient extends WebViewClient { "window.showLayerChooser = false"); } - // IITC expects to be injected after the DOM has been loaded completely. - // since it is injected with the onPageFinished() event, no further delay is necessary. - this.mIitcScript = js; + String gmInfo = "GM_info=" + getGmInfoJson(getScriptInfo(js)).toString() + "\n"; + this.mIitcScript = gmInfo + js; } @@ -205,7 +225,8 @@ public class IITC_WebViewClient extends WebViewClient { if (js.equals("false")) { return false; } else { - view.loadUrl("javascript:" + js); + String gmInfo = "GM_info=" + getGmInfoJson(getScriptInfo(js)) + "\n"; + view.loadUrl("javascript:" + gmInfo + js); } return true; } From bb4d57acad77ac409ecaedb908a569ea407e15e1 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Wed, 30 Oct 2013 23:21:27 +0100 Subject: [PATCH 10/72] - added getVersionName() to JSInterface - use versionName in IITC About dialog --- code/utils_misc.js | 2 +- .../com/cradle/iitc_mobile/IITC_JSInterface.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index 5ca68549..996580c1 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -3,7 +3,7 @@ window.aboutIITC = function() { var v = (script_info.script && script_info.script.version || script_info.dateTimeVersion) + ' ['+script_info.buildName+']'; if (typeof android !== 'undefined' && android && android.getVersionCode) { - v += '[IITC Mobile '+android.getVersionCode()+']'; + v += '[IITC Mobile '+android.getVersionName()+']'; } var plugins = '
    '; diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java b/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java index 93873162..9c385881 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java @@ -76,6 +76,19 @@ public class IITC_JSInterface { return versionCode; } + @JavascriptInterface + public String getVersionName() { + String buildVersion = "unknown"; + PackageManager pm = mIitc.getPackageManager(); + try { + PackageInfo info = pm.getPackageInfo(mIitc.getPackageName(), 0); + buildVersion = info.versionName; + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + return buildVersion; + } + @JavascriptInterface public void switchToPane(final String id) { mIitc.runOnUiThread(new Runnable() { From 3f901a588a5cae7070e5a18df59c241922dec4f4 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Wed, 30 Oct 2013 23:45:59 +0100 Subject: [PATCH 11/72] made getScriptInfo static and use it in pluginpreferenceactivity --- .../IITC_PluginPreferenceActivity.java | 30 +++++-------------- .../iitc_mobile/IITC_WebViewClient.java | 13 ++++++-- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_PluginPreferenceActivity.java b/mobile/src/com/cradle/iitc_mobile/IITC_PluginPreferenceActivity.java index 02ac8ddd..78736a9e 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_PluginPreferenceActivity.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_PluginPreferenceActivity.java @@ -21,6 +21,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Scanner; @@ -193,29 +194,12 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity { void addPluginPreference(String src, String plugin_key, boolean user) { - // now parse plugin name, description and category - String header = src.substring(src.indexOf("==UserScript=="), - src.indexOf("==/UserScript==")); - // remove new line comments and replace with space - // this way we get double spaces instead of newline + double slash - header = header.replace("\n//", " "); - // get a list of key-value...split on multiple spaces - String[] attributes = header.split(" +"); - String plugin_name = "not found"; - String plugin_desc = "not found"; - String plugin_cat = "Misc"; - for (int j = 0; j < attributes.length; j++) { - // search for name and use the value - if (attributes[j].equals("@name")) { - plugin_name = attributes[j + 1]; - } - if (attributes[j].equals("@description")) { - plugin_desc = attributes[j + 1]; - } - if (attributes[j].equals("@category")) { - plugin_cat = attributes[j + 1]; - } - } + // parse plugin name, description and category + // we need default versions here otherwise iitcm may crash + HashMap info = IITC_WebViewClient.getScriptInfo(src); + String plugin_name = info.get("name"); + String plugin_cat = info.get("category"); + String plugin_desc = info.get("description"); // remove IITC plugin prefix from plugin_name plugin_name = plugin_name.replace("IITC Plugin: ", ""); diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java index 38f3e5ba..1749b3a9 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java @@ -56,7 +56,8 @@ public class IITC_WebViewClient extends WebViewClient { return map.get("version"); } - public HashMap getScriptInfo(String js) { + // static method because we use it in IITC_PluginPreferenceActivity too + public static HashMap getScriptInfo(String js) { HashMap map = new HashMap(); String header = ""; if (js != null) { @@ -67,7 +68,12 @@ public class IITC_WebViewClient extends WebViewClient { header = header.replace("\n//", " "); // get a list of key-value String[] attributes = header.split(" +"); - String iitc_version = "not found"; + // add default values + map.put("version", "not found"); + map.put("name", "unknown"); + map.put("description", ""); + map.put("category", "Misc"); + // add parsed values for (int i = 0; i < attributes.length; i++) { // search for attributes and use the value if (attributes[i].equals("@version")) { @@ -79,6 +85,9 @@ public class IITC_WebViewClient extends WebViewClient { if (attributes[i].equals("@description")) { map.put("description", attributes[i + 1]); } + if (attributes[i].equals("@category")) { + map.put("category", attributes[i + 1]); + } } return map; } From 3fba33b1ff6ec0dd351067e9f5e88aa19e6820b3 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Wed, 30 Oct 2013 23:56:07 +0100 Subject: [PATCH 12/72] bumped version number --- mobile/AndroidManifest.xml | 4 ++-- mobile/build-test.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index e09e2f20..10f69ab0 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="58" + android:versionName="0.8"> From 1d838568a0ed759a20e43aa660334fdbe00af6a6 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Thu, 31 Oct 2013 00:11:26 +0100 Subject: [PATCH 13/72] use correct function name in if statement --- code/utils_misc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index 996580c1..0a99019e 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -2,7 +2,7 @@ window.aboutIITC = function() { var v = (script_info.script && script_info.script.version || script_info.dateTimeVersion) + ' ['+script_info.buildName+']'; - if (typeof android !== 'undefined' && android && android.getVersionCode) { + if (typeof android !== 'undefined' && android && android.getVersionName) { v += '[IITC Mobile '+android.getVersionName()+']'; } From 0e4efe49ed1667c42cbe31c064fb0ca11162d05d Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 31 Oct 2013 06:47:04 +0000 Subject: [PATCH 14/72] update check plugin: change to table layout, change category - still not finished... --- plugins/update-check.user.js | 80 +++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/plugins/update-check.user.js b/plugins/update-check.user.js index f58cc1f3..e144332d 100644 --- a/plugins/update-check.user.js +++ b/plugins/update-check.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @id iitc-plugin-update-check@jonatkins // @name IITC plugin: Check for updates -// @category Tweaks +// @category Misc // @version 0.1.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ @@ -107,20 +107,21 @@ window.plugin.updateCheck.compareDetails = function(web_version, script_version) var webVerHTML = result.webVersion && window.plugin.updateCheck.versionHTML(result.webVersion); var localVerHTML = result.localVersion && window.plugin.updateCheck.versionHTML(result.localVersion); - var webLinkInstallHTML = ''; - if (result.downloadUrl && result.webUrl) { - webLinkInstallHTML = 'web ' - + 'install'; - } + +// var webLinkInstallHTML = ''; +// if (result.downloadUrl && result.webUrl) { +// webLinkInstallHTML = 'web ' +// + 'install'; +// } if (!result.localVersion) { - result.html = 'version check failed '+webLinkInstallHTML; + result.html = 'version check failed'; } else if (!result.webVersion) { result.html = 'version check failed'; } else if (result.upToDate) { result.html = 'up to date'; } else if (result.outOfDate) { - result.html = 'out of date '+webLinkInstallHTML; + result.html = 'out of date'; } else if (result.localNewer) { result.html = localVerHTML+' is newer than '+webVerHTML+'(?!)'; } else { @@ -156,31 +157,72 @@ window.plugin.updateCheck.showReport = function(data) { } if (data.plugins && window.bootPlugins) { - result += '
    Plugins:
      '; + + var plugins = { upToDate: [], outOfDate: [], other: [] }; if (window.bootPlugins.length == 0) { result += '
    • No plugins installed
    • '; } else { for (var i=0; i'; - } else { - result += '
    • '+name+': no version data on server(!?)
    • '; + pluginStatus.compare = compare; + if (compare.upToDate) { + pluginStatus.status = 'upToDate'; + } else if (compare.outOfDate) { + pluginStatus.status = 'outOfDate'; + } } - } else { - result += '
    • '+name+': non-standard plugin - cannot check version
    • '; } + + plugins[pluginStatus.status].push(pluginStatus); + } } - result += '
    '; + result += '
    Plugins:'; + + var formatRow = function(p) { + var status = p.status; + var name = p.name; + var statustext = p.compare && p.compare.html || '-'; + + return ''; + } + + result += ''; + for (var i in plugins.outOfDate) { + result += formatRow (plugins.outOfDate[i]); + } + if (plugins.outOfDate.length==0) { + result += ''; + } + + result += ''; + for (var i in plugins.upToDate) { + result += formatRow (plugins.upToDate[i]); + } + if (plugins.upToDate.length==0) { + result += ''; + } + + result += ''; + for (var i in plugins.other) { + result += formatRow (plugins.other[i]); + } + if (plugins.other.length==0) { + result += ''; + } + + result += ''; } } From ed04a3959b2ec580504a84a4b053838c639d717f Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 31 Oct 2013 20:37:39 +0000 Subject: [PATCH 15/72] bump version number --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index c51ff443..e379b564 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,7 @@ // ==UserScript== // @id ingress-intel-total-conversion@jonatkins // @name IITC: Ingress intel map total conversion -// @version 0.14.4.@@DATETIMEVERSION@@ +// @version 0.14.5.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ From 5817052cbdf9430aac9648d8e042abf6b37b164d Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Sun, 3 Nov 2013 14:48:39 +0100 Subject: [PATCH 16/72] set copyToClipboard activity to exported...may be used by other applications (fix for #624) --- mobile/AndroidManifest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index 10f69ab0..f63e3dae 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -23,7 +23,7 @@ android:label="@string/app_name" android:theme="@style/AppTheme"> + android:value=".IITC_Mobile"/> From b678d83afd9cc2b2423696cd015688e3f1d23b78 Mon Sep 17 00:00:00 2001 From: fkloft Date: Mon, 4 Nov 2013 18:09:00 +0100 Subject: [PATCH 17/72] Set exported to "false" again and include a fix for wrong PackageManager queries --- mobile/AndroidManifest.xml | 2 +- .../src/com/cradle/iitc_mobile/share/IntentListView.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index f63e3dae..93066966 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -100,7 +100,7 @@ android:name=".share.SendToClipboard" android:enabled="true" android:excludeFromRecents="true" - android:exported="true" + android:exported="false" android:icon="@drawable/copy" android:label="@string/activity_share_to_clipboard" android:noHistory="false"> diff --git a/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java b/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java index 621f023c..235701bf 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java +++ b/mobile/src/com/cradle/iitc_mobile/share/IntentListView.java @@ -152,11 +152,19 @@ public class IntentListView extends ListView { ResolveInfo info = activityList.get(i); ActivityInfo activity = info.activityInfo; + // fix bug in PackageManager - a replaced package name might cause non-exported intents to appear + if (activity.exported == false && !activity.packageName.equals(packageName)) { + activityList.remove(i); + i--; + continue; + } + // remove all IITCm intents, except for SendToClipboard in case Drive is not installed if (activity.packageName.equals(packageName)) { if (hasCopyIntent || !activity.name.equals(SendToClipboard.class.getCanonicalName())) { activityList.remove(i); i--; + continue; } } } From 9a998b7a940918877722280f7b76be2e577ed30e Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 4 Nov 2013 18:19:31 +0100 Subject: [PATCH 18/72] use relativ name for searchable meta-data value --- mobile/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index 93066966..a4528ae7 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -136,7 +136,7 @@ + android:value=".IITC_Mobile"/> From d3c31ac3e38bf7d53c9a750a6d48a73bbd63870c Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 4 Nov 2013 18:26:46 +0000 Subject: [PATCH 19/72] add-kml plugin: - fix version number so it's the x.y.z.yyyymmdd.hhmmss format (3 digits before date) - change category to 'layer' - makes more sense there (or would 'controls' be better?) --- plugins/add-kml.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/add-kml.user.js b/plugins/add-kml.user.js index 45c4ce2c..0ff7d41b 100755 --- a/plugins/add-kml.user.js +++ b/plugins/add-kml.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @id overlay-kml@danielatkins // @name IITC plugin: overlay KML -// @category Info -// @version 0.1.@@DATETIMEVERSION@@ +// @category Layer +// @version 0.2.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ From 154bf3c6ab63148a0c66cd48cc1d938ab0d8a6df Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Wed, 6 Nov 2013 00:24:31 +0100 Subject: [PATCH 20/72] modified player tracker. show leaflet popup instead of tooltip on mobile --- plugins/player-tracker.user.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index f79e382a..89ca7329 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -295,16 +295,16 @@ window.plugin.playerTracker.drawData = function() { } } - title += '\n' - + ago(last.time, now) + ' ago\n' + title += '
    ' + + ago(last.time, now) + ' ago
    ' + window.chat.getChatPortalName(last); // show previous data in tooltip var minsAgo = '\t ago\t'; if(evtsLength >= 2) - title += '\n \nprevious locations:\n'; + title += '
     
    previous locations:
    '; for(var i = evtsLength - 2; i >= 0 && i >= evtsLength - 10; i--) { var ev = playerData.events[i]; - title += ago(ev.time, now) + minsAgo + window.chat.getChatPortalName(ev) + '\n'; + title += ago(ev.time, now) + minsAgo + window.chat.getChatPortalName(ev) + '
    '; } // calculate the closest portal to the player @@ -330,6 +330,8 @@ window.plugin.playerTracker.drawData = function() { // 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, opacity: absOpacity}); + if (typeof android !== 'undefined' && android) + m.bindPopup(title); // 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 9c1449fc7d47be8671f1d9a2ed60ddd2a68ea297 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Wed, 6 Nov 2013 00:26:24 +0100 Subject: [PATCH 21/72] fixed bootloop of sync plugin --- mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java index 1749b3a9..48f711cc 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java @@ -43,6 +43,7 @@ public class IITC_WebViewClient extends WebViewClient { private String mIitcScript = null; private String mIitcPath = null; + private boolean mIitcInjected = false; private final Context mContext; public IITC_WebViewClient(Context c) { @@ -142,6 +143,7 @@ public class IITC_WebViewClient extends WebViewClient { } else { js = this.fileToString("total-conversion-build.user.js", true); } + mIitcInjected = false; } PackageManager pm = mContext.getPackageManager(); @@ -177,8 +179,10 @@ public class IITC_WebViewClient extends WebViewClient { public void onPageFinished(WebView view, String url) { if (url.startsWith("http://www.ingress.com/intel") || url.startsWith("https://www.ingress.com/intel")) { + if (mIitcInjected) return; Log.d("iitcm", "injecting iitc.."); view.loadUrl("javascript: " + this.mIitcScript); + mIitcInjected = true; loadPlugins(view); } super.onPageFinished(view, url); From e0a4eb43136d27777c51422e802cabc5435acecc Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Wed, 6 Nov 2013 00:34:25 +0100 Subject: [PATCH 22/72] updated to SDK v19. still work in progreses... --- mobile/.idea/misc.xml | 18 +------ mobile/AndroidManifest.xml | 2 +- mobile/project.properties | 2 +- .../IITC_PluginPreferenceActivity.java | 5 ++ .../com/cradle/iitc_mobile/IITC_WebView.java | 54 ++++++++++++------- plugins/player-tracker.user.js | 12 +++-- 6 files changed, 51 insertions(+), 42 deletions(-) diff --git a/mobile/.idea/misc.xml b/mobile/.idea/misc.xml index 31e23495..062c409c 100644 --- a/mobile/.idea/misc.xml +++ b/mobile/.idea/misc.xml @@ -10,24 +10,8 @@ - + - - - - - Android 4.3 Platform - - - - - - - diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index a4528ae7..b7e97372 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -7,7 +7,7 @@ + android:targetSdkVersion="19"/> diff --git a/mobile/project.properties b/mobile/project.properties index ce39f2d0..4ab12569 100644 --- a/mobile/project.properties +++ b/mobile/project.properties @@ -11,4 +11,4 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-18 +target=android-19 diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_PluginPreferenceActivity.java b/mobile/src/com/cradle/iitc_mobile/IITC_PluginPreferenceActivity.java index 78736a9e..fe1680cb 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_PluginPreferenceActivity.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_PluginPreferenceActivity.java @@ -104,6 +104,11 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity { } } + @Override + protected boolean isValidFragment(String s) { + return true; + } + // called by Plugins Fragment public static ArrayList getPluginPreference(String key) { return sPlugins.get(key); diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java index 5754c1ec..2519eae8 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java @@ -16,6 +16,7 @@ import android.view.View; import android.view.WindowManager; import android.webkit.ConsoleMessage; import android.webkit.GeolocationPermissions; +import android.webkit.ValueCallback; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; @@ -138,24 +139,9 @@ public class IITC_WebView extends WebView { @Override public void loadUrl(String url) { - // if in edit text mode, don't load javascript otherwise the keyboard closes. - HitTestResult testResult = getHitTestResult(); - if (url.startsWith("javascript:") && testResult != null && - testResult.getType() == HitTestResult.EDIT_TEXT_TYPE) { - // let window.show(...) interupt input - // window.show(...) is called if one of the action bar buttons - // is clicked - if (!url.startsWith("javascript: window.show(")) { - Log.d("iitcm", "in insert mode. do not load script."); - return; - } - } - // do nothing if script is enabled; - if (mDisableJs) { - Log.d("iitcm", "javascript injection disabled...return"); - return; - } - if (!url.startsWith("javascript:")) { + if (url.startsWith("javascript:")) { + loadJS(url.substring("javascript:".length())); + } else { // force https if enabled in settings SharedPreferences sharedPref = PreferenceManager .getDefaultSharedPreferences(getContext()); @@ -168,8 +154,38 @@ public class IITC_WebView extends WebView { // disable splash screen if a http error code is responded new CheckHttpResponse(mJsInterface, mIitc).execute(url); Log.d("iitcm", "loading url: " + url); + super.loadUrl(url); + } + } + + public void loadJS(String js) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + evaluateJavascript(js, new ValueCallback() { + @Override + public void onReceiveValue(String value) { + // maybe we want to add stuff here + return; + } + }); + } else { + // if in edit text mode, don't load javascript otherwise the keyboard closes. + HitTestResult testResult = getHitTestResult(); + if (testResult != null && testResult.getType() == HitTestResult.EDIT_TEXT_TYPE) { + // let window.show(...) interupt input + // window.show(...) is called if one of the action bar buttons + // is clicked + if (!js.startsWith("window.show(")) { + Log.d("iitcm", "in insert mode. do not load script."); + return; + } + } + // do nothing if script is enabled; + if (mDisableJs) { + Log.d("iitcm", "javascript injection disabled...return"); + return; + } + super.loadUrl("javascript:" + js); } - super.loadUrl(url); } @Override diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index 89ca7329..20be22a4 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -329,11 +329,15 @@ window.plugin.playerTracker.drawData = function() { // 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, opacity: absOpacity}); - if (typeof android !== 'undefined' && android) + var m; + if (typeof android !== 'undefined' && android) { + m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity}); m.bindPopup(title); - // ensure tooltips are closed, sometimes they linger - m.on('mouseout', function() { $(this._icon).tooltip('close'); }); + } else { + 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); plugin.playerTracker.oms.addMarker(m); // jQueryUI doesn’t automatically notice the new markers From 750b9aca997e3cc428fdd6ab35cd0fc1cbda8600 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 6 Nov 2013 02:45:33 +0000 Subject: [PATCH 23/72] add missing player name resolving calls to scoreboard and portals-list --- plugins/portals-list.user.js | 7 +++++-- plugins/scoreboard.user.js | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index 2f34d169..5f03b471 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-portals-list@teo96 // @name IITC plugin: show list of portals // @category Info -// @version 0.0.17.@@DATETIMEVERSION@@ +// @version 0.0.18.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -211,11 +211,14 @@ window.plugin.portalslist.displayPL = function() { $(document).on('click.portalslist', '#portalslist .filterEnl', function() { $('#portalslist').html(window.plugin.portalslist.portalTable($(this).data('sort'),window.plugin.portalslist.sortOrder,2)); }); + + //run the name resolving process + resolvePlayerNames(); //debug tools //end = new Date().getTime(); //console.log('***** end : ' + end + ' and Elapse : ' + (end - start)); - } +} window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) { // sortOrder <0 ==> desc, >0 ==> asc, i use sortOrder * -1 to change the state diff --git a/plugins/scoreboard.user.js b/plugins/scoreboard.user.js index 2a0d4b42..22bd189b 100644 --- a/plugins/scoreboard.user.js +++ b/plugins/scoreboard.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-scoreboard@vita10gy // @name IITC plugin: show a localized scoreboard. // @category Info -// @version 0.1.8.@@DATETIMEVERSION@@ +// @version 0.1.9.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -291,6 +291,9 @@ window.plugin.scoreboard.display = function() { $(document).on('click', '#players table th', function() { $('#players').html(window.plugin.scoreboard.playerTable($(this).data('sort'))); }); + + //run the name resolving process + resolvePlayerNames(); } window.plugin.scoreboard.portalDistance = function(portalAE6Location, portalBE6Location) { From ead131a4753d624c53ffb8ba81e132d896ab6b14 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Wed, 6 Nov 2013 09:40:16 +0100 Subject: [PATCH 24/72] bumped version number of mobile app --- mobile/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index b7e97372..21fa7ea6 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="59" + android:versionName="0.9"> Date: Wed, 6 Nov 2013 09:40:41 +0100 Subject: [PATCH 25/72] use marker popup instead of mouseover tooltip on user location --- mobile/plugins/user-location.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mobile/plugins/user-location.user.js b/mobile/plugins/user-location.user.js index 4dbd30ba..aefe7b62 100644 --- a/mobile/plugins/user-location.user.js +++ b/mobile/plugins/user-location.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @id iitc-plugin-user-location@cradle // @name IITC plugin: User Location -// @version 0.1.3.@@DATETIMEVERSION@@ +// @version 0.1.4.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -35,10 +35,11 @@ window.plugin.userLocation.setup = function() { var title = '' + PLAYER.nickname + '\'s location'; var marker = L.marker(window.map.getCenter(), { - title: title, icon: new plugin.userLocation.icon() }); + marker.bindPopup(title); + plugin.userLocation.marker = marker; marker.addTo(window.map); // jQueryUI doesn’t automatically notice the new markers From 8e6f78701e1760150860b239faa2a0bb0aa9bf1c Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 6 Nov 2013 19:58:57 +0000 Subject: [PATCH 26/72] restyle leaflet popups so they follow the theme of the rest of the IITC interface --- style.css | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/style.css b/style.css index a368573e..3886aa79 100644 --- a/style.css +++ b/style.css @@ -982,3 +982,36 @@ td + td { display: none; } + + +/* leaflet popups - restyle to match the theme of IITC */ +#map .leaflet-popup-content-wrapper { + border-radius: 0px; + -webkit-border-radius: 0px; + border: 1px solid #20A8B1; + background: #0e3d4e; +} + +#map .leaflet-popup-content { + color: #ffce00; + margin: 5px 8px; +} + +#map .leaflet-popup-close-button { + display: none; +} + +#map .leaflet-popup-tip { + /* change the tip from an arrow to a simple line */ + background: #20A8B1; + width: 1px; + height: 20px; + padding: 0; + margin: 0 0 0 20px; + -webkit-transform: none; + -moz-transform: none; + -ms-transform: none; + -o-transform: none; + transform: none; + +} From 752eb65b8ee46193e84bd2224df9c07924171d44 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 6 Nov 2013 21:14:43 +0000 Subject: [PATCH 27/72] new munge set - 2013-11-06 --- code/utils_misc.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/code/utils_misc.js b/code/utils_misc.js index 0a99019e..2a9643bb 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -171,6 +171,49 @@ window.requestParameterMunges = [ inviteeEmailAddress: 'x16pe9u4i8bidbi2', }, + // set 7 - 2013-11-06 + { + 'dashboard.getArtifactInfo': 'artifacts', // GET_ARTIFACT_INFO: new (and not obfsucated?!) + 'dashboard.getGameScore': 'yol4dxx5ufqolhk2', // GET_GAME_SCORE + 'dashboard.getPaginatedPlextsV2': '7b83j2z81rtk6101', // GET_PAGINATED_PLEXTS + 'dashboard.getThinnedEntitiesV4': '46su4lrisoq28gxh', // GET_THINNED_ENTITIES + 'dashboard.getPlayersByGuids': 'wsc5puahrymtf1qh', // LOOKUP_PLAYERS + 'dashboard.redeemReward': 'oo0n7pw2m0xufpzx', // REDEEM_REWARD + 'dashboard.sendInviteEmail': 'bo1bp74rz8kbdjkb', // SEND_INVITE_EMAIL + 'dashboard.sendPlext': 'q0f8o4v9t8pt91yv', // SEND_PLEXT + + // common parameters + method: 'imo60cdzkemxduub', + version: '54lh4o0q7nz7dao9', //guessed parameter name - only seen munged + version_parameter: '370c0b4e160ed26c8c4ce40f10f546545730e1ef', // passed as the value to the above parameter + + // GET_THINNED_ENTITIES + quadKeys: 'iqy8e2d3zpne0cmh', //guessed parameter name - only seen munged + + // GET_PAGINATED_PLEXTS + desiredNumItems: 'chwe3yko3xy0qlk3', + minLatE6: 'f31z3x27ua8i05cf', + minLngE6: 't0rmob7f42c0w04r', + maxLatE6: 'ebwfvri5io9q0tvu', + maxLngE6: 'lfqzvpj92dp8uxo6', + minTimestampMs: '23a6djyyieeaeduu', + maxTimestampMs: 'zhjtsm2gw7w3b7mx', + chatTab: 'tak64gipm3hhqpnh', //guessed parameter name - only seen munged + ascendingTimestampOrder: 'v5rzzxtg5rmry3dx', + + // SEND_PLEXT + message: 'onptntn3szan21lj', + latE6: '1jq9lgu3hjajrt7s', + lngE6: 'plbubiopnavbxxh6', +// chatTab: 'tak64gipm3hhqpnh', //guessed parameter name - only seen munged + + // LOOKUP_PLAYERS + guids: '919p2cfpdo2wz03n', + + // SEND_INVITE_EMAIL + inviteeEmailAddress: 'thpbnoyjx0antwm5', + }, + ]; window.activeRequestMungeSet = undefined; From d7bec4866033cde9a88c971233fc3cd3b610f970 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 6 Nov 2013 21:32:42 +0000 Subject: [PATCH 28/72] website: add brief note about new release --- website/page/home.php | 6 ++++++ website/page/news.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/website/page/home.php b/website/page/home.php index 1eda08fc..cdebd36f 100644 --- a/website/page/home.php +++ b/website/page/home.php @@ -13,6 +13,12 @@ offers many more features. It is available for

    Latest news

    +

    6th October 2013

    +

    +IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates. +Other than this, it is identical to the 0.14.4/0.7.7 release. +

    +

    29th October 2013

    IITC 0.14.4 and IITC Mobile 0.7.7 have just been released. A critical update required to work with changes made to the diff --git a/website/page/news.php b/website/page/news.php index e2e63673..69542478 100644 --- a/website/page/news.php +++ b/website/page/news.php @@ -1,5 +1,11 @@

    News

    +

    6th October 2013

    +

    +IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates. +Other than this, it is identical to the 0.14.4/0.7.7 release. +

    +

    29th October 2013

    IITC 0.14.4 and IITC Mobile 0.7.7 have just been released. A critical update required to work with changes made to the From 1f6d25ab59cbee98b1b15946158f9dab5ba9d772 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 6 Nov 2013 22:19:48 +0000 Subject: [PATCH 29/72] bump dev builds to version 0.15.0, in preperation for a new release --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index e379b564..1f595a0b 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,7 @@ // ==UserScript== // @id ingress-intel-total-conversion@jonatkins // @name IITC: Ingress intel map total conversion -// @version 0.14.5.@@DATETIMEVERSION@@ +// @version 0.15.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ From 079ce89a20e1843f8d9d93bf5f50156c2ce5aafc Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Thu, 7 Nov 2013 00:39:26 +0100 Subject: [PATCH 30/72] bugfix: broken playertracker layout - use popup instead of tooltip on desktop too (see #630) --- plugins/player-tracker.user.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index 20be22a4..602907a3 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -299,13 +299,18 @@ window.plugin.playerTracker.drawData = function() { + ago(last.time, now) + ' ago
    ' + window.chat.getChatPortalName(last); // show previous data in tooltip - var minsAgo = '\t ago\t'; - if(evtsLength >= 2) - title += '
     
    previous locations:
    '; + if(evtsLength >= 2) { + title += '
     
    previous locations:
    ' + + '

    '+name+''+statustext+'
    Out of date
    no plugins
    Up To Date
    no plugins
    Other
    no plugins
    '; + } for(var i = evtsLength - 2; i >= 0 && i >= evtsLength - 10; i--) { var ev = playerData.events[i]; - title += ago(ev.time, now) + minsAgo + window.chat.getChatPortalName(ev) + '
    '; + title += '' + + '' + + ''; } + if(evtsLength >= 2) + title += '
    ' + ago(ev.time, now) + 'ago' + window.chat.getChatPortalName(ev) + '
    '; // calculate the closest portal to the player var eventPortal = [] @@ -330,14 +335,8 @@ window.plugin.playerTracker.drawData = function() { // marker itself var icon = playerData.team === 'RESISTANCE' ? new plugin.playerTracker.iconRes() : new plugin.playerTracker.iconEnl(); var m; - if (typeof android !== 'undefined' && android) { - m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity}); - m.bindPopup(title); - } else { - 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 = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity}); + m.bindPopup(title); m.addTo(playerData.team === 'RESISTANCE' ? plugin.playerTracker.drawnTracesRes : plugin.playerTracker.drawnTracesEnl); plugin.playerTracker.oms.addMarker(m); // jQueryUI doesn’t automatically notice the new markers From d4194dc8af12fa3a89c63342e3660499ddf45e2b Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 6 Nov 2013 23:43:12 +0000 Subject: [PATCH 31/72] website: fix date on latest news entry --- website/page/home.php | 2 +- website/page/news.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/page/home.php b/website/page/home.php index cdebd36f..02ae9641 100644 --- a/website/page/home.php +++ b/website/page/home.php @@ -13,7 +13,7 @@ offers many more features. It is available for

    Latest news

    -

    6th October 2013

    +

    6th November 2013

    IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates. Other than this, it is identical to the 0.14.4/0.7.7 release. diff --git a/website/page/news.php b/website/page/news.php index 69542478..0edb63e3 100644 --- a/website/page/news.php +++ b/website/page/news.php @@ -1,6 +1,6 @@

    News

    -

    6th October 2013

    +

    6th November 2013

    IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates. Other than this, it is identical to the 0.14.4/0.7.7 release. From 3ff65225c39153e30878cd7377d0ab141616bc40 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 7 Nov 2013 00:17:01 +0000 Subject: [PATCH 32/72] update overlapping marker spider code --- external/oms.min.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/external/oms.min.js b/external/oms.min.js index a53aede5..3b426845 100644 --- a/external/oms.min.js +++ b/external/oms.min.js @@ -5,15 +5,15 @@ Copyright (c) 2011 - 2012 George MacKerron Released under the MIT licence: http://opensource.org/licenses/mit-license Note: The Leaflet maps API must be included *before* this code */ -(function(){var n={}.hasOwnProperty,o=[].slice;null!=this.L&&(this.OverlappingMarkerSpiderfier=function(){function l(c,b){var a,e,g,f,d=this;this.map=c;null==b&&(b={});for(a in b)n.call(b,a)&&(e=b[a],this[a]=e);this.initMarkerArrays();this.listeners={};f=["click","zoomend"];e=0;for(g=f.length;eb)return this;a=this.markerListeners.splice(b,1)[0];c.removeEventListener("click",a);delete c._oms;this.markers.splice(b,1);return this};d.clearMarkers=function(){var c,b,a,e,g;this.unspiderfy();g=this.markers;c=a=0;for(e=g.length;aa||this.listeners[c].splice(a,1);return this};d.clearListeners=function(c){this.listeners[c]=[];return this};d.trigger=function(){var c,b,a,e,g,f;b=arguments[0];c=2<=arguments.length?o.call(arguments,1):[];b=null!=(a=this.listeners[b])?a:[];f=[];e=0;for(g=b.length;ec;a=0<=c?++f:--f)a=this.circleStartAngle+a*e,d.push(new L.Point(b.x+g*Math.cos(a),b.y+g*Math.sin(a)));return d};d.generatePtsSpiral=function(c,b){var a,e,g,f,d;g=this.spiralLengthStart;a=0;d=[];for(e=f=0;0<=c?fc;e=0<=c?++f:--f)a+=this.spiralFootSeparation/g+5.0E-4*e,e=new L.Point(b.x+g*Math.cos(a),b.y+g*Math.sin(a)),g+=i*this.spiralLengthFactor/a,d.push(e);return d};d.spiderListener=function(c){var b,a,e,g,f,d,h,i,j;b= -null!=c._omsData;(!b||!this.keepSpiderfied)&&this.unspiderfy();if(b)return this.trigger("click",c);g=[];f=[];d=this.nearbyDistance*this.nearbyDistance;e=this.map.latLngToLayerPoint(c.getLatLng());j=this.markers;h=0;for(i=j.length;h=this.circleSpiralSwitchover?this.generatePtsSpiral(k,a).reverse():this.generatePtsCircle(k,a);a=function(){var a,b,i,k=this;i=[];a=0;for(b=d.length;aa||this.listeners[c].splice(a,1);return this};d.clearListeners=function(c){this.listeners[c]=[];return this};d.trigger=function(){var c,b,a,e,g,f;b=arguments[0];c=2<=arguments.length?r.call(arguments,1):[];b=null!=(a=this.listeners[b])?a:[];f=[];e=0;for(g=b.length;ec;a=0<=c?++f:--f)a=this.circleStartAngle+a*e,d.push(new L.Point(b.x+g*Math.cos(a),b.y+g*Math.sin(a)));return d};d.generatePtsSpiral=function(c,b){var a,e,g,f,d;g=this.spiralLengthStart;a=0;d=[];for(e=f=0;0<=c?fc;e=0<=c?++f:--f)a+=this.spiralFootSeparation/g+5E-4*e,e=new L.Point(b.x+g*Math.cos(a),b.y+g*Math.sin(a)),g+=k*this.spiralLengthFactor/a,d.push(e);return d};d.spiderListener=function(c){var b,a,e,g,f,d,h,k,l;(b=null!= +c._omsData)&&this.keepSpiderfied||this.unspiderfy();if(b)return this.trigger("click",c);g=[];f=[];d=this.nearbyDistance*this.nearbyDistance;e=this.map.latLngToLayerPoint(c.getLatLng());l=this.markers;h=0;for(k=l.length;h=this.circleSpiralSwitchover?this.generatePtsSpiral(m,a).reverse():this.generatePtsCircle(m,a);a=function(){var a,b,k,m=this;k=[];a=0;for(b=d.length;a Date: Thu, 7 Nov 2013 00:17:18 +0000 Subject: [PATCH 33/72] change player tracker to always use a popup some code changes related to interfacing with clicks and oms, doing things as recommended by the oms code --- plugins/player-tracker.user.js | 44 ++++++++++++++++------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index 20be22a4..f93cff87 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-player-tracker@breunigs // @name IITC Plugin: Player tracker // @category Layer -// @version 0.9.6.@@DATETIMEVERSION@@ +// @version 0.10.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -62,12 +62,20 @@ window.plugin.playerTracker.setup = function() { }); } }); - plugin.playerTracker.oms = new OverlappingMarkerSpiderfier(map); + plugin.playerTracker.oms = new OverlappingMarkerSpiderfier(map, {keepSpiderfied: true, legWeight: 3.5}); plugin.playerTracker.oms.legColors = {'usual': '#FFFF00', 'highlighted': '#FF0000'}; - plugin.playerTracker.oms.legWeight = 3.5; + + var playerPopup = new L.Popup({offset: L.point([0,-20])}); plugin.playerTracker.oms.addListener('click', function(player) { window.renderPortalDetails(player.options.referenceToPortal); + playerPopup.setContent(player.options.desc); + playerPopup.setLatLng(player.getLatLng()); + map.openPopup(playerPopup) }); + plugin.playerTracker.oms.addListener('spiderfy', function(markers) { + map.closePopup(); + }); + addHook('publicChatDataAvailable', window.plugin.playerTracker.handleData); @@ -226,6 +234,7 @@ window.plugin.playerTracker.processNewData = function(data) { } window.plugin.playerTracker.getLatLngFromEvent = function(ev) { +//TODO? add weight to certain events, or otherwise prefer them, to give better locations? var lats = 0; var lngs = 0; $.each(ev.latlngs, function() { @@ -275,13 +284,13 @@ window.plugin.playerTracker.drawData = function() { polyLineByAgeEnl[ageBucket].push(line); } - // tooltip for marker + // popup for marker var evtsLength = playerData.events.length; var last = playerData.events[evtsLength-1]; var ago = plugin.playerTracker.ago; var cssClass = playerData.team === 'RESISTANCE' ? 'res' : 'enl'; var title = '' + playerData.nick + ''; - + if(window.plugin.guessPlayerLevels !== undefined && window.plugin.guessPlayerLevels.fetchLevelByPlayer !== undefined) { var playerLevel = window.plugin.guessPlayerLevels.fetchLevelByPlayer(pguid); @@ -298,7 +307,7 @@ window.plugin.playerTracker.drawData = function() { title += '
    ' + ago(last.time, now) + ' ago
    ' + window.chat.getChatPortalName(last); - // show previous data in tooltip + // show previous data in popup var minsAgo = '\t ago\t'; if(evtsLength >= 2) title += '
     
    previous locations:
    '; @@ -329,19 +338,13 @@ window.plugin.playerTracker.drawData = function() { // marker itself var icon = playerData.team === 'RESISTANCE' ? new plugin.playerTracker.iconRes() : new plugin.playerTracker.iconEnl(); - var m; - if (typeof android !== 'undefined' && android) { - m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity}); - m.bindPopup(title); - } else { - 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'); }); - } +// as per OverlappingMarkerSpiderfier docs, click events (popups, etc) must be handled via it rather than the standard +// marker click events. so store the popup text in the options, then display it in the oms click handler + var m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity, desc: title}); +// m.bindPopup(title); + 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 @@ -378,13 +381,6 @@ window.plugin.playerTracker.handleData = function(data) { plugin.playerTracker.discardOldData(); plugin.playerTracker.processNewData(data); - // remove old popups - 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.drawnTracesEnl.clearLayers(); plugin.playerTracker.drawnTracesRes.clearLayers(); From 6ea2e82637b04db1717889385a19de116d133609 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 7 Nov 2013 01:02:08 +0000 Subject: [PATCH 34/72] new basemap plugin - a few from maps.stamen.com --- plugins/basemap-stamen.user.js | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 plugins/basemap-stamen.user.js diff --git a/plugins/basemap-stamen.user.js b/plugins/basemap-stamen.user.js new file mode 100644 index 00000000..2478e076 --- /dev/null +++ b/plugins/basemap-stamen.user.js @@ -0,0 +1,56 @@ +// ==UserScript== +// @id iitc-plugin-basemap-stamen@jonatkins +// @name IITC plugin: Map layers from stamen.com +// @category Map Tiles +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Adds the 'Toner' and 'Watercolor' map layers from maps.stamen.com +// @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== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + + +// use own namespace for plugin +window.plugin.mapTileStamen = function() {}; + +window.plugin.mapTileStamen.setup = function() { + + load('http://maps.stamen.com/js/tile.stamen.js?v1.2.3').thenRun(window.plugin.mapTileStamen.addLayer); +} + +window.plugin.mapTileStamen.addLayer = function() { + + var types = { + 'toner': 'Toner', +// 'toner-hybrid': 'Toner Hybrid', // transparent layer. could be usefun over satelliate imagery or similar +// 'toner-labels': 'Toner Labels', // transparent layer. could be usefun over satelliate imagery or similar +// 'toner-lines': 'Toner Lines', // transparent layer. could be usefun over satelliate imagery or similar + 'toner-background': 'Toner Background', + 'toner-lite': 'Toner Lite', + 'watercolor': 'Watercolor', + }; + + for (var type in types) { + var name = types[type]; + + var layer = new L.StamenTileLayer(type); + + layerChooser.addBaseLayer(layer,'Stamen '+name); + } + +}; + +var setup = window.plugin.mapTileStamen.setup; + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@ From 24581e5893f5ecd2e20740eabc4b94ffe5b8fe92 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 7 Nov 2013 01:44:22 +0000 Subject: [PATCH 35/72] bing.com base map layers --- plugins/basemap-bing.user.js | 174 +++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 plugins/basemap-bing.user.js diff --git a/plugins/basemap-bing.user.js b/plugins/basemap-bing.user.js new file mode 100644 index 00000000..9a1f4adc --- /dev/null +++ b/plugins/basemap-bing.user.js @@ -0,0 +1,174 @@ +// ==UserScript== +// ==UserScript== +// @id iitc-plugin-bing-maps +// @name IITC plugin: Bing maps +// @category 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 maps.bing.com map layers ( +// @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== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + +window.plugin.mapBing = function() {}; + +window.plugin.mapBing.setupBingLeaflet = function() { +//--------------------------------------------------------------------- +// https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Bing.js +L.BingLayer = L.TileLayer.extend({ + options: { + subdomains: [0, 1, 2, 3], + type: 'Aerial', + attribution: 'Bing', + culture: '' + }, + + initialize: function(key, options) { + L.Util.setOptions(this, options); + + this._key = key; + this._url = null; + this.meta = {}; + this.loadMetadata(); + }, + + tile2quad: function(x, y, z) { + var quad = ''; + for (var i = z; i > 0; i--) { + var digit = 0; + var mask = 1 << (i - 1); + if ((x & mask) != 0) digit += 1; + if ((y & mask) != 0) digit += 2; + quad = quad + digit; + } + return quad; + }, + + getTileUrl: function(p, z) { + var z = this._getZoomForUrl(); + var subdomains = this.options.subdomains, + s = this.options.subdomains[Math.abs((p.x + p.y) % subdomains.length)]; + return this._url.replace('{subdomain}', s) + .replace('{quadkey}', this.tile2quad(p.x, p.y, z)) + .replace('{culture}', this.options.culture); + }, + + loadMetadata: function() { + // TODO? modify this to cache the metadata in - say - sessionStorage? localStorage? + var _this = this; + var cbid = '_bing_metadata_' + L.Util.stamp(this); + window[cbid] = function (meta) { + _this.meta = meta; + window[cbid] = undefined; + var e = document.getElementById(cbid); + e.parentNode.removeChild(e); + if (meta.errorDetails) { + alert("Got metadata" + meta.errorDetails); + return; + } + _this.initMetadata(); + }; + var url = "//dev.virtualearth.net/REST/v1/Imagery/Metadata/" + this.options.type + "?include=ImageryProviders&jsonp=" + cbid + "&key=" + this._key; + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = url; + script.id = cbid; + document.getElementsByTagName("head")[0].appendChild(script); + }, + + initMetadata: function() { + var r = this.meta.resourceSets[0].resources[0]; + this.options.subdomains = r.imageUrlSubdomains; + this._url = r.imageUrl; + this._providers = []; + for (var i = 0; i < r.imageryProviders.length; i++) { + var p = r.imageryProviders[i]; + for (var j = 0; j < p.coverageAreas.length; j++) { + var c = p.coverageAreas[j]; + var coverage = {zoomMin: c.zoomMin, zoomMax: c.zoomMax, active: false}; + var bounds = new L.LatLngBounds( + new L.LatLng(c.bbox[0]+0.01, c.bbox[1]+0.01), + new L.LatLng(c.bbox[2]-0.01, c.bbox[3]-0.01) + ); + coverage.bounds = bounds; + coverage.attrib = p.attribution; + this._providers.push(coverage); + } + } + this._update(); + }, + + _update: function() { + if (this._url == null || !this._map) return; + this._update_attribution(); + L.TileLayer.prototype._update.apply(this, []); + }, + + _update_attribution: function() { + var bounds = this._map.getBounds(); + var zoom = this._map.getZoom(); + for (var i = 0; i < this._providers.length; i++) { + var p = this._providers[i]; + if ((zoom <= p.zoomMax && zoom >= p.zoomMin) && + bounds.intersects(p.bounds)) { + if (!p.active) + this._map.attributionControl.addAttribution(p.attrib); + p.active = true; + } else { + if (p.active) + this._map.attributionControl.removeAttribution(p.attrib); + p.active = false; + } + } + }, + + onRemove: function(map) { + for (var i = 0; i < this._providers.length; i++) { + var p = this._providers[i]; + if (p.active) { + this._map.attributionControl.removeAttribution(p.attrib); + p.active = false; + } + } + L.TileLayer.prototype.onRemove.apply(this, [map]); + } +}); +//--------------------------------------------------------------------- +} + + +window.plugin.mapBing.setup = function() { + window.plugin.mapBing.setupBingLeaflet(); + + //set this to your API key + var bingApiKey = 'ArR2hTa2C9cRQZT-RmgrDkfvh3PwEVRl0gB34OO4wJI7vQNElg3DDWvbo5lfUs3p'; + + var bingTypes = { + 'Road': "Road", + 'Aerial': "Aerial", + 'AerialWithLabels': "Aerial with labels", + }; + + for (type in bingTypes) { + var name = bingTypes[type]; + var bingMap = new L.BingLayer(bingApiKey, {type: type, maxZoom:20}); + layerChooser.addBaseLayer(bingMap, 'Bing '+name); + } + +}; + +var setup = window.plugin.mapBing.setup; + +// PLUGIN END ////////////////////////////////////////////////////////// + + +@@PLUGINEND@@ From c602e42b2a5d0b636cca131b604aacca646c0372 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 7 Nov 2013 01:45:42 +0000 Subject: [PATCH 36/72] basemap: nokia ovi maps --- plugins/basemap-nokia-ovi.user.js | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 plugins/basemap-nokia-ovi.user.js diff --git a/plugins/basemap-nokia-ovi.user.js b/plugins/basemap-nokia-ovi.user.js new file mode 100644 index 00000000..e345d921 --- /dev/null +++ b/plugins/basemap-nokia-ovi.user.js @@ -0,0 +1,48 @@ +// ==UserScript== +// @id iitc-plugin-nokia-ovi-maps +// @name IITC plugin: Nokia OVI maps +// @category Map Tiles +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Add various map layers from Nokia OVI Maps +// @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== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + +window.plugin.mapNokiaOvi = function() {}; + +window.plugin.mapNokiaOvi.setup = function() { + //the list of styles you'd like to see + var oviStyles = { + 'normal.day': "Normal", + 'normal.day.grey': "Normal (grey)", + 'normal.day.transit': "Normal (transit)", + 'satellite.day': "Satellite", + 'terrain.day': "Terrain", + }; + + + var oviOpt = {attribution: 'Imagery © Nokia OVI', maxZoom: 20}; + + $.each(oviStyles, function(key,value) { + oviOpt['style'] = key; + var oviMap = new L.TileLayer('http://maptile.maps.svc.ovi.com/maptiler/maptile/newest/{style}/{z}/{x}/{y}/256/png8', oviOpt); + layerChooser.addBaseLayer(oviMap, 'Nokia OVI '+value); + }); + +}; + +var setup = window.plugin.mapNokiaOvi.setup; + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@ From 6b5571b18ae42f0abc0ca548615387d5a66668ab Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 7 Nov 2013 03:51:20 +0000 Subject: [PATCH 37/72] artifact display: initial checkin display artifacts (jarvis shards, jarvis targets) on the map TODO: add details to the portal info display --- code/artifact.js | 185 +++++++++++++++++++++++++++++++++++++++++++++++ code/boot.js | 1 + style.css | 7 ++ 3 files changed, 193 insertions(+) create mode 100644 code/artifact.js diff --git a/code/artifact.js b/code/artifact.js new file mode 100644 index 00000000..ec180db0 --- /dev/null +++ b/code/artifact.js @@ -0,0 +1,185 @@ +// ARTIFACT /////////////////////////////////////////////////////// + +// added as part of the ingress #13magnus in november 2013, artifacts +// are additional game elements overlayed on the intel map +// currently there are only jarvis-related entities +// - shards: move between portals (along links) each hour. more than one can be at a portal +// - targets: specific portals - one per team +// the artifact data includes details for the specific portals, so can be useful + + +window.artifact = function() {} + +window.artifact.setup = function() { + artifact.REFRESH_SUCCESS = 15*60; // 15 minutes on success + artifact.REFRESH_FAILURE = 2*60; // 2 minute retry on failure + + artifact.idle = false; + artifact.clearData(); + + addResumeFunction(artifact.idleResume); + + artifact.requestData(); + + artifact._layer = new L.LayerGroup(); + addLayerGroup ('Artifacts (Jarvis shards)', artifact._layer); +} + +window.artifact.requestData = function() { + if (isIdle()) { + artifact.idle = true; + } else { + window.postAjax('getArtifactInfo', {}, artifact.handleSuccess, artifact.handleError); + } +} + +window.artifact.idleResume = function() { + if (artifact.idle) { + artifact.idle = false; + artifact.requestData(); + } +} + +window.artifact.handleSuccess = function(data) { + artifact.processData (data); + + setTimeout (artifact.requestData, artifact.REFRESH_SUCCESS*1000); +} + +window.artifact.handleFailure = function(data) { + // no useful data on failure - do nothing + + setTimeout (artifact.requestData, artifact.REFRESH_FAILURE*1000); +} + + +window.artifact.processData = function(data) { + + if (!data.artifacts) { + console.warn('Failed to find artifacts in artifact response'); + return; + } + + artifact.clearData(); + + $.each (data.artifacts, function(i,artData) { + if (artData.artifactId != 'jarvis') { + // jarvis artifacts - fragmentInfos and targetInfos + // (future types? completely unknown at this time!) + console.warn('Note: unknown artifactId '+artData.artifactId+' - guessing how to handle it'); + } + + if (artData.fragmentInfos) { + artifact.processFragmentInfos (artData.artifactId, artData.fragmentInfos); + } + + if (artData.targetInfos) { + artifact.processTargetInfos (artData.artifactId, artData.targetInfos); + } + + // other data in future? completely unknown! + }); + + + // redraw the artifact layer + artifact.updateLayer(); + +} + + +window.artifact.clearData = function() { + + artifact.portalInfo = {}; +} + +window.artifact.processFragmentInfos = function (id, fragments) { + $.each(fragments, function(i, fragment) { + if (!artifact.portalInfo[fragment.portalGuid]) { + artifact.portalInfo[fragment.portalGuid] = { _entityData: fragment.portalInfo }; + } + + if (!artifact.portalInfo[fragment.portalGuid][id]) artifact.portalInfo[fragment.portalGuid][id] = {}; + + if (!artifact.portalInfo[fragment.portalGuid][id].fragments) artifact.portalInfo[fragment.portalGuid][id].fragments = []; + + $.each(fragment.fragments, function(i,f) { + artifact.portalInfo[fragment.portalGuid][id].fragments.push(f); + }); + + }); +} + +window.artifact.processTargetInfos = function (id, targets) { + $.each(targets, function(i, target) { + if (!artifact.portalInfo[target.portalGuid]) { + artifact.portalInfo[target.portalGuid] = { _entityData: target.portalInfo }; + } + + if (!artifact.portalInfo[target.portalGuid][id]) artifact.portalInfo[target.portalGuid][id] = {}; + + artifact.portalInfo[target.portalGuid][id].target = target.team === 'RESISTANCE' ? TEAM_RES : TEAM_ENL; + }); +} + + +// used to render portals that would otherwise be below the visible level +window.artifact.getArtifactEntities = function() { + var entities = []; + + // create fake entities from the artifact data + $.each (artifact.portalInfo, function(guid,data) { + var timestamp = 0; // we don't have a valid timestamp - so let's use 0 + var ent = [ guid, timestamp, data._entityData ]; + entities.push(ent); + }); + + return entities; +} + + +window.artifact.updateLayer = function() { + artifact._layer.clearLayers(); + +// TODO: icons +// //commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard.png +// //commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard_target_0.png +// (replace '0' with count of shards at the target portal) + + + $.each(artifact.portalInfo, function(guid,data) { + var latlng = L.latLng ([data._entityData.locationE6.latE6/1E6, data._entityData.locationE6.lngE6/1E6]); + + // jarvis shard icon + var iconUrl = undefined; + var iconSize = 0; + + if (data.jarvis.fragments) { + iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard.png'; + iconSize = 60/2; // 60 pixels - half that size works better + } + if (data.jarvis.target) { + // target portal - show the target marker. use the count of fragments at the target to pick the right icon - it has segments that fill up + + var count = data.jarvis.fragments ? data.jarvis.fragments.length : 0; + + iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard_target_'+count+'.png'; + iconSize = 100/2; // 100 pixels - half that size works better + } + + if (iconUrl) { + var icon = L.icon({ + iconUrl: iconUrl, + iconSize: [iconSize,iconSize], + iconAnchor: [iconSize/2,iconSize/2], + className: 'no-pointer-events' // the clickable: false below still blocks events going through to the svg underneath + }); + + var marker = L.marker (latlng, {icon: icon, clickable: false, keyboard: false}); + + artifact._layer.addLayer(marker); + } else { + console.warn('Oops! no URL for artifact portal icon?!'); + } + }); + +} diff --git a/code/boot.js b/code/boot.js index 220e1531..7d39eceb 100644 --- a/code/boot.js +++ b/code/boot.js @@ -525,6 +525,7 @@ function boot() { window.setupLargeImagePreview(); window.setupSidebarToggle(); window.updateGameScore(); + window.artifact.setup(); window.setupPlayerStat(); window.setupTooltips(); window.chat.setup(); diff --git a/style.css b/style.css index 3886aa79..9ec21114 100644 --- a/style.css +++ b/style.css @@ -1015,3 +1015,10 @@ td + td { transform: none; } + + +/* misc */ + +.no-pointer-events { + pointer-events: none; +} From 278a8e7536040bea7a2122c05e0cf3df35b39142 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 7 Nov 2013 04:25:44 +0000 Subject: [PATCH 38/72] missed from previous artifact commit - render artifact portals quickly from the available data --- code/map_data_request.js | 1 + 1 file changed, 1 insertion(+) diff --git a/code/map_data_request.js b/code/map_data_request.js index ae53421e..ecf31368 100644 --- a/code/map_data_request.js +++ b/code/map_data_request.js @@ -213,6 +213,7 @@ window.MapDataRequest.prototype.refresh = function() { this.render.updateEntityVisibility(); + this.render.processGameEntities(artifact.getArtifactEntities()); console.log('requesting data tiles at zoom '+zoom+' (L'+minPortalLevel+'+ portals), map zoom is '+map.getZoom()); From 73fc584571e9b5a82dad05d21111d25ec13fee5f Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 7 Nov 2013 04:44:41 +0000 Subject: [PATCH 39/72] tweaks to iitc-specific leaflet popup style - restore close button - pointer events only hit the main box, passing through the 'tip' area - this makes it easy to select differetn players after a marker spider --- style.css | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/style.css b/style.css index 9ec21114..a04b3086 100644 --- a/style.css +++ b/style.css @@ -985,11 +985,16 @@ td + td { /* leaflet popups - restyle to match the theme of IITC */ +#map .leaflet-popup { + pointer-events: none; +} + #map .leaflet-popup-content-wrapper { border-radius: 0px; -webkit-border-radius: 0px; border: 1px solid #20A8B1; background: #0e3d4e; + pointer-events: auto; } #map .leaflet-popup-content { @@ -998,9 +1003,15 @@ td + td { } #map .leaflet-popup-close-button { - display: none; + padding: 2px 1px 0 0; + font-size: 12px; + line-height: 8px; + width: 10px; + height: 10px; + pointer-events: auto; } + #map .leaflet-popup-tip { /* change the tip from an arrow to a simple line */ background: #20A8B1; @@ -1013,7 +1024,6 @@ td + td { -ms-transform: none; -o-transform: none; transform: none; - } From 9c4b3985ccddc81e731574e76e88c6c4131d09c4 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 7 Nov 2013 05:01:05 +0000 Subject: [PATCH 40/72] artifact layer defaults to on now --- code/artifact.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/artifact.js b/code/artifact.js index ec180db0..88b899b7 100644 --- a/code/artifact.js +++ b/code/artifact.js @@ -22,7 +22,7 @@ window.artifact.setup = function() { artifact.requestData(); artifact._layer = new L.LayerGroup(); - addLayerGroup ('Artifacts (Jarvis shards)', artifact._layer); + addLayerGroup ('Artifacts (Jarvis shards)', artifact._layer, true); } window.artifact.requestData = function() { From 52a5b231ed25c2dde29a1771e8762b3c2ffb7c3b Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Fri, 8 Nov 2013 00:36:15 +0000 Subject: [PATCH 41/72] new munge set for 2013-11-07 --- code/utils_misc.js | 52 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index 2a9643bb..d04dda75 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -214,6 +214,49 @@ window.requestParameterMunges = [ inviteeEmailAddress: 'thpbnoyjx0antwm5', }, + // set 8 - 2013-11-07 + { + 'dashboard.getArtifactInfo': 'artifacts', // GET_ARTIFACT_INFO: new (and not obfsucated?!) + 'dashboard.getGameScore': 'lls4clhel87apzpa', // GET_GAME_SCORE + 'dashboard.getPaginatedPlextsV2': 'r6n2xgcd8wjsm4og', // GET_PAGINATED_PLEXTS + 'dashboard.getThinnedEntitiesV4': '1ybigzcf2sifu34b', // GET_THINNED_ENTITIES + 'dashboard.getPlayersByGuids': 'uig0xeb6trclqd2l', // LOOKUP_PLAYERS + 'dashboard.redeemReward': '7dd7x64cc2lbutoq', // REDEEM_REWARD + 'dashboard.sendInviteEmail': 'd8p6dvwilsr460u3', // SEND_INVITE_EMAIL + 'dashboard.sendPlext': 'repg2orpg7htkoto', // SEND_PLEXT + + // common parameters + method: '97aes4vnlvyhoxik', + version: 'an8mglz21qabq3wq', //guessed parameter name - only seen munged + version_parameter: 'b92c9d055fcdf715887b173c706e7a2c267e32c5', // passed as the value to the above parameter + + // GET_THINNED_ENTITIES + quadKeys: 'mhjknavysslwfhk6', //guessed parameter name - only seen munged + + // GET_PAGINATED_PLEXTS + desiredNumItems: 'l61g8u397alq3j1x', + minLatE6: 'wwsvpboc5bxd1s9q', + minLngE6: '48l4x7ngfsz47z3u', + maxLatE6: 'p3m1qg81uqldizu6', + maxLngE6: 'h4kv1eef878vfyk3', + minTimestampMs: 'uj1vcy9ufws24v2c', + maxTimestampMs: '8pt1x5nd9hk5vakv', + chatTab: 'zy1yc1rfczashshu', //guessed parameter name - only seen munged + ascendingTimestampOrder: 'duyuskmky68nl2ci', + + // SEND_PLEXT + message: 'xktwjguq0nohzioa', + latE6: 'm4crflfaibmg9mdf', + lngE6: 'h6jfungrw5ii830r', +// chatTab: 'zy1yc1rfczashshu', //guessed parameter name - only seen munged + + // LOOKUP_PLAYERS + guids: '3u9h9cpfh2yiy4fk', + + // SEND_INVITE_EMAIL + inviteeEmailAddress: 'jpg3y4ax7t0w356j', + }, + ]; window.activeRequestMungeSet = undefined; @@ -224,11 +267,16 @@ window.detectActiveMungeSet = function() { // FIXME? revert to searching through all the code? is that practical? var stockFunc; try { - stockFunc = nemesis.dashboard.network.XhrController.prototype.sendRequest.toString(); + stockFunc = nemesis.dashboard.network.XhrController.prototype.doSendRequest_.toString(); } catch(e) { try { - stockFunc = nemesis.dashboard.network.DataFetcher.prototype.sendRequest_.toString(); + stockFunc = nemesis.dashboard.network.XhrController.prototype.sendRequest.toString(); } catch(e) { + try { + stockFunc = nemesis.dashboard.network.DataFetcher.prototype.sendRequest_.toString(); + } catch(e) { + console.warn('Failed to find a relevant function in the stock site'); + } } } From e99cceff0258275d2853e402c68224d766a073a6 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Fri, 8 Nov 2013 02:28:58 +0000 Subject: [PATCH 42/72] website: update for 0.14.6, mobile 0.7.7.2 --- website/page/home.php | 5 +++++ website/page/news.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/website/page/home.php b/website/page/home.php index 02ae9641..94dd5b6a 100644 --- a/website/page/home.php +++ b/website/page/home.php @@ -13,6 +13,11 @@ offers many more features. It is available for

    Latest news

    +

    7th November 2013

    +

    +IITC 0.14.6 and IITC Mobile 0.7.7.2 released. Another change needed to match a minor update to the standard intel site. +

    +

    6th November 2013

    IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates. diff --git a/website/page/news.php b/website/page/news.php index 0edb63e3..017a1cbe 100644 --- a/website/page/news.php +++ b/website/page/news.php @@ -1,5 +1,10 @@

    News

    +

    7th November 2013

    +

    +IITC 0.14.6 and IITC Mobile 0.7.7.2 released. Another change needed to match a minor update to the standard intel site. +

    +

    6th November 2013

    IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates. From 15537e4e95a7f0aab5405dc1ba1e06cb905b08dc Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Fri, 8 Nov 2013 02:30:24 +0000 Subject: [PATCH 43/72] website: the stock site javascript monitor script now sets a flag file that indicates things have changed. use this to display a warning on the website that IITC might be broken --- website/index.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/website/index.php b/website/index.php index 2d01c87b..8ce5fbfd 100644 --- a/website/index.php +++ b/website/index.php @@ -68,6 +68,20 @@ if ( file_exists ( 'tracking.php' ) ) - a place to ask for help and discuss with other users.

    + + +
    + Note: A change has been detected to the standard intel website. Such changes usually break IITC. + The developers have been notified of the update, and will be looking to fix things as soon as possible. + See the IITC Community + for the latest details. +
    +