diff --git a/static/webui/script.js b/static/webui/script.js index 52ff2ce34..0a3de30c0 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -83,6 +83,16 @@ function updateInventory() { }; a.textContent = "Make Rank 30"; td.appendChild(a); + td.innerHTML += " · "; + } + { + const a = document.createElement("a"); + a.href = "#"; + a.onclick = function () { + disposeOfGear("Suits", item.ItemId.$oid); + }; + a.textContent = "Remove"; + td.appendChild(a); } tr.appendChild(td); } @@ -109,6 +119,16 @@ function updateInventory() { }; a.textContent = "Make Rank 30"; td.appendChild(a); + td.innerHTML += " · "; + } + { + const a = document.createElement("a"); + a.href = "#"; + a.onclick = function () { + disposeOfGear(category, item.ItemId.$oid); + }; + a.textContent = "Remove"; + td.appendChild(a); } tr.appendChild(td); } @@ -197,3 +217,23 @@ function addGearExp(category, oid, xp) { updateInventory(); }); } + +function disposeOfGear(category, oid) { + const data = { + SellCurrency: "SC_RegularCredits", + SellPrice: 0, + Items: {} + }; + data.Items[category] = [ + { + String: oid + } + ]; + $.post({ + url: "/api/sell.php?accountId=" + window.accountId, + contentType: "text/plain", + data: JSON.stringify(data) + }).done(function () { + updateInventory(); + }); +}