Compatability improvements
This commit is contained in:
parent
76b953f801
commit
22378f2310
@ -115,25 +115,23 @@ function buyitem(id, cost) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getmerchhtmlfromjson(item) {
|
function getmerchhtmlfromjson(item) {
|
||||||
var itemhtml = "\
|
var itemhtml = "<div class='list-group-item shop-item' id='shopitem-" + item.merchid + "'>"
|
||||||
<div class='list-group-item shop-item' id='shopitem-" + item.merchid + "'>\
|
+ "<h4 class='itemname'>" + item.title + "</h4>"
|
||||||
<h4 class='itemname'>" + item.title + "</h4>\
|
+ "<p class = 'itemdesc' > " + item.desc + " </p>"
|
||||||
<p class='itemdesc'>" + item.desc + "</p>";
|
+ "<span class='btn btn-success' onclick=\"buyitem('" + item.merchid + "', " + item.cost + ")\">"
|
||||||
itemhtml += "<span class='btn btn-success' onclick=\"buyitem('" + item.merchid + "', " + item.cost + ")\">\
|
+ "Buy Item (" + item.cost + " coins)"
|
||||||
Buy Item (" + item.cost + " coins)\
|
+ "</span>"
|
||||||
</span>\
|
+ "</div>";
|
||||||
</div>";
|
|
||||||
return itemhtml;
|
return itemhtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getcoinhtmlfromjson(coin) {
|
function getcoinhtmlfromjson(coin) {
|
||||||
var coinhtml = "\
|
var coinhtml = "<div class='list-group-item shop-item' id='coinitem-" + coin.merchid + "'>"
|
||||||
<div class='list-group-item shop-item' id='coinitem-" + coin.merchid + "'>\
|
+ "<h4 class='itemname'>" + coin.display + " (" + coin.coins + ")</h4>"
|
||||||
<h4 class='itemname'>" + coin.display + " (" + coin.coins + ")</h4>";
|
+ "<span class='btn btn-success' onclick=\"buycoins('" + coin.merchid + "', " + coin.cost_usd + ")\">"
|
||||||
coinhtml += "<span class='btn btn-success' onclick=\"buycoins('" + coin.merchid + "', " + coin.cost_usd + ")\">\
|
+ "Buy Coins ($" + coin.cost_usd + ")"
|
||||||
Buy Coins ($" + coin.cost_usd + ")\
|
+ "</span>"
|
||||||
</span>\
|
+ "</div>";
|
||||||
</div>";
|
|
||||||
return coinhtml;
|
return coinhtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
function useitem(uuid) {
|
function useitem(uuid) {
|
||||||
$('#invitem-' + uuid).prop('onclick',null).off('click');
|
$('#invitem-' + uuid).prop('onclick', null).off('click');
|
||||||
$.getJSON(mkApiUrl('useitem', 'gs'), {
|
$.getJSON(mkApiUrl('useitem', 'gs'), {
|
||||||
itemuuid: uuid
|
itemuuid: uuid
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
@ -41,19 +41,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getitemhtmlfromjson(item) {
|
function getitemhtmlfromjson(item) {
|
||||||
var itemhtml = "\
|
var itemhtml = "<div class='list-group-item inventory-item' id='item-" + item.itemuuid + "'>"
|
||||||
<div class='list-group-item inventory-item' id='item-" + item.itemuuid + "'>\
|
+ "<h4 class='itemname'>" + item.itemname + "</h4>"
|
||||||
<h4 class='itemname'>" + item.itemname + "</h4>\
|
+ "<p class='itemdesc'>" + item.itemdesc + "</p>";
|
||||||
<p class='itemdesc'>" + item.itemdesc + "</p>";
|
|
||||||
if (item.classname == "healmagic") {
|
if (item.classname == "healmagic") {
|
||||||
itemhtml += "<span class='btn btn-success' id='invitem-" + item.itemuuid + "' onclick=\"useitem('" + item.itemuuid + "')\">\
|
itemhtml += "<span class='btn btn-success' id='invitem-" + item.itemuuid + "' onclick=\"useitem('" + item.itemuuid + "')\">"
|
||||||
Use Item\
|
+ "Use Item"
|
||||||
</span>";
|
+ "</span>";
|
||||||
}
|
}
|
||||||
itemhtml += "<span class='itemid' style='display: none;'>" + item.itemid + "</span>\
|
itemhtml += "<span class='itemid' style='display: none;'>" + item.itemid + "</span>"
|
||||||
<span class='itemclassid' style='display: none;'>" + item.classid + "</span>\
|
+ "<span class='itemclassid' style='display: none;'>" + item.classid + "</span>"
|
||||||
<span class='itemjson' style='display: none;'>" + item.itemjson + "</span>\
|
+ "<span class='itemjson' style='display: none;'>" + item.itemjson + "</span>"
|
||||||
</div>";
|
+ "</div>";
|
||||||
return itemhtml;
|
return itemhtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,10 +69,11 @@
|
|||||||
function (data) {
|
function (data) {
|
||||||
if (data.status === 'OK') {
|
if (data.status === 'OK') {
|
||||||
data.badges.forEach(function (item) {
|
data.badges.forEach(function (item) {
|
||||||
$('#badges').append('<div class="col col-xs-3 col-md-2 col-lg-1" \
|
var badgehtml = '<div class="col col-xs-3 col-md-2 col-lg-1" '
|
||||||
onclick="popBadge(\'' + item.badgename + '\', \'' + item.badgedesc + '\')">\n\
|
+ 'onclick="popBadge(\'' + item.badgename + '\', \'' + item.badgedesc + '\')">'
|
||||||
<img class="badge-img img-circle img-responsive" alt="" src="assets/badges/' + item.badgesid + '.png" onerror="this.src=\'assets/badges/badge.png\'"/>\n\
|
+ '<img class="badge-img img-circle img-responsive" alt="" src="assets/badges/' + item.badgesid + '.png" onerror="this.src=\'assets/badges/badge.png\'"/>'
|
||||||
</div>');
|
+ '</div>'
|
||||||
|
$('#badges').append(badgehtml);
|
||||||
});
|
});
|
||||||
$('#loading-badges').css('display', 'none');
|
$('#loading-badges').css('display', 'none');
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user