mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
feat: custom editor
This commit is contained in:
@@ -222,5 +222,23 @@ window.addEventListener("message", (event) => {
|
||||
});
|
||||
|
||||
document.dispatchEvent(keyboardEvent);
|
||||
} else if (event.data.type === "ckeditorSetData") {
|
||||
// Handle CKEditor data setting
|
||||
const { editorId, content } = event.data;
|
||||
|
||||
if (window.CKEDITOR && window.CKEDITOR.instances && window.CKEDITOR.instances[editorId]) {
|
||||
window.CKEDITOR.instances[editorId].setData(content);
|
||||
} else {
|
||||
console.warn(`[pageState] CKEditor instance '${editorId}' not found`);
|
||||
}
|
||||
} else if (event.data.type === "ckeditorGetData") {
|
||||
const { editorId } = event.data;
|
||||
if (window.CKEDITOR && window.CKEDITOR.instances && window.CKEDITOR.instances[editorId]) {
|
||||
const data = window.CKEDITOR.instances[editorId].getData();
|
||||
window.postMessage({
|
||||
type: "ckeditorGetDataResponse",
|
||||
data,
|
||||
}, "*");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user