返回提交历史
Modified
static/webui/script.js
+19
-12
Modified
static/webui/translations/en.js
+1
-0
XFEstudio/XFESpaceNinjaServer
chore(webui): say "successfully removed" when using a negative quantity (#1271)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1271
beb02bff
代码差异
2 个文件
+20
-12
@@ -812,20 +812,27 @@ function doAcquireMiscItems() {
812
812
$("#miscitem-type").addClass("is-invalid").focus();
813
813
return;
814
814
}
815
revalidateAuthz(() => {
816
$.post({
817
url: "/custom/addItems?" + window.authz,
818
contentType: "application/json",
819
data: JSON.stringify([
820
{
821
ItemType: uniqueName,
822
ItemCount: parseInt($("#miscitem-count").val())
815
const count = parseInt($("#miscitem-count").val());
816
if (count != 0) {
817
revalidateAuthz(() => {
818
$.post({
819
url: "/custom/addItems?" + window.authz,
820
contentType: "application/json",
821
data: JSON.stringify([
822
{
823
ItemType: uniqueName,
824
ItemCount: count
825
}
826
])
827
}).done(function () {
828
if (count > 0) {
829
toast(loc("code_succAdded"));
830
} else {
831
toast(loc("code_succRemoved"));
823
832
}
824
])
825
}).done(function () {
826
toast(loc("code_succAdded"));
833
});
827
834
});
828
});
835
}
829
836
}
830
837
831
838
function doAcquireRiven() {
@@ -28,6 +28,7 @@ dict = {
28
28
code_succRankUp: `Successfully ranked up.`,
29
29
code_noEquipmentToRankUp: `No equipment to rank up.`,
30
30
code_succAdded: `Successfully added.`,
31
code_succRemoved: `Successfully removed.`,
31
32
code_buffsNumber: `Number of buffs`,
32
33
code_cursesNumber: `Number of curses`,
33
34
code_rerollsNumber: `Number of rerolls`,