refactor: replace jquery.are-you-sure with first-party code (#39233)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind
2026-09-06 14:43:49 +08:00
committed by GitHub
co-authored by wxiaoguang
parent 3bd7ea4c9f
commit 7c280c0ce6
14 changed files with 180 additions and 265 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import {hideElem, querySingleVisibleElem, showElem} from '../utils/dom.ts';
import {errorMessage} from '../modules/errors.ts';
import {triggerUploadStateChanged} from './comp/EditorUpload.ts';
import {convertHtmlToMarkdown} from '../markup/html2markdown.ts';
import {applyAreYouSure, reinitializeAreYouSure} from '../vendor/jquery.are-you-sure.ts';
import {applyAreYouSure} from '../modules/are-you-sure.ts';
async function tryOnEditContent(e: Event) {
const clickTarget = (e.target as HTMLElement).closest('.edit-content');
@@ -52,7 +52,7 @@ async function tryOnEditContent(e: Event) {
return;
}
reinitializeAreYouSure(editContentZone.querySelector('form')); // the form is no longer dirty
applyAreYouSure(editContentZone.querySelector('form')!); // the form is no longer dirty
editContentZone.setAttribute('data-content-version', data.contentVersion);
// replace the render content with new one, to trigger re-initialization of all features