Merge branch 'gh-pages' of github.com:breunigs/ingress-intel-total-conversion into gh-pages
This commit is contained in:
commit
3936410f56
@ -46,14 +46,15 @@
|
|||||||
// checkRenderLimit: callback is passed the argument of
|
// checkRenderLimit: callback is passed the argument of
|
||||||
// {reached : false} to indicate that the renderlimit is reached
|
// {reached : false} to indicate that the renderlimit is reached
|
||||||
// set reached to true.
|
// set reached to true.
|
||||||
|
// requestFinished: called after each request finished. Argument is
|
||||||
|
// {success: boolean} indicated the request success or fail.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
window._hooks = {}
|
window._hooks = {}
|
||||||
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
|
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
|
||||||
'publicChatDataAvailable', 'portalDataLoaded', 'beforePortalReRender',
|
'publicChatDataAvailable', 'portalDataLoaded', 'beforePortalReRender',
|
||||||
'checkRenderLimit'];
|
'checkRenderLimit', 'requestFinished'];
|
||||||
|
|
||||||
window.runHooks = function(event, data) {
|
window.runHooks = function(event, data) {
|
||||||
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);
|
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);
|
||||||
|
@ -59,6 +59,7 @@ window.handleFailedRequest = function() {
|
|||||||
var leftOverPortals = portalRenderLimit.mergeLowLevelPortals(null);
|
var leftOverPortals = portalRenderLimit.mergeLowLevelPortals(null);
|
||||||
handlePortalsRender(leftOverPortals);
|
handlePortalsRender(leftOverPortals);
|
||||||
}
|
}
|
||||||
|
runHooks('requestFinished', {success: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
// works on map data response and ensures entities are drawn/updated.
|
// works on map data response and ensures entities are drawn/updated.
|
||||||
@ -139,6 +140,7 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
|||||||
|
|
||||||
resolvePlayerNames();
|
resolvePlayerNames();
|
||||||
renderUpdateStatus();
|
renderUpdateStatus();
|
||||||
|
runHooks('requestFinished', {success: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.handlePortalsRender = function(portals) {
|
window.handlePortalsRender = function(portals) {
|
||||||
@ -451,6 +453,7 @@ window.isResonatorsShow = function() {
|
|||||||
|
|
||||||
window.isSameResonator = function(oldRes, newRes) {
|
window.isSameResonator = function(oldRes, newRes) {
|
||||||
if(!oldRes && !newRes) return true;
|
if(!oldRes && !newRes) return true;
|
||||||
|
if(!oldRes || !newRes) return false;
|
||||||
if(typeof oldRes !== typeof newRes) return false;
|
if(typeof oldRes !== typeof newRes) return false;
|
||||||
if(oldRes.level !== newRes.level) return false;
|
if(oldRes.level !== newRes.level) return false;
|
||||||
if(oldRes.energyTotal !== newRes.energyTotal) return false;
|
if(oldRes.energyTotal !== newRes.energyTotal) return false;
|
||||||
|
@ -12,12 +12,12 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
|
|||||||
} else if (data.error === 'INVALID_PASSCODE') {
|
} else if (data.error === 'INVALID_PASSCODE') {
|
||||||
error = 'This passcode is invalid.';
|
error = 'This passcode is invalid.';
|
||||||
} else {
|
} else {
|
||||||
error = 'The passcode cannot be redeemed.';
|
error = 'There was a problem redeeming the passcode. Try again?';
|
||||||
}
|
}
|
||||||
alert("Error: " + data.error + "\n" + error);
|
alert('<strong>' + data.error + "</strong>\n" + error);
|
||||||
} else if (data.result) {
|
} else if (data.result) {
|
||||||
var res_level = 0, res_count = 0;
|
|
||||||
var xmp_level = 0, xmp_count = 0;
|
var xmp_level = 0, xmp_count = 0;
|
||||||
|
var res_level = 0, res_count = 0;
|
||||||
var shield_rarity = '', shield_count = 0;
|
var shield_rarity = '', shield_count = 0;
|
||||||
|
|
||||||
// This assumes that each passcode gives only one type of resonator/XMP/shield.
|
// This assumes that each passcode gives only one type of resonator/XMP/shield.
|
||||||
@ -30,17 +30,17 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
|
|||||||
shield_count++;
|
shield_count++;
|
||||||
}
|
}
|
||||||
} else if (acquired.resourceWithLevels) {
|
} else if (acquired.resourceWithLevels) {
|
||||||
if (acquired.resourceWithLevels.resourceType === 'EMITTER_A') {
|
if (acquired.resourceWithLevels.resourceType === 'EMP_BURSTER') {
|
||||||
res_level = acquired.resourceWithLevels.level;
|
|
||||||
res_count++;
|
|
||||||
} else if (acquired.resourceWithLevels.resourceType === 'EMP_BURSTER') {
|
|
||||||
xmp_level = acquired.resourceWithLevels.level;
|
xmp_level = acquired.resourceWithLevels.level;
|
||||||
xmp_count++;
|
xmp_count++;
|
||||||
|
} else if (acquired.resourceWithLevels.resourceType === 'EMITTER_A') {
|
||||||
|
res_level = acquired.resourceWithLevels.level;
|
||||||
|
res_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
alert("Passcode redeemed!\n" + [data.result.apAward + 'AP', data.result.xmAward + 'XM', res_count + 'xL' + res_level + ' RES', xmp_count + 'xL' + xmp_level + ' XMP', shield_count + 'x' + shield_rarity + ' SHIELD'].join('/'));
|
alert("<strong>Passcode accepted!</strong>\n" + [data.result.apAward + 'AP', data.result.xmAward + 'XM', xmp_count + 'xL' + xmp_level + ' XMP', res_count + 'xL' + res_level + ' RES', shield_count + 'x' + shield_rarity + ' SH'].join('/'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,6 +49,19 @@ window.setupRedeem = function() {
|
|||||||
if((e.keyCode ? e.keyCode : e.which) != 13) return;
|
if((e.keyCode ? e.keyCode : e.which) != 13) return;
|
||||||
var data = {passcode: $(this).val()};
|
var data = {passcode: $(this).val()};
|
||||||
window.postAjax('redeemReward', data, window.handleRedeemResponse,
|
window.postAjax('redeemReward', data, window.handleRedeemResponse,
|
||||||
function() { alert('The HTTP request failed. Either your code is invalid or their servers are down. No way to tell.'); });
|
function(response) {
|
||||||
|
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.";
|
||||||
|
} else {
|
||||||
|
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>.";
|
||||||
|
} else {
|
||||||
|
extra = "No status code was returned.";
|
||||||
|
}
|
||||||
|
alert('<strong>The HTTP request failed.</strong> ' + extra);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -204,9 +204,9 @@ window.plugin.playerTracker.drawData = function() {
|
|||||||
var evtsLength = playerData.events.length;
|
var evtsLength = playerData.events.length;
|
||||||
var last = playerData.events[evtsLength-1];
|
var last = playerData.events[evtsLength-1];
|
||||||
var ago = plugin.playerTracker.ago;
|
var ago = plugin.playerTracker.ago;
|
||||||
var color = playerData.team === 'ALIENS' ? '#029C02' : '#00789C';
|
var cssClass = playerData.team === 'ALIENS' ? 'enl' : 'res';
|
||||||
var title =
|
var title =
|
||||||
'<span style="font-weight:bold; color:'+color+'">' + playerData.nick + '</span>\n'
|
'<span class="nickname '+ cssClass+'" style="font-weight:bold;">' + playerData.nick + '</span>\n'
|
||||||
+ ago(last.time, now) + ' minutes ago\n'
|
+ ago(last.time, now) + ' minutes ago\n'
|
||||||
+ last.name;
|
+ last.name;
|
||||||
// show previous data in tooltip
|
// show previous data in tooltip
|
||||||
|
28
style.css
28
style.css
@ -679,15 +679,18 @@ aside {
|
|||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
background-color: #fff;
|
background-color: rgba(8, 48, 78, 0.9);
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #20A8B1;
|
||||||
color: #222;
|
color: #eee;
|
||||||
font: 13px/15px "Helvetica Neue", Arial, Helvetica, sans-serif;
|
font: 13px/15px "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||||
padding: 2px 4px;
|
padding: 2px 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-tooltip, .ui-dialog a {
|
||||||
|
color: #FFCE00;
|
||||||
|
}
|
||||||
|
|
||||||
.ui-dialog {
|
.ui-dialog {
|
||||||
border: 1px solid #0F0F0F;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
@ -715,23 +718,26 @@ aside {
|
|||||||
max-width: 700px !important;
|
max-width: 700px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-dialog a {
|
|
||||||
color: #0000ca;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-dialog-buttonpane {
|
.ui-dialog-buttonpane {
|
||||||
background: #F2F2F2;
|
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
border-top: 1px solid #E6E6E6;
|
border-top: 1px solid #20A8B1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-dialog-buttonset {
|
.ui-dialog-buttonset {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-dialog-buttonset button {
|
.ui-dialog-buttonset button,
|
||||||
|
.ui-dialog-content button {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
min-width: 80px;
|
min-width: 80px;
|
||||||
|
color: #FFCE00;
|
||||||
|
border: 1px solid #FFCE00;
|
||||||
|
background-color: rgba(8, 48, 78, 0.9);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-dialog-buttonset button:hover {
|
||||||
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user