Completely overhauled passcode redemption.

* Show table by default, offer plaintext option for reward copy-pasting
* Use recommendations from https://plus.google.com/115907431535033114848/posts/PVV9j4fTR2m for item plaintext listing
* Break passcode redemption responses and errors into window.REDEEM_* variables
* If an item isn't known, don't simply let it slip into the Aurbis. Log it separately.
* Don't show AP or XM if the passcode didn't give any.
This commit is contained in:
Morgan Jones
2013-04-23 20:21:48 -05:00
parent 99a18444bf
commit 00523fc03d
2 changed files with 86 additions and 78 deletions

View File

@ -78,13 +78,14 @@ window.digits = function(d) {
// able arguments: http://api.jquery.com/jQuery.ajax/
// error: see above. Additionally it is logged if the request failed.
window.postAjax = function(action, data, success, error) {
data = JSON.stringify($.extend({method: 'dashboard.'+action}, data));
var post_data = JSON.stringify($.extend({method: 'dashboard.'+action}, data));
var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); };
var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); };
var result = $.ajax({
url: '/rpc/dashboard.'+action,
type: 'POST',
data: data,
data: post_data,
context: data,
dataType: 'json',
success: [remove, success],
error: error ? [errCnt, error] : errCnt,