@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.
Files changed (401) hide show
  1. package/.eslintrc.json +260 -262
  2. package/dist/ej2-richtexteditor.umd.min.js +1 -1
  3. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-richtexteditor.es2015.js +22 -2
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +23 -2
  7. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/common/util.js +21 -1
  10. package/src/editor-manager/plugin/inserthtml.js +2 -1
  11. package/styles/bds-lite.css +278 -29
  12. package/styles/bds.css +289 -30
  13. package/styles/bootstrap-dark-lite.css +276 -27
  14. package/styles/bootstrap-dark.css +288 -29
  15. package/styles/bootstrap-lite.css +278 -29
  16. package/styles/bootstrap.css +290 -31
  17. package/styles/bootstrap4-lite.css +276 -27
  18. package/styles/bootstrap4.css +287 -28
  19. package/styles/bootstrap5-dark-lite.css +278 -29
  20. package/styles/bootstrap5-dark.css +289 -30
  21. package/styles/bootstrap5-lite.css +278 -29
  22. package/styles/bootstrap5.3-lite.css +276 -27
  23. package/styles/bootstrap5.3.css +288 -29
  24. package/styles/bootstrap5.css +289 -30
  25. package/styles/fabric-dark-lite.css +276 -27
  26. package/styles/fabric-dark.css +287 -28
  27. package/styles/fabric-lite.css +276 -27
  28. package/styles/fabric.css +287 -28
  29. package/styles/fluent-dark-lite.css +278 -29
  30. package/styles/fluent-dark.css +289 -31
  31. package/styles/fluent-lite.css +278 -29
  32. package/styles/fluent.css +289 -31
  33. package/styles/fluent2-lite.css +280 -31
  34. package/styles/fluent2.css +292 -33
  35. package/styles/highcontrast-light-lite.css +276 -27
  36. package/styles/highcontrast-light.css +287 -28
  37. package/styles/highcontrast-lite.css +276 -27
  38. package/styles/highcontrast.css +287 -28
  39. package/styles/material-dark-lite.css +276 -27
  40. package/styles/material-dark.css +287 -28
  41. package/styles/material-lite.css +276 -27
  42. package/styles/material.css +287 -28
  43. package/styles/material3-dark-lite.css +278 -27
  44. package/styles/material3-dark.css +289 -28
  45. package/styles/material3-lite.css +278 -27
  46. package/styles/material3.css +289 -28
  47. package/styles/rich-text-editor/_bds-definition.scss +9 -1
  48. package/styles/rich-text-editor/_bigger.scss +16 -3
  49. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +9 -1
  50. package/styles/rich-text-editor/_bootstrap-definition.scss +10 -2
  51. package/styles/rich-text-editor/_bootstrap4-definition.scss +9 -1
  52. package/styles/rich-text-editor/_bootstrap5-definition.scss +10 -2
  53. package/styles/rich-text-editor/_bootstrap5.3-definition.scss +9 -1
  54. package/styles/rich-text-editor/_fabric-dark-definition.scss +9 -1
  55. package/styles/rich-text-editor/_fabric-definition.scss +9 -1
  56. package/styles/rich-text-editor/_fluent-definition.scss +9 -2
  57. package/styles/rich-text-editor/_fluent2-definition.scss +10 -2
  58. package/styles/rich-text-editor/_fusionnew-definition.scss +8 -1
  59. package/styles/rich-text-editor/_highcontrast-definition.scss +9 -1
  60. package/styles/rich-text-editor/_highcontrast-light-definition.scss +9 -1
  61. package/styles/rich-text-editor/_layout.scss +208 -25
  62. package/styles/rich-text-editor/_material-dark-definition.scss +9 -1
  63. package/styles/rich-text-editor/_material-definition.scss +9 -1
  64. package/styles/rich-text-editor/_material3-definition.scss +9 -1
  65. package/styles/rich-text-editor/_tailwind-definition.scss +9 -1
  66. package/styles/rich-text-editor/_tailwind3-definition.scss +11 -3
  67. package/styles/rich-text-editor/_theme.scss +3 -0
  68. package/styles/rich-text-editor/bds.css +289 -30
  69. package/styles/rich-text-editor/bootstrap-dark.css +288 -29
  70. package/styles/rich-text-editor/bootstrap.css +290 -31
  71. package/styles/rich-text-editor/bootstrap4.css +287 -28
  72. package/styles/rich-text-editor/bootstrap5-dark.css +289 -30
  73. package/styles/rich-text-editor/bootstrap5.3.css +288 -29
  74. package/styles/rich-text-editor/bootstrap5.css +289 -30
  75. package/styles/rich-text-editor/fabric-dark.css +287 -28
  76. package/styles/rich-text-editor/fabric.css +287 -28
  77. package/styles/rich-text-editor/fluent-dark.css +289 -31
  78. package/styles/rich-text-editor/fluent.css +289 -31
  79. package/styles/rich-text-editor/fluent2.css +292 -33
  80. package/styles/rich-text-editor/highcontrast-light.css +287 -28
  81. package/styles/rich-text-editor/highcontrast.css +287 -28
  82. package/styles/rich-text-editor/icons/_bds.scss +4 -1
  83. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +4 -1
  84. package/styles/rich-text-editor/icons/_bootstrap.scss +4 -2
  85. package/styles/rich-text-editor/icons/_bootstrap4.scss +4 -2
  86. package/styles/rich-text-editor/icons/_bootstrap5.3.scss +4 -2
  87. package/styles/rich-text-editor/icons/_bootstrap5.scss +4 -2
  88. package/styles/rich-text-editor/icons/_fabric-dark.scss +4 -2
  89. package/styles/rich-text-editor/icons/_fabric.scss +4 -2
  90. package/styles/rich-text-editor/icons/_fluent.scss +5 -1
  91. package/styles/rich-text-editor/icons/_fluent2.scss +4 -2
  92. package/styles/rich-text-editor/icons/_fusionnew.scss +4 -2
  93. package/styles/rich-text-editor/icons/_highcontrast-light.scss +5 -1
  94. package/styles/rich-text-editor/icons/_highcontrast.scss +5 -1
  95. package/styles/rich-text-editor/icons/_material-dark.scss +5 -1
  96. package/styles/rich-text-editor/icons/_material.scss +5 -1
  97. package/styles/rich-text-editor/icons/_material3.scss +5 -1
  98. package/styles/rich-text-editor/icons/_tailwind.scss +5 -1
  99. package/styles/rich-text-editor/icons/_tailwind3.scss +5 -1
  100. package/styles/rich-text-editor/material-dark.css +287 -28
  101. package/styles/rich-text-editor/material.css +287 -28
  102. package/styles/rich-text-editor/material3-dark.css +289 -28
  103. package/styles/rich-text-editor/material3.css +289 -28
  104. package/styles/rich-text-editor/tailwind-dark.css +289 -30
  105. package/styles/rich-text-editor/tailwind.css +289 -30
  106. package/styles/rich-text-editor/tailwind3.css +291 -32
  107. package/styles/tailwind-dark-lite.css +278 -29
  108. package/styles/tailwind-dark.css +289 -30
  109. package/styles/tailwind-lite.css +278 -29
  110. package/styles/tailwind.css +289 -30
  111. package/styles/tailwind3-lite.css +280 -31
  112. package/styles/tailwind3.css +291 -32
  113. package/aceconfig.js +0 -17
  114. package/blazorGlobalSrc/common/config.d.ts +0 -63
  115. package/blazorGlobalSrc/common/config.js +0 -123
  116. package/blazorGlobalSrc/common/constant.d.ts +0 -117
  117. package/blazorGlobalSrc/common/constant.js +0 -23
  118. package/blazorGlobalSrc/common/editor-styles.d.ts +0 -1
  119. package/blazorGlobalSrc/common/editor-styles.js +0 -5
  120. package/blazorGlobalSrc/common/index.d.ts +0 -7
  121. package/blazorGlobalSrc/common/index.js +0 -9
  122. package/blazorGlobalSrc/common/interface.d.ts +0 -119
  123. package/blazorGlobalSrc/common/interface.js +0 -4
  124. package/blazorGlobalSrc/common/types.d.ts +0 -25
  125. package/blazorGlobalSrc/common/types.js +0 -4
  126. package/blazorGlobalSrc/common/user-agent.d.ts +0 -41
  127. package/blazorGlobalSrc/common/user-agent.js +0 -71
  128. package/blazorGlobalSrc/common/util.d.ts +0 -70
  129. package/blazorGlobalSrc/common/util.js +0 -222
  130. package/blazorGlobalSrc/components.d.ts +0 -8
  131. package/blazorGlobalSrc/components.js +0 -12
  132. package/blazorGlobalSrc/editor-manager/base/classes.d.ts +0 -31
  133. package/blazorGlobalSrc/editor-manager/base/classes.js +0 -28
  134. package/blazorGlobalSrc/editor-manager/base/constant.d.ts +0 -97
  135. package/blazorGlobalSrc/editor-manager/base/constant.js +0 -41
  136. package/blazorGlobalSrc/editor-manager/base/editor-manager.d.ts +0 -95
  137. package/blazorGlobalSrc/editor-manager/base/editor-manager.js +0 -339
  138. package/blazorGlobalSrc/editor-manager/base/enum.d.ts +0 -17
  139. package/blazorGlobalSrc/editor-manager/base/enum.js +0 -4
  140. package/blazorGlobalSrc/editor-manager/base/interface.d.ts +0 -263
  141. package/blazorGlobalSrc/editor-manager/base/interface.js +0 -4
  142. package/blazorGlobalSrc/editor-manager/base/types.d.ts +0 -7
  143. package/blazorGlobalSrc/editor-manager/base/types.js +0 -4
  144. package/blazorGlobalSrc/editor-manager/base.d.ts +0 -8
  145. package/blazorGlobalSrc/editor-manager/base.js +0 -10
  146. package/blazorGlobalSrc/editor-manager/index.d.ts +0 -5
  147. package/blazorGlobalSrc/editor-manager/index.js +0 -9
  148. package/blazorGlobalSrc/editor-manager/plugin/alignments.d.ts +0 -26
  149. package/blazorGlobalSrc/editor-manager/plugin/alignments.js +0 -105
  150. package/blazorGlobalSrc/editor-manager/plugin/audio.d.ts +0 -34
  151. package/blazorGlobalSrc/editor-manager/plugin/audio.js +0 -145
  152. package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.d.ts +0 -24
  153. package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.js +0 -47
  154. package/blazorGlobalSrc/editor-manager/plugin/clearformat.d.ts +0 -29
  155. package/blazorGlobalSrc/editor-manager/plugin/clearformat.js +0 -249
  156. package/blazorGlobalSrc/editor-manager/plugin/dom-node.d.ts +0 -351
  157. package/blazorGlobalSrc/editor-manager/plugin/dom-node.js +0 -737
  158. package/blazorGlobalSrc/editor-manager/plugin/dom-tree.d.ts +0 -84
  159. package/blazorGlobalSrc/editor-manager/plugin/dom-tree.js +0 -164
  160. package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.d.ts +0 -10
  161. package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.js +0 -86
  162. package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.d.ts +0 -47
  163. package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.js +0 -622
  164. package/blazorGlobalSrc/editor-manager/plugin/formats.d.ts +0 -43
  165. package/blazorGlobalSrc/editor-manager/plugin/formats.js +0 -597
  166. package/blazorGlobalSrc/editor-manager/plugin/image.d.ts +0 -48
  167. package/blazorGlobalSrc/editor-manager/plugin/image.js +0 -399
  168. package/blazorGlobalSrc/editor-manager/plugin/indents.d.ts +0 -24
  169. package/blazorGlobalSrc/editor-manager/plugin/indents.js +0 -106
  170. package/blazorGlobalSrc/editor-manager/plugin/insert-methods.d.ts +0 -48
  171. package/blazorGlobalSrc/editor-manager/plugin/insert-methods.js +0 -37
  172. package/blazorGlobalSrc/editor-manager/plugin/insert-text.d.ts +0 -22
  173. package/blazorGlobalSrc/editor-manager/plugin/insert-text.js +0 -36
  174. package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.d.ts +0 -22
  175. package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.js +0 -49
  176. package/blazorGlobalSrc/editor-manager/plugin/inserthtml.d.ts +0 -51
  177. package/blazorGlobalSrc/editor-manager/plugin/inserthtml.js +0 -985
  178. package/blazorGlobalSrc/editor-manager/plugin/isformatted.d.ts +0 -89
  179. package/blazorGlobalSrc/editor-manager/plugin/isformatted.js +0 -199
  180. package/blazorGlobalSrc/editor-manager/plugin/link.d.ts +0 -41
  181. package/blazorGlobalSrc/editor-manager/plugin/link.js +0 -550
  182. package/blazorGlobalSrc/editor-manager/plugin/lists.d.ts +0 -74
  183. package/blazorGlobalSrc/editor-manager/plugin/lists.js +0 -1503
  184. package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.d.ts +0 -61
  185. package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.js +0 -1136
  186. package/blazorGlobalSrc/editor-manager/plugin/nodecutter.d.ts +0 -64
  187. package/blazorGlobalSrc/editor-manager/plugin/nodecutter.js +0 -167
  188. package/blazorGlobalSrc/editor-manager/plugin/selection-commands.d.ts +0 -41
  189. package/blazorGlobalSrc/editor-manager/plugin/selection-commands.js +0 -1069
  190. package/blazorGlobalSrc/editor-manager/plugin/selection-exec.d.ts +0 -24
  191. package/blazorGlobalSrc/editor-manager/plugin/selection-exec.js +0 -49
  192. package/blazorGlobalSrc/editor-manager/plugin/table-selection.d.ts +0 -26
  193. package/blazorGlobalSrc/editor-manager/plugin/table-selection.js +0 -210
  194. package/blazorGlobalSrc/editor-manager/plugin/table.d.ts +0 -56
  195. package/blazorGlobalSrc/editor-manager/plugin/table.js +0 -1100
  196. package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.d.ts +0 -39
  197. package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.js +0 -384
  198. package/blazorGlobalSrc/editor-manager/plugin/undo.d.ts +0 -85
  199. package/blazorGlobalSrc/editor-manager/plugin/undo.js +0 -216
  200. package/blazorGlobalSrc/editor-manager/plugin/video.d.ts +0 -38
  201. package/blazorGlobalSrc/editor-manager/plugin/video.js +0 -311
  202. package/blazorGlobalSrc/editor-manager/plugin.d.ts +0 -27
  203. package/blazorGlobalSrc/editor-manager/plugin.js +0 -31
  204. package/blazorGlobalSrc/global.d.ts +0 -1
  205. package/blazorGlobalSrc/global.js +0 -3
  206. package/blazorGlobalSrc/index.d.ts +0 -8
  207. package/blazorGlobalSrc/index.js +0 -12
  208. package/blazorGlobalSrc/markdown-parser/base/constant.d.ts +0 -39
  209. package/blazorGlobalSrc/markdown-parser/base/constant.js +0 -10
  210. package/blazorGlobalSrc/markdown-parser/base/interface.d.ts +0 -169
  211. package/blazorGlobalSrc/markdown-parser/base/interface.js +0 -4
  212. package/blazorGlobalSrc/markdown-parser/base/markdown-parser.d.ts +0 -69
  213. package/blazorGlobalSrc/markdown-parser/base/markdown-parser.js +0 -87
  214. package/blazorGlobalSrc/markdown-parser/base/types.d.ts +0 -7
  215. package/blazorGlobalSrc/markdown-parser/base/types.js +0 -4
  216. package/blazorGlobalSrc/markdown-parser/base.d.ts +0 -7
  217. package/blazorGlobalSrc/markdown-parser/base.js +0 -9
  218. package/blazorGlobalSrc/markdown-parser/index.d.ts +0 -5
  219. package/blazorGlobalSrc/markdown-parser/index.js +0 -9
  220. package/blazorGlobalSrc/markdown-parser/plugin/clearformat.d.ts +0 -28
  221. package/blazorGlobalSrc/markdown-parser/plugin/clearformat.js +0 -110
  222. package/blazorGlobalSrc/markdown-parser/plugin/formats.d.ts +0 -32
  223. package/blazorGlobalSrc/markdown-parser/plugin/formats.js +0 -225
  224. package/blazorGlobalSrc/markdown-parser/plugin/insert-text.d.ts +0 -24
  225. package/blazorGlobalSrc/markdown-parser/plugin/insert-text.js +0 -49
  226. package/blazorGlobalSrc/markdown-parser/plugin/link.d.ts +0 -24
  227. package/blazorGlobalSrc/markdown-parser/plugin/link.js +0 -50
  228. package/blazorGlobalSrc/markdown-parser/plugin/lists.d.ts +0 -39
  229. package/blazorGlobalSrc/markdown-parser/plugin/lists.js +0 -462
  230. package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.d.ts +0 -140
  231. package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.js +0 -104
  232. package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.d.ts +0 -31
  233. package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.js +0 -335
  234. package/blazorGlobalSrc/markdown-parser/plugin/table.d.ts +0 -52
  235. package/blazorGlobalSrc/markdown-parser/plugin/table.js +0 -216
  236. package/blazorGlobalSrc/markdown-parser/plugin/undo.d.ts +0 -83
  237. package/blazorGlobalSrc/markdown-parser/plugin/undo.js +0 -147
  238. package/blazorGlobalSrc/markdown-parser/plugin.d.ts +0 -11
  239. package/blazorGlobalSrc/markdown-parser/plugin.js +0 -15
  240. package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.d.ts +0 -114
  241. package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.js +0 -465
  242. package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.d.ts +0 -58
  243. package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.js +0 -216
  244. package/blazorGlobalSrc/rich-text-editor/actions/color-picker.d.ts +0 -52
  245. package/blazorGlobalSrc/rich-text-editor/actions/color-picker.js +0 -241
  246. package/blazorGlobalSrc/rich-text-editor/actions/count.d.ts +0 -55
  247. package/blazorGlobalSrc/rich-text-editor/actions/count.js +0 -117
  248. package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.d.ts +0 -72
  249. package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.js +0 -552
  250. package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.d.ts +0 -51
  251. package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.js +0 -853
  252. package/blazorGlobalSrc/rich-text-editor/actions/enter-key.d.ts +0 -28
  253. package/blazorGlobalSrc/rich-text-editor/actions/enter-key.js +0 -821
  254. package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.d.ts +0 -11
  255. package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.js +0 -28
  256. package/blazorGlobalSrc/rich-text-editor/actions/file-manager.d.ts +0 -45
  257. package/blazorGlobalSrc/rich-text-editor/actions/file-manager.js +0 -249
  258. package/blazorGlobalSrc/rich-text-editor/actions/format-painter.d.ts +0 -25
  259. package/blazorGlobalSrc/rich-text-editor/actions/format-painter.js +0 -156
  260. package/blazorGlobalSrc/rich-text-editor/actions/full-screen.d.ts +0 -40
  261. package/blazorGlobalSrc/rich-text-editor/actions/full-screen.js +0 -148
  262. package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.d.ts +0 -15
  263. package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.js +0 -50
  264. package/blazorGlobalSrc/rich-text-editor/actions/html-editor.d.ts +0 -120
  265. package/blazorGlobalSrc/rich-text-editor/actions/html-editor.js +0 -1244
  266. package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.d.ts +0 -14
  267. package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.js +0 -47
  268. package/blazorGlobalSrc/rich-text-editor/actions/import-export.d.ts +0 -21
  269. package/blazorGlobalSrc/rich-text-editor/actions/import-export.js +0 -117
  270. package/blazorGlobalSrc/rich-text-editor/actions/keyboard-model.d.ts +0 -30
  271. package/blazorGlobalSrc/rich-text-editor/actions/keyboard.d.ts +0 -110
  272. package/blazorGlobalSrc/rich-text-editor/actions/keyboard.js +0 -163
  273. package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.d.ts +0 -66
  274. package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.js +0 -142
  275. package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.d.ts +0 -23
  276. package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.js +0 -124
  277. package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.d.ts +0 -86
  278. package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.js +0 -1071
  279. package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.d.ts +0 -151
  280. package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.js +0 -548
  281. package/blazorGlobalSrc/rich-text-editor/actions/resize.d.ts +0 -37
  282. package/blazorGlobalSrc/rich-text-editor/actions/resize.js +0 -188
  283. package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.d.ts +0 -11
  284. package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.js +0 -168
  285. package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.d.ts +0 -18
  286. package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.js +0 -76
  287. package/blazorGlobalSrc/rich-text-editor/actions/toolbar.d.ts +0 -185
  288. package/blazorGlobalSrc/rich-text-editor/actions/toolbar.js +0 -512
  289. package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.d.ts +0 -25
  290. package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.js +0 -166
  291. package/blazorGlobalSrc/rich-text-editor/actions.d.ts +0 -26
  292. package/blazorGlobalSrc/rich-text-editor/actions.js +0 -30
  293. package/blazorGlobalSrc/rich-text-editor/audio.d.ts +0 -4
  294. package/blazorGlobalSrc/rich-text-editor/audio.js +0 -8
  295. package/blazorGlobalSrc/rich-text-editor/base/classes.d.ts +0 -628
  296. package/blazorGlobalSrc/rich-text-editor/base/classes.js +0 -129
  297. package/blazorGlobalSrc/rich-text-editor/base/constant.d.ts +0 -808
  298. package/blazorGlobalSrc/rich-text-editor/base/constant.js +0 -334
  299. package/blazorGlobalSrc/rich-text-editor/base/enum.d.ts +0 -81
  300. package/blazorGlobalSrc/rich-text-editor/base/enum.js +0 -37
  301. package/blazorGlobalSrc/rich-text-editor/base/interface.d.ts +0 -1577
  302. package/blazorGlobalSrc/rich-text-editor/base/interface.js +0 -194
  303. package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor-model.d.ts +0 -1032
  304. package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.d.ts +0 -1699
  305. package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.js +0 -2645
  306. package/blazorGlobalSrc/rich-text-editor/base/util.d.ts +0 -212
  307. package/blazorGlobalSrc/rich-text-editor/base/util.js +0 -610
  308. package/blazorGlobalSrc/rich-text-editor/base.d.ts +0 -10
  309. package/blazorGlobalSrc/rich-text-editor/base.js +0 -13
  310. package/blazorGlobalSrc/rich-text-editor/formatter/formatter.d.ts +0 -87
  311. package/blazorGlobalSrc/rich-text-editor/formatter/formatter.js +0 -223
  312. package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.d.ts +0 -34
  313. package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.js +0 -44
  314. package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.d.ts +0 -39
  315. package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.js +0 -48
  316. package/blazorGlobalSrc/rich-text-editor/formatter.d.ts +0 -6
  317. package/blazorGlobalSrc/rich-text-editor/formatter.js +0 -10
  318. package/blazorGlobalSrc/rich-text-editor/html-editor.d.ts +0 -4
  319. package/blazorGlobalSrc/rich-text-editor/html-editor.js +0 -8
  320. package/blazorGlobalSrc/rich-text-editor/image.d.ts +0 -4
  321. package/blazorGlobalSrc/rich-text-editor/image.js +0 -8
  322. package/blazorGlobalSrc/rich-text-editor/index.d.ts +0 -9
  323. package/blazorGlobalSrc/rich-text-editor/index.js +0 -12
  324. package/blazorGlobalSrc/rich-text-editor/link.d.ts +0 -4
  325. package/blazorGlobalSrc/rich-text-editor/link.js +0 -8
  326. package/blazorGlobalSrc/rich-text-editor/markdown-editor.d.ts +0 -4
  327. package/blazorGlobalSrc/rich-text-editor/markdown-editor.js +0 -8
  328. package/blazorGlobalSrc/rich-text-editor/models/default-locale.d.ts +0 -25
  329. package/blazorGlobalSrc/rich-text-editor/models/default-locale.js +0 -391
  330. package/blazorGlobalSrc/rich-text-editor/models/iframe-settings-model.d.ts +0 -68
  331. package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.d.ts +0 -61
  332. package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.js +0 -60
  333. package/blazorGlobalSrc/rich-text-editor/models/inline-mode-model.d.ts +0 -24
  334. package/blazorGlobalSrc/rich-text-editor/models/inline-mode.d.ts +0 -20
  335. package/blazorGlobalSrc/rich-text-editor/models/inline-mode.js +0 -37
  336. package/blazorGlobalSrc/rich-text-editor/models/items.d.ts +0 -36
  337. package/blazorGlobalSrc/rich-text-editor/models/items.js +0 -1011
  338. package/blazorGlobalSrc/rich-text-editor/models/models.d.ts +0 -7
  339. package/blazorGlobalSrc/rich-text-editor/models/models.js +0 -4
  340. package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings-model.d.ts +0 -40
  341. package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.d.ts +0 -50
  342. package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.js +0 -143
  343. package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings-model.d.ts +0 -1130
  344. package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.d.ts +0 -992
  345. package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.js +0 -510
  346. package/blazorGlobalSrc/rich-text-editor/models.d.ts +0 -4
  347. package/blazorGlobalSrc/rich-text-editor/models.js +0 -4
  348. package/blazorGlobalSrc/rich-text-editor/quick-toolbar.d.ts +0 -4
  349. package/blazorGlobalSrc/rich-text-editor/quick-toolbar.js +0 -8
  350. package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.d.ts +0 -82
  351. package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.js +0 -886
  352. package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.d.ts +0 -65
  353. package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.js +0 -49
  354. package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.d.ts +0 -39
  355. package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.js +0 -111
  356. package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.d.ts +0 -33
  357. package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.js +0 -101
  358. package/blazorGlobalSrc/rich-text-editor/renderer/image-module.d.ts +0 -199
  359. package/blazorGlobalSrc/rich-text-editor/renderer/image-module.js +0 -2494
  360. package/blazorGlobalSrc/rich-text-editor/renderer/link-module.d.ts +0 -63
  361. package/blazorGlobalSrc/rich-text-editor/renderer/link-module.js +0 -596
  362. package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.d.ts +0 -65
  363. package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.js +0 -38
  364. package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.d.ts +0 -54
  365. package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.js +0 -35
  366. package/blazorGlobalSrc/rich-text-editor/renderer/render.d.ts +0 -46
  367. package/blazorGlobalSrc/rich-text-editor/renderer/render.js +0 -70
  368. package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.d.ts +0 -20
  369. package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.js +0 -224
  370. package/blazorGlobalSrc/rich-text-editor/renderer/table-module.d.ts +0 -155
  371. package/blazorGlobalSrc/rich-text-editor/renderer/table-module.js +0 -2206
  372. package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -131
  373. package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.js +0 -747
  374. package/blazorGlobalSrc/rich-text-editor/renderer/video-module.d.ts +0 -120
  375. package/blazorGlobalSrc/rich-text-editor/renderer/video-module.js +0 -1507
  376. package/blazorGlobalSrc/rich-text-editor/renderer/view-source.d.ts +0 -74
  377. package/blazorGlobalSrc/rich-text-editor/renderer/view-source.js +0 -225
  378. package/blazorGlobalSrc/rich-text-editor/renderer.d.ts +0 -17
  379. package/blazorGlobalSrc/rich-text-editor/renderer.js +0 -21
  380. package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.d.ts +0 -33
  381. package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.js +0 -29
  382. package/blazorGlobalSrc/rich-text-editor/services/service-locator.d.ts +0 -29
  383. package/blazorGlobalSrc/rich-text-editor/services/service-locator.js +0 -25
  384. package/blazorGlobalSrc/rich-text-editor/services.d.ts +0 -5
  385. package/blazorGlobalSrc/rich-text-editor/services.js +0 -9
  386. package/blazorGlobalSrc/rich-text-editor/toolbar.d.ts +0 -4
  387. package/blazorGlobalSrc/rich-text-editor/toolbar.js +0 -8
  388. package/blazorGlobalSrc/rich-text-editor/video.d.ts +0 -4
  389. package/blazorGlobalSrc/rich-text-editor/video.js +0 -8
  390. package/blazorGlobalSrc/rich-text-editor.d.ts +0 -4
  391. package/blazorGlobalSrc/rich-text-editor.js +0 -8
  392. package/blazorGlobalSrc/selection/index.d.ts +0 -4
  393. package/blazorGlobalSrc/selection/index.js +0 -8
  394. package/blazorGlobalSrc/selection/selection.d.ts +0 -244
  395. package/blazorGlobalSrc/selection/selection.js +0 -309
  396. package/helpers/e2e/index.d.ts +0 -1
  397. package/helpers/e2e/index.js +0 -8
  398. package/helpers/e2e/rte-helper.d.ts +0 -79
  399. package/helpers/e2e/rte-helper.js +0 -81
  400. package/src/global.d.ts +0 -1
  401. package/tslint.json +0 -111
