@syncfusion/ej2-richtexteditor 29.2.4-760237 → 29.2.4-771571
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 +22 -2
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +23 -2
- 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/inserthtml.js +2 -1
- package/styles/bds-lite.css +278 -29
- package/styles/bds.css +289 -30
- package/styles/bootstrap-dark-lite.css +276 -27
- package/styles/bootstrap-dark.css +288 -29
- package/styles/bootstrap-lite.css +278 -29
- package/styles/bootstrap.css +290 -31
- package/styles/bootstrap4-lite.css +276 -27
- package/styles/bootstrap4.css +287 -28
- package/styles/bootstrap5-dark-lite.css +278 -29
- package/styles/bootstrap5-dark.css +289 -30
- package/styles/bootstrap5-lite.css +278 -29
- package/styles/bootstrap5.3-lite.css +276 -27
- package/styles/bootstrap5.3.css +288 -29
- package/styles/bootstrap5.css +289 -30
- package/styles/fabric-dark-lite.css +276 -27
- package/styles/fabric-dark.css +287 -28
- package/styles/fabric-lite.css +276 -27
- package/styles/fabric.css +287 -28
- package/styles/fluent-dark-lite.css +278 -29
- package/styles/fluent-dark.css +289 -31
- package/styles/fluent-lite.css +278 -29
- package/styles/fluent.css +289 -31
- package/styles/fluent2-lite.css +280 -31
- package/styles/fluent2.css +292 -33
- package/styles/highcontrast-light-lite.css +276 -27
- package/styles/highcontrast-light.css +287 -28
- package/styles/highcontrast-lite.css +276 -27
- package/styles/highcontrast.css +287 -28
- package/styles/material-dark-lite.css +276 -27
- package/styles/material-dark.css +287 -28
- package/styles/material-lite.css +276 -27
- package/styles/material.css +287 -28
- package/styles/material3-dark-lite.css +278 -27
- package/styles/material3-dark.css +289 -28
- package/styles/material3-lite.css +278 -27
- package/styles/material3.css +289 -28
- package/styles/rich-text-editor/_bds-definition.scss +9 -1
- package/styles/rich-text-editor/_bigger.scss +16 -3
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +9 -1
- package/styles/rich-text-editor/_bootstrap-definition.scss +10 -2
- package/styles/rich-text-editor/_bootstrap4-definition.scss +9 -1
- package/styles/rich-text-editor/_bootstrap5-definition.scss +10 -2
- package/styles/rich-text-editor/_bootstrap5.3-definition.scss +9 -1
- package/styles/rich-text-editor/_fabric-dark-definition.scss +9 -1
- package/styles/rich-text-editor/_fabric-definition.scss +9 -1
- package/styles/rich-text-editor/_fluent-definition.scss +9 -2
- package/styles/rich-text-editor/_fluent2-definition.scss +10 -2
- package/styles/rich-text-editor/_fusionnew-definition.scss +8 -1
- package/styles/rich-text-editor/_highcontrast-definition.scss +9 -1
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +9 -1
- package/styles/rich-text-editor/_layout.scss +208 -25
- package/styles/rich-text-editor/_material-dark-definition.scss +9 -1
- package/styles/rich-text-editor/_material-definition.scss +9 -1
- package/styles/rich-text-editor/_material3-definition.scss +9 -1
- package/styles/rich-text-editor/_tailwind-definition.scss +9 -1
- package/styles/rich-text-editor/_tailwind3-definition.scss +11 -3
- package/styles/rich-text-editor/_theme.scss +3 -0
- package/styles/rich-text-editor/bds.css +289 -30
- package/styles/rich-text-editor/bootstrap-dark.css +288 -29
- package/styles/rich-text-editor/bootstrap.css +290 -31
- package/styles/rich-text-editor/bootstrap4.css +287 -28
- package/styles/rich-text-editor/bootstrap5-dark.css +289 -30
- package/styles/rich-text-editor/bootstrap5.3.css +288 -29
- package/styles/rich-text-editor/bootstrap5.css +289 -30
- package/styles/rich-text-editor/fabric-dark.css +287 -28
- package/styles/rich-text-editor/fabric.css +287 -28
- package/styles/rich-text-editor/fluent-dark.css +289 -31
- package/styles/rich-text-editor/fluent.css +289 -31
- package/styles/rich-text-editor/fluent2.css +292 -33
- package/styles/rich-text-editor/highcontrast-light.css +287 -28
- package/styles/rich-text-editor/highcontrast.css +287 -28
- package/styles/rich-text-editor/icons/_bds.scss +4 -1
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +4 -1
- package/styles/rich-text-editor/icons/_bootstrap.scss +4 -2
- package/styles/rich-text-editor/icons/_bootstrap4.scss +4 -2
- package/styles/rich-text-editor/icons/_bootstrap5.3.scss +4 -2
- package/styles/rich-text-editor/icons/_bootstrap5.scss +4 -2
- package/styles/rich-text-editor/icons/_fabric-dark.scss +4 -2
- package/styles/rich-text-editor/icons/_fabric.scss +4 -2
- package/styles/rich-text-editor/icons/_fluent.scss +5 -1
- package/styles/rich-text-editor/icons/_fluent2.scss +4 -2
- package/styles/rich-text-editor/icons/_fusionnew.scss +4 -2
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +5 -1
- package/styles/rich-text-editor/icons/_highcontrast.scss +5 -1
- package/styles/rich-text-editor/icons/_material-dark.scss +5 -1
- package/styles/rich-text-editor/icons/_material.scss +5 -1
- package/styles/rich-text-editor/icons/_material3.scss +5 -1
- package/styles/rich-text-editor/icons/_tailwind.scss +5 -1
- package/styles/rich-text-editor/icons/_tailwind3.scss +5 -1
- package/styles/rich-text-editor/material-dark.css +287 -28
- package/styles/rich-text-editor/material.css +287 -28
- package/styles/rich-text-editor/material3-dark.css +289 -28
- package/styles/rich-text-editor/material3.css +289 -28
- package/styles/rich-text-editor/tailwind-dark.css +289 -30
- package/styles/rich-text-editor/tailwind.css +289 -30
- package/styles/rich-text-editor/tailwind3.css +291 -32
- package/styles/tailwind-dark-lite.css +278 -29
- package/styles/tailwind-dark.css +289 -30
- package/styles/tailwind-lite.css +278 -29
- package/styles/tailwind.css +289 -30
- package/styles/tailwind3-lite.css +280 -31
- package/styles/tailwind3.css +291 -32
- 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,886 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "../base/constant", "../base/classes", "@syncfusion/ej2-inputs", "@syncfusion/ej2-buttons", "../base/enum", "../base/util", "../../common/util"], function (require, exports, ej2_base_1, ej2_base_2, events, classes, ej2_inputs_1, ej2_buttons_1, enum_1, util_1, util_2) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var Audio = (function () {
|
|
5
|
-
function Audio(parent, serviceLocator) {
|
|
6
|
-
this.isAudioUploaded = false;
|
|
7
|
-
this.isAllowedTypes = true;
|
|
8
|
-
this.deletedAudio = [];
|
|
9
|
-
this.parent = parent;
|
|
10
|
-
this.rteID = parent.element.id;
|
|
11
|
-
this.i10n = serviceLocator.getService('rteLocale');
|
|
12
|
-
this.rendererFactory = serviceLocator.getService('rendererFactory');
|
|
13
|
-
this.dialogRenderObj = serviceLocator.getService('dialogRenderObject');
|
|
14
|
-
this.addEventListener();
|
|
15
|
-
this.docClick = this.onDocumentClick.bind(this);
|
|
16
|
-
this.isDestroyed = false;
|
|
17
|
-
}
|
|
18
|
-
Audio.prototype.addEventListener = function () {
|
|
19
|
-
if (this.parent.isDestroyed) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
this.parent.on(events.keyDown, this.onKeyDown, this);
|
|
23
|
-
this.parent.on(events.keyUp, this.onKeyUp, this);
|
|
24
|
-
this.parent.on(events.insertAudio, this.insertingAudio, this);
|
|
25
|
-
this.parent.on(events.initialEnd, this.afterRender, this);
|
|
26
|
-
this.parent.on(events.dynamicModule, this.afterRender, this);
|
|
27
|
-
this.parent.on(events.showAudioDialog, this.showDialog, this);
|
|
28
|
-
this.parent.on(events.closeAudioDialog, this.closeDialog, this);
|
|
29
|
-
this.parent.on(events.audioToolbarAction, this.onToolbarAction, this);
|
|
30
|
-
this.parent.on(events.dropDownSelect, this.alignmentSelect, this);
|
|
31
|
-
this.parent.on(events.audioDelete, this.deleteAudio, this);
|
|
32
|
-
this.parent.on(events.editAreaClick, this.editAreaClickHandler, this);
|
|
33
|
-
this.parent.on(events.insertCompleted, this.showAudioQuickToolbar, this);
|
|
34
|
-
this.parent.on(events.destroy, this.destroy, this);
|
|
35
|
-
this.parent.on(events.iframeMouseDown, this.closeDialog, this);
|
|
36
|
-
};
|
|
37
|
-
Audio.prototype.removeEventListener = function () {
|
|
38
|
-
this.parent.off(events.keyDown, this.onKeyDown);
|
|
39
|
-
this.parent.off(events.keyUp, this.onKeyUp);
|
|
40
|
-
this.parent.off(events.insertAudio, this.insertingAudio);
|
|
41
|
-
this.parent.off(events.initialEnd, this.afterRender);
|
|
42
|
-
this.parent.off(events.dynamicModule, this.afterRender);
|
|
43
|
-
this.parent.off(events.showAudioDialog, this.showDialog);
|
|
44
|
-
this.parent.off(events.closeAudioDialog, this.closeDialog);
|
|
45
|
-
this.parent.off(events.audioToolbarAction, this.onToolbarAction);
|
|
46
|
-
this.parent.off(events.dropDownSelect, this.alignmentSelect);
|
|
47
|
-
this.parent.off(events.audioDelete, this.deleteAudio);
|
|
48
|
-
this.parent.off(events.editAreaClick, this.editAreaClickHandler);
|
|
49
|
-
this.parent.off(events.insertCompleted, this.showAudioQuickToolbar);
|
|
50
|
-
this.parent.off(events.destroy, this.destroy);
|
|
51
|
-
this.parent.off(events.iframeMouseDown, this.closeDialog);
|
|
52
|
-
if (!ej2_base_1.isNullOrUndefined(this.contentModule)) {
|
|
53
|
-
ej2_base_1.EventHandler.remove(this.parent.contentModule.getEditPanel(), ej2_base_2.Browser.touchStartEvent, this.touchStart);
|
|
54
|
-
ej2_base_1.EventHandler.remove(this.contentModule.getEditPanel(), ej2_base_2.Browser.touchEndEvent, this.audioClick);
|
|
55
|
-
this.parent.element.ownerDocument.removeEventListener('mousedown', this.docClick);
|
|
56
|
-
this.docClick = null;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
Audio.prototype.afterRender = function () {
|
|
60
|
-
this.contentModule = this.rendererFactory.getRenderer(enum_1.RenderType.Content);
|
|
61
|
-
ej2_base_1.EventHandler.add(this.parent.contentModule.getEditPanel(), ej2_base_2.Browser.touchStartEvent, this.touchStart, this);
|
|
62
|
-
ej2_base_1.EventHandler.add(this.contentModule.getEditPanel(), ej2_base_2.Browser.touchEndEvent, this.audioClick, this);
|
|
63
|
-
this.parent.element.ownerDocument.addEventListener('mousedown', this.docClick);
|
|
64
|
-
};
|
|
65
|
-
Audio.prototype.checkAudioBack = function (range) {
|
|
66
|
-
if (range.startContainer.nodeName === '#text' && range.startOffset === 0 &&
|
|
67
|
-
!ej2_base_2.isNullOrUndefined(range.startContainer.previousSibling) && this.isAudioElem(range.startContainer.previousSibling)) {
|
|
68
|
-
this.deletedAudio.push(range.startContainer.previousSibling);
|
|
69
|
-
}
|
|
70
|
-
else if (range.startContainer.nodeName !== '#text' && !ej2_base_2.isNullOrUndefined(range.startContainer.childNodes[range.startOffset - 1]) &&
|
|
71
|
-
this.isAudioElem(range.startContainer.childNodes[range.startOffset - 1])) {
|
|
72
|
-
this.deletedAudio.push(range.startContainer.childNodes[range.startOffset - 1]);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
Audio.prototype.checkAudioDel = function (range) {
|
|
76
|
-
if (range.startContainer.nodeName === '#text' && range.startOffset === range.startContainer.textContent.length &&
|
|
77
|
-
!ej2_base_2.isNullOrUndefined(range.startContainer.nextSibling) && range.startContainer.nextSibling.nodeName === 'AUDIO') {
|
|
78
|
-
this.deletedAudio.push(range.startContainer.nextSibling);
|
|
79
|
-
}
|
|
80
|
-
else if (range.startContainer.nodeName !== '#text' && !ej2_base_2.isNullOrUndefined(range.startContainer.childNodes[range.startOffset]) &&
|
|
81
|
-
this.isAudioElem(range.startContainer.childNodes[range.startOffset])) {
|
|
82
|
-
this.deletedAudio.push(range.startContainer.childNodes[range.startOffset]);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
Audio.prototype.undoStack = function (args) {
|
|
86
|
-
if ((args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') && this.parent.editorMode === 'HTML') {
|
|
87
|
-
for (var i = 0; i < this.parent.formatter.getUndoRedoStack().length; i++) {
|
|
88
|
-
var temp = this.parent.createElement('div');
|
|
89
|
-
var contentElem = this.parent.formatter.getUndoRedoStack()[i].text;
|
|
90
|
-
temp.appendChild(contentElem.cloneNode(true));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
Audio.prototype.touchStart = function (e, ele) {
|
|
95
|
-
if (this.parent.readonly) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
this.prevSelectedAudEle = this.audEle;
|
|
99
|
-
};
|
|
100
|
-
Audio.prototype.onToolbarAction = function (args) {
|
|
101
|
-
if (util_2.isIDevice()) {
|
|
102
|
-
this.parent.notify(events.selectionRestore, {});
|
|
103
|
-
}
|
|
104
|
-
var item = args.args.item;
|
|
105
|
-
switch (item.subCommand) {
|
|
106
|
-
case 'AudioReplace':
|
|
107
|
-
this.parent.notify(events.insertAudio, args);
|
|
108
|
-
break;
|
|
109
|
-
case 'AudioRemove':
|
|
110
|
-
this.parent.notify(events.audioDelete, args);
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
Audio.prototype.onKeyUp = function (event) {
|
|
115
|
-
if (!ej2_base_2.isNullOrUndefined(this.deletedAudio) && this.deletedAudio.length > 0) {
|
|
116
|
-
for (var i = 0; i < this.deletedAudio.length; i++) {
|
|
117
|
-
var elem = this.deletedAudio[i];
|
|
118
|
-
var srcElem = elem.tagName === 'SOURCE' ? elem : elem.querySelector('source');
|
|
119
|
-
var args = {
|
|
120
|
-
element: this.deletedAudio[i].querySelector('audio'),
|
|
121
|
-
src: srcElem.getAttribute('src')
|
|
122
|
-
};
|
|
123
|
-
this.parent.trigger(events.afterMediaDelete, args);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
Audio.prototype.onKeyDown = function (event) {
|
|
128
|
-
var originalEvent = event.args;
|
|
129
|
-
var range;
|
|
130
|
-
var save;
|
|
131
|
-
var selectNodeEle;
|
|
132
|
-
var selectParentEle;
|
|
133
|
-
this.deletedAudio = [];
|
|
134
|
-
var isCursor;
|
|
135
|
-
var keyCodeValues = [27, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
|
|
136
|
-
44, 45, 9, 16, 17, 18, 19, 20, 33, 34, 35, 36, 37, 38, 39, 40, 91, 92, 93, 144, 145, 182, 183];
|
|
137
|
-
if (this.parent.editorMode === 'HTML') {
|
|
138
|
-
range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
139
|
-
isCursor = range.startContainer === range.endContainer && range.startOffset === range.endOffset;
|
|
140
|
-
}
|
|
141
|
-
if (!isCursor && this.parent.editorMode === 'HTML' && keyCodeValues.indexOf(originalEvent.which) < 0) {
|
|
142
|
-
var nodes = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
143
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
144
|
-
if (this.isAudioElem(nodes[i])) {
|
|
145
|
-
this.deletedAudio.push(nodes[i]);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (this.parent.editorMode === 'HTML' && ((originalEvent.which === 8 && originalEvent.code === 'Backspace') ||
|
|
150
|
-
(originalEvent.which === 46 && originalEvent.code === 'Delete'))) {
|
|
151
|
-
var isCursor_1 = range.startContainer === range.endContainer && range.startOffset === range.endOffset;
|
|
152
|
-
if ((originalEvent.which === 8 && originalEvent.code === 'Backspace' && isCursor_1)) {
|
|
153
|
-
this.checkAudioBack(range);
|
|
154
|
-
}
|
|
155
|
-
else if ((originalEvent.which === 46 && originalEvent.code === 'Delete' && isCursor_1)) {
|
|
156
|
-
this.checkAudioDel(range);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if (!ej2_base_1.isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) &&
|
|
160
|
-
originalEvent.code !== 'KeyK') {
|
|
161
|
-
range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
162
|
-
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
163
|
-
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
164
|
-
if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
|
|
165
|
-
(this.isAudioElem(selectParentEle[0])) && selectParentEle[0].parentElement) {
|
|
166
|
-
var prev = selectParentEle[0].parentElement.childNodes[0];
|
|
167
|
-
this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), prev, prev, prev.textContent.length, prev.textContent.length);
|
|
168
|
-
ej2_base_2.removeClass([selectParentEle[0]], classes.CLS_AUD_FOCUS);
|
|
169
|
-
this.quickToolObj.audioQTBar.hidePopup();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (originalEvent.ctrlKey && (originalEvent.keyCode === 89 || originalEvent.keyCode === 90)) {
|
|
173
|
-
this.undoStack({ subCommand: (originalEvent.keyCode === 90 ? 'undo' : 'redo') });
|
|
174
|
-
}
|
|
175
|
-
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
176
|
-
if (selectNodeEle && (this.isAudioElem(selectNodeEle[0]) ||
|
|
177
|
-
(originalEvent.keyCode === 46 && selectNodeEle[0].nextSibling &&
|
|
178
|
-
this.isAudioElem(selectNodeEle[0].nextSibling)) ||
|
|
179
|
-
(originalEvent.keyCode === 8 && selectNodeEle[0].previousSibling &&
|
|
180
|
-
this.isAudioElem(selectNodeEle[0].previousSibling))) &&
|
|
181
|
-
selectNodeEle.length <= 2) {
|
|
182
|
-
if (!ej2_base_1.isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
|
|
183
|
-
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
184
|
-
}
|
|
185
|
-
originalEvent.preventDefault();
|
|
186
|
-
var event_1 = {
|
|
187
|
-
selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
|
|
188
|
-
args: {
|
|
189
|
-
item: { command: 'Audios', subCommand: 'AudioRemove' },
|
|
190
|
-
originalEvent: originalEvent
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
this.deleteAudio(event_1, originalEvent.keyCode);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
switch (originalEvent.action) {
|
|
197
|
-
case 'escape':
|
|
198
|
-
if (!ej2_base_1.isNullOrUndefined(this.dialogObj)) {
|
|
199
|
-
this.dialogObj.close();
|
|
200
|
-
}
|
|
201
|
-
break;
|
|
202
|
-
case 'backspace':
|
|
203
|
-
case 'delete':
|
|
204
|
-
for (var i = 0; i < this.deletedAudio.length; i++) {
|
|
205
|
-
var src = this.deletedAudio[i].src;
|
|
206
|
-
this.audioRemovePost(src);
|
|
207
|
-
}
|
|
208
|
-
if (this.parent.editorMode !== 'Markdown') {
|
|
209
|
-
if (range.startContainer.nodeType === 3) {
|
|
210
|
-
if (originalEvent.code === 'Backspace') {
|
|
211
|
-
if (range.startContainer.previousElementSibling && range.startOffset === 0 &&
|
|
212
|
-
range.startContainer.previousElementSibling.classList.contains(classes.CLS_AUDIOWRAP)) {
|
|
213
|
-
ej2_base_1.detach(range.startContainer.previousElementSibling);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
if (range.startContainer.nextElementSibling &&
|
|
218
|
-
range.endContainer.textContent.length === range.endOffset &&
|
|
219
|
-
range.startContainer.nextElementSibling.classList.contains(classes.CLS_AUDIOWRAP)) {
|
|
220
|
-
ej2_base_1.detach(range.startContainer.nextElementSibling);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
else if (range.startContainer.nodeType === 1 && (range.startContainer.classList &&
|
|
225
|
-
(range.startContainer.classList.contains(classes.CLS_AUDIOWRAP) ||
|
|
226
|
-
range.startContainer.classList.contains(classes.CLS_CLICKELEM) ||
|
|
227
|
-
range.startContainer.classList.contains(classes.CLS_VID_CLICK_ELEM)))) {
|
|
228
|
-
ej2_base_1.detach(range.startContainer);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
break;
|
|
232
|
-
case 'insert-audio':
|
|
233
|
-
if (!ej2_base_1.isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
|
|
234
|
-
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
235
|
-
}
|
|
236
|
-
this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
|
|
237
|
-
originalEvent.preventDefault();
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
if (originalEvent.ctrlKey && originalEvent.key === 'a') {
|
|
241
|
-
this.handleSelectAll();
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
Audio.prototype.handleSelectAll = function () {
|
|
245
|
-
var audioFocusNodes = this.parent.inputElement.querySelectorAll('.' + classes.CLS_AUD_FOCUS);
|
|
246
|
-
ej2_base_2.removeClass(audioFocusNodes, classes.CLS_AUD_FOCUS);
|
|
247
|
-
};
|
|
248
|
-
Audio.prototype.openDialog = function (isInternal, event, selection, ele, parentEle) {
|
|
249
|
-
var range;
|
|
250
|
-
var save;
|
|
251
|
-
var selectNodeEle;
|
|
252
|
-
var selectParentEle;
|
|
253
|
-
if (!isInternal && !ej2_base_2.isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
|
|
254
|
-
range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
255
|
-
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
256
|
-
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
257
|
-
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
save = selection;
|
|
261
|
-
selectNodeEle = ele;
|
|
262
|
-
selectParentEle = parentEle;
|
|
263
|
-
}
|
|
264
|
-
if (this.parent.editorMode === 'HTML') {
|
|
265
|
-
this.insertAudio({
|
|
266
|
-
args: {
|
|
267
|
-
item: { command: 'Audios', subCommand: 'Audio' },
|
|
268
|
-
originalEvent: event,
|
|
269
|
-
name: !isInternal ? 'showDialog' : null
|
|
270
|
-
},
|
|
271
|
-
selectNode: selectNodeEle,
|
|
272
|
-
selection: save,
|
|
273
|
-
selectParent: selectParentEle
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
Audio.prototype.showDialog = function (args) {
|
|
278
|
-
if (!ej2_base_2.isNullOrUndefined(args.originalEvent)) {
|
|
279
|
-
this.openDialog(false, args.originalEvent);
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
this.openDialog(false);
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
Audio.prototype.closeDialog = function () {
|
|
286
|
-
if (this.dialogObj) {
|
|
287
|
-
this.dialogObj.hide({ returnValue: true });
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
Audio.prototype.deleteAudio = function (e, keyCode) {
|
|
291
|
-
if (!this.isAudioElem(e.selectNode[0])) {
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
if (this.audEle) {
|
|
295
|
-
if (e.selectNode[0].nodeType === 3) {
|
|
296
|
-
e.selectNode[0] = this.audEle;
|
|
297
|
-
}
|
|
298
|
-
else if (this.isAudioElem(e.selectNode[0])) {
|
|
299
|
-
e.selectNode[0] = e.selectNode[0].classList.contains(classes.CLS_AUDIOWRAP) ? e.selectNode[0] :
|
|
300
|
-
e.selectNode[0].parentElement;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
var args = {
|
|
304
|
-
element: e.selectNode[0].querySelector('audio'),
|
|
305
|
-
src: e.selectNode[0].querySelector('source').getAttribute('src')
|
|
306
|
-
};
|
|
307
|
-
if (this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
308
|
-
this.parent.formatter.saveData();
|
|
309
|
-
}
|
|
310
|
-
e.selection.restore();
|
|
311
|
-
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, {
|
|
312
|
-
selectNode: e.selectNode,
|
|
313
|
-
subCommand: e.args.item.subCommand
|
|
314
|
-
});
|
|
315
|
-
this.audioRemovePost(args.src);
|
|
316
|
-
if (this.quickToolObj && document.body.contains(this.quickToolObj.audioQTBar.element)) {
|
|
317
|
-
this.quickToolObj.audioQTBar.hidePopup();
|
|
318
|
-
}
|
|
319
|
-
if (ej2_base_1.isNullOrUndefined(keyCode)) {
|
|
320
|
-
this.parent.trigger(events.afterMediaDelete, args);
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
Audio.prototype.audioRemovePost = function (src) {
|
|
324
|
-
var proxy = this;
|
|
325
|
-
var absoluteUrl = '';
|
|
326
|
-
if (ej2_base_2.isNullOrUndefined(this.parent.insertAudioSettings.removeUrl) || this.parent.insertAudioSettings.removeUrl === '') {
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
if (src.indexOf('http://') > -1 || src.indexOf('https://') > -1) {
|
|
330
|
-
absoluteUrl = src;
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
absoluteUrl = new URL(src, document.baseURI).href;
|
|
334
|
-
}
|
|
335
|
-
this.removingAudioName = absoluteUrl.replace(/^.*[\\/]/, '');
|
|
336
|
-
var xhr = new XMLHttpRequest();
|
|
337
|
-
xhr.addEventListener('readystatechange', function () {
|
|
338
|
-
if (this.readyState === 4 && this.status === 200) {
|
|
339
|
-
proxy.triggerPost(this.response);
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
xhr.open('GET', absoluteUrl);
|
|
343
|
-
xhr.responseType = 'blob';
|
|
344
|
-
xhr.send();
|
|
345
|
-
};
|
|
346
|
-
Audio.prototype.triggerPost = function (response) {
|
|
347
|
-
var removeUrl = this.parent.insertAudioSettings.removeUrl;
|
|
348
|
-
if (ej2_base_2.isNullOrUndefined(removeUrl) || removeUrl === '') {
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
var file = new File([response], this.removingAudioName);
|
|
352
|
-
var ajax = new ej2_base_1.Ajax(removeUrl, 'POST', true, null);
|
|
353
|
-
var formData = new FormData();
|
|
354
|
-
formData.append('UploadFiles', file);
|
|
355
|
-
ajax.send(formData);
|
|
356
|
-
};
|
|
357
|
-
Audio.prototype.audioClick = function (e) {
|
|
358
|
-
if (ej2_base_2.Browser.isDevice) {
|
|
359
|
-
if (this.isAudioElem(e.target)) {
|
|
360
|
-
this.contentModule.getEditPanel().setAttribute('contenteditable', 'false');
|
|
361
|
-
e.target.focus();
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
if (!this.parent.readonly) {
|
|
365
|
-
this.contentModule.getEditPanel().setAttribute('contenteditable', 'true');
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
if (this.isAudioElem(e.target) && !this.parent.userAgentData.isSafari()) {
|
|
370
|
-
this.audEle = e.target.querySelector('audio');
|
|
371
|
-
e.preventDefault();
|
|
372
|
-
}
|
|
373
|
-
};
|
|
374
|
-
Audio.prototype.onDocumentClick = function (e) {
|
|
375
|
-
var target = e.target;
|
|
376
|
-
if (ej2_base_2.isNullOrUndefined(this.contentModule.getEditPanel())) {
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
if (this.isAudioElem(target)) {
|
|
380
|
-
this.audEle = target.querySelector('audio');
|
|
381
|
-
}
|
|
382
|
-
if (!ej2_base_1.isNullOrUndefined(this.dialogObj) && ((!ej2_base_2.closest(target, '[id=' + "'" + this.dialogObj.element.id + "'" + ']') && this.parent.toolbarSettings.enable && this.parent.getToolbarElement() &&
|
|
383
|
-
!this.parent.getToolbarElement().contains(e.target)) ||
|
|
384
|
-
(this.parent.getToolbarElement() && this.parent.getToolbarElement().contains(e.target) &&
|
|
385
|
-
!ej2_base_2.closest(target, '#' + this.parent.getID() + '_toolbar_Audio') &&
|
|
386
|
-
!target.querySelector('#' + this.parent.getID() + '_toolbar_Audio')))) {
|
|
387
|
-
if (e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight) {
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
this.parent.notify(events.documentClickClosedBy, { closedBy: "outside click" });
|
|
391
|
-
this.dialogObj.hide({ returnValue: true });
|
|
392
|
-
this.parent.isBlur = true;
|
|
393
|
-
util_1.dispatchEvent(this.parent.element, 'focusout');
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
if (this.contentModule.getEditPanel().querySelector('.' + classes.CLS_AUD_FOCUS)) {
|
|
397
|
-
if (!this.isAudioElem(e.target) && !ej2_base_2.isNullOrUndefined(this.audEle)) {
|
|
398
|
-
this.audEle.style.outline = '';
|
|
399
|
-
}
|
|
400
|
-
else if (!ej2_base_2.isNullOrUndefined(this.prevSelectedAudEle) && this.prevSelectedAudEle !== target) {
|
|
401
|
-
this.prevSelectedAudEle.style.outline = '';
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
if (this.parent.inlineMode.enable && target && this.dialogObj && !ej2_base_2.closest(target, '#' + this.dialogObj.element.id)) {
|
|
405
|
-
this.dialogObj.hide();
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
Audio.prototype.alignmentSelect = function (e) {
|
|
409
|
-
var item = e.item;
|
|
410
|
-
if (!document.body.contains(document.body.querySelector('.e-rte-quick-toolbar')) || item.command !== 'Audios') {
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
414
|
-
var selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
415
|
-
if (this.audEle) {
|
|
416
|
-
selectNodeEle = [this.audEle];
|
|
417
|
-
}
|
|
418
|
-
var args = { args: e, selectNode: selectNodeEle };
|
|
419
|
-
if (this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
420
|
-
this.parent.formatter.saveData();
|
|
421
|
-
}
|
|
422
|
-
switch (item.subCommand) {
|
|
423
|
-
case 'Inline':
|
|
424
|
-
this.inline(args);
|
|
425
|
-
break;
|
|
426
|
-
case 'Break':
|
|
427
|
-
this.break(args);
|
|
428
|
-
break;
|
|
429
|
-
}
|
|
430
|
-
if (this.quickToolObj && document.body.contains(this.quickToolObj.audioQTBar.element)) {
|
|
431
|
-
this.quickToolObj.audioQTBar.hidePopup();
|
|
432
|
-
ej2_base_2.removeClass([selectNodeEle[0]], classes.CLS_AUD_FOCUS);
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
Audio.prototype.break = function (e) {
|
|
436
|
-
if (e.selectNode[0].nodeName !== 'AUDIO') {
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
var subCommand = (e.args.item && e.args.item.subCommand) ?
|
|
440
|
-
e.args.item.subCommand : 'Break';
|
|
441
|
-
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
442
|
-
};
|
|
443
|
-
Audio.prototype.inline = function (e) {
|
|
444
|
-
if (e.selectNode[0].nodeName !== 'AUDIO') {
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
var subCommand = (e.args.item && e.args.item.subCommand) ?
|
|
448
|
-
e.args.item.subCommand : 'Inline';
|
|
449
|
-
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
450
|
-
};
|
|
451
|
-
Audio.prototype.editAreaClickHandler = function (e) {
|
|
452
|
-
if (this.parent.readonly) {
|
|
453
|
-
this.hideAudioQuickToolbar();
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
var args = e.args;
|
|
457
|
-
var showOnRightClick = this.parent.quickToolbarSettings.showOnRightClick;
|
|
458
|
-
if (args.which === 2 || (showOnRightClick && args.which === 1) || (!showOnRightClick && args.which === 3)) {
|
|
459
|
-
if ((showOnRightClick && args.which === 1) && !ej2_base_1.isNullOrUndefined(args.target) &&
|
|
460
|
-
this.isAudioElem(args.target)) {
|
|
461
|
-
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
462
|
-
this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(), args.target);
|
|
463
|
-
}
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
|
-
if (this.parent.editorMode === 'HTML' && this.parent.quickToolbarModule && this.parent.quickToolbarModule.audioQTBar) {
|
|
467
|
-
this.quickToolObj = this.parent.quickToolbarModule;
|
|
468
|
-
var target = args.target;
|
|
469
|
-
this.contentModule = this.rendererFactory.getRenderer(enum_1.RenderType.Content);
|
|
470
|
-
var isPopupOpen = this.quickToolObj.audioQTBar.element.classList.contains('e-rte-pop');
|
|
471
|
-
if (this.isAudioElem(target) && this.parent.quickToolbarModule) {
|
|
472
|
-
if (isPopupOpen) {
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
476
|
-
this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(), target);
|
|
477
|
-
if (util_2.isIDevice()) {
|
|
478
|
-
this.parent.notify(events.selectionSave, e);
|
|
479
|
-
}
|
|
480
|
-
if (target.querySelector('audio')) {
|
|
481
|
-
target.querySelector('audio').style.outline = '2px solid #4a90e2';
|
|
482
|
-
}
|
|
483
|
-
this.showAudioQuickToolbar({ args: args, type: 'Audios', elements: [args.target] });
|
|
484
|
-
}
|
|
485
|
-
else {
|
|
486
|
-
this.hideAudioQuickToolbar();
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
Audio.prototype.isAudioElem = function (target) {
|
|
491
|
-
if (target && target.nodeType !== 3 && target.nodeName !== 'BR' && (target.classList &&
|
|
492
|
-
(target.classList.contains(classes.CLS_AUDIOWRAP) || target.classList.contains('e-rte-audio') || target.classList.contains(classes.CLS_CLICKELEM)))) {
|
|
493
|
-
return true;
|
|
494
|
-
}
|
|
495
|
-
else {
|
|
496
|
-
return false;
|
|
497
|
-
}
|
|
498
|
-
};
|
|
499
|
-
Audio.prototype.showAudioQuickToolbar = function (e) {
|
|
500
|
-
var _this = this;
|
|
501
|
-
if (e.type !== 'Audios' || ej2_base_1.isNullOrUndefined(this.parent.quickToolbarModule)
|
|
502
|
-
|| ej2_base_1.isNullOrUndefined(this.parent.quickToolbarModule.audioQTBar) || ej2_base_1.isNullOrUndefined(e.args)) {
|
|
503
|
-
return;
|
|
504
|
-
}
|
|
505
|
-
this.quickToolObj = this.parent.quickToolbarModule;
|
|
506
|
-
var args = e.args;
|
|
507
|
-
var target = e.elements;
|
|
508
|
-
[].forEach.call(e.elements, function (element, index) {
|
|
509
|
-
if (index === 0) {
|
|
510
|
-
target = element;
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
if (this.isAudioElem(target)) {
|
|
514
|
-
var audioElem = target.tagName === 'AUDIO' ? target : target.querySelector('audio');
|
|
515
|
-
ej2_base_1.addClass([audioElem], [classes.CLS_AUD_FOCUS]);
|
|
516
|
-
audioElem.style.outline = '2px solid #4a90e2';
|
|
517
|
-
}
|
|
518
|
-
if (this.parent.quickToolbarModule.audioQTBar) {
|
|
519
|
-
if (e.isNotify) {
|
|
520
|
-
this.showPopupTime = setTimeout(function () {
|
|
521
|
-
_this.parent.formatter.editorManager.nodeSelection.Clear(_this.contentModule.getDocument());
|
|
522
|
-
_this.parent.formatter.editorManager.nodeSelection.setSelectionContents(_this.contentModule.getDocument(), target);
|
|
523
|
-
_this.quickToolObj.audioQTBar.showPopup(args.pageX - 50, target.getBoundingClientRect().top + 34, target);
|
|
524
|
-
}, 400);
|
|
525
|
-
}
|
|
526
|
-
else {
|
|
527
|
-
this.quickToolObj.audioQTBar.showPopup(args.pageX - 50, target.getBoundingClientRect().top + 34, target);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
Audio.prototype.hideAudioQuickToolbar = function () {
|
|
532
|
-
if (!ej2_base_1.isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.' + classes.CLS_AUD_FOCUS))) {
|
|
533
|
-
ej2_base_2.removeClass([this.contentModule.getEditPanel().querySelector('.' + classes.CLS_AUD_FOCUS)], classes.CLS_AUD_FOCUS);
|
|
534
|
-
if (!ej2_base_2.isNullOrUndefined(this.audEle)) {
|
|
535
|
-
this.audEle.style.outline = '';
|
|
536
|
-
}
|
|
537
|
-
if (this.quickToolObj && this.quickToolObj.audioQTBar && document.body.contains(this.quickToolObj.audioQTBar.element)) {
|
|
538
|
-
this.quickToolObj.audioQTBar.hidePopup();
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
};
|
|
542
|
-
Audio.prototype.insertingAudio = function (e) {
|
|
543
|
-
this.insertAudio(e);
|
|
544
|
-
if (!ej2_base_1.isNullOrUndefined(this.dialogObj)) {
|
|
545
|
-
this.dialogObj.element.style.maxHeight = 'inherit';
|
|
546
|
-
var dialogContent = this.dialogObj.element.querySelector('.e-audio-content');
|
|
547
|
-
if (!ej2_base_1.isNullOrUndefined(this.parent.insertAudioSettings.path) || this.parent.editorMode === 'HTML') {
|
|
548
|
-
document.getElementById(this.rteID + '_insertAudio').focus();
|
|
549
|
-
}
|
|
550
|
-
else {
|
|
551
|
-
dialogContent.querySelector('.e-audio-url').focus();
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
};
|
|
555
|
-
Audio.prototype.clearDialogObj = function () {
|
|
556
|
-
if (this.uploadObj && !this.uploadObj.isDestroyed) {
|
|
557
|
-
this.uploadObj.destroy();
|
|
558
|
-
ej2_base_1.detach(this.uploadObj.element);
|
|
559
|
-
this.uploadObj = null;
|
|
560
|
-
}
|
|
561
|
-
if (this.button && !this.button.isDestroyed) {
|
|
562
|
-
this.button.destroy();
|
|
563
|
-
ej2_base_1.detach(this.button.element);
|
|
564
|
-
this.button = null;
|
|
565
|
-
}
|
|
566
|
-
if (this.dialogObj && !this.dialogObj.isDestroyed) {
|
|
567
|
-
this.dialogObj.destroy();
|
|
568
|
-
ej2_base_1.detach(this.dialogObj.element);
|
|
569
|
-
this.dialogObj = null;
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
Audio.prototype.insertAudio = function (e) {
|
|
573
|
-
var _this = this;
|
|
574
|
-
if (this.dialogObj) {
|
|
575
|
-
this.dialogObj.hide({ returnValue: true });
|
|
576
|
-
return;
|
|
577
|
-
}
|
|
578
|
-
var audioDialog = this.parent.createElement('div', { className: 'e-rte-audio-dialog', id: this.rteID + '_audio' });
|
|
579
|
-
this.parent.rootContainer.appendChild(audioDialog);
|
|
580
|
-
var audioInsert = this.i10n.getConstant('dialogInsert');
|
|
581
|
-
var audiolinkCancel = this.i10n.getConstant('dialogCancel');
|
|
582
|
-
var audioHeader = this.i10n.getConstant('audioHeader');
|
|
583
|
-
var selection = e.selection;
|
|
584
|
-
var selectObj = { selfAudio: this, selection: e.selection, args: e.args, selectParent: e.selectParent };
|
|
585
|
-
var dialogModel = {
|
|
586
|
-
header: audioHeader,
|
|
587
|
-
cssClass: classes.CLS_RTE_ELEMENTS,
|
|
588
|
-
enableRtl: this.parent.enableRtl,
|
|
589
|
-
locale: this.parent.locale,
|
|
590
|
-
showCloseIcon: true, closeOnEscape: true, width: (ej2_base_2.Browser.isDevice) ? '290px' : '340px',
|
|
591
|
-
isModal: ej2_base_2.Browser.isDevice,
|
|
592
|
-
buttons: [{
|
|
593
|
-
click: this.insertAudioUrl.bind(selectObj),
|
|
594
|
-
buttonModel: { content: audioInsert, cssClass: 'e-flat e-insertAudio', isPrimary: true, disabled: true }
|
|
595
|
-
},
|
|
596
|
-
{
|
|
597
|
-
click: function (e) {
|
|
598
|
-
_this.cancelDialog(e);
|
|
599
|
-
},
|
|
600
|
-
buttonModel: { cssClass: 'e-flat e-cancel', content: audiolinkCancel }
|
|
601
|
-
}],
|
|
602
|
-
target: (ej2_base_2.Browser.isDevice) ? document.body : this.parent.element,
|
|
603
|
-
animationSettings: { effect: 'None' },
|
|
604
|
-
close: function (event) {
|
|
605
|
-
if (_this.isAudioUploaded) {
|
|
606
|
-
if (_this.dialogObj.element.querySelector('.e-file-abort-btn')) {
|
|
607
|
-
_this.dialogObj.element.querySelector('.e-file-abort-btn').click();
|
|
608
|
-
}
|
|
609
|
-
else {
|
|
610
|
-
_this.uploadObj.remove();
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
_this.parent.isBlur = false;
|
|
614
|
-
if (event && !ej2_base_2.isNullOrUndefined(event.event) && event.event.returnValue) {
|
|
615
|
-
if (_this.parent.editorMode === 'HTML') {
|
|
616
|
-
selection.restore();
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
_this.clearDialogObj();
|
|
620
|
-
_this.dialogRenderObj.close(event);
|
|
621
|
-
}
|
|
622
|
-
};
|
|
623
|
-
var dialogContent = this.parent.createElement('div', { className: 'e-audio-content' });
|
|
624
|
-
if (!ej2_base_1.isNullOrUndefined(this.parent.insertAudioSettings.path) || this.parent.editorMode === 'HTML') {
|
|
625
|
-
dialogContent.appendChild(this.audioUpload(e));
|
|
626
|
-
}
|
|
627
|
-
var linkHeader = this.parent.createElement('div', { className: 'e-audioheader' });
|
|
628
|
-
var linkHeaderText = this.i10n.getConstant('audioLinkHeader');
|
|
629
|
-
if (this.parent.editorMode === 'HTML') {
|
|
630
|
-
linkHeader.innerHTML = linkHeaderText;
|
|
631
|
-
}
|
|
632
|
-
dialogContent.appendChild(linkHeader);
|
|
633
|
-
dialogContent.appendChild(this.audioUrlPopup(e));
|
|
634
|
-
if (e.selectNode && e.selectNode[0].nodeType === 1 && this.isAudioElem(e.selectNode[0])) {
|
|
635
|
-
dialogModel.header = this.parent.localeObj.getConstant('editAudioHeader');
|
|
636
|
-
dialogModel.content = dialogContent;
|
|
637
|
-
}
|
|
638
|
-
else {
|
|
639
|
-
dialogModel.content = dialogContent;
|
|
640
|
-
}
|
|
641
|
-
this.dialogObj = this.dialogRenderObj.render(dialogModel);
|
|
642
|
-
this.dialogObj.createElement = this.parent.createElement;
|
|
643
|
-
this.dialogObj.appendTo(audioDialog);
|
|
644
|
-
if (e.selectNode && e.selectNode[0].nodeType === 1 && this.isAudioElem(e.selectNode[0]) && (e.name === 'insertAudio')) {
|
|
645
|
-
this.dialogObj.element.querySelector('.e-insertAudio').textContent = this.parent.localeObj.getConstant('dialogUpdate');
|
|
646
|
-
}
|
|
647
|
-
audioDialog.style.maxHeight = 'inherit';
|
|
648
|
-
if (this.quickToolObj) {
|
|
649
|
-
if (this.quickToolObj.audioQTBar && document.body.contains(this.quickToolObj.audioQTBar.element)) {
|
|
650
|
-
this.quickToolObj.audioQTBar.hidePopup();
|
|
651
|
-
}
|
|
652
|
-
if (this.quickToolObj.inlineQTBar && document.body.contains(this.quickToolObj.inlineQTBar.element)) {
|
|
653
|
-
this.quickToolObj.inlineQTBar.hidePopup();
|
|
654
|
-
}
|
|
655
|
-
if (this.quickToolObj.textQTBar && this.parent.element.ownerDocument.body.contains(this.quickToolObj.textQTBar.element)) {
|
|
656
|
-
this.quickToolObj.textQTBar.hidePopup();
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
Audio.prototype.audioUrlPopup = function (e) {
|
|
661
|
-
var _this = this;
|
|
662
|
-
var audioUrl = this.parent.createElement('div', { className: 'audioUrl' });
|
|
663
|
-
var placeUrl = this.i10n.getConstant('audioUrl');
|
|
664
|
-
this.inputUrl = this.parent.createElement('input', {
|
|
665
|
-
className: 'e-input e-audio-url',
|
|
666
|
-
attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('audioLinkHeader') }
|
|
667
|
-
});
|
|
668
|
-
this.inputUrl.addEventListener('input', function () {
|
|
669
|
-
if (!ej2_base_2.isNullOrUndefined(_this.inputUrl)) {
|
|
670
|
-
if (_this.inputUrl.value.length === 0) {
|
|
671
|
-
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
});
|
|
678
|
-
if (e.selectNode && this.isAudioElem(e.selectNode[0])) {
|
|
679
|
-
var regex = new RegExp(/([^\S]|^)(((https?:\/\/)|(www\.))(\S+))/gi);
|
|
680
|
-
var sourceElement = e.selectNode[0].querySelector('source');
|
|
681
|
-
this.inputUrl.value = sourceElement.src.match(regex) ? sourceElement.src : '';
|
|
682
|
-
}
|
|
683
|
-
audioUrl.appendChild(this.inputUrl);
|
|
684
|
-
return audioUrl;
|
|
685
|
-
};
|
|
686
|
-
Audio.prototype.audioUpload = function (e) {
|
|
687
|
-
var _this = this;
|
|
688
|
-
var save;
|
|
689
|
-
var selectParent;
|
|
690
|
-
var proxy = this;
|
|
691
|
-
var iframe = proxy.parent.iframeSettings.enable;
|
|
692
|
-
if (proxy.parent.editorMode === 'HTML' && (!iframe && ej2_base_1.isNullOrUndefined(ej2_base_2.closest(e.selection.range.startContainer.parentNode, '[id='
|
|
693
|
-
+ "'" + this.parent.contentModule.getPanel().id + "'" + ']'))
|
|
694
|
-
|| (iframe && !util_1.hasClass(e.selection.range.startContainer.parentNode.ownerDocument.querySelector('body'), 'e-lib')))) {
|
|
695
|
-
this.contentModule.getEditPanel().focus();
|
|
696
|
-
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
697
|
-
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
698
|
-
selectParent = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
699
|
-
}
|
|
700
|
-
else {
|
|
701
|
-
save = e.selection;
|
|
702
|
-
selectParent = e.selectParent;
|
|
703
|
-
}
|
|
704
|
-
var uploadParentEle = this.parent.createElement('div', { className: 'e-aud-uploadwrap e-droparea' });
|
|
705
|
-
var deviceAudioUpMsg = this.i10n.getConstant('audioDeviceUploadMessage');
|
|
706
|
-
var audioUpMsg = this.i10n.getConstant('audioUploadMessage');
|
|
707
|
-
var span = this.parent.createElement('span', { className: 'e-droptext' });
|
|
708
|
-
var spanMsg = this.parent.createElement('span', {
|
|
709
|
-
className: 'e-rte-upload-text', innerHTML: ((ej2_base_2.Browser.isDevice) ? deviceAudioUpMsg : audioUpMsg)
|
|
710
|
-
});
|
|
711
|
-
span.appendChild(spanMsg);
|
|
712
|
-
var btnEle = this.parent.createElement('button', {
|
|
713
|
-
className: 'e-browsebtn', id: this.rteID + '_insertAudio', attrs: { autofocus: 'true', type: 'button' }
|
|
714
|
-
});
|
|
715
|
-
span.appendChild(btnEle);
|
|
716
|
-
uploadParentEle.appendChild(span);
|
|
717
|
-
var browserMsg = this.i10n.getConstant('browse');
|
|
718
|
-
this.button = new ej2_buttons_1.Button({ content: browserMsg, enableRtl: this.parent.enableRtl });
|
|
719
|
-
this.button.isStringTemplate = true;
|
|
720
|
-
this.button.createElement = this.parent.createElement;
|
|
721
|
-
this.button.appendTo(btnEle);
|
|
722
|
-
var btnClick = (ej2_base_2.Browser.isDevice) ? span : btnEle;
|
|
723
|
-
ej2_base_1.EventHandler.add(btnClick, 'click', this.fileSelect, this);
|
|
724
|
-
var uploadEle = this.parent.createElement('input', {
|
|
725
|
-
id: this.rteID + '_upload', attrs: { type: 'File', name: 'UploadFiles' }
|
|
726
|
-
});
|
|
727
|
-
uploadParentEle.appendChild(uploadEle);
|
|
728
|
-
var fileName;
|
|
729
|
-
var selectArgs;
|
|
730
|
-
var filesData;
|
|
731
|
-
this.uploadObj = new ej2_inputs_1.Uploader({
|
|
732
|
-
asyncSettings: { saveUrl: this.parent.insertAudioSettings.saveUrl, removeUrl: this.parent.insertAudioSettings.removeUrl },
|
|
733
|
-
dropArea: span, multiple: false, enableRtl: this.parent.enableRtl,
|
|
734
|
-
allowedExtensions: this.parent.insertAudioSettings.allowedTypes.toString(),
|
|
735
|
-
selected: function (e) {
|
|
736
|
-
proxy.isAudioUploaded = true;
|
|
737
|
-
selectArgs = e;
|
|
738
|
-
filesData = e.filesData;
|
|
739
|
-
_this.parent.trigger(events.fileSelected, selectArgs, function (selectArgs) {
|
|
740
|
-
if (!selectArgs.cancel) {
|
|
741
|
-
if (ej2_base_2.isNullOrUndefined(selectArgs.filesData[0])) {
|
|
742
|
-
return;
|
|
743
|
-
}
|
|
744
|
-
_this.checkExtension(selectArgs.filesData[0]);
|
|
745
|
-
fileName = selectArgs.filesData[0].name;
|
|
746
|
-
if (_this.parent.editorMode === 'HTML' && ej2_base_1.isNullOrUndefined(_this.parent.insertAudioSettings.path)) {
|
|
747
|
-
var reader_1 = new FileReader();
|
|
748
|
-
reader_1.addEventListener('load', function (e) {
|
|
749
|
-
var url = _this.parent.insertAudioSettings.saveFormat === 'Base64' ? reader_1.result :
|
|
750
|
-
URL.createObjectURL(util_1.convertToBlob(reader_1.result));
|
|
751
|
-
proxy.uploadUrl = {
|
|
752
|
-
url: url, selection: save, fileName: fileName,
|
|
753
|
-
selectParent: selectParent
|
|
754
|
-
};
|
|
755
|
-
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
756
|
-
if (ej2_base_1.isNullOrUndefined(proxy.parent.insertAudioSettings.saveUrl) && _this.isAllowedTypes
|
|
757
|
-
&& !ej2_base_1.isNullOrUndefined(_this.dialogObj)) {
|
|
758
|
-
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
759
|
-
}
|
|
760
|
-
});
|
|
761
|
-
reader_1.readAsDataURL(selectArgs.filesData[0].rawFile);
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
});
|
|
765
|
-
},
|
|
766
|
-
beforeUpload: function (args) {
|
|
767
|
-
_this.parent.trigger(events.beforeFileUpload, args);
|
|
768
|
-
},
|
|
769
|
-
uploading: function (e) {
|
|
770
|
-
if (!_this.parent.isServerRendered) {
|
|
771
|
-
_this.parent.trigger(events.fileUploading, e);
|
|
772
|
-
}
|
|
773
|
-
},
|
|
774
|
-
success: function (e) {
|
|
775
|
-
_this.parent.trigger(events.fileUploadSuccess, e, function (e) {
|
|
776
|
-
if (!ej2_base_1.isNullOrUndefined(_this.parent.insertAudioSettings.path)) {
|
|
777
|
-
var url = _this.parent.insertAudioSettings.path + e.file.name;
|
|
778
|
-
var value = { url: url, selection: save };
|
|
779
|
-
proxy.uploadUrl = {
|
|
780
|
-
url: url, selection: save, fileName: fileName, selectParent: selectParent
|
|
781
|
-
};
|
|
782
|
-
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
783
|
-
}
|
|
784
|
-
if (e.operation === 'upload' && !ej2_base_1.isNullOrUndefined(_this.dialogObj)) {
|
|
785
|
-
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
786
|
-
}
|
|
787
|
-
});
|
|
788
|
-
},
|
|
789
|
-
failure: function (e) {
|
|
790
|
-
_this.parent.trigger(events.fileUploadFailed, e);
|
|
791
|
-
},
|
|
792
|
-
removing: function () {
|
|
793
|
-
_this.parent.trigger(events.fileRemoving, e, function (e) {
|
|
794
|
-
proxy.isAudioUploaded = false;
|
|
795
|
-
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
796
|
-
proxy.inputUrl.removeAttribute('disabled');
|
|
797
|
-
if (proxy.uploadUrl) {
|
|
798
|
-
proxy.uploadUrl.url = '';
|
|
799
|
-
}
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
});
|
|
803
|
-
this.uploadObj.isStringTemplate = true;
|
|
804
|
-
this.uploadObj.createElement = this.parent.createElement;
|
|
805
|
-
this.uploadObj.appendTo(uploadEle);
|
|
806
|
-
return uploadParentEle;
|
|
807
|
-
};
|
|
808
|
-
Audio.prototype.checkExtension = function (e) {
|
|
809
|
-
if (this.uploadObj.allowedExtensions) {
|
|
810
|
-
if (this.uploadObj.allowedExtensions.toLocaleLowerCase().indexOf(('.' + e.type).toLocaleLowerCase()) === -1) {
|
|
811
|
-
this.dialogObj.getButtons(0).element.setAttribute('disabled', 'disabled');
|
|
812
|
-
this.isAllowedTypes = false;
|
|
813
|
-
}
|
|
814
|
-
else {
|
|
815
|
-
this.isAllowedTypes = true;
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
};
|
|
819
|
-
Audio.prototype.fileSelect = function () {
|
|
820
|
-
this.dialogObj.element.getElementsByClassName('e-file-select-wrap')[0].querySelector('button').click();
|
|
821
|
-
return false;
|
|
822
|
-
};
|
|
823
|
-
Audio.prototype.cancelDialog = function (e) {
|
|
824
|
-
this.parent.isBlur = false;
|
|
825
|
-
this.dialogObj.hide({ returnValue: true });
|
|
826
|
-
if (this.isAudioUploaded) {
|
|
827
|
-
this.uploadObj.removing();
|
|
828
|
-
}
|
|
829
|
-
};
|
|
830
|
-
Audio.prototype.insertAudioUrl = function (e) {
|
|
831
|
-
var proxy = this.selfAudio;
|
|
832
|
-
proxy.isAudioUploaded = false;
|
|
833
|
-
var url = proxy.inputUrl.value;
|
|
834
|
-
if (proxy.parent.formatter.getUndoRedoStack().length === 0) {
|
|
835
|
-
proxy.parent.formatter.saveData();
|
|
836
|
-
}
|
|
837
|
-
if (!ej2_base_1.isNullOrUndefined(proxy.uploadUrl) && proxy.uploadUrl.url !== '') {
|
|
838
|
-
proxy.uploadUrl.cssClass = (proxy.parent.insertAudioSettings.layoutOption === 'Inline' ?
|
|
839
|
-
classes.CLS_AUDIOINLINE : classes.CLS_AUDIOBREAK);
|
|
840
|
-
proxy.dialogObj.hide({ returnValue: false });
|
|
841
|
-
if (proxy.dialogObj !== null) {
|
|
842
|
-
return;
|
|
843
|
-
}
|
|
844
|
-
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, proxy.uploadUrl);
|
|
845
|
-
proxy.uploadUrl.url = '';
|
|
846
|
-
}
|
|
847
|
-
else if (url !== '') {
|
|
848
|
-
if (proxy.parent.editorMode === 'HTML' && ej2_base_1.isNullOrUndefined(ej2_base_2.closest(this.selection.range.startContainer.parentNode, '[id=' + "'" + proxy.contentModule.getPanel().id + "'" + ']')) && !(proxy.parent.iframeSettings.enable)) {
|
|
849
|
-
proxy.contentModule.getEditPanel().focus();
|
|
850
|
-
var range = proxy.parent.formatter.editorManager.nodeSelection.getRange(proxy.contentModule.getDocument());
|
|
851
|
-
this.selection = proxy.parent.formatter.editorManager.nodeSelection.save(range, proxy.contentModule.getDocument());
|
|
852
|
-
this.selectParent = proxy.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
853
|
-
}
|
|
854
|
-
var name_1 = proxy.parent.editorMode === 'HTML' ? url.split('/')[url.split('/').length - 1] : '';
|
|
855
|
-
var value = {
|
|
856
|
-
cssClass: (proxy.parent.insertAudioSettings.layoutOption === 'Inline' ? classes.CLS_AUDIOINLINE : classes.CLS_AUDIOBREAK),
|
|
857
|
-
url: url, selection: this.selection, fileName: name_1,
|
|
858
|
-
selectParent: this.selectParent
|
|
859
|
-
};
|
|
860
|
-
proxy.dialogObj.hide({ returnValue: false });
|
|
861
|
-
if (proxy.dialogObj !== null) {
|
|
862
|
-
return;
|
|
863
|
-
}
|
|
864
|
-
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, value);
|
|
865
|
-
}
|
|
866
|
-
};
|
|
867
|
-
Audio.prototype.destroy = function () {
|
|
868
|
-
if (this.isDestroyed) {
|
|
869
|
-
return;
|
|
870
|
-
}
|
|
871
|
-
this.prevSelectedAudEle = undefined;
|
|
872
|
-
if (this.showPopupTime) {
|
|
873
|
-
clearTimeout(this.showPopupTime);
|
|
874
|
-
this.showPopupTime = null;
|
|
875
|
-
}
|
|
876
|
-
this.removeEventListener();
|
|
877
|
-
this.clearDialogObj();
|
|
878
|
-
this.isDestroyed = true;
|
|
879
|
-
};
|
|
880
|
-
Audio.prototype.getModuleName = function () {
|
|
881
|
-
return 'audio';
|
|
882
|
-
};
|
|
883
|
-
return Audio;
|
|
884
|
-
}());
|
|
885
|
-
exports.Audio = Audio;
|
|
886
|
-
});
|