@syncfusion/ej2-richtexteditor 29.2.4-760237 → 29.2.4-795127
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/.eslintrc.json +260 -262
- package/dist/ej2-richtexteditor.umd.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +85 -20
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +107 -37
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/package.json +1 -1
- package/src/common/util.js +21 -1
- package/src/editor-manager/plugin/clearformat.js +53 -22
- package/src/editor-manager/plugin/inserthtml.js +2 -1
- package/src/rich-text-editor/actions/enter-key.js +25 -9
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -1
- package/src/rich-text-editor/base/rich-text-editor.js +4 -3
- package/styles/_all.bds.scss +1 -0
- package/styles/_all.bootstrap-dark.scss +1 -0
- package/styles/_all.bootstrap.scss +1 -0
- package/styles/_all.bootstrap4.scss +1 -0
- package/styles/_all.bootstrap5-dark.scss +1 -0
- package/styles/_all.bootstrap5.3.scss +1 -0
- package/styles/_all.bootstrap5.scss +1 -0
- package/styles/_all.fabric-dark.scss +1 -0
- package/styles/_all.fabric.scss +1 -0
- package/styles/_all.fluent-dark.scss +1 -0
- package/styles/_all.fluent.scss +1 -0
- package/styles/_all.fluent2.scss +1 -0
- package/styles/_all.highcontrast-light.scss +1 -0
- package/styles/_all.highcontrast.scss +1 -0
- package/styles/_all.material-dark.scss +1 -0
- package/styles/_all.material.scss +1 -0
- package/styles/_all.material3-dark.scss +1 -0
- package/styles/_all.material3.scss +1 -0
- package/styles/_all.scss +1 -1
- package/styles/_all.tailwind-dark.scss +1 -0
- package/styles/_all.tailwind.scss +1 -0
- package/styles/_all.tailwind3.scss +1 -0
- package/styles/bds-lite.css +510 -111
- package/styles/bds-lite.scss +3 -4
- package/styles/bds.css +629 -121
- package/styles/bds.scss +4 -5
- package/styles/bootstrap-dark-lite.css +475 -106
- package/styles/bootstrap-dark-lite.scss +3 -4
- package/styles/bootstrap-dark.css +580 -117
- package/styles/bootstrap-dark.scss +4 -5
- package/styles/bootstrap-lite.css +655 -108
- package/styles/bootstrap-lite.scss +3 -4
- package/styles/bootstrap.css +863 -133
- package/styles/bootstrap.scss +4 -5
- package/styles/bootstrap4-lite.css +848 -127
- package/styles/bootstrap4-lite.scss +3 -4
- package/styles/bootstrap4.css +1235 -241
- package/styles/bootstrap4.scss +4 -5
- package/styles/bootstrap5-dark-lite.css +464 -109
- package/styles/bootstrap5-dark-lite.scss +3 -4
- package/styles/bootstrap5-dark.css +561 -119
- package/styles/bootstrap5-dark.scss +4 -5
- package/styles/bootstrap5-lite.css +458 -109
- package/styles/bootstrap5-lite.scss +4 -4
- package/styles/bootstrap5.3-lite.css +724 -127
- package/styles/bootstrap5.3-lite.scss +4 -4
- package/styles/bootstrap5.3.css +907 -139
- package/styles/bootstrap5.3.scss +5 -5
- package/styles/bootstrap5.css +555 -119
- package/styles/bootstrap5.scss +5 -5
- package/styles/fabric-dark-lite.css +462 -107
- package/styles/fabric-dark-lite.scss +4 -4
- package/styles/fabric-dark.css +559 -117
- package/styles/fabric-dark.scss +5 -5
- package/styles/fabric-lite.css +462 -107
- package/styles/fabric-lite.scss +4 -4
- package/styles/fabric.css +559 -117
- package/styles/fabric.scss +5 -5
- package/styles/fluent-dark-lite.css +466 -120
- package/styles/fluent-dark-lite.scss +4 -4
- package/styles/fluent-dark.css +563 -131
- package/styles/fluent-dark.scss +5 -5
- package/styles/fluent-lite.css +466 -111
- package/styles/fluent-lite.scss +4 -4
- package/styles/fluent.css +563 -122
- package/styles/fluent.scss +5 -5
- package/styles/fluent2-lite.css +791 -137
- package/styles/fluent2-lite.scss +4 -4
- package/styles/fluent2.css +987 -151
- package/styles/fluent2.scss +5 -5
- package/styles/highcontrast-light-lite.css +462 -107
- package/styles/highcontrast-light-lite.scss +4 -4
- package/styles/highcontrast-light.css +559 -117
- package/styles/highcontrast-light.scss +5 -5
- package/styles/highcontrast-lite.css +462 -107
- package/styles/highcontrast-lite.scss +4 -4
- package/styles/highcontrast.css +559 -117
- package/styles/highcontrast.scss +5 -5
- package/styles/material-dark-lite.css +461 -106
- package/styles/material-dark-lite.scss +4 -4
- package/styles/material-dark.css +558 -116
- package/styles/material-dark.scss +5 -5
- package/styles/material-lite.css +461 -106
- package/styles/material-lite.scss +3 -4
- package/styles/material.css +558 -116
- package/styles/material.scss +4 -5
- package/styles/material3-dark-lite.css +809 -124
- package/styles/material3-dark-lite.scss +4 -4
- package/styles/material3-dark.css +1004 -150
- package/styles/material3-dark.scss +5 -7
- package/styles/material3-lite.css +729 -124
- package/styles/material3-lite.scss +4 -4
- package/styles/material3.css +926 -150
- package/styles/material3.scss +5 -7
- package/styles/rich-text-editor/_all.bds.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap-dark.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap4.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap5-dark.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap5.3.scss +2 -0
- package/styles/rich-text-editor/_all.bootstrap5.scss +2 -0
- package/styles/rich-text-editor/_all.fabric-dark.scss +2 -0
- package/styles/rich-text-editor/_all.fabric.scss +2 -0
- package/styles/rich-text-editor/_all.fluent-dark.scss +2 -0
- package/styles/rich-text-editor/_all.fluent.scss +2 -0
- package/styles/rich-text-editor/_all.fluent2.scss +2 -0
- package/styles/rich-text-editor/_all.highcontrast-light.scss +2 -0
- package/styles/rich-text-editor/_all.highcontrast.scss +2 -0
- package/styles/rich-text-editor/_all.material-dark.scss +2 -0
- package/styles/rich-text-editor/_all.material.scss +2 -0
- package/styles/rich-text-editor/_all.material3-dark.scss +2 -0
- package/styles/rich-text-editor/_all.material3.scss +2 -0
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_all.tailwind-dark.scss +2 -0
- package/styles/rich-text-editor/_all.tailwind.scss +2 -0
- package/styles/rich-text-editor/_all.tailwind3.scss +2 -0
- package/styles/rich-text-editor/_bds-definition.scss +476 -27
- package/styles/rich-text-editor/_bigger.bds.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap4.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap5-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap5.3.scss +3 -0
- package/styles/rich-text-editor/_bigger.bootstrap5.scss +3 -0
- package/styles/rich-text-editor/_bigger.fabric-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.fabric.scss +3 -0
- package/styles/rich-text-editor/_bigger.fluent-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.fluent.scss +3 -0
- package/styles/rich-text-editor/_bigger.fluent2.scss +3 -0
- package/styles/rich-text-editor/_bigger.highcontrast-light.scss +3 -0
- package/styles/rich-text-editor/_bigger.highcontrast.scss +3 -0
- package/styles/rich-text-editor/_bigger.material-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.material.scss +3 -0
- package/styles/rich-text-editor/_bigger.material3-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.material3.scss +3 -0
- package/styles/rich-text-editor/_bigger.scss +167 -59
- package/styles/rich-text-editor/_bigger.tailwind-dark.scss +3 -0
- package/styles/rich-text-editor/_bigger.tailwind.scss +3 -0
- package/styles/rich-text-editor/_bigger.tailwind3.scss +3 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +475 -26
- package/styles/rich-text-editor/_bootstrap-definition.scss +476 -27
- package/styles/rich-text-editor/_bootstrap4-definition.scss +481 -33
- package/styles/rich-text-editor/_bootstrap5-dark-definition.scss +709 -1
- package/styles/rich-text-editor/_bootstrap5-definition.scss +476 -28
- package/styles/rich-text-editor/_bootstrap5.3-definition.scss +477 -29
- package/styles/rich-text-editor/_fabric-dark-definition.scss +475 -27
- package/styles/rich-text-editor/_fabric-definition.scss +474 -27
- package/styles/rich-text-editor/_fluent-dark-definition.scss +710 -1
- package/styles/rich-text-editor/_fluent-definition.scss +478 -28
- package/styles/rich-text-editor/_fluent2-definition.scss +487 -34
- package/styles/rich-text-editor/_fusionnew-definition.scss +471 -26
- package/styles/rich-text-editor/_highcontrast-definition.scss +474 -26
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +474 -26
- package/styles/rich-text-editor/_layout.bds.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap4.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap5-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap5.3.scss +3 -0
- package/styles/rich-text-editor/_layout.bootstrap5.scss +3 -0
- package/styles/rich-text-editor/_layout.fabric-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.fabric.scss +3 -0
- package/styles/rich-text-editor/_layout.fluent-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.fluent.scss +3 -0
- package/styles/rich-text-editor/_layout.fluent2.scss +3 -0
- package/styles/rich-text-editor/_layout.highcontrast-light.scss +3 -0
- package/styles/rich-text-editor/_layout.highcontrast.scss +3 -0
- package/styles/rich-text-editor/_layout.material-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.material.scss +3 -0
- package/styles/rich-text-editor/_layout.material3-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.material3.scss +3 -0
- package/styles/rich-text-editor/_layout.scss +639 -361
- package/styles/rich-text-editor/_layout.tailwind-dark.scss +3 -0
- package/styles/rich-text-editor/_layout.tailwind.scss +3 -0
- package/styles/rich-text-editor/_layout.tailwind3.scss +3 -0
- package/styles/rich-text-editor/_material-dark-definition.scss +474 -28
- package/styles/rich-text-editor/_material-definition.scss +474 -26
- package/styles/rich-text-editor/_material3-dark-definition.scss +714 -1
- package/styles/rich-text-editor/_material3-definition.scss +481 -30
- package/styles/rich-text-editor/_tailwind-dark-definition.scss +706 -1
- package/styles/rich-text-editor/_tailwind-definition.scss +476 -28
- package/styles/rich-text-editor/_tailwind3-definition.scss +483 -35
- package/styles/rich-text-editor/_theme-variables.bds.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap4.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap5-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap5.3.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.bootstrap5.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fabric-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fabric.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fluent-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fluent.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.fluent2.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.highcontrast-light.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.highcontrast.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.material-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.material.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.material3-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.material3.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.tailwind-dark.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.tailwind.scss +1 -0
- package/styles/rich-text-editor/_theme-variables.tailwind3.scss +1 -0
- package/styles/rich-text-editor/_theme.bds.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap4.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap5-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap5.3.scss +4 -0
- package/styles/rich-text-editor/_theme.bootstrap5.scss +4 -0
- package/styles/rich-text-editor/_theme.fabric-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.fabric.scss +4 -0
- package/styles/rich-text-editor/_theme.fluent-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.fluent.scss +4 -0
- package/styles/rich-text-editor/_theme.fluent2.scss +4 -0
- package/styles/rich-text-editor/_theme.highcontrast-light.scss +4 -0
- package/styles/rich-text-editor/_theme.highcontrast.scss +4 -0
- package/styles/rich-text-editor/_theme.material-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.material.scss +4 -0
- package/styles/rich-text-editor/_theme.material3-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.material3.scss +4 -0
- package/styles/rich-text-editor/_theme.scss +68 -36
- package/styles/rich-text-editor/_theme.tailwind-dark.scss +4 -0
- package/styles/rich-text-editor/_theme.tailwind.scss +4 -0
- package/styles/rich-text-editor/_theme.tailwind3.scss +4 -0
- package/styles/rich-text-editor/bds.css +629 -121
- package/styles/rich-text-editor/bds.scss +5 -5
- package/styles/rich-text-editor/bootstrap-dark.css +580 -117
- package/styles/rich-text-editor/bootstrap-dark.scss +5 -5
- package/styles/rich-text-editor/bootstrap.css +863 -133
- package/styles/rich-text-editor/bootstrap.scss +5 -5
- package/styles/rich-text-editor/bootstrap4.css +1235 -241
- package/styles/rich-text-editor/bootstrap4.scss +5 -5
- package/styles/rich-text-editor/bootstrap5-dark.css +561 -119
- package/styles/rich-text-editor/bootstrap5-dark.scss +5 -5
- package/styles/rich-text-editor/bootstrap5.3.css +907 -139
- package/styles/rich-text-editor/bootstrap5.3.scss +5 -5
- package/styles/rich-text-editor/bootstrap5.css +555 -119
- package/styles/rich-text-editor/bootstrap5.scss +5 -5
- package/styles/rich-text-editor/fabric-dark.css +559 -117
- package/styles/rich-text-editor/fabric-dark.scss +5 -5
- package/styles/rich-text-editor/fabric.css +559 -117
- package/styles/rich-text-editor/fabric.scss +5 -5
- package/styles/rich-text-editor/fluent-dark.css +563 -131
- package/styles/rich-text-editor/fluent-dark.scss +5 -5
- package/styles/rich-text-editor/fluent.css +563 -122
- package/styles/rich-text-editor/fluent.scss +5 -5
- package/styles/rich-text-editor/fluent2.css +987 -151
- package/styles/rich-text-editor/fluent2.scss +5 -5
- package/styles/rich-text-editor/highcontrast-light.css +559 -117
- package/styles/rich-text-editor/highcontrast-light.scss +5 -5
- package/styles/rich-text-editor/highcontrast.css +559 -117
- package/styles/rich-text-editor/highcontrast.scss +5 -5
- package/styles/rich-text-editor/icons/_bds.scss +11 -1
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +11 -1
- package/styles/rich-text-editor/icons/_bootstrap.scss +11 -2
- package/styles/rich-text-editor/icons/_bootstrap4.scss +11 -2
- package/styles/rich-text-editor/icons/_bootstrap5-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap5.3.scss +11 -2
- package/styles/rich-text-editor/icons/_bootstrap5.scss +11 -2
- package/styles/rich-text-editor/icons/_fabric-dark.scss +11 -2
- package/styles/rich-text-editor/icons/_fabric.scss +11 -2
- package/styles/rich-text-editor/icons/_fluent-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_fluent.scss +11 -1
- package/styles/rich-text-editor/icons/_fluent2.scss +10 -1
- package/styles/rich-text-editor/icons/_fusionnew.scss +11 -2
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +12 -1
- package/styles/rich-text-editor/icons/_highcontrast.scss +12 -1
- package/styles/rich-text-editor/icons/_material-dark.scss +12 -1
- package/styles/rich-text-editor/icons/_material.scss +12 -1
- package/styles/rich-text-editor/icons/_material3-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_material3.scss +12 -1
- package/styles/rich-text-editor/icons/_tailwind-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_tailwind.scss +12 -1
- package/styles/rich-text-editor/icons/_tailwind3.scss +12 -1
- package/styles/rich-text-editor/material-dark.css +558 -116
- package/styles/rich-text-editor/material-dark.scss +5 -5
- package/styles/rich-text-editor/material.css +558 -116
- package/styles/rich-text-editor/material.scss +5 -5
- package/styles/rich-text-editor/material3-dark.css +1004 -150
- package/styles/rich-text-editor/material3-dark.scss +5 -6
- package/styles/rich-text-editor/material3.css +926 -150
- package/styles/rich-text-editor/material3.scss +5 -6
- package/styles/rich-text-editor/tailwind-dark.css +564 -122
- package/styles/rich-text-editor/tailwind-dark.scss +5 -5
- package/styles/rich-text-editor/tailwind.css +564 -122
- package/styles/rich-text-editor/tailwind.scss +5 -5
- package/styles/rich-text-editor/tailwind3.css +876 -139
- package/styles/rich-text-editor/tailwind3.scss +5 -5
- package/styles/tailwind-dark-lite.css +467 -112
- package/styles/tailwind-dark-lite.scss +4 -4
- package/styles/tailwind-dark.css +564 -122
- package/styles/tailwind-dark.scss +5 -5
- package/styles/tailwind-lite.css +467 -112
- package/styles/tailwind-lite.scss +4 -4
- package/styles/tailwind.css +564 -122
- package/styles/tailwind.scss +5 -5
- package/styles/tailwind3-lite.css +702 -127
- package/styles/tailwind3-lite.scss +4 -4
- package/styles/tailwind3.css +876 -139
- package/styles/tailwind3.scss +5 -5
- package/aceconfig.js +0 -17
- package/blazorGlobalSrc/common/config.d.ts +0 -63
- package/blazorGlobalSrc/common/config.js +0 -123
- package/blazorGlobalSrc/common/constant.d.ts +0 -117
- package/blazorGlobalSrc/common/constant.js +0 -23
- package/blazorGlobalSrc/common/editor-styles.d.ts +0 -1
- package/blazorGlobalSrc/common/editor-styles.js +0 -5
- package/blazorGlobalSrc/common/index.d.ts +0 -7
- package/blazorGlobalSrc/common/index.js +0 -9
- package/blazorGlobalSrc/common/interface.d.ts +0 -119
- package/blazorGlobalSrc/common/interface.js +0 -4
- package/blazorGlobalSrc/common/types.d.ts +0 -25
- package/blazorGlobalSrc/common/types.js +0 -4
- package/blazorGlobalSrc/common/user-agent.d.ts +0 -41
- package/blazorGlobalSrc/common/user-agent.js +0 -71
- package/blazorGlobalSrc/common/util.d.ts +0 -70
- package/blazorGlobalSrc/common/util.js +0 -222
- package/blazorGlobalSrc/components.d.ts +0 -8
- package/blazorGlobalSrc/components.js +0 -12
- package/blazorGlobalSrc/editor-manager/base/classes.d.ts +0 -31
- package/blazorGlobalSrc/editor-manager/base/classes.js +0 -28
- package/blazorGlobalSrc/editor-manager/base/constant.d.ts +0 -97
- package/blazorGlobalSrc/editor-manager/base/constant.js +0 -41
- package/blazorGlobalSrc/editor-manager/base/editor-manager.d.ts +0 -95
- package/blazorGlobalSrc/editor-manager/base/editor-manager.js +0 -339
- package/blazorGlobalSrc/editor-manager/base/enum.d.ts +0 -17
- package/blazorGlobalSrc/editor-manager/base/enum.js +0 -4
- package/blazorGlobalSrc/editor-manager/base/interface.d.ts +0 -263
- package/blazorGlobalSrc/editor-manager/base/interface.js +0 -4
- package/blazorGlobalSrc/editor-manager/base/types.d.ts +0 -7
- package/blazorGlobalSrc/editor-manager/base/types.js +0 -4
- package/blazorGlobalSrc/editor-manager/base.d.ts +0 -8
- package/blazorGlobalSrc/editor-manager/base.js +0 -10
- package/blazorGlobalSrc/editor-manager/index.d.ts +0 -5
- package/blazorGlobalSrc/editor-manager/index.js +0 -9
- package/blazorGlobalSrc/editor-manager/plugin/alignments.d.ts +0 -26
- package/blazorGlobalSrc/editor-manager/plugin/alignments.js +0 -105
- package/blazorGlobalSrc/editor-manager/plugin/audio.d.ts +0 -34
- package/blazorGlobalSrc/editor-manager/plugin/audio.js +0 -145
- package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.d.ts +0 -24
- package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.js +0 -47
- package/blazorGlobalSrc/editor-manager/plugin/clearformat.d.ts +0 -29
- package/blazorGlobalSrc/editor-manager/plugin/clearformat.js +0 -249
- package/blazorGlobalSrc/editor-manager/plugin/dom-node.d.ts +0 -351
- package/blazorGlobalSrc/editor-manager/plugin/dom-node.js +0 -737
- package/blazorGlobalSrc/editor-manager/plugin/dom-tree.d.ts +0 -84
- package/blazorGlobalSrc/editor-manager/plugin/dom-tree.js +0 -164
- package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.d.ts +0 -10
- package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.js +0 -86
- package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.d.ts +0 -47
- package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.js +0 -622
- package/blazorGlobalSrc/editor-manager/plugin/formats.d.ts +0 -43
- package/blazorGlobalSrc/editor-manager/plugin/formats.js +0 -597
- package/blazorGlobalSrc/editor-manager/plugin/image.d.ts +0 -48
- package/blazorGlobalSrc/editor-manager/plugin/image.js +0 -399
- package/blazorGlobalSrc/editor-manager/plugin/indents.d.ts +0 -24
- package/blazorGlobalSrc/editor-manager/plugin/indents.js +0 -106
- package/blazorGlobalSrc/editor-manager/plugin/insert-methods.d.ts +0 -48
- package/blazorGlobalSrc/editor-manager/plugin/insert-methods.js +0 -37
- package/blazorGlobalSrc/editor-manager/plugin/insert-text.d.ts +0 -22
- package/blazorGlobalSrc/editor-manager/plugin/insert-text.js +0 -36
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.d.ts +0 -22
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.js +0 -49
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml.d.ts +0 -51
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml.js +0 -985
- package/blazorGlobalSrc/editor-manager/plugin/isformatted.d.ts +0 -89
- package/blazorGlobalSrc/editor-manager/plugin/isformatted.js +0 -199
- package/blazorGlobalSrc/editor-manager/plugin/link.d.ts +0 -41
- package/blazorGlobalSrc/editor-manager/plugin/link.js +0 -550
- package/blazorGlobalSrc/editor-manager/plugin/lists.d.ts +0 -74
- package/blazorGlobalSrc/editor-manager/plugin/lists.js +0 -1503
- package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.d.ts +0 -61
- package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.js +0 -1136
- package/blazorGlobalSrc/editor-manager/plugin/nodecutter.d.ts +0 -64
- package/blazorGlobalSrc/editor-manager/plugin/nodecutter.js +0 -167
- package/blazorGlobalSrc/editor-manager/plugin/selection-commands.d.ts +0 -41
- package/blazorGlobalSrc/editor-manager/plugin/selection-commands.js +0 -1069
- package/blazorGlobalSrc/editor-manager/plugin/selection-exec.d.ts +0 -24
- package/blazorGlobalSrc/editor-manager/plugin/selection-exec.js +0 -49
- package/blazorGlobalSrc/editor-manager/plugin/table-selection.d.ts +0 -26
- package/blazorGlobalSrc/editor-manager/plugin/table-selection.js +0 -210
- package/blazorGlobalSrc/editor-manager/plugin/table.d.ts +0 -56
- package/blazorGlobalSrc/editor-manager/plugin/table.js +0 -1100
- package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.d.ts +0 -39
- package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.js +0 -384
- package/blazorGlobalSrc/editor-manager/plugin/undo.d.ts +0 -85
- package/blazorGlobalSrc/editor-manager/plugin/undo.js +0 -216
- package/blazorGlobalSrc/editor-manager/plugin/video.d.ts +0 -38
- package/blazorGlobalSrc/editor-manager/plugin/video.js +0 -311
- package/blazorGlobalSrc/editor-manager/plugin.d.ts +0 -27
- package/blazorGlobalSrc/editor-manager/plugin.js +0 -31
- package/blazorGlobalSrc/global.d.ts +0 -1
- package/blazorGlobalSrc/global.js +0 -3
- package/blazorGlobalSrc/index.d.ts +0 -8
- package/blazorGlobalSrc/index.js +0 -12
- package/blazorGlobalSrc/markdown-parser/base/constant.d.ts +0 -39
- package/blazorGlobalSrc/markdown-parser/base/constant.js +0 -10
- package/blazorGlobalSrc/markdown-parser/base/interface.d.ts +0 -169
- package/blazorGlobalSrc/markdown-parser/base/interface.js +0 -4
- package/blazorGlobalSrc/markdown-parser/base/markdown-parser.d.ts +0 -69
- package/blazorGlobalSrc/markdown-parser/base/markdown-parser.js +0 -87
- package/blazorGlobalSrc/markdown-parser/base/types.d.ts +0 -7
- package/blazorGlobalSrc/markdown-parser/base/types.js +0 -4
- package/blazorGlobalSrc/markdown-parser/base.d.ts +0 -7
- package/blazorGlobalSrc/markdown-parser/base.js +0 -9
- package/blazorGlobalSrc/markdown-parser/index.d.ts +0 -5
- package/blazorGlobalSrc/markdown-parser/index.js +0 -9
- package/blazorGlobalSrc/markdown-parser/plugin/clearformat.d.ts +0 -28
- package/blazorGlobalSrc/markdown-parser/plugin/clearformat.js +0 -110
- package/blazorGlobalSrc/markdown-parser/plugin/formats.d.ts +0 -32
- package/blazorGlobalSrc/markdown-parser/plugin/formats.js +0 -225
- package/blazorGlobalSrc/markdown-parser/plugin/insert-text.d.ts +0 -24
- package/blazorGlobalSrc/markdown-parser/plugin/insert-text.js +0 -49
- package/blazorGlobalSrc/markdown-parser/plugin/link.d.ts +0 -24
- package/blazorGlobalSrc/markdown-parser/plugin/link.js +0 -50
- package/blazorGlobalSrc/markdown-parser/plugin/lists.d.ts +0 -39
- package/blazorGlobalSrc/markdown-parser/plugin/lists.js +0 -462
- package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.d.ts +0 -140
- package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.js +0 -104
- package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.d.ts +0 -31
- package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.js +0 -335
- package/blazorGlobalSrc/markdown-parser/plugin/table.d.ts +0 -52
- package/blazorGlobalSrc/markdown-parser/plugin/table.js +0 -216
- package/blazorGlobalSrc/markdown-parser/plugin/undo.d.ts +0 -83
- package/blazorGlobalSrc/markdown-parser/plugin/undo.js +0 -147
- package/blazorGlobalSrc/markdown-parser/plugin.d.ts +0 -11
- package/blazorGlobalSrc/markdown-parser/plugin.js +0 -15
- package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.d.ts +0 -114
- package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.js +0 -465
- package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.d.ts +0 -58
- package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.js +0 -216
- package/blazorGlobalSrc/rich-text-editor/actions/color-picker.d.ts +0 -52
- package/blazorGlobalSrc/rich-text-editor/actions/color-picker.js +0 -241
- package/blazorGlobalSrc/rich-text-editor/actions/count.d.ts +0 -55
- package/blazorGlobalSrc/rich-text-editor/actions/count.js +0 -117
- package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.d.ts +0 -72
- package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.js +0 -552
- package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.d.ts +0 -51
- package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.js +0 -853
- package/blazorGlobalSrc/rich-text-editor/actions/enter-key.d.ts +0 -28
- package/blazorGlobalSrc/rich-text-editor/actions/enter-key.js +0 -821
- package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.d.ts +0 -11
- package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.js +0 -28
- package/blazorGlobalSrc/rich-text-editor/actions/file-manager.d.ts +0 -45
- package/blazorGlobalSrc/rich-text-editor/actions/file-manager.js +0 -249
- package/blazorGlobalSrc/rich-text-editor/actions/format-painter.d.ts +0 -25
- package/blazorGlobalSrc/rich-text-editor/actions/format-painter.js +0 -156
- package/blazorGlobalSrc/rich-text-editor/actions/full-screen.d.ts +0 -40
- package/blazorGlobalSrc/rich-text-editor/actions/full-screen.js +0 -148
- package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.d.ts +0 -15
- package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.js +0 -50
- package/blazorGlobalSrc/rich-text-editor/actions/html-editor.d.ts +0 -120
- package/blazorGlobalSrc/rich-text-editor/actions/html-editor.js +0 -1244
- package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.d.ts +0 -14
- package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.js +0 -47
- package/blazorGlobalSrc/rich-text-editor/actions/import-export.d.ts +0 -21
- package/blazorGlobalSrc/rich-text-editor/actions/import-export.js +0 -117
- package/blazorGlobalSrc/rich-text-editor/actions/keyboard-model.d.ts +0 -30
- package/blazorGlobalSrc/rich-text-editor/actions/keyboard.d.ts +0 -110
- package/blazorGlobalSrc/rich-text-editor/actions/keyboard.js +0 -163
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.d.ts +0 -66
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.js +0 -142
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.d.ts +0 -23
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.js +0 -124
- package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.d.ts +0 -86
- package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.js +0 -1071
- package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.d.ts +0 -151
- package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.js +0 -548
- package/blazorGlobalSrc/rich-text-editor/actions/resize.d.ts +0 -37
- package/blazorGlobalSrc/rich-text-editor/actions/resize.js +0 -188
- package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.d.ts +0 -11
- package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.js +0 -168
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.d.ts +0 -18
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.js +0 -76
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar.d.ts +0 -185
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar.js +0 -512
- package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.d.ts +0 -25
- package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.js +0 -166
- package/blazorGlobalSrc/rich-text-editor/actions.d.ts +0 -26
- package/blazorGlobalSrc/rich-text-editor/actions.js +0 -30
- package/blazorGlobalSrc/rich-text-editor/audio.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor/audio.js +0 -8
- package/blazorGlobalSrc/rich-text-editor/base/classes.d.ts +0 -628
- package/blazorGlobalSrc/rich-text-editor/base/classes.js +0 -129
- package/blazorGlobalSrc/rich-text-editor/base/constant.d.ts +0 -808
- package/blazorGlobalSrc/rich-text-editor/base/constant.js +0 -334
- package/blazorGlobalSrc/rich-text-editor/base/enum.d.ts +0 -81
- package/blazorGlobalSrc/rich-text-editor/base/enum.js +0 -37
- package/blazorGlobalSrc/rich-text-editor/base/interface.d.ts +0 -1577
- package/blazorGlobalSrc/rich-text-editor/base/interface.js +0 -194
- package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor-model.d.ts +0 -1032
- package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.d.ts +0 -1699
- package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.js +0 -2645
- package/blazorGlobalSrc/rich-text-editor/base/util.d.ts +0 -212
- package/blazorGlobalSrc/rich-text-editor/base/util.js +0 -610
- package/blazorGlobalSrc/rich-text-editor/base.d.ts +0 -10
- package/blazorGlobalSrc/rich-text-editor/base.js +0 -13
- package/blazorGlobalSrc/rich-text-editor/formatter/formatter.d.ts +0 -87
- package/blazorGlobalSrc/rich-text-editor/formatter/formatter.js +0 -223
- package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.d.ts +0 -34
- package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.js +0 -44
- package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.d.ts +0 -39
- package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.js +0 -48
- package/blazorGlobalSrc/rich-text-editor/formatter.d.ts +0 -6
- package/blazorGlobalSrc/rich-text-editor/formatter.js +0 -10
- package/blazorGlobalSrc/rich-text-editor/html-editor.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor/html-editor.js +0 -8
- package/blazorGlobalSrc/rich-text-editor/image.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor/image.js +0 -8
- package/blazorGlobalSrc/rich-text-editor/index.d.ts +0 -9
- package/blazorGlobalSrc/rich-text-editor/index.js +0 -12
- package/blazorGlobalSrc/rich-text-editor/link.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor/link.js +0 -8
- package/blazorGlobalSrc/rich-text-editor/markdown-editor.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor/markdown-editor.js +0 -8
- package/blazorGlobalSrc/rich-text-editor/models/default-locale.d.ts +0 -25
- package/blazorGlobalSrc/rich-text-editor/models/default-locale.js +0 -391
- package/blazorGlobalSrc/rich-text-editor/models/iframe-settings-model.d.ts +0 -68
- package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.d.ts +0 -61
- package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.js +0 -60
- package/blazorGlobalSrc/rich-text-editor/models/inline-mode-model.d.ts +0 -24
- package/blazorGlobalSrc/rich-text-editor/models/inline-mode.d.ts +0 -20
- package/blazorGlobalSrc/rich-text-editor/models/inline-mode.js +0 -37
- package/blazorGlobalSrc/rich-text-editor/models/items.d.ts +0 -36
- package/blazorGlobalSrc/rich-text-editor/models/items.js +0 -1011
- package/blazorGlobalSrc/rich-text-editor/models/models.d.ts +0 -7
- package/blazorGlobalSrc/rich-text-editor/models/models.js +0 -4
- package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings-model.d.ts +0 -40
- package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.d.ts +0 -50
- package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.js +0 -143
- package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings-model.d.ts +0 -1130
- package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.d.ts +0 -992
- package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.js +0 -510
- package/blazorGlobalSrc/rich-text-editor/models.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor/models.js +0 -4
- package/blazorGlobalSrc/rich-text-editor/quick-toolbar.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor/quick-toolbar.js +0 -8
- package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.d.ts +0 -82
- package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.js +0 -886
- package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.d.ts +0 -65
- package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.js +0 -49
- package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.d.ts +0 -39
- package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.js +0 -111
- package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.d.ts +0 -33
- package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.js +0 -101
- package/blazorGlobalSrc/rich-text-editor/renderer/image-module.d.ts +0 -199
- package/blazorGlobalSrc/rich-text-editor/renderer/image-module.js +0 -2494
- package/blazorGlobalSrc/rich-text-editor/renderer/link-module.d.ts +0 -63
- package/blazorGlobalSrc/rich-text-editor/renderer/link-module.js +0 -596
- package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.d.ts +0 -65
- package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.js +0 -38
- package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.d.ts +0 -54
- package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.js +0 -35
- package/blazorGlobalSrc/rich-text-editor/renderer/render.d.ts +0 -46
- package/blazorGlobalSrc/rich-text-editor/renderer/render.js +0 -70
- package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.d.ts +0 -20
- package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.js +0 -224
- package/blazorGlobalSrc/rich-text-editor/renderer/table-module.d.ts +0 -155
- package/blazorGlobalSrc/rich-text-editor/renderer/table-module.js +0 -2206
- package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -131
- package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.js +0 -747
- package/blazorGlobalSrc/rich-text-editor/renderer/video-module.d.ts +0 -120
- package/blazorGlobalSrc/rich-text-editor/renderer/video-module.js +0 -1507
- package/blazorGlobalSrc/rich-text-editor/renderer/view-source.d.ts +0 -74
- package/blazorGlobalSrc/rich-text-editor/renderer/view-source.js +0 -225
- package/blazorGlobalSrc/rich-text-editor/renderer.d.ts +0 -17
- package/blazorGlobalSrc/rich-text-editor/renderer.js +0 -21
- package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.d.ts +0 -33
- package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.js +0 -29
- package/blazorGlobalSrc/rich-text-editor/services/service-locator.d.ts +0 -29
- package/blazorGlobalSrc/rich-text-editor/services/service-locator.js +0 -25
- package/blazorGlobalSrc/rich-text-editor/services.d.ts +0 -5
- package/blazorGlobalSrc/rich-text-editor/services.js +0 -9
- package/blazorGlobalSrc/rich-text-editor/toolbar.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor/toolbar.js +0 -8
- package/blazorGlobalSrc/rich-text-editor/video.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor/video.js +0 -8
- package/blazorGlobalSrc/rich-text-editor.d.ts +0 -4
- package/blazorGlobalSrc/rich-text-editor.js +0 -8
- package/blazorGlobalSrc/selection/index.d.ts +0 -4
- package/blazorGlobalSrc/selection/index.js +0 -8
- package/blazorGlobalSrc/selection/selection.d.ts +0 -244
- package/blazorGlobalSrc/selection/selection.js +0 -309
- package/helpers/e2e/index.d.ts +0 -1
- package/helpers/e2e/index.js +0 -8
- package/helpers/e2e/rte-helper.d.ts +0 -79
- package/helpers/e2e/rte-helper.js +0 -81
- package/src/global.d.ts +0 -1
- package/tslint.json +0 -111
|
@@ -1,2645 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __assign = (this && this.__assign) || function () {
|
|
15
|
-
__assign = Object.assign || function(t) {
|
|
16
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
-
s = arguments[i];
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
return __assign.apply(this, arguments);
|
|
24
|
-
};
|
|
25
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
26
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
27
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
28
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
29
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
30
|
-
};
|
|
31
|
-
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-popups", "../base/constant", "../base/classes", "../renderer/render", "../renderer/view-source", "./interface", "../services/service-locator", "../services/renderer-factory", "./enum", "../actions/execute-command-callback", "../actions/keyboard", "../models/toolbar-settings", "../models/toolbar-settings", "../models/toolbar-settings", "../models/toolbar-settings", "../models/iframe-settings", "../models/inline-mode", "../models/default-locale", "../actions/html-attributes", "../actions/full-screen", "../actions/enter-key", "../../common/constant", "../base/util", "../../common/util", "../renderer/dialog-renderer", "../models/slash-menu-settings", "../../common/config", "../../common/user-agent", "../base/util", "../../selection/index"], function (require, exports, ej2_base_1, ej2_base_2, ej2_base_3, ej2_base_4, ej2_base_5, ej2_popups_1, events, classes, render_1, view_source_1, interface_1, service_locator_1, renderer_factory_1, enum_1, execute_command_callback_1, keyboard_1, toolbar_settings_1, toolbar_settings_2, toolbar_settings_3, toolbar_settings_4, iframe_settings_1, inline_mode_1, default_locale_1, html_attributes_1, full_screen_1, enter_key_1, CONSTANT, util_1, util_2, dialog_renderer_1, slash_menu_settings_1, config_1, user_agent_1, util_3, index_1) {
|
|
32
|
-
"use strict";
|
|
33
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
var RichTextEditor = (function (_super) {
|
|
35
|
-
__extends(RichTextEditor, _super);
|
|
36
|
-
function RichTextEditor(options, element) {
|
|
37
|
-
var _this = _super.call(this, options, element) || this;
|
|
38
|
-
_this.isPlainPaste = false;
|
|
39
|
-
_this.needsID = true;
|
|
40
|
-
_this.isCopyAll = false;
|
|
41
|
-
return _this;
|
|
42
|
-
}
|
|
43
|
-
RichTextEditor.prototype.requiredModules = function () {
|
|
44
|
-
var modules = [];
|
|
45
|
-
if (this.toolbarSettings.enable) {
|
|
46
|
-
modules.push({ member: 'toolbar', args: [this, this.serviceLocator] });
|
|
47
|
-
modules.push({
|
|
48
|
-
member: 'link',
|
|
49
|
-
args: [this, this.serviceLocator]
|
|
50
|
-
});
|
|
51
|
-
modules.push({
|
|
52
|
-
member: 'table',
|
|
53
|
-
args: [this, this.serviceLocator]
|
|
54
|
-
});
|
|
55
|
-
modules.push({
|
|
56
|
-
member: 'image',
|
|
57
|
-
args: [this, this.serviceLocator]
|
|
58
|
-
});
|
|
59
|
-
modules.push({
|
|
60
|
-
member: 'audio',
|
|
61
|
-
args: [this, this.serviceLocator]
|
|
62
|
-
});
|
|
63
|
-
modules.push({
|
|
64
|
-
member: 'video',
|
|
65
|
-
args: [this, this.serviceLocator]
|
|
66
|
-
});
|
|
67
|
-
if (this.quickToolbarSettings.enable) {
|
|
68
|
-
modules.push({ member: 'quickToolbar', args: [this, this.serviceLocator] });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (this.editorMode === 'HTML' && this.slashMenuSettings.enable) {
|
|
72
|
-
modules.push({ member: 'slashMenu', args: [this, this.serviceLocator] });
|
|
73
|
-
}
|
|
74
|
-
if (this.showCharCount) {
|
|
75
|
-
modules.push({ member: 'count', args: [this, this.serviceLocator] });
|
|
76
|
-
}
|
|
77
|
-
if (this.editorMode === 'Markdown') {
|
|
78
|
-
modules.push({ member: 'markdownEditor', args: [this, this.serviceLocator] });
|
|
79
|
-
}
|
|
80
|
-
if (this.editorMode === 'HTML') {
|
|
81
|
-
modules.push({ member: 'htmlEditor', args: [this, this.serviceLocator] });
|
|
82
|
-
modules.push({ member: 'pasteCleanup', args: [this, this.serviceLocator] });
|
|
83
|
-
modules.push({ member: 'importExport', args: [this, this.serviceLocator] });
|
|
84
|
-
modules.push({
|
|
85
|
-
member: 'formatPainter',
|
|
86
|
-
args: [this]
|
|
87
|
-
});
|
|
88
|
-
modules.push({
|
|
89
|
-
member: 'emojiPicker',
|
|
90
|
-
args: [this, this.serviceLocator]
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
if (this.fileManagerSettings.enable) {
|
|
94
|
-
modules.push({ member: 'fileManager', args: [this, this.serviceLocator] });
|
|
95
|
-
}
|
|
96
|
-
if (this.enableResize) {
|
|
97
|
-
modules.push({ member: 'resize', args: [this] });
|
|
98
|
-
}
|
|
99
|
-
return modules;
|
|
100
|
-
};
|
|
101
|
-
RichTextEditor.prototype.updateEnable = function () {
|
|
102
|
-
if (this.enabled) {
|
|
103
|
-
ej2_base_3.removeClass([this.element], classes.CLS_DISABLED);
|
|
104
|
-
this.element.setAttribute('aria-disabled', 'false');
|
|
105
|
-
if (!ej2_base_4.isNullOrUndefined(this.htmlAttributes.tabindex)) {
|
|
106
|
-
this.inputElement.setAttribute('tabindex', this.htmlAttributes.tabindex);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
this.inputElement.setAttribute('tabindex', '0');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
if (this.getToolbar()) {
|
|
114
|
-
ej2_base_3.removeClass(this.getToolbar().querySelectorAll('.' + classes.CLS_ACTIVE), classes.CLS_ACTIVE);
|
|
115
|
-
ej2_base_3.removeClass([this.getToolbar().parentElement], [classes.CLS_TB_FLOAT]);
|
|
116
|
-
}
|
|
117
|
-
ej2_base_1.addClass([this.element], classes.CLS_DISABLED);
|
|
118
|
-
this.element.tabIndex = -1;
|
|
119
|
-
this.element.setAttribute('aria-disabled', 'true');
|
|
120
|
-
this.inputElement.setAttribute('tabindex', '-1');
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
RichTextEditor.prototype.setEnable = function () {
|
|
124
|
-
this.updateEnable();
|
|
125
|
-
(this.enabled) ? this.eventInitializer() : this.unWireEvents();
|
|
126
|
-
};
|
|
127
|
-
RichTextEditor.prototype.initializeValue = function () {
|
|
128
|
-
this.isFocusOut = false;
|
|
129
|
-
this.isRTE = false;
|
|
130
|
-
this.isBlur = true;
|
|
131
|
-
this.defaultResetValue = null;
|
|
132
|
-
this.isResizeInitialized = false;
|
|
133
|
-
};
|
|
134
|
-
RichTextEditor.prototype.preRender = function () {
|
|
135
|
-
this.initializeValue();
|
|
136
|
-
this.clickPoints = { clientX: 0, clientY: 0 };
|
|
137
|
-
this.initialValue = this.value;
|
|
138
|
-
this.serviceLocator = new service_locator_1.ServiceLocator;
|
|
139
|
-
this.initializeServices();
|
|
140
|
-
this.setContainer();
|
|
141
|
-
this.persistData();
|
|
142
|
-
ej2_base_3.setStyleAttribute(this.element, { 'width': ej2_base_2.formatUnit(this.width) });
|
|
143
|
-
ej2_base_3.attributes(this.element, { role: 'application', 'aria-label': 'Rich Text Editor' });
|
|
144
|
-
this.beforeRenderClassValue = this.element.getAttribute('class');
|
|
145
|
-
};
|
|
146
|
-
RichTextEditor.prototype.persistData = function () {
|
|
147
|
-
if (this.enablePersistence && this.originalElement.tagName === 'TEXTAREA') {
|
|
148
|
-
this.element.id = this.originalElement.id + '_wrapper';
|
|
149
|
-
var data = window.localStorage.getItem(this.getModuleName() + this.element.id);
|
|
150
|
-
if (!(ej2_base_4.isNullOrUndefined(data) || (data === ''))) {
|
|
151
|
-
this.setProperties(JSON.parse(data), true);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
RichTextEditor.prototype.setContainer = function () {
|
|
156
|
-
this.originalElement = this.element.cloneNode(true);
|
|
157
|
-
if (this.value === null || this.valueTemplate !== null) {
|
|
158
|
-
this.setValue();
|
|
159
|
-
}
|
|
160
|
-
if (this.element.hasAttribute('tabindex')) {
|
|
161
|
-
this.htmlAttributes = { 'tabindex': this.element.getAttribute('tabindex') };
|
|
162
|
-
this.element.removeAttribute('tabindex');
|
|
163
|
-
}
|
|
164
|
-
this.element.innerHTML = '';
|
|
165
|
-
var invalidAttr = ['class', 'style', 'id', 'ejs-for'];
|
|
166
|
-
var htmlAttr = {};
|
|
167
|
-
for (var a = 0; a < this.element.attributes.length; a++) {
|
|
168
|
-
if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&
|
|
169
|
-
!(/^data-val/.test(this.element.attributes[a].name))) {
|
|
170
|
-
htmlAttr[this.element.attributes[a].name] = this.element.getAttribute(this.element.attributes[a].name);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
ej2_base_4.extend(htmlAttr, this.htmlAttributes, htmlAttr);
|
|
174
|
-
this.setProperties({ htmlAttributes: htmlAttr }, true);
|
|
175
|
-
if (!ej2_base_4.isNullOrUndefined(this.htmlAttributes.id)) {
|
|
176
|
-
this.element.id = this.htmlAttributes.id;
|
|
177
|
-
}
|
|
178
|
-
this.internalID = this.element.id;
|
|
179
|
-
if (this.element.tagName === 'TEXTAREA') {
|
|
180
|
-
var rteOuterWrapper = this.createElement('div', {
|
|
181
|
-
className: this.element.getAttribute('class')
|
|
182
|
-
});
|
|
183
|
-
this.element.innerHTML = '';
|
|
184
|
-
this.element.parentElement.insertBefore(rteOuterWrapper, this.element);
|
|
185
|
-
this.valueContainer = this.element;
|
|
186
|
-
ej2_base_3.removeClass([this.valueContainer], this.element.getAttribute('class').split(' '));
|
|
187
|
-
this.element = rteOuterWrapper;
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
this.valueContainer = this.createElement('textarea', {
|
|
191
|
-
id: this.getID() + '-value',
|
|
192
|
-
attrs: { 'aria-labelledby': this.getID() }
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
this.valueContainer.name = this.getID();
|
|
196
|
-
ej2_base_1.addClass([this.valueContainer], classes.CLS_RTE_HIDDEN);
|
|
197
|
-
if (!ej2_base_4.isNullOrUndefined(this.cssClass)) {
|
|
198
|
-
var currentClassList = this.cssClass.split(' ');
|
|
199
|
-
for (var i = 0; i < currentClassList.length; i++) {
|
|
200
|
-
ej2_base_1.addClass([this.valueContainer], currentClassList[i]);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
this.rootContainer = this.createElement('div', { className: classes.CLS_RTE_CONTAINER, attrs: { 'role': 'presentation' } });
|
|
204
|
-
this.element.appendChild(this.rootContainer);
|
|
205
|
-
this.rootContainer.appendChild(this.valueContainer);
|
|
206
|
-
};
|
|
207
|
-
RichTextEditor.prototype.getPersistData = function () {
|
|
208
|
-
return this.addOnPersist(['value']);
|
|
209
|
-
};
|
|
210
|
-
RichTextEditor.prototype.focusIn = function () {
|
|
211
|
-
if (this.enabled) {
|
|
212
|
-
this.inputElement.focus();
|
|
213
|
-
this.focusHandler({});
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
RichTextEditor.prototype.focusOut = function () {
|
|
217
|
-
if (this.enabled) {
|
|
218
|
-
this.inputElement.blur();
|
|
219
|
-
this.blurHandler({});
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
RichTextEditor.prototype.selectAll = function () {
|
|
223
|
-
this.notify(events.selectAll, {});
|
|
224
|
-
};
|
|
225
|
-
RichTextEditor.prototype.selectRange = function (range) {
|
|
226
|
-
this.notify(events.selectRange, { range: range });
|
|
227
|
-
};
|
|
228
|
-
RichTextEditor.prototype.getSelection = function () {
|
|
229
|
-
var str = '';
|
|
230
|
-
this.notify(events.getSelectedHtml, {
|
|
231
|
-
callBack: function (txt) {
|
|
232
|
-
str = txt;
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
return str;
|
|
236
|
-
};
|
|
237
|
-
RichTextEditor.prototype.showEmojiPicker = function (x, y) {
|
|
238
|
-
if (this.readonly) {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
this.notify(events.emojiPicker, { x: x, y: y });
|
|
242
|
-
};
|
|
243
|
-
RichTextEditor.prototype.executeCommand = function (commandName, value, option) {
|
|
244
|
-
if (commandName === 'importWord') {
|
|
245
|
-
var importContainer = this.createElement('div');
|
|
246
|
-
importContainer.innerHTML = value;
|
|
247
|
-
var tableElement = importContainer.querySelectorAll('table:not(.e-rte-table):not(.e-rte-paste-table)');
|
|
248
|
-
for (var i = 0; i < tableElement.length; i++) {
|
|
249
|
-
tableElement[i].classList.add('e-rte-paste-table');
|
|
250
|
-
}
|
|
251
|
-
value = importContainer.innerHTML;
|
|
252
|
-
importContainer.remove();
|
|
253
|
-
commandName = 'insertHTML';
|
|
254
|
-
}
|
|
255
|
-
value = this.htmlPurifier(commandName, value);
|
|
256
|
-
var internalValue;
|
|
257
|
-
if (this.editorMode === 'HTML') {
|
|
258
|
-
var range = this.getRange();
|
|
259
|
-
if (this.iframeSettings.enable) {
|
|
260
|
-
this.formatter.editorManager.nodeSelection.Clear(this.element.ownerDocument);
|
|
261
|
-
}
|
|
262
|
-
var toFocus = (this.iframeSettings.enable &&
|
|
263
|
-
range.startContainer === this.inputElement) ? true : !this.inputElement.contains(range.startContainer);
|
|
264
|
-
if (toFocus) {
|
|
265
|
-
this.focusIn();
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
var tool = interface_1.executeGroup["" + commandName];
|
|
269
|
-
if (option && option.undo) {
|
|
270
|
-
if (option.undo && this.formatter.getUndoRedoStack().length === 0) {
|
|
271
|
-
this.formatter.saveData();
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
if (this.maxLength !== -1 && !ej2_base_4.isNullOrUndefined(tool.command)) {
|
|
275
|
-
var currentInsertContentLength = 0;
|
|
276
|
-
if (tool.command === 'Links') {
|
|
277
|
-
currentInsertContentLength = value.text.length === 0 ?
|
|
278
|
-
value.url.length : value.text.length;
|
|
279
|
-
}
|
|
280
|
-
if (tool.command === 'Images' || tool.command === 'Table' || tool.command === 'Files') {
|
|
281
|
-
currentInsertContentLength = 1;
|
|
282
|
-
}
|
|
283
|
-
if (tool.command === 'InsertHTML') {
|
|
284
|
-
if (!ej2_base_4.isNullOrUndefined(value)) {
|
|
285
|
-
var tempElem = this.createElement('div');
|
|
286
|
-
tempElem.innerHTML = value;
|
|
287
|
-
currentInsertContentLength = tempElem.textContent.length;
|
|
288
|
-
}
|
|
289
|
-
else if (!ej2_base_4.isNullOrUndefined(tool.value) && (tool.value === '<hr/>' || tool.value === '<br/>')) {
|
|
290
|
-
currentInsertContentLength = 1;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
if (tool.command === 'InsertText') {
|
|
294
|
-
currentInsertContentLength = value.length;
|
|
295
|
-
}
|
|
296
|
-
var currentLength = this.getText().trim().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, '').length;
|
|
297
|
-
var selectionLength = this.getSelection().length;
|
|
298
|
-
var totalLength = (currentLength - selectionLength) + currentInsertContentLength;
|
|
299
|
-
if (!(this.maxLength === -1 || totalLength <= this.maxLength)) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
internalValue = value;
|
|
304
|
-
if (tool.command === 'FormatPainter') {
|
|
305
|
-
if (!ej2_base_4.isNullOrUndefined(value)) {
|
|
306
|
-
this.formatPainterSettings = value;
|
|
307
|
-
}
|
|
308
|
-
internalValue = {
|
|
309
|
-
formatPainterAction: tool.value
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
this.formatter.editorManager.execCommand(tool.command, tool.subCommand ? tool.subCommand : (internalValue ? internalValue : tool.value), null, null, (internalValue ? internalValue : tool.value), (internalValue ? internalValue : (tool.value === 'UL' || tool.value === 'OL') ? null : tool.value), null, this.enterKey);
|
|
313
|
-
util_2.scrollToCursor(this.contentModule.getDocument(), this.inputElement);
|
|
314
|
-
if (option && option.undo) {
|
|
315
|
-
this.formatter.saveData();
|
|
316
|
-
this.formatter.enableUndo(this);
|
|
317
|
-
}
|
|
318
|
-
this.setPlaceHolder();
|
|
319
|
-
this.notify(events.contentChanged, {});
|
|
320
|
-
};
|
|
321
|
-
RichTextEditor.prototype.htmlPurifier = function (command, value) {
|
|
322
|
-
if (this.editorMode === 'HTML') {
|
|
323
|
-
switch (command) {
|
|
324
|
-
case 'insertHTML':
|
|
325
|
-
if (this.enableHtmlSanitizer) {
|
|
326
|
-
if (typeof value === 'string') {
|
|
327
|
-
value = value.replace(/&(times|divide|ne)/g, '&amp;$1');
|
|
328
|
-
value = this.htmlEditorModule.sanitizeHelper(value);
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
331
|
-
value = this.htmlEditorModule.sanitizeHelper(value.outerHTML);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
break;
|
|
335
|
-
case 'insertTable':
|
|
336
|
-
if (ej2_base_4.isNullOrUndefined(value.width)) {
|
|
337
|
-
value.width = { minWidth: this.tableSettings.minWidth,
|
|
338
|
-
maxWidth: this.tableSettings.maxWidth, width: this.tableSettings.width };
|
|
339
|
-
}
|
|
340
|
-
break;
|
|
341
|
-
case 'insertImage': {
|
|
342
|
-
var temp = this.createElement('img', {
|
|
343
|
-
attrs: {
|
|
344
|
-
src: value.url
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
var imageValue = temp.outerHTML;
|
|
348
|
-
if (this.enableHtmlSanitizer) {
|
|
349
|
-
imageValue = this.htmlEditorModule.sanitizeHelper(temp.outerHTML);
|
|
350
|
-
}
|
|
351
|
-
var url = (imageValue !== '' && (this.createElement('div', {
|
|
352
|
-
innerHTML: imageValue
|
|
353
|
-
}).firstElementChild).getAttribute('src')) || null;
|
|
354
|
-
url = !ej2_base_4.isNullOrUndefined(url) ? url : '';
|
|
355
|
-
value.url = url;
|
|
356
|
-
if (ej2_base_4.isNullOrUndefined(value.width)) {
|
|
357
|
-
value.width = { minWidth: this.insertImageSettings.minWidth,
|
|
358
|
-
maxWidth: this.insertImageSettings.maxWidth, width: this.insertImageSettings.width };
|
|
359
|
-
}
|
|
360
|
-
if (ej2_base_4.isNullOrUndefined(value.height)) {
|
|
361
|
-
value.height = { minHeight: this.insertImageSettings.minHeight,
|
|
362
|
-
maxHeight: this.insertImageSettings.maxHeight, height: this.insertImageSettings.height };
|
|
363
|
-
}
|
|
364
|
-
break;
|
|
365
|
-
}
|
|
366
|
-
case 'insertAudio': {
|
|
367
|
-
var wrapTemp = this.createElement('audio', {
|
|
368
|
-
attrs: {
|
|
369
|
-
controls: ''
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
var temp = this.createElement('source', {
|
|
373
|
-
attrs: {
|
|
374
|
-
src: value.url,
|
|
375
|
-
type: value.url && value.url.split('.').length > 0
|
|
376
|
-
? 'audio/' + value.url.split('.')[value.url.split('.').length - 1] : ''
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
wrapTemp.appendChild(temp);
|
|
380
|
-
var audioValue = wrapTemp.outerHTML;
|
|
381
|
-
if (this.enableHtmlSanitizer) {
|
|
382
|
-
audioValue = this.htmlEditorModule.sanitizeHelper(wrapTemp.outerHTML);
|
|
383
|
-
}
|
|
384
|
-
var url = (audioValue !== '' && (this.createElement('div', {
|
|
385
|
-
innerHTML: audioValue
|
|
386
|
-
}).firstElementChild.firstElementChild).getAttribute('src')) || null;
|
|
387
|
-
url = !ej2_base_4.isNullOrUndefined(url) ? url : '';
|
|
388
|
-
value.url = url;
|
|
389
|
-
break;
|
|
390
|
-
}
|
|
391
|
-
case 'insertVideo': {
|
|
392
|
-
var wrapTemp = this.createElement('video', {
|
|
393
|
-
attrs: {
|
|
394
|
-
controls: ''
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
var temp = this.createElement('source', {
|
|
398
|
-
attrs: {
|
|
399
|
-
src: value.url,
|
|
400
|
-
type: value.url && value.url.split('.').length > 0
|
|
401
|
-
? 'video/' + value.url.split('.')[value.url.split('.').length - 1] : ''
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
wrapTemp.appendChild(temp);
|
|
405
|
-
var audioValue = wrapTemp.outerHTML;
|
|
406
|
-
if (this.enableHtmlSanitizer) {
|
|
407
|
-
audioValue = this.htmlEditorModule.sanitizeHelper(temp.outerHTML);
|
|
408
|
-
}
|
|
409
|
-
var url = (audioValue !== '' && (this.createElement('div', {
|
|
410
|
-
innerHTML: audioValue
|
|
411
|
-
}).firstElementChild).getAttribute('src')) || null;
|
|
412
|
-
url = !ej2_base_4.isNullOrUndefined(url) ? url : '';
|
|
413
|
-
value.url = url;
|
|
414
|
-
if (ej2_base_4.isNullOrUndefined(value.width)) {
|
|
415
|
-
value.width = { minWidth: this.insertVideoSettings.minWidth,
|
|
416
|
-
maxWidth: this.insertVideoSettings.maxWidth, width: this.insertVideoSettings.width };
|
|
417
|
-
}
|
|
418
|
-
if (ej2_base_4.isNullOrUndefined(value.height)) {
|
|
419
|
-
value.height = { minHeight: this.insertVideoSettings.minHeight,
|
|
420
|
-
maxHeight: this.insertVideoSettings.maxHeight, height: this.insertVideoSettings.height };
|
|
421
|
-
}
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
424
|
-
case 'createLink': {
|
|
425
|
-
var tempNode = this.createElement('a', {
|
|
426
|
-
attrs: {
|
|
427
|
-
href: value.url
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
var linkValue = tempNode.outerHTML;
|
|
431
|
-
if (this.enableHtmlSanitizer) {
|
|
432
|
-
linkValue = this.htmlEditorModule.sanitizeHelper(tempNode.outerHTML);
|
|
433
|
-
}
|
|
434
|
-
var href = (linkValue !== '' && (this.createElement('div', {
|
|
435
|
-
innerHTML: linkValue
|
|
436
|
-
}).firstElementChild).getAttribute('href')) || null;
|
|
437
|
-
href = !ej2_base_4.isNullOrUndefined(href) ? href : '';
|
|
438
|
-
value.url = href;
|
|
439
|
-
break;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
return value;
|
|
444
|
-
};
|
|
445
|
-
RichTextEditor.prototype.encode = function (value) {
|
|
446
|
-
var divNode = this.createElement('div');
|
|
447
|
-
divNode.innerText = value.trim();
|
|
448
|
-
return divNode.innerHTML.replace(/<br\s*[\/]?>/gi, '\n');
|
|
449
|
-
};
|
|
450
|
-
RichTextEditor.prototype.render = function () {
|
|
451
|
-
this.setProperties({ value: this.replaceEntities(this.value) }, true);
|
|
452
|
-
if (this.value && !this.valueTemplate) {
|
|
453
|
-
this.setProperties({ value: this.serializeValue(this.value) }, true);
|
|
454
|
-
}
|
|
455
|
-
this.value = (!(this.editorMode === 'Markdown') && !ej2_base_4.isNullOrUndefined(this.value)) ? this.addAnchorAriaLabel(this.value) : this.value;
|
|
456
|
-
this.renderModule = new render_1.Render(this, this.serviceLocator);
|
|
457
|
-
this.sourceCodeModule = new view_source_1.ViewSource(this, this.serviceLocator);
|
|
458
|
-
this.notify(events.initialLoad, {});
|
|
459
|
-
this.trigger(events.load);
|
|
460
|
-
this.RTERender();
|
|
461
|
-
var execCommandCallBack = new execute_command_callback_1.ExecCommandCallBack(this);
|
|
462
|
-
if (this.element.dataset.rteUnitTesting === 'true') {
|
|
463
|
-
this.userAgentData = new user_agent_1.CustomUserAgentData(ej2_base_1.Browser.userAgent, true);
|
|
464
|
-
}
|
|
465
|
-
else {
|
|
466
|
-
this.userAgentData = new user_agent_1.CustomUserAgentData(ej2_base_1.Browser.userAgent, false);
|
|
467
|
-
}
|
|
468
|
-
this.notify(events.initialEnd, {});
|
|
469
|
-
if (this.enableXhtml) {
|
|
470
|
-
this.setProperties({ value: this.getXhtml() }, true);
|
|
471
|
-
}
|
|
472
|
-
if (this.toolbarSettings.enable && (this.toolbarSettings.type === 'Expand' || this.toolbarSettings.type === 'MultiRow' || this.toolbarSettings.type === 'Scrollable') && !ej2_base_4.isNullOrUndefined(this.getToolbar()) &&
|
|
473
|
-
(this.toolbarSettings.items.indexOf('Undo') > -1 && this.toolbarSettings.items.indexOf('Redo') > -1)) {
|
|
474
|
-
this.disableToolbarItem(['Undo', 'Redo']);
|
|
475
|
-
}
|
|
476
|
-
if (this.value !== null) {
|
|
477
|
-
this.valueContainer.defaultValue = this.value;
|
|
478
|
-
}
|
|
479
|
-
(this.enabled && !this.readonly) ? this.eventInitializer() : this.unWireEvents();
|
|
480
|
-
this.notify(events.bindCssClass, { cssClass: this.getCssClass() });
|
|
481
|
-
this.addAudioVideoWrapper();
|
|
482
|
-
this.notify(events.tableclass, {});
|
|
483
|
-
this.autoResize();
|
|
484
|
-
this.renderComplete();
|
|
485
|
-
};
|
|
486
|
-
RichTextEditor.prototype.addAudioVideoWrapper = function () {
|
|
487
|
-
var _this = this;
|
|
488
|
-
var insertElem;
|
|
489
|
-
var audioElm = this.element.querySelectorAll('audio');
|
|
490
|
-
for (var i = 0; i < audioElm.length; i++) {
|
|
491
|
-
if (!audioElm[i].classList.contains('e-rte-audio')) {
|
|
492
|
-
audioElm[i].classList.add('e-rte-audio');
|
|
493
|
-
audioElm[i].classList.add(classes.CLS_AUDIOINLINE);
|
|
494
|
-
}
|
|
495
|
-
if (!audioElm[i].parentElement.classList.contains(classes.CLS_CLICKELEM) && !audioElm[i].parentElement.classList.contains(classes.CLS_AUDIOWRAP)) {
|
|
496
|
-
var audioWrapElem = this.createElement('span', { className: classes.CLS_AUDIOWRAP });
|
|
497
|
-
var csstext = 'width:300px; margin:0 auto;';
|
|
498
|
-
ej2_base_1.updateCSSText(audioWrapElem, csstext);
|
|
499
|
-
audioWrapElem.contentEditable = 'false';
|
|
500
|
-
var audioInnerWrapElem = this.createElement('span', { className: classes.CLS_CLICKELEM });
|
|
501
|
-
audioWrapElem.appendChild(audioInnerWrapElem);
|
|
502
|
-
audioElm[i].parentNode.insertBefore(audioWrapElem, audioElm[i].nextSibling);
|
|
503
|
-
audioInnerWrapElem.appendChild(audioElm[i]);
|
|
504
|
-
if (audioWrapElem.nextElementSibling === null) {
|
|
505
|
-
insertElem = this.createElement('br');
|
|
506
|
-
audioWrapElem.parentNode.insertBefore(insertElem, audioWrapElem.nextSibling);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
var videoElm = this.element.querySelectorAll('video');
|
|
511
|
-
for (var i = 0; i < videoElm.length; i++) {
|
|
512
|
-
if (!videoElm[i].classList.contains('e-rte-video')) {
|
|
513
|
-
videoElm[i].classList.add('e-rte-video');
|
|
514
|
-
videoElm[i].classList.add(classes.CLS_VIDEOINLINE);
|
|
515
|
-
}
|
|
516
|
-
if (!videoElm[i].parentElement.classList.contains(classes.CLS_CLICKELEM) && !videoElm[i].parentElement.classList.contains(classes.CLS_VIDEOWRAP)) {
|
|
517
|
-
var videoWrapElem = this.createElement('span', { className: classes.CLS_VIDEOWRAP });
|
|
518
|
-
videoWrapElem.contentEditable = 'false';
|
|
519
|
-
videoElm[i].parentNode.insertBefore(videoWrapElem, videoElm[i].nextSibling);
|
|
520
|
-
videoWrapElem.appendChild(videoElm[i]);
|
|
521
|
-
if (videoWrapElem.nextElementSibling === null) {
|
|
522
|
-
insertElem = this.createElement('br');
|
|
523
|
-
videoWrapElem.parentNode.insertBefore(insertElem, videoWrapElem.nextSibling);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
if (ej2_base_1.Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
527
|
-
videoElm[i].addEventListener('play', function (args) {
|
|
528
|
-
_this.notify(events.mouseDown, { args: args });
|
|
529
|
-
_this.notify('editAreaClick', { args: args });
|
|
530
|
-
});
|
|
531
|
-
videoElm[i].addEventListener('pause', function (args) {
|
|
532
|
-
_this.notify(events.mouseDown, { args: args });
|
|
533
|
-
_this.notify('editAreaClick', { args: args });
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
};
|
|
538
|
-
RichTextEditor.prototype.eventInitializer = function () {
|
|
539
|
-
this.wireEvents();
|
|
540
|
-
};
|
|
541
|
-
RichTextEditor.prototype.cleanList = function (e) {
|
|
542
|
-
var range = this.getRange();
|
|
543
|
-
var currentStartContainer = range.startContainer;
|
|
544
|
-
var currentEndContainer = range.endContainer;
|
|
545
|
-
var currentStartOffset = range.startOffset;
|
|
546
|
-
var isSameContainer = currentStartContainer === currentEndContainer ? true : false;
|
|
547
|
-
var currentEndOffset = currentEndContainer.textContent.length;
|
|
548
|
-
var endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
|
|
549
|
-
range.endContainer;
|
|
550
|
-
var closestLI = ej2_base_2.closest(endNode, 'LI');
|
|
551
|
-
var isDetached = false;
|
|
552
|
-
var currentRangeEndOffset = range.endOffset;
|
|
553
|
-
if (currentEndContainer.nodeType === Node.TEXT_NODE) {
|
|
554
|
-
if (currentEndContainer.textContent.charAt(currentRangeEndOffset - 1) === '\uFEFF') {
|
|
555
|
-
currentRangeEndOffset--;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
if (!ej2_base_4.isNullOrUndefined(closestLI) && endNode.textContent.trim().length === currentRangeEndOffset &&
|
|
559
|
-
!range.collapsed && ej2_base_4.isNullOrUndefined(endNode.nextElementSibling) && !endNode.classList.contains(classes.CLS_IMG_INNER)) {
|
|
560
|
-
for (var i = 0; i < closestLI.childNodes.length; i++) {
|
|
561
|
-
if (closestLI.childNodes[i].nodeName === '#text' && closestLI.childNodes[i].textContent.trim().length === 0) {
|
|
562
|
-
ej2_base_1.detach(closestLI.childNodes[i]);
|
|
563
|
-
isDetached = true;
|
|
564
|
-
i--;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
var currentLastElem = closestLI;
|
|
568
|
-
while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
|
|
569
|
-
currentLastElem = currentLastElem.lastChild;
|
|
570
|
-
}
|
|
571
|
-
if (isDetached) {
|
|
572
|
-
var currentLast = currentLastElem.nodeName === 'BR' && !ej2_base_4.isNullOrUndefined(currentLastElem.previousSibling) ?
|
|
573
|
-
currentLastElem.previousSibling : currentLastElem;
|
|
574
|
-
this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? currentLast : currentStartContainer, currentLast, currentStartOffset, (currentLast.nodeName === 'BR' ? 0 : currentLast.textContent.length));
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
RichTextEditor.prototype.keyDown = function (e) {
|
|
579
|
-
var isMacDev = this.userAgentData.getPlatform() === 'macOS';
|
|
580
|
-
if (((e.ctrlKey || (e.metaKey && isMacDev)) && e.shiftKey && e.keyCode === 86) ||
|
|
581
|
-
(e.metaKey && isMacDev && e.altKey && e.shiftKey && e.keyCode === 86)) {
|
|
582
|
-
this.isPlainPaste = true;
|
|
583
|
-
}
|
|
584
|
-
if (this.inputElement.classList.contains('e-mention')) {
|
|
585
|
-
var mentionPopup = this.element.ownerDocument.getElementById(this.inputElement.id + '_popup');
|
|
586
|
-
var slashMenuPopup = this.element.ownerDocument.getElementById(this.inputElement.id + '_slash_menu_popup');
|
|
587
|
-
var mentionKeys = config_1.mentionRestrictKeys;
|
|
588
|
-
var isMentionKeys = mentionKeys.indexOf(e.key) !== -1;
|
|
589
|
-
var isMentionPopupOpen = mentionPopup && mentionPopup.classList.contains('e-popup-open');
|
|
590
|
-
var isSlashMenuPopupOpen = slashMenuPopup && slashMenuPopup.classList.contains('e-popup-open');
|
|
591
|
-
if (isMentionKeys && (isMentionPopupOpen || isSlashMenuPopupOpen)) {
|
|
592
|
-
return;
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
if (this.enableTabKey) {
|
|
596
|
-
if (this.quickToolbarModule && !e.altKey && e.key !== 'F10' && e.action !== 'toolbar-focus') {
|
|
597
|
-
this.quickToolbarModule.hideQuickToolbars();
|
|
598
|
-
}
|
|
599
|
-
var isImageResize = this.imageModule && this.imageModule.imgResizeDiv ? true : false;
|
|
600
|
-
var isVideoResize = this.videoModule && this.videoModule.vidResizeDiv ? true : false;
|
|
601
|
-
if (isImageResize) {
|
|
602
|
-
this.imageModule.cancelResizeAction();
|
|
603
|
-
}
|
|
604
|
-
if (isVideoResize) {
|
|
605
|
-
this.videoModule.cancelResizeAction();
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
this.notify(events.keyDown, { member: 'keydown', args: e });
|
|
609
|
-
this.restrict(e);
|
|
610
|
-
if (this.editorMode === 'HTML') {
|
|
611
|
-
this.cleanList(e);
|
|
612
|
-
}
|
|
613
|
-
if (this.editorMode === 'HTML' && ((e.which === 8 && e.code === 'Backspace') || (e.which === 46 && e.code === 'Delete'))) {
|
|
614
|
-
var range = this.getRange();
|
|
615
|
-
var startNode = range.startContainer.nodeName === '#text' ? range.startContainer.parentElement :
|
|
616
|
-
range.startContainer;
|
|
617
|
-
if (ej2_base_2.closest(startNode, 'pre') &&
|
|
618
|
-
(e.which === 8 && range.startContainer.textContent.charCodeAt(range.startOffset - 1) === 8203) ||
|
|
619
|
-
(e.which === 46 && range.startContainer.textContent.charCodeAt(range.startOffset) === 8203)) {
|
|
620
|
-
var regEx = new RegExp('\u200B', 'g');
|
|
621
|
-
var pointer = e.which === 8 ? range.startOffset - 1 : range.startOffset;
|
|
622
|
-
range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
|
|
623
|
-
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), range.startContainer, pointer);
|
|
624
|
-
}
|
|
625
|
-
else if ((e.code === 'Backspace' && e.which === 8) &&
|
|
626
|
-
range.startContainer.textContent.charCodeAt(0) === 8203 && range.collapsed) {
|
|
627
|
-
var parentEle = range.startContainer.parentElement;
|
|
628
|
-
var index = void 0;
|
|
629
|
-
var i = void 0;
|
|
630
|
-
for (i = 0; i < parentEle.childNodes.length; i++) {
|
|
631
|
-
if (parentEle.childNodes[i] === range.startContainer) {
|
|
632
|
-
index = i;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
var bool = true;
|
|
636
|
-
var removeNodeArray = [];
|
|
637
|
-
for (i = index; i >= 0; i--) {
|
|
638
|
-
if (parentEle.childNodes[i].nodeType === 3 && parentEle.childNodes[i].textContent.charCodeAt(0) === 8203 && bool) {
|
|
639
|
-
removeNodeArray.push(i);
|
|
640
|
-
}
|
|
641
|
-
else {
|
|
642
|
-
bool = false;
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
if (removeNodeArray.length > 0) {
|
|
646
|
-
for (i = removeNodeArray.length - 1; i > 0; i--) {
|
|
647
|
-
parentEle.childNodes[removeNodeArray[i]].textContent = '';
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), range.startContainer, range.startOffset);
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
var notFormatPainterCopy = ej2_base_4.isNullOrUndefined(e.action) ? true : (e.action !== 'format-copy' ? true : false);
|
|
654
|
-
if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy &&
|
|
655
|
-
!(e.altKey || (e.shiftKey && e.which === 16) || (e.altKey && e.shiftKey && e.which === 67))) {
|
|
656
|
-
this.formatter.saveData();
|
|
657
|
-
}
|
|
658
|
-
var preventingMention = false;
|
|
659
|
-
if (this.editorMode === 'HTML') {
|
|
660
|
-
var range = this.getRange();
|
|
661
|
-
preventingMention = !ej2_base_4.isNullOrUndefined(range.startContainer) && range.startContainer === range.endContainer && range.endContainer.childNodes.length > 1 && !ej2_base_4.isNullOrUndefined(range.startContainer.childNodes[range.startOffset - 1]) && range.startContainer.childNodes[range.startOffset - 1].nodeName === '#text' && !ej2_base_4.isNullOrUndefined(range.startContainer.childNodes[range.startOffset - 1].previousSibling) && range.startContainer.childNodes[range.startOffset - 1].textContent.charCodeAt(0) === 32 && range.startContainer.childNodes[range.startOffset - 1].previousSibling.classList.contains('e-mention-chip');
|
|
662
|
-
}
|
|
663
|
-
var keyboardEventAction = ['insert-link', 'format-copy', 'format-paste', 'insert-image', 'insert-table', 'insert-audio', 'insert-video'];
|
|
664
|
-
if (keyboardEventAction.indexOf(e.action) === -1 &&
|
|
665
|
-
(!e.target || !(e.target.classList.contains('e-mention') && !ej2_base_4.isNullOrUndefined(document.querySelector('#' + e.target.id + '_popup.e-popup-open')) && e.code === 'Tab')) &&
|
|
666
|
-
(e.action && e.action !== 'paste' && e.action !== 'space'
|
|
667
|
-
|| e.which === 9 || (e.code === 'Backspace' && e.which === 8)) && !preventingMention) {
|
|
668
|
-
var FormatPainterEscapeAction = false;
|
|
669
|
-
if (!ej2_base_4.isNullOrUndefined(this.formatPainterModule)) {
|
|
670
|
-
FormatPainterEscapeAction = this.formatPainterModule.previousAction === 'escape';
|
|
671
|
-
}
|
|
672
|
-
if (!FormatPainterEscapeAction) {
|
|
673
|
-
if (this.editorMode === 'HTML' && (e.action === 'increase-fontsize' || e.action === 'decrease-fontsize')) {
|
|
674
|
-
this.notify(events.onHandleFontsizeChange, { member: 'onHandleFontsizeChange', args: e });
|
|
675
|
-
}
|
|
676
|
-
else {
|
|
677
|
-
this.formatter.process(this, null, e);
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
switch (e.action) {
|
|
681
|
-
case 'toolbar-focus':
|
|
682
|
-
if (this.toolbarSettings.enable && this.getToolbarElement()) {
|
|
683
|
-
if (this.userAgentData.isSafari() && e.type === 'keydown' && this.formatter.editorManager.nodeSelection &&
|
|
684
|
-
this.formatter.editorManager.nodeSelection.get(this.contentModule.getDocument()).rangeCount > 0 &&
|
|
685
|
-
this.inputElement.contains(this.getRange().startContainer)) {
|
|
686
|
-
this.notify(events.selectionSave, {});
|
|
687
|
-
}
|
|
688
|
-
var toolbarFocusType = 'toolbar';
|
|
689
|
-
var firstActiveItem = this.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
|
|
690
|
-
var quickToolbarElem = this.getRenderedQuickToolbarElem();
|
|
691
|
-
if (quickToolbarElem) {
|
|
692
|
-
firstActiveItem = quickToolbarElem.querySelector('.e-toolbar-item:not(.e-overlay)[title]');
|
|
693
|
-
toolbarFocusType = 'quickToolbar';
|
|
694
|
-
}
|
|
695
|
-
if (firstActiveItem) {
|
|
696
|
-
var firstChild = firstActiveItem.firstElementChild;
|
|
697
|
-
firstChild.removeAttribute('tabindex');
|
|
698
|
-
firstChild.focus();
|
|
699
|
-
if (this.userAgentData.isSafari() && (toolbarFocusType === 'toolbar' || toolbarFocusType === 'quickToolbar')) {
|
|
700
|
-
this.inputElement.ownerDocument.getSelection().removeAllRanges();
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
break;
|
|
705
|
-
case 'escape':
|
|
706
|
-
this.contentModule.getEditPanel().focus();
|
|
707
|
-
break;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
this.notify(events.afterKeyDown, { member: 'afterKeyDown', args: e });
|
|
711
|
-
this.autoResize();
|
|
712
|
-
if (!ej2_base_4.isNullOrUndefined(this.placeholder)) {
|
|
713
|
-
this.setPlaceHolder();
|
|
714
|
-
}
|
|
715
|
-
if (!ej2_base_4.isNullOrUndefined(e) && !ej2_base_4.isNullOrUndefined(e.code) && (e.code === 'Backspace' || e.code === 'Delete')) {
|
|
716
|
-
var range = this.contentModule.getDocument().getSelection().getRangeAt(0);
|
|
717
|
-
var div = document.createElement('div');
|
|
718
|
-
div.appendChild(range.cloneContents());
|
|
719
|
-
var selectedHTML = div.innerHTML;
|
|
720
|
-
if (selectedHTML === this.inputElement.innerHTML) {
|
|
721
|
-
this.isCopyAll = true;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
if (e.metaKey && e.key === 'Backspace' && this.autoSaveOnIdle) {
|
|
725
|
-
this.keyUp(e);
|
|
726
|
-
}
|
|
727
|
-
};
|
|
728
|
-
RichTextEditor.prototype.keyUp = function (e) {
|
|
729
|
-
if (this.editorMode === 'HTML') {
|
|
730
|
-
var range = this.getRange();
|
|
731
|
-
if (!ej2_base_4.isNullOrUndefined(e) && !ej2_base_4.isNullOrUndefined(e.code) && (e.code === 'Backspace' || e.code === 'Delete')) {
|
|
732
|
-
var currentRange = this.getRange();
|
|
733
|
-
var selection = this.iframeSettings.enable ? this.contentModule.getPanel().ownerDocument.getSelection() :
|
|
734
|
-
this.contentModule.getDocument().getSelection();
|
|
735
|
-
if (this.isCopyAll) {
|
|
736
|
-
var brElement = this.createElement('br');
|
|
737
|
-
var newElement = this.enterKey === 'BR' ? brElement : this.createElement(this.enterKey).appendChild(brElement).parentElement;
|
|
738
|
-
this.inputElement.innerHTML = '';
|
|
739
|
-
this.inputElement.appendChild(newElement);
|
|
740
|
-
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), brElement, 0);
|
|
741
|
-
this.isCopyAll = false;
|
|
742
|
-
}
|
|
743
|
-
if (selection.rangeCount > 0 && this.contentModule.getDocument().activeElement.tagName !== 'INPUT' && this.inputElement.contains(this.contentModule.getDocument().activeElement) && range.startContainer.innerHTML === '<br>' && range.startContainer.textContent === '') {
|
|
744
|
-
selection.removeAllRanges();
|
|
745
|
-
selection.addRange(currentRange);
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
if (ej2_base_1.Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer.nodeName === '#text' &&
|
|
749
|
-
range.startContainer.parentElement === this.inputElement && this.enterKey !== 'BR') {
|
|
750
|
-
var range_1 = this.getRange();
|
|
751
|
-
var tempElem = this.createElement(this.enterKey);
|
|
752
|
-
range_1.startContainer.parentElement.insertBefore(tempElem, range_1.startContainer);
|
|
753
|
-
tempElem.appendChild(range_1.startContainer);
|
|
754
|
-
this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), tempElem.childNodes[0], tempElem.childNodes[0], tempElem.childNodes[0].textContent.length, tempElem.childNodes[0].textContent.length);
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
var currentStackIndex = this.formatter.getCurrentStackIndex();
|
|
758
|
-
if (currentStackIndex === 0) {
|
|
759
|
-
this.updateUndoRedoStack(e);
|
|
760
|
-
}
|
|
761
|
-
this.notify(events.keyUp, { member: 'keyup', args: e });
|
|
762
|
-
this.notify(events.tableModulekeyUp, { member: 'tableModulekeyUp', args: e });
|
|
763
|
-
if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
|
|
764
|
-
this.inputElement.innerHTML === '<br>')) {
|
|
765
|
-
this.inputElement.innerHTML = util_3.resetContentEditableElements(util_1.getEditValue(util_1.getDefaultValue(this), this), this.editorMode);
|
|
766
|
-
}
|
|
767
|
-
var isMention = this.inputElement.classList.contains('e-mention');
|
|
768
|
-
var allowedKeys = e.which === 32 || e.which === 13 || e.which === 8 || e.which === 46 || e.which === 9 && isMention;
|
|
769
|
-
var formatPainterCopy = e.key === 'C' && e.altKey && e.shiftKey;
|
|
770
|
-
var formatPainterPaste = e.key === 'V' && e.altKey && e.shiftKey;
|
|
771
|
-
if ((!formatPainterCopy && !formatPainterPaste) && ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
|
|
772
|
-
&& ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys)) || (this.autoSaveOnIdle && ej2_base_1.Browser.isDevice) && !this.inlineMode.enable) {
|
|
773
|
-
this.formatter.onKeyHandler(this, e);
|
|
774
|
-
}
|
|
775
|
-
if (this.inputElement && this.inputElement.textContent.length !== 0
|
|
776
|
-
|| this.element.querySelectorAll('.e-toolbar-item.e-active').length > 0 || this.formatter.getUndoRedoStack().length > 0) {
|
|
777
|
-
this.notify(events.toolbarRefresh, { args: e });
|
|
778
|
-
}
|
|
779
|
-
this.setPlaceHolder();
|
|
780
|
-
};
|
|
781
|
-
RichTextEditor.prototype.serializeValue = function (value) {
|
|
782
|
-
if (this.editorMode === 'HTML' && !ej2_base_4.isNullOrUndefined(value)) {
|
|
783
|
-
if (this.enableHtmlEncode) {
|
|
784
|
-
value = this.htmlEditorModule.sanitizeHelper(util_1.decode(value));
|
|
785
|
-
value = this.encode(value);
|
|
786
|
-
}
|
|
787
|
-
else {
|
|
788
|
-
value = this.htmlEditorModule.sanitizeHelper(value);
|
|
789
|
-
value = this.enableXhtml ? this.htmlEditorModule.xhtmlValidation.selfEncloseValidation(value) : value;
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
return value;
|
|
793
|
-
};
|
|
794
|
-
RichTextEditor.prototype.sanitizeHtml = function (value) {
|
|
795
|
-
return this.serializeValue(value);
|
|
796
|
-
};
|
|
797
|
-
RichTextEditor.prototype.updateValue = function (value) {
|
|
798
|
-
if (ej2_base_4.isNullOrUndefined(value)) {
|
|
799
|
-
var inputVal = this.inputElement.innerHTML;
|
|
800
|
-
this.setProperties({ value: util_1.isEditableValueEmpty(inputVal) ? null : inputVal });
|
|
801
|
-
}
|
|
802
|
-
else {
|
|
803
|
-
this.setProperties({ value: value });
|
|
804
|
-
}
|
|
805
|
-
};
|
|
806
|
-
RichTextEditor.prototype.triggerEditArea = function (e) {
|
|
807
|
-
if (!util_1.isIDevice()) {
|
|
808
|
-
this.notify(events.editAreaClick, { member: 'editAreaClick', args: e });
|
|
809
|
-
}
|
|
810
|
-
else {
|
|
811
|
-
var touch = (e.touches ? e.changedTouches[0] : e);
|
|
812
|
-
if (this.clickPoints.clientX === touch.clientX && this.clickPoints.clientY === touch.clientY) {
|
|
813
|
-
this.notify(events.editAreaClick, { member: 'editAreaClick', args: e });
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
};
|
|
817
|
-
RichTextEditor.prototype.notifyMouseUp = function (e) {
|
|
818
|
-
var touch = (e.touches ? e.changedTouches[0] : e);
|
|
819
|
-
this.notify(events.mouseUp, { member: 'mouseUp', args: e,
|
|
820
|
-
touchData: { prevClientX: this.clickPoints.clientX, prevClientY: this.clickPoints.clientY,
|
|
821
|
-
clientX: touch.clientX, clientY: touch.clientY }
|
|
822
|
-
});
|
|
823
|
-
if (this.inputElement && ((this.editorMode === 'HTML' && ((this.inputElement.textContent.length !== 0) || e.target && !ej2_base_4.isNullOrUndefined(e.target.querySelector('li')))) ||
|
|
824
|
-
(this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) ||
|
|
825
|
-
(e.target && !ej2_base_4.isNullOrUndefined(ej2_base_2.closest(e.target, 'table'))) ||
|
|
826
|
-
(e.target && !ej2_base_4.isNullOrUndefined(e.target.querySelector('img'))) ||
|
|
827
|
-
(e.target && (e.target.nodeName === 'VIDEO' ||
|
|
828
|
-
e.target.querySelectorAll('.' + classes.CLS_VIDEOWRAP).length > 0) ||
|
|
829
|
-
(e.target && e.target.nodeName !== 'BR' &&
|
|
830
|
-
(e.target.classList.contains(classes.CLS_AUDIOWRAP) ||
|
|
831
|
-
e.target.classList.contains(classes.CLS_CLICKELEM) ||
|
|
832
|
-
e.target.classList.contains(classes.CLS_VID_CLICK_ELEM))))) {
|
|
833
|
-
this.notify(events.toolbarRefresh, { args: e });
|
|
834
|
-
}
|
|
835
|
-
this.triggerEditArea(e);
|
|
836
|
-
};
|
|
837
|
-
RichTextEditor.prototype.updateUndoRedoStack = function (e) {
|
|
838
|
-
var undoRedoStack = this.formatter.getUndoRedoStack();
|
|
839
|
-
var currentStackIndex = this.formatter.getCurrentStackIndex();
|
|
840
|
-
var navigationKeys = [
|
|
841
|
-
'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown',
|
|
842
|
-
'Home', 'End', 'PageUp', 'PageDown'
|
|
843
|
-
];
|
|
844
|
-
var isNavKey = navigationKeys.indexOf(e.key) !== -1;
|
|
845
|
-
var isNavigationKey = e.type === 'keyup' ? isNavKey : true;
|
|
846
|
-
if (undoRedoStack.length === 0 || currentStackIndex === 0) {
|
|
847
|
-
if (undoRedoStack.length === 0) {
|
|
848
|
-
this.formatter.saveData();
|
|
849
|
-
}
|
|
850
|
-
else if (currentStackIndex === 0 && this.editorMode === 'HTML' && isNavigationKey) {
|
|
851
|
-
var firstStackState = undoRedoStack[0];
|
|
852
|
-
var save = new index_1.NodeSelection(this.inputElement)
|
|
853
|
-
.save(this.getRange(), this.contentModule.getDocument());
|
|
854
|
-
firstStackState.range = save;
|
|
855
|
-
}
|
|
856
|
-
else if (currentStackIndex === 0 && this.editorMode === 'Markdown' && isNavigationKey) {
|
|
857
|
-
var markdownFirstStackState = undoRedoStack[0];
|
|
858
|
-
var start = this.inputElement.selectionStart;
|
|
859
|
-
var end = this.inputElement.selectionEnd;
|
|
860
|
-
markdownFirstStackState.start = start;
|
|
861
|
-
markdownFirstStackState.end = end;
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
};
|
|
865
|
-
RichTextEditor.prototype.mouseUp = function (e) {
|
|
866
|
-
if (this.quickToolbarSettings.showOnRightClick && ej2_base_1.Browser.isDevice) {
|
|
867
|
-
var target = e.target;
|
|
868
|
-
var closestTable = ej2_base_2.closest(target, 'table');
|
|
869
|
-
if (target && target.nodeName === 'A' || target.nodeName === 'IMG' || (target.nodeName === 'TD' || target.nodeName === 'TH' ||
|
|
870
|
-
target.nodeName === 'TABLE' || (closestTable && this.contentModule.getEditPanel().contains(closestTable)))) {
|
|
871
|
-
return;
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
this.notifyMouseUp(e);
|
|
875
|
-
this.setPlaceHolder();
|
|
876
|
-
this.autoResize();
|
|
877
|
-
this.updateUndoRedoStack(e);
|
|
878
|
-
};
|
|
879
|
-
RichTextEditor.prototype.ensureModuleInjected = function (module) {
|
|
880
|
-
return this.getInjectedModules().indexOf(module) >= 0;
|
|
881
|
-
};
|
|
882
|
-
RichTextEditor.prototype.onCopy = function () {
|
|
883
|
-
this.contentModule.getDocument().execCommand('copy', false, null);
|
|
884
|
-
};
|
|
885
|
-
RichTextEditor.prototype.onCut = function () {
|
|
886
|
-
this.contentModule.getDocument().execCommand('cut', false, null);
|
|
887
|
-
};
|
|
888
|
-
RichTextEditor.prototype.onPaste = function (e) {
|
|
889
|
-
var _this = this;
|
|
890
|
-
var evenArgs = {
|
|
891
|
-
originalEvent: e,
|
|
892
|
-
cancel: false,
|
|
893
|
-
requestType: 'Paste'
|
|
894
|
-
};
|
|
895
|
-
this.isPlainPaste = e && e.clipboardData && e.clipboardData.items && e.clipboardData.items.length
|
|
896
|
-
&& e.clipboardData.items.length === 1 && e.clipboardData.items[0].type === 'text/plain';
|
|
897
|
-
this.trigger(events.actionBegin, evenArgs, function (pasteArgs) {
|
|
898
|
-
var currentLength = _this.getText().replace(/\u200B/g, '').replace(_this.editorMode === 'HTML' ? /(\r\n|\n|\r|\t)/gm : '', '').length;
|
|
899
|
-
var selectionLength = _this.getSelection().length;
|
|
900
|
-
var pastedContentLength = (ej2_base_4.isNullOrUndefined(e) || ej2_base_4.isNullOrUndefined(e.clipboardData))
|
|
901
|
-
? 0 : e.clipboardData.getData('text/plain').replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, '').length;
|
|
902
|
-
var totalLength = (currentLength - selectionLength) + pastedContentLength;
|
|
903
|
-
if (_this.editorMode === 'Markdown') {
|
|
904
|
-
var args_1 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
905
|
-
setTimeout(function () {
|
|
906
|
-
_this.formatter.onSuccess(_this, args_1);
|
|
907
|
-
}, 0);
|
|
908
|
-
if (!(_this.maxLength === -1 || totalLength <= _this.maxLength)) {
|
|
909
|
-
e.preventDefault();
|
|
910
|
-
}
|
|
911
|
-
return;
|
|
912
|
-
}
|
|
913
|
-
if (!pasteArgs.cancel && _this.inputElement.contentEditable === 'true' &&
|
|
914
|
-
(_this.maxLength === -1 || totalLength <= _this.maxLength)) {
|
|
915
|
-
var isImageDialogOpen = _this.contentModule.getDocument().querySelector('.e-rte-img-dialog');
|
|
916
|
-
if (!ej2_base_4.isNullOrUndefined(_this.pasteCleanupModule)) {
|
|
917
|
-
if (ej2_base_4.isNullOrUndefined(isImageDialogOpen)) {
|
|
918
|
-
_this.notify(events.pasteClean, { args: e, isPlainPaste: _this.isPlainPaste });
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
else {
|
|
922
|
-
if (!_this.isPlainPaste) {
|
|
923
|
-
console.warn('[WARNING] :: Module "pasteCleanup" is not available in RichTextEditor component! You either misspelled the module name or forgot to load it.');
|
|
924
|
-
var args_2 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
925
|
-
var value = null;
|
|
926
|
-
var htmlValue = false;
|
|
927
|
-
if (e && !ej2_base_4.isNullOrUndefined(e.clipboardData)) {
|
|
928
|
-
value = e.clipboardData.getData('text/plain');
|
|
929
|
-
htmlValue = e.clipboardData.getData('text/html').indexOf('MsoNormal') > 0;
|
|
930
|
-
}
|
|
931
|
-
var file = e && e.clipboardData && e.clipboardData.items.length > 0 ?
|
|
932
|
-
e.clipboardData.items[0].getAsFile() : null;
|
|
933
|
-
if (value !== null) {
|
|
934
|
-
_this.notify(events.paste, {
|
|
935
|
-
file: file,
|
|
936
|
-
args: e,
|
|
937
|
-
text: value,
|
|
938
|
-
isWordPaste: htmlValue
|
|
939
|
-
});
|
|
940
|
-
}
|
|
941
|
-
setTimeout(function () {
|
|
942
|
-
_this.formatter.onSuccess(_this, args_2);
|
|
943
|
-
}, 0);
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
else {
|
|
948
|
-
e.preventDefault();
|
|
949
|
-
}
|
|
950
|
-
});
|
|
951
|
-
this.isPlainPaste = false;
|
|
952
|
-
};
|
|
953
|
-
RichTextEditor.prototype.clipboardAction = function (action, event) {
|
|
954
|
-
switch (action.toLowerCase()) {
|
|
955
|
-
case 'cut':
|
|
956
|
-
this.onCut();
|
|
957
|
-
this.formatter.onSuccess(this, {
|
|
958
|
-
requestType: 'Cut',
|
|
959
|
-
editorMode: this.editorMode,
|
|
960
|
-
event: event
|
|
961
|
-
});
|
|
962
|
-
break;
|
|
963
|
-
case 'copy':
|
|
964
|
-
this.onCopy();
|
|
965
|
-
this.formatter.onSuccess(this, {
|
|
966
|
-
requestType: 'Copy',
|
|
967
|
-
editorMode: this.editorMode,
|
|
968
|
-
event: event
|
|
969
|
-
});
|
|
970
|
-
break;
|
|
971
|
-
case 'paste':
|
|
972
|
-
this.onPaste(event);
|
|
973
|
-
break;
|
|
974
|
-
}
|
|
975
|
-
};
|
|
976
|
-
RichTextEditor.prototype.destroy = function () {
|
|
977
|
-
if (this.isDestroyed || !this.isRendered) {
|
|
978
|
-
return;
|
|
979
|
-
}
|
|
980
|
-
this.element.className = this.beforeRenderClassValue;
|
|
981
|
-
this.removeHtmlAttributes();
|
|
982
|
-
this.removeAttributes();
|
|
983
|
-
this.beforeRenderClassValue = null;
|
|
984
|
-
if (!ej2_base_4.isNullOrUndefined(this.timeInterval)) {
|
|
985
|
-
clearInterval(this.timeInterval);
|
|
986
|
-
this.timeInterval = null;
|
|
987
|
-
}
|
|
988
|
-
if (!ej2_base_4.isNullOrUndefined(this.autoSaveTimeOut)) {
|
|
989
|
-
clearTimeout(this.autoSaveTimeOut);
|
|
990
|
-
this.autoSaveTimeOut = null;
|
|
991
|
-
}
|
|
992
|
-
if (!ej2_base_4.isNullOrUndefined(this.idleInterval)) {
|
|
993
|
-
clearTimeout(this.idleInterval);
|
|
994
|
-
this.idleInterval = null;
|
|
995
|
-
}
|
|
996
|
-
this.notify(events.destroy, {});
|
|
997
|
-
this.destroyDependentModules();
|
|
998
|
-
this.unWireEvents();
|
|
999
|
-
if (this.originalElement.tagName === 'TEXTAREA') {
|
|
1000
|
-
this.element.parentElement.insertBefore(this.valueContainer, this.element);
|
|
1001
|
-
this.valueContainer.id = this.getID();
|
|
1002
|
-
this.valueContainer.removeAttribute('name');
|
|
1003
|
-
ej2_base_1.detach(this.element);
|
|
1004
|
-
if (this.originalElement.innerHTML.trim() !== '') {
|
|
1005
|
-
this.valueContainer.value = this.originalElement.innerHTML.trim();
|
|
1006
|
-
this.setProperties({ value: (!ej2_base_4.isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
|
|
1007
|
-
}
|
|
1008
|
-
else {
|
|
1009
|
-
this.valueContainer.value = this.valueContainer.defaultValue;
|
|
1010
|
-
}
|
|
1011
|
-
this.element = this.valueContainer;
|
|
1012
|
-
for (var i = 0; i < this.originalElement.classList.length; i++) {
|
|
1013
|
-
ej2_base_1.addClass([this.element], this.originalElement.classList[i]);
|
|
1014
|
-
}
|
|
1015
|
-
if (!ej2_base_4.isNullOrUndefined(this.cssClass)) {
|
|
1016
|
-
var currentClassList = this.cssClass.split(' ');
|
|
1017
|
-
for (var i = 0; i < currentClassList.length; i++) {
|
|
1018
|
-
ej2_base_1.addClass([this.element], currentClassList[i]);
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
ej2_base_3.removeClass([this.element], classes.CLS_RTE_HIDDEN);
|
|
1022
|
-
}
|
|
1023
|
-
else {
|
|
1024
|
-
if (this.originalElement.innerHTML.trim() !== '') {
|
|
1025
|
-
this.element.innerHTML = this.originalElement.innerHTML.trim();
|
|
1026
|
-
this.setProperties({ value: (!ej2_base_4.isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
|
|
1027
|
-
}
|
|
1028
|
-
else {
|
|
1029
|
-
this.element.innerHTML = '';
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
var dialogElement = document.querySelector('.e-dialog.e-rte-elements');
|
|
1033
|
-
if (dialogElement) {
|
|
1034
|
-
ej2_base_1.detach(dialogElement);
|
|
1035
|
-
}
|
|
1036
|
-
if (this.placeholder && this.placeHolderWrapper) {
|
|
1037
|
-
this.placeHolderWrapper = null;
|
|
1038
|
-
}
|
|
1039
|
-
if (!ej2_base_4.isNullOrUndefined(this.cssClass)) {
|
|
1040
|
-
var allClassName = this.cssClass.split(' ');
|
|
1041
|
-
for (var i = 0; i < allClassName.length; i++) {
|
|
1042
|
-
if (allClassName[i].trim() !== '') {
|
|
1043
|
-
ej2_base_3.removeClass([this.element], allClassName[i]);
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
if (this.rootContainer) {
|
|
1048
|
-
this.rootContainer = null;
|
|
1049
|
-
}
|
|
1050
|
-
if (this.valueContainer) {
|
|
1051
|
-
this.valueContainer = null;
|
|
1052
|
-
}
|
|
1053
|
-
if (this.originalElement) {
|
|
1054
|
-
this.originalElement = null;
|
|
1055
|
-
}
|
|
1056
|
-
this.currentTarget = null;
|
|
1057
|
-
this.scrollParentElements = [];
|
|
1058
|
-
this.userAgentData = null;
|
|
1059
|
-
this.isRendered = false;
|
|
1060
|
-
_super.prototype.destroy.call(this);
|
|
1061
|
-
};
|
|
1062
|
-
RichTextEditor.prototype.removeHtmlAttributes = function () {
|
|
1063
|
-
if (this.htmlAttributes) {
|
|
1064
|
-
var keys = Object.keys(this.htmlAttributes);
|
|
1065
|
-
for (var i = 0; i < keys.length && this.element.hasAttribute(keys[i]); i++) {
|
|
1066
|
-
this.element.removeAttribute(keys[i]);
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
};
|
|
1070
|
-
RichTextEditor.prototype.removeAttributes = function () {
|
|
1071
|
-
if (!this.enabled) {
|
|
1072
|
-
ej2_base_3.removeClass([this.element], classes.CLS_DISABLED);
|
|
1073
|
-
}
|
|
1074
|
-
if (this.enableRtl) {
|
|
1075
|
-
ej2_base_3.removeClass([this.element], classes.CLS_RTL);
|
|
1076
|
-
}
|
|
1077
|
-
if (this.readonly) {
|
|
1078
|
-
ej2_base_3.removeClass([this.element], classes.CLS_RTE_READONLY);
|
|
1079
|
-
}
|
|
1080
|
-
if (this.element.style.width !== '' && this.originalElement.style.width === '') {
|
|
1081
|
-
this.element.style.removeProperty('width');
|
|
1082
|
-
}
|
|
1083
|
-
if (this.element.style.height !== '' && this.originalElement.style.height === '') {
|
|
1084
|
-
this.element.style.removeProperty('height');
|
|
1085
|
-
}
|
|
1086
|
-
this.element.removeAttribute('aria-disabled');
|
|
1087
|
-
this.element.removeAttribute('role');
|
|
1088
|
-
this.element.removeAttribute('tabindex');
|
|
1089
|
-
this.element.removeAttribute('aria-label');
|
|
1090
|
-
};
|
|
1091
|
-
RichTextEditor.prototype.destroyDependentModules = function () {
|
|
1092
|
-
this.renderModule.destroy();
|
|
1093
|
-
this.formatter.editorManager.destroy();
|
|
1094
|
-
};
|
|
1095
|
-
RichTextEditor.prototype.getContent = function () {
|
|
1096
|
-
return this.contentModule.getPanel();
|
|
1097
|
-
};
|
|
1098
|
-
RichTextEditor.prototype.getText = function () {
|
|
1099
|
-
return this.contentModule.getText();
|
|
1100
|
-
};
|
|
1101
|
-
RichTextEditor.prototype.getSelectedHtml = function () {
|
|
1102
|
-
var range;
|
|
1103
|
-
var wrapperElm = this.createElement('div');
|
|
1104
|
-
var selection = this.contentModule.getDocument().getSelection();
|
|
1105
|
-
if (selection.rangeCount > 0) {
|
|
1106
|
-
range = selection.getRangeAt(0);
|
|
1107
|
-
var selectedHtml = range.cloneContents();
|
|
1108
|
-
wrapperElm.appendChild(selectedHtml);
|
|
1109
|
-
}
|
|
1110
|
-
return wrapperElm.innerHTML;
|
|
1111
|
-
};
|
|
1112
|
-
RichTextEditor.prototype.showInlineToolbar = function () {
|
|
1113
|
-
if (this.inlineMode.enable) {
|
|
1114
|
-
var currentRange = this.getRange();
|
|
1115
|
-
var targetElm = currentRange.endContainer.nodeName === '#text' ?
|
|
1116
|
-
currentRange.endContainer.parentElement : currentRange.endContainer;
|
|
1117
|
-
var rects = Array.from(currentRange.getClientRects(), function (rect) { return rect; });
|
|
1118
|
-
if (rects.length === 0) {
|
|
1119
|
-
rects = [currentRange.startContainer.getBoundingClientRect()];
|
|
1120
|
-
}
|
|
1121
|
-
if (rects.length > 0) {
|
|
1122
|
-
var x = rects[0].left;
|
|
1123
|
-
var y = rects[0].top;
|
|
1124
|
-
this.quickToolbarModule.showInlineQTBar(x, y, targetElm);
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
};
|
|
1128
|
-
RichTextEditor.prototype.hideInlineToolbar = function () {
|
|
1129
|
-
this.quickToolbarModule.hideInlineQTBar();
|
|
1130
|
-
};
|
|
1131
|
-
RichTextEditor.prototype.getModuleName = function () {
|
|
1132
|
-
return 'richtexteditor';
|
|
1133
|
-
};
|
|
1134
|
-
RichTextEditor.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
1135
|
-
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
1136
|
-
var prop = _a[_i];
|
|
1137
|
-
switch (prop) {
|
|
1138
|
-
case 'enterKey':
|
|
1139
|
-
case 'value': {
|
|
1140
|
-
var nVal = void 0;
|
|
1141
|
-
if (prop === 'enterKey') {
|
|
1142
|
-
if (this.value === null || this.value === '<div><br></div>' || this.value === '<p><br></p>' ||
|
|
1143
|
-
this.value === '<br>') {
|
|
1144
|
-
nVal = null;
|
|
1145
|
-
}
|
|
1146
|
-
else {
|
|
1147
|
-
nVal = this.value;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
else {
|
|
1151
|
-
nVal = newProp[prop];
|
|
1152
|
-
}
|
|
1153
|
-
nVal = this.editorMode === 'HTML' ? this.replaceEntities(nVal) : nVal;
|
|
1154
|
-
nVal = this.serializeValue(nVal);
|
|
1155
|
-
var val = this.editorMode === 'HTML' ? util_1.getEditValue(nVal, this) : nVal;
|
|
1156
|
-
if ((!ej2_base_4.isNullOrUndefined(nVal) && nVal !== '') || prop === 'enterKey') {
|
|
1157
|
-
this.setProperties({ value: ((this.enableHtmlEncode) ? this.encode(util_1.decode(val)) : val) }, true);
|
|
1158
|
-
}
|
|
1159
|
-
this.updatePanelValue();
|
|
1160
|
-
if (this.inputElement) {
|
|
1161
|
-
this.notify(events.tableclass, {});
|
|
1162
|
-
}
|
|
1163
|
-
this.setPlaceHolder();
|
|
1164
|
-
this.notify(events.xhtmlValidation, { module: 'XhtmlValidation', newProp: newProp, oldProp: oldProp });
|
|
1165
|
-
if (this.enableXhtml) {
|
|
1166
|
-
this.setProperties({ value: this.getXhtml() }, true);
|
|
1167
|
-
}
|
|
1168
|
-
if (this.showCharCount) {
|
|
1169
|
-
this.countModule.refresh();
|
|
1170
|
-
}
|
|
1171
|
-
this.addAudioVideoWrapper();
|
|
1172
|
-
break;
|
|
1173
|
-
}
|
|
1174
|
-
case 'valueTemplate':
|
|
1175
|
-
this.setValue(true);
|
|
1176
|
-
if (this.showCharCount) {
|
|
1177
|
-
this.countModule.refresh();
|
|
1178
|
-
}
|
|
1179
|
-
break;
|
|
1180
|
-
case 'width':
|
|
1181
|
-
this.setWidth(newProp[prop]);
|
|
1182
|
-
if (this.toolbarSettings.enable && !this.inlineMode.enable) {
|
|
1183
|
-
this.toolbarModule.refreshToolbarOverflow();
|
|
1184
|
-
this.resizeHandler();
|
|
1185
|
-
}
|
|
1186
|
-
break;
|
|
1187
|
-
case 'height':
|
|
1188
|
-
this.setHeight(newProp[prop]);
|
|
1189
|
-
this.autoResize();
|
|
1190
|
-
break;
|
|
1191
|
-
case 'readonly':
|
|
1192
|
-
this.setReadOnly(false);
|
|
1193
|
-
break;
|
|
1194
|
-
case 'cssClass':
|
|
1195
|
-
this.element.classList.remove(oldProp[prop]);
|
|
1196
|
-
this.setCssClass(newProp[prop]);
|
|
1197
|
-
this.notify(events.bindCssClass, { cssClass: newProp[prop], oldCssClass: oldProp[prop] });
|
|
1198
|
-
break;
|
|
1199
|
-
case 'enabled':
|
|
1200
|
-
this.setEnable();
|
|
1201
|
-
break;
|
|
1202
|
-
case 'enableRtl':
|
|
1203
|
-
this.updateRTL();
|
|
1204
|
-
break;
|
|
1205
|
-
case 'placeholder':
|
|
1206
|
-
this.placeholder = newProp[prop];
|
|
1207
|
-
this.setPlaceHolder();
|
|
1208
|
-
break;
|
|
1209
|
-
case 'htmlAttributes':
|
|
1210
|
-
html_attributes_1.setAttributes(this.htmlAttributes, this, false, false);
|
|
1211
|
-
break;
|
|
1212
|
-
case 'iframeSettings': {
|
|
1213
|
-
var frameSetting = oldProp[prop];
|
|
1214
|
-
if (frameSetting.resources) {
|
|
1215
|
-
var iframe = this.contentModule.getDocument();
|
|
1216
|
-
var header = iframe.querySelector('head');
|
|
1217
|
-
var files = void 0;
|
|
1218
|
-
if (frameSetting.resources.scripts) {
|
|
1219
|
-
files = header.querySelectorAll('.' + classes.CLS_SCRIPT_SHEET);
|
|
1220
|
-
this.removeSheets(files);
|
|
1221
|
-
}
|
|
1222
|
-
if (frameSetting.resources.styles) {
|
|
1223
|
-
files = header.querySelectorAll('.' + classes.CLS_STYLE_SHEET);
|
|
1224
|
-
this.removeSheets(files);
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
this.setIframeSettings();
|
|
1228
|
-
break;
|
|
1229
|
-
}
|
|
1230
|
-
case 'locale':
|
|
1231
|
-
_super.prototype.refresh.call(this);
|
|
1232
|
-
break;
|
|
1233
|
-
case 'inlineMode':
|
|
1234
|
-
this.notify(events.modelChanged, { module: 'quickToolbar', newProp: newProp, oldProp: oldProp });
|
|
1235
|
-
break;
|
|
1236
|
-
case 'toolbarSettings':
|
|
1237
|
-
this.notify(events.modelChanged, { module: 'toolbar', newProp: newProp, oldProp: oldProp });
|
|
1238
|
-
break;
|
|
1239
|
-
case 'maxLength':
|
|
1240
|
-
if (this.showCharCount) {
|
|
1241
|
-
this.countModule.refresh();
|
|
1242
|
-
}
|
|
1243
|
-
break;
|
|
1244
|
-
case 'showCharCount':
|
|
1245
|
-
if (newProp[prop] && this.countModule) {
|
|
1246
|
-
this.countModule.renderCount();
|
|
1247
|
-
}
|
|
1248
|
-
else if (newProp[prop] === false && this.countModule) {
|
|
1249
|
-
this.countModule.destroy();
|
|
1250
|
-
}
|
|
1251
|
-
break;
|
|
1252
|
-
case 'enableHtmlEncode':
|
|
1253
|
-
this.updateValueData();
|
|
1254
|
-
this.updatePanelValue();
|
|
1255
|
-
this.setPlaceHolder();
|
|
1256
|
-
if (this.showCharCount) {
|
|
1257
|
-
this.countModule.refresh();
|
|
1258
|
-
}
|
|
1259
|
-
break;
|
|
1260
|
-
case 'undoRedoSteps':
|
|
1261
|
-
case 'undoRedoTimer':
|
|
1262
|
-
this.formatter.editorManager.observer.notify(CONSTANT.MODEL_CHANGED, { newProp: newProp, oldProp: oldProp });
|
|
1263
|
-
break;
|
|
1264
|
-
case 'enableXhtml':
|
|
1265
|
-
this.notify(events.xhtmlValidation, { module: 'XhtmlValidation', newProp: newProp, oldProp: oldProp });
|
|
1266
|
-
break;
|
|
1267
|
-
case 'quickToolbarSettings':
|
|
1268
|
-
newProp.quickToolbarSettings.showOnRightClick ? this.wireContextEvent() : this.unWireContextEvent();
|
|
1269
|
-
this.notify(events.modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
1270
|
-
break;
|
|
1271
|
-
case 'formatPainterSettings':
|
|
1272
|
-
this.formatter.editorManager.observer.notify(CONSTANT.MODEL_CHANGED, { module: 'formatPainter', newProp: newProp });
|
|
1273
|
-
break;
|
|
1274
|
-
default:
|
|
1275
|
-
this.notify(events.modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
1276
|
-
break;
|
|
1277
|
-
}
|
|
1278
|
-
this.autoResize();
|
|
1279
|
-
}
|
|
1280
|
-
};
|
|
1281
|
-
RichTextEditor.prototype.updateValueData = function () {
|
|
1282
|
-
if (this.enableHtmlEncode) {
|
|
1283
|
-
this.setProperties({ value: this.encode(util_1.decode(this.inputElement.innerHTML)) }, true);
|
|
1284
|
-
}
|
|
1285
|
-
else {
|
|
1286
|
-
this.setProperties({
|
|
1287
|
-
value: /<[a-z][\s\S]*>/i.test(this.inputElement.innerHTML) ? this.inputElement.innerHTML :
|
|
1288
|
-
util_1.decode(this.inputElement.innerHTML)
|
|
1289
|
-
});
|
|
1290
|
-
}
|
|
1291
|
-
};
|
|
1292
|
-
RichTextEditor.prototype.removeSheets = function (srcList) {
|
|
1293
|
-
var i;
|
|
1294
|
-
for (i = 0; i < srcList.length; i++) {
|
|
1295
|
-
ej2_base_1.detach(srcList[i]);
|
|
1296
|
-
}
|
|
1297
|
-
};
|
|
1298
|
-
RichTextEditor.prototype.replaceEntities = function (value) {
|
|
1299
|
-
var _this = this;
|
|
1300
|
-
if (this.editorMode !== 'HTML' || ej2_base_4.isNullOrUndefined(value) || !/&(amp;)*((times)|(divide)|(ne))/.test(value)) {
|
|
1301
|
-
return value;
|
|
1302
|
-
}
|
|
1303
|
-
var isEncodedOrSanitized = this.enableHtmlEncode || this.enableHtmlSanitizer;
|
|
1304
|
-
var createReplacement = function (entity) {
|
|
1305
|
-
var replacement = isEncodedOrSanitized ? "&amp;" + entity : "&" + entity;
|
|
1306
|
-
var regexPattern = (!_this.enableHtmlEncode && _this.enableHtmlSanitizer)
|
|
1307
|
-
? "&(" + entity + ")"
|
|
1308
|
-
: "&(amp;)*(" + entity + ")";
|
|
1309
|
-
var regExp = RegExp;
|
|
1310
|
-
var regex = new regExp(regexPattern, 'g');
|
|
1311
|
-
return [replacement, regex];
|
|
1312
|
-
};
|
|
1313
|
-
var entities = ['times', 'divide', 'ne'];
|
|
1314
|
-
var replacementsAndRegexes = entities.map(createReplacement);
|
|
1315
|
-
for (var _i = 0, replacementsAndRegexes_1 = replacementsAndRegexes; _i < replacementsAndRegexes_1.length; _i++) {
|
|
1316
|
-
var _a = replacementsAndRegexes_1[_i], replacement = _a[0], regex = _a[1];
|
|
1317
|
-
if (regex.test(value)) {
|
|
1318
|
-
value = value.replace(regex, replacement);
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
return value;
|
|
1322
|
-
};
|
|
1323
|
-
RichTextEditor.prototype.updatePanelValue = function () {
|
|
1324
|
-
this.setProperties({ value: this.replaceEntities(this.value) }, true);
|
|
1325
|
-
var value = this.editorMode === 'HTML' ? this.listOrderCorrection(this.value) : this.value;
|
|
1326
|
-
value = (this.enableHtmlEncode && this.value) ? util_1.decode(value) : value;
|
|
1327
|
-
var getTextArea = this.element.querySelector('.' + classes.CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
1328
|
-
if (value) {
|
|
1329
|
-
if (!ej2_base_4.isNullOrUndefined(getTextArea) && this.rootContainer.classList.contains('e-source-code-enabled')) {
|
|
1330
|
-
getTextArea.value = this.value;
|
|
1331
|
-
}
|
|
1332
|
-
if (this.valueContainer) {
|
|
1333
|
-
this.valueContainer.value = (this.enableHtmlEncode) ? this.value : value;
|
|
1334
|
-
}
|
|
1335
|
-
if (this.editorMode === 'HTML' && this.inputElement && this.inputElement.innerHTML.trim() !== value.trim()) {
|
|
1336
|
-
this.inputElement.innerHTML = util_3.resetContentEditableElements(value, this.editorMode);
|
|
1337
|
-
}
|
|
1338
|
-
else if (this.editorMode === 'Markdown' && this.inputElement
|
|
1339
|
-
&& this.inputElement.value.trim() !== value.trim()) {
|
|
1340
|
-
this.inputElement.value = value;
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
else {
|
|
1344
|
-
if (!ej2_base_4.isNullOrUndefined(getTextArea) && this.rootContainer.classList.contains('e-source-code-enabled')) {
|
|
1345
|
-
getTextArea.value = '';
|
|
1346
|
-
}
|
|
1347
|
-
if (this.editorMode === 'HTML') {
|
|
1348
|
-
if (this.enterKey === 'DIV') {
|
|
1349
|
-
this.inputElement.innerHTML = '<div><br/></div>';
|
|
1350
|
-
}
|
|
1351
|
-
else if (this.enterKey === 'BR') {
|
|
1352
|
-
this.inputElement.innerHTML = '<br/>';
|
|
1353
|
-
}
|
|
1354
|
-
else {
|
|
1355
|
-
this.inputElement.innerHTML = '<p><br/></p>';
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
else {
|
|
1359
|
-
this.inputElement.value = '';
|
|
1360
|
-
}
|
|
1361
|
-
if (this.valueContainer) {
|
|
1362
|
-
this.valueContainer.value = '';
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
if (this.showCharCount) {
|
|
1366
|
-
this.countModule.refresh();
|
|
1367
|
-
}
|
|
1368
|
-
};
|
|
1369
|
-
RichTextEditor.prototype.listOrderCorrection = function (value) {
|
|
1370
|
-
var valueElementWrapper = this.createElement('div');
|
|
1371
|
-
valueElementWrapper.innerHTML = value;
|
|
1372
|
-
var listElements = valueElementWrapper.querySelectorAll('UL, OL');
|
|
1373
|
-
for (var i = 0; i < listElements.length; i++) {
|
|
1374
|
-
if (!ej2_base_4.isNullOrUndefined(listElements[i]) && !ej2_base_4.isNullOrUndefined(listElements[i].parentElement) && !ej2_base_4.isNullOrUndefined(listElements[i].previousElementSibling) && (listElements[i].parentElement.nodeName === 'UL' || listElements[i].parentElement.nodeName === 'OL')) {
|
|
1375
|
-
listElements[i].previousElementSibling.appendChild(listElements[i]);
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
return valueElementWrapper.innerHTML;
|
|
1379
|
-
};
|
|
1380
|
-
RichTextEditor.prototype.setHeight = function (height) {
|
|
1381
|
-
if (height !== 'auto') {
|
|
1382
|
-
this.element.style.height = ej2_base_2.formatUnit(height);
|
|
1383
|
-
}
|
|
1384
|
-
else {
|
|
1385
|
-
this.element.style.height = 'auto';
|
|
1386
|
-
}
|
|
1387
|
-
if (this.toolbarSettings.type === 'Expand' && (typeof (this.height) === 'string' &&
|
|
1388
|
-
this.height.indexOf('px') > -1 || typeof (this.height) === 'number')) {
|
|
1389
|
-
this.element.classList.add(classes.CLS_RTE_FIXED_TB_EXPAND);
|
|
1390
|
-
}
|
|
1391
|
-
else {
|
|
1392
|
-
this.element.classList.remove(classes.CLS_RTE_FIXED_TB_EXPAND);
|
|
1393
|
-
}
|
|
1394
|
-
};
|
|
1395
|
-
RichTextEditor.prototype.setPlaceHolder = function () {
|
|
1396
|
-
if (this.inputElement && this.placeholder && this.iframeSettings.enable !== true) {
|
|
1397
|
-
if (this.editorMode !== 'Markdown') {
|
|
1398
|
-
if (!this.placeHolderWrapper) {
|
|
1399
|
-
this.placeHolderWrapper = this.createElement('span', { className: 'rte-placeholder e-rte-placeholder' + ' ' + this.getCssClass() });
|
|
1400
|
-
if (this.fontSize.default) {
|
|
1401
|
-
this.placeHolderWrapper.style.fontSize = this.fontSize.default;
|
|
1402
|
-
}
|
|
1403
|
-
if (this.inputElement) {
|
|
1404
|
-
this.inputElement.parentElement.insertBefore(this.placeHolderWrapper, this.inputElement);
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
this.placeHolderWrapper.innerHTML = this.placeholder;
|
|
1408
|
-
if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !ej2_base_4.isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
1409
|
-
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !ej2_base_4.isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
|
|
1410
|
-
this.inputElement.firstChild.childNodes.length < 2 && this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
1411
|
-
this.placeHolderWrapper.classList.add('enabled');
|
|
1412
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'input', this.setPlaceHolder, this);
|
|
1413
|
-
}
|
|
1414
|
-
else {
|
|
1415
|
-
this.placeHolderWrapper.classList.remove('enabled');
|
|
1416
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'input', this.setPlaceHolder);
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
else {
|
|
1420
|
-
this.inputElement.setAttribute('placeholder', this.placeholder);
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
if (this.placeholder && this.iframeSettings.enable && this.inputElement) {
|
|
1424
|
-
if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !ej2_base_4.isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
1425
|
-
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !ej2_base_4.isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
|
|
1426
|
-
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
1427
|
-
ej2_base_1.addClass([this.inputElement], 'e-rte-placeholder');
|
|
1428
|
-
this.inputElement.setAttribute('placeholder', this.placeholder);
|
|
1429
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'input', this.setPlaceHolder, this);
|
|
1430
|
-
}
|
|
1431
|
-
else {
|
|
1432
|
-
ej2_base_3.removeClass([this.inputElement], 'e-rte-placeholder');
|
|
1433
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'input', this.setPlaceHolder);
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
};
|
|
1437
|
-
RichTextEditor.prototype.setWidth = function (width) {
|
|
1438
|
-
if (width !== 'auto') {
|
|
1439
|
-
ej2_base_3.setStyleAttribute(this.element, { 'width': ej2_base_2.formatUnit(this.width) });
|
|
1440
|
-
}
|
|
1441
|
-
else {
|
|
1442
|
-
this.element.style.width = 'auto';
|
|
1443
|
-
}
|
|
1444
|
-
};
|
|
1445
|
-
RichTextEditor.prototype.setCssClass = function (cssClass) {
|
|
1446
|
-
if (!ej2_base_4.isNullOrUndefined(cssClass)) {
|
|
1447
|
-
var allClassName = cssClass.split(' ');
|
|
1448
|
-
for (var i = 0; i < allClassName.length; i++) {
|
|
1449
|
-
if (allClassName[i].trim() !== '') {
|
|
1450
|
-
this.element.classList.add(allClassName[i]);
|
|
1451
|
-
}
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
};
|
|
1455
|
-
RichTextEditor.prototype.updateRTL = function () {
|
|
1456
|
-
this.notify(events.rtlMode, { enableRtl: this.enableRtl });
|
|
1457
|
-
if (this.enableRtl) {
|
|
1458
|
-
this.element.classList.add(classes.CLS_RTL);
|
|
1459
|
-
this.inputElement.classList.add(classes.CLS_RTL);
|
|
1460
|
-
}
|
|
1461
|
-
else {
|
|
1462
|
-
this.element.classList.remove(classes.CLS_RTL);
|
|
1463
|
-
this.inputElement.classList.remove(classes.CLS_RTL);
|
|
1464
|
-
}
|
|
1465
|
-
};
|
|
1466
|
-
RichTextEditor.prototype.updateReadOnly = function () {
|
|
1467
|
-
this.notify(events.readOnlyMode, { editPanel: this.inputElement, mode: this.readonly });
|
|
1468
|
-
};
|
|
1469
|
-
RichTextEditor.prototype.setReadOnly = function (initial) {
|
|
1470
|
-
this.updateReadOnly();
|
|
1471
|
-
if (!initial) {
|
|
1472
|
-
if (this.readonly && this.enabled) {
|
|
1473
|
-
this.unbindEvents();
|
|
1474
|
-
this.unWireEvents();
|
|
1475
|
-
}
|
|
1476
|
-
else if (this.enabled) {
|
|
1477
|
-
this.wireEvents();
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
};
|
|
1481
|
-
RichTextEditor.prototype.print = function () {
|
|
1482
|
-
var _this = this;
|
|
1483
|
-
var printWind;
|
|
1484
|
-
var printArgs = {
|
|
1485
|
-
element: this.inputElement,
|
|
1486
|
-
requestType: 'print',
|
|
1487
|
-
cancel: false
|
|
1488
|
-
};
|
|
1489
|
-
this.trigger(events.actionBegin, printArgs, function (printingArgs) {
|
|
1490
|
-
printWind = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth);
|
|
1491
|
-
if (ej2_base_1.Browser.info.name === 'msie') {
|
|
1492
|
-
printWind.resizeTo(screen.availWidth, screen.availHeight);
|
|
1493
|
-
}
|
|
1494
|
-
printWind = ej2_base_3.print(_this.inputElement, printWind);
|
|
1495
|
-
if (!printingArgs.cancel) {
|
|
1496
|
-
var actionArgs = {
|
|
1497
|
-
requestType: 'print'
|
|
1498
|
-
};
|
|
1499
|
-
_this.trigger(events.actionComplete, actionArgs);
|
|
1500
|
-
}
|
|
1501
|
-
});
|
|
1502
|
-
};
|
|
1503
|
-
RichTextEditor.prototype.refreshUI = function () {
|
|
1504
|
-
this.renderModule.refresh();
|
|
1505
|
-
if (this.editorMode === 'Markdown') {
|
|
1506
|
-
this.autoResize();
|
|
1507
|
-
}
|
|
1508
|
-
};
|
|
1509
|
-
RichTextEditor.prototype.showFullScreen = function () {
|
|
1510
|
-
this.fullScreenModule.showFullScreen();
|
|
1511
|
-
};
|
|
1512
|
-
RichTextEditor.prototype.enableToolbarItem = function (items, muteToolbarUpdate) {
|
|
1513
|
-
this.toolbarModule.enableTBarItems(this.getBaseToolbarObject(), items, true, muteToolbarUpdate);
|
|
1514
|
-
};
|
|
1515
|
-
RichTextEditor.prototype.disableToolbarItem = function (items, muteToolbarUpdate) {
|
|
1516
|
-
this.toolbarModule.enableTBarItems(this.getBaseToolbarObject(), items, false, muteToolbarUpdate);
|
|
1517
|
-
};
|
|
1518
|
-
RichTextEditor.prototype.removeToolbarItem = function (items) {
|
|
1519
|
-
this.toolbarModule.removeTBarItems(items);
|
|
1520
|
-
};
|
|
1521
|
-
RichTextEditor.prototype.getRange = function () {
|
|
1522
|
-
return this.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
1523
|
-
};
|
|
1524
|
-
RichTextEditor.prototype.initializeServices = function () {
|
|
1525
|
-
this.serviceLocator.register('rendererFactory', new renderer_factory_1.RendererFactory);
|
|
1526
|
-
this.serviceLocator.register('rteLocale', this.localeObj = new ej2_base_2.L10n(this.getModuleName(), default_locale_1.defaultLocale, this.locale));
|
|
1527
|
-
this.serviceLocator.register('dialogRenderObject', new dialog_renderer_1.DialogRenderer(this));
|
|
1528
|
-
};
|
|
1529
|
-
RichTextEditor.prototype.RTERender = function () {
|
|
1530
|
-
var rendererFactory = this.serviceLocator.getService('rendererFactory');
|
|
1531
|
-
this.contentModule = rendererFactory.getRenderer(enum_1.RenderType.Content);
|
|
1532
|
-
this.fullScreenModule = new full_screen_1.FullScreen(this);
|
|
1533
|
-
this.enterKeyModule = new enter_key_1.EnterKeyAction(this);
|
|
1534
|
-
this.renderModule.render();
|
|
1535
|
-
this.inputElement = this.contentModule.getEditPanel();
|
|
1536
|
-
this.setHeight(this.height);
|
|
1537
|
-
html_attributes_1.setAttributes(this.htmlAttributes, this, false, true);
|
|
1538
|
-
if (this.iframeSettings) {
|
|
1539
|
-
this.setIframeSettings();
|
|
1540
|
-
}
|
|
1541
|
-
this.setCssClass(this.cssClass);
|
|
1542
|
-
this.updateEnable();
|
|
1543
|
-
this.setPlaceHolder();
|
|
1544
|
-
this.updateRTL();
|
|
1545
|
-
this.updateReadOnly();
|
|
1546
|
-
this.updatePanelValue();
|
|
1547
|
-
if (this.enableHtmlEncode && !ej2_base_4.isNullOrUndefined(this.value)) {
|
|
1548
|
-
this.setProperties({ value: this.encode(util_1.decode(this.value)) });
|
|
1549
|
-
}
|
|
1550
|
-
};
|
|
1551
|
-
RichTextEditor.prototype.setIframeSettings = function () {
|
|
1552
|
-
if (this.iframeSettings.resources) {
|
|
1553
|
-
var styleSrc = this.iframeSettings.resources.styles;
|
|
1554
|
-
var scriptSrc = this.iframeSettings.resources.scripts;
|
|
1555
|
-
if (!ej2_base_4.isNullOrUndefined(this.iframeSettings.resources.scripts) && this.iframeSettings.resources.scripts.length > 0) {
|
|
1556
|
-
this.InjectSheet(true, scriptSrc);
|
|
1557
|
-
}
|
|
1558
|
-
if (!ej2_base_4.isNullOrUndefined(this.iframeSettings.resources.styles) && this.iframeSettings.resources.styles.length > 0) {
|
|
1559
|
-
this.InjectSheet(false, styleSrc);
|
|
1560
|
-
}
|
|
1561
|
-
}
|
|
1562
|
-
if (this.iframeSettings.attributes) {
|
|
1563
|
-
html_attributes_1.setAttributes(this.iframeSettings.attributes, this, true, false);
|
|
1564
|
-
}
|
|
1565
|
-
};
|
|
1566
|
-
RichTextEditor.prototype.InjectSheet = function (scriptSheet, srcList) {
|
|
1567
|
-
try {
|
|
1568
|
-
if (srcList && srcList.length > 0) {
|
|
1569
|
-
var iFrame = this.contentModule.getDocument();
|
|
1570
|
-
var target = iFrame.querySelector('head');
|
|
1571
|
-
for (var i = 0; i < srcList.length; i++) {
|
|
1572
|
-
if (scriptSheet) {
|
|
1573
|
-
var scriptEle = this.createScriptElement();
|
|
1574
|
-
scriptEle.src = srcList[i];
|
|
1575
|
-
target.appendChild(scriptEle);
|
|
1576
|
-
}
|
|
1577
|
-
else {
|
|
1578
|
-
var styleEle = this.createStyleElement();
|
|
1579
|
-
styleEle.href = srcList[i];
|
|
1580
|
-
target.appendChild(styleEle);
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
}
|
|
1585
|
-
catch (e) {
|
|
1586
|
-
return;
|
|
1587
|
-
}
|
|
1588
|
-
};
|
|
1589
|
-
RichTextEditor.prototype.createScriptElement = function () {
|
|
1590
|
-
var scriptEle = this.createElement('script', {
|
|
1591
|
-
className: classes.CLS_SCRIPT_SHEET
|
|
1592
|
-
});
|
|
1593
|
-
scriptEle.type = 'text/javascript';
|
|
1594
|
-
return scriptEle;
|
|
1595
|
-
};
|
|
1596
|
-
RichTextEditor.prototype.createStyleElement = function () {
|
|
1597
|
-
var styleEle = this.createElement('link', {
|
|
1598
|
-
className: classes.CLS_STYLE_SHEET
|
|
1599
|
-
});
|
|
1600
|
-
styleEle.rel = 'stylesheet';
|
|
1601
|
-
return styleEle;
|
|
1602
|
-
};
|
|
1603
|
-
RichTextEditor.prototype.setValue = function (isPropertyChange) {
|
|
1604
|
-
var _this = this;
|
|
1605
|
-
if (this.valueTemplate) {
|
|
1606
|
-
var regEx = new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);
|
|
1607
|
-
if (typeof this.valueTemplate === 'string' && regEx.test(this.valueTemplate)) {
|
|
1608
|
-
this.setProperties({ value: this.valueTemplate });
|
|
1609
|
-
}
|
|
1610
|
-
else {
|
|
1611
|
-
var compiledTemplate = ej2_base_4.compile(this.valueTemplate)('', this, 'valueTemplate');
|
|
1612
|
-
if (typeof this.valueTemplate !== 'string' && this.isReact) {
|
|
1613
|
-
this.displayTempElem = this.createElement('div');
|
|
1614
|
-
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
1615
|
-
var item = compiledTemplate[i];
|
|
1616
|
-
ej2_base_4.append([item], this.displayTempElem);
|
|
1617
|
-
}
|
|
1618
|
-
this.renderTemplates(function () {
|
|
1619
|
-
_this.inputElement.innerHTML = util_3.resetContentEditableElements(_this.displayTempElem.childNodes[0].innerHTML, _this.editorMode);
|
|
1620
|
-
_this.setProperties({ value: _this.inputElement.innerHTML.trim() });
|
|
1621
|
-
});
|
|
1622
|
-
}
|
|
1623
|
-
else {
|
|
1624
|
-
var appendElem = this.element;
|
|
1625
|
-
if (isPropertyChange) {
|
|
1626
|
-
this.inputElement.innerHTML = '';
|
|
1627
|
-
appendElem = this.inputElement;
|
|
1628
|
-
}
|
|
1629
|
-
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
1630
|
-
var item = compiledTemplate[i];
|
|
1631
|
-
ej2_base_4.append([item], appendElem);
|
|
1632
|
-
}
|
|
1633
|
-
var content = appendElem.innerHTML.trim();
|
|
1634
|
-
if (content.length > 0) {
|
|
1635
|
-
this.setProperties({ value: content });
|
|
1636
|
-
}
|
|
1637
|
-
this.renderReactTemplates();
|
|
1638
|
-
}
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
else {
|
|
1642
|
-
var innerHtml = !ej2_base_4.isNullOrUndefined(this.element.innerHTML) && this.element.innerHTML.replace(/<(\/?|\!?)(!--!--)>/g, '').trim();
|
|
1643
|
-
if (innerHtml !== '') {
|
|
1644
|
-
if (this.element.tagName === 'TEXTAREA') {
|
|
1645
|
-
this.setProperties({ value: util_1.decode(innerHtml) });
|
|
1646
|
-
}
|
|
1647
|
-
else {
|
|
1648
|
-
this.setProperties({ value: innerHtml });
|
|
1649
|
-
}
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
RichTextEditor.prototype.renderTemplates = function (callBack) {
|
|
1654
|
-
this.renderReactTemplates(callBack);
|
|
1655
|
-
};
|
|
1656
|
-
RichTextEditor.prototype.updateResizeFlag = function () {
|
|
1657
|
-
this.isResizeInitialized = true;
|
|
1658
|
-
};
|
|
1659
|
-
RichTextEditor.prototype.getInsertImgMaxWidth = function () {
|
|
1660
|
-
var maxWidth = this.insertImageSettings.maxWidth;
|
|
1661
|
-
var imgPadding = 12;
|
|
1662
|
-
var imgResizeBorder = 2;
|
|
1663
|
-
var editEle = this.contentModule.getEditPanel();
|
|
1664
|
-
if (this.editorMode === 'HTML' && !ej2_base_4.isNullOrUndefined(this.formatter.editorManager.nodeSelection) && !ej2_base_4.isNullOrUndefined(this.formatter.editorManager.nodeSelection.range)) {
|
|
1665
|
-
var currentRange = this.formatter.editorManager.nodeSelection.range;
|
|
1666
|
-
if (currentRange.startContainer.nodeType !== 3 && currentRange.startContainer.closest &&
|
|
1667
|
-
!ej2_base_4.isNullOrUndefined(currentRange.startContainer.closest('TD'))) {
|
|
1668
|
-
editEle = currentRange.startContainer;
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
var eleStyle = window.getComputedStyle(editEle);
|
|
1672
|
-
var editEleMaxWidth = editEle.offsetWidth - (imgPadding + imgResizeBorder +
|
|
1673
|
-
parseFloat(eleStyle.paddingLeft.split('px')[0]) + parseFloat(eleStyle.paddingRight.split('px')[0]) +
|
|
1674
|
-
parseFloat(eleStyle.marginLeft.split('px')[0]) + parseFloat(eleStyle.marginRight.split('px')[0]));
|
|
1675
|
-
return ej2_base_4.isNullOrUndefined(maxWidth) ? editEleMaxWidth : maxWidth;
|
|
1676
|
-
};
|
|
1677
|
-
RichTextEditor.prototype.getInsertVidMaxWidth = function () {
|
|
1678
|
-
var maxWidth = this.insertVideoSettings.maxWidth;
|
|
1679
|
-
var vidPadding = 12;
|
|
1680
|
-
var vidResizeBorder = 2;
|
|
1681
|
-
var editEle = this.contentModule.getEditPanel();
|
|
1682
|
-
var eleStyle = window.getComputedStyle(editEle);
|
|
1683
|
-
var editEleMaxWidth = editEle.offsetWidth - (vidPadding + vidResizeBorder +
|
|
1684
|
-
parseFloat(eleStyle.paddingLeft.split('px')[0]) + parseFloat(eleStyle.paddingRight.split('px')[0]) +
|
|
1685
|
-
parseFloat(eleStyle.marginLeft.split('px')[0]) + parseFloat(eleStyle.marginRight.split('px')[0]));
|
|
1686
|
-
return ej2_base_4.isNullOrUndefined(maxWidth) ? editEleMaxWidth : maxWidth;
|
|
1687
|
-
};
|
|
1688
|
-
RichTextEditor.prototype.getHtml = function () {
|
|
1689
|
-
var htmlValue = util_3.cleanupInternalElements(this.contentModule.getEditPanel().innerHTML, this.editorMode);
|
|
1690
|
-
return (this.enableXhtml && (htmlValue === '<p><br></p>' || htmlValue === '<div><br></div>' ||
|
|
1691
|
-
htmlValue === '<br>') ? null : this.serializeValue(htmlValue));
|
|
1692
|
-
};
|
|
1693
|
-
RichTextEditor.prototype.getXhtml = function () {
|
|
1694
|
-
var currentValue = util_3.cleanupInternalElements(this.value, this.editorMode);
|
|
1695
|
-
if (!ej2_base_4.isNullOrUndefined(currentValue) && this.enableXhtml) {
|
|
1696
|
-
currentValue = this.htmlEditorModule.xhtmlValidation.selfEncloseValidation(currentValue);
|
|
1697
|
-
}
|
|
1698
|
-
return currentValue;
|
|
1699
|
-
};
|
|
1700
|
-
RichTextEditor.prototype.showSourceCode = function () {
|
|
1701
|
-
if (this.readonly) {
|
|
1702
|
-
return;
|
|
1703
|
-
}
|
|
1704
|
-
this.notify(events.sourceCode, {});
|
|
1705
|
-
};
|
|
1706
|
-
RichTextEditor.prototype.getCharCount = function () {
|
|
1707
|
-
var htmlText = this.editorMode === 'Markdown' ? this.inputElement.value.trim() :
|
|
1708
|
-
this.inputElement.textContent.trim();
|
|
1709
|
-
var htmlLength;
|
|
1710
|
-
if (this.editorMode !== 'Markdown' && htmlText.indexOf('\u200B') !== -1) {
|
|
1711
|
-
htmlLength = htmlText.replace(/\u200B/g, '').length;
|
|
1712
|
-
}
|
|
1713
|
-
else {
|
|
1714
|
-
htmlLength = htmlText.length;
|
|
1715
|
-
}
|
|
1716
|
-
return htmlLength;
|
|
1717
|
-
};
|
|
1718
|
-
RichTextEditor.prototype.showDialog = function (type) {
|
|
1719
|
-
if (type === enum_1.DialogType.InsertLink) {
|
|
1720
|
-
this.notify(events.showLinkDialog, {});
|
|
1721
|
-
}
|
|
1722
|
-
else if (type === enum_1.DialogType.InsertImage) {
|
|
1723
|
-
this.notify(events.showImageDialog, {});
|
|
1724
|
-
}
|
|
1725
|
-
else if (type === enum_1.DialogType.InsertAudio) {
|
|
1726
|
-
this.notify(events.showAudioDialog, {});
|
|
1727
|
-
}
|
|
1728
|
-
else if (type === enum_1.DialogType.InsertVideo) {
|
|
1729
|
-
this.notify(events.showVideoDialog, {});
|
|
1730
|
-
}
|
|
1731
|
-
else if (type === enum_1.DialogType.InsertTable) {
|
|
1732
|
-
this.notify(events.showTableDialog, {});
|
|
1733
|
-
}
|
|
1734
|
-
};
|
|
1735
|
-
RichTextEditor.prototype.closeDialog = function (type) {
|
|
1736
|
-
if (type === enum_1.DialogType.InsertLink) {
|
|
1737
|
-
this.notify(events.closeLinkDialog, {});
|
|
1738
|
-
}
|
|
1739
|
-
else if (type === enum_1.DialogType.InsertImage) {
|
|
1740
|
-
this.notify(events.closeImageDialog, {});
|
|
1741
|
-
}
|
|
1742
|
-
else if (type === enum_1.DialogType.InsertAudio) {
|
|
1743
|
-
this.notify(events.closeAudioDialog, {});
|
|
1744
|
-
}
|
|
1745
|
-
else if (type === enum_1.DialogType.InsertVideo) {
|
|
1746
|
-
this.notify(events.closeVideoDialog, {});
|
|
1747
|
-
}
|
|
1748
|
-
else if (type === enum_1.DialogType.InsertTable) {
|
|
1749
|
-
this.notify(events.closeTableDialog, {});
|
|
1750
|
-
}
|
|
1751
|
-
};
|
|
1752
|
-
RichTextEditor.prototype.getBaseToolbarObject = function () {
|
|
1753
|
-
var tbObj;
|
|
1754
|
-
if (this.inlineMode.enable && (!ej2_base_1.Browser.isDevice || util_1.isIDevice())) {
|
|
1755
|
-
tbObj = this.quickToolbarModule && this.quickToolbarModule.getInlineBaseToolbar();
|
|
1756
|
-
}
|
|
1757
|
-
else {
|
|
1758
|
-
tbObj = this.toolbarModule && this.toolbarModule.getBaseToolbar();
|
|
1759
|
-
}
|
|
1760
|
-
return tbObj;
|
|
1761
|
-
};
|
|
1762
|
-
RichTextEditor.prototype.getToolbar = function () {
|
|
1763
|
-
return this.toolbarModule ? this.toolbarModule.getToolbarElement() : null;
|
|
1764
|
-
};
|
|
1765
|
-
RichTextEditor.prototype.getToolbarElement = function () {
|
|
1766
|
-
return this.toolbarModule && this.toolbarModule.getToolbarElement();
|
|
1767
|
-
};
|
|
1768
|
-
RichTextEditor.prototype.getID = function () {
|
|
1769
|
-
return this.internalID;
|
|
1770
|
-
};
|
|
1771
|
-
RichTextEditor.prototype.getCssClass = function (isSpace) {
|
|
1772
|
-
return (ej2_base_4.isNullOrUndefined(this.cssClass) ? '' : isSpace ? ' ' + this.cssClass : this.cssClass);
|
|
1773
|
-
};
|
|
1774
|
-
RichTextEditor.prototype.mouseDownHandler = function (e) {
|
|
1775
|
-
var touch = (e.touches ? e.changedTouches[0] : e);
|
|
1776
|
-
ej2_base_1.addClass([this.element], [classes.CLS_FOCUS]);
|
|
1777
|
-
this.preventDefaultResize(e);
|
|
1778
|
-
this.notify(events.mouseDown, { args: e });
|
|
1779
|
-
this.formatter.editorManager.observer.notify(events.mouseDown, { args: e });
|
|
1780
|
-
this.clickPoints = { clientX: touch.clientX, clientY: touch.clientY };
|
|
1781
|
-
};
|
|
1782
|
-
RichTextEditor.prototype.preventImgResize = function (e) {
|
|
1783
|
-
if (e.target.nodeName.toLocaleLowerCase() === 'img') {
|
|
1784
|
-
e.preventDefault();
|
|
1785
|
-
}
|
|
1786
|
-
};
|
|
1787
|
-
RichTextEditor.prototype.preventDefaultResize = function (e) {
|
|
1788
|
-
if (ej2_base_1.Browser.info.name === 'msie') {
|
|
1789
|
-
this.contentModule.getEditPanel().addEventListener('mscontrolselect', this.preventImgResize);
|
|
1790
|
-
}
|
|
1791
|
-
else if (ej2_base_1.Browser.info.name === 'mozilla') {
|
|
1792
|
-
this.contentModule.getDocument().execCommand('enableObjectResizing', false, 'false');
|
|
1793
|
-
this.contentModule.getDocument().execCommand('enableInlineTableEditing', false, 'false');
|
|
1794
|
-
}
|
|
1795
|
-
};
|
|
1796
|
-
RichTextEditor.prototype.defaultResize = function (e) {
|
|
1797
|
-
if (ej2_base_1.Browser.info.name === 'msie') {
|
|
1798
|
-
this.contentModule.getEditPanel().removeEventListener('mscontrolselect', this.preventImgResize);
|
|
1799
|
-
}
|
|
1800
|
-
else if (ej2_base_1.Browser.info.name === 'mozilla') {
|
|
1801
|
-
this.contentModule.getDocument().execCommand('enableObjectResizing', true, 'true');
|
|
1802
|
-
this.contentModule.getDocument().execCommand('enableInlineTableEditing', true, 'true');
|
|
1803
|
-
}
|
|
1804
|
-
};
|
|
1805
|
-
RichTextEditor.prototype.resizeHandler = function () {
|
|
1806
|
-
if (!document.body.contains(this.element)) {
|
|
1807
|
-
document.defaultView.removeEventListener('resize', this.resizeHandler, true);
|
|
1808
|
-
this.onResizeHandler = null;
|
|
1809
|
-
return;
|
|
1810
|
-
}
|
|
1811
|
-
if (this.toolbarSettings.enable && !this.inlineMode.enable) {
|
|
1812
|
-
this.toolbarModule.refreshToolbarOverflow();
|
|
1813
|
-
}
|
|
1814
|
-
this.notify(events.windowResize, null);
|
|
1815
|
-
this.autoResize();
|
|
1816
|
-
};
|
|
1817
|
-
RichTextEditor.prototype.scrollHandler = function (e) {
|
|
1818
|
-
if (this.element) {
|
|
1819
|
-
this.notify(events.scroll, { args: e });
|
|
1820
|
-
}
|
|
1821
|
-
};
|
|
1822
|
-
RichTextEditor.prototype.contentScrollHandler = function (e) {
|
|
1823
|
-
this.notify(events.contentscroll, { args: e });
|
|
1824
|
-
};
|
|
1825
|
-
RichTextEditor.prototype.focusHandler = function (e) {
|
|
1826
|
-
if ((!this.isRTE || this.isFocusOut)) {
|
|
1827
|
-
this.isRTE = this.isFocusOut ? false : true;
|
|
1828
|
-
this.isFocusOut = false;
|
|
1829
|
-
ej2_base_1.addClass([this.element], [classes.CLS_FOCUS]);
|
|
1830
|
-
if (this.editorMode === 'HTML') {
|
|
1831
|
-
this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
1832
|
-
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
1833
|
-
this.encode(util_1.decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
1834
|
-
}
|
|
1835
|
-
else {
|
|
1836
|
-
this.cloneValue = this.inputElement.value === '' ? null :
|
|
1837
|
-
this.inputElement.value;
|
|
1838
|
-
}
|
|
1839
|
-
var active = document.activeElement;
|
|
1840
|
-
if (active === this.element || active === this.getToolbarElement() || active === this.contentModule.getEditPanel()
|
|
1841
|
-
|| ((this.iframeSettings.enable && active === this.contentModule.getPanel()) &&
|
|
1842
|
-
e.target && !e.target.classList.contains('e-img-inner')
|
|
1843
|
-
&& (e.target && e.target.parentElement
|
|
1844
|
-
&& !e.target.parentElement.classList.contains('e-img-wrap')))
|
|
1845
|
-
|| ej2_base_2.closest(active, '.e-rte-toolbar') === this.getToolbarElement()) {
|
|
1846
|
-
this.contentModule.getEditPanel().focus();
|
|
1847
|
-
if (!ej2_base_4.isNullOrUndefined(this.getToolbarElement())) {
|
|
1848
|
-
this.getToolbarElement().setAttribute('tabindex', '-1');
|
|
1849
|
-
var items = this.getToolbarElement().querySelectorAll('[tabindex="0"]');
|
|
1850
|
-
for (var i = 0; i < items.length; i++) {
|
|
1851
|
-
items[i].setAttribute('tabindex', '-1');
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
this.preventDefaultResize(e);
|
|
1856
|
-
this.trigger('focus', { event: e, isInteracted: Object.keys(e).length === 0 ? false : true });
|
|
1857
|
-
if (!ej2_base_4.isNullOrUndefined(this.saveInterval) && this.saveInterval > 0 && !this.autoSaveOnIdle && ej2_base_4.isNullOrUndefined(this.timeInterval)) {
|
|
1858
|
-
this.timeInterval = setInterval(this.updateValueOnIdle.bind(this), this.saveInterval);
|
|
1859
|
-
}
|
|
1860
|
-
ej2_base_1.EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
|
|
1861
|
-
}
|
|
1862
|
-
if (!this.readonly) {
|
|
1863
|
-
var currentFocus = this.getCurrentFocus(e);
|
|
1864
|
-
if (currentFocus === 'editArea' || currentFocus === 'textArea' || currentFocus === 'sourceCode') {
|
|
1865
|
-
this.resetToolbarTabIndex();
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
};
|
|
1869
|
-
RichTextEditor.prototype.getUpdatedValue = function () {
|
|
1870
|
-
var value;
|
|
1871
|
-
var getTextArea = this.element.querySelector('.' + classes.CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
1872
|
-
if (this.editorMode === 'HTML') {
|
|
1873
|
-
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
1874
|
-
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
1875
|
-
this.encode(util_1.decode(util_3.cleanupInternalElements(this.inputElement.innerHTML, this.editorMode))) :
|
|
1876
|
-
this.inputElement.innerHTML;
|
|
1877
|
-
if (this.enableHtmlSanitizer && !ej2_base_4.isNullOrUndefined(value) && /&(amp;)*((times)|(divide)|(ne))/.test(value)) {
|
|
1878
|
-
value = value.replace(/&(amp;)*(times|divide|ne)/g, '&amp;$2');
|
|
1879
|
-
}
|
|
1880
|
-
if (!ej2_base_4.isNullOrUndefined(getTextArea) && this.rootContainer.classList.contains('e-source-code-enabled')) {
|
|
1881
|
-
value = /&(amp;)*((times)|(divide)|(ne))/.test(getTextArea.value) ? getTextArea.value.replace(/&(amp;)*(times|divide|ne)/g, '&amp;$2') : getTextArea.value;
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
else {
|
|
1885
|
-
value = this.inputElement.value === '' ? null :
|
|
1886
|
-
this.inputElement.value;
|
|
1887
|
-
}
|
|
1888
|
-
if (value != null && !this.enableHtmlEncode) {
|
|
1889
|
-
value = util_3.cleanupInternalElements(value, this.editorMode);
|
|
1890
|
-
}
|
|
1891
|
-
return value;
|
|
1892
|
-
};
|
|
1893
|
-
RichTextEditor.prototype.updateValueOnIdle = function () {
|
|
1894
|
-
if (!ej2_base_4.isNullOrUndefined(this.tableModule) && !ej2_base_4.isNullOrUndefined(this.inputElement.querySelector('.e-table-box.e-rbox-select'))) {
|
|
1895
|
-
return;
|
|
1896
|
-
}
|
|
1897
|
-
this.setProperties({ value: this.getUpdatedValue() }, true);
|
|
1898
|
-
this.valueContainer.value = this.value;
|
|
1899
|
-
this.isValueChangeBlurhandler = false;
|
|
1900
|
-
this.invokeChangeEvent();
|
|
1901
|
-
};
|
|
1902
|
-
RichTextEditor.prototype.updateIntervalValue = function () {
|
|
1903
|
-
clearTimeout(this.idleInterval);
|
|
1904
|
-
this.idleInterval = setTimeout(this.updateValueOnIdle.bind(this), 0);
|
|
1905
|
-
};
|
|
1906
|
-
RichTextEditor.prototype.cleanupResizeElements = function (args) {
|
|
1907
|
-
var value = util_3.cleanupInternalElements(args.value, this.editorMode);
|
|
1908
|
-
args.callBack(value);
|
|
1909
|
-
};
|
|
1910
|
-
RichTextEditor.prototype.addAnchorAriaLabel = function (value) {
|
|
1911
|
-
var valueElementWrapper = document.createElement('div');
|
|
1912
|
-
valueElementWrapper.innerHTML = value;
|
|
1913
|
-
var item = valueElementWrapper.querySelectorAll('a');
|
|
1914
|
-
if (item.length > 0) {
|
|
1915
|
-
for (var i = 0; i < item.length; i++) {
|
|
1916
|
-
if (item[i].hasAttribute('target') && item[i].getAttribute('target') === '_blank') {
|
|
1917
|
-
item[i].setAttribute('aria-label', this.serviceLocator.getService('rteLocale').getConstant('linkAriaLabel'));
|
|
1918
|
-
}
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1921
|
-
return valueElementWrapper.innerHTML;
|
|
1922
|
-
};
|
|
1923
|
-
RichTextEditor.prototype.updateStatus = function (e) {
|
|
1924
|
-
if (!ej2_base_4.isNullOrUndefined(e.html) || !ej2_base_4.isNullOrUndefined(e.markdown)) {
|
|
1925
|
-
var status_1 = this.formatter.editorManager.undoRedoManager.getUndoStatus();
|
|
1926
|
-
var eventArgs = {
|
|
1927
|
-
undo: status_1.undo,
|
|
1928
|
-
redo: status_1.redo,
|
|
1929
|
-
html: e.html,
|
|
1930
|
-
markdown: e.markdown
|
|
1931
|
-
};
|
|
1932
|
-
this.trigger(events.updatedToolbarStatus, eventArgs);
|
|
1933
|
-
}
|
|
1934
|
-
};
|
|
1935
|
-
RichTextEditor.prototype.onDocumentClick = function (e) {
|
|
1936
|
-
var target = e.target;
|
|
1937
|
-
var rteElement = ej2_base_2.closest(target, '.' + classes.CLS_RTE);
|
|
1938
|
-
if (!this.element.contains(e.target) && document !== e.target && rteElement !== this.element &&
|
|
1939
|
-
!ej2_base_2.closest(target, '[aria-owns="' + this.getID() + '"]')) {
|
|
1940
|
-
this.isBlur = true;
|
|
1941
|
-
this.isRTE = false;
|
|
1942
|
-
}
|
|
1943
|
-
this.notify(events.docClick, { args: e });
|
|
1944
|
-
var hideQuickToolbarChecker = this.quickToolbarModule && !this.inlineMode.enable &&
|
|
1945
|
-
ej2_base_4.isNullOrUndefined(this.quickToolbarModule.inlineQTBar);
|
|
1946
|
-
if ((hideQuickToolbarChecker && !ej2_base_4.isNullOrUndefined(ej2_base_2.closest(target, '.' + 'e-toolbar-wrapper'))) || (hideQuickToolbarChecker && (!ej2_base_4.isNullOrUndefined(ej2_base_2.closest(target, '.e-rte-table-resize')) || !ej2_base_4.isNullOrUndefined(ej2_base_2.closest(target, '.e-table-box'))))) {
|
|
1947
|
-
this.quickToolbarModule.hideQuickToolbars();
|
|
1948
|
-
}
|
|
1949
|
-
if (ej2_base_1.Browser.info.name !== 'msie' && e.detail > 3) {
|
|
1950
|
-
e.preventDefault();
|
|
1951
|
-
}
|
|
1952
|
-
};
|
|
1953
|
-
RichTextEditor.prototype.blurHandler = function (e) {
|
|
1954
|
-
var trg = e.relatedTarget;
|
|
1955
|
-
if (trg) {
|
|
1956
|
-
var rteElement = ej2_base_2.closest(trg, '.' + classes.CLS_RTE);
|
|
1957
|
-
if (!rteElement && this.iframeSettings.enable) {
|
|
1958
|
-
var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
1959
|
-
if (iframeElement && iframeElement.contentWindow.document.body.contains(trg)) {
|
|
1960
|
-
rteElement = ej2_base_2.closest(iframeElement, '.' + classes.CLS_RTE);
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
if (rteElement && rteElement === this.element) {
|
|
1964
|
-
this.isBlur = false;
|
|
1965
|
-
if (trg === this.getToolbarElement()) {
|
|
1966
|
-
trg.setAttribute('tabindex', '-1');
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
else if (ej2_base_2.closest(trg, '[aria-owns="' + this.getID() + '"]') || ej2_base_2.closest(trg, '.' + classes.CLS_RTE_ELEMENTS)) {
|
|
1970
|
-
this.isBlur = false;
|
|
1971
|
-
}
|
|
1972
|
-
else {
|
|
1973
|
-
this.isBlur = true;
|
|
1974
|
-
trg = null;
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
if (this.isBlur && ej2_base_4.isNullOrUndefined(trg)) {
|
|
1978
|
-
ej2_base_3.removeClass([this.element], [classes.CLS_FOCUS]);
|
|
1979
|
-
util_3.removeSelectionClassStates(this.inputElement);
|
|
1980
|
-
this.notify(events.focusChange, {});
|
|
1981
|
-
var value = this.getUpdatedValue();
|
|
1982
|
-
if (!this.rootContainer.classList.contains('e-source-code-enabled')) {
|
|
1983
|
-
this.setProperties({ value: value }, true);
|
|
1984
|
-
}
|
|
1985
|
-
else {
|
|
1986
|
-
this.setProperties({ value: value });
|
|
1987
|
-
}
|
|
1988
|
-
this.valueContainer.value = this.value;
|
|
1989
|
-
this.isValueChangeBlurhandler = true;
|
|
1990
|
-
this.invokeChangeEvent();
|
|
1991
|
-
this.isFocusOut = true;
|
|
1992
|
-
this.isBlur = false;
|
|
1993
|
-
util_1.dispatchEvent(this.valueContainer, 'focusout');
|
|
1994
|
-
this.defaultResize(e);
|
|
1995
|
-
this.trigger('blur', { event: e, isInteracted: Object.keys(e).length === 0 ? false : true });
|
|
1996
|
-
if (!ej2_base_4.isNullOrUndefined(this.timeInterval)) {
|
|
1997
|
-
clearInterval(this.timeInterval);
|
|
1998
|
-
this.timeInterval = null;
|
|
1999
|
-
}
|
|
2000
|
-
if (!ej2_base_4.isNullOrUndefined(this.placeHolderWrapper) && this.element.querySelector('[title = Preview]')) {
|
|
2001
|
-
this.placeHolderWrapper.style.display = 'none';
|
|
2002
|
-
}
|
|
2003
|
-
ej2_base_1.EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
2004
|
-
}
|
|
2005
|
-
else {
|
|
2006
|
-
this.isRTE = true;
|
|
2007
|
-
}
|
|
2008
|
-
if (!this.readonly && this.getCurrentFocus(e) === 'outside') {
|
|
2009
|
-
this.resetToolbarTabIndex();
|
|
2010
|
-
}
|
|
2011
|
-
};
|
|
2012
|
-
RichTextEditor.prototype.contentChanged = function (args) {
|
|
2013
|
-
var tempSpanToRemove = this.inputElement.querySelector('.tempSpan');
|
|
2014
|
-
if (tempSpanToRemove) {
|
|
2015
|
-
ej2_base_1.detach(tempSpanToRemove);
|
|
2016
|
-
}
|
|
2017
|
-
if (args && !ej2_base_4.isNullOrUndefined(args.detail) && args.detail.click) {
|
|
2018
|
-
this.formatter.saveData();
|
|
2019
|
-
}
|
|
2020
|
-
if (this.autoSaveOnIdle) {
|
|
2021
|
-
if (!ej2_base_4.isNullOrUndefined(this.saveInterval)) {
|
|
2022
|
-
clearTimeout(this.autoSaveTimeOut);
|
|
2023
|
-
this.autoSaveTimeOut = setTimeout(this.updateIntervalValue.bind(this), this.saveInterval);
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
};
|
|
2027
|
-
RichTextEditor.prototype.invokeChangeEvent = function () {
|
|
2028
|
-
var currentValue;
|
|
2029
|
-
if (this.enableXhtml) {
|
|
2030
|
-
currentValue = this.getXhtml();
|
|
2031
|
-
}
|
|
2032
|
-
else {
|
|
2033
|
-
currentValue = this.value;
|
|
2034
|
-
}
|
|
2035
|
-
var eventArgs = {
|
|
2036
|
-
value: currentValue,
|
|
2037
|
-
isInteracted: this.isValueChangeBlurhandler
|
|
2038
|
-
};
|
|
2039
|
-
if (this.value !== util_3.cleanupInternalElements(this.cloneValue, this.editorMode)) {
|
|
2040
|
-
this.trigger('change', eventArgs);
|
|
2041
|
-
this.cloneValue = this.value;
|
|
2042
|
-
}
|
|
2043
|
-
};
|
|
2044
|
-
RichTextEditor.prototype.wireScrollElementsEvents = function () {
|
|
2045
|
-
this.scrollParentElements = ej2_popups_1.getScrollableParent(this.element);
|
|
2046
|
-
for (var _i = 0, _a = this.scrollParentElements; _i < _a.length; _i++) {
|
|
2047
|
-
var element = _a[_i];
|
|
2048
|
-
ej2_base_1.EventHandler.add(element, 'scroll', this.scrollHandler, this);
|
|
2049
|
-
}
|
|
2050
|
-
if (!this.iframeSettings.enable) {
|
|
2051
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'scroll', this.contentScrollHandler, this);
|
|
2052
|
-
}
|
|
2053
|
-
};
|
|
2054
|
-
RichTextEditor.prototype.wireContextEvent = function () {
|
|
2055
|
-
if (this.quickToolbarSettings.showOnRightClick) {
|
|
2056
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'contextmenu', this.contextHandler, this);
|
|
2057
|
-
if (ej2_base_1.Browser.isDevice) {
|
|
2058
|
-
this.touchModule = new ej2_base_5.Touch(this.inputElement, { tapHold: this.touchHandler.bind(this), tapHoldThreshold: 500 });
|
|
2059
|
-
}
|
|
2060
|
-
}
|
|
2061
|
-
};
|
|
2062
|
-
RichTextEditor.prototype.unWireContextEvent = function () {
|
|
2063
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'contextmenu', this.contextHandler);
|
|
2064
|
-
if (ej2_base_1.Browser.isDevice && this.touchModule) {
|
|
2065
|
-
this.touchModule.destroy();
|
|
2066
|
-
}
|
|
2067
|
-
};
|
|
2068
|
-
RichTextEditor.prototype.unWireScrollElementsEvents = function () {
|
|
2069
|
-
this.scrollParentElements = ej2_popups_1.getScrollableParent(this.element);
|
|
2070
|
-
for (var _i = 0, _a = this.scrollParentElements; _i < _a.length; _i++) {
|
|
2071
|
-
var element = _a[_i];
|
|
2072
|
-
ej2_base_1.EventHandler.remove(element, 'scroll', this.scrollHandler);
|
|
2073
|
-
}
|
|
2074
|
-
if (!this.iframeSettings.enable) {
|
|
2075
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'scroll', this.contentScrollHandler);
|
|
2076
|
-
}
|
|
2077
|
-
};
|
|
2078
|
-
RichTextEditor.prototype.touchHandler = function (e) {
|
|
2079
|
-
this.notifyMouseUp(e.originalEvent);
|
|
2080
|
-
this.triggerEditArea(e.originalEvent);
|
|
2081
|
-
};
|
|
2082
|
-
RichTextEditor.prototype.contextHandler = function (e) {
|
|
2083
|
-
var closestElem = ej2_base_2.closest(e.target, 'a, table, img, video, audio, .e-embed-video-wrap');
|
|
2084
|
-
if (!closestElem && e.target && e.target.classList &&
|
|
2085
|
-
(e.target.classList.contains(classes.CLS_AUDIOWRAP) ||
|
|
2086
|
-
e.target.classList.contains(classes.CLS_CLICKELEM))) {
|
|
2087
|
-
closestElem = e.target.querySelector('audio');
|
|
2088
|
-
}
|
|
2089
|
-
if (this.inlineMode.onSelection === false || (!ej2_base_4.isNullOrUndefined(closestElem) && this.inputElement.contains(closestElem)
|
|
2090
|
-
&& (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A' ||
|
|
2091
|
-
closestElem.tagName.toLowerCase() === 'video' || closestElem.tagName.toLowerCase() === 'audio' || closestElem.tagName === 'SPAN'))) {
|
|
2092
|
-
e.preventDefault();
|
|
2093
|
-
}
|
|
2094
|
-
};
|
|
2095
|
-
RichTextEditor.prototype.resetHandler = function () {
|
|
2096
|
-
var defaultValue = this.valueContainer.defaultValue.trim();
|
|
2097
|
-
this.setProperties({ value: defaultValue === '' ? null : defaultValue });
|
|
2098
|
-
};
|
|
2099
|
-
RichTextEditor.prototype.autoResize = function () {
|
|
2100
|
-
if (!this.element || !this.originalElement || !this.valueContainer) {
|
|
2101
|
-
return;
|
|
2102
|
-
}
|
|
2103
|
-
if (this.height === 'auto') {
|
|
2104
|
-
if (this.editorMode === 'Markdown') {
|
|
2105
|
-
this.setAutoHeight(this.inputElement);
|
|
2106
|
-
}
|
|
2107
|
-
else if (this.iframeSettings.enable) {
|
|
2108
|
-
var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
2109
|
-
if (iframeElement) {
|
|
2110
|
-
this.setAutoHeight(iframeElement);
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
else {
|
|
2115
|
-
if (this.editorMode === 'Markdown') {
|
|
2116
|
-
var textArea = this.inputElement;
|
|
2117
|
-
var otherElemHeight = (this.enableResize || this.showCharCount) ? 20 : 0;
|
|
2118
|
-
if (textArea) {
|
|
2119
|
-
textArea.style.height = this.element.clientHeight - (this.toolbarModule.getToolbarHeight() + otherElemHeight + 3) + 'px';
|
|
2120
|
-
}
|
|
2121
|
-
}
|
|
2122
|
-
else if (this.iframeSettings.enable) {
|
|
2123
|
-
var iframe = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
2124
|
-
var otherElemHeight = (this.enableResize || this.showCharCount) ? 20 : 0;
|
|
2125
|
-
if (iframe && this.toolbarModule) {
|
|
2126
|
-
iframe.style.height = this.element.clientHeight - (this.toolbarModule.getToolbarHeight() + otherElemHeight + 3) + 'px';
|
|
2127
|
-
}
|
|
2128
|
-
}
|
|
2129
|
-
}
|
|
2130
|
-
};
|
|
2131
|
-
RichTextEditor.prototype.setAutoHeight = function (element) {
|
|
2132
|
-
if (element.nodeName === 'TEXTAREA') {
|
|
2133
|
-
element.style.height = 'auto';
|
|
2134
|
-
element.style.height = (this.inputElement.scrollHeight + 16) + 'px';
|
|
2135
|
-
element.style.overflow = 'hidden';
|
|
2136
|
-
}
|
|
2137
|
-
else if (element.nodeName === 'IFRAME') {
|
|
2138
|
-
element.style.height = this.inputElement.parentElement.offsetHeight + 'px';
|
|
2139
|
-
}
|
|
2140
|
-
};
|
|
2141
|
-
RichTextEditor.prototype.wireEvents = function () {
|
|
2142
|
-
this.onBlurHandler = this.blurHandler.bind(this);
|
|
2143
|
-
this.onFocusHandler = this.focusHandler.bind(this);
|
|
2144
|
-
this.onResizeHandler = this.resizeHandler.bind(this);
|
|
2145
|
-
this.element.addEventListener('focusin', this.onFocusHandler, true);
|
|
2146
|
-
this.element.addEventListener('focusout', this.onBlurHandler, true);
|
|
2147
|
-
this.on(events.contentChanged, this.contentChanged, this);
|
|
2148
|
-
this.on(events.resizeInitialized, this.updateResizeFlag, this);
|
|
2149
|
-
this.on(events.updateTbItemsStatus, this.updateStatus, this);
|
|
2150
|
-
this.on(events.cleanupResizeElements, this.cleanupResizeElements, this);
|
|
2151
|
-
this.on(events.updateValueOnIdle, this.updateValueOnIdle, this);
|
|
2152
|
-
this.on(events.autoResize, this.autoResize, this);
|
|
2153
|
-
if (this.iframeSettings.enable) {
|
|
2154
|
-
this.onLoadHandler = this.iframeEditableElemLoad.bind(this);
|
|
2155
|
-
this.contentModule.getEditPanel().addEventListener('load', this.onLoadHandler, true);
|
|
2156
|
-
}
|
|
2157
|
-
if (this.readonly && this.enabled) {
|
|
2158
|
-
return;
|
|
2159
|
-
}
|
|
2160
|
-
this.bindEvents();
|
|
2161
|
-
};
|
|
2162
|
-
RichTextEditor.prototype.restrict = function (e) {
|
|
2163
|
-
if (this.maxLength >= 0) {
|
|
2164
|
-
var element = this.editorMode === 'Markdown' ? this.contentModule.getText() :
|
|
2165
|
-
(this.getText().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, ''));
|
|
2166
|
-
if (!element) {
|
|
2167
|
-
return;
|
|
2168
|
-
}
|
|
2169
|
-
var array = [8, 16, 17, 37, 38, 39, 40, 46, 65];
|
|
2170
|
-
var arrayKey = void 0;
|
|
2171
|
-
for (var i = 0; i <= array.length - 1; i++) {
|
|
2172
|
-
if (e.which === array[i]) {
|
|
2173
|
-
if (e.ctrlKey && e.which === 65) {
|
|
2174
|
-
return;
|
|
2175
|
-
}
|
|
2176
|
-
else if (e.which !== 65) {
|
|
2177
|
-
arrayKey = array[i];
|
|
2178
|
-
return;
|
|
2179
|
-
}
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
if ((element.length >= this.maxLength && this.maxLength !== -1) && e.which !== arrayKey) {
|
|
2183
|
-
e.preventDefault();
|
|
2184
|
-
}
|
|
2185
|
-
}
|
|
2186
|
-
};
|
|
2187
|
-
RichTextEditor.prototype.beforeInputHandler = function (e) {
|
|
2188
|
-
if (this.maxLength >= 0) {
|
|
2189
|
-
var element = this.editorMode === 'Markdown' ? this.contentModule.getText() :
|
|
2190
|
-
(this.getText().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, ''));
|
|
2191
|
-
if (e.data && element.length >= this.maxLength && !this.isSpecialInputType(e)) {
|
|
2192
|
-
e.preventDefault();
|
|
2193
|
-
}
|
|
2194
|
-
}
|
|
2195
|
-
};
|
|
2196
|
-
RichTextEditor.prototype.isSpecialInputType = function (e) {
|
|
2197
|
-
var allowedKeys = [8, 16, 17, 37, 38, 39, 40, 46, 65];
|
|
2198
|
-
if (e.inputType) {
|
|
2199
|
-
return (e.inputType.indexOf('delete') !== -1 ||
|
|
2200
|
-
e.inputType.indexOf('backward') !== -1 ||
|
|
2201
|
-
e.inputType === 'insertLineBreak');
|
|
2202
|
-
}
|
|
2203
|
-
return allowedKeys.indexOf(e.which) !== -1;
|
|
2204
|
-
};
|
|
2205
|
-
RichTextEditor.prototype.bindEvents = function () {
|
|
2206
|
-
this.keyboardModule = new keyboard_1.KeyboardEvents(this.inputElement, {
|
|
2207
|
-
keyAction: this.keyDown.bind(this), keyConfigs: __assign({}, this.formatter.keyConfig, this.keyConfig), eventName: 'keydown'
|
|
2208
|
-
});
|
|
2209
|
-
if (this.userAgentData && this.userAgentData.getPlatform() === 'Android') {
|
|
2210
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'beforeinput', this.beforeInputHandler, this);
|
|
2211
|
-
}
|
|
2212
|
-
var formElement = ej2_base_2.closest(this.valueContainer, 'form');
|
|
2213
|
-
if (formElement) {
|
|
2214
|
-
ej2_base_1.EventHandler.add(formElement, 'reset', this.resetHandler, this);
|
|
2215
|
-
}
|
|
2216
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
|
|
2217
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'paste', this.onPaste, this);
|
|
2218
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'content-changed', this.contentChanged, this);
|
|
2219
|
-
this.mouseDownDebListener = ej2_base_4.debounce(this.mouseUp, 30);
|
|
2220
|
-
ej2_base_1.EventHandler.add(this.inputElement, ej2_base_1.Browser.touchEndEvent, this.mouseDownDebListener, this);
|
|
2221
|
-
ej2_base_1.EventHandler.add(this.inputElement, ej2_base_1.Browser.touchStartEvent, this.mouseDownHandler, this);
|
|
2222
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'input', this.inputHandler, this);
|
|
2223
|
-
this.wireContextEvent();
|
|
2224
|
-
this.formatter.editorManager.observer.on(CONSTANT.KEY_DOWN_HANDLER, this.editorKeyDown, this);
|
|
2225
|
-
this.element.ownerDocument.defaultView.addEventListener('resize', this.onResizeHandler, true);
|
|
2226
|
-
if (this.iframeSettings.enable) {
|
|
2227
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'focusin', this.focusHandler, this);
|
|
2228
|
-
ej2_base_1.EventHandler.add(this.inputElement, 'focusout', this.blurHandler, this);
|
|
2229
|
-
ej2_base_1.EventHandler.add(this.inputElement.ownerDocument, 'scroll', this.contentScrollHandler, this);
|
|
2230
|
-
ej2_base_1.EventHandler.add(this.inputElement.ownerDocument, ej2_base_1.Browser.touchStartEvent, this.onIframeMouseDown, this);
|
|
2231
|
-
ej2_base_1.EventHandler.add(this.contentModule.getPanel(), 'load', this.iframeLoadHandler, this);
|
|
2232
|
-
}
|
|
2233
|
-
this.wireScrollElementsEvents();
|
|
2234
|
-
};
|
|
2235
|
-
RichTextEditor.prototype.onIframeMouseDown = function (e) {
|
|
2236
|
-
this.isBlur = false;
|
|
2237
|
-
this.currentTarget = e.target;
|
|
2238
|
-
this.notify(events.iframeMouseDown, e);
|
|
2239
|
-
};
|
|
2240
|
-
RichTextEditor.prototype.inputHandler = function () {
|
|
2241
|
-
this.autoResize();
|
|
2242
|
-
};
|
|
2243
|
-
RichTextEditor.prototype.editorKeyDown = function (e) {
|
|
2244
|
-
switch (e.event.action) {
|
|
2245
|
-
case 'copy':
|
|
2246
|
-
this.onCopy();
|
|
2247
|
-
break;
|
|
2248
|
-
case 'cut':
|
|
2249
|
-
this.onCut();
|
|
2250
|
-
break;
|
|
2251
|
-
case 'tab':
|
|
2252
|
-
if (this.iframeSettings.enable) {
|
|
2253
|
-
this.isBlur = true;
|
|
2254
|
-
}
|
|
2255
|
-
break;
|
|
2256
|
-
}
|
|
2257
|
-
if (e.callBack && (e.event.action === 'copy' || e.event.action === 'cut' || e.event.action === 'delete')) {
|
|
2258
|
-
e.callBack({
|
|
2259
|
-
requestType: e.event.action,
|
|
2260
|
-
editorMode: 'HTML',
|
|
2261
|
-
event: e.event
|
|
2262
|
-
});
|
|
2263
|
-
}
|
|
2264
|
-
};
|
|
2265
|
-
RichTextEditor.prototype.unWireEvents = function () {
|
|
2266
|
-
this.element.removeEventListener('focusin', this.onFocusHandler, true);
|
|
2267
|
-
this.onFocusHandler = null;
|
|
2268
|
-
this.element.removeEventListener('focusout', this.onBlurHandler, true);
|
|
2269
|
-
this.onBlurHandler = null;
|
|
2270
|
-
this.off(events.contentChanged, this.contentChanged);
|
|
2271
|
-
this.off(events.resizeInitialized, this.updateResizeFlag);
|
|
2272
|
-
this.off(events.updateTbItemsStatus, this.updateStatus);
|
|
2273
|
-
this.off(events.cleanupResizeElements, this.cleanupResizeElements);
|
|
2274
|
-
this.off(events.updateValueOnIdle, this.updateValueOnIdle);
|
|
2275
|
-
this.off(events.autoResize, this.autoResize);
|
|
2276
|
-
if (this.iframeSettings.enable) {
|
|
2277
|
-
this.contentModule.getEditPanel().removeEventListener('load', this.onLoadHandler, true);
|
|
2278
|
-
this.onLoadHandler = null;
|
|
2279
|
-
}
|
|
2280
|
-
if (this.readonly && this.enabled) {
|
|
2281
|
-
return;
|
|
2282
|
-
}
|
|
2283
|
-
this.unbindEvents();
|
|
2284
|
-
};
|
|
2285
|
-
RichTextEditor.prototype.unbindEvents = function () {
|
|
2286
|
-
if (this.keyboardModule && !this.keyboardModule.isDestroyed) {
|
|
2287
|
-
this.keyboardModule.destroy();
|
|
2288
|
-
this.keyboardModule = null;
|
|
2289
|
-
}
|
|
2290
|
-
var formElement = ej2_base_2.closest(this.valueContainer, 'form');
|
|
2291
|
-
if (formElement) {
|
|
2292
|
-
ej2_base_1.EventHandler.remove(formElement, 'reset', this.resetHandler);
|
|
2293
|
-
}
|
|
2294
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
|
|
2295
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'paste', this.onPaste);
|
|
2296
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'content-changed', this.contentChanged);
|
|
2297
|
-
ej2_base_1.EventHandler.remove(this.inputElement, ej2_base_1.Browser.touchEndEvent, this.mouseDownDebListener);
|
|
2298
|
-
this.mouseDownDebListener = null;
|
|
2299
|
-
ej2_base_1.EventHandler.remove(this.inputElement, ej2_base_1.Browser.touchStartEvent, this.mouseDownHandler);
|
|
2300
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'input', this.inputHandler);
|
|
2301
|
-
ej2_base_1.EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
2302
|
-
this.unWireContextEvent();
|
|
2303
|
-
if (this.formatter) {
|
|
2304
|
-
this.formatter.editorManager.observer.off(CONSTANT.KEY_DOWN_HANDLER, this.editorKeyDown);
|
|
2305
|
-
}
|
|
2306
|
-
this.element.ownerDocument.defaultView.removeEventListener('resize', this.onResizeHandler, true);
|
|
2307
|
-
this.onResizeHandler = null;
|
|
2308
|
-
if (this.iframeSettings.enable) {
|
|
2309
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'focusin', this.focusHandler);
|
|
2310
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'focusout', this.blurHandler);
|
|
2311
|
-
ej2_base_1.EventHandler.remove(this.inputElement.ownerDocument, 'scroll', this.contentScrollHandler);
|
|
2312
|
-
ej2_base_1.EventHandler.remove(this.inputElement.ownerDocument, ej2_base_1.Browser.touchStartEvent, this.onIframeMouseDown);
|
|
2313
|
-
ej2_base_1.EventHandler.remove(this.contentModule.getPanel(), 'load', this.iframeLoadHandler);
|
|
2314
|
-
}
|
|
2315
|
-
if (this.userAgentData && this.userAgentData.getPlatform() === 'Android') {
|
|
2316
|
-
ej2_base_1.EventHandler.remove(this.inputElement, 'beforeinput', this.beforeInputHandler);
|
|
2317
|
-
}
|
|
2318
|
-
this.unWireScrollElementsEvents();
|
|
2319
|
-
};
|
|
2320
|
-
RichTextEditor.prototype.getCurrentFocus = function (e) {
|
|
2321
|
-
if (e.target === this.inputElement && document.activeElement === this.inputElement) {
|
|
2322
|
-
return 'editArea';
|
|
2323
|
-
}
|
|
2324
|
-
else if (e.target === this.getToolbarElement() || (!ej2_base_4.isNullOrUndefined(e.relatedTarget) && ej2_base_2.closest(e.relatedTarget, '.e-rte-toolbar') === this.getToolbarElement())) {
|
|
2325
|
-
return 'toolbar';
|
|
2326
|
-
}
|
|
2327
|
-
else if (e.target === this.valueContainer && document.activeElement === this.valueContainer) {
|
|
2328
|
-
return 'textArea';
|
|
2329
|
-
}
|
|
2330
|
-
else if (!ej2_base_4.isNullOrUndefined(e.target) && e.target.classList.contains(classes.CLS_RTE_SOURCE_CODE_TXTAREA)
|
|
2331
|
-
&& document.activeElement === e.target) {
|
|
2332
|
-
return 'sourceCode';
|
|
2333
|
-
}
|
|
2334
|
-
return 'outside';
|
|
2335
|
-
};
|
|
2336
|
-
RichTextEditor.prototype.resetToolbarTabIndex = function () {
|
|
2337
|
-
if (this.getToolbarElement()) {
|
|
2338
|
-
var toolbarItem = this.getToolbarElement().querySelectorAll('input,select,button,a,[tabindex]');
|
|
2339
|
-
for (var i = 0; i < toolbarItem.length; i++) {
|
|
2340
|
-
if ((!toolbarItem[i].classList.contains('e-rte-dropdown-btn') &&
|
|
2341
|
-
!toolbarItem[i].classList.contains('e-insert-table-btn')) &&
|
|
2342
|
-
(!toolbarItem[i].hasAttribute('tabindex') ||
|
|
2343
|
-
toolbarItem[i].getAttribute('tabindex') !== '-1')) {
|
|
2344
|
-
toolbarItem[i].setAttribute('tabindex', '-1');
|
|
2345
|
-
}
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
};
|
|
2349
|
-
RichTextEditor.prototype.getRenderedQuickToolbarElem = function () {
|
|
2350
|
-
if (!ej2_base_4.isNullOrUndefined(this.quickToolbarModule)) {
|
|
2351
|
-
var quickToolbars = this.quickToolbarModule.getQuickToolbarInstance();
|
|
2352
|
-
for (var i = 0; i < quickToolbars.length; i++) {
|
|
2353
|
-
if (quickToolbars[i] && quickToolbars[i].isRendered) {
|
|
2354
|
-
return quickToolbars[i].element;
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
return null;
|
|
2359
|
-
};
|
|
2360
|
-
RichTextEditor.prototype.iframeLoadHandler = function () {
|
|
2361
|
-
this.autoResize();
|
|
2362
|
-
};
|
|
2363
|
-
RichTextEditor.prototype.iframeEditableElemLoad = function () {
|
|
2364
|
-
this.autoResize();
|
|
2365
|
-
};
|
|
2366
|
-
__decorate([
|
|
2367
|
-
ej2_base_1.Complex({}, toolbar_settings_1.ToolbarSettings)
|
|
2368
|
-
], RichTextEditor.prototype, "toolbarSettings", void 0);
|
|
2369
|
-
__decorate([
|
|
2370
|
-
ej2_base_1.Complex({ enable: false, items: ['Paragraph', 'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'OrderedList', 'UnorderedList', 'CodeBlock', 'Blockquote'], popupWidth: '300px', popupHeight: '320px' }, slash_menu_settings_1.SlashMenuSettings)
|
|
2371
|
-
], RichTextEditor.prototype, "slashMenuSettings", void 0);
|
|
2372
|
-
__decorate([
|
|
2373
|
-
ej2_base_1.Complex({}, toolbar_settings_1.QuickToolbarSettings)
|
|
2374
|
-
], RichTextEditor.prototype, "quickToolbarSettings", void 0);
|
|
2375
|
-
__decorate([
|
|
2376
|
-
ej2_base_1.Complex({}, toolbar_settings_3.PasteCleanupSettings)
|
|
2377
|
-
], RichTextEditor.prototype, "pasteCleanupSettings", void 0);
|
|
2378
|
-
__decorate([
|
|
2379
|
-
ej2_base_1.Complex({}, toolbar_settings_1.FormatPainterSettings)
|
|
2380
|
-
], RichTextEditor.prototype, "formatPainterSettings", void 0);
|
|
2381
|
-
__decorate([
|
|
2382
|
-
ej2_base_1.Complex({}, toolbar_settings_1.EmojiSettings)
|
|
2383
|
-
], RichTextEditor.prototype, "emojiPickerSettings", void 0);
|
|
2384
|
-
__decorate([
|
|
2385
|
-
ej2_base_1.Complex({}, iframe_settings_1.IFrameSettings)
|
|
2386
|
-
], RichTextEditor.prototype, "iframeSettings", void 0);
|
|
2387
|
-
__decorate([
|
|
2388
|
-
ej2_base_1.Complex({}, toolbar_settings_1.ImageSettings)
|
|
2389
|
-
], RichTextEditor.prototype, "insertImageSettings", void 0);
|
|
2390
|
-
__decorate([
|
|
2391
|
-
ej2_base_1.Complex({}, toolbar_settings_1.ImportWord)
|
|
2392
|
-
], RichTextEditor.prototype, "importWord", void 0);
|
|
2393
|
-
__decorate([
|
|
2394
|
-
ej2_base_1.Complex({}, toolbar_settings_1.ExportWord)
|
|
2395
|
-
], RichTextEditor.prototype, "exportWord", void 0);
|
|
2396
|
-
__decorate([
|
|
2397
|
-
ej2_base_1.Complex({}, toolbar_settings_1.ExportPdf)
|
|
2398
|
-
], RichTextEditor.prototype, "exportPdf", void 0);
|
|
2399
|
-
__decorate([
|
|
2400
|
-
ej2_base_1.Complex({}, toolbar_settings_1.AudioSettings)
|
|
2401
|
-
], RichTextEditor.prototype, "insertAudioSettings", void 0);
|
|
2402
|
-
__decorate([
|
|
2403
|
-
ej2_base_1.Complex({}, toolbar_settings_1.VideoSettings)
|
|
2404
|
-
], RichTextEditor.prototype, "insertVideoSettings", void 0);
|
|
2405
|
-
__decorate([
|
|
2406
|
-
ej2_base_1.Complex({}, toolbar_settings_3.TableSettings)
|
|
2407
|
-
], RichTextEditor.prototype, "tableSettings", void 0);
|
|
2408
|
-
__decorate([
|
|
2409
|
-
ej2_base_2.Property(0)
|
|
2410
|
-
], RichTextEditor.prototype, "floatingToolbarOffset", void 0);
|
|
2411
|
-
__decorate([
|
|
2412
|
-
ej2_base_1.Complex({}, inline_mode_1.InlineMode)
|
|
2413
|
-
], RichTextEditor.prototype, "inlineMode", void 0);
|
|
2414
|
-
__decorate([
|
|
2415
|
-
ej2_base_1.Complex({}, toolbar_settings_2.FileManagerSettings)
|
|
2416
|
-
], RichTextEditor.prototype, "fileManagerSettings", void 0);
|
|
2417
|
-
__decorate([
|
|
2418
|
-
ej2_base_2.Property('100%')
|
|
2419
|
-
], RichTextEditor.prototype, "width", void 0);
|
|
2420
|
-
__decorate([
|
|
2421
|
-
ej2_base_2.Property(false)
|
|
2422
|
-
], RichTextEditor.prototype, "enablePersistence", void 0);
|
|
2423
|
-
__decorate([
|
|
2424
|
-
ej2_base_2.Property(true)
|
|
2425
|
-
], RichTextEditor.prototype, "showTooltip", void 0);
|
|
2426
|
-
__decorate([
|
|
2427
|
-
ej2_base_2.Property(false)
|
|
2428
|
-
], RichTextEditor.prototype, "enableResize", void 0);
|
|
2429
|
-
__decorate([
|
|
2430
|
-
ej2_base_2.Property({})
|
|
2431
|
-
], RichTextEditor.prototype, "htmlAttributes", void 0);
|
|
2432
|
-
__decorate([
|
|
2433
|
-
ej2_base_2.Property(null)
|
|
2434
|
-
], RichTextEditor.prototype, "placeholder", void 0);
|
|
2435
|
-
__decorate([
|
|
2436
|
-
ej2_base_2.Property(false)
|
|
2437
|
-
], RichTextEditor.prototype, "autoSaveOnIdle", void 0);
|
|
2438
|
-
__decorate([
|
|
2439
|
-
ej2_base_2.Property(false)
|
|
2440
|
-
], RichTextEditor.prototype, "readonly", void 0);
|
|
2441
|
-
__decorate([
|
|
2442
|
-
ej2_base_2.Property(true)
|
|
2443
|
-
], RichTextEditor.prototype, "enabled", void 0);
|
|
2444
|
-
__decorate([
|
|
2445
|
-
ej2_base_2.Property(true)
|
|
2446
|
-
], RichTextEditor.prototype, "enableHtmlSanitizer", void 0);
|
|
2447
|
-
__decorate([
|
|
2448
|
-
ej2_base_2.Property(false)
|
|
2449
|
-
], RichTextEditor.prototype, "enableHtmlEncode", void 0);
|
|
2450
|
-
__decorate([
|
|
2451
|
-
ej2_base_2.Property(false)
|
|
2452
|
-
], RichTextEditor.prototype, "enableXhtml", void 0);
|
|
2453
|
-
__decorate([
|
|
2454
|
-
ej2_base_2.Property('auto')
|
|
2455
|
-
], RichTextEditor.prototype, "height", void 0);
|
|
2456
|
-
__decorate([
|
|
2457
|
-
ej2_base_2.Property(null)
|
|
2458
|
-
], RichTextEditor.prototype, "cssClass", void 0);
|
|
2459
|
-
__decorate([
|
|
2460
|
-
ej2_base_2.Property(null)
|
|
2461
|
-
], RichTextEditor.prototype, "value", void 0);
|
|
2462
|
-
__decorate([
|
|
2463
|
-
ej2_base_2.Property('P')
|
|
2464
|
-
], RichTextEditor.prototype, "enterKey", void 0);
|
|
2465
|
-
__decorate([
|
|
2466
|
-
ej2_base_2.Property('BR')
|
|
2467
|
-
], RichTextEditor.prototype, "shiftEnterKey", void 0);
|
|
2468
|
-
__decorate([
|
|
2469
|
-
ej2_base_2.Property(30)
|
|
2470
|
-
], RichTextEditor.prototype, "undoRedoSteps", void 0);
|
|
2471
|
-
__decorate([
|
|
2472
|
-
ej2_base_2.Property(300)
|
|
2473
|
-
], RichTextEditor.prototype, "undoRedoTimer", void 0);
|
|
2474
|
-
__decorate([
|
|
2475
|
-
ej2_base_2.Property('HTML')
|
|
2476
|
-
], RichTextEditor.prototype, "editorMode", void 0);
|
|
2477
|
-
__decorate([
|
|
2478
|
-
ej2_base_2.Property(null)
|
|
2479
|
-
], RichTextEditor.prototype, "keyConfig", void 0);
|
|
2480
|
-
__decorate([
|
|
2481
|
-
ej2_base_2.Property(false)
|
|
2482
|
-
], RichTextEditor.prototype, "showCharCount", void 0);
|
|
2483
|
-
__decorate([
|
|
2484
|
-
ej2_base_2.Property(false)
|
|
2485
|
-
], RichTextEditor.prototype, "enableTabKey", void 0);
|
|
2486
|
-
__decorate([
|
|
2487
|
-
ej2_base_2.Property(false)
|
|
2488
|
-
], RichTextEditor.prototype, "enableAutoUrl", void 0);
|
|
2489
|
-
__decorate([
|
|
2490
|
-
ej2_base_2.Property(-1)
|
|
2491
|
-
], RichTextEditor.prototype, "maxLength", void 0);
|
|
2492
|
-
__decorate([
|
|
2493
|
-
ej2_base_1.Complex({}, toolbar_settings_1.Format)
|
|
2494
|
-
], RichTextEditor.prototype, "format", void 0);
|
|
2495
|
-
__decorate([
|
|
2496
|
-
ej2_base_1.Complex({}, toolbar_settings_1.NumberFormatList)
|
|
2497
|
-
], RichTextEditor.prototype, "numberFormatList", void 0);
|
|
2498
|
-
__decorate([
|
|
2499
|
-
ej2_base_1.Complex({}, toolbar_settings_1.BulletFormatList)
|
|
2500
|
-
], RichTextEditor.prototype, "bulletFormatList", void 0);
|
|
2501
|
-
__decorate([
|
|
2502
|
-
ej2_base_1.Complex({}, toolbar_settings_1.FontFamily)
|
|
2503
|
-
], RichTextEditor.prototype, "fontFamily", void 0);
|
|
2504
|
-
__decorate([
|
|
2505
|
-
ej2_base_1.Complex({}, toolbar_settings_1.FontSize)
|
|
2506
|
-
], RichTextEditor.prototype, "fontSize", void 0);
|
|
2507
|
-
__decorate([
|
|
2508
|
-
ej2_base_1.Complex({}, toolbar_settings_4.FontColor)
|
|
2509
|
-
], RichTextEditor.prototype, "fontColor", void 0);
|
|
2510
|
-
__decorate([
|
|
2511
|
-
ej2_base_1.Complex({}, toolbar_settings_4.BackgroundColor)
|
|
2512
|
-
], RichTextEditor.prototype, "backgroundColor", void 0);
|
|
2513
|
-
__decorate([
|
|
2514
|
-
ej2_base_2.Property(null)
|
|
2515
|
-
], RichTextEditor.prototype, "valueTemplate", void 0);
|
|
2516
|
-
__decorate([
|
|
2517
|
-
ej2_base_2.Property(10000)
|
|
2518
|
-
], RichTextEditor.prototype, "saveInterval", void 0);
|
|
2519
|
-
__decorate([
|
|
2520
|
-
ej2_base_3.Event()
|
|
2521
|
-
], RichTextEditor.prototype, "actionBegin", void 0);
|
|
2522
|
-
__decorate([
|
|
2523
|
-
ej2_base_3.Event()
|
|
2524
|
-
], RichTextEditor.prototype, "actionComplete", void 0);
|
|
2525
|
-
__decorate([
|
|
2526
|
-
ej2_base_3.Event()
|
|
2527
|
-
], RichTextEditor.prototype, "beforeDialogOpen", void 0);
|
|
2528
|
-
__decorate([
|
|
2529
|
-
ej2_base_3.Event()
|
|
2530
|
-
], RichTextEditor.prototype, "dialogOpen", void 0);
|
|
2531
|
-
__decorate([
|
|
2532
|
-
ej2_base_3.Event()
|
|
2533
|
-
], RichTextEditor.prototype, "beforeDialogClose", void 0);
|
|
2534
|
-
__decorate([
|
|
2535
|
-
ej2_base_3.Event()
|
|
2536
|
-
], RichTextEditor.prototype, "dialogClose", void 0);
|
|
2537
|
-
__decorate([
|
|
2538
|
-
ej2_base_3.Event()
|
|
2539
|
-
], RichTextEditor.prototype, "beforeQuickToolbarOpen", void 0);
|
|
2540
|
-
__decorate([
|
|
2541
|
-
ej2_base_3.Event()
|
|
2542
|
-
], RichTextEditor.prototype, "quickToolbarOpen", void 0);
|
|
2543
|
-
__decorate([
|
|
2544
|
-
ej2_base_3.Event()
|
|
2545
|
-
], RichTextEditor.prototype, "quickToolbarClose", void 0);
|
|
2546
|
-
__decorate([
|
|
2547
|
-
ej2_base_3.Event()
|
|
2548
|
-
], RichTextEditor.prototype, "toolbarStatusUpdate", void 0);
|
|
2549
|
-
__decorate([
|
|
2550
|
-
ej2_base_3.Event()
|
|
2551
|
-
], RichTextEditor.prototype, "updatedToolbarStatus", void 0);
|
|
2552
|
-
__decorate([
|
|
2553
|
-
ej2_base_3.Event()
|
|
2554
|
-
], RichTextEditor.prototype, "imageSelected", void 0);
|
|
2555
|
-
__decorate([
|
|
2556
|
-
ej2_base_3.Event()
|
|
2557
|
-
], RichTextEditor.prototype, "beforeImageUpload", void 0);
|
|
2558
|
-
__decorate([
|
|
2559
|
-
ej2_base_3.Event()
|
|
2560
|
-
], RichTextEditor.prototype, "imageUploading", void 0);
|
|
2561
|
-
__decorate([
|
|
2562
|
-
ej2_base_3.Event()
|
|
2563
|
-
], RichTextEditor.prototype, "imageUploadSuccess", void 0);
|
|
2564
|
-
__decorate([
|
|
2565
|
-
ej2_base_3.Event()
|
|
2566
|
-
], RichTextEditor.prototype, "imageUploadFailed", void 0);
|
|
2567
|
-
__decorate([
|
|
2568
|
-
ej2_base_3.Event()
|
|
2569
|
-
], RichTextEditor.prototype, "imageRemoving", void 0);
|
|
2570
|
-
__decorate([
|
|
2571
|
-
ej2_base_3.Event()
|
|
2572
|
-
], RichTextEditor.prototype, "afterImageDelete", void 0);
|
|
2573
|
-
__decorate([
|
|
2574
|
-
ej2_base_3.Event()
|
|
2575
|
-
], RichTextEditor.prototype, "fileSelected", void 0);
|
|
2576
|
-
__decorate([
|
|
2577
|
-
ej2_base_3.Event()
|
|
2578
|
-
], RichTextEditor.prototype, "beforeFileUpload", void 0);
|
|
2579
|
-
__decorate([
|
|
2580
|
-
ej2_base_3.Event()
|
|
2581
|
-
], RichTextEditor.prototype, "fileUploading", void 0);
|
|
2582
|
-
__decorate([
|
|
2583
|
-
ej2_base_3.Event()
|
|
2584
|
-
], RichTextEditor.prototype, "fileUploadSuccess", void 0);
|
|
2585
|
-
__decorate([
|
|
2586
|
-
ej2_base_3.Event()
|
|
2587
|
-
], RichTextEditor.prototype, "fileUploadFailed", void 0);
|
|
2588
|
-
__decorate([
|
|
2589
|
-
ej2_base_3.Event()
|
|
2590
|
-
], RichTextEditor.prototype, "fileRemoving", void 0);
|
|
2591
|
-
__decorate([
|
|
2592
|
-
ej2_base_3.Event()
|
|
2593
|
-
], RichTextEditor.prototype, "afterMediaDelete", void 0);
|
|
2594
|
-
__decorate([
|
|
2595
|
-
ej2_base_3.Event()
|
|
2596
|
-
], RichTextEditor.prototype, "created", void 0);
|
|
2597
|
-
__decorate([
|
|
2598
|
-
ej2_base_3.Event()
|
|
2599
|
-
], RichTextEditor.prototype, "destroyed", void 0);
|
|
2600
|
-
__decorate([
|
|
2601
|
-
ej2_base_3.Event()
|
|
2602
|
-
], RichTextEditor.prototype, "beforeSanitizeHtml", void 0);
|
|
2603
|
-
__decorate([
|
|
2604
|
-
ej2_base_3.Event()
|
|
2605
|
-
], RichTextEditor.prototype, "blur", void 0);
|
|
2606
|
-
__decorate([
|
|
2607
|
-
ej2_base_3.Event()
|
|
2608
|
-
], RichTextEditor.prototype, "toolbarClick", void 0);
|
|
2609
|
-
__decorate([
|
|
2610
|
-
ej2_base_3.Event()
|
|
2611
|
-
], RichTextEditor.prototype, "focus", void 0);
|
|
2612
|
-
__decorate([
|
|
2613
|
-
ej2_base_3.Event()
|
|
2614
|
-
], RichTextEditor.prototype, "change", void 0);
|
|
2615
|
-
__decorate([
|
|
2616
|
-
ej2_base_3.Event()
|
|
2617
|
-
], RichTextEditor.prototype, "resizing", void 0);
|
|
2618
|
-
__decorate([
|
|
2619
|
-
ej2_base_3.Event()
|
|
2620
|
-
], RichTextEditor.prototype, "resizeStart", void 0);
|
|
2621
|
-
__decorate([
|
|
2622
|
-
ej2_base_3.Event()
|
|
2623
|
-
], RichTextEditor.prototype, "resizeStop", void 0);
|
|
2624
|
-
__decorate([
|
|
2625
|
-
ej2_base_3.Event()
|
|
2626
|
-
], RichTextEditor.prototype, "beforePasteCleanup", void 0);
|
|
2627
|
-
__decorate([
|
|
2628
|
-
ej2_base_3.Event()
|
|
2629
|
-
], RichTextEditor.prototype, "afterPasteCleanup", void 0);
|
|
2630
|
-
__decorate([
|
|
2631
|
-
ej2_base_3.Event()
|
|
2632
|
-
], RichTextEditor.prototype, "beforeImageDrop", void 0);
|
|
2633
|
-
__decorate([
|
|
2634
|
-
ej2_base_2.Property(null)
|
|
2635
|
-
], RichTextEditor.prototype, "formatter", void 0);
|
|
2636
|
-
__decorate([
|
|
2637
|
-
ej2_base_3.Event()
|
|
2638
|
-
], RichTextEditor.prototype, "slashMenuItemSelect", void 0);
|
|
2639
|
-
RichTextEditor = __decorate([
|
|
2640
|
-
ej2_base_2.NotifyPropertyChanges
|
|
2641
|
-
], RichTextEditor);
|
|
2642
|
-
return RichTextEditor;
|
|
2643
|
-
}(ej2_base_1.Component));
|
|
2644
|
-
exports.RichTextEditor = RichTextEditor;
|
|
2645
|
-
});
|