@syncfusion/ej2-richtexteditor 29.2.4-738301 → 29.2.4-760237
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 +262 -260
- package/aceconfig.js +17 -0
- package/blazorGlobalSrc/common/config.d.ts +63 -0
- package/blazorGlobalSrc/common/config.js +123 -0
- package/blazorGlobalSrc/common/constant.d.ts +117 -0
- package/blazorGlobalSrc/common/constant.js +23 -0
- package/blazorGlobalSrc/common/editor-styles.d.ts +1 -0
- package/blazorGlobalSrc/common/editor-styles.js +5 -0
- package/blazorGlobalSrc/common/index.d.ts +7 -0
- package/blazorGlobalSrc/common/index.js +9 -0
- package/blazorGlobalSrc/common/interface.d.ts +119 -0
- package/blazorGlobalSrc/common/interface.js +4 -0
- package/blazorGlobalSrc/common/types.d.ts +25 -0
- package/blazorGlobalSrc/common/types.js +4 -0
- package/blazorGlobalSrc/common/user-agent.d.ts +41 -0
- package/blazorGlobalSrc/common/user-agent.js +71 -0
- package/blazorGlobalSrc/common/util.d.ts +70 -0
- package/blazorGlobalSrc/common/util.js +222 -0
- package/blazorGlobalSrc/components.d.ts +8 -0
- package/blazorGlobalSrc/components.js +12 -0
- package/blazorGlobalSrc/editor-manager/base/classes.d.ts +31 -0
- package/blazorGlobalSrc/editor-manager/base/classes.js +28 -0
- package/blazorGlobalSrc/editor-manager/base/constant.d.ts +97 -0
- package/blazorGlobalSrc/editor-manager/base/constant.js +41 -0
- package/blazorGlobalSrc/editor-manager/base/editor-manager.d.ts +95 -0
- package/blazorGlobalSrc/editor-manager/base/editor-manager.js +339 -0
- package/blazorGlobalSrc/editor-manager/base/enum.d.ts +17 -0
- package/blazorGlobalSrc/editor-manager/base/enum.js +4 -0
- package/blazorGlobalSrc/editor-manager/base/interface.d.ts +263 -0
- package/blazorGlobalSrc/editor-manager/base/interface.js +4 -0
- package/blazorGlobalSrc/editor-manager/base/types.d.ts +7 -0
- package/blazorGlobalSrc/editor-manager/base/types.js +4 -0
- package/blazorGlobalSrc/editor-manager/base.d.ts +8 -0
- package/blazorGlobalSrc/editor-manager/base.js +10 -0
- package/blazorGlobalSrc/editor-manager/index.d.ts +5 -0
- package/blazorGlobalSrc/editor-manager/index.js +9 -0
- package/blazorGlobalSrc/editor-manager/plugin/alignments.d.ts +26 -0
- package/blazorGlobalSrc/editor-manager/plugin/alignments.js +105 -0
- package/blazorGlobalSrc/editor-manager/plugin/audio.d.ts +34 -0
- package/blazorGlobalSrc/editor-manager/plugin/audio.js +145 -0
- package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.d.ts +24 -0
- package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.js +47 -0
- package/blazorGlobalSrc/editor-manager/plugin/clearformat.d.ts +29 -0
- package/blazorGlobalSrc/editor-manager/plugin/clearformat.js +249 -0
- package/blazorGlobalSrc/editor-manager/plugin/dom-node.d.ts +351 -0
- package/blazorGlobalSrc/editor-manager/plugin/dom-node.js +737 -0
- package/blazorGlobalSrc/editor-manager/plugin/dom-tree.d.ts +84 -0
- package/blazorGlobalSrc/editor-manager/plugin/dom-tree.js +164 -0
- package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.d.ts +10 -0
- package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.js +86 -0
- package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.d.ts +47 -0
- package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.js +622 -0
- package/blazorGlobalSrc/editor-manager/plugin/formats.d.ts +43 -0
- package/blazorGlobalSrc/editor-manager/plugin/formats.js +597 -0
- package/blazorGlobalSrc/editor-manager/plugin/image.d.ts +48 -0
- package/blazorGlobalSrc/editor-manager/plugin/image.js +399 -0
- package/blazorGlobalSrc/editor-manager/plugin/indents.d.ts +24 -0
- package/blazorGlobalSrc/editor-manager/plugin/indents.js +106 -0
- package/blazorGlobalSrc/editor-manager/plugin/insert-methods.d.ts +48 -0
- package/blazorGlobalSrc/editor-manager/plugin/insert-methods.js +37 -0
- package/blazorGlobalSrc/editor-manager/plugin/insert-text.d.ts +22 -0
- package/blazorGlobalSrc/editor-manager/plugin/insert-text.js +36 -0
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.d.ts +22 -0
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.js +49 -0
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml.d.ts +51 -0
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml.js +985 -0
- package/blazorGlobalSrc/editor-manager/plugin/isformatted.d.ts +89 -0
- package/blazorGlobalSrc/editor-manager/plugin/isformatted.js +199 -0
- package/blazorGlobalSrc/editor-manager/plugin/link.d.ts +41 -0
- package/blazorGlobalSrc/editor-manager/plugin/link.js +550 -0
- package/blazorGlobalSrc/editor-manager/plugin/lists.d.ts +74 -0
- package/blazorGlobalSrc/editor-manager/plugin/lists.js +1503 -0
- package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.d.ts +61 -0
- package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.js +1136 -0
- package/blazorGlobalSrc/editor-manager/plugin/nodecutter.d.ts +64 -0
- package/blazorGlobalSrc/editor-manager/plugin/nodecutter.js +167 -0
- package/blazorGlobalSrc/editor-manager/plugin/selection-commands.d.ts +41 -0
- package/blazorGlobalSrc/editor-manager/plugin/selection-commands.js +1069 -0
- package/blazorGlobalSrc/editor-manager/plugin/selection-exec.d.ts +24 -0
- package/blazorGlobalSrc/editor-manager/plugin/selection-exec.js +49 -0
- package/blazorGlobalSrc/editor-manager/plugin/table-selection.d.ts +26 -0
- package/blazorGlobalSrc/editor-manager/plugin/table-selection.js +210 -0
- package/blazorGlobalSrc/editor-manager/plugin/table.d.ts +56 -0
- package/blazorGlobalSrc/editor-manager/plugin/table.js +1100 -0
- package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.d.ts +39 -0
- package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.js +384 -0
- package/blazorGlobalSrc/editor-manager/plugin/undo.d.ts +85 -0
- package/blazorGlobalSrc/editor-manager/plugin/undo.js +216 -0
- package/blazorGlobalSrc/editor-manager/plugin/video.d.ts +38 -0
- package/blazorGlobalSrc/editor-manager/plugin/video.js +311 -0
- package/blazorGlobalSrc/editor-manager/plugin.d.ts +27 -0
- package/blazorGlobalSrc/editor-manager/plugin.js +31 -0
- package/blazorGlobalSrc/global.d.ts +1 -0
- package/blazorGlobalSrc/global.js +3 -0
- package/blazorGlobalSrc/index.d.ts +8 -0
- package/blazorGlobalSrc/index.js +12 -0
- package/blazorGlobalSrc/markdown-parser/base/constant.d.ts +39 -0
- package/blazorGlobalSrc/markdown-parser/base/constant.js +10 -0
- package/blazorGlobalSrc/markdown-parser/base/interface.d.ts +169 -0
- package/blazorGlobalSrc/markdown-parser/base/interface.js +4 -0
- package/blazorGlobalSrc/markdown-parser/base/markdown-parser.d.ts +69 -0
- package/blazorGlobalSrc/markdown-parser/base/markdown-parser.js +87 -0
- package/blazorGlobalSrc/markdown-parser/base/types.d.ts +7 -0
- package/blazorGlobalSrc/markdown-parser/base/types.js +4 -0
- package/blazorGlobalSrc/markdown-parser/base.d.ts +7 -0
- package/blazorGlobalSrc/markdown-parser/base.js +9 -0
- package/blazorGlobalSrc/markdown-parser/index.d.ts +5 -0
- package/blazorGlobalSrc/markdown-parser/index.js +9 -0
- package/blazorGlobalSrc/markdown-parser/plugin/clearformat.d.ts +28 -0
- package/blazorGlobalSrc/markdown-parser/plugin/clearformat.js +110 -0
- package/blazorGlobalSrc/markdown-parser/plugin/formats.d.ts +32 -0
- package/blazorGlobalSrc/markdown-parser/plugin/formats.js +225 -0
- package/blazorGlobalSrc/markdown-parser/plugin/insert-text.d.ts +24 -0
- package/blazorGlobalSrc/markdown-parser/plugin/insert-text.js +49 -0
- package/blazorGlobalSrc/markdown-parser/plugin/link.d.ts +24 -0
- package/blazorGlobalSrc/markdown-parser/plugin/link.js +50 -0
- package/blazorGlobalSrc/markdown-parser/plugin/lists.d.ts +39 -0
- package/blazorGlobalSrc/markdown-parser/plugin/lists.js +462 -0
- package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.d.ts +140 -0
- package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.js +104 -0
- package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.d.ts +31 -0
- package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.js +335 -0
- package/blazorGlobalSrc/markdown-parser/plugin/table.d.ts +52 -0
- package/blazorGlobalSrc/markdown-parser/plugin/table.js +216 -0
- package/blazorGlobalSrc/markdown-parser/plugin/undo.d.ts +83 -0
- package/blazorGlobalSrc/markdown-parser/plugin/undo.js +147 -0
- package/blazorGlobalSrc/markdown-parser/plugin.d.ts +11 -0
- package/blazorGlobalSrc/markdown-parser/plugin.js +15 -0
- package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.d.ts +114 -0
- package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.js +465 -0
- package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.d.ts +58 -0
- package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.js +216 -0
- package/blazorGlobalSrc/rich-text-editor/actions/color-picker.d.ts +52 -0
- package/blazorGlobalSrc/rich-text-editor/actions/color-picker.js +241 -0
- package/blazorGlobalSrc/rich-text-editor/actions/count.d.ts +55 -0
- package/blazorGlobalSrc/rich-text-editor/actions/count.js +117 -0
- package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.d.ts +72 -0
- package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.js +552 -0
- package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.d.ts +51 -0
- package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.js +853 -0
- package/blazorGlobalSrc/rich-text-editor/actions/enter-key.d.ts +28 -0
- package/blazorGlobalSrc/rich-text-editor/actions/enter-key.js +821 -0
- package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.d.ts +11 -0
- package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.js +28 -0
- package/blazorGlobalSrc/rich-text-editor/actions/file-manager.d.ts +45 -0
- package/blazorGlobalSrc/rich-text-editor/actions/file-manager.js +249 -0
- package/blazorGlobalSrc/rich-text-editor/actions/format-painter.d.ts +25 -0
- package/blazorGlobalSrc/rich-text-editor/actions/format-painter.js +156 -0
- package/blazorGlobalSrc/rich-text-editor/actions/full-screen.d.ts +40 -0
- package/blazorGlobalSrc/rich-text-editor/actions/full-screen.js +148 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.d.ts +15 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.js +50 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-editor.d.ts +120 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-editor.js +1244 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.d.ts +14 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.js +47 -0
- package/blazorGlobalSrc/rich-text-editor/actions/import-export.d.ts +21 -0
- package/blazorGlobalSrc/rich-text-editor/actions/import-export.js +117 -0
- package/blazorGlobalSrc/rich-text-editor/actions/keyboard-model.d.ts +30 -0
- package/blazorGlobalSrc/rich-text-editor/actions/keyboard.d.ts +110 -0
- package/blazorGlobalSrc/rich-text-editor/actions/keyboard.js +163 -0
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.d.ts +66 -0
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.js +142 -0
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.d.ts +23 -0
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.js +124 -0
- package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.d.ts +86 -0
- package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.js +1071 -0
- package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.d.ts +151 -0
- package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.js +548 -0
- package/blazorGlobalSrc/rich-text-editor/actions/resize.d.ts +37 -0
- package/blazorGlobalSrc/rich-text-editor/actions/resize.js +188 -0
- package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.d.ts +11 -0
- package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.js +168 -0
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.d.ts +18 -0
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.js +76 -0
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar.d.ts +185 -0
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar.js +512 -0
- package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.d.ts +25 -0
- package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.js +166 -0
- package/blazorGlobalSrc/rich-text-editor/actions.d.ts +26 -0
- package/blazorGlobalSrc/rich-text-editor/actions.js +30 -0
- package/blazorGlobalSrc/rich-text-editor/audio.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/audio.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/base/classes.d.ts +628 -0
- package/blazorGlobalSrc/rich-text-editor/base/classes.js +129 -0
- package/blazorGlobalSrc/rich-text-editor/base/constant.d.ts +808 -0
- package/blazorGlobalSrc/rich-text-editor/base/constant.js +334 -0
- package/blazorGlobalSrc/rich-text-editor/base/enum.d.ts +81 -0
- package/blazorGlobalSrc/rich-text-editor/base/enum.js +37 -0
- package/blazorGlobalSrc/rich-text-editor/base/interface.d.ts +1577 -0
- package/blazorGlobalSrc/rich-text-editor/base/interface.js +194 -0
- package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor-model.d.ts +1032 -0
- package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.d.ts +1699 -0
- package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.js +2645 -0
- package/blazorGlobalSrc/rich-text-editor/base/util.d.ts +212 -0
- package/blazorGlobalSrc/rich-text-editor/base/util.js +610 -0
- package/blazorGlobalSrc/rich-text-editor/base.d.ts +10 -0
- package/blazorGlobalSrc/rich-text-editor/base.js +13 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/formatter.d.ts +87 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/formatter.js +223 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.d.ts +34 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.js +44 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.d.ts +39 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.js +48 -0
- package/blazorGlobalSrc/rich-text-editor/formatter.d.ts +6 -0
- package/blazorGlobalSrc/rich-text-editor/formatter.js +10 -0
- package/blazorGlobalSrc/rich-text-editor/html-editor.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/html-editor.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/image.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/image.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/index.d.ts +9 -0
- package/blazorGlobalSrc/rich-text-editor/index.js +12 -0
- package/blazorGlobalSrc/rich-text-editor/link.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/link.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/markdown-editor.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/markdown-editor.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/models/default-locale.d.ts +25 -0
- package/blazorGlobalSrc/rich-text-editor/models/default-locale.js +391 -0
- package/blazorGlobalSrc/rich-text-editor/models/iframe-settings-model.d.ts +68 -0
- package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.d.ts +61 -0
- package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.js +60 -0
- package/blazorGlobalSrc/rich-text-editor/models/inline-mode-model.d.ts +24 -0
- package/blazorGlobalSrc/rich-text-editor/models/inline-mode.d.ts +20 -0
- package/blazorGlobalSrc/rich-text-editor/models/inline-mode.js +37 -0
- package/blazorGlobalSrc/rich-text-editor/models/items.d.ts +36 -0
- package/blazorGlobalSrc/rich-text-editor/models/items.js +1011 -0
- package/blazorGlobalSrc/rich-text-editor/models/models.d.ts +7 -0
- package/blazorGlobalSrc/rich-text-editor/models/models.js +4 -0
- package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings-model.d.ts +40 -0
- package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.d.ts +50 -0
- package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.js +143 -0
- package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings-model.d.ts +1130 -0
- package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.d.ts +992 -0
- package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.js +510 -0
- package/blazorGlobalSrc/rich-text-editor/models.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/models.js +4 -0
- package/blazorGlobalSrc/rich-text-editor/quick-toolbar.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/quick-toolbar.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.d.ts +82 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.js +886 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.d.ts +65 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.js +49 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.d.ts +39 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.js +111 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.d.ts +33 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.js +101 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/image-module.d.ts +199 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/image-module.js +2494 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/link-module.d.ts +63 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/link-module.js +596 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.d.ts +65 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.js +38 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.d.ts +54 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.js +35 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/render.d.ts +46 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/render.js +70 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.d.ts +20 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.js +224 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/table-module.d.ts +155 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/table-module.js +2206 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.d.ts +131 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.js +747 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/video-module.d.ts +120 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/video-module.js +1507 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/view-source.d.ts +74 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/view-source.js +225 -0
- package/blazorGlobalSrc/rich-text-editor/renderer.d.ts +17 -0
- package/blazorGlobalSrc/rich-text-editor/renderer.js +21 -0
- package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.d.ts +33 -0
- package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.js +29 -0
- package/blazorGlobalSrc/rich-text-editor/services/service-locator.d.ts +29 -0
- package/blazorGlobalSrc/rich-text-editor/services/service-locator.js +25 -0
- package/blazorGlobalSrc/rich-text-editor/services.d.ts +5 -0
- package/blazorGlobalSrc/rich-text-editor/services.js +9 -0
- package/blazorGlobalSrc/rich-text-editor/toolbar.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/toolbar.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/video.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/video.js +8 -0
- package/blazorGlobalSrc/rich-text-editor.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor.js +8 -0
- package/blazorGlobalSrc/selection/index.d.ts +4 -0
- package/blazorGlobalSrc/selection/index.js +8 -0
- package/blazorGlobalSrc/selection/selection.d.ts +244 -0
- package/blazorGlobalSrc/selection/selection.js +309 -0
- 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 +6 -4
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +6 -4
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/helpers/e2e/index.d.ts +1 -0
- package/helpers/e2e/index.js +8 -0
- package/helpers/e2e/rte-helper.d.ts +79 -0
- package/helpers/e2e/rte-helper.js +81 -0
- package/package.json +1 -1
- package/src/editor-manager/plugin/dom-tree.js +6 -4
- package/src/global.d.ts +1 -0
- package/styles/bds-lite.css +7 -17
- package/styles/bds.css +11 -22
- package/styles/bootstrap-dark-lite.css +3 -13
- package/styles/bootstrap-dark.css +3 -14
- package/styles/bootstrap-lite.css +3 -13
- package/styles/bootstrap.css +3 -14
- package/styles/bootstrap4-lite.css +3 -13
- package/styles/bootstrap4.css +3 -14
- package/styles/bootstrap5-dark-lite.css +3 -13
- package/styles/bootstrap5-dark.css +3 -14
- package/styles/bootstrap5-lite.css +3 -13
- package/styles/bootstrap5.3-lite.css +3 -13
- package/styles/bootstrap5.3.css +3 -14
- package/styles/bootstrap5.css +3 -14
- package/styles/fabric-dark-lite.css +3 -13
- package/styles/fabric-dark.css +3 -14
- package/styles/fabric-lite.css +3 -13
- package/styles/fabric.css +3 -14
- package/styles/fluent-dark-lite.css +3 -13
- package/styles/fluent-dark.css +3 -14
- package/styles/fluent-lite.css +3 -13
- package/styles/fluent.css +3 -14
- package/styles/fluent2-lite.css +3 -13
- package/styles/fluent2.css +3 -14
- package/styles/highcontrast-light-lite.css +3 -13
- package/styles/highcontrast-light.css +3 -14
- package/styles/highcontrast-lite.css +3 -13
- package/styles/highcontrast.css +3 -14
- package/styles/material-dark-lite.css +3 -13
- package/styles/material-dark.css +3 -14
- package/styles/material-lite.css +3 -13
- package/styles/material.css +3 -14
- package/styles/material3-dark-lite.css +3 -13
- package/styles/material3-dark.css +3 -14
- package/styles/material3-lite.css +3 -13
- package/styles/material3.css +3 -14
- package/styles/rich-text-editor/_bds-definition.scss +2 -2
- package/styles/rich-text-editor/_bigger.scss +0 -1
- package/styles/rich-text-editor/_layout.scss +0 -9
- package/styles/rich-text-editor/_theme.scss +3 -0
- package/styles/rich-text-editor/bds.css +11 -22
- package/styles/rich-text-editor/bootstrap-dark.css +3 -14
- package/styles/rich-text-editor/bootstrap.css +3 -14
- package/styles/rich-text-editor/bootstrap4.css +3 -14
- package/styles/rich-text-editor/bootstrap5-dark.css +3 -14
- package/styles/rich-text-editor/bootstrap5.3.css +3 -14
- package/styles/rich-text-editor/bootstrap5.css +3 -14
- package/styles/rich-text-editor/fabric-dark.css +3 -14
- package/styles/rich-text-editor/fabric.css +3 -14
- package/styles/rich-text-editor/fluent-dark.css +3 -14
- package/styles/rich-text-editor/fluent.css +3 -14
- package/styles/rich-text-editor/fluent2.css +3 -14
- package/styles/rich-text-editor/highcontrast-light.css +3 -14
- package/styles/rich-text-editor/highcontrast.css +3 -14
- package/styles/rich-text-editor/material-dark.css +3 -14
- package/styles/rich-text-editor/material.css +3 -14
- package/styles/rich-text-editor/material3-dark.css +3 -14
- package/styles/rich-text-editor/material3.css +3 -14
- package/styles/rich-text-editor/tailwind-dark.css +3 -14
- package/styles/rich-text-editor/tailwind.css +3 -14
- package/styles/rich-text-editor/tailwind3.css +3 -14
- package/styles/tailwind-dark-lite.css +3 -13
- package/styles/tailwind-dark.css +3 -14
- package/styles/tailwind-lite.css +3 -13
- package/styles/tailwind.css +3 -14
- package/styles/tailwind3-lite.css +3 -13
- package/styles/tailwind3.css +3 -14
- package/tslint.json +111 -0
|
@@ -0,0 +1,886 @@
|
|
|
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
|
+
});
|