@@ -1,1507 +0,0 @@
1
- define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-buttons", "@syncfusion/ej2-inputs", "../../common/util", "../base/classes", "../base/constant", "../base/enum", "../base/util"], function (require, exports, ej2_base_1, ej2_buttons_1, ej2_inputs_1, util_1, classes, events, enum_1, util_2) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- var Video = (function () {
5
- function Video(parent, serviceLocator) {
6
- this.isVideoUploaded = false;
7
- this.isAllowedTypes = true;
8
- this.pageX = null;
9
- this.pageY = null;
10
- this.mouseX = null;
11
- this.deletedVid = [];
12
- this.isResizeBind = true;
13
- this.parent = parent;
14
- this.rteID = parent.element.id;
15
- this.i10n = serviceLocator.getService('rteLocale');
16
- this.rendererFactory = serviceLocator.getService('rendererFactory');
17
- this.dialogRenderObj = serviceLocator.getService('dialogRenderObject');
18
- this.addEventListener();
19
- this.isDestroyed = false;
20
- this.docClick = this.onDocumentClick.bind(this);
21
- }
22
- Video.prototype.addEventListener = function () {
23
- if (this.parent.isDestroyed) {
24
- return;
25
- }
26
- this.parent.on(events.keyDown, this.onKeyDown, this);
27
- this.parent.on(events.keyUp, this.onKeyUp, this);
28
- this.parent.on(events.insertVideo, this.insertingVideo, this);
29
- this.parent.on(events.initialEnd, this.afterRender, this);
30
- this.parent.on(events.dynamicModule, this.afterRender, this);
31
- this.parent.on(events.windowResize, this.onWindowResize, this);
32
- this.parent.on(events.showVideoDialog, this.showDialog, this);
33
- this.parent.on(events.closeVideoDialog, this.closeDialog, this);
34
- this.parent.on(events.dropDownSelect, this.alignmentSelect, this);
35
- this.parent.on(events.videoDelete, this.deleteVideo, this);
36
- this.parent.on(events.videoToolbarAction, this.onToolbarAction, this);
37
- this.parent.on(events.editAreaClick, this.editAreaClickHandler, this);
38
- this.parent.on(events.iframeMouseDown, this.onIframeMouseDown, this);
39
- this.parent.on(events.videoSize, this.videoSize, this);
40
- this.parent.on(events.insertCompleted, this.showVideoQuickToolbar, this);
41
- this.parent.on(events.clearDialogObj, this.clearDialogObj, this);
42
- this.parent.on(events.destroy, this.destroy, this);
43
- };
44
- Video.prototype.removeEventListener = function () {
45
- this.parent.off(events.keyDown, this.onKeyDown);
46
- this.parent.off(events.keyUp, this.onKeyUp);
47
- this.parent.off(events.insertVideo, this.insertingVideo);
48
- this.parent.off(events.windowResize, this.onWindowResize);
49
- this.parent.off(events.initialEnd, this.afterRender);
50
- this.parent.off(events.dynamicModule, this.afterRender);
51
- this.parent.off(events.showVideoDialog, this.showDialog);
52
- this.parent.off(events.closeVideoDialog, this.closeDialog);
53
- this.parent.off(events.dropDownSelect, this.alignmentSelect);
54
- this.parent.off(events.videoDelete, this.deleteVideo);
55
- this.parent.off(events.videoToolbarAction, this.onToolbarAction);
56
- this.parent.off(events.editAreaClick, this.editAreaClickHandler);
57
- this.parent.off(events.iframeMouseDown, this.onIframeMouseDown);
58
- this.parent.off(events.videoSize, this.videoSize);
59
- this.parent.off(events.insertCompleted, this.showVideoQuickToolbar);
60
- this.parent.off(events.clearDialogObj, this.clearDialogObj);
61
- this.parent.off(events.destroy, this.destroy);
62
- if (!ej2_base_1.isNullOrUndefined(this.contentModule)) {
63
- ej2_base_1.EventHandler.remove(this.contentModule.getEditPanel(), ej2_base_1.Browser.touchEndEvent, this.videoClick);
64
- this.parent.formatter.editorManager.observer.off(events.checkUndo, this.undoStack);
65
- if (this.parent.insertVideoSettings.resize) {
66
- ej2_base_1.EventHandler.remove(this.parent.contentModule.getEditPanel(), ej2_base_1.Browser.touchStartEvent, this.resizeStart);
67
- this.parent.element.ownerDocument.removeEventListener('mousedown', this.docClick);
68
- this.docClick = null;
69
- ej2_base_1.EventHandler.remove(this.contentModule.getEditPanel(), 'cut', this.onCutHandler);
70
- ej2_base_1.EventHandler.remove(this.contentModule.getDocument(), ej2_base_1.Browser.touchMoveEvent, this.resizing);
71
- }
72
- }
73
- };
74
- Video.prototype.afterRender = function () {
75
- this.contentModule = this.rendererFactory.getRenderer(enum_1.RenderType.Content);
76
- ej2_base_1.EventHandler.add(this.contentModule.getEditPanel(), ej2_base_1.Browser.touchEndEvent, this.videoClick, this);
77
- if (this.parent.insertVideoSettings.resize) {
78
- ej2_base_1.EventHandler.add(this.parent.contentModule.getEditPanel(), ej2_base_1.Browser.touchStartEvent, this.resizeStart, this);
79
- this.parent.element.ownerDocument.addEventListener('mousedown', this.docClick);
80
- ej2_base_1.EventHandler.add(this.contentModule.getEditPanel(), 'cut', this.onCutHandler, this);
81
- }
82
- };
83
- Video.prototype.clearDialogObj = function () {
84
- if (this.uploadObj && !this.uploadObj.isDestroyed) {
85
- this.uploadObj.destroy();
86
- ej2_base_1.detach(this.uploadObj.element);
87
- this.uploadObj = null;
88
- }
89
- if (this.webUrlBtn && !this.webUrlBtn.isDestroyed) {
90
- this.webUrlBtn.destroy();
91
- ej2_base_1.detach(this.webUrlBtn.element);
92
- this.webUrlBtn = null;
93
- }
94
- if (this.embedUrlBtn && !this.embedUrlBtn.isDestroyed) {
95
- this.embedUrlBtn.destroy();
96
- ej2_base_1.detach(this.embedUrlBtn.element);
97
- this.embedUrlBtn = null;
98
- }
99
- if (this.widthNum && !this.widthNum.isDestroyed) {
100
- this.widthNum.destroy();
101
- ej2_base_1.detach(this.widthNum.element);
102
- this.widthNum = null;
103
- }
104
- if (this.heightNum && !this.heightNum.isDestroyed) {
105
- this.heightNum.destroy();
106
- ej2_base_1.detach(this.heightNum.element);
107
- this.heightNum = null;
108
- }
109
- if (this.button && !this.button.isDestroyed) {
110
- this.button.destroy();
111
- ej2_base_1.detach(this.button.element);
112
- this.heightNum = null;
113
- }
114
- if (this.dialogObj && this.dialogObj.element) {
115
- this.dialogObj.destroy();
116
- ej2_base_1.detach(this.dialogObj.element);
117
- this.dialogObj = null;
118
- }
119
- };
120
- Video.prototype.onKeyUp = function (event) {
121
- if (!ej2_base_1.isNullOrUndefined(this.deletedVid) && this.deletedVid.length > 0) {
122
- for (var i = 0; i < this.deletedVid.length; i++) {
123
- var args = {
124
- element: this.deletedVid[i],
125
- src: this.deletedVid[i].tagName !== 'IFRAME' ? this.deletedVid[i].querySelector('source').getAttribute('src') :
126
- this.deletedVid[i].src
127
- };
128
- this.parent.trigger(events.afterMediaDelete, args);
129
- }
130
- }
131
- };
132
- Video.prototype.undoStack = function (args) {
133
- if ((args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') && this.parent.editorMode === 'HTML') {
134
- for (var i = 0; i < this.parent.formatter.getUndoRedoStack().length; i++) {
135
- var temp = this.parent.createElement('div');
136
- var contentElem = this.parent.formatter.getUndoRedoStack()[i].text;
137
- temp.appendChild(contentElem.cloneNode(true));
138
- var vid = temp.querySelectorAll('video');
139
- if (temp.querySelector('.e-vid-resize') && vid.length > 0) {
140
- for (var j = 0; j < vid.length; j++) {
141
- vid[j].style.outline = '';
142
- }
143
- ej2_base_1.detach(temp.querySelector('.e-vid-resize'));
144
- var clonedElement = temp.cloneNode(true);
145
- var fragment = document.createDocumentFragment();
146
- while (clonedElement.firstChild) {
147
- fragment.appendChild(clonedElement.firstChild);
148
- }
149
- this.parent.formatter.getUndoRedoStack()[i].text = fragment;
150
- }
151
- }
152
- }
153
- };
154
- Video.prototype.onIframeMouseDown = function (e) {
155
- var target = e.target;
156
- if (this.dialogObj) {
157
- this.dialogObj.hide({ returnValue: true });
158
- }
159
- if (!(!ej2_base_1.isNullOrUndefined(this.parent.currentTarget) && this.parent.currentTarget.nodeName === 'VIDEO') && (this.videoEle && this.vidResizeDiv && this.contentModule.getEditPanel().contains(this.vidResizeDiv))) {
160
- this.cancelResizeAction();
161
- }
162
- if (this.contentModule.getEditPanel().querySelector('.e-vid-resize') && (this.parent.currentTarget.nodeName === 'VIDEO')) {
163
- if (!ej2_base_1.isNullOrUndefined(this.prevSelectedVidEle) &&
164
- this.prevSelectedVidEle !== ((target.tagName === 'IFRAME' || target.tagName === 'VIDEO') ? target : target.querySelector('iframe'))) {
165
- this.prevSelectedVidEle.style.outline = '';
166
- }
167
- }
168
- };
169
- Video.prototype.videoSize = function (e) {
170
- var _this = this;
171
- if (e.selectNode[0].nodeName !== 'VIDEO' && !this.isEmbedVidElem(e.selectNode[0])) {
172
- return;
173
- }
174
- this.insertVideo(e);
175
- if (!ej2_base_1.isNullOrUndefined(this.dialogObj)) {
176
- var vidSizeHeader = this.i10n.getConstant('videoSizeHeader');
177
- var linkUpdate = this.i10n.getConstant('dialogUpdate');
178
- var dialogContent = this.vidsizeInput(e);
179
- var selectObj_1 = { args: e.args, selfVideo: this, selection: e.selection, selectNode: e.selectNode };
180
- this.dialogObj.setProperties({
181
- width: '290px', header: vidSizeHeader, content: dialogContent,
182
- buttons: [{
183
- click: function (e) {
184
- _this.insertSize(selectObj_1);
185
- },
186
- buttonModel: {
187
- content: linkUpdate, cssClass: 'e-flat e-update-size', isPrimary: true
188
- }
189
- }]
190
- });
191
- this.dialogObj.element.style.maxHeight = 'inherit';
192
- this.dialogObj.content.querySelector('input').focus();
193
- }
194
- };
195
- Video.prototype.vidsizeInput = function (e) {
196
- var _this = this;
197
- var selectNode = e.selectNode[0];
198
- var vidHeight = this.i10n.getConstant('videoHeight');
199
- var vidWidth = this.i10n.getConstant('videoWidth');
200
- var vidSizeWrap = this.parent.createElement('div', { className: 'e-video-sizewrap' });
201
- var widthVal = ej2_base_1.isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
202
- selectNode.style.width !== '') ? selectNode.style.width : !ej2_base_1.isNullOrUndefined(this.changedWidthValue) ?
203
- this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString(), 10)).toString();
204
- var heightVal = ej2_base_1.isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
205
- selectNode.style.height !== '') ? selectNode.style.height : !ej2_base_1.isNullOrUndefined(this.changedHeightValue) ?
206
- this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString(), 10)).toString();
207
- if (selectNode.style.width === '' && ej2_base_1.isNullOrUndefined(this.changedWidthValue)) {
208
- widthVal = 'auto';
209
- }
210
- if (selectNode.style.height === '' && ej2_base_1.isNullOrUndefined(this.changedHeightValue)) {
211
- heightVal = 'auto';
212
- }
213
- this.changedWidthValue = null;
214
- this.changedHeightValue = null;
215
- var content = '<div class="e-rte-label"><label>' + vidWidth +
216
- '</label></div><div class="e-rte-field"><input type="text" id="vidwidth" class="e-vid-width" value=' +
217
- widthVal
218
- + ' /></div>' +
219
- '<div class="e-rte-label">' + '<label>' + vidHeight + '</label></div><div class="e-rte-field"> ' +
220
- '<input type="text" id="vidheight" class="e-vid-height" value=' +
221
- heightVal
222
- + ' /></div>';
223
- var contentElem = util_2.parseHtml(content);
224
- vidSizeWrap.appendChild(contentElem);
225
- this.widthNum = new ej2_inputs_1.TextBox({
226
- value: ej2_base_1.formatUnit(widthVal),
227
- enableRtl: this.parent.enableRtl,
228
- input: function (e) {
229
- _this.inputWidthValue = ej2_base_1.formatUnit((e.value));
230
- }
231
- });
232
- this.widthNum.createElement = this.parent.createElement;
233
- this.widthNum.appendTo(vidSizeWrap.querySelector('#vidwidth'));
234
- this.heightNum = new ej2_inputs_1.TextBox({
235
- value: ej2_base_1.formatUnit(heightVal),
236
- enableRtl: this.parent.enableRtl,
237
- input: function (e) {
238
- _this.inputHeightValue = ej2_base_1.formatUnit((e.value));
239
- }
240
- });
241
- this.heightNum.createElement = this.parent.createElement;
242
- this.heightNum.appendTo(vidSizeWrap.querySelector('#vidheight'));
243
- return vidSizeWrap;
244
- };
245
- Video.prototype.insertSize = function (e) {
246
- e.selection.restore();
247
- var proxy = e.selfVideo;
248
- if (proxy.parent.formatter.getUndoRedoStack().length === 0) {
249
- proxy.parent.formatter.saveData();
250
- }
251
- var dialogEle = proxy.dialogObj.element;
252
- this.changedWidthValue = this.inputWidthValue === 'px' ? null : this.inputWidthValue;
253
- this.changedHeightValue = this.inputHeightValue === 'px' ? null : this.inputHeightValue;
254
- var width = dialogEle.querySelector('.e-vid-width').value;
255
- var height = dialogEle.parentElement.querySelector('.e-vid-height').value;
256
- proxy.parent.formatter.process(this.parent, e.args, e.args, {
257
- width: width, height: height, selectNode: e.selectNode,
258
- subCommand: e.args.item.subCommand
259
- });
260
- if (this.vidResizeDiv) {
261
- e.selectNode[0] = (e.selectNode[0].tagName === 'VIDEO' || e.selectNode[0].tagName === 'IFRAME') ?
262
- e.selectNode[0] : e.selectNode[0].querySelector('iframe');
263
- proxy.vidResizePos(e.selectNode[0], this.vidResizeDiv);
264
- }
265
- proxy.dialogObj.hide({ returnValue: true });
266
- };
267
- Video.prototype.resizeEnd = function (e) {
268
- this.resizeBtnInit();
269
- this.videoEle.parentElement.style.cursor = 'auto';
270
- if (ej2_base_1.Browser.isDevice) {
271
- ej2_base_1.removeClass([e.target.parentElement], 'e-mob-span');
272
- }
273
- var args = { event: e, requestType: 'videos' };
274
- this.parent.trigger(events.resizeStop, args);
275
- var pageX = this.getPointX(e);
276
- var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
277
- this.parent.element.getBoundingClientRect().top + e.clientY : e.pageY;
278
- this.parent.formatter.editorManager.observer.on(events.checkUndo, this.undoStack, this);
279
- this.parent.formatter.saveData();
280
- };
281
- Video.prototype.resizeStart = function (e, ele) {
282
- var _this = this;
283
- if (this.parent.readonly) {
284
- return;
285
- }
286
- var target = ele ? ele : !this.isEmbedVidElem(e.target) ? e.target : e.target.querySelector('iframe');
287
- if (ej2_base_1.isNullOrUndefined(target)) {
288
- return;
289
- }
290
- this.prevSelectedVidEle = this.videoEle;
291
- if (target.tagName === 'VIDEO' || target.tagName === 'IFRAME') {
292
- this.parent.preventDefaultResize(e);
293
- var videoElem = target;
294
- if (this.vidResizeDiv && this.contentModule.getEditPanel().contains(this.vidResizeDiv)) {
295
- ej2_base_1.detach(this.vidResizeDiv);
296
- }
297
- this.videoResize(videoElem);
298
- }
299
- if (target.classList.contains('e-rte-videoboxmark')) {
300
- if (this.parent.formatter.getUndoRedoStack().length === 0) {
301
- this.parent.formatter.saveData();
302
- }
303
- this.pageX = this.getPointX(e);
304
- this.pageY = this.getPointY(e);
305
- e.preventDefault();
306
- e.stopImmediatePropagation();
307
- this.resizeBtnInit();
308
- if (this.quickToolObj) {
309
- this.quickToolObj.videoQTBar.hidePopup();
310
- }
311
- if (target.classList.contains('e-rte-topLeft')) {
312
- this.resizeBtnStat.topLeft = true;
313
- }
314
- if (target.classList.contains('e-rte-topRight')) {
315
- this.resizeBtnStat.topRight = true;
316
- }
317
- if (target.classList.contains('e-rte-botLeft')) {
318
- this.resizeBtnStat.botLeft = true;
319
- }
320
- if (target.classList.contains('e-rte-botRight')) {
321
- this.resizeBtnStat.botRight = true;
322
- }
323
- if (ej2_base_1.Browser.isDevice && this.contentModule.getEditPanel().contains(this.vidResizeDiv) &&
324
- !this.vidResizeDiv.classList.contains('e-mob-span')) {
325
- ej2_base_1.addClass([this.vidResizeDiv], 'e-mob-span');
326
- }
327
- else {
328
- var args = { event: e, requestType: 'videos' };
329
- this.parent.trigger(events.resizeStart, args, function (resizeStartArgs) {
330
- if (resizeStartArgs.cancel) {
331
- _this.cancelResizeAction();
332
- }
333
- });
334
- }
335
- if (this.isResizeBind) {
336
- ej2_base_1.EventHandler.add(this.contentModule.getDocument(), ej2_base_1.Browser.touchMoveEvent, this.resizing, this);
337
- ej2_base_1.EventHandler.add(this.contentModule.getDocument(), ej2_base_1.Browser.touchEndEvent, this.resizeEnd, this);
338
- this.isResizeBind = false;
339
- }
340
- }
341
- };
342
- Video.prototype.videoClick = function (e) {
343
- if (ej2_base_1.Browser.isDevice) {
344
- if ((e.target.tagName === 'VIDEO' || this.isEmbedVidElem(e.target))) {
345
- this.contentModule.getEditPanel().setAttribute('contenteditable', 'false');
346
- e.target.focus();
347
- }
348
- else {
349
- if (!this.parent.readonly) {
350
- this.contentModule.getEditPanel().setAttribute('contenteditable', 'true');
351
- }
352
- }
353
- }
354
- if (e.target.tagName === 'VIDEO' || this.isEmbedVidElem(e.target) && !this.parent.userAgentData.isSafari()) {
355
- e.preventDefault();
356
- }
357
- };
358
- Video.prototype.onCutHandler = function () {
359
- if (this.vidResizeDiv && this.contentModule.getEditPanel().contains(this.vidResizeDiv)) {
360
- this.cancelResizeAction();
361
- }
362
- };
363
- Video.prototype.videoResize = function (e) {
364
- this.resizeBtnInit();
365
- this.videoEle = e;
366
- ej2_base_1.addClass([this.videoEle], 'e-resize');
367
- this.vidResizeDiv = this.parent.createElement('span', { className: 'e-vid-resize', id: this.rteID + '_vidResize' });
368
- this.vidResizeDiv.appendChild(this.parent.createElement('span', {
369
- className: 'e-rte-videoboxmark e-rte-topLeft', styles: 'cursor: nwse-resize'
370
- }));
371
- this.vidResizeDiv.appendChild(this.parent.createElement('span', {
372
- className: 'e-rte-videoboxmark e-rte-topRight', styles: 'cursor: nesw-resize'
373
- }));
374
- this.vidResizeDiv.appendChild(this.parent.createElement('span', {
375
- className: 'e-rte-videoboxmark e-rte-botLeft', styles: 'cursor: nesw-resize'
376
- }));
377
- this.vidResizeDiv.appendChild(this.parent.createElement('span', {
378
- className: 'e-rte-videoboxmark e-rte-botRight', styles: 'cursor: nwse-resize'
379
- }));
380
- if (ej2_base_1.Browser.isDevice) {
381
- ej2_base_1.addClass([this.vidResizeDiv], 'e-mob-rte');
382
- }
383
- e.style.outline = '2px solid #4a90e2';
384
- this.vidResizePos(e, this.vidResizeDiv);
385
- this.resizeVidDupPos(e);
386
- this.contentModule.getEditPanel().appendChild(this.vidResizeDiv);
387
- if (this.parent.element.style.height === 'auto') {
388
- this.vidResizePos(e, this.vidResizeDiv);
389
- }
390
- };
391
- Video.prototype.getPointX = function (e) {
392
- if (e.touches && e.touches.length) {
393
- return e.touches[0].pageX;
394
- }
395
- else {
396
- return e.pageX;
397
- }
398
- };
399
- Video.prototype.getPointY = function (e) {
400
- if (e.touches && e.touches.length) {
401
- return e.touches[0].pageY;
402
- }
403
- else {
404
- return e.pageY;
405
- }
406
- };
407
- Video.prototype.vidResizePos = function (e, vidResizeDiv) {
408
- if (ej2_base_1.isNullOrUndefined(vidResizeDiv)) {
409
- return;
410
- }
411
- var pos = this.calcPos(e);
412
- var top = pos.top;
413
- var left = pos.left;
414
- var vidWid = e.width !== 0 && e.width !== 'auto' && e.width !== 'NaN' ? e.width : e.getBoundingClientRect().width;
415
- var vidHgt = e.height !== 0 && e.height !== 'auto' && e.height !== 'NaN' ? e.height : e.getBoundingClientRect().height;
416
- var borWid = (ej2_base_1.Browser.isDevice) ? (4 * parseInt((e.style.outline.slice(-3)), 10)) + 2 :
417
- (2 * parseInt((e.style.outline.slice(-3)), 10)) + 2;
418
- var devWid = ((ej2_base_1.Browser.isDevice) ? 0 : 2);
419
- vidResizeDiv.querySelector('.e-rte-botLeft').style.left = (left - borWid) + 'px';
420
- vidResizeDiv.querySelector('.e-rte-botLeft').style.top = ((parseInt(vidHgt.toString(), 10) - borWid) + top) + 'px';
421
- vidResizeDiv.querySelector('.e-rte-botRight').style.left = ((parseInt(vidWid.toString(), 10) - (borWid - devWid)) + left) + 'px';
422
- vidResizeDiv.querySelector('.e-rte-botRight').style.top = ((parseInt(vidHgt.toString(), 10) - borWid) + top) + 'px';
423
- vidResizeDiv.querySelector('.e-rte-topRight').style.left = ((parseInt(vidWid.toString(), 10) - (borWid - devWid)) + left) + 'px';
424
- vidResizeDiv.querySelector('.e-rte-topRight').style.top = (top - (borWid)) + 'px';
425
- vidResizeDiv.querySelector('.e-rte-topLeft').style.left = (left - borWid) + 'px';
426
- vidResizeDiv.querySelector('.e-rte-topLeft').style.top = (top - borWid) + 'px';
427
- };
428
- Video.prototype.calcPos = function (elem) {
429
- var ignoreOffset = ['TD', 'TH', 'TABLE', 'A'];
430
- var parentOffset = { top: 0, left: 0 };
431
- var elementOffset;
432
- var doc = elem.ownerDocument;
433
- var offsetParent = ((elem.offsetParent && (elem.offsetParent.classList.contains('e-video-clickelem') ||
434
- ignoreOffset.indexOf(elem.offsetParent.tagName) > -1)) ? ej2_base_1.closest(elem, '#' + this.parent.getID() + '_rte-edit-view') : elem.offsetParent) || doc.documentElement;
435
- while (offsetParent &&
436
- (offsetParent === doc.body || offsetParent === doc.documentElement) &&
437
- offsetParent.style.position === 'static') {
438
- offsetParent = offsetParent.parentNode;
439
- }
440
- if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
441
- parentOffset = offsetParent.getBoundingClientRect();
442
- }
443
- if (elem && elem.nodeType === 1 && elem.tagName === 'IFRAME') {
444
- elementOffset = elem.getBoundingClientRect();
445
- return {
446
- top: elementOffset.top - parentOffset.top,
447
- left: elementOffset.left - parentOffset.left
448
- };
449
- }
450
- else {
451
- return {
452
- top: elem.offsetTop,
453
- left: elem.offsetLeft
454
- };
455
- }
456
- };
457
- Video.prototype.setAspectRatio = function (vid, expectedX, expectedY, e) {
458
- var vidEleStyle = getComputedStyle(vid);
459
- if (ej2_base_1.isNullOrUndefined(vidEleStyle)) {
460
- return;
461
- }
462
- var regExp = RegExp;
463
- var width = vidEleStyle.width !== '' ? vidEleStyle.width.match(new regExp('^\\d+(\\.\\d*)?%$', 'g')) ? parseFloat(vidEleStyle.width) :
464
- parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
465
- var height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
466
- width = width.toString().match(new regExp('\\b\\d+(\\.\\d*)?(%|$)\\b', 'g')) ? parseFloat(width.toString()) : parseInt(width.toString(), 10);
467
- height = height.toString().match(new regExp('\\b\\d+(\\.\\d*)?(%|$)\\b', 'g')) ? parseFloat(height.toString()) : parseInt(height.toString(), 10);
468
- if (width > height) {
469
- vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '200px' : ej2_base_1.formatUnit(this.parent.insertVideoSettings.minWidth);
470
- vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '90px' : ej2_base_1.formatUnit(this.parent.insertVideoSettings.minHeight);
471
- if (this.parent.insertVideoSettings.resizeByPercent) {
472
- this.updateVidEleWidth(vid, width, height, expectedX, expectedY);
473
- }
474
- else if ((vid.style.width === '' && vid.style.height !== '') || (vidEleStyle.width === '' && vidEleStyle.height !== '')) {
475
- vid.style.height = expectedY + 'px';
476
- }
477
- else if ((vid.style.width !== '' && vid.style.height === '') || (vidEleStyle.width !== '' && vidEleStyle.height === '')) {
478
- var currentWidth = ((width / height * expectedY) +
479
- width / height) <
480
- (this.parent.inputElement.getBoundingClientRect().right - 32) ?
481
- ((width / height * expectedY) +
482
- width / height) :
483
- (this.parent.inputElement.getBoundingClientRect().right - 32);
484
- vid.style.width = currentWidth.toString() + 'px';
485
- }
486
- else if (vid.style.width !== '' || vidEleStyle.width !== '') {
487
- var currentWidth = (width / height * expectedY) <
488
- (this.parent.inputElement.getBoundingClientRect().right - 32) ?
489
- (width / height * expectedY) :
490
- (this.parent.inputElement.getBoundingClientRect().right - 32);
491
- vid.style.width = currentWidth + 'px';
492
- vid.style.height = expectedY + 'px';
493
- }
494
- else {
495
- vid.setAttribute('width', (parseInt(((width / height * expectedY) + width / height).toString(), 10)).toString());
496
- }
497
- }
498
- else if (height > width) {
499
- if (this.parent.insertVideoSettings.resizeByPercent) {
500
- this.updateVidEleWidth(vid, width, height, expectedX, expectedY);
501
- }
502
- else if (vidEleStyle.width !== '' || vid.style.width !== '') {
503
- vid.style.width = expectedX + 'px';
504
- vid.style.height = (height / width * expectedX) + 'px';
505
- }
506
- else {
507
- vid.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - vid.getBoundingClientRect().left).toString() : expectedX.toString());
508
- }
509
- }
510
- else {
511
- if (this.parent.insertVideoSettings.resizeByPercent) {
512
- vid.style.width = this.pixToPerc(expectedX, (vid.previousElementSibling || vid.parentElement)) + '%';
513
- vid.style.height = null;
514
- vid.removeAttribute('height');
515
- }
516
- else {
517
- vid.style.width = expectedX + 'px';
518
- vid.style.height = expectedX + 'px';
519
- }
520
- }
521
- };
522
- Video.prototype.updateVidEleWidth = function (vid, width, height, expectedX, expectedY) {
523
- if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
524
- var original = vid.offsetWidth + this.mouseX;
525
- var finalWidthByPerc = (original / vid.offsetWidth) * (parseFloat(vid.style.width).toString() === 'NaN' ? (vid.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(vid.style.width));
526
- vid.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
527
- }
528
- else {
529
- if (width > height) {
530
- vid.style.width = this.pixToPerc(width / height * expectedY, (vid.previousElementSibling || vid.parentElement)) + '%';
531
- }
532
- else {
533
- vid.style.width = this.pixToPerc((expectedX / height * expectedY), (vid.previousElementSibling || vid.parentElement)) + '%';
534
- }
535
- }
536
- vid.style.height = null;
537
- vid.removeAttribute('height');
538
- };
539
- Video.prototype.pixToPerc = function (expected, parentEle) {
540
- return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
541
- };
542
- Video.prototype.vidDupMouseMove = function (width, height, e) {
543
- var _this = this;
544
- var args = { event: e, requestType: 'videos' };
545
- this.parent.trigger(events.onResize, args, function (resizingArgs) {
546
- if (resizingArgs.cancel) {
547
- _this.cancelResizeAction();
548
- }
549
- else {
550
- if ((parseInt(_this.parent.insertVideoSettings.minWidth, 10) >= parseInt(width, 10) ||
551
- (parseInt(_this.parent.getInsertVidMaxWidth(), 10) <= parseInt(width, 10) &&
552
- ej2_base_1.isNullOrUndefined(_this.videoEle.style.width)))) {
553
- return;
554
- }
555
- if (!_this.parent.insertVideoSettings.resizeByPercent &&
556
- (parseInt(_this.parent.insertVideoSettings.minHeight, 10) >= parseInt(height, 10) ||
557
- parseInt(_this.parent.insertVideoSettings.maxHeight, 10) <= parseInt(height, 10))) {
558
- return;
559
- }
560
- _this.videoEle.parentElement.style.cursor = 'pointer';
561
- _this.setAspectRatio(_this.videoEle, parseInt(width, 10), parseInt(height, 10), args);
562
- _this.resizeVidDupPos(_this.videoEle);
563
- _this.vidResizePos(_this.videoEle, _this.vidResizeDiv);
564
- }
565
- });
566
- };
567
- Video.prototype.resizing = function (e) {
568
- if (this.videoEle.offsetWidth >= this.parent.getInsertVidMaxWidth()) {
569
- this.videoEle.style.maxHeight = this.videoEle.offsetHeight + 'px';
570
- }
571
- var pageX = this.getPointX(e);
572
- var pageY = this.getPointY(e);
573
- var mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
574
- var mouseY = (this.resizeBtnStat.topLeft || this.resizeBtnStat.topRight) ? -(pageY - this.pageY) : (pageY - this.pageY);
575
- var width = parseInt(this.vidDupPos.width, 10) + mouseX;
576
- var height = parseInt(this.vidDupPos.height, 10) + mouseY;
577
- this.pageX = pageX;
578
- this.pageY = pageY;
579
- this.mouseX = mouseX;
580
- if (this.resizeBtnStat.botRight) {
581
- this.vidDupMouseMove(width + 'px', height + 'px', e);
582
- }
583
- else if (this.resizeBtnStat.botLeft) {
584
- this.vidDupMouseMove(width + 'px', height + 'px', e);
585
- }
586
- else if (this.resizeBtnStat.topRight) {
587
- this.vidDupMouseMove(width + 'px', height + 'px', e);
588
- }
589
- else if (this.resizeBtnStat.topLeft) {
590
- this.vidDupMouseMove(width + 'px', height + 'px', e);
591
- }
592
- };
593
- Video.prototype.cancelResizeAction = function () {
594
- this.isResizeBind = true;
595
- ej2_base_1.EventHandler.remove(this.contentModule.getDocument(), ej2_base_1.Browser.touchMoveEvent, this.resizing);
596
- ej2_base_1.EventHandler.remove(this.contentModule.getDocument(), ej2_base_1.Browser.touchEndEvent, this.resizeEnd);
597
- if (this.videoEle && this.vidResizeDiv && this.contentModule.getEditPanel().contains(this.vidResizeDiv)) {
598
- ej2_base_1.detach(this.vidResizeDiv);
599
- this.videoEle.style.outline = '';
600
- this.vidResizeDiv = null;
601
- this.pageX = null;
602
- this.pageY = null;
603
- }
604
- };
605
- Video.prototype.resizeVidDupPos = function (e) {
606
- this.vidDupPos = {
607
- width: (e.style.width !== '' && (this.parent.insertVideoSettings &&
608
- !this.parent.insertVideoSettings.resizeByPercent)) ? this.videoEle.style.width : e.width !== 'auto' && e.width !== 0 && e.width !== 'NaN' ? e.width + 'px' : parseInt(getComputedStyle(e).width, 10) + 'px',
609
- height: (e.style.height !== '') ? this.videoEle.style.height : e.height !== 'auto' && e.height !== 0 && e.height !== 'NaN' ? e.height + 'px' : parseInt(getComputedStyle(e).height, 10) + 'px'
610
- };
611
- };
612
- Video.prototype.resizeBtnInit = function () {
613
- return this.resizeBtnStat = { botLeft: false, botRight: false, topRight: false, topLeft: false };
614
- };
615
- Video.prototype.onToolbarAction = function (args) {
616
- if (util_1.isIDevice()) {
617
- this.parent.notify(events.selectionRestore, {});
618
- }
619
- var item = args.args.item;
620
- switch (item.subCommand) {
621
- case 'VideoReplace':
622
- this.parent.notify(events.insertVideo, args);
623
- break;
624
- case 'VideoRemove':
625
- this.parent.notify(events.videoDelete, args);
626
- break;
627
- case 'VideoDimension':
628
- this.parent.notify(events.videoSize, args);
629
- }
630
- };
631
- Video.prototype.onKeyDown = function (event) {
632
- var originalEvent = event.args;
633
- var range;
634
- var save;
635
- var selectNodeEle;
636
- var selectParentEle;
637
- this.deletedVid = [];
638
- var isCursor;
639
- var keyCodeValues = [27, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
640
- 44, 45, 9, 16, 17, 18, 19, 20, 33, 34, 35, 36, 37, 38, 39, 40, 91, 92, 93, 144, 145, 182, 183];
641
- if (this.parent.editorMode === 'HTML') {
642
- range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
643
- isCursor = range.startContainer === range.endContainer && range.startOffset === range.endOffset;
644
- }
645
- if (!isCursor && this.parent.editorMode === 'HTML' && keyCodeValues.indexOf(originalEvent.which) < 0) {
646
- var nodes = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
647
- for (var i = 0; i < nodes.length; i++) {
648
- if (nodes[i].nodeName === 'VIDEO' || nodes[i].nodeName === 'IFRAME') {
649
- this.deletedVid.push(nodes[i]);
650
- }
651
- }
652
- }
653
- if (this.parent.editorMode === 'HTML' && ((originalEvent.which === 8 && originalEvent.code === 'Backspace') ||
654
- (originalEvent.which === 46 && originalEvent.code === 'Delete'))) {
655
- var isCursor_1 = range.startContainer === range.endContainer && range.startOffset === range.endOffset;
656
- if ((originalEvent.which === 8 && originalEvent.code === 'Backspace' && isCursor_1)) {
657
- this.checkVideoBack(range);
658
- }
659
- else if ((originalEvent.which === 46 && originalEvent.code === 'Delete' && isCursor_1)) {
660
- this.checkVideoDel(range);
661
- }
662
- }
663
- if (!ej2_base_1.isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) &&
664
- originalEvent.code !== 'KeyK') {
665
- range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
666
- selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
667
- selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
668
- if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
669
- ((!ej2_base_1.isNullOrUndefined(selectParentEle[0]) && selectParentEle[0].tagName === 'VIDEO' || this.isEmbedVidElem(selectParentEle[0]))) &&
670
- selectParentEle[0].parentElement) {
671
- var prev = selectParentEle[0].parentElement;
672
- if (this.contentModule.getEditPanel().querySelector('.e-vid-resize')) {
673
- this.removeResizeEle();
674
- }
675
- ej2_base_1.removeClass([selectParentEle[0]], classes.CLS_VID_FOCUS);
676
- if (this.quickToolObj && this.quickToolObj.videoQTBar) {
677
- this.quickToolObj.videoQTBar.hidePopup();
678
- }
679
- }
680
- }
681
- if (originalEvent.ctrlKey && (originalEvent.keyCode === 89 || originalEvent.keyCode === 90)) {
682
- this.undoStack({ subCommand: (originalEvent.keyCode === 90 ? 'undo' : 'redo') });
683
- }
684
- if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
685
- if (selectNodeEle && selectNodeEle[0] &&
686
- ((selectNodeEle[0].nodeName === 'VIDEO' || this.isEmbedVidElem(selectNodeEle[0])) ||
687
- (originalEvent.keyCode === 46 && selectNodeEle[0].nextSibling &&
688
- (selectNodeEle[0].nextSibling.className === 'e-video-wrap' || this.isEmbedVidElem(selectNodeEle[0].nextSibling))) ||
689
- (originalEvent.keyCode === 8 && selectNodeEle[0].previousSibling &&
690
- (selectNodeEle[0].previousSibling.className === 'e-video-wrap' || this.isEmbedVidElem(selectNodeEle[0].previousSibling)))) &&
691
- selectNodeEle.length <= 2) {
692
- if (!ej2_base_1.isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
693
- save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
694
- }
695
- originalEvent.preventDefault();
696
- var event_1 = {
697
- selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
698
- args: {
699
- item: { command: 'Videos', subCommand: 'VideoRemove' },
700
- originalEvent: originalEvent
701
- }
702
- };
703
- this.deleteVideo(event_1, originalEvent.keyCode);
704
- }
705
- if (this.parent.contentModule.getEditPanel().querySelector('.e-vid-resize')) {
706
- this.removeResizeEle();
707
- }
708
- }
709
- if (originalEvent.code === 'Backspace') {
710
- originalEvent.action = 'backspace';
711
- }
712
- switch (originalEvent.action) {
713
- case 'escape':
714
- if (!ej2_base_1.isNullOrUndefined(this.dialogObj)) {
715
- this.dialogObj.close();
716
- }
717
- break;
718
- case 'backspace':
719
- case 'delete':
720
- for (var i = 0; i < this.deletedVid.length; i++) {
721
- var src = this.deletedVid[i].src;
722
- this.videoRemovePost(src);
723
- }
724
- if (this.parent.editorMode !== 'Markdown') {
725
- if (range.startContainer.nodeType === 3) {
726
- if (originalEvent.code === 'Backspace') {
727
- if (range.startContainer.previousElementSibling && range.startOffset === 0 &&
728
- range.startContainer.previousElementSibling.classList.contains(classes.CLS_VIDEOWRAP)) {
729
- ej2_base_1.detach(range.startContainer.previousElementSibling);
730
- }
731
- }
732
- else {
733
- if (range.startContainer.nextElementSibling &&
734
- range.endContainer.textContent.length === range.endOffset &&
735
- range.startContainer.nextElementSibling.classList.contains(classes.CLS_VIDEOWRAP)) {
736
- ej2_base_1.detach(range.startContainer.nextElementSibling);
737
- }
738
- }
739
- }
740
- else if (range.startContainer.nodeType === 1 && (range.startContainer.classList &&
741
- range.startContainer.classList.contains(classes.CLS_VIDEOWRAP))) {
742
- ej2_base_1.detach(range.startContainer);
743
- }
744
- else if (range.startContainer.nodeType === 1 &&
745
- !ej2_base_1.isNullOrUndefined(range.startContainer.querySelector('.e-video-wrap')) && originalEvent.code === 'Delete') {
746
- ej2_base_1.detach(range.startContainer.querySelector('.e-video-wrap'));
747
- }
748
- }
749
- break;
750
- case 'insert-video':
751
- if (!ej2_base_1.isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
752
- save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
753
- }
754
- this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
755
- originalEvent.preventDefault();
756
- break;
757
- }
758
- if (originalEvent.ctrlKey && originalEvent.key === 'a') {
759
- this.handleSelectAll();
760
- }
761
- };
762
- Video.prototype.handleSelectAll = function () {
763
- this.cancelResizeAction();
764
- var videoFocusNodes = this.parent.inputElement.querySelectorAll('.' + classes.CLS_VID_FOCUS);
765
- ej2_base_1.removeClass(videoFocusNodes, classes.CLS_VID_FOCUS);
766
- };
767
- Video.prototype.openDialog = function (isInternal, event, selection, ele, parentEle) {
768
- var range;
769
- var save;
770
- var selectNodeEle;
771
- var selectParentEle;
772
- if (!isInternal && !ej2_base_1.isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
773
- range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
774
- save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
775
- selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
776
- selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
777
- }
778
- else {
779
- save = selection;
780
- selectNodeEle = ele;
781
- selectParentEle = parentEle;
782
- }
783
- if (this.parent.editorMode === 'HTML') {
784
- this.insertVideo({
785
- args: {
786
- item: { command: 'Videos', subCommand: 'Video' },
787
- originalEvent: event,
788
- name: !isInternal ? 'showDialog' : null
789
- },
790
- selectNode: selectNodeEle,
791
- selection: save,
792
- selectParent: selectParentEle
793
- });
794
- }
795
- };
796
- Video.prototype.showDialog = function (args) {
797
- if (!ej2_base_1.isNullOrUndefined(args.originalEvent)) {
798
- this.openDialog(false, args.originalEvent);
799
- }
800
- else {
801
- this.openDialog(false);
802
- }
803
- };
804
- Video.prototype.closeDialog = function () {
805
- if (this.dialogObj) {
806
- this.dialogObj.hide({ returnValue: true });
807
- }
808
- };
809
- Video.prototype.checkVideoBack = function (range) {
810
- if (range.startContainer.nodeName === '#text' && range.startOffset === 0 &&
811
- !ej2_base_1.isNullOrUndefined(range.startContainer.previousSibling) && (range.startContainer.previousSibling.nodeName === 'VIDEO' ||
812
- this.isEmbedVidElem(range.startContainer.previousSibling))) {
813
- this.deletedVid.push(range.startContainer.previousSibling);
814
- }
815
- else if (range.startContainer.nodeName !== '#text' && !ej2_base_1.isNullOrUndefined(range.startContainer.childNodes[range.startOffset - 1]) &&
816
- (range.startContainer.childNodes[range.startOffset - 1].nodeName === 'VIDEO' ||
817
- this.isEmbedVidElem(range.startContainer.childNodes[range.startOffset - 1]))) {
818
- this.deletedVid.push(range.startContainer.childNodes[range.startOffset - 1]);
819
- }
820
- };
821
- Video.prototype.checkVideoDel = function (range) {
822
- if (range.startContainer.nodeName === '#text' && range.startOffset === range.startContainer.textContent.length &&
823
- !ej2_base_1.isNullOrUndefined(range.startContainer.nextSibling) && (range.startContainer.nextSibling.nodeName === 'VIDEO' ||
824
- this.isEmbedVidElem(range.startContainer.nextSibling))) {
825
- this.deletedVid.push(range.startContainer.nextSibling);
826
- }
827
- else if (range.startContainer.nodeName !== '#text' && !ej2_base_1.isNullOrUndefined(range.startContainer.childNodes[range.startOffset]) &&
828
- (range.startContainer.childNodes[range.startOffset].nodeName === 'VIDEO' ||
829
- this.isEmbedVidElem(range.startContainer.childNodes[range.startOffset]))) {
830
- this.deletedVid.push(range.startContainer.childNodes[range.startOffset]);
831
- }
832
- };
833
- Video.prototype.alignmentSelect = function (e) {
834
- var item = e.item;
835
- if (!document.body.contains(document.body.querySelector('.e-rte-quick-toolbar')) || item.command !== 'Videos') {
836
- return;
837
- }
838
- var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
839
- var selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
840
- selectNodeEle = (selectNodeEle[0].nodeName === 'VIDEO') ? selectNodeEle : [this.videoEle];
841
- var args = { args: e, selectNode: selectNodeEle };
842
- if (this.parent.formatter.getUndoRedoStack().length === 0) {
843
- this.parent.formatter.saveData();
844
- }
845
- switch (item.subCommand) {
846
- case 'JustifyLeft':
847
- case 'JustifyCenter':
848
- case 'JustifyRight':
849
- this.alignVideo(args, item.subCommand);
850
- break;
851
- case 'Inline':
852
- this.inline(args);
853
- break;
854
- case 'Break':
855
- this.break(args);
856
- break;
857
- }
858
- if (this.quickToolObj && document.body.contains(this.quickToolObj.videoQTBar.element)) {
859
- this.quickToolObj.videoQTBar.hidePopup();
860
- ej2_base_1.removeClass([selectNodeEle[0]], classes.CLS_VID_FOCUS);
861
- }
862
- this.cancelResizeAction();
863
- };
864
- Video.prototype.deleteVideo = function (e, keyCode) {
865
- if (e.selectNode[0].nodeName !== 'VIDEO' && !this.isEmbedVidElem(e.selectNode[0])) {
866
- return;
867
- }
868
- if (this.isEmbedVidElem(e.selectNode[0])) {
869
- e.selectNode[0] = e.selectNode[0].classList.contains(classes.CLS_VID_CLICK_ELEM) ? e.selectNode[0] :
870
- e.selectNode[0].parentElement;
871
- }
872
- var args = {
873
- element: !this.isEmbedVidElem(e.selectNode[0]) ? e.selectNode[0].querySelector('iframe') :
874
- e.selectNode[0],
875
- src: !this.isEmbedVidElem(e.selectNode[0]) ? e.selectNode[0].querySelector('source').getAttribute('src') :
876
- e.selectNode[0].querySelector('iframe').getAttribute('src')
877
- };
878
- if (this.parent.formatter.getUndoRedoStack().length === 0) {
879
- this.parent.formatter.saveData();
880
- }
881
- e.selection.restore();
882
- this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, {
883
- selectNode: e.selectNode,
884
- subCommand: e.args.item.subCommand
885
- });
886
- this.videoRemovePost(args.src);
887
- if (this.quickToolObj && document.body.contains(this.quickToolObj.videoQTBar.element)) {
888
- this.quickToolObj.videoQTBar.hidePopup();
889
- }
890
- this.cancelResizeAction();
891
- if (ej2_base_1.isNullOrUndefined(keyCode)) {
892
- this.parent.trigger(events.afterMediaDelete, args);
893
- }
894
- };
895
- Video.prototype.videoRemovePost = function (src) {
896
- var proxy = this;
897
- var absoluteUrl = '';
898
- if (ej2_base_1.isNullOrUndefined(this.parent.insertVideoSettings.removeUrl) || this.parent.insertVideoSettings.removeUrl === '') {
899
- return;
900
- }
901
- if (src.indexOf('http://') > -1 || src.indexOf('https://') > -1) {
902
- absoluteUrl = src;
903
- }
904
- else {
905
- absoluteUrl = new URL(src, document.baseURI).href;
906
- }
907
- this.removingVideoName = absoluteUrl.replace(/^.*[\\\/]/, '');
908
- var xhr = new XMLHttpRequest();
909
- xhr.addEventListener('readystatechange', function () {
910
- if (this.readyState === 4 && this.status === 200) {
911
- proxy.triggerPost(this.response);
912
- }
913
- });
914
- xhr.open('GET', absoluteUrl);
915
- xhr.responseType = 'blob';
916
- xhr.send();
917
- };
918
- Video.prototype.triggerPost = function (response) {
919
- var removeUrl = this.parent.insertVideoSettings.removeUrl;
920
- if (ej2_base_1.isNullOrUndefined(removeUrl) || removeUrl === '') {
921
- return;
922
- }
923
- var file = new File([response], this.removingVideoName);
924
- var ajax = new ej2_base_1.Ajax(removeUrl, 'POST', true, null);
925
- var formData = new FormData();
926
- formData.append('UploadFiles', file);
927
- ajax.send(formData);
928
- };
929
- Video.prototype.onDocumentClick = function (e) {
930
- var target = e.target;
931
- if (ej2_base_1.isNullOrUndefined(this.contentModule.getEditPanel())) {
932
- return;
933
- }
934
- if (target.nodeName === 'VIDEO' || this.isEmbedVidElem(target)) {
935
- this.videoEle = !this.isEmbedVidElem(target) ? target : target.querySelector('iframe');
936
- }
937
- if (!ej2_base_1.isNullOrUndefined(this.dialogObj) && ((!ej2_base_1.closest(target, '[id=' + "'" + this.dialogObj.element.id + "'" + ']') && this.parent.toolbarSettings.enable && this.parent.getToolbarElement() &&
938
- !this.parent.getToolbarElement().contains(e.target)) ||
939
- (this.parent.getToolbarElement() && this.parent.getToolbarElement().contains(e.target) &&
940
- !ej2_base_1.closest(target, '#' + this.parent.getID() + '_toolbar_Video') &&
941
- !target.querySelector('#' + this.parent.getID() + '_toolbar_Video')))) {
942
- if (e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight) {
943
- }
944
- else {
945
- this.parent.notify(events.documentClickClosedBy, { closedBy: "outside click" });
946
- this.dialogObj.hide({ returnValue: true });
947
- this.parent.isBlur = true;
948
- util_2.dispatchEvent(this.parent.element, 'focusout');
949
- }
950
- }
951
- if (this.contentModule.getEditPanel().querySelector('.e-vid-resize')) {
952
- if (target.tagName !== 'VIDEO' && !this.isEmbedVidElem(target)) {
953
- this.removeResizeEle();
954
- }
955
- if ((target.tagName !== 'VIDEO' && !this.isEmbedVidElem(target)) && !ej2_base_1.isNullOrUndefined(this.videoEle)) {
956
- this.videoEle.style.outline = '';
957
- }
958
- else if (!ej2_base_1.isNullOrUndefined(this.prevSelectedVidEle) &&
959
- this.prevSelectedVidEle !== ((target.tagName === 'IFRAME' || target.tagName === 'VIDEO') ? target : target.querySelector('iframe'))) {
960
- this.prevSelectedVidEle.style.outline = '';
961
- }
962
- }
963
- if (this.parent.inlineMode.enable && target && this.dialogObj && !ej2_base_1.closest(target, '#' + this.dialogObj.element.id)) {
964
- this.dialogObj.hide();
965
- }
966
- };
967
- Video.prototype.removeResizeEle = function () {
968
- this.isResizeBind = true;
969
- ej2_base_1.EventHandler.remove(this.contentModule.getDocument(), ej2_base_1.Browser.touchMoveEvent, this.resizing);
970
- ej2_base_1.EventHandler.remove(this.contentModule.getDocument(), ej2_base_1.Browser.touchEndEvent, this.resizeEnd);
971
- ej2_base_1.detach(this.contentModule.getEditPanel().querySelector('.e-vid-resize'));
972
- };
973
- Video.prototype.onWindowResize = function () {
974
- if (!ej2_base_1.isNullOrUndefined(this.contentModule) && !ej2_base_1.isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.e-vid-resize'))) {
975
- this.cancelResizeAction();
976
- }
977
- };
978
- Video.prototype.break = function (e) {
979
- if (e.selectNode[0].nodeName !== 'VIDEO' && !this.isEmbedVidElem(e.selectNode[0])) {
980
- return;
981
- }
982
- var subCommand = (e.args.item) ?
983
- e.args.item.subCommand : 'Break';
984
- this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
985
- };
986
- Video.prototype.inline = function (e) {
987
- if (e.selectNode[0].nodeName !== 'VIDEO' && !this.isEmbedVidElem(e.selectNode[0])) {
988
- return;
989
- }
990
- var subCommand = (e.args.item) ?
991
- e.args.item.subCommand : 'Inline';
992
- this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
993
- };
994
- Video.prototype.alignVideo = function (e, type) {
995
- var subCommand = (e.args.item) ?
996
- e.args.item.subCommand : type;
997
- this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
998
- };
999
- Video.prototype.editAreaClickHandler = function (e) {
1000
- if (this.parent.readonly) {
1001
- this.hideVideoQuickToolbar();
1002
- return;
1003
- }
1004
- var args = e.args;
1005
- var showOnRightClick = this.parent.quickToolbarSettings.showOnRightClick;
1006
- if (args.which === 2 || (showOnRightClick && args.which === 1) || (!showOnRightClick && args.which === 3)) {
1007
- if ((showOnRightClick && args.which === 1) && !ej2_base_1.isNullOrUndefined(args.target) &&
1008
- (args.target.tagName === 'VIDEO' || this.isEmbedVidElem(args.target))) {
1009
- this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
1010
- this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(), args.target);
1011
- }
1012
- return;
1013
- }
1014
- if (this.parent.editorMode === 'HTML' && this.parent.quickToolbarModule && this.parent.quickToolbarModule.videoQTBar) {
1015
- this.quickToolObj = this.parent.quickToolbarModule;
1016
- var target = args.target;
1017
- this.contentModule = this.rendererFactory.getRenderer(enum_1.RenderType.Content);
1018
- var isPopupOpen = this.quickToolObj.videoQTBar.element.classList.contains('e-rte-pop');
1019
- if ((target.nodeName === 'VIDEO' || this.isEmbedVidElem(target)) && this.parent.quickToolbarModule) {
1020
- if (isPopupOpen) {
1021
- return;
1022
- }
1023
- this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
1024
- this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(), target);
1025
- if (util_1.isIDevice()) {
1026
- this.parent.notify(events.selectionSave, e);
1027
- }
1028
- ej2_base_1.addClass([!this.isEmbedVidElem(target) ? target : target.querySelector('iframe')], classes.CLS_VID_FOCUS);
1029
- this.showVideoQuickToolbar({ args: args, type: 'Videos', elements: [args.target] });
1030
- }
1031
- else {
1032
- this.hideVideoQuickToolbar();
1033
- }
1034
- }
1035
- };
1036
- Video.prototype.showVideoQuickToolbar = function (e) {
1037
- var _this = this;
1038
- if (e.type !== 'Videos' || (!ej2_base_1.isNullOrUndefined(e.args) && e.args.detail === 2) || ej2_base_1.isNullOrUndefined(this.parent.quickToolbarModule)
1039
- || ej2_base_1.isNullOrUndefined(this.parent.quickToolbarModule.videoQTBar) || ej2_base_1.isNullOrUndefined(e.args)) {
1040
- return;
1041
- }
1042
- this.quickToolObj = this.parent.quickToolbarModule;
1043
- var args = e.args;
1044
- var target = e.elements;
1045
- [].forEach.call(e.elements, function (element, index) {
1046
- if (index === 0) {
1047
- target = element;
1048
- }
1049
- });
1050
- if (target.tagName === 'VIDEO' || this.isEmbedVidElem(target)) {
1051
- ej2_base_1.addClass([(!this.isEmbedVidElem(target) || target.tagName === 'IFRAME') ? target : target.querySelector('iframe')], [classes.CLS_VID_FOCUS]);
1052
- }
1053
- var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
1054
- this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
1055
- if (this.parent.quickToolbarModule.videoQTBar) {
1056
- if (e.isNotify) {
1057
- this.showPopupTime = setTimeout(function () {
1058
- _this.parent.formatter.editorManager.nodeSelection.Clear(_this.contentModule.getDocument());
1059
- _this.parent.formatter.editorManager.nodeSelection.setSelectionContents(_this.contentModule.getDocument(), target);
1060
- _this.quickToolObj.videoQTBar.showPopup(args.pageX - 50, pageY + (target.getBoundingClientRect().height / 2) - target.offsetTop, target);
1061
- if (_this.parent.insertVideoSettings.resize === true) {
1062
- _this.resizeStart(e.args, target);
1063
- }
1064
- }, 400);
1065
- }
1066
- else {
1067
- this.quickToolObj.videoQTBar.showPopup(args.pageX - 50, pageY + (target.getBoundingClientRect().height / 2) - target.offsetTop, target);
1068
- }
1069
- }
1070
- };
1071
- Video.prototype.hideVideoQuickToolbar = function () {
1072
- if (!ej2_base_1.isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.' + classes.CLS_VID_FOCUS))) {
1073
- ej2_base_1.removeClass([this.contentModule.getEditPanel().querySelector('.' + classes.CLS_VID_FOCUS)], classes.CLS_VID_FOCUS);
1074
- if (!ej2_base_1.isNullOrUndefined(this.videoEle)) {
1075
- this.videoEle.style.outline = '';
1076
- }
1077
- if (!ej2_base_1.isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.e-vid-resize'))) {
1078
- ej2_base_1.detach(this.contentModule.getEditPanel().querySelector('.e-vid-resize'));
1079
- }
1080
- if (this.quickToolObj && this.quickToolObj.videoQTBar && document.body.contains(this.quickToolObj.videoQTBar.element)) {
1081
- this.quickToolObj.videoQTBar.hidePopup();
1082
- }
1083
- }
1084
- };
1085
- Video.prototype.isEmbedVidElem = function (target) {
1086
- if ((target && target.nodeType !== 3 && target.nodeName !== 'BR' && (target.classList && (target.classList.contains(classes.CLS_VIDEOWRAP) || target.classList.contains(classes.CLS_VID_CLICK_ELEM) ||
1087
- target.classList.contains('e-embed-video-wrap')))) || (target && target.nodeName === 'IFRAME')) {
1088
- return true;
1089
- }
1090
- else {
1091
- return false;
1092
- }
1093
- };
1094
- Video.prototype.insertingVideo = function (e) {
1095
- this.insertVideo(e);
1096
- if (!ej2_base_1.isNullOrUndefined(this.dialogObj)) {
1097
- this.dialogObj.element.style.maxHeight = 'inherit';
1098
- var dialogContent = this.dialogObj.element.querySelector('.e-video-content');
1099
- if (!ej2_base_1.isNullOrUndefined(this.parent.insertVideoSettings.path) || this.parent.editorMode === 'HTML') {
1100
- document.getElementById(this.rteID + '_insertVideo').focus();
1101
- }
1102
- else {
1103
- dialogContent.querySelector('.e-video-url').focus();
1104
- }
1105
- }
1106
- };
1107
- Video.prototype.insertVideo = function (e) {
1108
- var _this = this;
1109
- if (this.dialogObj) {
1110
- this.dialogObj.hide({ returnValue: true });
1111
- return;
1112
- }
1113
- var videoDialog = this.parent.createElement('div', { className: 'e-rte-video-dialog', id: this.rteID + '_video' });
1114
- this.parent.rootContainer.appendChild(videoDialog);
1115
- var videoInsert = this.i10n.getConstant('dialogInsert');
1116
- var videolinkCancel = this.i10n.getConstant('dialogCancel');
1117
- var videoHeader = this.i10n.getConstant('videoHeader');
1118
- var selection = e.selection;
1119
- var selectObj = { selfVideo: this, selection: e.selection, args: e.args, selectParent: e.selectParent };
1120
- var dialogModel = {
1121
- header: videoHeader,
1122
- cssClass: classes.CLS_RTE_ELEMENTS,
1123
- enableRtl: this.parent.enableRtl,
1124
- locale: this.parent.locale,
1125
- showCloseIcon: true, closeOnEscape: true, width: (ej2_base_1.Browser.isDevice) ? '290px' : '340px',
1126
- isModal: ej2_base_1.Browser.isDevice,
1127
- buttons: [{
1128
- click: this.insertVideoUrl.bind(selectObj),
1129
- buttonModel: { content: videoInsert, cssClass: 'e-flat e-insertVideo', isPrimary: true, disabled: true }
1130
- },
1131
- {
1132
- click: function (e) {
1133
- _this.cancelDialog(e);
1134
- },
1135
- buttonModel: { cssClass: 'e-flat e-cancel', content: videolinkCancel }
1136
- }],
1137
- target: (ej2_base_1.Browser.isDevice) ? document.body : this.parent.element,
1138
- animationSettings: { effect: 'None' },
1139
- close: function (event) {
1140
- if (_this.isVideoUploaded) {
1141
- if (_this.dialogObj.element.querySelector('.e-file-abort-btn')) {
1142
- _this.dialogObj.element.querySelector('.e-file-abort-btn').click();
1143
- }
1144
- else {
1145
- _this.uploadObj.remove();
1146
- }
1147
- }
1148
- _this.parent.isBlur = false;
1149
- if (event && !ej2_base_1.isNullOrUndefined(event.event) && event.event.returnValue) {
1150
- if (_this.parent.editorMode === 'HTML') {
1151
- selection.restore();
1152
- }
1153
- }
1154
- _this.clearDialogObj();
1155
- _this.dialogRenderObj.close(event);
1156
- }
1157
- };
1158
- var dialogContent = this.parent.createElement('div', { className: 'e-video-content' });
1159
- if (!ej2_base_1.isNullOrUndefined(this.parent.insertVideoSettings.path) || this.parent.editorMode === 'HTML') {
1160
- dialogContent.appendChild(this.videoUpload(e));
1161
- }
1162
- var linkHeader = this.parent.createElement('div', { className: 'e-videoheader' });
1163
- var embedLinkHeader = this.parent.createElement('div', { className: 'e-embed-videoheader' });
1164
- var linkHeaderText = this.i10n.getConstant('videoLinkHeader');
1165
- var embedLinkHeaderText = this.i10n.getConstant('embedVideoLinkHeader');
1166
- if (this.parent.editorMode === 'HTML') {
1167
- linkHeader.innerHTML = linkHeaderText;
1168
- embedLinkHeader.innerHTML = embedLinkHeaderText;
1169
- }
1170
- dialogContent.appendChild(this.urlPopup(e));
1171
- if (e.selectNode && e.selectNode[0].nodeType === 1 && (e.selectNode[0].tagName === 'VIDEO' || this.isEmbedVidElem(e.selectNode[0]))) {
1172
- dialogModel.header = this.parent.localeObj.getConstant('editVideoHeader');
1173
- dialogModel.content = dialogContent;
1174
- }
1175
- else {
1176
- dialogModel.content = dialogContent;
1177
- }
1178
- this.dialogObj = this.dialogRenderObj.render(dialogModel);
1179
- this.dialogObj.createElement = this.parent.createElement;
1180
- this.dialogObj.appendTo(videoDialog);
1181
- if (e.selectNode && e.selectNode[0].nodeType === 1 && (e.selectNode[0].tagName === 'VIDEO' || this.isEmbedVidElem(e.selectNode[0]))
1182
- && (e.name === 'insertVideo')) {
1183
- this.dialogObj.element.querySelector('.e-insertVideo').textContent = this.parent.localeObj.getConstant('dialogUpdate');
1184
- }
1185
- videoDialog.style.maxHeight = 'inherit';
1186
- if (this.quickToolObj) {
1187
- if (this.quickToolObj.videoQTBar && document.body.contains(this.quickToolObj.videoQTBar.element)) {
1188
- this.quickToolObj.videoQTBar.hidePopup();
1189
- if (!ej2_base_1.isNullOrUndefined(e.selectParent)) {
1190
- ej2_base_1.removeClass([e.selectParent[0]], classes.CLS_VID_FOCUS);
1191
- }
1192
- }
1193
- if (this.quickToolObj.inlineQTBar && document.body.contains(this.quickToolObj.inlineQTBar.element)) {
1194
- this.quickToolObj.inlineQTBar.hidePopup();
1195
- }
1196
- if (this.quickToolObj.textQTBar && this.parent.element.ownerDocument.body.contains(this.quickToolObj.textQTBar.element)) {
1197
- this.quickToolObj.textQTBar.hidePopup();
1198
- }
1199
- }
1200
- };
1201
- Video.prototype.urlPopup = function (e) {
1202
- var _this = this;
1203
- var videoUrl = this.parent.createElement('div', { className: 'e-video-url-wrap' });
1204
- var urlContent = this.parent.createElement('div', { id: 'urlcontent' });
1205
- var placeUrl = this.i10n.getConstant('videoUrl');
1206
- var content = '<input id="embedURL" type="radio">' + '<input id="webURL" type="radio" >';
1207
- var contentElem = util_2.parseHtml(content);
1208
- videoUrl.appendChild(contentElem);
1209
- videoUrl.appendChild(urlContent);
1210
- this.embedInputUrl = this.parent.createElement('textarea', {
1211
- className: 'e-input e-embed-video-url',
1212
- attrs: { placeholder: this.i10n.getConstant('pasteEmbeddedCodeHere'), type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
1213
- });
1214
- this.embedInputUrl.addEventListener('input', function () {
1215
- if (!ej2_base_1.isNullOrUndefined(_this.embedInputUrl)) {
1216
- if (_this.embedInputUrl.value.length === 0) {
1217
- _this.dialogObj.getButtons(0).element.disabled = true;
1218
- }
1219
- else {
1220
- _this.dialogObj.getButtons(0).element.removeAttribute('disabled');
1221
- }
1222
- }
1223
- });
1224
- this.inputUrl = this.parent.createElement('input', {
1225
- className: 'e-input e-video-url',
1226
- attrs: { placeholder: placeUrl, spellcheck: 'false' }
1227
- });
1228
- this.inputUrl.addEventListener('input', function () {
1229
- if (!ej2_base_1.isNullOrUndefined(_this.inputUrl)) {
1230
- if (_this.inputUrl.value.length === 0) {
1231
- _this.dialogObj.getButtons(0).element.disabled = true;
1232
- }
1233
- else {
1234
- _this.dialogObj.getButtons(0).element.removeAttribute('disabled');
1235
- }
1236
- }
1237
- });
1238
- if (e.selectNode && e.selectNode[0] && (e.selectNode[0].nodeName === 'VIDEO' || this.isEmbedVidElem(e.selectNode[0]))) {
1239
- if (e.selectNode[0].nodeName === 'VIDEO' || e.selectNode[0].classList.contains('e-video-wrap')) {
1240
- var regex = new RegExp(/([^\S]|^)(((https?:\/\/)|(www\.))(\S+))/gi);
1241
- var sourceElement = e.selectNode[0].querySelector('source');
1242
- this.inputUrl.value = sourceElement && sourceElement.src && sourceElement.src.match(regex) ? sourceElement.src : '';
1243
- }
1244
- else {
1245
- this.embedInputUrl.value = e.selectNode[0].nodeName === 'IFRAME' ? e.selectNode[0].outerHTML
1246
- : e.selectNode[0].querySelector('iframe').outerHTML;
1247
- }
1248
- }
1249
- var isWebUrl = this.inputUrl.value ? true : false;
1250
- this.embedUrlBtn = new ej2_buttons_1.RadioButton({
1251
- label: this.i10n.getConstant('embeddedCode'),
1252
- checked: !isWebUrl,
1253
- name: 'URL',
1254
- created: function () {
1255
- if (!isWebUrl) {
1256
- urlContent.appendChild(_this.embedInputUrl);
1257
- }
1258
- },
1259
- change: function () {
1260
- urlContent.innerHTML = '';
1261
- urlContent.appendChild(_this.embedInputUrl);
1262
- }
1263
- });
1264
- this.embedUrlBtn.appendTo(videoUrl.querySelector('#embedURL'));
1265
- this.webUrlBtn = new ej2_buttons_1.RadioButton({
1266
- label: this.i10n.getConstant('webUrl'),
1267
- checked: isWebUrl,
1268
- name: 'URL',
1269
- created: function () {
1270
- if (isWebUrl) {
1271
- urlContent.appendChild(_this.inputUrl);
1272
- }
1273
- },
1274
- change: function () {
1275
- urlContent.innerHTML = '';
1276
- urlContent.appendChild(_this.inputUrl);
1277
- }
1278
- });
1279
- this.webUrlBtn.appendTo(videoUrl.querySelector('#webURL'));
1280
- return videoUrl;
1281
- };
1282
- Video.prototype.videoUpload = function (e) {
1283
- var _this = this;
1284
- var save;
1285
- var selectParent;
1286
- var proxy = this;
1287
- var iframe = proxy.parent.iframeSettings.enable;
1288
- if (proxy.parent.editorMode === 'HTML' && (!iframe && ej2_base_1.isNullOrUndefined(ej2_base_1.closest(e.selection.range.startContainer.parentNode, '[id='
1289
- + "'" + this.parent.contentModule.getPanel().id + "'" + ']'))
1290
- || (iframe && !util_2.hasClass(e.selection.range.startContainer.parentNode.ownerDocument.querySelector('body'), 'e-lib')))) {
1291
- this.contentModule.getEditPanel().focus();
1292
- var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
1293
- save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
1294
- selectParent = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
1295
- }
1296
- else {
1297
- save = e.selection;
1298
- selectParent = e.selectParent;
1299
- }
1300
- var uploadParentEle = this.parent.createElement('div', { className: 'e-vid-uploadwrap e-droparea' });
1301
- var deviceVideoUpMsg = this.i10n.getConstant('videoDeviceUploadMessage');
1302
- var videoUpMsg = this.i10n.getConstant('videoUploadMessage');
1303
- var span = this.parent.createElement('span', { className: 'e-droptext' });
1304
- var spanMsg = this.parent.createElement('span', {
1305
- className: 'e-rte-upload-text', innerHTML: ((ej2_base_1.Browser.isDevice) ? deviceVideoUpMsg : videoUpMsg)
1306
- });
1307
- span.appendChild(spanMsg);
1308
- var btnEle = this.parent.createElement('button', {
1309
- className: 'e-browsebtn', id: this.rteID + '_insertVideo', attrs: { autofocus: 'true', type: 'button' }
1310
- });
1311
- span.appendChild(btnEle);
1312
- uploadParentEle.appendChild(span);
1313
- var browserMsg = this.i10n.getConstant('browse');
1314
- this.button = new ej2_buttons_1.Button({ content: browserMsg, enableRtl: this.parent.enableRtl });
1315
- this.button.isStringTemplate = true;
1316
- this.button.createElement = this.parent.createElement;
1317
- this.button.appendTo(btnEle);
1318
- var btnClick = (ej2_base_1.Browser.isDevice) ? span : btnEle;
1319
- ej2_base_1.EventHandler.add(btnClick, 'click', this.fileSelect, this);
1320
- var uploadEle = this.parent.createElement('input', {
1321
- id: this.rteID + '_upload', attrs: { type: 'File', name: 'UploadFiles' }
1322
- });
1323
- uploadParentEle.appendChild(uploadEle);
1324
- var fileName;
1325
- var selectArgs;
1326
- var filesData;
1327
- this.uploadObj = new ej2_inputs_1.Uploader({
1328
- asyncSettings: { saveUrl: this.parent.insertVideoSettings.saveUrl, removeUrl: this.parent.insertVideoSettings.removeUrl },
1329
- dropArea: span, multiple: false, enableRtl: this.parent.enableRtl,
1330
- allowedExtensions: this.parent.insertVideoSettings.allowedTypes.toString(),
1331
- selected: function (e) {
1332
- proxy.isVideoUploaded = true;
1333
- selectArgs = e;
1334
- filesData = e.filesData;
1335
- _this.parent.trigger(events.fileSelected, selectArgs, function (selectArgs) {
1336
- if (!selectArgs.cancel) {
1337
- if (ej2_base_1.isNullOrUndefined(selectArgs.filesData[0])) {
1338
- return;
1339
- }
1340
- _this.checkExtension(selectArgs.filesData[0]);
1341
- fileName = selectArgs.filesData[0].name;
1342
- if (_this.parent.editorMode === 'HTML' && ej2_base_1.isNullOrUndefined(_this.parent.insertVideoSettings.path)) {
1343
- var reader_1 = new FileReader();
1344
- reader_1.addEventListener('load', function (e) {
1345
- var url = _this.parent.insertVideoSettings.saveFormat === 'Base64' ? reader_1.result :
1346
- URL.createObjectURL(util_2.convertToBlob(reader_1.result));
1347
- proxy.uploadUrl = {
1348
- url: url, selection: save, fileName: fileName,
1349
- selectParent: selectParent
1350
- };
1351
- proxy.inputUrl.setAttribute('disabled', 'true');
1352
- proxy.embedInputUrl.setAttribute('disabled', 'true');
1353
- if (ej2_base_1.isNullOrUndefined(proxy.parent.insertVideoSettings.saveUrl) && _this.isAllowedTypes
1354
- && !ej2_base_1.isNullOrUndefined(_this.dialogObj)) {
1355
- _this.dialogObj.getButtons(0).element.removeAttribute('disabled');
1356
- }
1357
- });
1358
- reader_1.readAsDataURL(selectArgs.filesData[0].rawFile);
1359
- }
1360
- }
1361
- });
1362
- },
1363
- beforeUpload: function (args) {
1364
- _this.parent.trigger(events.beforeFileUpload, args);
1365
- },
1366
- uploading: function (e) {
1367
- if (!_this.parent.isServerRendered) {
1368
- _this.parent.trigger(events.fileUploading, e);
1369
- }
1370
- },
1371
- success: function (e) {
1372
- _this.parent.trigger(events.fileUploadSuccess, e, function (e) {
1373
- if (!ej2_base_1.isNullOrUndefined(_this.parent.insertVideoSettings.path)) {
1374
- var url = _this.parent.insertVideoSettings.path + e.file.name;
1375
- var value = { url: url, selection: save };
1376
- proxy.uploadUrl = {
1377
- url: url, selection: save, fileName: fileName, selectParent: selectParent,
1378
- width: {
1379
- width: proxy.parent.insertVideoSettings.width, minWidth: proxy.parent.insertVideoSettings.minWidth,
1380
- maxWidth: proxy.parent.getInsertImgMaxWidth()
1381
- },
1382
- height: {
1383
- height: proxy.parent.insertVideoSettings.height, minHeight: proxy.parent.insertVideoSettings.minHeight,
1384
- maxHeight: proxy.parent.insertVideoSettings.maxHeight
1385
- }
1386
- };
1387
- proxy.embedInputUrl.setAttribute('disabled', 'true');
1388
- }
1389
- if (e.operation === 'upload' && !ej2_base_1.isNullOrUndefined(_this.dialogObj)) {
1390
- _this.dialogObj.getButtons(0).element.removeAttribute('disabled');
1391
- }
1392
- });
1393
- },
1394
- failure: function (e) {
1395
- _this.parent.trigger(events.fileUploadFailed, e);
1396
- },
1397
- removing: function () {
1398
- _this.parent.trigger(events.fileRemoving, e, function (e) {
1399
- proxy.isVideoUploaded = false;
1400
- _this.dialogObj.getButtons(0).element.disabled = true;
1401
- if (proxy.inputUrl.getAttribute('disabled')) {
1402
- proxy.inputUrl.removeAttribute('disabled');
1403
- }
1404
- if (proxy.embedInputUrl.getAttribute('disabled')) {
1405
- proxy.embedInputUrl.removeAttribute('disabled');
1406
- }
1407
- if (proxy.uploadUrl) {
1408
- proxy.uploadUrl.url = '';
1409
- }
1410
- });
1411
- }
1412
- });
1413
- this.uploadObj.isStringTemplate = true;
1414
- this.uploadObj.createElement = this.parent.createElement;
1415
- this.uploadObj.appendTo(uploadEle);
1416
- return uploadParentEle;
1417
- };
1418
- Video.prototype.checkExtension = function (e) {
1419
- if (this.uploadObj.allowedExtensions) {
1420
- if (this.uploadObj.allowedExtensions.toLocaleLowerCase().indexOf(('.' + e.type).toLocaleLowerCase()) === -1) {
1421
- this.dialogObj.getButtons(0).element.setAttribute('disabled', 'disabled');
1422
- this.isAllowedTypes = false;
1423
- }
1424
- else {
1425
- this.isAllowedTypes = true;
1426
- }
1427
- }
1428
- };
1429
- Video.prototype.fileSelect = function () {
1430
- this.dialogObj.element.getElementsByClassName('e-file-select-wrap')[0].querySelector('button').click();
1431
- return false;
1432
- };
1433
- Video.prototype.cancelDialog = function (e) {
1434
- this.parent.isBlur = false;
1435
- this.dialogObj.hide({ returnValue: true });
1436
- if (this.isVideoUploaded) {
1437
- this.uploadObj.removing();
1438
- }
1439
- };
1440
- Video.prototype.insertVideoUrl = function (e) {
1441
- var proxy = this.selfVideo;
1442
- proxy.isVideoUploaded = false;
1443
- var url = proxy.inputUrl.value;
1444
- var embedUrl = proxy.embedInputUrl.value;
1445
- if (proxy.parent.formatter.getUndoRedoStack().length === 0) {
1446
- proxy.parent.formatter.saveData();
1447
- }
1448
- if (!ej2_base_1.isNullOrUndefined(proxy.uploadUrl) && proxy.uploadUrl.url !== '') {
1449
- proxy.uploadUrl.cssClass = (proxy.parent.insertVideoSettings.layoutOption === 'Inline' ?
1450
- classes.CLS_VIDEOINLINE : classes.CLS_VIDEOBREAK);
1451
- proxy.uploadUrl.width = {
1452
- width: proxy.parent.insertVideoSettings.width, minWidth: proxy.parent.insertVideoSettings.minWidth,
1453
- maxWidth: proxy.parent.getInsertImgMaxWidth()
1454
- };
1455
- proxy.uploadUrl.height = {
1456
- height: proxy.parent.insertVideoSettings.height, minHeight: proxy.parent.insertVideoSettings.minHeight,
1457
- maxHeight: proxy.parent.insertVideoSettings.maxHeight
1458
- };
1459
- proxy.dialogObj.hide({ returnValue: false });
1460
- if (proxy.dialogObj !== null) {
1461
- return;
1462
- }
1463
- proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, proxy.uploadUrl);
1464
- proxy.uploadUrl.url = '';
1465
- }
1466
- else if (proxy.parent.editorMode === 'HTML' && (url !== '' || embedUrl !== '')) {
1467
- var webUrlBtn = document.getElementById('webURL');
1468
- var name_1 = webUrlBtn.checked ? url.split('/')[url.split('/').length - 1] : embedUrl;
1469
- var value = {
1470
- cssClass: (proxy.parent.insertVideoSettings.layoutOption === 'Inline' ? classes.CLS_VIDEOINLINE : classes.CLS_VIDEOBREAK),
1471
- url: url, selection: this.selection, fileName: name_1, isEmbedUrl: !webUrlBtn.checked,
1472
- selectParent: this.selectParent, width: {
1473
- width: proxy.parent.insertVideoSettings.width, minWidth: proxy.parent.insertVideoSettings.minWidth,
1474
- maxWidth: proxy.parent.getInsertImgMaxWidth()
1475
- },
1476
- height: {
1477
- height: proxy.parent.insertVideoSettings.height, minHeight: proxy.parent.insertVideoSettings.minHeight,
1478
- maxHeight: proxy.parent.insertVideoSettings.maxHeight
1479
- }
1480
- };
1481
- proxy.dialogObj.hide({ returnValue: false });
1482
- if (proxy.dialogObj !== null) {
1483
- return;
1484
- }
1485
- proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, value);
1486
- }
1487
- };
1488
- Video.prototype.destroy = function () {
1489
- if (this.isDestroyed) {
1490
- return;
1491
- }
1492
- this.prevSelectedVidEle = undefined;
1493
- this.removeEventListener();
1494
- if (this.showPopupTime) {
1495
- clearTimeout(this.showPopupTime);
1496
- this.showPopupTime = null;
1497
- }
1498
- this.clearDialogObj();
1499
- this.isDestroyed = true;
1500
- };
1501
- Video.prototype.getModuleName = function () {
1502
- return 'video';
1503
- };
1504
- return Video;
1505
- }());
1506
- exports.Video = Video;
1507
- });