Merge branch 'master' into highlighter

This commit is contained in:
vita10gy
2013-04-16 23:07:03 -05:00
22 changed files with 8514 additions and 81 deletions

View File

@ -23,4 +23,7 @@ window.setupGeosearch = function() {
});
e.preventDefault();
});
$('#geosearchwrapper img').click(function(){
map.locate({setView : true});;
});
}

View File

@ -42,7 +42,7 @@
// array to change order or add additional values to the
// details of a portal.
// beforePortalReRender: the callback argument is
// {portal: ent[2], oldPortal : d, reRender : false}.
// {portal: ent[2], oldPortal : d, portalGuid: ent[0], reRender : false}.
// The callback needs to update the value of reRender to
// true if the plugin has a reason to have the portal
// redrawn. It is called early on in the

View File

@ -266,7 +266,7 @@ window.renderPortal = function(ent) {
u = u || oo.level !== portalLevel;
// Allow plugins to add additional conditions as to when a portal gets re-rendered
var hookData = {portal: ent[2], oldPortal: oo.details, reRender: false};
var hookData = {portal: ent[2], oldPortal: oo.details, portalGuid: ent[0], reRender: false};
runHooks('beforePortalReRender', hookData);
u = u || hookData.reRender;

View File

@ -58,7 +58,8 @@ window.renderPortalDetails = function(guid) {
$('#portaldetails')
.attr('class', TEAM_TO_CSS[getTeam(d)])
.html(''
+ '<h3 ondblclick="renderPortalDetails(null);">'+d.portalV2.descriptiveText.TITLE+'</h3>'
+ '<h3 class="title">'+d.portalV2.descriptiveText.TITLE+'</h3>'
+ '<span class="close" onclick="unselectOldPortal();" title="Close">X</span>'
// help cursor via “.imgpreview img”
+ '<div class="imgpreview" '+imgTitle+' style="background-image: url('+img+')">'
+ '<img class="hide" src="'+img+'"/>'
@ -67,10 +68,10 @@ window.renderPortalDetails = function(guid) {
+ '<div class="mods">'+getModDetails(d)+'</div>'
+ randDetails
+ resoDetails
+ '<div class="linkdetails"><aside><a href="'+perma+'" onclick="return androidCopy(this.href)" >portal link</a></aside>'
+ '<aside><a onclick="'+poslinks+'">poslinks</a></aside>'
+ '<aside><a onclick="alert(\''+postcard+'\');">donate</a></aside>'
+ '<aside><a onclick="window.reportPortalIssue()">report issue</a></aside>'
+ '<div class="linkdetails">'
+ '<aside><a href="'+perma+'" onclick="return androidCopy(this.href)" title="Create a URL link to this portal" >Portal link</a></aside>'
+ '<aside><a onclick="'+poslinks+'" title="Link to alternative maps (Google, etc)">Map links</a></aside>'
+ '<aside><a onclick="window.reportPortalIssue()" title="Report issues with this portal to Niantic/Google">Report issue</a></aside>'
+ '</div>'
);

View File

@ -1,5 +1,4 @@
// REDEEMING /////////////////////////////////////////////////////////
window.handleRedeemResponse = function(data, textStatus, jqXHR) {
@ -27,6 +26,7 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
var resonators = {};
var bursts = {};
var shields = {};
var cubes = {};
for(var i in data.result.inventoryAward) {
var acquired = data.result.inventoryAward[i][2];
@ -45,6 +45,10 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
var level = acquired.resourceWithLevels.level
if(!bursts[level]) bursts[level] = 0;
bursts[level] += 1;
} else if(acquired.resourceWithLevels.resourceType === 'POWER_CUBE') {
var level = acquired.resourceWithLevels.level
if(!cubes[level]) cubes[level] = 0;
cubes[level] += 1;
}
}
}
@ -59,12 +63,16 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
if(count >= 2) text += ' ('+count+')';
tblResult.append($('<tr ><td style="color: ' +window.COLORS_LVL[lvl]+ ';">L' +lvl+ '</td><td>' + text + '</td></tr>'));
});
$.each(cubes, function(lvl, count) {
var text = 'Power Cube';
if(count >= 2) text += ' ('+count+')';
tblResult.append($('<tr ><td style="color: ' +window.COLORS_LVL[lvl]+ ';">L' +lvl+ '</td><td>' + text + '</td></tr>'));
});
$.each(shields, function(lvl, count) {
var text = 'Portal Shield';
if(count >= 2) text += ' ('+count+')';
tblResult.append($('<tr><td>'+lvl+'</td><td>'+text+'</td></tr>'));
});
alert(tblResult, true);
}
}

View File

@ -136,8 +136,8 @@ window.showPortalPosLinks = function(lat, lng, name) {
} else {
var qrcode = '<div id="qrcode"></div>';
var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>';
var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+portal_name+'">gmaps</a>';
var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OSM</a>';
var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+portal_name+'">Google maps</a>';
var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OpenStreetMap</a>';
var latLng = '<span>'+lat+','+lng +'</span>';
alert('<div style="text-align: center;">' + qrcode + script + gmaps + ' ' + osm + '<br />' + latLng + '</div>');
}