(e, prompt, fn, allowSkip = true)
| 337 | // Otherwise, a confirmation dialog is shown. If the user confirms, the function fn will also |
| 338 | // be executed. |
| 339 | function shiftOrConfirm(e, prompt, fn, allowSkip = true) { |
| 340 | e.stopPropagation() |
| 341 | let tip = allowSkip |
| 342 | ? '<small>Tip: To skip this dialog, use shift-click or disable the "Confirm dangerous actions" setting in the Settings tab.</small>' |
| 343 | : "" |
| 344 | if (allowSkip && (e.shiftKey || !confirmDangerousActionsField.checked)) { |
| 345 | fn(e) |
| 346 | } else { |
| 347 | confirm(tip, prompt, () => { |
| 348 | fn(e) |
| 349 | }) |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | function undoableRemove(element, doubleUndo = false) { |
| 354 | let data = { |
no test coverage detected