chore(webui): give feedback via toasts instead of alerts
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build / build (20) (push) Successful in 1m7s
				
			
		
			
				
	
				Build / build (18) (pull_request) Successful in 40s
				
			
		
			
				
	
				Build / build (22) (pull_request) Successful in 37s
				
			
		
			
				
	
				Build / build (22) (push) Successful in 38s
				
			
		
			
				
	
				Build / build (18) (push) Successful in 1m29s
				
			
		
			
				
	
				Build / build (20) (pull_request) Successful in 1m6s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build / build (20) (push) Successful in 1m7s
				
			Build / build (18) (pull_request) Successful in 40s
				
			Build / build (22) (pull_request) Successful in 37s
				
			Build / build (22) (push) Successful in 38s
				
			Build / build (18) (push) Successful in 1m29s
				
			Build / build (20) (pull_request) Successful in 1m6s
				
			This commit is contained in:
		
							parent
							
								
									5038095c13
								
							
						
					
					
						commit
						549df92178
					
				@ -593,6 +593,7 @@
 | 
				
			|||||||
                <button class="btn btn-primary mt-3" onclick="doImport();" data-loc="import_submit"></button>
 | 
					                <button class="btn btn-primary mt-3" onclick="doImport();" data-loc="import_submit"></button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					        <div class="toast-container position-fixed bottom-0 end-0 p-3"></div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <datalist id="datalist-Suits"></datalist>
 | 
					    <datalist id="datalist-Suits"></datalist>
 | 
				
			||||||
    <datalist id="datalist-SpaceSuits"></datalist>
 | 
					    <datalist id="datalist-SpaceSuits"></datalist>
 | 
				
			||||||
 | 
				
			|||||||
