@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,1071 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "../base/constant", "@syncfusion/ej2-popups", "@syncfusion/ej2-buttons", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "../base/classes", "../base/classes", "../../common/config", "../../selection/selection", "./../../common/constant", "../base/enum", "@syncfusion/ej2-inputs", "../base/classes", "../base/util", "../../common/util"], function (require, exports, events, ej2_popups_1, ej2_buttons_1, ej2_base_1, ej2_base_2, classes_1, classes_2, config_1, selection_1, EVENTS, enum_1, ej2_inputs_1, classes, util_1, util_2) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var PasteCleanup = (function () {
|
|
5
|
-
function PasteCleanup(parent, serviceLocator) {
|
|
6
|
-
this.isNotFromHtml = false;
|
|
7
|
-
this.containsHtml = false;
|
|
8
|
-
this.cropImageData = [];
|
|
9
|
-
this.plainTextContent = '';
|
|
10
|
-
this.parent = parent;
|
|
11
|
-
this.locator = serviceLocator;
|
|
12
|
-
this.renderFactory = this.locator.getService('rendererFactory');
|
|
13
|
-
this.i10n = serviceLocator.getService('rteLocale');
|
|
14
|
-
this.dialogRenderObj = serviceLocator.getService('dialogRenderObject');
|
|
15
|
-
this.addEventListener();
|
|
16
|
-
this.isDestroyed = false;
|
|
17
|
-
}
|
|
18
|
-
PasteCleanup.prototype.addEventListener = function () {
|
|
19
|
-
this.nodeSelectionObj = new selection_1.NodeSelection(this.parent.inputElement);
|
|
20
|
-
if (this.parent.isDestroyed) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
this.parent.on(events.pasteClean, this.pasteClean, this);
|
|
24
|
-
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
25
|
-
this.parent.on(events.destroy, this.destroy, this);
|
|
26
|
-
this.parent.on(events.docClick, this.docClick, this);
|
|
27
|
-
};
|
|
28
|
-
PasteCleanup.prototype.destroy = function () {
|
|
29
|
-
if (this.isDestroyed) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (this.fireFoxUploadTime) {
|
|
33
|
-
clearTimeout(this.fireFoxUploadTime);
|
|
34
|
-
this.fireFoxUploadTime = null;
|
|
35
|
-
}
|
|
36
|
-
if (this.refreshPopupTime) {
|
|
37
|
-
clearTimeout(this.refreshPopupTime);
|
|
38
|
-
this.refreshPopupTime = null;
|
|
39
|
-
}
|
|
40
|
-
if (this.popupCloseTime) {
|
|
41
|
-
clearTimeout(this.popupCloseTime);
|
|
42
|
-
this.popupCloseTime = null;
|
|
43
|
-
}
|
|
44
|
-
if (this.failureTime) {
|
|
45
|
-
clearTimeout(this.failureTime);
|
|
46
|
-
this.failureTime = null;
|
|
47
|
-
}
|
|
48
|
-
if (this.iframeUploadTime) {
|
|
49
|
-
clearTimeout(this.iframeUploadTime);
|
|
50
|
-
this.iframeUploadTime = null;
|
|
51
|
-
}
|
|
52
|
-
this.removeEventListener();
|
|
53
|
-
if (this.popupObj && !this.popupObj.isDestroyed) {
|
|
54
|
-
this.popupObj.destroy();
|
|
55
|
-
this.popupObj = null;
|
|
56
|
-
}
|
|
57
|
-
if (this.uploadObj && !this.uploadObj.isDestroyed) {
|
|
58
|
-
this.uploadObj.destroy();
|
|
59
|
-
this.uploadObj = null;
|
|
60
|
-
}
|
|
61
|
-
if (this.keepRadioButton && !this.keepRadioButton.isDestroyed) {
|
|
62
|
-
this.keepRadioButton.destroy();
|
|
63
|
-
this.keepRadioButton = null;
|
|
64
|
-
}
|
|
65
|
-
if (this.cleanRadioButton && !this.cleanRadioButton.isDestroyed) {
|
|
66
|
-
this.cleanRadioButton.destroy();
|
|
67
|
-
this.cleanRadioButton = null;
|
|
68
|
-
}
|
|
69
|
-
if (this.plainTextRadioButton && !this.plainTextRadioButton.isDestroyed) {
|
|
70
|
-
this.plainTextRadioButton.destroy();
|
|
71
|
-
this.plainTextRadioButton = null;
|
|
72
|
-
}
|
|
73
|
-
this.isDestroyed = true;
|
|
74
|
-
this.plainTextContent = '';
|
|
75
|
-
};
|
|
76
|
-
PasteCleanup.prototype.removeEventListener = function () {
|
|
77
|
-
this.parent.off(events.pasteClean, this.pasteClean);
|
|
78
|
-
this.parent.off(events.bindCssClass, this.setCssClass);
|
|
79
|
-
this.parent.off(events.destroy, this.destroy);
|
|
80
|
-
this.parent.off(events.docClick, this.docClick);
|
|
81
|
-
};
|
|
82
|
-
PasteCleanup.prototype.pasteClean = function (e) {
|
|
83
|
-
var _this = this;
|
|
84
|
-
var args = {
|
|
85
|
-
requestType: 'Paste',
|
|
86
|
-
editorMode: this.parent.editorMode,
|
|
87
|
-
event: e
|
|
88
|
-
};
|
|
89
|
-
var value = null;
|
|
90
|
-
var imageproperties;
|
|
91
|
-
var allowedTypes = this.parent.insertImageSettings.allowedTypes;
|
|
92
|
-
if (e.args && !ej2_base_1.isNullOrUndefined(e.args.clipboardData)) {
|
|
93
|
-
value = e.args.clipboardData.getData('text/html');
|
|
94
|
-
if (e.args.clipboardData.getData('text/plain')) {
|
|
95
|
-
this.plainTextContent = e.args.clipboardData.getData('text/plain');
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (e.args && value !== null && this.parent.editorMode === 'HTML') {
|
|
99
|
-
var file = void 0;
|
|
100
|
-
if (value.length === 0) {
|
|
101
|
-
var htmlRegex = new RegExp(/<\/[a-z][\s\S]*>/i);
|
|
102
|
-
value = e.args.clipboardData.getData('text/plain');
|
|
103
|
-
this.parent.trigger(events.beforePasteCleanup, { value: value });
|
|
104
|
-
this.isNotFromHtml = value !== '' ? true : false;
|
|
105
|
-
value = value.replace(/</g, '<');
|
|
106
|
-
value = value.replace(/>/g, '>');
|
|
107
|
-
this.containsHtml = htmlRegex.test(value);
|
|
108
|
-
this.plainTextContent = value;
|
|
109
|
-
file = e && e.args.clipboardData &&
|
|
110
|
-
e.args.clipboardData.items.length > 0 ?
|
|
111
|
-
(e.args.clipboardData.items[0].getAsFile() === null ?
|
|
112
|
-
(!ej2_base_1.isNullOrUndefined(e.args.clipboardData.items[1]) ?
|
|
113
|
-
e.args.clipboardData.items[1].getAsFile() : null) :
|
|
114
|
-
e.args.clipboardData.items[0].getAsFile()) : null;
|
|
115
|
-
if (file) {
|
|
116
|
-
var fileNameParts = file.name;
|
|
117
|
-
var imgType_1 = fileNameParts.substring(fileNameParts.lastIndexOf('.'));
|
|
118
|
-
if (allowedTypes.every(function (type) { return type.toLowerCase() !== imgType_1; })) {
|
|
119
|
-
e.args.preventDefault();
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
this.parent.notify(events.paste, {
|
|
124
|
-
file: file,
|
|
125
|
-
args: e.args,
|
|
126
|
-
text: value,
|
|
127
|
-
callBack: function (b) {
|
|
128
|
-
imageproperties = b;
|
|
129
|
-
if (typeof (imageproperties) === 'object') {
|
|
130
|
-
_this.parent.formatter.editorManager.execCommand('Images', 'Image', e.args, _this.imageFormatting.bind(_this, args), 'pasteCleanup', imageproperties, 'pasteCleanupModule');
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
value = imageproperties;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
if (!htmlRegex.test(value)) {
|
|
138
|
-
var divElement = this.parent.createElement('div');
|
|
139
|
-
divElement.innerHTML = this.splitBreakLine(value);
|
|
140
|
-
value = divElement.innerHTML;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
else if (value.length > 0) {
|
|
144
|
-
this.parent.trigger(events.beforePasteCleanup, { value: value });
|
|
145
|
-
this.parent.formatter.editorManager.observer.notify(EVENTS.MS_WORD_CLEANUP, {
|
|
146
|
-
args: e.args,
|
|
147
|
-
text: e.text,
|
|
148
|
-
allowedStylePropertiesArray: this.parent.pasteCleanupSettings.allowedStyleProps,
|
|
149
|
-
callBack: function (a, cropImageData, pasteTableSource) {
|
|
150
|
-
args.pasteTableSource = pasteTableSource;
|
|
151
|
-
value = a.trim();
|
|
152
|
-
_this.cropImageData = cropImageData;
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
if (value !== null && value !== '') {
|
|
157
|
-
value = value.replace(/<base[^>]*>/g, '');
|
|
158
|
-
}
|
|
159
|
-
this.contentRenderer = this.renderFactory.getRenderer(enum_1.RenderType.Content);
|
|
160
|
-
var currentDocument = this.contentRenderer.getDocument();
|
|
161
|
-
var range = this.nodeSelectionObj.getRange(currentDocument);
|
|
162
|
-
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
163
|
-
var tempDivElem = this.parent.createElement('div');
|
|
164
|
-
tempDivElem.innerHTML = value;
|
|
165
|
-
var unsupportedImg = tempDivElem.querySelectorAll('.e-rte-image-unsupported');
|
|
166
|
-
for (var index = 0; index < unsupportedImg.length; index++) {
|
|
167
|
-
unsupportedImg[index].setAttribute('alt', this.i10n.getConstant('unsupportedImage'));
|
|
168
|
-
unsupportedImg[index].classList.remove('e-rte-image-unsupported');
|
|
169
|
-
}
|
|
170
|
-
value = tempDivElem.innerHTML;
|
|
171
|
-
var isValueNotEmpty = tempDivElem.textContent !== '' || !ej2_base_1.isNullOrUndefined(tempDivElem.querySelector('img')) ||
|
|
172
|
-
!ej2_base_1.isNullOrUndefined(tempDivElem.querySelector('table'));
|
|
173
|
-
this.parent.notify(events.cleanupResizeElements, {
|
|
174
|
-
value: value,
|
|
175
|
-
callBack: function (currentValue) {
|
|
176
|
-
value = currentValue;
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
if (this.parent.pasteCleanupSettings.prompt && !e.isPlainPaste) {
|
|
180
|
-
if (isValueNotEmpty) {
|
|
181
|
-
e.args.preventDefault();
|
|
182
|
-
this.pasteDialog(value, args);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
186
|
-
e.args.preventDefault();
|
|
187
|
-
this.plainFormatting(value, args);
|
|
188
|
-
}
|
|
189
|
-
else if (this.parent.pasteCleanupSettings.keepFormat || e.isPlainPaste) {
|
|
190
|
-
e.args.preventDefault();
|
|
191
|
-
this.formatting(value, false, args);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
e.args.preventDefault();
|
|
195
|
-
this.formatting(value, true, args);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
PasteCleanup.prototype.splitBreakLine = function (value) {
|
|
200
|
-
var enterSplitText = value.split('\r\n\r\n');
|
|
201
|
-
var finalText = '';
|
|
202
|
-
var startNode = this.parent.enterKey === 'P' ? '<p>' : (this.parent.enterKey === 'DIV' ? '<div>' : '');
|
|
203
|
-
var endNode = this.parent.enterKey === 'P' ? '</p>' : (this.parent.enterKey === 'DIV' ? '</div>' : '<br>');
|
|
204
|
-
for (var i = 0; i < enterSplitText.length; i++) {
|
|
205
|
-
var content = enterSplitText[i];
|
|
206
|
-
var contentWithSpace = this.makeSpace(content);
|
|
207
|
-
var contentWithLineBreak = contentWithSpace.replace(/\r\n|\n/g, '<br>');
|
|
208
|
-
if (i === 0) {
|
|
209
|
-
if (this.parent.enterKey === 'BR' && !contentWithLineBreak.endsWith('<br>')) {
|
|
210
|
-
finalText += (contentWithLineBreak + endNode);
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
finalText += contentWithLineBreak;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
if (this.parent.enterKey === 'BR') {
|
|
218
|
-
if (i === enterSplitText.length - 1) {
|
|
219
|
-
finalText += (contentWithLineBreak + endNode);
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
finalText += (contentWithLineBreak + endNode + endNode);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
finalText += startNode + contentWithLineBreak + endNode;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return finalText;
|
|
231
|
-
};
|
|
232
|
-
PasteCleanup.prototype.makeSpace = function (text) {
|
|
233
|
-
var spacedContent = '';
|
|
234
|
-
if (text === '') {
|
|
235
|
-
return text;
|
|
236
|
-
}
|
|
237
|
-
var lineBreakSplitText = text.split(' ');
|
|
238
|
-
for (var i = 0; i < lineBreakSplitText.length; i++) {
|
|
239
|
-
var currentText = lineBreakSplitText[i];
|
|
240
|
-
if (currentText === '') {
|
|
241
|
-
spacedContent += ' ';
|
|
242
|
-
}
|
|
243
|
-
else if (currentText === '\t') {
|
|
244
|
-
spacedContent += ' ';
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
if (i > 0 && i < lineBreakSplitText.length) {
|
|
248
|
-
spacedContent += ' ';
|
|
249
|
-
}
|
|
250
|
-
spacedContent += currentText;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
spacedContent = spacedContent.replace(/\t/g, ' ');
|
|
254
|
-
spacedContent = spacedContent.replace(/ /g, ' ');
|
|
255
|
-
return spacedContent;
|
|
256
|
-
};
|
|
257
|
-
PasteCleanup.prototype.imgUploading = function (elm) {
|
|
258
|
-
var allImgElm = elm.querySelectorAll('.pasteContent_Img');
|
|
259
|
-
if (this.parent.insertImageSettings.saveUrl && allImgElm.length > 0) {
|
|
260
|
-
var base64Src = [];
|
|
261
|
-
var imgName = [];
|
|
262
|
-
var uploadImg = [];
|
|
263
|
-
for (var i = 0; i < allImgElm.length; i++) {
|
|
264
|
-
if (!ej2_base_1.isNullOrUndefined(allImgElm[i].getAttribute('src')) &&
|
|
265
|
-
allImgElm[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
|
|
266
|
-
base64Src.push(allImgElm[i].getAttribute('src'));
|
|
267
|
-
imgName.push(ej2_base_2.getUniqueID('rte_image'));
|
|
268
|
-
uploadImg.push(allImgElm[i]);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
var fileList = [];
|
|
272
|
-
for (var i = 0; i < base64Src.length; i++) {
|
|
273
|
-
fileList.push(this.base64ToFile(base64Src[i], imgName[i]));
|
|
274
|
-
}
|
|
275
|
-
for (var i = 0; i < fileList.length; i++) {
|
|
276
|
-
this.uploadMethod(fileList[i], uploadImg[i]);
|
|
277
|
-
}
|
|
278
|
-
if (ej2_base_1.isNullOrUndefined(this.parent.insertImageSettings.path) &&
|
|
279
|
-
this.parent.insertImageSettings.saveFormat === 'Blob') {
|
|
280
|
-
this.getBlob(allImgElm);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
else if (this.parent.insertImageSettings.saveFormat === 'Blob') {
|
|
284
|
-
this.getBlob(allImgElm);
|
|
285
|
-
}
|
|
286
|
-
var allImgElmId = elm.querySelectorAll('.pasteContent_Img');
|
|
287
|
-
for (var i = 0; i < allImgElmId.length; i++) {
|
|
288
|
-
allImgElmId[i].classList.remove('pasteContent_Img');
|
|
289
|
-
if (allImgElmId[i].getAttribute('class').trim() === '') {
|
|
290
|
-
allImgElm[i].removeAttribute('class');
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
PasteCleanup.prototype.getBlob = function (allImgElm) {
|
|
295
|
-
for (var i = 0; i < allImgElm.length; i++) {
|
|
296
|
-
if (!ej2_base_1.isNullOrUndefined(allImgElm[i].getAttribute('src')) &&
|
|
297
|
-
allImgElm[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
|
|
298
|
-
var blopUrl = URL.createObjectURL(util_1.convertToBlob(allImgElm[i].getAttribute('src')));
|
|
299
|
-
allImgElm[i].setAttribute('src', blopUrl);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
PasteCleanup.prototype.toolbarEnableDisable = function (state) {
|
|
304
|
-
if (!this.parent.inlineMode.enable) {
|
|
305
|
-
this.parent.toolbarModule.baseToolbar.toolbarObj.disable(state);
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
PasteCleanup.prototype.uploadMethod = function (file, imgElem) {
|
|
309
|
-
var _this = this;
|
|
310
|
-
imgElem.style.opacity = '0.5';
|
|
311
|
-
var popupEle = this.parent.createElement('div');
|
|
312
|
-
this.parent.rootContainer.appendChild(popupEle);
|
|
313
|
-
var contentEle = this.parent.createElement('input', {
|
|
314
|
-
id: this.parent.getID() + '_upload', attrs: { type: 'File', name: 'UploadFiles' }
|
|
315
|
-
});
|
|
316
|
-
this.popupObj = new ej2_popups_1.Popup(popupEle, {
|
|
317
|
-
relateTo: imgElem,
|
|
318
|
-
height: '85px',
|
|
319
|
-
width: '300px',
|
|
320
|
-
content: contentEle,
|
|
321
|
-
viewPortElement: this.parent.inputElement,
|
|
322
|
-
enableRtl: this.parent.enableRtl,
|
|
323
|
-
zIndex: 10001,
|
|
324
|
-
close: function (event) {
|
|
325
|
-
_this.parent.isBlur = false;
|
|
326
|
-
_this.popupObj.destroy();
|
|
327
|
-
ej2_base_1.detach(_this.popupObj.element);
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
this.popupObj.element.style.display = 'none';
|
|
331
|
-
ej2_base_1.addClass([this.popupObj.element], [classes.CLS_POPUP_OPEN, classes.CLS_RTE_UPLOAD_POPUP]);
|
|
332
|
-
if (!ej2_base_1.isNullOrUndefined(this.parent.cssClass)) {
|
|
333
|
-
ej2_base_1.addClass([this.popupObj.element], this.parent.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
334
|
-
}
|
|
335
|
-
var timeOut = file.size > 1000000 ? 300 : 100;
|
|
336
|
-
this.refreshPopupTime = setTimeout(function () {
|
|
337
|
-
_this.refreshPopup(imgElem, _this.popupObj);
|
|
338
|
-
}, timeOut);
|
|
339
|
-
this.uploadObj = new ej2_inputs_1.Uploader({
|
|
340
|
-
asyncSettings: {
|
|
341
|
-
saveUrl: this.parent.insertImageSettings.saveUrl,
|
|
342
|
-
removeUrl: this.parent.insertImageSettings.removeUrl
|
|
343
|
-
},
|
|
344
|
-
cssClass: classes.CLS_RTE_DIALOG_UPLOAD,
|
|
345
|
-
dropArea: this.parent.inputElement,
|
|
346
|
-
allowedExtensions: this.parent.insertImageSettings.allowedTypes.toString(),
|
|
347
|
-
success: function (e) {
|
|
348
|
-
_this.popupClose(_this.popupObj, _this.uploadObj, imgElem, e);
|
|
349
|
-
},
|
|
350
|
-
uploading: function (e) {
|
|
351
|
-
if (!_this.parent.isServerRendered) {
|
|
352
|
-
_this.parent.trigger(events.imageUploading, e, function (imageUploadingArgs) {
|
|
353
|
-
if (imageUploadingArgs.cancel) {
|
|
354
|
-
if (!ej2_base_1.isNullOrUndefined(imgElem)) {
|
|
355
|
-
ej2_base_1.detach(imgElem);
|
|
356
|
-
}
|
|
357
|
-
if (!ej2_base_1.isNullOrUndefined(_this.popupObj.element)) {
|
|
358
|
-
ej2_base_1.detach(_this.popupObj.element);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
362
|
-
_this.parent.inputElement.contentEditable = 'false';
|
|
363
|
-
}
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
beforeUpload: function (args) {
|
|
368
|
-
_this.parent.trigger(events.beforeImageUpload, args);
|
|
369
|
-
_this.toolbarEnableDisable(true);
|
|
370
|
-
},
|
|
371
|
-
failure: function (e) {
|
|
372
|
-
_this.failureTime = setTimeout(function () {
|
|
373
|
-
_this.uploadFailure(imgElem, _this.uploadObj, _this.popupObj, e);
|
|
374
|
-
}, 900);
|
|
375
|
-
},
|
|
376
|
-
canceling: function () {
|
|
377
|
-
_this.parent.inputElement.contentEditable = 'true';
|
|
378
|
-
if (imgElem.nextSibling.textContent === ' ') {
|
|
379
|
-
ej2_base_1.detach(imgElem.nextSibling);
|
|
380
|
-
}
|
|
381
|
-
ej2_base_1.detach(imgElem);
|
|
382
|
-
_this.popupObj.close();
|
|
383
|
-
},
|
|
384
|
-
selected: function (e) {
|
|
385
|
-
e.cancel = true;
|
|
386
|
-
},
|
|
387
|
-
removing: function () {
|
|
388
|
-
_this.parent.inputElement.contentEditable = 'true';
|
|
389
|
-
if (imgElem.nextSibling.textContent === ' ') {
|
|
390
|
-
ej2_base_1.detach(imgElem.nextSibling);
|
|
391
|
-
}
|
|
392
|
-
ej2_base_1.detach(imgElem);
|
|
393
|
-
_this.popupObj.close();
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
this.uploadObj.appendTo(this.popupObj.element.childNodes[0]);
|
|
397
|
-
var fileInfo = [{
|
|
398
|
-
name: file.name,
|
|
399
|
-
rawFile: file,
|
|
400
|
-
size: file.size,
|
|
401
|
-
type: file.type,
|
|
402
|
-
status: 'Ready to Upload',
|
|
403
|
-
validationMessages: { minSize: '', maxSize: '' },
|
|
404
|
-
statusCode: '1'
|
|
405
|
-
}];
|
|
406
|
-
this.uploadObj.createFileList(fileInfo);
|
|
407
|
-
this.uploadObj.upload(fileInfo);
|
|
408
|
-
this.popupObj.element.getElementsByClassName('e-file-select-wrap')[0].style.display = 'none';
|
|
409
|
-
ej2_base_1.detach(this.popupObj.element.querySelector('.e-rte-dialog-upload .e-file-select-wrap'));
|
|
410
|
-
};
|
|
411
|
-
PasteCleanup.prototype.uploadFailure = function (imgElem, uploadObj, popupObj, e) {
|
|
412
|
-
if (this.parent && this.parent.isDestroyed) {
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
this.parent.inputElement.contentEditable = 'true';
|
|
416
|
-
ej2_base_1.detach(imgElem);
|
|
417
|
-
if (popupObj) {
|
|
418
|
-
this.parent.isBlur = false;
|
|
419
|
-
popupObj.destroy();
|
|
420
|
-
if (!ej2_base_1.isNullOrUndefined(popupObj.element)) {
|
|
421
|
-
ej2_base_1.detach(popupObj.element);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
this.parent.trigger(events.imageUploadFailed, e);
|
|
425
|
-
if (uploadObj && document.body.contains(uploadObj.element)) {
|
|
426
|
-
uploadObj.destroy();
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
PasteCleanup.prototype.popupClose = function (popupObj, uploadObj, imgElem, e) {
|
|
430
|
-
var _this = this;
|
|
431
|
-
this.parent.inputElement.contentEditable = 'true';
|
|
432
|
-
e.element = imgElem;
|
|
433
|
-
e.detectImageSource = enum_1.ImageInputSource.Pasted;
|
|
434
|
-
var element = e.file;
|
|
435
|
-
if (element.statusCode === '2') {
|
|
436
|
-
this.parent.trigger(events.imageUploadSuccess, e, function (e) {
|
|
437
|
-
if (!ej2_base_1.isNullOrUndefined(_this.parent.insertImageSettings.path)) {
|
|
438
|
-
var url = _this.parent.insertImageSettings.path + e.file.name;
|
|
439
|
-
if (!_this.parent.inputElement.contains(imgElem) && imgElem.id) {
|
|
440
|
-
var imgHtmlElems = _this.parent.inputElement.querySelectorAll('#' + imgElem.id);
|
|
441
|
-
for (var i = 0; i < imgHtmlElems.length; i++) {
|
|
442
|
-
var imgHtmlElem = imgHtmlElems[i];
|
|
443
|
-
if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
|
|
444
|
-
imgHtmlElem.src = url;
|
|
445
|
-
imgHtmlElem.setAttribute('alt', e.file.name);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
imgElem.src = url;
|
|
451
|
-
imgElem.setAttribute('alt', e.file.name);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
else if (element.statusCode === '5') {
|
|
457
|
-
this.parent.trigger(events.imageRemoving, e, function (e) {
|
|
458
|
-
if (!ej2_base_1.isNullOrUndefined(e.element.src)) {
|
|
459
|
-
e.element.src = '';
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
this.popupCloseTime = setTimeout(function () {
|
|
464
|
-
if (popupObj) {
|
|
465
|
-
_this.parent.isBlur = false;
|
|
466
|
-
popupObj.destroy();
|
|
467
|
-
if (!ej2_base_1.isNullOrUndefined(popupObj.element)) {
|
|
468
|
-
ej2_base_1.detach(popupObj.element);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
if (!_this.parent.inputElement.contains(imgElem) && (imgElem.id || imgElem.alt)) {
|
|
472
|
-
var selector = imgElem.id ? "#" + imgElem.id : "[alt=\"" + imgElem.alt + "\"]";
|
|
473
|
-
if (selector) {
|
|
474
|
-
var imgHtmlElems = _this.parent.inputElement.querySelectorAll(selector);
|
|
475
|
-
for (var i = 0; i < imgHtmlElems.length; i++) {
|
|
476
|
-
var imgHtmlElem = imgHtmlElems[i];
|
|
477
|
-
if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
|
|
478
|
-
imgHtmlElem.style.opacity = '1';
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
else {
|
|
484
|
-
imgElem.style.opacity = '1';
|
|
485
|
-
}
|
|
486
|
-
_this.toolbarEnableDisable(false);
|
|
487
|
-
if (uploadObj && document.body.contains(uploadObj.element)) {
|
|
488
|
-
uploadObj.destroy();
|
|
489
|
-
}
|
|
490
|
-
}, 1500);
|
|
491
|
-
};
|
|
492
|
-
PasteCleanup.prototype.refreshPopup = function (imageElement, popupObj) {
|
|
493
|
-
var imgPosition = this.parent.iframeSettings.enable ? this.parent.element.offsetTop +
|
|
494
|
-
imageElement.offsetTop : imageElement.offsetTop;
|
|
495
|
-
var rtePosition = this.parent.element.offsetTop + this.parent.element.offsetHeight;
|
|
496
|
-
if (imgPosition > rtePosition) {
|
|
497
|
-
popupObj.offsetY = this.parent.iframeSettings.enable ? -30 : -65;
|
|
498
|
-
popupObj.element.style.display = 'block';
|
|
499
|
-
}
|
|
500
|
-
else {
|
|
501
|
-
if (popupObj) {
|
|
502
|
-
popupObj.refreshPosition(imageElement);
|
|
503
|
-
popupObj.element.style.display = 'block';
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
};
|
|
507
|
-
PasteCleanup.prototype.base64ToFile = function (base64, filename) {
|
|
508
|
-
var baseStr = base64.split(',');
|
|
509
|
-
var typeStr = baseStr[0].match(/:(.*?);/)[1];
|
|
510
|
-
var extension = typeStr.split('/')[1];
|
|
511
|
-
var decodeStr = atob(baseStr[1]);
|
|
512
|
-
var strLen = decodeStr.length;
|
|
513
|
-
var decodeArr = new Uint8Array(strLen);
|
|
514
|
-
while (strLen--) {
|
|
515
|
-
decodeArr[strLen] = decodeStr.charCodeAt(strLen);
|
|
516
|
-
}
|
|
517
|
-
if (ej2_base_2.Browser.isIE || navigator.appVersion.indexOf('Edge') > -1) {
|
|
518
|
-
var blob = new Blob([decodeArr], { type: extension });
|
|
519
|
-
ej2_base_1.extend(blob, { name: filename + '.' + (!ej2_base_1.isNullOrUndefined(extension) ? extension : '') });
|
|
520
|
-
return blob;
|
|
521
|
-
}
|
|
522
|
-
else {
|
|
523
|
-
return new File([decodeArr], filename + '.' + (!ej2_base_1.isNullOrUndefined(extension) ? extension : ''), { type: extension });
|
|
524
|
-
}
|
|
525
|
-
};
|
|
526
|
-
PasteCleanup.prototype.imageFormatting = function (pasteArgs, imgElement) {
|
|
527
|
-
if (!ej2_base_1.isNullOrUndefined(imgElement.elements[0].getAttribute('src'))) {
|
|
528
|
-
imgElement.elements[0].classList.add('pasteContent_Img');
|
|
529
|
-
}
|
|
530
|
-
var imageElement = this.parent.createElement('span');
|
|
531
|
-
imageElement.appendChild(imgElement.elements[0]);
|
|
532
|
-
var imageValue = imageElement.innerHTML;
|
|
533
|
-
this.contentRenderer = this.renderFactory.getRenderer(enum_1.RenderType.Content);
|
|
534
|
-
var currentDocument = this.contentRenderer.getDocument();
|
|
535
|
-
var range = this.nodeSelectionObj.getRange(currentDocument);
|
|
536
|
-
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
537
|
-
if (this.parent.pasteCleanupSettings.prompt) {
|
|
538
|
-
this.pasteDialog(imageValue, pasteArgs);
|
|
539
|
-
}
|
|
540
|
-
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
541
|
-
this.plainFormatting(imageValue, pasteArgs);
|
|
542
|
-
}
|
|
543
|
-
else if (this.parent.pasteCleanupSettings.keepFormat) {
|
|
544
|
-
this.formatting(imageValue, false, pasteArgs);
|
|
545
|
-
}
|
|
546
|
-
else {
|
|
547
|
-
this.formatting(imageValue, true, pasteArgs);
|
|
548
|
-
}
|
|
549
|
-
};
|
|
550
|
-
PasteCleanup.prototype.radioRender = function () {
|
|
551
|
-
this.keepRadioButton = new ej2_buttons_1.RadioButton({ label: this.i10n.getConstant('keepFormat'),
|
|
552
|
-
name: 'pasteOption', checked: true });
|
|
553
|
-
this.keepRadioButton.isStringTemplate = true;
|
|
554
|
-
var keepFormatElement = this.parent.element.querySelector('#keepFormating');
|
|
555
|
-
this.keepRadioButton.appendTo(keepFormatElement);
|
|
556
|
-
this.cleanRadioButton = new ej2_buttons_1.RadioButton({ label: this.i10n.getConstant('cleanFormat'), name: 'pasteOption' });
|
|
557
|
-
this.cleanRadioButton.isStringTemplate = true;
|
|
558
|
-
var cleanFormatElement = this.parent.element.querySelector('#cleanFormat');
|
|
559
|
-
this.cleanRadioButton.appendTo(cleanFormatElement);
|
|
560
|
-
this.plainTextRadioButton = new ej2_buttons_1.RadioButton({ label: this.i10n.getConstant('plainText'), name: 'pasteOption' });
|
|
561
|
-
this.plainTextRadioButton.isStringTemplate = true;
|
|
562
|
-
var plainTextElement = this.parent.element.querySelector('#plainTextFormat');
|
|
563
|
-
this.plainTextRadioButton.appendTo(plainTextElement);
|
|
564
|
-
};
|
|
565
|
-
PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked) {
|
|
566
|
-
if (keepChecked) {
|
|
567
|
-
this.formatting(value, false, args);
|
|
568
|
-
}
|
|
569
|
-
else if (cleanChecked) {
|
|
570
|
-
this.formatting(value, true, args);
|
|
571
|
-
}
|
|
572
|
-
else {
|
|
573
|
-
this.plainFormatting(value, args);
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
PasteCleanup.prototype.pasteDialog = function (value, args) {
|
|
577
|
-
var _this = this;
|
|
578
|
-
var dialogModel = {
|
|
579
|
-
buttons: [
|
|
580
|
-
{
|
|
581
|
-
click: function () {
|
|
582
|
-
if (!_this.dialogObj.isDestroyed) {
|
|
583
|
-
var keepChecked = _this.parent.element.querySelector('#keepFormating').checked;
|
|
584
|
-
var cleanChecked = _this.parent.element.querySelector('#cleanFormat').checked;
|
|
585
|
-
_this.dialogObj.hide();
|
|
586
|
-
var argument = _this.dialogObj;
|
|
587
|
-
_this.dialogRenderObj.close(argument);
|
|
588
|
-
_this.dialogObj.destroy();
|
|
589
|
-
_this.selectFormatting(value, args, keepChecked, cleanChecked);
|
|
590
|
-
}
|
|
591
|
-
},
|
|
592
|
-
buttonModel: {
|
|
593
|
-
isPrimary: true,
|
|
594
|
-
cssClass: 'e-flat ' + classes_2.CLS_RTE_PASTE_OK,
|
|
595
|
-
content: this.i10n.getConstant('pasteDialogOk')
|
|
596
|
-
}
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
click: function () {
|
|
600
|
-
if (!_this.dialogObj.isDestroyed) {
|
|
601
|
-
_this.dialogObj.hide();
|
|
602
|
-
var args_1 = _this.dialogObj;
|
|
603
|
-
_this.dialogRenderObj.close(args_1);
|
|
604
|
-
_this.dialogObj.destroy();
|
|
605
|
-
}
|
|
606
|
-
},
|
|
607
|
-
buttonModel: {
|
|
608
|
-
cssClass: 'e-flat ' + classes_2.CLS_RTE_PASTE_CANCEL,
|
|
609
|
-
content: this.i10n.getConstant('pasteDialogCancel')
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
],
|
|
613
|
-
header: this.i10n.getConstant('pasteFormat'),
|
|
614
|
-
content: this.i10n.getConstant('pasteFormatContent') + '<br/><div><div style="padding-top:24px;">' +
|
|
615
|
-
'<input type="radio" class="' + classes_1.CLS_RTE_PASTE_KEEP_FORMAT + '" id="keepFormating"/>' +
|
|
616
|
-
'</div><div style="padding-top:20px;"><input type="radio" class="' +
|
|
617
|
-
classes_1.CLS_RTE_PASTE_REMOVE_FORMAT + '" id="cleanFormat"/></div>' +
|
|
618
|
-
'<div style="padding-top:20px;"><input type="radio" class="' +
|
|
619
|
-
classes_1.CLS_RTE_PASTE_PLAIN_FORMAT + '" id="plainTextFormat"/></div></div>',
|
|
620
|
-
target: this.parent.element,
|
|
621
|
-
width: '300px',
|
|
622
|
-
height: '265px',
|
|
623
|
-
cssClass: classes_2.CLS_RTE_DIALOG_MIN_HEIGHT,
|
|
624
|
-
isModal: ej2_base_2.Browser.isDevice,
|
|
625
|
-
visible: false
|
|
626
|
-
};
|
|
627
|
-
this.dialogObj = this.dialogRenderObj.render(dialogModel);
|
|
628
|
-
var rteDialogWrapper = this.parent.element.querySelector('#' + this.parent.getID()
|
|
629
|
-
+ '_pasteCleanupDialog');
|
|
630
|
-
if (rteDialogWrapper !== null && rteDialogWrapper.innerHTML !== '') {
|
|
631
|
-
this.destroyDialog(rteDialogWrapper);
|
|
632
|
-
}
|
|
633
|
-
if (rteDialogWrapper === null) {
|
|
634
|
-
rteDialogWrapper = this.parent.createElement('div', {
|
|
635
|
-
id: this.parent.getID() + '_pasteCleanupDialog'
|
|
636
|
-
});
|
|
637
|
-
this.parent.rootContainer.appendChild(rteDialogWrapper);
|
|
638
|
-
}
|
|
639
|
-
this.dialogObj.appendTo(rteDialogWrapper);
|
|
640
|
-
this.radioRender();
|
|
641
|
-
this.dialogObj.show();
|
|
642
|
-
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
643
|
-
};
|
|
644
|
-
PasteCleanup.prototype.updateCss = function (currentObj, e) {
|
|
645
|
-
if (currentObj && e.cssClass) {
|
|
646
|
-
if (ej2_base_1.isNullOrUndefined(e.oldCssClass)) {
|
|
647
|
-
currentObj.setProperties({ cssClass: (currentObj.cssClass + ' ' + e.cssClass).trim() });
|
|
648
|
-
}
|
|
649
|
-
else {
|
|
650
|
-
currentObj.setProperties({ cssClass: (currentObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
};
|
|
654
|
-
PasteCleanup.prototype.setCssClass = function (e) {
|
|
655
|
-
if (this.popupObj && e.cssClass) {
|
|
656
|
-
if (ej2_base_1.isNullOrUndefined(e.oldCssClass)) {
|
|
657
|
-
ej2_base_1.addClass([this.popupObj.element], e.cssClass);
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
ej2_base_1.removeClass([this.popupObj.element], e.oldCssClass);
|
|
661
|
-
ej2_base_1.addClass([this.popupObj.element], e.cssClass);
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
this.updateCss(this.dialogObj, e);
|
|
665
|
-
this.updateCss(this.uploadObj, e);
|
|
666
|
-
this.updateCss(this.plainTextRadioButton, e);
|
|
667
|
-
this.updateCss(this.cleanRadioButton, e);
|
|
668
|
-
this.updateCss(this.keepRadioButton, e);
|
|
669
|
-
};
|
|
670
|
-
PasteCleanup.prototype.destroyDialog = function (rteDialogWrapper) {
|
|
671
|
-
var rteDialogContainer = this.parent.element.querySelector('.e-rte-dialog-minheight');
|
|
672
|
-
ej2_base_1.detach(rteDialogContainer);
|
|
673
|
-
var rteDialogWrapperChildLength = rteDialogWrapper.children.length;
|
|
674
|
-
for (var i = 0; i < rteDialogWrapperChildLength; i++) {
|
|
675
|
-
ej2_base_1.detach(rteDialogWrapper.children[0]);
|
|
676
|
-
}
|
|
677
|
-
};
|
|
678
|
-
PasteCleanup.prototype.docClick = function (e) {
|
|
679
|
-
var target = e.args.target;
|
|
680
|
-
if (target && target.classList && ((this.dialogObj && !ej2_base_2.closest(target, '[id=' + '\'' + this.dialogObj.element.id + '\'' + ']')))
|
|
681
|
-
&& (!target.classList.contains('e-toolbar-item'))) {
|
|
682
|
-
if (this.dialogObj) {
|
|
683
|
-
this.dialogObj.hide();
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
};
|
|
687
|
-
PasteCleanup.prototype.cleanAppleClass = function (elem) {
|
|
688
|
-
var appleClassElem = elem.querySelectorAll('br.Apple-interchange-newline');
|
|
689
|
-
for (var i = 0; i < appleClassElem.length; i++) {
|
|
690
|
-
ej2_base_1.detach(appleClassElem[i]);
|
|
691
|
-
}
|
|
692
|
-
return elem;
|
|
693
|
-
};
|
|
694
|
-
PasteCleanup.prototype.formatting = function (value, clean, args) {
|
|
695
|
-
var _this = this;
|
|
696
|
-
var clipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
|
|
697
|
-
if (this.isNotFromHtml && this.containsHtml) {
|
|
698
|
-
value = this.splitBreakLine(value);
|
|
699
|
-
}
|
|
700
|
-
clipBoardElem.innerHTML = value;
|
|
701
|
-
clipBoardElem = this.cleanAppleClass(clipBoardElem);
|
|
702
|
-
if (this.parent.pasteCleanupSettings.deniedTags !== null) {
|
|
703
|
-
clipBoardElem = this.deniedTags(clipBoardElem);
|
|
704
|
-
}
|
|
705
|
-
if (clean) {
|
|
706
|
-
clipBoardElem = this.deniedAttributes(clipBoardElem, clean);
|
|
707
|
-
}
|
|
708
|
-
else if (this.parent.pasteCleanupSettings.deniedAttrs !== null) {
|
|
709
|
-
clipBoardElem = this.deniedAttributes(clipBoardElem, clean);
|
|
710
|
-
}
|
|
711
|
-
if (this.parent.pasteCleanupSettings.allowedStyleProps !== null) {
|
|
712
|
-
clipBoardElem = this.allowedStyle(clipBoardElem);
|
|
713
|
-
}
|
|
714
|
-
this.saveSelection.restore();
|
|
715
|
-
var newText = clipBoardElem.innerHTML;
|
|
716
|
-
if (this.parent.enableHtmlSanitizer) {
|
|
717
|
-
newText = clipBoardElem.innerHTML.split('&').join('&');
|
|
718
|
-
}
|
|
719
|
-
clipBoardElem.innerHTML = this.sanitizeHelper(newText);
|
|
720
|
-
var allImg = clipBoardElem.querySelectorAll('img');
|
|
721
|
-
for (var i = 0; i < allImg.length; i++) {
|
|
722
|
-
if (!ej2_base_1.isNullOrUndefined(allImg[i].getAttribute('src'))) {
|
|
723
|
-
allImg[i].classList.add('pasteContent_Img');
|
|
724
|
-
}
|
|
725
|
-
this.setImageProperties(allImg[i]);
|
|
726
|
-
}
|
|
727
|
-
this.addTempClass(clipBoardElem);
|
|
728
|
-
if (clipBoardElem.querySelectorAll('picture').length > 0) {
|
|
729
|
-
this.processPictureElement(clipBoardElem);
|
|
730
|
-
}
|
|
731
|
-
if (clipBoardElem.textContent !== '' || !ej2_base_1.isNullOrUndefined(clipBoardElem.querySelector('img')) ||
|
|
732
|
-
!ej2_base_1.isNullOrUndefined(clipBoardElem.querySelector('table'))) {
|
|
733
|
-
var tempWrapperElem = this.parent.createElement('div');
|
|
734
|
-
tempWrapperElem.innerHTML = value;
|
|
735
|
-
var filesData = [];
|
|
736
|
-
if (!ej2_base_1.isNullOrUndefined(tempWrapperElem.querySelector('img'))) {
|
|
737
|
-
var imgElem = tempWrapperElem.querySelectorAll('img');
|
|
738
|
-
var base64Src = [];
|
|
739
|
-
var imgName = [];
|
|
740
|
-
var uploadImg = [];
|
|
741
|
-
for (var i = 0; i < imgElem.length; i++) {
|
|
742
|
-
if (imgElem[i].getAttribute('src') &&
|
|
743
|
-
imgElem[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
|
|
744
|
-
base64Src.push(imgElem[i].getAttribute('src'));
|
|
745
|
-
imgName.push(ej2_base_2.getUniqueID('rte_image'));
|
|
746
|
-
uploadImg.push(imgElem[i]);
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
var fileList = [];
|
|
750
|
-
var currentData = void 0;
|
|
751
|
-
for (var i = 0; i < base64Src.length; i++) {
|
|
752
|
-
fileList.push(this.base64ToFile(base64Src[i], imgName[i]));
|
|
753
|
-
currentData = {
|
|
754
|
-
name: fileList[i].name, rawFile: fileList[i],
|
|
755
|
-
size: fileList[i].size, type: fileList[i].type,
|
|
756
|
-
status: '', validationMessages: { minSize: '', maxSize: '' }, statusCode: '1'
|
|
757
|
-
};
|
|
758
|
-
filesData.push(currentData);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
|
|
762
|
-
clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
|
|
763
|
-
clipBoardElem = this.addTableClass(clipBoardElem, args.pasteTableSource);
|
|
764
|
-
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
765
|
-
ej2_base_1.extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
766
|
-
_this.parent.formatter.onSuccess(_this.parent, args);
|
|
767
|
-
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
768
|
-
this.parent.notify(events.autoResize, {});
|
|
769
|
-
util_2.scrollToCursor(this.parent.contentModule.getDocument(), this.parent.inputElement);
|
|
770
|
-
this.removeTempClass();
|
|
771
|
-
this.parent.notify(events.toolbarRefresh, {});
|
|
772
|
-
this.cropImageHandler(this.parent.inputElement);
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
PasteCleanup.prototype.convertBlobToBase64 = function (element) {
|
|
776
|
-
var imgElem = element.querySelectorAll('img');
|
|
777
|
-
var _loop_1 = function (i) {
|
|
778
|
-
if (imgElem[i].getAttribute('src') &&
|
|
779
|
-
imgElem[i].getAttribute('src').startsWith('blob')) {
|
|
780
|
-
var blobImageUrl = imgElem[i].getAttribute('src');
|
|
781
|
-
var img_1 = new Image();
|
|
782
|
-
var onImageLoadEvent_1 = function () {
|
|
783
|
-
var canvas = document.createElement('canvas');
|
|
784
|
-
var ctx = canvas.getContext('2d');
|
|
785
|
-
canvas.width = img_1.width;
|
|
786
|
-
canvas.height = img_1.height;
|
|
787
|
-
ctx.drawImage(img_1, 0, 0);
|
|
788
|
-
var base64String = canvas.toDataURL('image/png');
|
|
789
|
-
imgElem[i].src = base64String;
|
|
790
|
-
img_1.removeEventListener('load', onImageLoadEvent_1);
|
|
791
|
-
};
|
|
792
|
-
img_1.src = blobImageUrl;
|
|
793
|
-
img_1.addEventListener('load', onImageLoadEvent_1);
|
|
794
|
-
}
|
|
795
|
-
};
|
|
796
|
-
for (var i = 0; i < imgElem.length; i++) {
|
|
797
|
-
_loop_1(i);
|
|
798
|
-
}
|
|
799
|
-
};
|
|
800
|
-
PasteCleanup.prototype.cropImageHandler = function (element) {
|
|
801
|
-
var _this = this;
|
|
802
|
-
var allImgElm = element.querySelectorAll('.e-img-cropped');
|
|
803
|
-
if (allImgElm.length > 0) {
|
|
804
|
-
var _loop_2 = function (i) {
|
|
805
|
-
if (allImgElm[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
|
|
806
|
-
var image_1 = new Image();
|
|
807
|
-
image_1.src = allImgElm[i].getAttribute('src');
|
|
808
|
-
var canvas_1 = document.createElement('canvas');
|
|
809
|
-
var ctx_1 = canvas_1.getContext('2d');
|
|
810
|
-
image_1.onload = function () {
|
|
811
|
-
var wGoalWidth = _this.cropImageData[i].goalWidth / image_1.naturalWidth;
|
|
812
|
-
var hGoalHeight = _this.cropImageData[i].goalHeight / image_1.naturalHeight;
|
|
813
|
-
var cropLength = _this.cropImageData[i].cropLength / wGoalWidth;
|
|
814
|
-
var cropTop = _this.cropImageData[i].cropTop / hGoalHeight;
|
|
815
|
-
var cropWidth = (_this.cropImageData[i].goalWidth -
|
|
816
|
-
_this.cropImageData[i].cropLength -
|
|
817
|
-
_this.cropImageData[i].cropR) / wGoalWidth;
|
|
818
|
-
var cropHeight = (_this.cropImageData[i].goalHeight -
|
|
819
|
-
_this.cropImageData[i].cropTop -
|
|
820
|
-
_this.cropImageData[i].cropB) / hGoalHeight;
|
|
821
|
-
canvas_1.width = cropWidth;
|
|
822
|
-
canvas_1.height = cropHeight;
|
|
823
|
-
ctx_1.drawImage(image_1, cropLength, cropTop, cropWidth, cropHeight, 0, 0, cropWidth, cropHeight);
|
|
824
|
-
var croppedBase64 = canvas_1.toDataURL('image/png');
|
|
825
|
-
allImgElm[i].setAttribute('src', croppedBase64);
|
|
826
|
-
allImgElm[i].classList.remove('e-img-cropped');
|
|
827
|
-
_this.imgUploading(_this.parent.inputElement);
|
|
828
|
-
if (_this.parent.iframeSettings.enable) {
|
|
829
|
-
_this.parent.updateValue();
|
|
830
|
-
}
|
|
831
|
-
};
|
|
832
|
-
}
|
|
833
|
-
};
|
|
834
|
-
for (var i = 0; i < allImgElm.length; i++) {
|
|
835
|
-
_loop_2(i);
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
else {
|
|
839
|
-
if (!ej2_base_1.isNullOrUndefined(this.parent.insertImageSettings.saveUrl) && !ej2_base_1.isNullOrUndefined(this.parent.insertImageSettings.path) &&
|
|
840
|
-
this.parent.inputElement.querySelectorAll('img').length > 0 && this.parent.inputElement.querySelectorAll('img')[0].src.startsWith('blob')) {
|
|
841
|
-
this.convertBlobToBase64(this.parent.inputElement);
|
|
842
|
-
this.iframeUploadTime = setTimeout(function () {
|
|
843
|
-
_this.imgUploading(_this.parent.inputElement);
|
|
844
|
-
if (_this.parent.iframeSettings.enable) {
|
|
845
|
-
_this.parent.updateValue();
|
|
846
|
-
}
|
|
847
|
-
}, 20);
|
|
848
|
-
}
|
|
849
|
-
else {
|
|
850
|
-
this.imgUploading(this.parent.inputElement);
|
|
851
|
-
if (this.parent.iframeSettings.enable) {
|
|
852
|
-
this.parent.updateValue();
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
};
|
|
857
|
-
PasteCleanup.prototype.addTableClass = function (element, source) {
|
|
858
|
-
var tableElement = element.querySelectorAll('table');
|
|
859
|
-
for (var i = 0; i < tableElement.length; i++) {
|
|
860
|
-
var isMSTeamsTable = tableElement[i].parentElement.nodeName === 'FIGURE';
|
|
861
|
-
if (tableElement[i].classList.length > 0 && tableElement[i].classList.contains('e-rte-custom-table')) {
|
|
862
|
-
continue;
|
|
863
|
-
}
|
|
864
|
-
if (this.parent.pasteCleanupSettings.keepFormat && source && !isMSTeamsTable) {
|
|
865
|
-
tableElement[i].classList.add('e-rte-paste-' + source + '-table');
|
|
866
|
-
}
|
|
867
|
-
else if (!tableElement[i].classList.contains('e-rte-table')) {
|
|
868
|
-
tableElement[i].classList.add('e-rte-table');
|
|
869
|
-
}
|
|
870
|
-
if (ej2_base_1.isNullOrUndefined(tableElement[i].nextElementSibling) && tableElement[i].nextSibling &&
|
|
871
|
-
!tableElement[i].nextSibling.textContent.trim()) {
|
|
872
|
-
ej2_base_1.detach(tableElement[i].nextSibling);
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
return element;
|
|
876
|
-
};
|
|
877
|
-
PasteCleanup.prototype.setImageProperties = function (allImg) {
|
|
878
|
-
if (this.parent.insertImageSettings.width !== 'auto') {
|
|
879
|
-
allImg.setAttribute('width', this.parent.insertImageSettings.width);
|
|
880
|
-
}
|
|
881
|
-
if (this.parent.insertImageSettings.minWidth !== '0' && this.parent.insertImageSettings.minWidth !== 0) {
|
|
882
|
-
allImg.style.minWidth = this.parent.insertImageSettings.minWidth.toString();
|
|
883
|
-
}
|
|
884
|
-
if (this.parent.insertImageSettings.maxWidth !== null) {
|
|
885
|
-
allImg.style.maxWidth = this.parent.getInsertImgMaxWidth().toString();
|
|
886
|
-
}
|
|
887
|
-
if (this.parent.insertImageSettings.height !== 'auto') {
|
|
888
|
-
allImg.setAttribute('height', this.parent.insertImageSettings.height);
|
|
889
|
-
}
|
|
890
|
-
if (this.parent.insertImageSettings.minHeight !== '0' && this.parent.insertImageSettings.minHeight !== 0) {
|
|
891
|
-
allImg.style.minHeight = this.parent.insertImageSettings.minHeight.toString();
|
|
892
|
-
}
|
|
893
|
-
if (this.parent.insertImageSettings.maxHeight !== null) {
|
|
894
|
-
allImg.style.maxHeight = this.parent.insertImageSettings.maxHeight.toString();
|
|
895
|
-
}
|
|
896
|
-
};
|
|
897
|
-
PasteCleanup.prototype.addTempClass = function (clipBoardElem) {
|
|
898
|
-
var allChild = clipBoardElem.children;
|
|
899
|
-
for (var i = 0; i < allChild.length; i++) {
|
|
900
|
-
allChild[i].classList.add('pasteContent_RTE');
|
|
901
|
-
}
|
|
902
|
-
};
|
|
903
|
-
PasteCleanup.prototype.removeTempClass = function () {
|
|
904
|
-
var classElm = this.parent.inputElement.querySelectorAll('.pasteContent_RTE');
|
|
905
|
-
for (var i = 0; i < classElm.length; i++) {
|
|
906
|
-
classElm[i].classList.remove('pasteContent_RTE');
|
|
907
|
-
if (classElm[i].getAttribute('class') === '') {
|
|
908
|
-
classElm[i].removeAttribute('class');
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
};
|
|
912
|
-
PasteCleanup.prototype.sanitizeHelper = function (value) {
|
|
913
|
-
value = util_1.sanitizeHelper(value, this.parent);
|
|
914
|
-
return value;
|
|
915
|
-
};
|
|
916
|
-
PasteCleanup.prototype.plainFormatting = function (value, args) {
|
|
917
|
-
var _this = this;
|
|
918
|
-
var clipBoardElem = this.parent.createElement('div', { className: 'pasteContent' });
|
|
919
|
-
this.plainTextContent = this.plainTextContent.replace(/</g, '<');
|
|
920
|
-
this.plainTextContent = this.plainTextContent.replace(/>/g, '>');
|
|
921
|
-
var sanitizedContent = this.sanitizeHelper(this.plainTextContent);
|
|
922
|
-
var splitContent = this.splitBreakLine(sanitizedContent);
|
|
923
|
-
clipBoardElem.innerHTML = splitContent;
|
|
924
|
-
if (clipBoardElem.textContent.trim() !== '') {
|
|
925
|
-
this.saveSelection.restore();
|
|
926
|
-
this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: null }, function (updatedArgs) { value = updatedArgs.value; });
|
|
927
|
-
clipBoardElem.innerHTML = value;
|
|
928
|
-
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
929
|
-
ej2_base_1.extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
930
|
-
_this.parent.formatter.onSuccess(_this.parent, args);
|
|
931
|
-
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
932
|
-
this.removeTempClass();
|
|
933
|
-
}
|
|
934
|
-
else {
|
|
935
|
-
this.saveSelection.restore();
|
|
936
|
-
ej2_base_1.extend(args, { elements: [] }, true);
|
|
937
|
-
this.parent.formatter.onSuccess(this.parent, args);
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
PasteCleanup.prototype.tagGrouping = function (deniedTags) {
|
|
941
|
-
var groupingTags = deniedTags.slice();
|
|
942
|
-
var keys = Object.keys(config_1.pasteCleanupGroupingTags);
|
|
943
|
-
var values = keys.map(function (key) {
|
|
944
|
-
return config_1.pasteCleanupGroupingTags["" + key];
|
|
945
|
-
});
|
|
946
|
-
var addTags = [];
|
|
947
|
-
for (var i = 0; i < groupingTags.length; i++) {
|
|
948
|
-
if (groupingTags[i].split('[').length > 1) {
|
|
949
|
-
groupingTags[i] = groupingTags[i].split('[')[0].trim();
|
|
950
|
-
}
|
|
951
|
-
if (keys.indexOf(groupingTags[i]) > -1) {
|
|
952
|
-
for (var j = 0; j < values[keys.indexOf(groupingTags[i])].length; j++) {
|
|
953
|
-
if (groupingTags.indexOf(values[keys.indexOf(groupingTags[i])][j]) < 0 &&
|
|
954
|
-
addTags.indexOf(values[keys.indexOf(groupingTags[i])][j]) < 0) {
|
|
955
|
-
addTags.push(values[keys.indexOf(groupingTags[i])][j]);
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
return deniedTags = deniedTags.concat(addTags);
|
|
961
|
-
};
|
|
962
|
-
PasteCleanup.prototype.attributesfilter = function (deniedTags) {
|
|
963
|
-
for (var i = 0; i < deniedTags.length; i++) {
|
|
964
|
-
if (deniedTags[i].split('[').length > 1) {
|
|
965
|
-
var userAttributes = deniedTags[i].split('[')[1].split(']')[0].split(',');
|
|
966
|
-
var allowedAttributeArray = [];
|
|
967
|
-
var deniedAttributeArray = [];
|
|
968
|
-
for (var j = 0; j < userAttributes.length; j++) {
|
|
969
|
-
if (userAttributes[j].indexOf('!') < 0) {
|
|
970
|
-
allowedAttributeArray.push(userAttributes[j].trim());
|
|
971
|
-
}
|
|
972
|
-
else {
|
|
973
|
-
deniedAttributeArray.push(userAttributes[j].split('!')[1].trim());
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
var allowedAttribute = allowedAttributeArray.length > 1 ?
|
|
977
|
-
(allowedAttributeArray.join('][')) : (allowedAttributeArray.join());
|
|
978
|
-
var deniedAttribute = deniedAttributeArray.length > 1 ?
|
|
979
|
-
deniedAttributeArray.join('][') : (deniedAttributeArray.join());
|
|
980
|
-
if (deniedAttribute.length > 0) {
|
|
981
|
-
var select = allowedAttribute !== '' ? deniedTags[i].split('[')[0] +
|
|
982
|
-
'[' + allowedAttribute + ']' : deniedTags[i].split('[')[0];
|
|
983
|
-
deniedTags[i] = select + ':not([' + deniedAttribute + '])';
|
|
984
|
-
}
|
|
985
|
-
else {
|
|
986
|
-
deniedTags[i] = deniedTags[i].split('[')[0] + '[' + allowedAttribute + ']';
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
return deniedTags;
|
|
991
|
-
};
|
|
992
|
-
PasteCleanup.prototype.deniedTags = function (clipBoardElem) {
|
|
993
|
-
var deniedTags = ej2_base_1.isNullOrUndefined(this.parent.pasteCleanupSettings.deniedTags) ? [] : this.parent.pasteCleanupSettings.deniedTags.slice();
|
|
994
|
-
deniedTags = this.attributesfilter(deniedTags);
|
|
995
|
-
deniedTags = this.tagGrouping(deniedTags);
|
|
996
|
-
for (var i = 0; i < deniedTags.length; i++) {
|
|
997
|
-
var removableElement = clipBoardElem.querySelectorAll(deniedTags[i]);
|
|
998
|
-
for (var j = removableElement.length - 1; j >= 0; j--) {
|
|
999
|
-
var parentElem = removableElement[j].parentNode;
|
|
1000
|
-
while (removableElement[j].firstChild) {
|
|
1001
|
-
parentElem.insertBefore(removableElement[j].firstChild, removableElement[j]);
|
|
1002
|
-
}
|
|
1003
|
-
parentElem.removeChild(removableElement[j]);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
return clipBoardElem;
|
|
1007
|
-
};
|
|
1008
|
-
PasteCleanup.prototype.deniedAttributes = function (clipBoardElem, clean) {
|
|
1009
|
-
var deniedAttrs = ej2_base_1.isNullOrUndefined(this.parent.pasteCleanupSettings.deniedAttrs) ? [] : this.parent.pasteCleanupSettings.deniedAttrs.slice();
|
|
1010
|
-
if (clean) {
|
|
1011
|
-
deniedAttrs.push('style');
|
|
1012
|
-
}
|
|
1013
|
-
for (var i = 0; i < deniedAttrs.length; i++) {
|
|
1014
|
-
var removableAttrElement = clipBoardElem.
|
|
1015
|
-
querySelectorAll('[' + deniedAttrs[i] + ']');
|
|
1016
|
-
for (var j = 0; j < removableAttrElement.length; j++) {
|
|
1017
|
-
removableAttrElement[j].removeAttribute(deniedAttrs[i]);
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
return clipBoardElem;
|
|
1021
|
-
};
|
|
1022
|
-
PasteCleanup.prototype.allowedStyle = function (clipBoardElem) {
|
|
1023
|
-
var allowedStyleProps = ej2_base_1.isNullOrUndefined(this.parent.pasteCleanupSettings.allowedStyleProps) ? [] : this.parent.pasteCleanupSettings.allowedStyleProps.slice();
|
|
1024
|
-
allowedStyleProps.push('list-style-type', 'list-style');
|
|
1025
|
-
var styleElement = clipBoardElem.querySelectorAll('[style]');
|
|
1026
|
-
for (var i = 0; i < styleElement.length; i++) {
|
|
1027
|
-
var allowedStyleValue = '';
|
|
1028
|
-
var allowedStyleValueArray = [];
|
|
1029
|
-
var styleValue = styleElement[i].getAttribute('style').split(';');
|
|
1030
|
-
for (var k = 0; k < styleValue.length; k++) {
|
|
1031
|
-
if (allowedStyleProps.indexOf(styleValue[k].split(':')[0].trim()) >= 0) {
|
|
1032
|
-
allowedStyleValueArray.push(styleValue[k]);
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
styleElement[i].removeAttribute('style');
|
|
1036
|
-
allowedStyleValue = allowedStyleValueArray.join(';').trim() === '' ?
|
|
1037
|
-
allowedStyleValueArray.join(';') : allowedStyleValueArray.join(';') + ';';
|
|
1038
|
-
if (allowedStyleValue) {
|
|
1039
|
-
styleElement[i].style.cssText += allowedStyleValue;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
return clipBoardElem;
|
|
1043
|
-
};
|
|
1044
|
-
PasteCleanup.prototype.processPictureElement = function (clipBoardElem) {
|
|
1045
|
-
var pictureElems = clipBoardElem.querySelectorAll('picture');
|
|
1046
|
-
var base = this.parent.contentModule.getDocument().baseURI;
|
|
1047
|
-
for (var i = 0; i < pictureElems.length; i++) {
|
|
1048
|
-
var imgElem = pictureElems[i].querySelector('img');
|
|
1049
|
-
var sourceElems = pictureElems[i].querySelectorAll('source');
|
|
1050
|
-
if (imgElem && imgElem.getAttribute('src')) {
|
|
1051
|
-
var srcValue = imgElem.getAttribute('src');
|
|
1052
|
-
var url = srcValue.indexOf('http') > -1 ? new URL(srcValue) : new URL(srcValue, base);
|
|
1053
|
-
for (var j = 0; j < sourceElems.length; j++) {
|
|
1054
|
-
var srcset = sourceElems[j].getAttribute('srcset');
|
|
1055
|
-
if (srcset) {
|
|
1056
|
-
if (srcset.indexOf('http') === -1) {
|
|
1057
|
-
var fullPath = url.origin + srcset;
|
|
1058
|
-
sourceElems[j].setAttribute('srcset', fullPath);
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
};
|
|
1065
|
-
PasteCleanup.prototype.getModuleName = function () {
|
|
1066
|
-
return 'pasteCleanup';
|
|
1067
|
-
};
|
|
1068
|
-
return PasteCleanup;
|
|
1069
|
-
}());
|
|
1070
|
-
exports.PasteCleanup = PasteCleanup;
|
|
1071
|
-
});
|