diff --git a/code/artifact.js b/code/artifact.js index b1ef4e03..8d61552b 100644 --- a/code/artifact.js +++ b/code/artifact.js @@ -156,21 +156,6 @@ window.artifact.getPortalData = function(guid,artifactId) { return artifact.portalInfo[guid] && artifact.portalInfo[guid][artifactId]; } -// get the target(s) at a specified portal. returns 'false'y if the portal isn't a target -window.artifact.getPortalTarget = function(guid) { - targets = {}; - if (artifact.portalInfo[guid]) { - for (var type in artifact.artifactTypes) { - if (artifact.portalInfo[guid][type].target !== undefined) { - targets[type] = artifact.portalInfo[guid][type].target; - } - } - } - - return Object.keys(targets).length == 0 ? null : targets; - -} - window.artifact.updateLayer = function() { artifact._layer.clearLayers(); @@ -237,7 +222,7 @@ window.artifact.showArtifactList = function() { $.each(artifact.artifactTypes, function(type,type2) { // no nice way to convert the Niantic internal name into the correct display name // (we do get the description string once a portal with that shard type is selected - could cache that somewhere?) - var name = type.substr(0,1).toUpperCase() + type.substr(1) + ' shards'; + var name = type.capitalize() + ' shards'; if (!first) html += '
'; first = false; diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index b72012e0..dc4793df 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -190,11 +190,10 @@ window.getPortalMiscDetails = function(guid,d) { // artifacts - tacked on after (but not as part of) the 'randdetails' table // instead of using the existing columns.... - // fill in target status from the artifact code - var targets = artifact.getPortalTarget(guid); - if (targets) { + if (d.artifactBrief && d.artifactBrief.target && Object.keys(d.artifactBrief.target).length > 0) { + var targets = Object.keys(d.artifactBrief.target); //currently (2015-07-10) we no longer know the team each target portal is for - so we'll just show the artifact type(s) - randDetails += '
Target portal: '+Object.keys(targets).map(function(x) { return x.substr(0,1).toUpperCase()+x.substr(1); }).join(', ')+'
'; + randDetails += '
Target portal: '+targets.map(function(x) { return x.capitalize(); }).join(', ')+'
'; } // shards - taken directly from the portal details