@ -707,7 +707,7 @@ function maxRankAllEquipment(categories) {
 | 
				
			|||||||
                return sendBatchGearExp(batchData);
 | 
					                return sendBatchGearExp(batchData);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            alert(loc("code_noEquipmentToRankUp"));
 | 
					            toast(loc("code_noEquipmentToRankUp"));
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -740,6 +740,7 @@ function sendBatchGearExp(data) {
 | 
				
			|||||||
            contentType: "application/json",
 | 
					            contentType: "application/json",
 | 
				
			||||||
            data: JSON.stringify(data)
 | 
					            data: JSON.stringify(data)
 | 
				
			||||||
        }).done(() => {
 | 
					        }).done(() => {
 | 
				
			||||||
 | 
					            toast(loc("code_succRankUp"));
 | 
				
			||||||
            updateInventory();
 | 
					            updateInventory();
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
@ -822,7 +823,7 @@ function doAcquireMiscItems() {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            ])
 | 
					            ])
 | 
				
			||||||
        }).done(function () {
 | 
					        }).done(function () {
 | 
				
			||||||
            alert(loc("code_succAdded"));
 | 
					            toast(loc("code_succAdded"));
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -1019,9 +1020,9 @@ function doUnlockAllFocusSchools() {
 | 
				
			|||||||
                await unlockFocusSchool(upgradeType);
 | 
					                await unlockFocusSchool(upgradeType);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (Object.keys(missingFocusUpgrades).length == 0) {
 | 
					            if (Object.keys(missingFocusUpgrades).length == 0) {
 | 
				
			||||||
                alert(loc("code_focusAllUnlocked"));
 | 
					                toast(loc("code_focusAllUnlocked"));
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                alert(loc("code_focusUnlocked").split("|COUNT|").join(Object.keys(missingFocusUpgrades).length));
 | 
					                toast(loc("code_focusUnlocked").split("|COUNT|").join(Object.keys(missingFocusUpgrades).length));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
@ -1155,7 +1156,7 @@ function doImport() {
 | 
				
			|||||||
                inventory: JSON.parse($("#import-inventory").val())
 | 
					                inventory: JSON.parse($("#import-inventory").val())
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
        }).then(function () {
 | 
					        }).then(function () {
 | 
				
			||||||
            alert(loc("code_succImport"));
 | 
					            toast(loc("code_succImport"));
 | 
				
			||||||
            updateInventory();
 | 
					            updateInventory();
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
@ -1192,3 +1193,20 @@ function doQuestUpdate(operation) {
 | 
				
			|||||||
        updateInventory();
 | 
					        updateInventory();
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function toast(text) {
 | 
				
			||||||
 | 
					    const toast = document.createElement("div");
 | 
				
			||||||
 | 
					    toast.className = "toast align-items-center text-bg-primary border-0";
 | 
				
			||||||
 | 
					    const div = document.createElement("div");
 | 
				
			||||||
 | 
					    div.className = "d-flex";
 | 
				
			||||||
 | 
					    const body = document.createElement("div");
 | 
				
			||||||
 | 
					    body.className = "toast-body";
 | 
				
			||||||
 | 
					    body.textContent = text;
 | 
				
			||||||
 | 
					    div.appendChild(body);
 | 
				
			||||||
 | 
					    const button = document.createElement("button");
 | 
				
			||||||
 | 
					    button.className = "btn-close btn-close-white me-2 m-auto";
 | 
				
			||||||
 | 
					    button.setAttribute("data-bs-dismiss", "toast");
 | 
				
			||||||
 | 
					    div.appendChild(button);
 | 
				
			||||||
 | 
					    toast.appendChild(div);
 | 
				
			||||||
 | 
					    new bootstrap.Toast(document.querySelector(".toast-container").appendChild(toast)).show();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -26,6 +26,7 @@ dict = {
 | 
				
			|||||||
    code_renamePrompt: `Neuen benutzerdefinierten Namen eingeben:`,
 | 
					    code_renamePrompt: `Neuen benutzerdefinierten Namen eingeben:`,
 | 
				
			||||||
    code_remove: `Entfernen`,
 | 
					    code_remove: `Entfernen`,
 | 
				
			||||||
    code_addItemsConfirm: `Bist du sicher, dass du |COUNT| Gegenstände zu deinem Account hinzufügen möchtest?`,
 | 
					    code_addItemsConfirm: `Bist du sicher, dass du |COUNT| Gegenstände zu deinem Account hinzufügen möchtest?`,
 | 
				
			||||||
 | 
					    code_succRankUp: `[UNTRANSLATED] Successfully ranked up.`,
 | 
				
			||||||
    code_noEquipmentToRankUp: `Keine Ausstattung zum Rangaufstieg verfügbar.`,
 | 
					    code_noEquipmentToRankUp: `Keine Ausstattung zum Rangaufstieg verfügbar.`,
 | 
				
			||||||
    code_succAdded: `Erfolgreich hinzugefügt.`,
 | 
					    code_succAdded: `Erfolgreich hinzugefügt.`,
 | 
				
			||||||
    code_buffsNumber: `Anzahl der Buffs`,
 | 
					    code_buffsNumber: `Anzahl der Buffs`,
 | 
				
			||||||
 | 
				
			|||||||
@ -25,6 +25,7 @@ dict = {
 | 
				
			|||||||
    code_renamePrompt: `Enter new custom name:`,
 | 
					    code_renamePrompt: `Enter new custom name:`,
 | 
				
			||||||
    code_remove: `Remove`,
 | 
					    code_remove: `Remove`,
 | 
				
			||||||
    code_addItemsConfirm: `Are you sure you want to add |COUNT| items to your account?`,
 | 
					    code_addItemsConfirm: `Are you sure you want to add |COUNT| items to your account?`,
 | 
				
			||||||
 | 
					    code_succRankUp: `Successfully ranked up.`,
 | 
				
			||||||
    code_noEquipmentToRankUp: `No equipment to rank up.`,
 | 
					    code_noEquipmentToRankUp: `No equipment to rank up.`,
 | 
				
			||||||
    code_succAdded: `Successfully added.`,
 | 
					    code_succAdded: `Successfully added.`,
 | 
				
			||||||
    code_buffsNumber: `Number of buffs`,
 | 
					    code_buffsNumber: `Number of buffs`,
 | 
				
			||||||
 | 
				
			|||||||
@ -26,6 +26,7 @@ dict = {
 | 
				
			|||||||
    code_renamePrompt: `Nouveau nom :`,
 | 
					    code_renamePrompt: `Nouveau nom :`,
 | 
				
			||||||
    code_remove: `Retirer`,
 | 
					    code_remove: `Retirer`,
 | 
				
			||||||
    code_addItemsConfirm: `Ajouter |COUNT| items à l'inventaire ?`,
 | 
					    code_addItemsConfirm: `Ajouter |COUNT| items à l'inventaire ?`,
 | 
				
			||||||
 | 
					    code_succRankUp: `[UNTRANSLATED] Successfully ranked up.`,
 | 
				
			||||||
    code_noEquipmentToRankUp: `No equipment to rank up.`,
 | 
					    code_noEquipmentToRankUp: `No equipment to rank up.`,
 | 
				
			||||||
    code_succAdded: `Ajouté.`,
 | 
					    code_succAdded: `Ajouté.`,
 | 
				
			||||||
    code_buffsNumber: `Nombre de buffs`,
 | 
					    code_buffsNumber: `Nombre de buffs`,
 | 
				
			||||||
 | 
				
			|||||||
@ -26,6 +26,7 @@ dict = {
 | 
				
			|||||||
    code_renamePrompt: `Введите новое имя:`,
 | 
					    code_renamePrompt: `Введите новое имя:`,
 | 
				
			||||||
    code_remove: `Удалить`,
 | 
					    code_remove: `Удалить`,
 | 
				
			||||||
    code_addItemsConfirm: `Вы уверены, что хотите добавить |COUNT| предметов на ваш аккаунт?`,
 | 
					    code_addItemsConfirm: `Вы уверены, что хотите добавить |COUNT| предметов на ваш аккаунт?`,
 | 
				
			||||||
 | 
					    code_succRankUp: `[UNTRANSLATED] Successfully ranked up.`,
 | 
				
			||||||
    code_noEquipmentToRankUp: `Нет снаряжения для повышения ранга.`,
 | 
					    code_noEquipmentToRankUp: `Нет снаряжения для повышения ранга.`,
 | 
				
			||||||
    code_succAdded: `Успешно добавлено.`,
 | 
					    code_succAdded: `Успешно добавлено.`,
 | 
				
			||||||
    code_buffsNumber: `Количество усилений`,
 | 
					    code_buffsNumber: `Количество усилений`,
 | 
				
			||||||
 | 
				
			|||||||
@ -26,6 +26,7 @@ dict = {
 | 
				
			|||||||
    code_renamePrompt: `输入新的自定义名称:`,
 | 
					    code_renamePrompt: `输入新的自定义名称:`,
 | 
				
			||||||
    code_remove: `移除`,
 | 
					    code_remove: `移除`,
 | 
				
			||||||
    code_addItemsConfirm: `确定要向账户添加 |COUNT| 件物品吗?`,
 | 
					    code_addItemsConfirm: `确定要向账户添加 |COUNT| 件物品吗?`,
 | 
				
			||||||
 | 
					    code_succRankUp: `[UNTRANSLATED] Successfully ranked up.`,
 | 
				
			||||||
    code_noEquipmentToRankUp: `没有可升级的装备。`,
 | 
					    code_noEquipmentToRankUp: `没有可升级的装备。`,
 | 
				
			||||||
    code_succAdded: `已成功添加。`,
 | 
					    code_succAdded: `已成功添加。`,
 | 
				
			||||||
    code_buffsNumber: `增益数量`,
 | 
					    code_buffsNumber: `增益数量`,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user