mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 11:44:40 +00:00
feat: enable spellcheck on text editors
This commit is contained in:
+7
-1
@@ -420,7 +420,6 @@ function removeThemeTagsFromNotices () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function updateIframesWithDarkMode(): Promise<void> {
|
async function updateIframesWithDarkMode(): Promise<void> {
|
||||||
|
|
||||||
// Load the CSS file to overwrite iFrame default CSS
|
// Load the CSS file to overwrite iFrame default CSS
|
||||||
const cssLink = document.createElement('style')
|
const cssLink = document.createElement('style')
|
||||||
cssLink.classList.add('iframecss')
|
cssLink.classList.add('iframecss')
|
||||||
@@ -434,6 +433,13 @@ async function updateIframesWithDarkMode(): Promise<void> {
|
|||||||
const iframe = node as HTMLIFrameElement
|
const iframe = node as HTMLIFrameElement
|
||||||
try {
|
try {
|
||||||
applyDarkModeToIframe(iframe, cssLink, settingsState.DarkMode);
|
applyDarkModeToIframe(iframe, cssLink, settingsState.DarkMode);
|
||||||
|
|
||||||
|
// check if it is a text editor frame
|
||||||
|
if (node instanceof HTMLElement && node.classList.contains('cke_wysiwyg_frame')) {
|
||||||
|
await delay(100)
|
||||||
|
// enable spellcheck
|
||||||
|
iframe.contentDocument?.body.setAttribute('spellcheck', 'true')
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error applying dark mode:', error)
|
console.error('Error applying dark mode:', error)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user