From 7d8c4a9794d395b05c9ec32af6b68528bd8d0b12 Mon Sep 17 00:00:00 2001 From: Dunstkreis Date: Sun, 2 Feb 2014 11:18:11 +0100 Subject: [PATCH 1/4] Update leaflet.draw.css fixed line break between save/cancel for delete layers --- external/leaflet.draw.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/leaflet.draw.css b/external/leaflet.draw.css index 900608fd..31e59c89 100644 --- a/external/leaflet.draw.css +++ b/external/leaflet.draw.css @@ -50,6 +50,7 @@ position: absolute; left: 26px; /* leaflet-draw-toolbar.left + leaflet-draw-toolbar.width */ top: 0; + white-space: nowrap; } .leaflet-right .leaflet-draw-actions { @@ -98,7 +99,6 @@ .leaflet-draw-actions-top { margin-top: 1px; - white-space: nowrap; } .leaflet-draw-actions-top a, From 019e044b921d4358582336d6c9ca169c21375ce2 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 6 Feb 2014 22:24:25 +0000 Subject: [PATCH 2/4] add artifact support for likely new 'amar artifacts'. seems to be the same system as the jarvis shards, but different display names, and URLs for resources --- code/artifact.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/code/artifact.js b/code/artifact.js index d52abc72..d2926598 100644 --- a/code/artifact.js +++ b/code/artifact.js @@ -6,6 +6,7 @@ // - 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 +// 2014-02-06: intel site updates hint at new 'amar artifacts', likely following the same system as above window.artifact = function() {} @@ -179,6 +180,7 @@ window.artifact.updateLayer = function() { var iconSize = 0; var opacity = 1.0; + // redundant as of 2014-02-05 - jarvis shards removed if (data.jarvis) { 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 @@ -193,6 +195,22 @@ window.artifact.updateLayer = function() { opacity = 0.6; // these often hide portals - let's make them semi transparent } + } + // 2014-02-06: a guess at whats needed for the new artifacts + if (data.amar) { + if (data.amar.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.amar.fragments ? data.amar.fragments.length : 0; + + iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/amar_shard_target_'+count+'.png'; + iconSize = 100/2; // 100 pixels - half that size works better + } else if (data.amar.fragments) { + iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/amar_shard.png'; + iconSize = 60/2; // 60 pixels - half that size works better + opacity = 0.6; // these often hide portals - let's make them semi transparent + } + } if (iconUrl) { @@ -217,11 +235,16 @@ window.artifact.updateLayer = function() { window.artifact.showArtifactList = function() { - var html = '
Artifact portals
'; + var html = ''; - var types = { 'jarvis': 'Jarvis Shards' }; + var typeNames = { 'jarvis': 'Jarvis Shards', 'amar': 'Amar Artifacts' }; - $.each(types, function(type, name) { + if (Object.keys(artifact.artifactTypes).length == 0) { + html += 'No artifacts at this time'; + } + + $.each(artifact.artifactTypes, function(type,type2) { + var name = typeNames[type] || ('New artifact type: '+type); html += '
'+types[type]+'
'; From b127059895cd07ffb70f3b9f75ae9d590c9be8fa Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 12 Feb 2014 22:30:36 +0000 Subject: [PATCH 3/4] remove references to jarvis shards. css class name changed --- code/artifact.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/artifact.js b/code/artifact.js index d2926598..736587bf 100644 --- a/code/artifact.js +++ b/code/artifact.js @@ -25,9 +25,9 @@ window.artifact.setup = function() { setTimeout (artifact.requestData, 1); artifact._layer = new L.LayerGroup(); - addLayerGroup ('Artifacts (Jarvis shards)', artifact._layer, true); + addLayerGroup ('Artifacts', artifact._layer, true); - $('#toolbox').append(' Artifacts'); + $('#toolbox').append(' Artifacts'); } @@ -246,9 +246,9 @@ window.artifact.showArtifactList = function() { $.each(artifact.artifactTypes, function(type,type2) { var name = typeNames[type] || ('New artifact type: '+type); - html += '
'+types[type]+'
'; + html += '
'+name+'
'; - html += ''; + html += '
'; html += ''; var tableRows = []; From 9563ebcd1c0757d46594753d8e22751047a8f930 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 12 Feb 2014 22:31:37 +0000 Subject: [PATCH 4/4] make artifact display on portal details more generic - might handle the new 'amar artifacts' now --- code/portal_detail_display.js | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index 3bb64e93..1258c992 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -202,21 +202,27 @@ window.getPortalMiscDetails = function(guid,d) { // artifact details - //niantic hard-code the fact it's just jarvis shards/targets - so until more examples exist, we'll do the same - //(at some future point we can iterate through all the artifact types and add rows as needed) - var jarvisArtifact = artifact.getPortalData (guid, 'jarvis'); - if (jarvisArtifact) { - // the genFourColumnTable function below doesn't handle cases where one column is null and the other isn't - so default to *something* in both columns - var target = ['',''], shards = ['shards','(none)']; - if (jarvisArtifact.target) { - target = ['target', ''+(jarvisArtifact.target==TEAM_RES?'Resistance':'Enlightened')+'']; - } - if (jarvisArtifact.fragments) { - shards = [jarvisArtifact.fragments.length>1?'shards':'shard', '#'+jarvisArtifact.fragments.join(', #')]; - } + // 2014-02-06: stock site changed from supporting 'jarvis shards' to 'amar artifacts'(?) - so let's see what we can do to be generic... + var artifactTypes = { + 'jarvis': { 'name': 'Jarvis', 'fragmentName': 'shard(s)' }, + 'amar': { 'name': 'Amar', 'fragmentName': 'artifact(s)' }, + }; - randDetailsData.push (target, shards); - } + $.each(artifactTypes,function(type,details) { + var artdata = artifact.getPortalData (guid, type); + if (artdata) { + // the genFourColumnTable function below doesn't handle cases where one column is null and the other isn't - so default to *something* in both columns + var target = ['',''], shards = [details.fragmentName,'(none)']; + if (artdata.target) { + target = ['target', ''+(artdata.target==TEAM_RES?'Resistance':'Enlightened')+'']; + } + if (artdata.fragments) { + shards = [details.fragmentName, '#'+artdata.fragments.join(', #')]; + } + + randDetailsData.push (target, shards); + } + }); randDetails = '
PortalDetails
' + genFourColumnTable(randDetailsData) + '
';