diff --git a/code/artifact.js b/code/artifact.js index d52abc72..736587bf 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() {} @@ -24,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'); } @@ -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,15 +235,20 @@ 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'; + } - html += '
'+types[type]+'
'; + $.each(artifact.artifactTypes, function(type,type2) { + var name = typeNames[type] || ('New artifact type: '+type); - html += ''; + html += '
'+name+'
'; + + html += '
'; html += ''; var tableRows = []; 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) + '
'; 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,