@richscripts/richtexteditor 2.14.1 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +173 -10
- package/angular/build-manifest.json +23 -0
- package/angular/index.d.ts +71 -76
- package/angular/index.mjs +2 -0
- package/angular/package.json +4 -0
- package/headless/index.d.ts +3 -1
- package/headless/index.js +72 -16
- package/index.d.ts +33 -54
- package/integrations/initialization-scope.js +27 -0
- package/integrations/native-mount.js +30 -0
- package/integrations/shared.d.ts +23 -1
- package/integrations/shared.js +58 -22
- package/package.json +25 -3
- package/react/index.js +118 -37
- package/react/index.mjs +29 -0
- package/richtexteditor/all_plugins.js +7001 -1078
- package/richtexteditor/all_plugins.min.js +62 -59
- package/richtexteditor/lang/emoji/LICENSE-CLDR.txt +41 -0
- package/richtexteditor/lang/emoji/rte-emoji-de.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-es.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-fr.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-it.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ja.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ko.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-nl.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-pt-pt.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-pt.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ru.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-zh-Hans.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-zh-Hant.js +3 -0
- package/richtexteditor/lang/rte-lang-af.js +1 -0
- package/richtexteditor/lang/rte-lang-ar.js +1 -0
- package/richtexteditor/lang/rte-lang-bg.js +1 -0
- package/richtexteditor/lang/rte-lang-bn.js +1 -0
- package/richtexteditor/lang/rte-lang-bs.js +1 -0
- package/richtexteditor/lang/rte-lang-ca.js +1 -0
- package/richtexteditor/lang/rte-lang-cs.js +1 -0
- package/richtexteditor/lang/rte-lang-cy.js +1 -0
- package/richtexteditor/lang/rte-lang-da.js +1 -0
- package/richtexteditor/lang/rte-lang-de.js +1017 -2
- package/richtexteditor/lang/rte-lang-el.js +1 -0
- package/richtexteditor/lang/rte-lang-en.js +1 -0
- package/richtexteditor/lang/rte-lang-es.js +1023 -2
- package/richtexteditor/lang/rte-lang-et.js +1 -0
- package/richtexteditor/lang/rte-lang-fa.js +1 -0
- package/richtexteditor/lang/rte-lang-fi.js +1 -0
- package/richtexteditor/lang/rte-lang-fil.js +1 -0
- package/richtexteditor/lang/rte-lang-fj.js +1 -0
- package/richtexteditor/lang/rte-lang-fr.js +1023 -2
- package/richtexteditor/lang/rte-lang-ga.js +1 -0
- package/richtexteditor/lang/rte-lang-gu.js +1 -0
- package/richtexteditor/lang/rte-lang-he.js +1 -0
- package/richtexteditor/lang/rte-lang-hi.js +1 -0
- package/richtexteditor/lang/rte-lang-hr.js +1 -0
- package/richtexteditor/lang/rte-lang-ht.js +1 -0
- package/richtexteditor/lang/rte-lang-hu.js +1 -0
- package/richtexteditor/lang/rte-lang-id.js +1 -0
- package/richtexteditor/lang/rte-lang-is.js +1 -0
- package/richtexteditor/lang/rte-lang-it.js +1023 -2
- package/richtexteditor/lang/rte-lang-ja.js +1023 -2
- package/richtexteditor/lang/rte-lang-kn.js +1 -0
- package/richtexteditor/lang/rte-lang-ko.js +1023 -2
- package/richtexteditor/lang/rte-lang-lt.js +1 -0
- package/richtexteditor/lang/rte-lang-lv.js +1 -0
- package/richtexteditor/lang/rte-lang-mg.js +1 -0
- package/richtexteditor/lang/rte-lang-mi.js +1 -0
- package/richtexteditor/lang/rte-lang-ml.js +1 -0
- package/richtexteditor/lang/rte-lang-mr.js +1 -0
- package/richtexteditor/lang/rte-lang-ms.js +1 -0
- package/richtexteditor/lang/rte-lang-mt.js +1 -0
- package/richtexteditor/lang/rte-lang-mww.js +1 -0
- package/richtexteditor/lang/rte-lang-nb.js +1 -0
- package/richtexteditor/lang/rte-lang-nl.js +1023 -2
- package/richtexteditor/lang/rte-lang-otq.js +1 -0
- package/richtexteditor/lang/rte-lang-pa.js +1 -0
- package/richtexteditor/lang/rte-lang-pl.js +1 -0
- package/richtexteditor/lang/rte-lang-pt-pt.js +1023 -2
- package/richtexteditor/lang/rte-lang-pt.js +1023 -2
- package/richtexteditor/lang/rte-lang-ro.js +1 -0
- package/richtexteditor/lang/rte-lang-ru.js +1023 -2
- package/richtexteditor/lang/rte-lang-sk.js +1 -0
- package/richtexteditor/lang/rte-lang-sl.js +1 -0
- package/richtexteditor/lang/rte-lang-sm.js +1 -0
- package/richtexteditor/lang/rte-lang-sr-Cyrl.js +1 -0
- package/richtexteditor/lang/rte-lang-sr-Latn.js +1 -0
- package/richtexteditor/lang/rte-lang-sv.js +1 -0
- package/richtexteditor/lang/rte-lang-sw.js +1 -0
- package/richtexteditor/lang/rte-lang-ta.js +1 -0
- package/richtexteditor/lang/rte-lang-te.js +1 -0
- package/richtexteditor/lang/rte-lang-th.js +1 -0
- package/richtexteditor/lang/rte-lang-tlh-Latn.js +1 -0
- package/richtexteditor/lang/rte-lang-tlh-Piqd.js +1 -0
- package/richtexteditor/lang/rte-lang-to.js +1 -0
- package/richtexteditor/lang/rte-lang-tr.js +1 -0
- package/richtexteditor/lang/rte-lang-ty.js +1 -0
- package/richtexteditor/lang/rte-lang-uk.js +1 -0
- package/richtexteditor/lang/rte-lang-ur.js +1 -0
- package/richtexteditor/lang/rte-lang-vi.js +1 -0
- package/richtexteditor/lang/rte-lang-yua.js +1 -0
- package/richtexteditor/lang/rte-lang-zh-Hans.js +1017 -2
- package/richtexteditor/lang/rte-lang-zh-Hant.js +1017 -2
- package/richtexteditor/plugins/a11yenhance.js +2 -1
- package/richtexteditor/plugins/a11yenhance.min.js +1 -1
- package/richtexteditor/plugins/accessibilitychecker.js +252 -60
- package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
- package/richtexteditor/plugins/aitoolkit.js +966 -303
- package/richtexteditor/plugins/aitoolkit.min.js +7 -7
- package/richtexteditor/plugins/all_plugins.js +7001 -1078
- package/richtexteditor/plugins/all_plugins.min.js +62 -59
- package/richtexteditor/plugins/autocorrect.js +66 -31
- package/richtexteditor/plugins/autocorrect.min.js +1 -1
- package/richtexteditor/plugins/autoembed.js +17 -0
- package/richtexteditor/plugins/autoembed.min.js +1 -1
- package/richtexteditor/plugins/blocktypes.js +18 -9
- package/richtexteditor/plugins/blocktypes.min.js +1 -1
- package/richtexteditor/plugins/bookmarkcard.js +12 -5
- package/richtexteditor/plugins/bookmarkcard.min.js +2 -2
- package/richtexteditor/plugins/changecase.js +72 -19
- package/richtexteditor/plugins/changecase.min.js +1 -1
- package/richtexteditor/plugins/charlimit.js +62 -2
- package/richtexteditor/plugins/charlimit.min.js +2 -2
- package/richtexteditor/plugins/comments.js +458 -59
- package/richtexteditor/plugins/comments.min.js +4 -3
- package/richtexteditor/plugins/contentminimap.js +25 -6
- package/richtexteditor/plugins/contentminimap.min.js +1 -1
- package/richtexteditor/plugins/crossreference.js +1 -1
- package/richtexteditor/plugins/crossreference.min.js +1 -1
- package/richtexteditor/plugins/dialoga11y.js +26 -4
- package/richtexteditor/plugins/dialoga11y.min.js +1 -1
- package/richtexteditor/plugins/dictation.js +1 -1
- package/richtexteditor/plugins/documentimport.js +220 -51
- package/richtexteditor/plugins/documentimport.min.js +4 -4
- package/richtexteditor/plugins/documentoutline.js +47 -8
- package/richtexteditor/plugins/documentoutline.min.js +1 -1
- package/richtexteditor/plugins/docxexport.js +204 -32
- package/richtexteditor/plugins/docxexport.min.js +2 -2
- package/richtexteditor/plugins/draghandle.js +267 -3
- package/richtexteditor/plugins/draghandle.min.js +1 -1
- package/richtexteditor/plugins/emailtoolkit.js +28 -14
- package/richtexteditor/plugins/emailtoolkit.min.js +1 -1
- package/richtexteditor/plugins/emojiautocomplete.js +110 -56
- package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
- package/richtexteditor/plugins/footnotes.js +65 -11
- package/richtexteditor/plugins/footnotes.min.js +1 -1
- package/richtexteditor/plugins/formatpainter.js +10 -0
- package/richtexteditor/plugins/formatpainter.min.js +1 -1
- package/richtexteditor/plugins/formattingmarks.js +6 -6
- package/richtexteditor/plugins/formattingmarks.min.js +1 -1
- package/richtexteditor/plugins/gapcursor.js +60 -0
- package/richtexteditor/plugins/gapcursor.min.js +1 -1
- package/richtexteditor/plugins/ghostcomplete.js +1 -1
- package/richtexteditor/plugins/html2pdf.js +1 -1
- package/richtexteditor/plugins/html2pdf.min.js +1 -1
- package/richtexteditor/plugins/imageeditor.js +12 -6
- package/richtexteditor/plugins/imageeditor.min.js +1 -1
- package/richtexteditor/plugins/importstyles.js +1 -1
- package/richtexteditor/plugins/inlinecode.js +25 -0
- package/richtexteditor/plugins/inlinecode.min.js +1 -1
- package/richtexteditor/plugins/insertcode.js +21 -3
- package/richtexteditor/plugins/insertcode.min.js +4 -4
- package/richtexteditor/plugins/insertemoji.js +112 -15
- package/richtexteditor/plugins/insertemoji.min.js +1 -1
- package/richtexteditor/plugins/insertgallery.js +42 -36
- package/richtexteditor/plugins/insertgallery.min.js +1 -1
- package/richtexteditor/plugins/inserttemplate.js +33 -17
- package/richtexteditor/plugins/inserttemplate.min.js +1 -1
- package/richtexteditor/plugins/keyboarda11y.js +66 -3
- package/richtexteditor/plugins/keyboarda11y.min.js +1 -1
- package/richtexteditor/plugins/layouttable.js +20 -0
- package/richtexteditor/plugins/layouttable.min.js +1 -1
- package/richtexteditor/plugins/linkchecker.js +29 -9
- package/richtexteditor/plugins/linkchecker.min.js +1 -1
- package/richtexteditor/plugins/localdraft.js +51 -7
- package/richtexteditor/plugins/localdraft.min.js +1 -1
- package/richtexteditor/plugins/markdownexport.js +159 -0
- package/richtexteditor/plugins/markdownexport.min.js +2 -2
- package/richtexteditor/plugins/mathdialog.js +11 -5
- package/richtexteditor/plugins/mathdialog.min.js +1 -1
- package/richtexteditor/plugins/mentionplugin.js +88 -25
- package/richtexteditor/plugins/mentionplugin.min.js +1 -1
- package/richtexteditor/plugins/mermaiddiagram.js +9 -3
- package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
- package/richtexteditor/plugins/multilevellist.js +4 -0
- package/richtexteditor/plugins/multilevellist.min.js +1 -1
- package/richtexteditor/plugins/pdfexport.js +235 -35
- package/richtexteditor/plugins/pdfexport.min.js +12 -12
- package/richtexteditor/plugins/permanentpen.js +3 -3
- package/richtexteditor/plugins/permanentpen.min.js +1 -1
- package/richtexteditor/plugins/readabilitystats.js +25 -11
- package/richtexteditor/plugins/readabilitystats.min.js +1 -1
- package/richtexteditor/plugins/readaloud.js +29 -15
- package/richtexteditor/plugins/readaloud.min.js +1 -1
- package/richtexteditor/plugins/restrictedediting.js +166 -0
- package/richtexteditor/plugins/restrictedediting.min.js +2 -2
- package/richtexteditor/plugins/revisionhistory.js +169 -37
- package/richtexteditor/plugins/revisionhistory.min.js +3 -3
- package/richtexteditor/plugins/rubyannotation.js +19 -9
- package/richtexteditor/plugins/rubyannotation.min.js +1 -1
- package/richtexteditor/plugins/sanitizer.js +62 -3
- package/richtexteditor/plugins/sanitizer.min.js +1 -1
- package/richtexteditor/plugins/slashcommand.js +30 -16
- package/richtexteditor/plugins/slashcommand.min.js +2 -2
- package/richtexteditor/plugins/smartchips.js +36 -22
- package/richtexteditor/plugins/smartchips.min.js +2 -2
- package/richtexteditor/plugins/spellcheck.js +17 -8
- package/richtexteditor/plugins/spellcheck.min.js +2 -2
- package/richtexteditor/plugins/stateinspector.js +19 -9
- package/richtexteditor/plugins/stateinspector.min.js +2 -2
- package/richtexteditor/plugins/structured-content-bridge.js +56 -24
- package/richtexteditor/plugins/structured-content-bridge.min.js +7 -7
- package/richtexteditor/plugins/tableofcontents.js +5 -2
- package/richtexteditor/plugins/tableofcontents.min.js +1 -1
- package/richtexteditor/plugins/tabletools.js +388 -3
- package/richtexteditor/plugins/tabletools.min.js +1 -1
- package/richtexteditor/plugins/textdirection.js +18 -5
- package/richtexteditor/plugins/textdirection.min.js +1 -1
- package/richtexteditor/plugins/textpartlanguage.js +161 -32
- package/richtexteditor/plugins/textpartlanguage.min.js +1 -1
- package/richtexteditor/plugins/todolist.js +90 -6
- package/richtexteditor/plugins/todolist.min.js +1 -1
- package/richtexteditor/plugins/trackedchanges.js +1812 -25
- package/richtexteditor/plugins/trackedchanges.min.js +5 -3
- package/richtexteditor/plugins/wordexport.js +2 -2
- package/richtexteditor/plugins/yjscollab.js +9 -4
- package/richtexteditor/plugins/yjscollab.min.js +1 -1
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.js +22 -13
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -1
- package/richtexteditor/rte-config.js +130 -50
- package/richtexteditor/rte-headless.js +19 -4
- package/richtexteditor/rte-webcomponent.js +89 -16
- package/richtexteditor/rte.js +132 -52
- package/scripts/build-angular.mjs +97 -0
- package/svelte/index.d.ts +2 -1
- package/svelte/index.js +80 -9
- package/vue/index.js +130 -34
- package/angular/component.ts +0 -297
- package/angular/index.ts +0 -24
|
@@ -226,7 +226,7 @@ RTE_DefaultConfig.insertCellTag = "<td><br/></td>"; // Default cell attributes w
|
|
|
226
226
|
|
|
227
227
|
|
|
228
228
|
|
|
229
|
-
RTE_DefaultConfig.insertOrderedListItems = [["decimal", "1,2,3,4,5"], ["lower-alpha", "a,b,c,d,e"], ["upper-alpha", "A,B,C,D,E"], ["lower-roman", "
|
|
229
|
+
RTE_DefaultConfig.insertOrderedListItems = [["decimal", "1,2,3,4,5"], ["lower-alpha", "a,b,c,d,e"], ["upper-alpha", "A,B,C,D,E"], ["lower-roman", "\u2170,\u2171,\u2172,\u2173,\u2174"], ["upper-roman", "\u2160,\u2161,\u2162,\u2163,\u2164"]];
|
|
230
230
|
|
|
231
231
|
RTE_DefaultConfig.insertUnorderedListItems = [["disc", "Disc"], ["circle", "Circle"], ["square", "Square"]];
|
|
232
232
|
|
|
@@ -377,7 +377,7 @@ RTE_DefaultConfig.stylesMerge = false; // true: the Quick Styles lists below are
|
|
|
377
377
|
// { title: "Callouts", items: [ ... ] } a labelled GROUP; items are indented under a heading
|
|
378
378
|
// Groups render as a heading plus indented items, not as a flyout submenu.
|
|
379
379
|
RTE_DefaultConfig.inlineStyles = [["Red", "color:red", "color:red"], ["Bold", "font-weight:bold", "font-weight:bold"], ["Mark", "my-cls-mark"], ["Warning", "my-cls-warning"]]; // Default CSS styles for inline styles dropdown.
|
|
380
|
-
RTE_DefaultConfig.paragraphStyles = [["Red", "color:red", "color:red"], ["Bold", "font-weight:bold", "font-weight:bold"], ["Quote", "my-cls-quote"], ["
|
|
380
|
+
RTE_DefaultConfig.paragraphStyles = [["Red", "color:red", "color:red"], ["Bold", "font-weight:bold", "font-weight:bold"], ["Quote", "my-cls-quote"], ["Large Center", "my-cls-largecenter"]]; // Default CSS styles for paragraph styles dropdown.
|
|
381
381
|
RTE_DefaultConfig.imageStyles = [["Border", "border: 1px solid #ddd; border-radius: 4px; padding: 5px;"], ["grayscale", "filter: grayscale(100%);"], ["Shadow", "box-shadow:0 0 8px gray"], ["Margin10", "margin:10px"], ["Padding:10", "padding:10px"]
|
|
382
382
|
, ["Rounded Corners", "border-radius: 10px;"], ["Rounded Images", "border-radius: 50%;"], ["Thumbnail Image", "border: 1px solid #ddd; border-radius: 4px; padding: 5px;width:150px"]// Default CSS styles for image Styles dropdown.
|
|
383
383
|
];
|
|
@@ -420,13 +420,15 @@ RTE_DefaultConfig.subtoolbar_more_full = "{strike,ucase,lcase,titlecase,insertho
|
|
|
420
420
|
RTE_DefaultConfig.subtoolbar_more_mobile = "{save} #{newdoc,help}"; // A set of buttons that appears in the subtoolbar of mobile toolbar set.
|
|
421
421
|
RTE_DefaultConfig.subtoolbar_paste = "pasteauto,pastetext,pasteword"; // A set of buttons that appears in the rich text editor's paste subtoolbar.
|
|
422
422
|
RTE_DefaultConfig.subtoolbar_paragraphop = "{justifyleft,justifycenter,justifyright,insertorderedlist,insertunorderedlist,indent,outdent,insertblockquote}" // A set of buttons that appears in the rich text editor's paragraph subtoolbar.
|
|
423
|
-
RTE_DefaultConfig.subtoolbar_table = "controlsizeauto,controlsize100,controlsize75,controlsize50,tabledistributecolumns,tabledistributerows,tableproperties,tabledelete"; // A set of buttons that appears in the table subtoolbar.
|
|
423
|
+
RTE_DefaultConfig.subtoolbar_table = "controlsizeauto,controlsize100,controlsize75,controlsize50,tabledistributecolumns,tabledistributerows,tablecaption,tableproperties,tabledelete"; // A set of buttons that appears in the table subtoolbar.
|
|
424
424
|
RTE_DefaultConfig.subtoolbar_tablerow = "tablerowinsertabove,tablerowinsertbelow,tablerowdelete"; // A set of buttons that appears in the tablerow subtoolbar.
|
|
425
425
|
RTE_DefaultConfig.subtoolbar_tablecell = "tablecellmerge,tablecellsplitver,tablecellsplithor,tablecellforecolor,tablecellbackcolor,tablecelltype,tablecellproperties"; // A set of buttons that appears in the tablecell subtoolbar.
|
|
426
426
|
|
|
427
427
|
// Icons + tooltips for the table/cell commands added 2026-06-18 (Lucide-style line icons).
|
|
428
428
|
RTE_DefaultConfig.text_tablecellproperties = "Cell Properties";
|
|
429
429
|
RTE_DefaultConfig.text_tableproperties = "Table Properties";
|
|
430
|
+
RTE_DefaultConfig.text_tablecaption = "Table Caption";
|
|
431
|
+
RTE_DefaultConfig.svgCode_tablecaption = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="6" y1="4" x2="18" y2="4"/><rect x="3" y="8" width="18" height="13" rx="1"/><line x1="3" y1="14.5" x2="21" y2="14.5"/><line x1="12" y1="8" x2="12" y2="21"/></svg>';
|
|
430
432
|
RTE_DefaultConfig.text_tablecelltype = "Toggle Header Cell";
|
|
431
433
|
RTE_DefaultConfig.text_tabledistributecolumns = "Distribute Columns";
|
|
432
434
|
RTE_DefaultConfig.text_tabledistributerows = "Distribute Rows";
|
|
@@ -649,22 +651,22 @@ RTE_DefaultConfig.text_ok = "OK";
|
|
|
649
651
|
RTE_DefaultConfig.text_cancel = "Cancel";
|
|
650
652
|
|
|
651
653
|
RTE_DefaultConfig.text_normal = "Normal"
|
|
652
|
-
RTE_DefaultConfig.text_h1 = "
|
|
653
|
-
RTE_DefaultConfig.text_h2 = "
|
|
654
|
-
RTE_DefaultConfig.text_h3 = "
|
|
655
|
-
RTE_DefaultConfig.text_h4 = "
|
|
656
|
-
RTE_DefaultConfig.text_h5 = "
|
|
657
|
-
RTE_DefaultConfig.text_h6 = "
|
|
658
|
-
RTE_DefaultConfig.text_h7 = "
|
|
654
|
+
RTE_DefaultConfig.text_h1 = "Heading 1"
|
|
655
|
+
RTE_DefaultConfig.text_h2 = "Heading 2"
|
|
656
|
+
RTE_DefaultConfig.text_h3 = "Heading 3"
|
|
657
|
+
RTE_DefaultConfig.text_h4 = "Heading 4"
|
|
658
|
+
RTE_DefaultConfig.text_h5 = "Heading 5"
|
|
659
|
+
RTE_DefaultConfig.text_h6 = "Heading 6"
|
|
660
|
+
RTE_DefaultConfig.text_h7 = "Heading 7"
|
|
659
661
|
|
|
660
662
|
RTE_DefaultConfig.text_close = "Close";
|
|
661
663
|
|
|
662
664
|
RTE_DefaultConfig.text_bold = "Bold";
|
|
663
665
|
RTE_DefaultConfig.text_italic = "Italic";
|
|
664
666
|
RTE_DefaultConfig.text_underline = "Underline";
|
|
665
|
-
RTE_DefaultConfig.text_strike = "
|
|
667
|
+
RTE_DefaultConfig.text_strike = "Strikethrough";
|
|
666
668
|
RTE_DefaultConfig.text_superscript = "Superscript";
|
|
667
|
-
RTE_DefaultConfig.text_subscript = "
|
|
669
|
+
RTE_DefaultConfig.text_subscript = "Subscript";
|
|
668
670
|
RTE_DefaultConfig.text_ucase = "Upper Case";
|
|
669
671
|
RTE_DefaultConfig.text_lcase = "Lower Case";
|
|
670
672
|
RTE_DefaultConfig.text_titlecase = "Title Case";
|
|
@@ -675,17 +677,17 @@ RTE_DefaultConfig.text_titlecase = "Title Case";
|
|
|
675
677
|
// translate without forking the plugin source.
|
|
676
678
|
RTE_DefaultConfig.svgCode_documentoutline = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="6" y1="6" x2="20" y2="6"/><line x1="9" y1="11" x2="20" y2="11"/><line x1="12" y1="16" x2="20" y2="16"/><line x1="3" y1="6" x2="3.5" y2="6"/><line x1="6" y1="11" x2="6.5" y2="11"/><line x1="9" y1="16" x2="9.5" y2="16"/></svg>';
|
|
677
679
|
RTE_DefaultConfig.text_documentoutline = "Document outline";
|
|
678
|
-
RTE_DefaultConfig.text_documentoutlinehint = "Live table of contents
|
|
680
|
+
RTE_DefaultConfig.text_documentoutlinehint = "Live table of contents \u2014 click any heading to jump to it.";
|
|
679
681
|
|
|
680
682
|
RTE_DefaultConfig.svgCode_contentminimap = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="6" y1="7" x2="14" y2="7"/><line x1="6" y1="11" x2="18" y2="11"/><line x1="6" y1="15" x2="12" y2="15"/><line x1="6" y1="19" x2="16" y2="19"/></svg>';
|
|
681
683
|
RTE_DefaultConfig.text_contentminimap = "Content minimap";
|
|
682
|
-
RTE_DefaultConfig.text_contentminimaphint = "Bird's-eye view of the document
|
|
684
|
+
RTE_DefaultConfig.text_contentminimaphint = "Bird's-eye view of the document \u2014 drag the highlight box to scroll.";
|
|
683
685
|
|
|
684
686
|
RTE_DefaultConfig.svgCode_accessibilitychecker = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><circle cx="12" cy="7" r="1.4" fill="currentColor"/><path d="M9 11.5h6"/><path d="M12 11.5v8"/><path d="M9 19.5l3-4 3 4"/></svg>';
|
|
685
687
|
RTE_DefaultConfig.text_accessibilitychecker = "Accessibility checker";
|
|
686
688
|
RTE_DefaultConfig.text_accessibilitycheckerhint = "Scan the document for missing alt text, empty headings, low contrast, and other a11y issues.";
|
|
687
689
|
|
|
688
|
-
RTE_DefaultConfig.text_removeformat = "
|
|
690
|
+
RTE_DefaultConfig.text_removeformat = "Clear Formatting";
|
|
689
691
|
|
|
690
692
|
RTE_DefaultConfig.text_insertlink = "Insert Link";
|
|
691
693
|
RTE_DefaultConfig.text_openlink = "Open Link";
|
|
@@ -704,8 +706,8 @@ RTE_DefaultConfig.text_outdent = "Outdent";
|
|
|
704
706
|
|
|
705
707
|
RTE_DefaultConfig.text_insertblockquote = "Block Quote";
|
|
706
708
|
|
|
707
|
-
RTE_DefaultConfig.text_insertorderedlist = "
|
|
708
|
-
RTE_DefaultConfig.text_insertunorderedlist = "
|
|
709
|
+
RTE_DefaultConfig.text_insertorderedlist = "Numbered List";
|
|
710
|
+
RTE_DefaultConfig.text_insertunorderedlist = "Bulleted List";
|
|
709
711
|
|
|
710
712
|
RTE_DefaultConfig.text_inserthorizontalrule = "Insert Horizontal Rule";
|
|
711
713
|
RTE_DefaultConfig.text_insertdate = "Insert Date";
|
|
@@ -745,13 +747,13 @@ RTE_DefaultConfig.text_inlinestyles = "Text styles";// Quick Styles applied to t
|
|
|
745
747
|
RTE_DefaultConfig.text_fontname = "Font";
|
|
746
748
|
RTE_DefaultConfig.text_fontsize = "Size";
|
|
747
749
|
RTE_DefaultConfig.text_forecolor = "Text Color";
|
|
748
|
-
RTE_DefaultConfig.text_backcolor = "
|
|
750
|
+
RTE_DefaultConfig.text_backcolor = "Background Color";
|
|
749
751
|
|
|
750
752
|
RTE_DefaultConfig.text_justify = "Justify"
|
|
751
|
-
RTE_DefaultConfig.text_justifyleft = "
|
|
752
|
-
RTE_DefaultConfig.text_justifyright = "
|
|
753
|
-
RTE_DefaultConfig.text_justifycenter = "
|
|
754
|
-
RTE_DefaultConfig.text_justifyfull = "Justify
|
|
753
|
+
RTE_DefaultConfig.text_justifyleft = "Align Left"
|
|
754
|
+
RTE_DefaultConfig.text_justifyright = "Align Right"
|
|
755
|
+
RTE_DefaultConfig.text_justifycenter = "Align Center"
|
|
756
|
+
RTE_DefaultConfig.text_justifyfull = "Justify"
|
|
755
757
|
RTE_DefaultConfig.text_justifynone = "Justify None"
|
|
756
758
|
|
|
757
759
|
RTE_DefaultConfig.text_delete = "Delete";
|
|
@@ -764,11 +766,11 @@ RTE_DefaultConfig.text_preview = "Preview";
|
|
|
764
766
|
RTE_DefaultConfig.text_print = "Print";
|
|
765
767
|
RTE_DefaultConfig.text_undo = "Undo";
|
|
766
768
|
RTE_DefaultConfig.text_redo = "Redo";
|
|
767
|
-
RTE_DefaultConfig.text_more = "More
|
|
769
|
+
RTE_DefaultConfig.text_more = "More\u2026";
|
|
768
770
|
RTE_DefaultConfig.text_newdoc = "New Doc";
|
|
769
771
|
RTE_DefaultConfig.text_help = "Help";
|
|
770
772
|
|
|
771
|
-
RTE_DefaultConfig.text_fullscreenenter = "
|
|
773
|
+
RTE_DefaultConfig.text_fullscreenenter = "Full Screen";
|
|
772
774
|
RTE_DefaultConfig.text_fullscreenexit = "Exit Full Screen";
|
|
773
775
|
RTE_DefaultConfig.text_fullscreen = "@text_fullscreenenter";
|
|
774
776
|
|
|
@@ -782,9 +784,9 @@ RTE_DefaultConfig.text_paragraphstyle = "Paragraph Styles";
|
|
|
782
784
|
RTE_DefaultConfig.text_linkstyle = "Link Styles";
|
|
783
785
|
RTE_DefaultConfig.text_link = "Link";
|
|
784
786
|
RTE_DefaultConfig.text_style = "Styles";
|
|
785
|
-
RTE_DefaultConfig.text_cssclass = "
|
|
786
|
-
RTE_DefaultConfig.text_url = "
|
|
787
|
-
RTE_DefaultConfig.text_byurl = "By
|
|
787
|
+
RTE_DefaultConfig.text_cssclass = "CSS Classes";
|
|
788
|
+
RTE_DefaultConfig.text_url = "URL";
|
|
789
|
+
RTE_DefaultConfig.text_byurl = "By URL";
|
|
788
790
|
RTE_DefaultConfig.text_upload = "Upload";
|
|
789
791
|
RTE_DefaultConfig.text_size = "Size";
|
|
790
792
|
|
|
@@ -795,7 +797,7 @@ RTE_DefaultConfig.text_opennewwin = "Open in new tab";
|
|
|
795
797
|
RTE_DefaultConfig.text_insert = "Insert";
|
|
796
798
|
RTE_DefaultConfig.text_update = "Update";
|
|
797
799
|
|
|
798
|
-
RTE_DefaultConfig.text_find = "Find
|
|
800
|
+
RTE_DefaultConfig.text_find = "Find and Replace";
|
|
799
801
|
RTE_DefaultConfig.text_findwhat = "Find";
|
|
800
802
|
RTE_DefaultConfig.text_replacewith = "Replace";
|
|
801
803
|
|
|
@@ -854,9 +856,9 @@ RTE_DefaultConfig.text_pmoveup = "Move Up";
|
|
|
854
856
|
RTE_DefaultConfig.text_pmovedown = "Move Down";
|
|
855
857
|
RTE_DefaultConfig.text_pduplicate = "Duplicate";
|
|
856
858
|
RTE_DefaultConfig.text_pdelete = "Delete";
|
|
857
|
-
RTE_DefaultConfig.text_pmore = "More
|
|
859
|
+
RTE_DefaultConfig.text_pmore = "More\u2026";
|
|
858
860
|
|
|
859
|
-
RTE_DefaultConfig.text_togglemore = "More
|
|
861
|
+
RTE_DefaultConfig.text_togglemore = "More\u2026";
|
|
860
862
|
RTE_DefaultConfig.text_toggleborder = "Toggle Border";
|
|
861
863
|
|
|
862
864
|
RTE_DefaultConfig.text_cut = "Cut";
|
|
@@ -877,7 +879,7 @@ RTE_DefaultConfig.text_insertbookmarktitle = "Insert bookmark";
|
|
|
877
879
|
RTE_DefaultConfig.text_insertbookmarklabel = "Link URL";
|
|
878
880
|
RTE_DefaultConfig.text_spellcheck = "Spell Check";
|
|
879
881
|
RTE_DefaultConfig.text_spellchecktitle = "Spelling";
|
|
880
|
-
RTE_DefaultConfig.text_spellchecknative = "Browser spell-check is on
|
|
882
|
+
RTE_DefaultConfig.text_spellchecknative = "Browser spell-check is on \u2014 misspellings are underlined as you type.";
|
|
881
883
|
RTE_DefaultConfig.text_spellcheckclean = "No spelling issues found.";
|
|
882
884
|
RTE_DefaultConfig.text_insertdatechip = "Date Chip";
|
|
883
885
|
RTE_DefaultConfig.text_insertchip = "Smart Chip";
|
|
@@ -954,14 +956,80 @@ RTE_DefaultConfig.translation = RTE_DefaultConfig.translation || {
|
|
|
954
956
|
RTE_DefaultConfig.plugin_insertcomment = function () {
|
|
955
957
|
var obj = this;
|
|
956
958
|
obj.PluginName = "InsertComment";
|
|
959
|
+
// Wraps each block's part of range in its own make() element, and returns them. The selection is
|
|
960
|
+
// cut into runs of text that share a block; a run starting or ending at the edge of an inline
|
|
961
|
+
// element (<b>) takes the whole element, so no empty <b></b> is left behind; text inside a
|
|
962
|
+
// non-editable element (a chip) moves with its run; a whitespace-only run (the line break between
|
|
963
|
+
// two blocks) gets nothing.
|
|
964
|
+
function markEachBlock(doc, range, make) {
|
|
965
|
+
var BLOCK = /^(P|DIV|LI|UL|OL|DL|DT|DD|TABLE|TBODY|THEAD|TFOOT|TR|TD|TH|CAPTION|H[1-6]|PRE|BLOCKQUOTE|ADDRESS|FIGURE|FIGCAPTION|SECTION|ARTICLE|ASIDE|HEADER|FOOTER|NAV|MAIN|DETAILS|SUMMARY|FORM|FIELDSET|LEGEND|HR|BODY)$/;
|
|
966
|
+
function blockOf(node) {
|
|
967
|
+
for (var n = node; n; n = n.parentNode)
|
|
968
|
+
if (n.nodeType === 1 && BLOCK.test(n.nodeName)) return n;
|
|
969
|
+
return null;
|
|
970
|
+
}
|
|
971
|
+
var root = range.commonAncestorContainer;
|
|
972
|
+
if (root.nodeType !== 1) root = root.parentNode;
|
|
973
|
+
var runs = [], cur = null;
|
|
974
|
+
var w = doc.createTreeWalker(root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, {
|
|
975
|
+
acceptNode: function (n) { return n.nodeType === 1 && n.getAttribute("contenteditable") === "false" ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT; }
|
|
976
|
+
});
|
|
977
|
+
for (var n = w.nextNode(); n; n = w.nextNode()) {
|
|
978
|
+
if (n.nodeType === 1) {
|
|
979
|
+
if (BLOCK.test(n.nodeName)) cur = null;
|
|
980
|
+
continue;
|
|
981
|
+
}
|
|
982
|
+
if (!range.intersectsNode(n)) continue;
|
|
983
|
+
var a = n === range.startContainer ? range.startOffset : 0, b = n === range.endContainer ? range.endOffset : n.data.length;
|
|
984
|
+
if (b <= a) continue;
|
|
985
|
+
var blk = blockOf(n);
|
|
986
|
+
if (!cur || cur.block !== blk) {
|
|
987
|
+
cur = { block: blk, sn: n, so: a, text: "" };
|
|
988
|
+
runs.push(cur);
|
|
989
|
+
}
|
|
990
|
+
cur.en = n;
|
|
991
|
+
cur.eo = b;
|
|
992
|
+
cur.text += n.data.substring(a, b);
|
|
993
|
+
}
|
|
994
|
+
var out = [];
|
|
995
|
+
// from the last run back: wrapping one never moves the text of a run still to come
|
|
996
|
+
for (var i = runs.length - 1; i >= 0; i--) {
|
|
997
|
+
var run = runs[i];
|
|
998
|
+
if (!/\S/.test(run.text)) continue;
|
|
999
|
+
var sub = doc.createRange();
|
|
1000
|
+
sub.setStart(run.sn, run.so);
|
|
1001
|
+
sub.setEnd(run.en, run.eo);
|
|
1002
|
+
var x = sub.startContainer;
|
|
1003
|
+
if (x.nodeType === 3 && sub.startOffset === 0) {
|
|
1004
|
+
while (x.parentNode && x.parentNode !== run.block && !x.previousSibling && !BLOCK.test(x.parentNode.nodeName)) x = x.parentNode;
|
|
1005
|
+
sub.setStartBefore(x);
|
|
1006
|
+
}
|
|
1007
|
+
x = sub.endContainer;
|
|
1008
|
+
if (x.nodeType === 3 && sub.endOffset === x.data.length) {
|
|
1009
|
+
while (x.parentNode && x.parentNode !== run.block && !x.nextSibling && !BLOCK.test(x.parentNode.nodeName)) x = x.parentNode;
|
|
1010
|
+
sub.setEndAfter(x);
|
|
1011
|
+
}
|
|
1012
|
+
var el = make();
|
|
1013
|
+
el.appendChild(sub.extractContents());
|
|
1014
|
+
sub.insertNode(el);
|
|
1015
|
+
out.unshift(el);
|
|
1016
|
+
}
|
|
1017
|
+
return out;
|
|
1018
|
+
}
|
|
957
1019
|
obj.InitConfig = function () {};
|
|
958
1020
|
obj.InitEditor = function (editor) {
|
|
959
1021
|
editor.attachEvent("exec_command_insertcomment", function (state) {
|
|
960
1022
|
var edDoc = editor.document;
|
|
961
1023
|
var sel = edDoc.defaultView.getSelection();
|
|
962
1024
|
var selectedText = sel && !sel.isCollapsed ? sel.toString() : "";
|
|
963
|
-
|
|
964
|
-
|
|
1025
|
+
// 2026-10-02 The range is kept from the moment the dialog opens: read on submit, after
|
|
1026
|
+
// focus had moved into the dialog, it could be collapsed (an EMPTY mark landed at the
|
|
1027
|
+
// start of the document in Firefox). tools/comments/comment-dialog.mjs
|
|
1028
|
+
var savedRange = selectedText ? sel.getRangeAt(0).cloneRange() : null;
|
|
1029
|
+
|
|
1030
|
+
// 2026-10-18 the dialog's words read config.text_ keys (English as the fallback).
|
|
1031
|
+
// tools/i18n/core-dialogs-language.mjs
|
|
1032
|
+
var dialoginner = editor.createDialog((editor.config || {}).text_commentapply || "Add Comment", "rte-dialog-insertcomment");
|
|
965
1033
|
dialoginner.style.padding = "14px";
|
|
966
1034
|
if (selectedText) {
|
|
967
1035
|
var preview = document.createElement("div");
|
|
@@ -970,30 +1038,39 @@ RTE_DefaultConfig.plugin_insertcomment = function () {
|
|
|
970
1038
|
dialoginner.appendChild(preview);
|
|
971
1039
|
}
|
|
972
1040
|
var label = document.createElement("label");
|
|
973
|
-
label.innerText = "Comment:";
|
|
1041
|
+
label.innerText = (editor.config || {}).text_dlg_commentlabel || "Comment:";
|
|
974
1042
|
label.className = "rte-comment-dialog-label";
|
|
975
1043
|
dialoginner.appendChild(label);
|
|
976
1044
|
var textarea = document.createElement("textarea");
|
|
977
1045
|
textarea.id = "rte-comment-input-" + new Date().getTime();
|
|
978
1046
|
label.htmlFor = textarea.id;
|
|
979
|
-
textarea.placeholder = "Type your comment...";
|
|
1047
|
+
textarea.placeholder = (editor.config || {}).text_commentplaceholder || "Type your comment...";
|
|
980
1048
|
textarea.className = "rte-comment-dialog-input";
|
|
981
1049
|
dialoginner.appendChild(textarea);
|
|
982
1050
|
var btnRow = document.createElement("div");
|
|
983
1051
|
btnRow.className = "rte-comment-dialog-actions";
|
|
984
1052
|
var insertBtn = document.createElement("button");
|
|
985
|
-
insertBtn.innerText = "Add Comment";
|
|
1053
|
+
insertBtn.innerText = (editor.config || {}).text_commentapply || "Add Comment";
|
|
986
1054
|
insertBtn.type = "button";
|
|
987
1055
|
insertBtn.className = "rte-comment-dialog-submit";
|
|
1056
|
+
// 2026-10-15 unstyled, the buttons were 21px tall: WCAG 2.5.8 asks for 24px targets. tools/a11y/dialog-axe.mjs
|
|
1057
|
+
insertBtn.style.cssText = "min-height:28px;padding:4px 14px;margin-right:6px;cursor:pointer;";
|
|
988
1058
|
insertBtn.onclick = function () {
|
|
989
1059
|
var comment = textarea.value.replace(/^\s+|\s+$/g, "");
|
|
990
|
-
if (comment &&
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
mark
|
|
995
|
-
|
|
996
|
-
|
|
1060
|
+
if (comment && savedRange) {
|
|
1061
|
+
// 2026-10-02 range.surroundContents THREW whenever the selection crossed an
|
|
1062
|
+
// element edge - starting inside a bold word, two paragraphs, two list items - and
|
|
1063
|
+
// the throw was swallowed: the dialog closed and the typed comment was gone. Each
|
|
1064
|
+
// block's part of the selection now gets its own mark (a mark around blocks would
|
|
1065
|
+
// split them, as links and the comments plugin did).
|
|
1066
|
+
if (editor.commitBookmark) editor.commitBookmark();
|
|
1067
|
+
markEachBlock(edDoc, savedRange, function () {
|
|
1068
|
+
var mark = edDoc.createElement("mark");
|
|
1069
|
+
mark.style.cssText = "background:#fff9c4;border-bottom:2px solid #f9a825;cursor:pointer;position:relative;";
|
|
1070
|
+
mark.setAttribute("title", comment);
|
|
1071
|
+
mark.setAttribute("data-comment", comment);
|
|
1072
|
+
return mark;
|
|
1073
|
+
});
|
|
997
1074
|
} else if (comment) {
|
|
998
1075
|
var safeComment = comment.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
999
1076
|
editor.insertHTML('<span class="rte-comment-marker" contenteditable="false" style="background:#fff9c4;border:1px solid #f9a825;border-radius:3px;padding:1px 6px;font-size:11px;color:#f57f17;cursor:pointer;" title="' + safeComment + '">💬 Comment</span>');
|
|
@@ -1002,9 +1079,10 @@ RTE_DefaultConfig.plugin_insertcomment = function () {
|
|
|
1002
1079
|
editor.focus();
|
|
1003
1080
|
};
|
|
1004
1081
|
var cancelBtn = document.createElement("button");
|
|
1005
|
-
cancelBtn.innerText = "Cancel";
|
|
1082
|
+
cancelBtn.innerText = (editor.config || {}).text_cancel || "Cancel";
|
|
1006
1083
|
cancelBtn.type = "button";
|
|
1007
1084
|
cancelBtn.className = "rte-comment-dialog-cancel";
|
|
1085
|
+
cancelBtn.style.cssText = "min-height:28px;padding:4px 14px;cursor:pointer;";
|
|
1008
1086
|
cancelBtn.onclick = function () {
|
|
1009
1087
|
dialoginner.close();
|
|
1010
1088
|
editor.focus();
|
|
@@ -1030,16 +1108,18 @@ RTE_DefaultConfig.plugin_insertcomment = function () {
|
|
|
1030
1108
|
};
|
|
1031
1109
|
};
|
|
1032
1110
|
|
|
1033
|
-
// ===
|
|
1111
|
+
// === Keyboard shortcut hints for the toolbar tooltips (config.keyboardShortcutHints). ===
|
|
1034
1112
|
(function () {
|
|
1035
1113
|
if (!RTE_DefaultConfig.showKeyboardShortcutsInTooltips) return;
|
|
1036
1114
|
var isMac = typeof navigator !== "undefined" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform || navigator.userAgent || "");
|
|
1037
|
-
var mod = isMac ? "
|
|
1038
|
-
var shift = isMac ? "
|
|
1115
|
+
var mod = isMac ? "\u2318" : "Ctrl";
|
|
1116
|
+
var shift = isMac ? "\u21e7" : "Shift";
|
|
1117
|
+
// 2026-10-18 a map read by rte.js for the toolbar TOOLTIPS; the label strings are no longer rewritten, so a
|
|
1118
|
+
// dialog title or a button's accessible name never carries " (Ctrl+K)" and a language pack keeps the hints.
|
|
1119
|
+
// tools/i18n/shortcut-hints.mjs
|
|
1120
|
+
var hints = RTE_DefaultConfig.keyboardShortcutHints = RTE_DefaultConfig.keyboardShortcutHints || {};
|
|
1039
1121
|
function add(cmd, key) {
|
|
1040
|
-
|
|
1041
|
-
if (!base || / \(.+\)$/.test(base)) return;
|
|
1042
|
-
RTE_DefaultConfig["text_" + cmd] = base + " (" + key + ")";
|
|
1122
|
+
if (!hints[cmd]) hints[cmd] = key;
|
|
1043
1123
|
}
|
|
1044
1124
|
add("bold", mod + "+B");
|
|
1045
1125
|
add("italic", mod + "+I");
|
|
@@ -116,15 +116,18 @@
|
|
|
116
116
|
}, 16);
|
|
117
117
|
}
|
|
118
118
|
this._emitUpdate = emitUpdate;
|
|
119
|
+
this._editorListeners = [];
|
|
119
120
|
|
|
120
121
|
["selectionchange", "change", "focus", "blur"].forEach(function (evt) {
|
|
121
122
|
try {
|
|
122
|
-
|
|
123
|
+
var listener = function (a, b) {
|
|
123
124
|
self._emit(evt, a, b);
|
|
124
125
|
if (evt === "selectionchange" || evt === "change") {
|
|
125
126
|
emitUpdate();
|
|
126
127
|
}
|
|
127
|
-
}
|
|
128
|
+
};
|
|
129
|
+
self.editor.attachEvent(evt, listener);
|
|
130
|
+
self._editorListeners.push([evt, listener]);
|
|
128
131
|
} catch (e) { /* event surface differs by build; ignore */ }
|
|
129
132
|
});
|
|
130
133
|
|
|
@@ -150,6 +153,7 @@
|
|
|
150
153
|
};
|
|
151
154
|
|
|
152
155
|
HeadlessController.prototype.on = function (name, cb) {
|
|
156
|
+
if (this._destroyed) return this;
|
|
153
157
|
if (typeof cb === "function") {
|
|
154
158
|
(this._handlers[name] = this._handlers[name] || []).push(cb);
|
|
155
159
|
}
|
|
@@ -165,12 +169,13 @@
|
|
|
165
169
|
};
|
|
166
170
|
|
|
167
171
|
HeadlessController.prototype._emit = function (name) {
|
|
172
|
+
if (this._destroyed) return;
|
|
168
173
|
var list = this._handlers[name];
|
|
169
174
|
if (!list || !list.length) {
|
|
170
175
|
return;
|
|
171
176
|
}
|
|
172
177
|
var args = Array.prototype.slice.call(arguments, 1);
|
|
173
|
-
for (var i = 0; i < list.length; i++) {
|
|
178
|
+
for (var i = 0; i < list.length && !this._destroyed; i++) {
|
|
174
179
|
try {
|
|
175
180
|
list[i].apply(this, args);
|
|
176
181
|
} catch (e) {
|
|
@@ -303,8 +308,15 @@
|
|
|
303
308
|
};
|
|
304
309
|
|
|
305
310
|
HeadlessController.prototype.destroy = function () {
|
|
311
|
+
if (this._destroyed) return this;
|
|
306
312
|
this._destroyed = true;
|
|
307
313
|
this._handlers = {};
|
|
314
|
+
if (this._editorListeners) {
|
|
315
|
+
for (var ei = 0; ei < this._editorListeners.length; ei++) {
|
|
316
|
+
try { this.editor.detachEvent(this._editorListeners[ei][0], this._editorListeners[ei][1]); } catch (e) {}
|
|
317
|
+
}
|
|
318
|
+
this._editorListeners = null;
|
|
319
|
+
}
|
|
308
320
|
// Drop format subscriptions here too: _destroyed alone only silences the
|
|
309
321
|
// callback, it does not stop the core from evaluating the commands on
|
|
310
322
|
// every toolbar refresh for a controller nobody is using any more.
|
|
@@ -321,7 +333,10 @@
|
|
|
321
333
|
}
|
|
322
334
|
this._docListeners = null;
|
|
323
335
|
this._boundDoc = null;
|
|
324
|
-
try {
|
|
336
|
+
try {
|
|
337
|
+
if (typeof this.editor.destroy === "function") this.editor.destroy();
|
|
338
|
+
else if (typeof this.editor.prepareDestroy === "function") this.editor.prepareDestroy();
|
|
339
|
+
} catch (e) { /* ignore */ }
|
|
325
340
|
return this;
|
|
326
341
|
};
|
|
327
342
|
|