返回提交历史
Modified
static/webui/script.js
+40
-0
XFEstudio/SpaceNinjaServer
feat(webui): add "Remove" option for owned warframes & weapons (#172)
a8ea8d13
代码差异
1 个文件
+40
-0
@@ -83,6 +83,16 @@ function updateInventory() {
83
83
};
84
84
a.textContent = "Make Rank 30";
85
85
td.appendChild(a);
86
td.innerHTML += " · ";
87
}
88
{
89
const a = document.createElement("a");
90
a.href = "#";
91
a.onclick = function () {
92
disposeOfGear("Suits", item.ItemId.$oid);
93
};
94
a.textContent = "Remove";
95
td.appendChild(a);
86
96
}
87
97
tr.appendChild(td);
88
98
}
@@ -109,6 +119,16 @@ function updateInventory() {
109
119
};
110
120
a.textContent = "Make Rank 30";
111
121
td.appendChild(a);
122
td.innerHTML += " · ";
123
}
124
{
125
const a = document.createElement("a");
126
a.href = "#";
127
a.onclick = function () {
128
disposeOfGear(category, item.ItemId.$oid);
129
};
130
a.textContent = "Remove";
131
td.appendChild(a);
112
132
}
113
133
tr.appendChild(td);
114
134
}
@@ -197,3 +217,23 @@ function addGearExp(category, oid, xp) {
197
217
updateInventory();
198
218
});
199
219
}
220
221
function disposeOfGear(category, oid) {
222
const data = {
223
SellCurrency: "SC_RegularCredits",
224
SellPrice: 0,
225
Items: {}
226
};
227
data.Items[category] = [
228
{
229
String: oid
230
}
231
];
232
$.post({
233
url: "/api/sell.php?accountId=" + window.accountId,
234
contentType: "text/plain",
235
data: JSON.stringify(data)
236
}).done(function () {
237
updateInventory();
238
});
239
}