Show an explanation for why the CPU toggle is disabled; utility class for alert() and confirm() that matches the ED theme; code formatting

This commit is contained in:
cmdr2
2023-05-24 16:24:29 +05:30
parent 8554b0eab2
commit db265309a5
3 changed files with 79 additions and 49 deletions

View File

@ -261,20 +261,11 @@ function shiftOrConfirm(e, prompt, fn) {
if (e.shiftKey || !confirmDangerousActionsField.checked) {
fn(e)
} else {
$.confirm({
theme: "modern",
title: prompt,
useBootstrap: false,
animateFromElement: false,
content:
'<small>Tip: To skip this dialog, use shift-click or disable the "Confirm dangerous actions" setting in the Settings tab.</small>',
buttons: {
yes: () => {
fn(e)
},
cancel: () => {},
},
})
confirm(
'<small>Tip: To skip this dialog, use shift-click or disable the "Confirm dangerous actions" setting in the Settings tab.</small>',
prompt,
fn
)
}
}