Merge branch 'upstream' into redeem_dlg
Conflicts: code/redeeming.js
This commit is contained in:
@ -81,7 +81,7 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
||||
var ppp = [];
|
||||
var p2f = {};
|
||||
$.each(m, function(qk, val) {
|
||||
$.each(val.deletedGameEntityGuids, function(ind, guid) {
|
||||
$.each(val.deletedGameEntityGuids || [], function(ind, guid) {
|
||||
if(getTypeByGuid(guid) === TYPE_FIELD && window.fields[guid] !== undefined) {
|
||||
$.each(window.fields[guid].options.vertices, function(ind, vertex) {
|
||||
if(window.portals[vertex.guid] === undefined) return true;
|
||||
@ -92,7 +92,7 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
||||
window.removeByGuid(guid);
|
||||
});
|
||||
|
||||
$.each(val.gameEntities, function(ind, ent) {
|
||||
$.each(val.gameEntities || [], function(ind, ent) {
|
||||
// ent = [GUID, id(?), details]
|
||||
// format for links: { controllingTeam, creator, edge }
|
||||
// format for portals: { controllingTeam, turret }
|
||||
@ -453,6 +453,7 @@ window.isResonatorsShow = function() {
|
||||
|
||||
window.isSameResonator = function(oldRes, newRes) {
|
||||
if(!oldRes && !newRes) return true;
|
||||
if(!oldRes || !newRes) return false;
|
||||
if(typeof oldRes !== typeof newRes) return false;
|
||||
if(oldRes.level !== newRes.level) return false;
|
||||
if(oldRes.energyTotal !== newRes.energyTotal) return false;
|
||||
|
@ -14,7 +14,7 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
|
||||
} else {
|
||||
error = 'There was a problem redeeming the passcode. Try again?';
|
||||
}
|
||||
alert('<strong>' + data.error + "</strong>\n" + error);
|
||||
alert('<strong>' + data.error + '</strong>\n' + error);
|
||||
} else if (data.result) {
|
||||
var tblResult = $('<table class="redeem-result" />');
|
||||
tblResult.append($('<tr><th colspan="2">Passcode accepted!</th></tr>'));
|
||||
@ -84,13 +84,13 @@ window.setupRedeem = function() {
|
||||
var extra = '';
|
||||
if (response && response.status) {
|
||||
if (response.status === 429) {
|
||||
extra = "You have been rate-limited by the server. Wait a bit and try again.";
|
||||
extra = 'You have been rate-limited by the server. Wait a bit and try again.';
|
||||
} else {
|
||||
extra = "The server indicated an error.";
|
||||
extra = 'The server indicated an error.';
|
||||
}
|
||||
extra += "\n" + 'Response: HTTP <a href="http://httpstatus.es/' + jq.status + '" alt="HTTP ' + jq.status + '"target="_blank">' + jq.status + "</a>.";
|
||||
extra += '\nResponse: HTTP <a href="http://httpstatus.es/' + response.status + '" alt="HTTP ' + response.status + '">' + response.status + '</a>.';
|
||||
} else {
|
||||
extra = "No status code was returned.";
|
||||
extra = 'No status code was returned.';
|
||||
}
|
||||
alert('<strong>The HTTP request failed.</strong> ' + extra);
|
||||
});
|
||||
|
Reference in New Issue
Block a user