diff --git a/static/webui/script.js b/static/webui/script.js index 05a9a400..ee16ffdf 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -1031,47 +1031,23 @@ function updateInventory() { const timeString = formatDatetime("%Y-%m-%d %H:%M:%s", ExpiryDate * 1000); const inlineForm = document.createElement("form"); const input = document.createElement("input"); - const a = document.createElement("a"); - a.href = "#"; - a.onclick = event => { - event.preventDefault(); - if (inlineForm.style.display === "none") { - inlineForm.style.display = "inline"; - input.value = timeString; - a.style.display = "none"; - input.focus(); - } else { - inlineForm.style.display = "none"; - a.style.display = "inline"; - input.value = ""; - } - }; - a.textContent = timeString; - a.title = loc("code_changeExpiry"); - a.classList.add("text-decoration-none"); - td.appendChild(a); - - const submit = () => { - if (doChangeBoosterExpiry(ItemType, input)) { - inlineForm.style.display = "none"; - input.value = ""; - a.style.display = "inline"; - } - }; - - inlineForm.style.display = "none"; + inlineForm.style.display = "inline-block"; inlineForm.onsubmit = function (event) { event.preventDefault(); - submit(); + doChangeBoosterExpiry(ItemType, input); }; input.type = "datetime-local"; input.classList.add("form-control"); input.classList.add("form-control-sm"); input.value = timeString; + let changed = false; + input.onchange = function () { + changed = true; + }; input.onblur = function () { - if (inlineForm.style.display === "inline") { - submit(); + if (changed) { + doChangeBoosterExpiry(ItemType, input); } }; inlineForm.appendChild(input); diff --git a/static/webui/translations/de.js b/static/webui/translations/de.js index 9fb692df..4e1b8a2d 100644 --- a/static/webui/translations/de.js +++ b/static/webui/translations/de.js @@ -37,7 +37,6 @@ dict = { code_rankUp: `Rang erhöhen`, code_rankDown: `Rang verringern`, code_count: `Anzahl`, - code_changeExpiry: `[UNTRANSLATED] Change Expiry Time`, code_focusAllUnlocked: `Alle Fokus-Schulen sind bereits freigeschaltet.`, code_focusUnlocked: `|COUNT| neue Fokus-Schulen freigeschaltet! Ein Inventar-Update wird benötigt, damit die Änderungen im Spiel sichtbar werden. Die Sternenkarte zu besuchen, sollte der einfachste Weg sein, dies auszulösen.`, code_addModsConfirm: `Bist du sicher, dass du |COUNT| Mods zu deinem Account hinzufügen möchtest?`, diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index 3372d574..79cec6e7 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -36,7 +36,6 @@ dict = { code_rankUp: `Rank up`, code_rankDown: `Rank down`, code_count: `Count`, - code_changeExpiry: `Change Expiry Time`, code_focusAllUnlocked: `All focus schools are already unlocked.`, code_focusUnlocked: `Unlocked |COUNT| new focus schools! An inventory update will be needed for the changes to be reflected in-game. Visiting the navigation should be the easiest way to trigger that.`, code_addModsConfirm: `Are you sure you want to add |COUNT| mods to your account?`, diff --git a/static/webui/translations/es.js b/static/webui/translations/es.js index c1c7d549..72d8453b 100644 --- a/static/webui/translations/es.js +++ b/static/webui/translations/es.js @@ -37,7 +37,6 @@ dict = { code_rankUp: `Subir de rango`, code_rankDown: `Bajar de rango`, code_count: `Cantidad`, - code_changeExpiry: `[UNTRANSLATED] Change Expiry Time`, code_focusAllUnlocked: `Todas las escuelas de enfoque ya están desbloqueadas.`, code_focusUnlocked: `¡Desbloqueadas |COUNT| nuevas escuelas de enfoque! Se necesita una actualización del inventario para reflejar los cambios en el juego. Visitar la navegación debería ser la forma más sencilla de activarlo.`, code_addModsConfirm: `¿Estás seguro de que deseas agregar |COUNT| modificadores a tu cuenta?`, diff --git a/static/webui/translations/fr.js b/static/webui/translations/fr.js index 31bee75e..bc079ef0 100644 --- a/static/webui/translations/fr.js +++ b/static/webui/translations/fr.js @@ -37,7 +37,6 @@ dict = { code_rankUp: `Monter de rang`, code_rankDown: `Baisser de rang`, code_count: `Quantité`, - code_changeExpiry: `[UNTRANSLATED] Change Expiry Time`, code_focusAllUnlocked: `Les écoles de Focus sont déjà déverrouillées.`, code_focusUnlocked: `|COUNT| écoles de Focus déverrouillées ! Synchronisation de l'inventaire nécessaire.`, code_addModsConfirm: `Ajouter |COUNT| mods à l'inventaire ?`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index 181f6fac..c99ca154 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -37,7 +37,6 @@ dict = { code_rankUp: `Повысить Ранг`, code_rankDown: `Понизить Ранг`, code_count: `Количество`, - code_changeExpiry: `[UNTRANSLATED] Change Expiry Time`, code_focusAllUnlocked: `Все школы фокуса уже разблокированы.`, code_focusUnlocked: `Разблокировано |COUNT| новых школ фокуса! Для отображения изменений в игре потребуется обновление инвентаря. Посещение навигации — самый простой способ этого добиться.`, code_addModsConfirm: `Вы уверены, что хотите добавить |COUNT| модов на ваш аккаунт?`, diff --git a/static/webui/translations/zh.js b/static/webui/translations/zh.js index 24561018..d6eb68b3 100644 --- a/static/webui/translations/zh.js +++ b/static/webui/translations/zh.js @@ -37,7 +37,6 @@ dict = { code_rankUp: `[UNTRANSLATED] Rank up`, code_rankDown: `[UNTRANSLATED] Rank down`, code_count: `数量`, - code_changeExpiry: `更改逾期时间`, code_focusAllUnlocked: `所有专精学派均已解锁。`, code_focusUnlocked: `已解锁 |COUNT| 个新专精学派!需要游戏内仓库更新才能生效,您可以通过访问星图来触发仓库更新。`, code_addModsConfirm: `确定要向账户添加 |COUNT| 张MOD吗?`,