Merge branch 'master' of github.com:jonatkins/ingress-intel-total-conversion
This commit is contained in:
		@@ -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(' <a onclick="window.artifact.showArtifactList()" title="Show artifact portal list (jarvis shards and targets)">Artifacts</a>');
 | 
			
		||||
  $('#toolbox').append(' <a onclick="window.artifact.showArtifactList()" title="Show artifact portal list">Artifacts</a>');
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -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 = '<div><b>Artifact portals</b></div>';
 | 
			
		||||
  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 += '<i>No artifacts at this time</i>';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    html += '<hr><div><b>'+types[type]+'</b></div>';
 | 
			
		||||
  $.each(artifact.artifactTypes, function(type,type2) {
 | 
			
		||||
    var name = typeNames[type] || ('New artifact type: '+type);
 | 
			
		||||
 | 
			
		||||
    html += '<table class="artifact '+type+'">';
 | 
			
		||||
    html += '<hr><div><b>'+name+'</b></div>';
 | 
			
		||||
 | 
			
		||||
    html += '<table class="artifact artifact-'+type+'">';
 | 
			
		||||
    html += '<tr><th>Portal</th><th>Details</th></tr>';
 | 
			
		||||
 | 
			
		||||
    var tableRows = [];
 | 
			
		||||
 
 | 
			
		||||
@@ -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', '<span class="'+TEAM_TO_CSS[jarvisArtifact.target]+'">'+(jarvisArtifact.target==TEAM_RES?'Resistance':'Enlightened')+'</span>'];
 | 
			
		||||
      }
 | 
			
		||||
      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', '<span class="'+TEAM_TO_CSS[artdata.target]+'">'+(artdata.target==TEAM_RES?'Resistance':'Enlightened')+'</span>'];
 | 
			
		||||
        }
 | 
			
		||||
        if (artdata.fragments) {
 | 
			
		||||
          shards = [details.fragmentName, '#'+artdata.fragments.join(', #')];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        randDetailsData.push (target, shards);
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    randDetails = '<table id="randdetails">' + genFourColumnTable(randDetailsData) + '</table>';
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								external/leaflet.draw.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								external/leaflet.draw.css
									
									
									
									
										vendored
									
									
								
							@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user