diff --git a/build.py b/build.py
index ed403b50..07a126bd 100755
--- a/build.py
+++ b/build.py
@@ -19,14 +19,24 @@ try:
except ImportError:
pass
+# load default build
+try:
+ from localbuildsettings import defaultBuild
+except ImportError:
+ defaultBuild = None
+
+
+buildName = defaultBuild
# build name from command line
-if len(sys.argv) != 2: # argv[0] = program, argv[1] = buildname, len=2
- print ("Usage: build.py buildname")
- print (" available build names:", ','.join(buildSettings.keys()))
- sys.exit(1)
+if len(sys.argv) == 2: # argv[0] = program, argv[1] = buildname, len=2
+ buildName = sys.argv[1]
-buildName = sys.argv[1]
+
+if buildName is None or not buildName in buildSettings:
+ print ("Usage: build.py buildname")
+ print (" available build names: %s" % ', '.join(buildSettings.keys()))
+ sys.exit(1)
settings = buildSettings[buildName]
diff --git a/buildsettings.py b/buildsettings.py
index 2edefe9f..0288ea2c 100644
--- a/buildsettings.py
+++ b/buildsettings.py
@@ -28,3 +28,8 @@ buildSettings = {
}
+
+
+# defaultBuild - the name of the default build to use if none is specified on the build.py command line
+# (in here as an example - it only works in localbuildsettings.py)
+#defaultBuild = 'local'
diff --git a/plugins/ap-list.css b/plugins/ap-list.css
new file mode 100644
index 00000000..1ccb441c
--- /dev/null
+++ b/plugins/ap-list.css
@@ -0,0 +1,86 @@
+
+#ap-list {
+ color: #ffce00;
+ font-size: 90%;
+ padding: 4px 2px;
+}
+
+#ap-list-side-labels {
+ display: inline-block;
+ width: 90%;
+}
+
+#ap-list-eny {
+ display: inline-block;
+ text-align: center;
+ width: 50%;
+ opacity: 1.0;
+}
+
+#ap-list-frd {
+ display: inline-block;
+ text-align: center;
+ width: 50%;
+ opacity: 0.5;
+}
+
+#ap-list-reload {
+ display: inline-block;
+ text-align: right;
+ width: 10%;
+}
+
+#ap-list-table {
+ width: 100%;
+ table-layout:fixed;
+}
+
+.ap-list-td-checkbox {
+ width: 5%;
+ height: 1px;
+}
+
+.ap-list-td-link {
+ overflow:hidden;
+ white-space:nowrap;
+}
+
+.ap-list-td-link-eny {
+ width: 80%;
+}
+
+.ap-list-td-link-frd {
+ width: 85%;
+}
+
+.ap-list-checkbox-outer {
+ display: table;
+ height: 100%;
+ width: 100%;
+}
+
+.ap-list-checkbox-mid {
+ display: table-cell;
+ vertical-align: middle;
+}
+
+.ap-list-checkbox-inner {
+ width: 10px;
+ height: 10px;
+ border: 1px solid rgb(32, 168, 177);
+ margin: 0 auto;
+}
+
+.ap-list-checkbox-selected {
+ background-color: rgb(32, 168, 177);
+}
+
+.ap-list-link {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.ap-list-link-selected {
+ font-style:italic;
+}
\ No newline at end of file
diff --git a/plugins/ap-list.user.js b/plugins/ap-list.user.js
index d9de91ec..7de36dee 100644
--- a/plugins/ap-list.user.js
+++ b/plugins/ap-list.user.js
@@ -1,7 +1,7 @@
// ==UserScript==
// @id iitc-plugin-ap-list@xelio
// @name IITC plugin: AP List
-// @version 0.4.1.@@DATETIMEVERSION@@
+// @version 0.4.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -40,6 +40,9 @@ window.plugin.apList.cacheActiveZoomLevel;
window.plugin.apList.destroyPortalsGuid = new Array();
+window.plugin.apList.portalLocationIndicator;
+window.plugin.apList.animTimeout;
+
window.plugin.apList.handleUpdate = function() {
if(!requests.isLastRequest('getThinnedEntitiesV2')) return;
@@ -51,18 +54,18 @@ window.plugin.apList.handleUpdate = function() {
window.plugin.apList.updatePortalTable = function(side) {
var displayEnemy = (plugin.apList.displaySide === window.plugin.apList.SIDE_ENEMY);
- var content = '
';
+ var content = '';
for(var i = 0; i < plugin.apList.topMaxCount; i++) {
var portal = plugin.apList.sortedPortals[side][i];
content += '';
// Only enemy portal list will display destroy checkbox
if(displayEnemy) {
- content += ''
+ content += ' | '
+ (portal ? plugin.apList.getPortalDestroyCheckbox(portal) : ' ')
+ ' | ';
}
- content += ''
+ content += ' | '
+ (portal ? plugin.apList.getPortalLink(portal) : ' ')
+ ' | '
+ ''
@@ -76,16 +79,15 @@ window.plugin.apList.updatePortalTable = function(side) {
window.plugin.apList.getPortalDestroyCheckbox = function(portal) {
// Change background color to border color if portal selected for destroy
- var style = 'width: 10px; height: 10px; border: 1px solid rgb(32, 168, 177); margin: 0 auto; '
- + (plugin.apList.destroyPortalIndex(portal.guid) >= 0
- ? 'background-color: rgb(32, 168, 177);'
- : '');
+ var checkboxClass = plugin.apList.destroyPortalIndex(portal.guid) >= 0
+ ? 'ap-list-checkbox-inner ap-list-checkbox-selected'
+ : 'ap-list-checkbox-inner';
var onClick = 'window.plugin.apList.destroyPortal(\'' + portal.guid + '\');';
// 3 div for centering checkbox horizontally and vertically,
// click event on outest div for people with not so good aiming
- var div = ''
- + ' '
- + ' '
+ var div = ' ';
return div;
@@ -144,24 +146,24 @@ window.plugin.apList.getPortalApTitle = function(portal) {
// hover: show address
window.plugin.apList.getPortalLink = function(portal) {
var latlng = [portal.locationE6.latE6/1E6, portal.locationE6.lngE6/1E6].join();
- var jsSingleClick = 'window.renderPortalDetails(\''+portal.guid+'\');return false';
+ var jsSingleClick = 'window.plugin.apList.selectPortal(\''+portal.guid+'\');return false';
var jsDoubleClick = 'window.zoomToAndShowPortal(\''+portal.guid+'\', ['+latlng+']);return false';
var perma = 'https://ingress.com/intel?latE6='+portal.locationE6.latE6
+'&lngE6='+portal.locationE6.lngE6+'&z=17&pguid='+portal.guid;
- var style = plugin.apList.destroyPortalIndex(portal.guid) >= 0
- ? 'font-style:italic'
- : '';
//Use Jquery to create the link, which escape characters in TITLE and ADDRESS of portal
var a = $(' ',{
"class": 'help',
- style: style,
text: portal.portalV2.descriptiveText.TITLE,
title: portal.portalV2.descriptiveText.ADDRESS,
href: perma,
onClick: jsSingleClick,
onDblClick: jsDoubleClick
})[0].outerHTML;
- var div = ''+a+' ';
+
+ var divClass = plugin.apList.destroyPortalIndex(portal.guid) >= 0
+ ? 'ap-list-link ap-list-link-selected'
+ : 'ap-list-link';
+ var div = ''+a+' ';
return div;
}
@@ -406,24 +408,70 @@ window.plugin.apList.getAttackApGain = function(d) {
}
}
+window.plugin.apList.selectPortal = function(guid) {
+ renderPortalDetails(guid);
+ plugin.apList.setPortalLocationIndicator(guid);
+}
+
+window.plugin.apList.setPortalLocationIndicator = function(guid) {
+ var portal = window.portals[guid];
+ if(!portal) return;
+ var startRadius = screen.availWidth / 2;
+ var portalRadius = portal.options.radius;
+ var latlng = portal.getLatLng();
+ var property = {
+ radius: startRadius,
+ fill: false,
+ color: COLOR_SELECTED_PORTAL,
+ weight: 2,
+ opacity: 1,
+ portalRadius: portalRadius,
+ clickable: false };
+
+ if(plugin.apList.portalLocationIndicator)
+ map.removeLayer(plugin.apList.portalLocationIndicator);
+ if(plugin.apList.animTimeout)
+ clearTimeout(plugin.apList.animTimeout);
+ plugin.apList.portalLocationIndicator = L.circleMarker(latlng, property).addTo(map);
+ plugin.apList.animTimeout = setTimeout(plugin.apList.animPortalLocationIndicator,100);
+}
+
+window.plugin.apList.animPortalLocationIndicator = function() {
+ var radius = plugin.apList.portalLocationIndicator.options.radius;
+ var portalRadius = plugin.apList.portalLocationIndicator.options.portalRadius
+ if(radius > portalRadius) {
+ var step = radius / 3;
+ if(radius < 80) step = step / 3;
+ var newRadius = plugin.apList.portalLocationIndicator.options.radius -= step;
+ plugin.apList.portalLocationIndicator.setRadius(newRadius);
+ if(plugin.apList.animTimeout)
+ clearTimeout(plugin.apList.animTimeout);
+ plugin.apList.animTimeout = setTimeout(plugin.apList.animPortalLocationIndicator,100);
+ } else {
+ map.removeLayer(plugin.apList.portalLocationIndicator);
+ }
+}
+
// Change display table to friendly portals
window.plugin.apList.displayFriendly = function() {
- plugin.apList.displaySide = plugin.apList.SIDE_FRIENDLY;
- plugin.apList.changeDisplaySide(plugin.apList.displaySide);
+ plugin.apList.changeDisplaySide(plugin.apList.SIDE_FRIENDLY);
}
// Change display table to enemy portals
window.plugin.apList.displayEnemy = function() {
- plugin.apList.displaySide = plugin.apList.SIDE_ENEMY;
- plugin.apList.changeDisplaySide(plugin.apList.displaySide);
+ plugin.apList.changeDisplaySide(plugin.apList.SIDE_ENEMY);
}
window.plugin.apList.changeDisplaySide = function(side) {
- plugin.apList.updatePortalTable(side);
- plugin.apList.toggleSideLabel(side);
-
- var scrollTo = $("#ap-list").position().top + $("#ap-list").outerHeight()
- - $("#sidebar").height() + $("#sidebar").scrollTop()
+ var isChange = (plugin.apList.displaySide !== side);
+ var scrollTo = 0;
+ if(isChange) {
+ plugin.apList.displaySide = side;
+ plugin.apList.updatePortalTable(side);
+ plugin.apList.toggleSideLabel(side);
+ scrollTo = $("#ap-list").position().top + $("#ap-list").outerHeight()
+ - $("#sidebar").height() + $("#sidebar").scrollTop();
+ }
$('#sidebar').scrollTop(scrollTo);
}
@@ -456,17 +504,24 @@ window.plugin.apList.setupVar = function() {
= "#ap-list-eny";
}
+window.plugin.apList.setupCSS = function() {
+ $(" |