bedrock_sass 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (466) hide show
  1. checksums.yaml +4 -4
  2. data/assets/_vendor/ace/ace.js +255 -589
  3. data/assets/_vendor/ace/ext-beautify.js +1 -2
  4. data/assets/_vendor/ace/ext-elastic_tabstops_lite.js +2 -2
  5. data/assets/_vendor/ace/ext-emmet.js +4 -4
  6. data/assets/_vendor/ace/ext-error_marker.js +1 -2
  7. data/assets/_vendor/ace/ext-keybinding_menu.js +1 -2
  8. data/assets/_vendor/ace/ext-language_tools.js +5 -9
  9. data/assets/_vendor/ace/ext-linking.js +1 -2
  10. data/assets/_vendor/ace/ext-modelist.js +9 -5
  11. data/assets/_vendor/ace/ext-options.js +10 -7
  12. data/assets/_vendor/ace/ext-rtl.js +1 -2
  13. data/assets/_vendor/ace/ext-searchbox.js +8 -4
  14. data/assets/_vendor/ace/ext-settings_menu.js +10 -7
  15. data/assets/_vendor/ace/ext-spellcheck.js +1 -2
  16. data/assets/_vendor/ace/ext-split.js +1 -2
  17. data/assets/_vendor/ace/ext-static_highlight.js +11 -8
  18. data/assets/_vendor/ace/ext-statusbar.js +1 -2
  19. data/assets/_vendor/ace/ext-textarea.js +1 -5
  20. data/assets/_vendor/ace/ext-themelist.js +2 -4
  21. data/assets/_vendor/ace/ext-whitespace.js +1 -2
  22. data/assets/_vendor/ace/keybinding-emacs.js +6 -2
  23. data/assets/_vendor/ace/keybinding-vim.js +13 -25
  24. data/assets/_vendor/ace/mode-abap.js +2 -3
  25. data/assets/_vendor/ace/mode-abc.js +3 -2
  26. data/assets/_vendor/ace/mode-actionscript.js +2 -2
  27. data/assets/_vendor/ace/mode-ada.js +1 -2
  28. data/assets/_vendor/ace/mode-apache_conf.js +2 -2
  29. data/assets/_vendor/ace/mode-apex.js +457 -0
  30. data/assets/_vendor/ace/mode-applescript.js +1 -2
  31. data/assets/_vendor/ace/mode-asciidoc.js +2 -2
  32. data/assets/_vendor/ace/mode-asl.js +1 -2
  33. data/assets/_vendor/ace/mode-assembly_x86.js +2 -2
  34. data/assets/_vendor/ace/mode-autohotkey.js +1 -2
  35. data/assets/_vendor/ace/mode-batchfile.js +2 -2
  36. data/assets/_vendor/ace/mode-bro.js +2 -2
  37. data/assets/_vendor/ace/mode-c9search.js +1 -2
  38. data/assets/_vendor/ace/mode-c_cpp.js +2 -2
  39. data/assets/_vendor/ace/mode-cirru.js +1 -2
  40. data/assets/_vendor/ace/mode-clojure.js +2 -2
  41. data/assets/_vendor/ace/mode-cobol.js +1 -2
  42. data/assets/_vendor/ace/mode-coffee.js +1 -2
  43. data/assets/_vendor/ace/mode-coldfusion.js +3 -2
  44. data/assets/_vendor/ace/mode-csharp.js +3 -3
  45. data/assets/_vendor/ace/mode-csound_document.js +319 -80
  46. data/assets/_vendor/ace/mode-csound_orchestra.js +323 -86
  47. data/assets/_vendor/ace/mode-csound_score.js +1 -2
  48. data/assets/_vendor/ace/mode-csp.js +1 -2
  49. data/assets/_vendor/ace/mode-css.js +2 -2
  50. data/assets/_vendor/ace/mode-curly.js +3 -2
  51. data/assets/_vendor/ace/mode-d.js +2 -2
  52. data/assets/_vendor/ace/mode-dart.js +24 -14
  53. data/assets/_vendor/ace/mode-diff.js +4 -4
  54. data/assets/_vendor/ace/mode-django.js +3 -2
  55. data/assets/_vendor/ace/mode-dockerfile.js +3 -2
  56. data/assets/_vendor/ace/mode-dot.js +1 -2
  57. data/assets/_vendor/ace/mode-drools.js +3 -2
  58. data/assets/_vendor/ace/mode-edifact.js +2 -2
  59. data/assets/_vendor/ace/mode-eiffel.js +1 -2
  60. data/assets/_vendor/ace/mode-ejs.js +5 -2
  61. data/assets/_vendor/ace/mode-elixir.js +2 -2
  62. data/assets/_vendor/ace/mode-elm.js +1 -2
  63. data/assets/_vendor/ace/mode-erlang.js +2 -2
  64. data/assets/_vendor/ace/mode-forth.js +2 -2
  65. data/assets/_vendor/ace/mode-fortran.js +1 -2
  66. data/assets/_vendor/ace/mode-fsharp.js +1 -2
  67. data/assets/_vendor/ace/mode-fsl.js +258 -0
  68. data/assets/_vendor/ace/mode-ftl.js +3 -2
  69. data/assets/_vendor/ace/mode-gcode.js +1 -2
  70. data/assets/_vendor/ace/mode-gherkin.js +2 -4
  71. data/assets/_vendor/ace/mode-gitignore.js +1 -2
  72. data/assets/_vendor/ace/mode-glsl.js +2 -2
  73. data/assets/_vendor/ace/mode-gobstones.js +3 -2
  74. data/assets/_vendor/ace/mode-golang.js +1 -2
  75. data/assets/_vendor/ace/mode-graphqlschema.js +1 -2
  76. data/assets/_vendor/ace/mode-groovy.js +4 -2
  77. data/assets/_vendor/ace/mode-haml.js +5 -2
  78. data/assets/_vendor/ace/mode-handlebars.js +3 -2
  79. data/assets/_vendor/ace/mode-haskell.js +2 -2
  80. data/assets/_vendor/ace/mode-haskell_cabal.js +1 -2
  81. data/assets/_vendor/ace/mode-haxe.js +2 -2
  82. data/assets/_vendor/ace/mode-hjson.js +2 -2
  83. data/assets/_vendor/ace/mode-html.js +3 -2
  84. data/assets/_vendor/ace/mode-html_elixir.js +4 -2
  85. data/assets/_vendor/ace/mode-html_ruby.js +5 -2
  86. data/assets/_vendor/ace/mode-ini.js +1 -2
  87. data/assets/_vendor/ace/mode-io.js +2 -2
  88. data/assets/_vendor/ace/mode-jack.js +1 -2
  89. data/assets/_vendor/ace/mode-jade.js +14 -115
  90. data/assets/_vendor/ace/mode-java.js +64 -3
  91. data/assets/_vendor/ace/mode-javascript.js +2 -2
  92. data/assets/_vendor/ace/mode-json.js +1 -2
  93. data/assets/_vendor/ace/mode-jsoniq.js +8 -2317
  94. data/assets/_vendor/ace/mode-jsp.js +4 -2
  95. data/assets/_vendor/ace/mode-jssm.js +2 -2
  96. data/assets/_vendor/ace/mode-jsx.js +1 -2
  97. data/assets/_vendor/ace/mode-julia.js +2 -2
  98. data/assets/_vendor/ace/mode-kotlin.js +2 -2
  99. data/assets/_vendor/ace/mode-latex.js +1 -2
  100. data/assets/_vendor/ace/mode-less.js +4 -2
  101. data/assets/_vendor/ace/mode-liquid.js +2026 -477
  102. data/assets/_vendor/ace/mode-lisp.js +2 -2
  103. data/assets/_vendor/ace/mode-livescript.js +1 -2
  104. data/assets/_vendor/ace/mode-logiql.js +2 -2
  105. data/assets/_vendor/ace/mode-logtalk.js +352 -0
  106. data/assets/_vendor/ace/mode-lsl.js +1 -2
  107. data/assets/_vendor/ace/mode-lua.js +1 -2
  108. data/assets/_vendor/ace/mode-luapage.js +3 -2
  109. data/assets/_vendor/ace/mode-lucene.js +2 -3
  110. data/assets/_vendor/ace/mode-makefile.js +3 -2
  111. data/assets/_vendor/ace/mode-markdown.js +5 -2
  112. data/assets/_vendor/ace/mode-mask.js +3 -2
  113. data/assets/_vendor/ace/mode-matlab.js +1 -2
  114. data/assets/_vendor/ace/mode-maze.js +2 -2
  115. data/assets/_vendor/ace/mode-mel.js +2 -2
  116. data/assets/_vendor/ace/mode-mixal.js +1 -2
  117. data/assets/_vendor/ace/mode-mushcode.js +2 -2
  118. data/assets/_vendor/ace/mode-mysql.js +3 -4
  119. data/assets/_vendor/ace/mode-nix.js +2 -2
  120. data/assets/_vendor/ace/mode-nsis.js +2 -2
  121. data/assets/_vendor/ace/mode-objectivec.js +3 -2
  122. data/assets/_vendor/ace/mode-ocaml.js +1 -2
  123. data/assets/_vendor/ace/mode-pascal.js +2 -2
  124. data/assets/_vendor/ace/mode-perl.js +2 -2
  125. data/assets/_vendor/ace/mode-perl6.js +593 -0
  126. data/assets/_vendor/ace/mode-pgsql.js +304 -69
  127. data/assets/_vendor/ace/mode-php.js +844 -1029
  128. data/assets/_vendor/ace/mode-php_laravel_blade.js +844 -1029
  129. data/assets/_vendor/ace/mode-pig.js +2 -2
  130. data/assets/_vendor/ace/mode-plain_text.js +1 -2
  131. data/assets/_vendor/ace/mode-powershell.js +2 -2
  132. data/assets/_vendor/ace/mode-praat.js +2 -2
  133. data/assets/_vendor/ace/mode-prolog.js +2 -2
  134. data/assets/_vendor/ace/mode-properties.js +1 -2
  135. data/assets/_vendor/ace/mode-protobuf.js +2 -2
  136. data/assets/_vendor/ace/mode-puppet.js +1 -2
  137. data/assets/_vendor/ace/mode-python.js +297 -63
  138. data/assets/_vendor/ace/mode-r.js +3 -2
  139. data/assets/_vendor/ace/mode-razor.js +9 -3
  140. data/assets/_vendor/ace/mode-rdoc.js +2 -2
  141. data/assets/_vendor/ace/mode-red.js +2 -2
  142. data/assets/_vendor/ace/mode-redshift.js +1 -2
  143. data/assets/_vendor/ace/mode-rhtml.js +5 -2
  144. data/assets/_vendor/ace/mode-rst.js +1 -2
  145. data/assets/_vendor/ace/mode-ruby.js +3 -2
  146. data/assets/_vendor/ace/mode-rust.js +2 -2
  147. data/assets/_vendor/ace/mode-sass.js +205 -117
  148. data/assets/_vendor/ace/mode-scad.js +2 -2
  149. data/assets/_vendor/ace/mode-scala.js +3 -2
  150. data/assets/_vendor/ace/mode-scheme.js +2 -2
  151. data/assets/_vendor/ace/mode-scss.js +204 -115
  152. data/assets/_vendor/ace/mode-sh.js +3 -2
  153. data/assets/_vendor/ace/mode-sjs.js +2 -2
  154. data/assets/_vendor/ace/mode-slim.js +18 -117
  155. data/assets/_vendor/ace/mode-smarty.js +3 -2
  156. data/assets/_vendor/ace/mode-snippets.js +1 -2
  157. data/assets/_vendor/ace/mode-soy_template.js +4 -2
  158. data/assets/_vendor/ace/mode-space.js +1 -2
  159. data/assets/_vendor/ace/mode-sparql.js +2 -2
  160. data/assets/_vendor/ace/mode-sql.js +2 -3
  161. data/assets/_vendor/ace/mode-sqlserver.js +2 -2
  162. data/assets/_vendor/ace/mode-stylus.js +3 -2
  163. data/assets/_vendor/ace/mode-svg.js +2 -2
  164. data/assets/_vendor/ace/mode-swift.js +1 -2
  165. data/assets/_vendor/ace/mode-tcl.js +2 -2
  166. data/assets/_vendor/ace/mode-terraform.js +1 -2
  167. data/assets/_vendor/ace/mode-tex.js +2 -2
  168. data/assets/_vendor/ace/mode-text.js +1 -2
  169. data/assets/_vendor/ace/mode-textile.js +1 -2
  170. data/assets/_vendor/ace/mode-toml.js +1 -2
  171. data/assets/_vendor/ace/mode-tsx.js +2 -2
  172. data/assets/_vendor/ace/mode-turtle.js +2 -2
  173. data/assets/_vendor/ace/mode-twig.js +3 -2
  174. data/assets/_vendor/ace/mode-typescript.js +2 -2
  175. data/assets/_vendor/ace/mode-vala.js +2 -2
  176. data/assets/_vendor/ace/mode-vbscript.js +1 -2
  177. data/assets/_vendor/ace/mode-velocity.js +4 -2
  178. data/assets/_vendor/ace/mode-verilog.js +1 -2
  179. data/assets/_vendor/ace/mode-vhdl.js +1 -2
  180. data/assets/_vendor/ace/mode-visualforce.js +2641 -0
  181. data/assets/_vendor/ace/mode-wollok.js +3 -2
  182. data/assets/_vendor/ace/mode-xml.js +1 -2
  183. data/assets/_vendor/ace/mode-xquery.js +8 -2287
  184. data/assets/_vendor/ace/mode-yaml.js +1 -2
  185. data/assets/_vendor/ace/snippets/abap.js +2 -3
  186. data/assets/_vendor/ace/snippets/abc.js +1 -2
  187. data/assets/_vendor/ace/snippets/actionscript.js +1 -2
  188. data/assets/_vendor/ace/snippets/ada.js +2 -3
  189. data/assets/_vendor/ace/snippets/apache_conf.js +2 -3
  190. data/assets/_vendor/ace/snippets/apex.js +14 -0
  191. data/assets/_vendor/ace/snippets/applescript.js +2 -3
  192. data/assets/_vendor/ace/snippets/asciidoc.js +2 -3
  193. data/assets/_vendor/ace/snippets/asl.js +2 -3
  194. data/assets/_vendor/ace/snippets/assembly_x86.js +2 -3
  195. data/assets/_vendor/ace/snippets/autohotkey.js +2 -3
  196. data/assets/_vendor/ace/snippets/batchfile.js +2 -3
  197. data/assets/_vendor/ace/snippets/bro.js +1 -2
  198. data/assets/_vendor/ace/snippets/c9search.js +2 -3
  199. data/assets/_vendor/ace/snippets/c_cpp.js +1 -2
  200. data/assets/_vendor/ace/snippets/cirru.js +2 -3
  201. data/assets/_vendor/ace/snippets/clojure.js +1 -2
  202. data/assets/_vendor/ace/snippets/cobol.js +2 -3
  203. data/assets/_vendor/ace/snippets/coffee.js +1 -2
  204. data/assets/_vendor/ace/snippets/coldfusion.js +2 -3
  205. data/assets/_vendor/ace/snippets/csharp.js +2 -3
  206. data/assets/_vendor/ace/snippets/csound_document.js +1 -2
  207. data/assets/_vendor/ace/snippets/csound_orchestra.js +1 -2
  208. data/assets/_vendor/ace/snippets/csound_score.js +2 -3
  209. data/assets/_vendor/ace/snippets/csp.js +1 -2
  210. data/assets/_vendor/ace/snippets/css.js +1 -2
  211. data/assets/_vendor/ace/snippets/curly.js +2 -3
  212. data/assets/_vendor/ace/snippets/d.js +2 -3
  213. data/assets/_vendor/ace/snippets/dart.js +1 -2
  214. data/assets/_vendor/ace/snippets/diff.js +1 -2
  215. data/assets/_vendor/ace/snippets/django.js +1 -2
  216. data/assets/_vendor/ace/snippets/dockerfile.js +2 -3
  217. data/assets/_vendor/ace/snippets/dot.js +2 -3
  218. data/assets/_vendor/ace/snippets/drools.js +1 -2
  219. data/assets/_vendor/ace/snippets/edifact.js +1 -2
  220. data/assets/_vendor/ace/snippets/eiffel.js +2 -3
  221. data/assets/_vendor/ace/snippets/ejs.js +2 -3
  222. data/assets/_vendor/ace/snippets/elixir.js +1 -2
  223. data/assets/_vendor/ace/snippets/elm.js +2 -3
  224. data/assets/_vendor/ace/snippets/erlang.js +1 -2
  225. data/assets/_vendor/ace/snippets/forth.js +2 -3
  226. data/assets/_vendor/ace/snippets/fortran.js +2 -3
  227. data/assets/_vendor/ace/snippets/fsharp.js +2 -3
  228. data/assets/_vendor/ace/snippets/fsl.js +14 -0
  229. data/assets/_vendor/ace/snippets/ftl.js +2 -3
  230. data/assets/_vendor/ace/snippets/gcode.js +2 -3
  231. data/assets/_vendor/ace/snippets/gherkin.js +2 -3
  232. data/assets/_vendor/ace/snippets/gitignore.js +2 -3
  233. data/assets/_vendor/ace/snippets/glsl.js +2 -3
  234. data/assets/_vendor/ace/snippets/gobstones.js +1 -2
  235. data/assets/_vendor/ace/snippets/golang.js +2 -3
  236. data/assets/_vendor/ace/snippets/graphqlschema.js +1 -2
  237. data/assets/_vendor/ace/snippets/groovy.js +2 -3
  238. data/assets/_vendor/ace/snippets/haml.js +1 -2
  239. data/assets/_vendor/ace/snippets/handlebars.js +2 -3
  240. data/assets/_vendor/ace/snippets/haskell.js +1 -2
  241. data/assets/_vendor/ace/snippets/haskell_cabal.js +2 -3
  242. data/assets/_vendor/ace/snippets/haxe.js +2 -3
  243. data/assets/_vendor/ace/snippets/hjson.js +1 -2
  244. data/assets/_vendor/ace/snippets/html.js +1 -2
  245. data/assets/_vendor/ace/snippets/html_elixir.js +2 -3
  246. data/assets/_vendor/ace/snippets/html_ruby.js +2 -3
  247. data/assets/_vendor/ace/snippets/ini.js +2 -3
  248. data/assets/_vendor/ace/snippets/io.js +1 -2
  249. data/assets/_vendor/ace/snippets/jack.js +2 -3
  250. data/assets/_vendor/ace/snippets/jade.js +2 -3
  251. data/assets/_vendor/ace/snippets/java.js +1 -2
  252. data/assets/_vendor/ace/snippets/javascript.js +1 -2
  253. data/assets/_vendor/ace/snippets/json.js +2 -3
  254. data/assets/_vendor/ace/snippets/jsoniq.js +1 -2
  255. data/assets/_vendor/ace/snippets/jsp.js +1 -2
  256. data/assets/_vendor/ace/snippets/jssm.js +1 -2
  257. data/assets/_vendor/ace/snippets/jsx.js +2 -3
  258. data/assets/_vendor/ace/snippets/julia.js +2 -3
  259. data/assets/_vendor/ace/snippets/kotlin.js +1 -2
  260. data/assets/_vendor/ace/snippets/latex.js +2 -3
  261. data/assets/_vendor/ace/snippets/less.js +2 -3
  262. data/assets/_vendor/ace/snippets/liquid.js +883 -3
  263. data/assets/_vendor/ace/snippets/lisp.js +2 -3
  264. data/assets/_vendor/ace/snippets/livescript.js +2 -3
  265. data/assets/_vendor/ace/snippets/logiql.js +2 -3
  266. data/assets/_vendor/ace/snippets/logtalk.js +14 -0
  267. data/assets/_vendor/ace/snippets/lsl.js +1 -2
  268. data/assets/_vendor/ace/snippets/lua.js +1 -2
  269. data/assets/_vendor/ace/snippets/luapage.js +2 -3
  270. data/assets/_vendor/ace/snippets/lucene.js +2 -3
  271. data/assets/_vendor/ace/snippets/makefile.js +1 -2
  272. data/assets/_vendor/ace/snippets/markdown.js +1 -2
  273. data/assets/_vendor/ace/snippets/mask.js +2 -3
  274. data/assets/_vendor/ace/snippets/matlab.js +2 -3
  275. data/assets/_vendor/ace/snippets/maze.js +1 -2
  276. data/assets/_vendor/ace/snippets/mel.js +2 -3
  277. data/assets/_vendor/ace/snippets/mixal.js +2 -3
  278. data/assets/_vendor/ace/snippets/mushcode.js +2 -3
  279. data/assets/_vendor/ace/snippets/mysql.js +2 -3
  280. data/assets/_vendor/ace/snippets/nix.js +2 -3
  281. data/assets/_vendor/ace/snippets/nsis.js +1 -2
  282. data/assets/_vendor/ace/snippets/objectivec.js +2 -3
  283. data/assets/_vendor/ace/snippets/ocaml.js +2 -3
  284. data/assets/_vendor/ace/snippets/pascal.js +2 -3
  285. data/assets/_vendor/ace/snippets/perl.js +1 -2
  286. data/assets/_vendor/ace/snippets/perl6.js +14 -0
  287. data/assets/_vendor/ace/snippets/pgsql.js +2 -3
  288. data/assets/_vendor/ace/snippets/php.js +1 -2
  289. data/assets/_vendor/ace/snippets/php_laravel_blade.js +2 -3
  290. data/assets/_vendor/ace/snippets/pig.js +2 -3
  291. data/assets/_vendor/ace/snippets/plain_text.js +2 -3
  292. data/assets/_vendor/ace/snippets/powershell.js +2 -3
  293. data/assets/_vendor/ace/snippets/praat.js +2 -3
  294. data/assets/_vendor/ace/snippets/prolog.js +2 -3
  295. data/assets/_vendor/ace/snippets/properties.js +2 -3
  296. data/assets/_vendor/ace/snippets/protobuf.js +1 -2
  297. data/assets/_vendor/ace/snippets/puppet.js +2 -3
  298. data/assets/_vendor/ace/snippets/python.js +1 -2
  299. data/assets/_vendor/ace/snippets/r.js +1 -2
  300. data/assets/_vendor/ace/snippets/razor.js +1 -2
  301. data/assets/_vendor/ace/snippets/rdoc.js +2 -3
  302. data/assets/_vendor/ace/snippets/red.js +1 -2
  303. data/assets/_vendor/ace/snippets/redshift.js +2 -3
  304. data/assets/_vendor/ace/snippets/rhtml.js +2 -3
  305. data/assets/_vendor/ace/snippets/rst.js +1 -2
  306. data/assets/_vendor/ace/snippets/ruby.js +1 -2
  307. data/assets/_vendor/ace/snippets/rust.js +2 -3
  308. data/assets/_vendor/ace/snippets/sass.js +2 -3
  309. data/assets/_vendor/ace/snippets/scad.js +2 -3
  310. data/assets/_vendor/ace/snippets/scala.js +2 -3
  311. data/assets/_vendor/ace/snippets/scheme.js +2 -3
  312. data/assets/_vendor/ace/snippets/scss.js +2 -3
  313. data/assets/_vendor/ace/snippets/sh.js +1 -2
  314. data/assets/_vendor/ace/snippets/sjs.js +2 -3
  315. data/assets/_vendor/ace/snippets/slim.js +2 -3
  316. data/assets/_vendor/ace/snippets/smarty.js +2 -3
  317. data/assets/_vendor/ace/snippets/snippets.js +1 -2
  318. data/assets/_vendor/ace/snippets/soy_template.js +2 -3
  319. data/assets/_vendor/ace/snippets/space.js +2 -3
  320. data/assets/_vendor/ace/snippets/sparql.js +1 -2
  321. data/assets/_vendor/ace/snippets/sql.js +1 -2
  322. data/assets/_vendor/ace/snippets/sqlserver.js +1 -2
  323. data/assets/_vendor/ace/snippets/stylus.js +2 -3
  324. data/assets/_vendor/ace/snippets/svg.js +2 -3
  325. data/assets/_vendor/ace/snippets/swift.js +2 -3
  326. data/assets/_vendor/ace/snippets/tcl.js +1 -2
  327. data/assets/_vendor/ace/snippets/terraform.js +2 -3
  328. data/assets/_vendor/ace/snippets/tex.js +1 -2
  329. data/assets/_vendor/ace/snippets/text.js +2 -3
  330. data/assets/_vendor/ace/snippets/textile.js +1 -2
  331. data/assets/_vendor/ace/snippets/toml.js +2 -3
  332. data/assets/_vendor/ace/snippets/tsx.js +2 -3
  333. data/assets/_vendor/ace/snippets/turtle.js +1 -2
  334. data/assets/_vendor/ace/snippets/twig.js +2 -3
  335. data/assets/_vendor/ace/snippets/typescript.js +2 -3
  336. data/assets/_vendor/ace/snippets/vala.js +1 -2
  337. data/assets/_vendor/ace/snippets/vbscript.js +2 -3
  338. data/assets/_vendor/ace/snippets/velocity.js +1 -2
  339. data/assets/_vendor/ace/snippets/verilog.js +2 -3
  340. data/assets/_vendor/ace/snippets/vhdl.js +2 -3
  341. data/assets/_vendor/ace/snippets/visualforce.js +14 -0
  342. data/assets/_vendor/ace/snippets/wollok.js +1 -2
  343. data/assets/_vendor/ace/snippets/xml.js +2 -3
  344. data/assets/_vendor/ace/snippets/xquery.js +1 -2
  345. data/assets/_vendor/ace/snippets/yaml.js +2 -3
  346. data/assets/_vendor/ace/theme-ambiance.js +1 -2
  347. data/assets/_vendor/ace/theme-chaos.js +1 -2
  348. data/assets/_vendor/ace/theme-chrome.js +1 -2
  349. data/assets/_vendor/ace/theme-clouds.js +1 -2
  350. data/assets/_vendor/ace/theme-clouds_midnight.js +1 -2
  351. data/assets/_vendor/ace/theme-cobalt.js +1 -2
  352. data/assets/_vendor/ace/theme-crimson_editor.js +1 -2
  353. data/assets/_vendor/ace/theme-dawn.js +1 -2
  354. data/assets/_vendor/ace/theme-dracula.js +1 -2
  355. data/assets/_vendor/ace/theme-dreamweaver.js +1 -2
  356. data/assets/_vendor/ace/theme-eclipse.js +1 -2
  357. data/assets/_vendor/ace/theme-github.js +3 -3
  358. data/assets/_vendor/ace/theme-gob.js +1 -2
  359. data/assets/_vendor/ace/theme-gruvbox.js +1 -2
  360. data/assets/_vendor/ace/theme-idle_fingers.js +1 -2
  361. data/assets/_vendor/ace/theme-iplastic.js +1 -2
  362. data/assets/_vendor/ace/theme-katzenmilch.js +1 -2
  363. data/assets/_vendor/ace/theme-kr_theme.js +1 -2
  364. data/assets/_vendor/ace/theme-kuroir.js +1 -2
  365. data/assets/_vendor/ace/theme-merbivore.js +1 -2
  366. data/assets/_vendor/ace/theme-merbivore_soft.js +1 -2
  367. data/assets/_vendor/ace/theme-mono_industrial.js +1 -2
  368. data/assets/_vendor/ace/theme-monokai.js +1 -2
  369. data/assets/_vendor/ace/theme-pastel_on_dark.js +1 -2
  370. data/assets/_vendor/ace/theme-solarized_dark.js +1 -2
  371. data/assets/_vendor/ace/theme-solarized_light.js +1 -2
  372. data/assets/_vendor/ace/theme-sqlserver.js +1 -2
  373. data/assets/_vendor/ace/theme-terminal.js +1 -2
  374. data/assets/_vendor/ace/theme-textmate.js +1 -2
  375. data/assets/_vendor/ace/theme-tomorrow.js +1 -2
  376. data/assets/_vendor/ace/theme-tomorrow_night.js +1 -2
  377. data/assets/_vendor/ace/theme-tomorrow_night_blue.js +1 -2
  378. data/assets/_vendor/ace/theme-tomorrow_night_bright.js +1 -2
  379. data/assets/_vendor/ace/theme-tomorrow_night_eighties.js +1 -2
  380. data/assets/_vendor/ace/theme-twilight.js +1 -2
  381. data/assets/_vendor/ace/theme-vibrant_ink.js +1 -2
  382. data/assets/_vendor/ace/theme-xcode.js +1 -2
  383. data/assets/_vendor/ace/worker-coffee.js +11 -20
  384. data/assets/_vendor/ace/worker-css.js +23 -20
  385. data/assets/_vendor/ace/worker-html.js +25 -31
  386. data/assets/_vendor/ace/worker-javascript.js +76 -36
  387. data/assets/_vendor/ace/worker-json.js +25 -20
  388. data/assets/_vendor/ace/worker-lua.js +68 -69
  389. data/assets/_vendor/ace/worker-php.js +12 -20
  390. data/assets/_vendor/ace/worker-xml.js +12 -22
  391. data/assets/_vendor/ace/worker-xquery.js +44 -12378
  392. data/assets/_vendor/tinymce/plugins/advlist/plugin.js +137 -137
  393. data/assets/_vendor/tinymce/plugins/anchor/plugin.js +102 -102
  394. data/assets/_vendor/tinymce/plugins/autolink/plugin.js +154 -154
  395. data/assets/_vendor/tinymce/plugins/autoresize/plugin.js +145 -145
  396. data/assets/_vendor/tinymce/plugins/autosave/plugin.js +207 -217
  397. data/assets/_vendor/tinymce/plugins/autosave/plugin.min.js +1 -1
  398. data/assets/_vendor/tinymce/plugins/bbcode/plugin.js +89 -89
  399. data/assets/_vendor/tinymce/plugins/charmap/plugin.js +1246 -1246
  400. data/assets/_vendor/tinymce/plugins/code/plugin.js +80 -80
  401. data/assets/_vendor/tinymce/plugins/codesample/plugin.js +852 -852
  402. data/assets/_vendor/tinymce/plugins/colorpicker/plugin.js +109 -109
  403. data/assets/_vendor/tinymce/plugins/contextmenu/plugin.js +144 -144
  404. data/assets/_vendor/tinymce/plugins/directionality/plugin.js +53 -53
  405. data/assets/_vendor/tinymce/plugins/emoticons/plugin.js +74 -74
  406. data/assets/_vendor/tinymce/plugins/fullpage/plugin.js +464 -464
  407. data/assets/_vendor/tinymce/plugins/fullscreen/plugin.js +152 -152
  408. data/assets/_vendor/tinymce/plugins/help/plugin.js +639 -678
  409. data/assets/_vendor/tinymce/plugins/help/plugin.min.js +1 -1
  410. data/assets/_vendor/tinymce/plugins/hr/plugin.js +29 -29
  411. data/assets/_vendor/tinymce/plugins/image/plugin.js +1119 -1126
  412. data/assets/_vendor/tinymce/plugins/image/plugin.min.js +1 -1
  413. data/assets/_vendor/tinymce/plugins/imagetools/plugin.js +3414 -3445
  414. data/assets/_vendor/tinymce/plugins/imagetools/plugin.min.js +1 -1
  415. data/assets/_vendor/tinymce/plugins/importcss/plugin.js +230 -230
  416. data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.js +152 -152
  417. data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.js +193 -193
  418. data/assets/_vendor/tinymce/plugins/link/plugin.js +646 -646
  419. data/assets/_vendor/tinymce/plugins/lists/plugin.js +2103 -1037
  420. data/assets/_vendor/tinymce/plugins/lists/plugin.min.js +1 -1
  421. data/assets/_vendor/tinymce/plugins/media/plugin.js +1050 -1050
  422. data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.js +69 -69
  423. data/assets/_vendor/tinymce/plugins/noneditable/plugin.js +98 -98
  424. data/assets/_vendor/tinymce/plugins/pagebreak/plugin.js +91 -91
  425. data/assets/_vendor/tinymce/plugins/paste/plugin.js +1725 -1364
  426. data/assets/_vendor/tinymce/plugins/paste/plugin.min.js +1 -1
  427. data/assets/_vendor/tinymce/plugins/preview/plugin.js +107 -107
  428. data/assets/_vendor/tinymce/plugins/print/plugin.js +28 -28
  429. data/assets/_vendor/tinymce/plugins/save/plugin.js +101 -101
  430. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.js +535 -537
  431. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.min.js +1 -1
  432. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.js +683 -681
  433. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.min.js +1 -1
  434. data/assets/_vendor/tinymce/plugins/tabfocus/plugin.js +95 -95
  435. data/assets/_vendor/tinymce/plugins/table/plugin.js +8927 -9805
  436. data/assets/_vendor/tinymce/plugins/table/plugin.min.js +1 -1
  437. data/assets/_vendor/tinymce/plugins/template/plugin.js +305 -311
  438. data/assets/_vendor/tinymce/plugins/template/plugin.min.js +1 -1
  439. data/assets/_vendor/tinymce/plugins/textcolor/plugin.js +317 -317
  440. data/assets/_vendor/tinymce/plugins/textpattern/plugin.js +575 -329
  441. data/assets/_vendor/tinymce/plugins/textpattern/plugin.min.js +1 -1
  442. data/assets/_vendor/tinymce/plugins/toc/plugin.js +201 -201
  443. data/assets/_vendor/tinymce/plugins/visualblocks/plugin.js +113 -113
  444. data/assets/_vendor/tinymce/plugins/visualchars/plugin.js +419 -471
  445. data/assets/_vendor/tinymce/plugins/visualchars/plugin.min.js +1 -1
  446. data/assets/_vendor/tinymce/plugins/wordcount/plugin.js +371 -308
  447. data/assets/_vendor/tinymce/plugins/wordcount/plugin.min.js +1 -1
  448. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  449. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.svg +1 -0
  450. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  451. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  452. data/assets/_vendor/tinymce/skins/lightgray/skin.min.css +1 -1
  453. data/assets/_vendor/tinymce/themes/inlite/theme.js +9272 -9686
  454. data/assets/_vendor/tinymce/themes/inlite/theme.min.js +1 -1
  455. data/assets/_vendor/tinymce/themes/mobile/theme.js +12130 -13042
  456. data/assets/_vendor/tinymce/themes/mobile/theme.min.js +1 -1
  457. data/assets/_vendor/tinymce/themes/modern/theme.js +9090 -9504
  458. data/assets/_vendor/tinymce/themes/modern/theme.min.js +1 -1
  459. data/assets/_vendor/tinymce/tinymce.js +24914 -25218
  460. data/assets/bedrock/js/bedrock.js +1 -1
  461. data/assets/bedrock/scss/components/no-content.scss +5 -0
  462. data/assets/bedrock/scss/components/select-box.scss +1 -1
  463. data/lib/bedrock_sass.rb +51 -16
  464. data/lib/bedrock_sass/engine.rb +3 -2
  465. data/lib/bedrock_sass/version.rb +1 -1
  466. metadata +17 -7
@@ -1,1497 +1,1858 @@
1
1
  (function () {
2
2
  var paste = (function () {
3
- 'use strict';
3
+ 'use strict';
4
4
 
5
- var Cell = function (initial) {
6
- var value = initial;
7
- var get = function () {
8
- return value;
9
- };
10
- var set = function (v) {
11
- value = v;
12
- };
13
- var clone = function () {
14
- return Cell(get());
15
- };
16
- return {
17
- get: get,
18
- set: set,
19
- clone: clone
5
+ var Cell = function (initial) {
6
+ var value = initial;
7
+ var get = function () {
8
+ return value;
9
+ };
10
+ var set = function (v) {
11
+ value = v;
12
+ };
13
+ var clone = function () {
14
+ return Cell(get());
15
+ };
16
+ return {
17
+ get: get,
18
+ set: set,
19
+ clone: clone
20
+ };
20
21
  };
21
- };
22
22
 
23
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
23
+ var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
24
24
 
25
- var hasProPlugin = function (editor) {
26
- if (/(^|[ ,])powerpaste([, ]|$)/.test(editor.settings.plugins) && global.get('powerpaste')) {
27
- if (typeof window.console !== 'undefined' && window.console.log) {
28
- window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.');
25
+ var hasProPlugin = function (editor) {
26
+ if (/(^|[ ,])powerpaste([, ]|$)/.test(editor.settings.plugins) && global.get('powerpaste')) {
27
+ if (typeof window.console !== 'undefined' && window.console.log) {
28
+ window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.');
29
+ }
30
+ return true;
31
+ } else {
32
+ return false;
29
33
  }
30
- return true;
31
- } else {
32
- return false;
33
- }
34
- };
35
- var $_1wddxcidjm0ofzo9 = { hasProPlugin: hasProPlugin };
34
+ };
35
+ var DetectProPlugin = { hasProPlugin: hasProPlugin };
36
36
 
37
- var get = function (clipboard, quirks) {
38
- return {
39
- clipboard: clipboard,
40
- quirks: quirks
37
+ var get = function (clipboard, quirks) {
38
+ return {
39
+ clipboard: clipboard,
40
+ quirks: quirks
41
+ };
41
42
  };
42
- };
43
- var $_9cpx3tifjm0ofzos = { get: get };
43
+ var Api = { get: get };
44
44
 
45
- var firePastePreProcess = function (editor, html, internal, isWordHtml) {
46
- return editor.fire('PastePreProcess', {
47
- content: html,
48
- internal: internal,
49
- wordContent: isWordHtml
50
- });
51
- };
52
- var firePastePostProcess = function (editor, node, internal, isWordHtml) {
53
- return editor.fire('PastePostProcess', {
54
- node: node,
55
- internal: internal,
56
- wordContent: isWordHtml
57
- });
58
- };
59
- var firePastePlainTextToggle = function (editor, state) {
60
- return editor.fire('PastePlainTextToggle', { state: state });
61
- };
62
- var firePaste = function (editor, ieFake) {
63
- return editor.fire('paste', { ieFake: ieFake });
64
- };
65
- var $_4gidzbiijm0ofzow = {
66
- firePastePreProcess: firePastePreProcess,
67
- firePastePostProcess: firePastePostProcess,
68
- firePastePlainTextToggle: firePastePlainTextToggle,
69
- firePaste: firePaste
70
- };
45
+ var firePastePreProcess = function (editor, html, internal, isWordHtml) {
46
+ return editor.fire('PastePreProcess', {
47
+ content: html,
48
+ internal: internal,
49
+ wordContent: isWordHtml
50
+ });
51
+ };
52
+ var firePastePostProcess = function (editor, node, internal, isWordHtml) {
53
+ return editor.fire('PastePostProcess', {
54
+ node: node,
55
+ internal: internal,
56
+ wordContent: isWordHtml
57
+ });
58
+ };
59
+ var firePastePlainTextToggle = function (editor, state) {
60
+ return editor.fire('PastePlainTextToggle', { state: state });
61
+ };
62
+ var firePaste = function (editor, ieFake) {
63
+ return editor.fire('paste', { ieFake: ieFake });
64
+ };
65
+ var Events = {
66
+ firePastePreProcess: firePastePreProcess,
67
+ firePastePostProcess: firePastePostProcess,
68
+ firePastePlainTextToggle: firePastePlainTextToggle,
69
+ firePaste: firePaste
70
+ };
71
71
 
72
- var shouldPlainTextInform = function (editor) {
73
- return editor.getParam('paste_plaintext_inform', true);
74
- };
75
- var shouldBlockDrop = function (editor) {
76
- return editor.getParam('paste_block_drop', false);
77
- };
78
- var shouldPasteDataImages = function (editor) {
79
- return editor.getParam('paste_data_images', false);
80
- };
81
- var shouldFilterDrop = function (editor) {
82
- return editor.getParam('paste_filter_drop', true);
83
- };
84
- var getPreProcess = function (editor) {
85
- return editor.getParam('paste_preprocess');
86
- };
87
- var getPostProcess = function (editor) {
88
- return editor.getParam('paste_postprocess');
89
- };
90
- var getWebkitStyles = function (editor) {
91
- return editor.getParam('paste_webkit_styles');
92
- };
93
- var shouldRemoveWebKitStyles = function (editor) {
94
- return editor.getParam('paste_remove_styles_if_webkit', true);
95
- };
96
- var shouldMergeFormats = function (editor) {
97
- return editor.getParam('paste_merge_formats', true);
98
- };
99
- var isSmartPasteEnabled = function (editor) {
100
- return editor.getParam('smart_paste', true);
101
- };
102
- var isPasteAsTextEnabled = function (editor) {
103
- return editor.getParam('paste_as_text', false);
104
- };
105
- var getRetainStyleProps = function (editor) {
106
- return editor.getParam('paste_retain_style_properties');
107
- };
108
- var getWordValidElements = function (editor) {
109
- var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody';
110
- return editor.getParam('paste_word_valid_elements', defaultValidElements);
111
- };
112
- var shouldConvertWordFakeLists = function (editor) {
113
- return editor.getParam('paste_convert_word_fake_lists', true);
114
- };
115
- var shouldUseDefaultFilters = function (editor) {
116
- return editor.getParam('paste_enable_default_filters', true);
117
- };
118
- var $_dbkrisijjm0ofzoy = {
119
- shouldPlainTextInform: shouldPlainTextInform,
120
- shouldBlockDrop: shouldBlockDrop,
121
- shouldPasteDataImages: shouldPasteDataImages,
122
- shouldFilterDrop: shouldFilterDrop,
123
- getPreProcess: getPreProcess,
124
- getPostProcess: getPostProcess,
125
- getWebkitStyles: getWebkitStyles,
126
- shouldRemoveWebKitStyles: shouldRemoveWebKitStyles,
127
- shouldMergeFormats: shouldMergeFormats,
128
- isSmartPasteEnabled: isSmartPasteEnabled,
129
- isPasteAsTextEnabled: isPasteAsTextEnabled,
130
- getRetainStyleProps: getRetainStyleProps,
131
- getWordValidElements: getWordValidElements,
132
- shouldConvertWordFakeLists: shouldConvertWordFakeLists,
133
- shouldUseDefaultFilters: shouldUseDefaultFilters
134
- };
72
+ var shouldPlainTextInform = function (editor) {
73
+ return editor.getParam('paste_plaintext_inform', true);
74
+ };
75
+ var shouldBlockDrop = function (editor) {
76
+ return editor.getParam('paste_block_drop', false);
77
+ };
78
+ var shouldPasteDataImages = function (editor) {
79
+ return editor.getParam('paste_data_images', false);
80
+ };
81
+ var shouldFilterDrop = function (editor) {
82
+ return editor.getParam('paste_filter_drop', true);
83
+ };
84
+ var getPreProcess = function (editor) {
85
+ return editor.getParam('paste_preprocess');
86
+ };
87
+ var getPostProcess = function (editor) {
88
+ return editor.getParam('paste_postprocess');
89
+ };
90
+ var getWebkitStyles = function (editor) {
91
+ return editor.getParam('paste_webkit_styles');
92
+ };
93
+ var shouldRemoveWebKitStyles = function (editor) {
94
+ return editor.getParam('paste_remove_styles_if_webkit', true);
95
+ };
96
+ var shouldMergeFormats = function (editor) {
97
+ return editor.getParam('paste_merge_formats', true);
98
+ };
99
+ var isSmartPasteEnabled = function (editor) {
100
+ return editor.getParam('smart_paste', true);
101
+ };
102
+ var isPasteAsTextEnabled = function (editor) {
103
+ return editor.getParam('paste_as_text', false);
104
+ };
105
+ var getRetainStyleProps = function (editor) {
106
+ return editor.getParam('paste_retain_style_properties');
107
+ };
108
+ var getWordValidElements = function (editor) {
109
+ var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody';
110
+ return editor.getParam('paste_word_valid_elements', defaultValidElements);
111
+ };
112
+ var shouldConvertWordFakeLists = function (editor) {
113
+ return editor.getParam('paste_convert_word_fake_lists', true);
114
+ };
115
+ var shouldUseDefaultFilters = function (editor) {
116
+ return editor.getParam('paste_enable_default_filters', true);
117
+ };
118
+ var Settings = {
119
+ shouldPlainTextInform: shouldPlainTextInform,
120
+ shouldBlockDrop: shouldBlockDrop,
121
+ shouldPasteDataImages: shouldPasteDataImages,
122
+ shouldFilterDrop: shouldFilterDrop,
123
+ getPreProcess: getPreProcess,
124
+ getPostProcess: getPostProcess,
125
+ getWebkitStyles: getWebkitStyles,
126
+ shouldRemoveWebKitStyles: shouldRemoveWebKitStyles,
127
+ shouldMergeFormats: shouldMergeFormats,
128
+ isSmartPasteEnabled: isSmartPasteEnabled,
129
+ isPasteAsTextEnabled: isPasteAsTextEnabled,
130
+ getRetainStyleProps: getRetainStyleProps,
131
+ getWordValidElements: getWordValidElements,
132
+ shouldConvertWordFakeLists: shouldConvertWordFakeLists,
133
+ shouldUseDefaultFilters: shouldUseDefaultFilters
134
+ };
135
135
 
136
- var shouldInformUserAboutPlainText = function (editor, userIsInformedState) {
137
- return userIsInformedState.get() === false && $_dbkrisijjm0ofzoy.shouldPlainTextInform(editor);
138
- };
139
- var displayNotification = function (editor, message) {
140
- editor.notificationManager.open({
141
- text: editor.translate(message),
142
- type: 'info'
143
- });
144
- };
145
- var togglePlainTextPaste = function (editor, clipboard, userIsInformedState) {
146
- if (clipboard.pasteFormat.get() === 'text') {
147
- clipboard.pasteFormat.set('html');
148
- $_4gidzbiijm0ofzow.firePastePlainTextToggle(editor, false);
149
- } else {
150
- clipboard.pasteFormat.set('text');
151
- $_4gidzbiijm0ofzow.firePastePlainTextToggle(editor, true);
152
- if (shouldInformUserAboutPlainText(editor, userIsInformedState)) {
153
- displayNotification(editor, 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.');
154
- userIsInformedState.set(true);
136
+ var shouldInformUserAboutPlainText = function (editor, userIsInformedState) {
137
+ return userIsInformedState.get() === false && Settings.shouldPlainTextInform(editor);
138
+ };
139
+ var displayNotification = function (editor, message) {
140
+ editor.notificationManager.open({
141
+ text: editor.translate(message),
142
+ type: 'info'
143
+ });
144
+ };
145
+ var togglePlainTextPaste = function (editor, clipboard, userIsInformedState) {
146
+ if (clipboard.pasteFormat.get() === 'text') {
147
+ clipboard.pasteFormat.set('html');
148
+ Events.firePastePlainTextToggle(editor, false);
149
+ } else {
150
+ clipboard.pasteFormat.set('text');
151
+ Events.firePastePlainTextToggle(editor, true);
152
+ if (shouldInformUserAboutPlainText(editor, userIsInformedState)) {
153
+ displayNotification(editor, 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.');
154
+ userIsInformedState.set(true);
155
+ }
155
156
  }
156
- }
157
- editor.focus();
158
- };
159
- var $_7tierfihjm0ofzov = { togglePlainTextPaste: togglePlainTextPaste };
157
+ editor.focus();
158
+ };
159
+ var Actions = { togglePlainTextPaste: togglePlainTextPaste };
160
160
 
161
- var register = function (editor, clipboard, userIsInformedState) {
162
- editor.addCommand('mceTogglePlainTextPaste', function () {
163
- $_7tierfihjm0ofzov.togglePlainTextPaste(editor, clipboard, userIsInformedState);
164
- });
165
- editor.addCommand('mceInsertClipboardContent', function (ui, value) {
166
- if (value.content) {
167
- clipboard.pasteHtml(value.content, value.internal);
168
- }
169
- if (value.text) {
170
- clipboard.pasteText(value.text);
171
- }
172
- });
173
- };
174
- var $_4ny6o6igjm0ofzot = { register: register };
161
+ var register = function (editor, clipboard, userIsInformedState) {
162
+ editor.addCommand('mceTogglePlainTextPaste', function () {
163
+ Actions.togglePlainTextPaste(editor, clipboard, userIsInformedState);
164
+ });
165
+ editor.addCommand('mceInsertClipboardContent', function (ui, value) {
166
+ if (value.content) {
167
+ clipboard.pasteHtml(value.content, value.internal);
168
+ }
169
+ if (value.text) {
170
+ clipboard.pasteText(value.text);
171
+ }
172
+ });
173
+ };
174
+ var Commands = { register: register };
175
175
 
176
- var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
176
+ var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
177
177
 
178
- var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
178
+ var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
179
179
 
180
- var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
180
+ var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
181
181
 
182
- var global$4 = tinymce.util.Tools.resolve('tinymce.util.VK');
182
+ var global$4 = tinymce.util.Tools.resolve('tinymce.util.VK');
183
183
 
184
- var internalMimeType = 'x-tinymce/html';
185
- var internalMark = '<!-- ' + internalMimeType + ' -->';
186
- var mark = function (html) {
187
- return internalMark + html;
188
- };
189
- var unmark = function (html) {
190
- return html.replace(internalMark, '');
191
- };
192
- var isMarked = function (html) {
193
- return html.indexOf(internalMark) !== -1;
194
- };
195
- var $_21ba1xiqjm0ofzpc = {
196
- mark: mark,
197
- unmark: unmark,
198
- isMarked: isMarked,
199
- internalHtmlMime: function () {
200
- return internalMimeType;
201
- }
202
- };
184
+ var internalMimeType = 'x-tinymce/html';
185
+ var internalMark = '<!-- ' + internalMimeType + ' -->';
186
+ var mark = function (html) {
187
+ return internalMark + html;
188
+ };
189
+ var unmark = function (html) {
190
+ return html.replace(internalMark, '');
191
+ };
192
+ var isMarked = function (html) {
193
+ return html.indexOf(internalMark) !== -1;
194
+ };
195
+ var InternalHtml = {
196
+ mark: mark,
197
+ unmark: unmark,
198
+ isMarked: isMarked,
199
+ internalHtmlMime: function () {
200
+ return internalMimeType;
201
+ }
202
+ };
203
203
 
204
- var global$5 = tinymce.util.Tools.resolve('tinymce.html.Entities');
204
+ var global$5 = tinymce.util.Tools.resolve('tinymce.html.Entities');
205
205
 
206
- var isPlainText = function (text) {
207
- return !/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(text);
208
- };
209
- var toBRs = function (text) {
210
- return text.replace(/\r?\n/g, '<br>');
211
- };
212
- var openContainer = function (rootTag, rootAttrs) {
213
- var key;
214
- var attrs = [];
215
- var tag = '<' + rootTag;
216
- if (typeof rootAttrs === 'object') {
217
- for (key in rootAttrs) {
218
- if (rootAttrs.hasOwnProperty(key)) {
219
- attrs.push(key + '="' + global$5.encodeAllRaw(rootAttrs[key]) + '"');
206
+ var isPlainText = function (text) {
207
+ return !/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(text);
208
+ };
209
+ var toBRs = function (text) {
210
+ return text.replace(/\r?\n/g, '<br>');
211
+ };
212
+ var openContainer = function (rootTag, rootAttrs) {
213
+ var key;
214
+ var attrs = [];
215
+ var tag = '<' + rootTag;
216
+ if (typeof rootAttrs === 'object') {
217
+ for (key in rootAttrs) {
218
+ if (rootAttrs.hasOwnProperty(key)) {
219
+ attrs.push(key + '="' + global$5.encodeAllRaw(rootAttrs[key]) + '"');
220
+ }
221
+ }
222
+ if (attrs.length) {
223
+ tag += ' ' + attrs.join(' ');
220
224
  }
221
225
  }
222
- if (attrs.length) {
223
- tag += ' ' + attrs.join(' ');
224
- }
225
- }
226
- return tag + '>';
227
- };
228
- var toBlockElements = function (text, rootTag, rootAttrs) {
229
- var blocks = text.split(/\n\n/);
230
- var tagOpen = openContainer(rootTag, rootAttrs);
231
- var tagClose = '</' + rootTag + '>';
232
- var paragraphs = global$3.map(blocks, function (p) {
233
- return p.split(/\n/).join('<br />');
234
- });
235
- var stitch = function (p) {
236
- return tagOpen + p + tagClose;
237
- };
238
- return paragraphs.length === 1 ? paragraphs[0] : global$3.map(paragraphs, stitch).join('');
239
- };
240
- var convert = function (text, rootTag, rootAttrs) {
241
- return rootTag ? toBlockElements(text, rootTag, rootAttrs) : toBRs(text);
242
- };
243
- var $_67xxvyirjm0ofzpe = {
244
- isPlainText: isPlainText,
245
- convert: convert,
246
- toBRs: toBRs,
247
- toBlockElements: toBlockElements
248
- };
226
+ return tag + '>';
227
+ };
228
+ var toBlockElements = function (text, rootTag, rootAttrs) {
229
+ var blocks = text.split(/\n\n/);
230
+ var tagOpen = openContainer(rootTag, rootAttrs);
231
+ var tagClose = '</' + rootTag + '>';
232
+ var paragraphs = global$3.map(blocks, function (p) {
233
+ return p.split(/\n/).join('<br />');
234
+ });
235
+ var stitch = function (p) {
236
+ return tagOpen + p + tagClose;
237
+ };
238
+ return paragraphs.length === 1 ? paragraphs[0] : global$3.map(paragraphs, stitch).join('');
239
+ };
240
+ var convert = function (text, rootTag, rootAttrs) {
241
+ return rootTag ? toBlockElements(text, rootTag, rootAttrs) : toBRs(text);
242
+ };
243
+ var Newlines = {
244
+ isPlainText: isPlainText,
245
+ convert: convert,
246
+ toBRs: toBRs,
247
+ toBlockElements: toBlockElements
248
+ };
249
249
 
250
- var global$6 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
250
+ var global$6 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
251
251
 
252
- var global$7 = tinymce.util.Tools.resolve('tinymce.html.Node');
252
+ var global$7 = tinymce.util.Tools.resolve('tinymce.html.Node');
253
253
 
254
- var global$8 = tinymce.util.Tools.resolve('tinymce.html.Schema');
254
+ var global$8 = tinymce.util.Tools.resolve('tinymce.html.Schema');
255
255
 
256
- var global$9 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
256
+ var global$9 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
257
257
 
258
- function filter(content, items) {
259
- global$3.each(items, function (v) {
260
- if (v.constructor === RegExp) {
261
- content = content.replace(v, '');
262
- } else {
263
- content = content.replace(v[0], v[1]);
264
- }
265
- });
266
- return content;
267
- }
268
- function innerText(html) {
269
- var schema = global$8();
270
- var domParser = global$6({}, schema);
271
- var text = '';
272
- var shortEndedElements = schema.getShortEndedElements();
273
- var ignoreElements = global$3.makeMap('script noscript style textarea video audio iframe object', ' ');
274
- var blockElements = schema.getBlockElements();
275
- function walk(node) {
276
- var name$$1 = node.name, currentNode = node;
277
- if (name$$1 === 'br') {
278
- text += '\n';
279
- return;
280
- }
281
- if (shortEndedElements[name$$1]) {
282
- text += ' ';
283
- }
284
- if (ignoreElements[name$$1]) {
285
- text += ' ';
286
- return;
287
- }
288
- if (node.type === 3) {
289
- text += node.value;
290
- }
291
- if (!node.shortEnded) {
292
- if (node = node.firstChild) {
293
- do {
294
- walk(node);
295
- } while (node = node.next);
258
+ function filter(content, items) {
259
+ global$3.each(items, function (v) {
260
+ if (v.constructor === RegExp) {
261
+ content = content.replace(v, '');
262
+ } else {
263
+ content = content.replace(v[0], v[1]);
296
264
  }
297
- }
298
- if (blockElements[name$$1] && currentNode.next) {
299
- text += '\n';
300
- if (name$$1 === 'p') {
265
+ });
266
+ return content;
267
+ }
268
+ function innerText(html) {
269
+ var schema = global$8();
270
+ var domParser = global$6({}, schema);
271
+ var text = '';
272
+ var shortEndedElements = schema.getShortEndedElements();
273
+ var ignoreElements = global$3.makeMap('script noscript style textarea video audio iframe object', ' ');
274
+ var blockElements = schema.getBlockElements();
275
+ function walk(node) {
276
+ var name$$1 = node.name, currentNode = node;
277
+ if (name$$1 === 'br') {
278
+ text += '\n';
279
+ return;
280
+ }
281
+ if (name$$1 === 'wbr') {
282
+ return;
283
+ }
284
+ if (shortEndedElements[name$$1]) {
285
+ text += ' ';
286
+ }
287
+ if (ignoreElements[name$$1]) {
288
+ text += ' ';
289
+ return;
290
+ }
291
+ if (node.type === 3) {
292
+ text += node.value;
293
+ }
294
+ if (!node.shortEnded) {
295
+ if (node = node.firstChild) {
296
+ do {
297
+ walk(node);
298
+ } while (node = node.next);
299
+ }
300
+ }
301
+ if (blockElements[name$$1] && currentNode.next) {
301
302
  text += '\n';
303
+ if (name$$1 === 'p') {
304
+ text += '\n';
305
+ }
302
306
  }
303
307
  }
308
+ html = filter(html, [/<!\[[^\]]+\]>/g]);
309
+ walk(domParser.parse(html));
310
+ return text;
304
311
  }
305
- html = filter(html, [/<!\[[^\]]+\]>/g]);
306
- walk(domParser.parse(html));
307
- return text;
308
- }
309
- function trimHtml(html) {
310
- function trimSpaces(all, s1, s2) {
311
- if (!s1 && !s2) {
312
- return ' ';
313
- }
314
- return '\xA0';
312
+ function trimHtml(html) {
313
+ function trimSpaces(all, s1, s2) {
314
+ if (!s1 && !s2) {
315
+ return ' ';
316
+ }
317
+ return '\xA0';
318
+ }
319
+ html = filter(html, [
320
+ /^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,
321
+ /<!--StartFragment-->|<!--EndFragment-->/g,
322
+ [
323
+ /( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,
324
+ trimSpaces
325
+ ],
326
+ /<br class="Apple-interchange-newline">/g,
327
+ /<br>$/i
328
+ ]);
329
+ return html;
330
+ }
331
+ function createIdGenerator(prefix) {
332
+ var count = 0;
333
+ return function () {
334
+ return prefix + count++;
335
+ };
315
336
  }
316
- html = filter(html, [
317
- /^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,
318
- /<!--StartFragment-->|<!--EndFragment-->/g,
319
- [
320
- /( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,
321
- trimSpaces
322
- ],
323
- /<br class="Apple-interchange-newline">/g,
324
- /<br>$/i
325
- ]);
326
- return html;
327
- }
328
- function createIdGenerator(prefix) {
329
- var count = 0;
330
- return function () {
331
- return prefix + count++;
332
- };
333
- }
334
- var isMsEdge = function () {
335
- return navigator.userAgent.indexOf(' Edge/') !== -1;
336
- };
337
- var $_1340csizjm0ofzpu = {
338
- filter: filter,
339
- innerText: innerText,
340
- trimHtml: trimHtml,
341
- createIdGenerator: createIdGenerator,
342
- isMsEdge: isMsEdge
343
- };
337
+ var isMsEdge = function () {
338
+ return navigator.userAgent.indexOf(' Edge/') !== -1;
339
+ };
340
+ var Utils = {
341
+ filter: filter,
342
+ innerText: innerText,
343
+ trimHtml: trimHtml,
344
+ createIdGenerator: createIdGenerator,
345
+ isMsEdge: isMsEdge
346
+ };
344
347
 
345
- function isWordContent(content) {
346
- return /<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(content) || /class="OutlineElement/.test(content) || /id="?docs\-internal\-guid\-/.test(content);
347
- }
348
- function isNumericList(text) {
349
- var found, patterns;
350
- patterns = [
351
- /^[IVXLMCD]{1,2}\.[ \u00a0]/,
352
- /^[ivxlmcd]{1,2}\.[ \u00a0]/,
353
- /^[a-z]{1,2}[\.\)][ \u00a0]/,
354
- /^[A-Z]{1,2}[\.\)][ \u00a0]/,
355
- /^[0-9]+\.[ \u00a0]/,
356
- /^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,
357
- /^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/
358
- ];
359
- text = text.replace(/^[\u00a0 ]+/, '');
360
- global$3.each(patterns, function (pattern) {
361
- if (pattern.test(text)) {
362
- found = true;
363
- return false;
364
- }
365
- });
366
- return found;
367
- }
368
- function isBulletList(text) {
369
- return /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(text);
370
- }
371
- function convertFakeListsToProperLists(node) {
372
- var currentListNode, prevListNode, lastLevel = 1;
373
- function getText(node) {
374
- var txt = '';
375
- if (node.type === 3) {
376
- return node.value;
377
- }
378
- if (node = node.firstChild) {
379
- do {
380
- txt += getText(node);
381
- } while (node = node.next);
382
- }
383
- return txt;
348
+ function isWordContent(content) {
349
+ return /<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(content) || /class="OutlineElement/.test(content) || /id="?docs\-internal\-guid\-/.test(content);
384
350
  }
385
- function trimListStart(node, regExp) {
386
- if (node.type === 3) {
387
- if (regExp.test(node.value)) {
388
- node.value = node.value.replace(regExp, '');
351
+ function isNumericList(text) {
352
+ var found, patterns;
353
+ patterns = [
354
+ /^[IVXLMCD]{1,2}\.[ \u00a0]/,
355
+ /^[ivxlmcd]{1,2}\.[ \u00a0]/,
356
+ /^[a-z]{1,2}[\.\)][ \u00a0]/,
357
+ /^[A-Z]{1,2}[\.\)][ \u00a0]/,
358
+ /^[0-9]+\.[ \u00a0]/,
359
+ /^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,
360
+ /^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/
361
+ ];
362
+ text = text.replace(/^[\u00a0 ]+/, '');
363
+ global$3.each(patterns, function (pattern) {
364
+ if (pattern.test(text)) {
365
+ found = true;
389
366
  return false;
390
367
  }
391
- }
392
- if (node = node.firstChild) {
393
- do {
394
- if (!trimListStart(node, regExp)) {
395
- return false;
396
- }
397
- } while (node = node.next);
398
- }
399
- return true;
368
+ });
369
+ return found;
400
370
  }
401
- function removeIgnoredNodes(node) {
402
- if (node._listIgnore) {
403
- node.remove();
404
- return;
405
- }
406
- if (node = node.firstChild) {
407
- do {
408
- removeIgnoredNodes(node);
409
- } while (node = node.next);
410
- }
371
+ function isBulletList(text) {
372
+ return /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(text);
411
373
  }
412
- function convertParagraphToLi(paragraphNode, listName, start) {
413
- var level = paragraphNode._listLevel || lastLevel;
414
- if (level !== lastLevel) {
415
- if (level < lastLevel) {
416
- if (currentListNode) {
417
- currentListNode = currentListNode.parent.parent;
418
- }
419
- } else {
420
- prevListNode = currentListNode;
421
- currentListNode = null;
374
+ function convertFakeListsToProperLists(node) {
375
+ var currentListNode, prevListNode, lastLevel = 1;
376
+ function getText(node) {
377
+ var txt = '';
378
+ if (node.type === 3) {
379
+ return node.value;
422
380
  }
423
- }
424
- if (!currentListNode || currentListNode.name !== listName) {
425
- prevListNode = prevListNode || currentListNode;
426
- currentListNode = new global$7(listName, 1);
427
- if (start > 1) {
428
- currentListNode.attr('start', '' + start);
429
- }
430
- paragraphNode.wrap(currentListNode);
431
- } else {
432
- currentListNode.append(paragraphNode);
433
- }
434
- paragraphNode.name = 'li';
435
- if (level > lastLevel && prevListNode) {
436
- prevListNode.lastChild.append(currentListNode);
437
- }
438
- lastLevel = level;
439
- removeIgnoredNodes(paragraphNode);
440
- trimListStart(paragraphNode, /^\u00a0+/);
441
- trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);
442
- trimListStart(paragraphNode, /^\u00a0+/);
443
- }
444
- var elements = [];
445
- var child = node.firstChild;
446
- while (typeof child !== 'undefined' && child !== null) {
447
- elements.push(child);
448
- child = child.walk();
449
- if (child !== null) {
450
- while (typeof child !== 'undefined' && child.parent !== node) {
451
- child = child.walk();
381
+ if (node = node.firstChild) {
382
+ do {
383
+ txt += getText(node);
384
+ } while (node = node.next);
452
385
  }
386
+ return txt;
453
387
  }
454
- }
455
- for (var i = 0; i < elements.length; i++) {
456
- node = elements[i];
457
- if (node.name === 'p' && node.firstChild) {
458
- var nodeText = getText(node);
459
- if (isBulletList(nodeText)) {
460
- convertParagraphToLi(node, 'ul');
461
- continue;
462
- }
463
- if (isNumericList(nodeText)) {
464
- var matches = /([0-9]+)\./.exec(nodeText);
465
- var start = 1;
466
- if (matches) {
467
- start = parseInt(matches[1], 10);
388
+ function trimListStart(node, regExp) {
389
+ if (node.type === 3) {
390
+ if (regExp.test(node.value)) {
391
+ node.value = node.value.replace(regExp, '');
392
+ return false;
468
393
  }
469
- convertParagraphToLi(node, 'ol', start);
470
- continue;
471
394
  }
472
- if (node._listLevel) {
473
- convertParagraphToLi(node, 'ul', 1);
474
- continue;
395
+ if (node = node.firstChild) {
396
+ do {
397
+ if (!trimListStart(node, regExp)) {
398
+ return false;
399
+ }
400
+ } while (node = node.next);
475
401
  }
476
- currentListNode = null;
477
- } else {
478
- prevListNode = currentListNode;
479
- currentListNode = null;
402
+ return true;
480
403
  }
481
- }
482
- }
483
- function filterStyles(editor, validStyles, node, styleValue) {
484
- var outputStyles = {}, matches;
485
- var styles = editor.dom.parseStyle(styleValue);
486
- global$3.each(styles, function (value, name) {
487
- switch (name) {
488
- case 'mso-list':
489
- matches = /\w+ \w+([0-9]+)/i.exec(styleValue);
490
- if (matches) {
491
- node._listLevel = parseInt(matches[1], 10);
492
- }
493
- if (/Ignore/i.test(value) && node.firstChild) {
494
- node._listIgnore = true;
495
- node.firstChild._listIgnore = true;
496
- }
497
- break;
498
- case 'horiz-align':
499
- name = 'text-align';
500
- break;
501
- case 'vert-align':
502
- name = 'vertical-align';
503
- break;
504
- case 'font-color':
505
- case 'mso-foreground':
506
- name = 'color';
507
- break;
508
- case 'mso-background':
509
- case 'mso-highlight':
510
- name = 'background';
511
- break;
512
- case 'font-weight':
513
- case 'font-style':
514
- if (value !== 'normal') {
515
- outputStyles[name] = value;
516
- }
517
- return;
518
- case 'mso-element':
519
- if (/^(comment|comment-list)$/i.test(value)) {
404
+ function removeIgnoredNodes(node) {
405
+ if (node._listIgnore) {
520
406
  node.remove();
521
407
  return;
522
408
  }
523
- break;
524
- }
525
- if (name.indexOf('mso-comment') === 0) {
526
- node.remove();
527
- return;
528
- }
529
- if (name.indexOf('mso-') === 0) {
530
- return;
531
- }
532
- if ($_dbkrisijjm0ofzoy.getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) {
533
- outputStyles[name] = value;
534
- }
535
- });
536
- if (/(bold)/i.test(outputStyles['font-weight'])) {
537
- delete outputStyles['font-weight'];
538
- node.wrap(new global$7('b', 1));
539
- }
540
- if (/(italic)/i.test(outputStyles['font-style'])) {
541
- delete outputStyles['font-style'];
542
- node.wrap(new global$7('i', 1));
543
- }
544
- outputStyles = editor.dom.serializeStyle(outputStyles, node.name);
545
- if (outputStyles) {
546
- return outputStyles;
547
- }
548
- return null;
549
- }
550
- var filterWordContent = function (editor, content) {
551
- var retainStyleProperties, validStyles;
552
- retainStyleProperties = $_dbkrisijjm0ofzoy.getRetainStyleProps(editor);
553
- if (retainStyleProperties) {
554
- validStyles = global$3.makeMap(retainStyleProperties.split(/[, ]/));
555
- }
556
- content = $_1340csizjm0ofzpu.filter(content, [
557
- /<br class="?Apple-interchange-newline"?>/gi,
558
- /<b[^>]+id="?docs-internal-[^>]*>/gi,
559
- /<!--[\s\S]+?-->/gi,
560
- /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
561
- [
562
- /<(\/?)s>/gi,
563
- '<$1strike>'
564
- ],
565
- [
566
- /&nbsp;/gi,
567
- '\xA0'
568
- ],
569
- [
570
- /<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
571
- function (str, spaces) {
572
- return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join('\xA0') : '';
573
- }
574
- ]
575
- ]);
576
- var validElements = $_dbkrisijjm0ofzoy.getWordValidElements(editor);
577
- var schema = global$8({
578
- valid_elements: validElements,
579
- valid_children: '-li[p]'
580
- });
581
- global$3.each(schema.elements, function (rule) {
582
- if (!rule.attributes.class) {
583
- rule.attributes.class = {};
584
- rule.attributesOrder.push('class');
585
- }
586
- if (!rule.attributes.style) {
587
- rule.attributes.style = {};
588
- rule.attributesOrder.push('style');
589
- }
590
- });
591
- var domParser = global$6({}, schema);
592
- domParser.addAttributeFilter('style', function (nodes) {
593
- var i = nodes.length, node;
594
- while (i--) {
595
- node = nodes[i];
596
- node.attr('style', filterStyles(editor, validStyles, node, node.attr('style')));
597
- if (node.name === 'span' && node.parent && !node.attributes.length) {
598
- node.unwrap();
599
- }
600
- }
601
- });
602
- domParser.addAttributeFilter('class', function (nodes) {
603
- var i = nodes.length, node, className;
604
- while (i--) {
605
- node = nodes[i];
606
- className = node.attr('class');
607
- if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
608
- node.remove();
409
+ if (node = node.firstChild) {
410
+ do {
411
+ removeIgnoredNodes(node);
412
+ } while (node = node.next);
609
413
  }
610
- node.attr('class', null);
611
414
  }
612
- });
613
- domParser.addNodeFilter('del', function (nodes) {
614
- var i = nodes.length;
615
- while (i--) {
616
- nodes[i].remove();
617
- }
618
- });
619
- domParser.addNodeFilter('a', function (nodes) {
620
- var i = nodes.length, node, href, name;
621
- while (i--) {
622
- node = nodes[i];
623
- href = node.attr('href');
624
- name = node.attr('name');
625
- if (href && href.indexOf('#_msocom_') !== -1) {
626
- node.remove();
627
- continue;
628
- }
629
- if (href && href.indexOf('file://') === 0) {
630
- href = href.split('#')[1];
631
- if (href) {
632
- href = '#' + href;
415
+ function convertParagraphToLi(paragraphNode, listName, start) {
416
+ var level = paragraphNode._listLevel || lastLevel;
417
+ if (level !== lastLevel) {
418
+ if (level < lastLevel) {
419
+ if (currentListNode) {
420
+ currentListNode = currentListNode.parent.parent;
421
+ }
422
+ } else {
423
+ prevListNode = currentListNode;
424
+ currentListNode = null;
633
425
  }
634
426
  }
635
- if (!href && !name) {
636
- node.unwrap();
637
- } else {
638
- if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) {
639
- node.unwrap();
640
- continue;
427
+ if (!currentListNode || currentListNode.name !== listName) {
428
+ prevListNode = prevListNode || currentListNode;
429
+ currentListNode = new global$7(listName, 1);
430
+ if (start > 1) {
431
+ currentListNode.attr('start', '' + start);
641
432
  }
642
- node.attr({
643
- href: href,
644
- name: name
645
- });
433
+ paragraphNode.wrap(currentListNode);
434
+ } else {
435
+ currentListNode.append(paragraphNode);
646
436
  }
647
- }
648
- });
649
- var rootNode = domParser.parse(content);
650
- if ($_dbkrisijjm0ofzoy.shouldConvertWordFakeLists(editor)) {
651
- convertFakeListsToProperLists(rootNode);
652
- }
653
- content = global$9({ validate: editor.settings.validate }, schema).serialize(rootNode);
654
- return content;
655
- };
656
- var preProcess = function (editor, content) {
657
- return $_dbkrisijjm0ofzoy.shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content;
658
- };
659
- var $_52rjxviujm0ofzpl = {
660
- preProcess: preProcess,
661
- isWordContent: isWordContent
662
- };
663
-
664
- var processResult = function (content, cancelled) {
665
- return {
666
- content: content,
667
- cancelled: cancelled
668
- };
669
- };
670
- var postProcessFilter = function (editor, html, internal, isWordHtml) {
671
- var tempBody = editor.dom.create('div', { style: 'display:none' }, html);
672
- var postProcessArgs = $_4gidzbiijm0ofzow.firePastePostProcess(editor, tempBody, internal, isWordHtml);
673
- return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented());
674
- };
675
- var filterContent = function (editor, content, internal, isWordHtml) {
676
- var preProcessArgs = $_4gidzbiijm0ofzow.firePastePreProcess(editor, content, internal, isWordHtml);
677
- if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) {
678
- return postProcessFilter(editor, preProcessArgs.content, internal, isWordHtml);
679
- } else {
680
- return processResult(preProcessArgs.content, preProcessArgs.isDefaultPrevented());
681
- }
682
- };
683
- var process = function (editor, html, internal) {
684
- var isWordHtml = $_52rjxviujm0ofzpl.isWordContent(html);
685
- var content = isWordHtml ? $_52rjxviujm0ofzpl.preProcess(editor, html) : html;
686
- return filterContent(editor, content, internal, isWordHtml);
687
- };
688
- var $_432mgditjm0ofzph = { process: process };
689
-
690
- var pasteHtml = function (editor, html) {
691
- editor.insertContent(html, {
692
- merge: $_dbkrisijjm0ofzoy.shouldMergeFormats(editor),
693
- paste: true
694
- });
695
- return true;
696
- };
697
- var isAbsoluteUrl = function (url) {
698
- return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url);
699
- };
700
- var isImageUrl = function (url) {
701
- return isAbsoluteUrl(url) && /.(gif|jpe?g|png)$/.test(url);
702
- };
703
- var createImage = function (editor, url, pasteHtmlFn) {
704
- editor.undoManager.extra(function () {
705
- pasteHtmlFn(editor, url);
706
- }, function () {
707
- editor.insertContent('<img src="' + url + '">');
708
- });
709
- return true;
710
- };
711
- var createLink = function (editor, url, pasteHtmlFn) {
712
- editor.undoManager.extra(function () {
713
- pasteHtmlFn(editor, url);
714
- }, function () {
715
- editor.execCommand('mceInsertLink', false, url);
716
- });
717
- return true;
718
- };
719
- var linkSelection = function (editor, html, pasteHtmlFn) {
720
- return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false;
721
- };
722
- var insertImage = function (editor, html, pasteHtmlFn) {
723
- return isImageUrl(html) ? createImage(editor, html, pasteHtmlFn) : false;
724
- };
725
- var smartInsertContent = function (editor, html) {
726
- global$3.each([
727
- linkSelection,
728
- insertImage,
729
- pasteHtml
730
- ], function (action) {
731
- return action(editor, html, pasteHtml) !== true;
732
- });
733
- };
734
- var insertContent = function (editor, html) {
735
- if ($_dbkrisijjm0ofzoy.isSmartPasteEnabled(editor) === false) {
736
- pasteHtml(editor, html);
737
- } else {
738
- smartInsertContent(editor, html);
739
- }
740
- };
741
- var $_cazeczj0jm0ofzpz = {
742
- isImageUrl: isImageUrl,
743
- isAbsoluteUrl: isAbsoluteUrl,
744
- insertContent: insertContent
745
- };
746
-
747
- var pasteHtml$1 = function (editor, html, internalFlag) {
748
- var internal = internalFlag ? internalFlag : $_21ba1xiqjm0ofzpc.isMarked(html);
749
- var args = $_432mgditjm0ofzph.process(editor, $_21ba1xiqjm0ofzpc.unmark(html), internal);
750
- if (args.cancelled === false) {
751
- $_cazeczj0jm0ofzpz.insertContent(editor, args.content);
752
- }
753
- };
754
- var pasteText = function (editor, text) {
755
- text = editor.dom.encode(text).replace(/\r\n/g, '\n');
756
- text = $_67xxvyirjm0ofzpe.convert(text, editor.settings.forced_root_block, editor.settings.forced_root_block_attrs);
757
- pasteHtml$1(editor, text, false);
758
- };
759
- var getDataTransferItems = function (dataTransfer) {
760
- var items = {};
761
- var mceInternalUrlPrefix = 'data:text/mce-internal,';
762
- if (dataTransfer) {
763
- if (dataTransfer.getData) {
764
- var legacyText = dataTransfer.getData('Text');
765
- if (legacyText && legacyText.length > 0) {
766
- if (legacyText.indexOf(mceInternalUrlPrefix) === -1) {
767
- items['text/plain'] = legacyText;
768
- }
437
+ paragraphNode.name = 'li';
438
+ if (level > lastLevel && prevListNode) {
439
+ prevListNode.lastChild.append(currentListNode);
769
440
  }
770
- }
771
- if (dataTransfer.types) {
772
- for (var i = 0; i < dataTransfer.types.length; i++) {
773
- var contentType = dataTransfer.types[i];
774
- try {
775
- items[contentType] = dataTransfer.getData(contentType);
776
- } catch (ex) {
777
- items[contentType] = '';
441
+ lastLevel = level;
442
+ removeIgnoredNodes(paragraphNode);
443
+ trimListStart(paragraphNode, /^\u00a0+/);
444
+ trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);
445
+ trimListStart(paragraphNode, /^\u00a0+/);
446
+ }
447
+ var elements = [];
448
+ var child = node.firstChild;
449
+ while (typeof child !== 'undefined' && child !== null) {
450
+ elements.push(child);
451
+ child = child.walk();
452
+ if (child !== null) {
453
+ while (typeof child !== 'undefined' && child.parent !== node) {
454
+ child = child.walk();
778
455
  }
779
456
  }
780
457
  }
781
- }
782
- return items;
783
- };
784
- var getClipboardContent = function (editor, clipboardEvent) {
785
- var content = getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer);
786
- return $_1340csizjm0ofzpu.isMsEdge() ? global$3.extend(content, { 'text/html': '' }) : content;
787
- };
788
- var hasContentType = function (clipboardContent, mimeType) {
789
- return mimeType in clipboardContent && clipboardContent[mimeType].length > 0;
790
- };
791
- var hasHtmlOrText = function (content) {
792
- return hasContentType(content, 'text/html') || hasContentType(content, 'text/plain');
793
- };
794
- var getBase64FromUri = function (uri) {
795
- var idx;
796
- idx = uri.indexOf(',');
797
- if (idx !== -1) {
798
- return uri.substr(idx + 1);
799
- }
800
- return null;
801
- };
802
- var isValidDataUriImage = function (settings, imgElm) {
803
- return settings.images_dataimg_filter ? settings.images_dataimg_filter(imgElm) : true;
804
- };
805
- var extractFilename = function (editor, str) {
806
- var m = str.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);
807
- return m ? editor.dom.encode(m[1]) : null;
808
- };
809
- var uniqueId = $_1340csizjm0ofzpu.createIdGenerator('mceclip');
810
- var pasteImage = function (editor, rng, reader, blob) {
811
- if (rng) {
812
- editor.selection.setRng(rng);
813
- rng = null;
814
- }
815
- var dataUri = reader.result;
816
- var base64 = getBase64FromUri(dataUri);
817
- var id = uniqueId();
818
- var name$$1 = editor.settings.images_reuse_filename && blob.name ? extractFilename(editor, blob.name) : id;
819
- var img = new Image();
820
- img.src = dataUri;
821
- if (isValidDataUriImage(editor.settings, img)) {
822
- var blobCache = editor.editorUpload.blobCache;
823
- var blobInfo = void 0, existingBlobInfo = void 0;
824
- existingBlobInfo = blobCache.findFirst(function (cachedBlobInfo) {
825
- return cachedBlobInfo.base64() === base64;
826
- });
827
- if (!existingBlobInfo) {
828
- blobInfo = blobCache.create(id, blob, base64, name$$1);
829
- blobCache.add(blobInfo);
830
- } else {
831
- blobInfo = existingBlobInfo;
832
- }
833
- pasteHtml$1(editor, '<img src="' + blobInfo.blobUri() + '">', false);
834
- } else {
835
- pasteHtml$1(editor, '<img src="' + dataUri + '">', false);
836
- }
837
- };
838
- var isClipboardEvent = function (event$$1) {
839
- return event$$1.type === 'paste';
840
- };
841
- var pasteImageData = function (editor, e, rng) {
842
- var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer;
843
- function processItems(items) {
844
- var i, item, reader, hadImage = false;
845
- if (items) {
846
- for (i = 0; i < items.length; i++) {
847
- item = items[i];
848
- if (/^image\/(jpeg|png|gif|bmp)$/.test(item.type)) {
849
- var blob = item.getAsFile ? item.getAsFile() : item;
850
- reader = new window.FileReader();
851
- reader.onload = pasteImage.bind(null, editor, rng, reader, blob);
852
- reader.readAsDataURL(blob);
853
- e.preventDefault();
854
- hadImage = true;
458
+ for (var i = 0; i < elements.length; i++) {
459
+ node = elements[i];
460
+ if (node.name === 'p' && node.firstChild) {
461
+ var nodeText = getText(node);
462
+ if (isBulletList(nodeText)) {
463
+ convertParagraphToLi(node, 'ul');
464
+ continue;
465
+ }
466
+ if (isNumericList(nodeText)) {
467
+ var matches = /([0-9]+)\./.exec(nodeText);
468
+ var start = 1;
469
+ if (matches) {
470
+ start = parseInt(matches[1], 10);
471
+ }
472
+ convertParagraphToLi(node, 'ol', start);
473
+ continue;
474
+ }
475
+ if (node._listLevel) {
476
+ convertParagraphToLi(node, 'ul', 1);
477
+ continue;
855
478
  }
479
+ currentListNode = null;
480
+ } else {
481
+ prevListNode = currentListNode;
482
+ currentListNode = null;
856
483
  }
857
484
  }
858
- return hadImage;
859
- }
860
- if (editor.settings.paste_data_images && dataTransfer) {
861
- return processItems(dataTransfer.items) || processItems(dataTransfer.files);
862
485
  }
863
- };
864
- var isBrokenAndroidClipboardEvent = function (e) {
865
- var clipboardData = e.clipboardData;
866
- return navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
867
- };
868
- var isKeyboardPasteEvent = function (e) {
869
- return global$4.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45;
870
- };
871
- var registerEventHandlers = function (editor, pasteBin, pasteFormat) {
872
- var keyboardPasteTimeStamp = 0;
873
- var keyboardPastePlainTextState;
874
- editor.on('keydown', function (e) {
875
- function removePasteBinOnKeyUp(e) {
876
- if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
877
- pasteBin.remove();
878
- }
879
- }
880
- if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
881
- keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86;
882
- if (keyboardPastePlainTextState && global$1.webkit && navigator.userAgent.indexOf('Version/') !== -1) {
486
+ function filterStyles(editor, validStyles, node, styleValue) {
487
+ var outputStyles = {}, matches;
488
+ var styles = editor.dom.parseStyle(styleValue);
489
+ global$3.each(styles, function (value, name) {
490
+ switch (name) {
491
+ case 'mso-list':
492
+ matches = /\w+ \w+([0-9]+)/i.exec(styleValue);
493
+ if (matches) {
494
+ node._listLevel = parseInt(matches[1], 10);
495
+ }
496
+ if (/Ignore/i.test(value) && node.firstChild) {
497
+ node._listIgnore = true;
498
+ node.firstChild._listIgnore = true;
499
+ }
500
+ break;
501
+ case 'horiz-align':
502
+ name = 'text-align';
503
+ break;
504
+ case 'vert-align':
505
+ name = 'vertical-align';
506
+ break;
507
+ case 'font-color':
508
+ case 'mso-foreground':
509
+ name = 'color';
510
+ break;
511
+ case 'mso-background':
512
+ case 'mso-highlight':
513
+ name = 'background';
514
+ break;
515
+ case 'font-weight':
516
+ case 'font-style':
517
+ if (value !== 'normal') {
518
+ outputStyles[name] = value;
519
+ }
883
520
  return;
521
+ case 'mso-element':
522
+ if (/^(comment|comment-list)$/i.test(value)) {
523
+ node.remove();
524
+ return;
525
+ }
526
+ break;
884
527
  }
885
- e.stopImmediatePropagation();
886
- keyboardPasteTimeStamp = new Date().getTime();
887
- if (global$1.ie && keyboardPastePlainTextState) {
888
- e.preventDefault();
889
- $_4gidzbiijm0ofzow.firePaste(editor, true);
528
+ if (name.indexOf('mso-comment') === 0) {
529
+ node.remove();
890
530
  return;
891
531
  }
892
- pasteBin.remove();
893
- pasteBin.create();
894
- editor.once('keyup', removePasteBinOnKeyUp);
895
- editor.once('paste', function () {
896
- editor.off('keyup', removePasteBinOnKeyUp);
897
- });
898
- }
899
- });
900
- function insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal) {
901
- var content, isPlainTextHtml;
902
- if (hasContentType(clipboardContent, 'text/html')) {
903
- content = clipboardContent['text/html'];
904
- } else {
905
- content = pasteBin.getHtml();
906
- internal = internal ? internal : $_21ba1xiqjm0ofzpc.isMarked(content);
907
- if (pasteBin.isDefaultContent(content)) {
908
- plainTextMode = true;
532
+ if (name.indexOf('mso-') === 0) {
533
+ return;
909
534
  }
910
- }
911
- content = $_1340csizjm0ofzpu.trimHtml(content);
912
- pasteBin.remove();
913
- isPlainTextHtml = internal === false && $_67xxvyirjm0ofzpe.isPlainText(content);
914
- if (!content.length || isPlainTextHtml) {
915
- plainTextMode = true;
916
- }
917
- if (plainTextMode) {
918
- if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) {
919
- content = clipboardContent['text/plain'];
920
- } else {
921
- content = $_1340csizjm0ofzpu.innerText(content);
535
+ if (Settings.getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) {
536
+ outputStyles[name] = value;
922
537
  }
538
+ });
539
+ if (/(bold)/i.test(outputStyles['font-weight'])) {
540
+ delete outputStyles['font-weight'];
541
+ node.wrap(new global$7('b', 1));
923
542
  }
924
- if (pasteBin.isDefaultContent(content)) {
925
- if (!isKeyBoardPaste) {
926
- editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.');
927
- }
928
- return;
543
+ if (/(italic)/i.test(outputStyles['font-style'])) {
544
+ delete outputStyles['font-style'];
545
+ node.wrap(new global$7('i', 1));
929
546
  }
930
- if (plainTextMode) {
931
- pasteText(editor, content);
932
- } else {
933
- pasteHtml$1(editor, content, internal);
547
+ outputStyles = editor.dom.serializeStyle(outputStyles, node.name);
548
+ if (outputStyles) {
549
+ return outputStyles;
934
550
  }
551
+ return null;
935
552
  }
936
- var getLastRng = function () {
937
- return pasteBin.getLastRng() || editor.selection.getRng();
938
- };
939
- editor.on('paste', function (e) {
940
- var clipboardTimer = new Date().getTime();
941
- var clipboardContent = getClipboardContent(editor, e);
942
- var clipboardDelay = new Date().getTime() - clipboardTimer;
943
- var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp - clipboardDelay < 1000;
944
- var plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState;
945
- var internal = hasContentType(clipboardContent, $_21ba1xiqjm0ofzpc.internalHtmlMime());
946
- keyboardPastePlainTextState = false;
947
- if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
948
- pasteBin.remove();
949
- return;
950
- }
951
- if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) {
952
- pasteBin.remove();
953
- return;
954
- }
955
- if (!isKeyBoardPaste) {
956
- e.preventDefault();
957
- }
958
- if (global$1.ie && (!isKeyBoardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) {
959
- pasteBin.create();
960
- editor.dom.bind(pasteBin.getEl(), 'paste', function (e) {
961
- e.stopPropagation();
962
- });
963
- editor.getDoc().execCommand('Paste', false, null);
964
- clipboardContent['text/html'] = pasteBin.getHtml();
965
- }
966
- if (hasContentType(clipboardContent, 'text/html')) {
967
- e.preventDefault();
968
- if (!internal) {
969
- internal = $_21ba1xiqjm0ofzpc.isMarked(clipboardContent['text/html']);
553
+ var filterWordContent = function (editor, content) {
554
+ var retainStyleProperties, validStyles;
555
+ retainStyleProperties = Settings.getRetainStyleProps(editor);
556
+ if (retainStyleProperties) {
557
+ validStyles = global$3.makeMap(retainStyleProperties.split(/[, ]/));
558
+ }
559
+ content = Utils.filter(content, [
560
+ /<br class="?Apple-interchange-newline"?>/gi,
561
+ /<b[^>]+id="?docs-internal-[^>]*>/gi,
562
+ /<!--[\s\S]+?-->/gi,
563
+ /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
564
+ [
565
+ /<(\/?)s>/gi,
566
+ '<$1strike>'
567
+ ],
568
+ [
569
+ /&nbsp;/gi,
570
+ '\xA0'
571
+ ],
572
+ [
573
+ /<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
574
+ function (str, spaces) {
575
+ return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join('\xA0') : '';
576
+ }
577
+ ]
578
+ ]);
579
+ var validElements = Settings.getWordValidElements(editor);
580
+ var schema = global$8({
581
+ valid_elements: validElements,
582
+ valid_children: '-li[p]'
583
+ });
584
+ global$3.each(schema.elements, function (rule) {
585
+ if (!rule.attributes.class) {
586
+ rule.attributes.class = {};
587
+ rule.attributesOrder.push('class');
970
588
  }
971
- insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
972
- } else {
973
- global$2.setEditorTimeout(editor, function () {
974
- insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
975
- }, 0);
976
- }
977
- });
978
- };
979
- var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) {
980
- registerEventHandlers(editor, pasteBin, pasteFormat);
981
- var src;
982
- editor.parser.addNodeFilter('img', function (nodes, name$$1, args) {
983
- var isPasteInsert = function (args) {
984
- return args.data && args.data.paste === true;
985
- };
986
- var remove = function (node) {
987
- if (!node.attr('data-mce-object') && src !== global$1.transparentSrc) {
988
- node.remove();
589
+ if (!rule.attributes.style) {
590
+ rule.attributes.style = {};
591
+ rule.attributesOrder.push('style');
989
592
  }
990
- };
991
- var isWebKitFakeUrl = function (src) {
992
- return src.indexOf('webkit-fake-url') === 0;
993
- };
994
- var isDataUri = function (src) {
995
- return src.indexOf('data:') === 0;
996
- };
997
- if (!editor.settings.paste_data_images && isPasteInsert(args)) {
593
+ });
594
+ var domParser = global$6({}, schema);
595
+ domParser.addAttributeFilter('style', function (nodes) {
596
+ var i = nodes.length, node;
597
+ while (i--) {
598
+ node = nodes[i];
599
+ node.attr('style', filterStyles(editor, validStyles, node, node.attr('style')));
600
+ if (node.name === 'span' && node.parent && !node.attributes.length) {
601
+ node.unwrap();
602
+ }
603
+ }
604
+ });
605
+ domParser.addAttributeFilter('class', function (nodes) {
606
+ var i = nodes.length, node, className;
607
+ while (i--) {
608
+ node = nodes[i];
609
+ className = node.attr('class');
610
+ if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
611
+ node.remove();
612
+ }
613
+ node.attr('class', null);
614
+ }
615
+ });
616
+ domParser.addNodeFilter('del', function (nodes) {
998
617
  var i = nodes.length;
999
618
  while (i--) {
1000
- src = nodes[i].attributes.map.src;
1001
- if (!src) {
619
+ nodes[i].remove();
620
+ }
621
+ });
622
+ domParser.addNodeFilter('a', function (nodes) {
623
+ var i = nodes.length, node, href, name;
624
+ while (i--) {
625
+ node = nodes[i];
626
+ href = node.attr('href');
627
+ name = node.attr('name');
628
+ if (href && href.indexOf('#_msocom_') !== -1) {
629
+ node.remove();
1002
630
  continue;
1003
631
  }
1004
- if (isWebKitFakeUrl(src)) {
1005
- remove(nodes[i]);
1006
- } else if (!editor.settings.allow_html_data_urls && isDataUri(src)) {
1007
- remove(nodes[i]);
632
+ if (href && href.indexOf('file://') === 0) {
633
+ href = href.split('#')[1];
634
+ if (href) {
635
+ href = '#' + href;
636
+ }
637
+ }
638
+ if (!href && !name) {
639
+ node.unwrap();
640
+ } else {
641
+ if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) {
642
+ node.unwrap();
643
+ continue;
644
+ }
645
+ node.attr({
646
+ href: href,
647
+ name: name
648
+ });
1008
649
  }
1009
650
  }
651
+ });
652
+ var rootNode = domParser.parse(content);
653
+ if (Settings.shouldConvertWordFakeLists(editor)) {
654
+ convertFakeListsToProperLists(rootNode);
1010
655
  }
1011
- });
1012
- };
656
+ content = global$9({ validate: editor.settings.validate }, schema).serialize(rootNode);
657
+ return content;
658
+ };
659
+ var preProcess = function (editor, content) {
660
+ return Settings.shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content;
661
+ };
662
+ var WordFilter = {
663
+ preProcess: preProcess,
664
+ isWordContent: isWordContent
665
+ };
1013
666
 
1014
- var getPasteBinParent = function (editor) {
1015
- return global$1.ie && editor.inline ? document.body : editor.getBody();
1016
- };
1017
- var isExternalPasteBin = function (editor) {
1018
- return getPasteBinParent(editor) !== editor.getBody();
1019
- };
1020
- var delegatePasteEvents = function (editor, pasteBinElm, pasteBinDefaultContent) {
1021
- if (isExternalPasteBin(editor)) {
1022
- editor.dom.bind(pasteBinElm, 'paste keyup', function (e) {
1023
- if (!isDefault(editor, pasteBinDefaultContent)) {
1024
- editor.fire('paste');
1025
- }
1026
- });
1027
- }
1028
- };
1029
- var create = function (editor, lastRngCell, pasteBinDefaultContent) {
1030
- var dom = editor.dom, body = editor.getBody();
1031
- var pasteBinElm;
1032
- lastRngCell.set(editor.selection.getRng());
1033
- pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', {
1034
- 'id': 'mcepastebin',
1035
- 'class': 'mce-pastebin',
1036
- 'contentEditable': true,
1037
- 'data-mce-bogus': 'all',
1038
- 'style': 'position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0'
1039
- }, pasteBinDefaultContent);
1040
- if (global$1.ie || global$1.gecko) {
1041
- dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) === 'rtl' ? 65535 : -65535);
1042
- }
1043
- dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function (e) {
1044
- e.stopPropagation();
1045
- });
1046
- delegatePasteEvents(editor, pasteBinElm, pasteBinDefaultContent);
1047
- pasteBinElm.focus();
1048
- editor.selection.select(pasteBinElm, true);
1049
- };
1050
- var remove = function (editor, lastRngCell) {
1051
- if (getEl(editor)) {
1052
- var pasteBinClone = void 0;
1053
- var lastRng = lastRngCell.get();
1054
- while (pasteBinClone = editor.dom.get('mcepastebin')) {
1055
- editor.dom.remove(pasteBinClone);
1056
- editor.dom.unbind(pasteBinClone);
667
+ var processResult = function (content, cancelled) {
668
+ return {
669
+ content: content,
670
+ cancelled: cancelled
671
+ };
672
+ };
673
+ var postProcessFilter = function (editor, html, internal, isWordHtml) {
674
+ var tempBody = editor.dom.create('div', { style: 'display:none' }, html);
675
+ var postProcessArgs = Events.firePastePostProcess(editor, tempBody, internal, isWordHtml);
676
+ return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented());
677
+ };
678
+ var filterContent = function (editor, content, internal, isWordHtml) {
679
+ var preProcessArgs = Events.firePastePreProcess(editor, content, internal, isWordHtml);
680
+ if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) {
681
+ return postProcessFilter(editor, preProcessArgs.content, internal, isWordHtml);
682
+ } else {
683
+ return processResult(preProcessArgs.content, preProcessArgs.isDefaultPrevented());
1057
684
  }
1058
- if (lastRng) {
1059
- editor.selection.setRng(lastRng);
685
+ };
686
+ var process = function (editor, html, internal) {
687
+ var isWordHtml = WordFilter.isWordContent(html);
688
+ var content = isWordHtml ? WordFilter.preProcess(editor, html) : html;
689
+ return filterContent(editor, content, internal, isWordHtml);
690
+ };
691
+ var ProcessFilters = { process: process };
692
+
693
+ var removeMeta = function (editor, html) {
694
+ var body = editor.dom.create('body', {}, html);
695
+ global$3.each(body.querySelectorAll('meta'), function (elm) {
696
+ return elm.parentNode.removeChild(elm);
697
+ });
698
+ return body.innerHTML;
699
+ };
700
+ var pasteHtml = function (editor, html) {
701
+ editor.insertContent(removeMeta(editor, html), {
702
+ merge: Settings.shouldMergeFormats(editor),
703
+ paste: true
704
+ });
705
+ return true;
706
+ };
707
+ var isAbsoluteUrl = function (url) {
708
+ return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url);
709
+ };
710
+ var isImageUrl = function (url) {
711
+ return isAbsoluteUrl(url) && /.(gif|jpe?g|png)$/.test(url);
712
+ };
713
+ var createImage = function (editor, url, pasteHtmlFn) {
714
+ editor.undoManager.extra(function () {
715
+ pasteHtmlFn(editor, url);
716
+ }, function () {
717
+ editor.insertContent('<img src="' + url + '">');
718
+ });
719
+ return true;
720
+ };
721
+ var createLink = function (editor, url, pasteHtmlFn) {
722
+ editor.undoManager.extra(function () {
723
+ pasteHtmlFn(editor, url);
724
+ }, function () {
725
+ editor.execCommand('mceInsertLink', false, url);
726
+ });
727
+ return true;
728
+ };
729
+ var linkSelection = function (editor, html, pasteHtmlFn) {
730
+ return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false;
731
+ };
732
+ var insertImage = function (editor, html, pasteHtmlFn) {
733
+ return isImageUrl(html) ? createImage(editor, html, pasteHtmlFn) : false;
734
+ };
735
+ var smartInsertContent = function (editor, html) {
736
+ global$3.each([
737
+ linkSelection,
738
+ insertImage,
739
+ pasteHtml
740
+ ], function (action) {
741
+ return action(editor, html, pasteHtml) !== true;
742
+ });
743
+ };
744
+ var insertContent = function (editor, html) {
745
+ if (Settings.isSmartPasteEnabled(editor) === false) {
746
+ pasteHtml(editor, html);
747
+ } else {
748
+ smartInsertContent(editor, html);
1060
749
  }
750
+ };
751
+ var SmartPaste = {
752
+ isImageUrl: isImageUrl,
753
+ isAbsoluteUrl: isAbsoluteUrl,
754
+ insertContent: insertContent
755
+ };
756
+
757
+ var constant = function (value) {
758
+ return function () {
759
+ return value;
760
+ };
761
+ };
762
+ function curry(fn) {
763
+ var initialArgs = [];
764
+ for (var _i = 1; _i < arguments.length; _i++) {
765
+ initialArgs[_i - 1] = arguments[_i];
766
+ }
767
+ return function () {
768
+ var restArgs = [];
769
+ for (var _i = 0; _i < arguments.length; _i++) {
770
+ restArgs[_i] = arguments[_i];
771
+ }
772
+ var all = initialArgs.concat(restArgs);
773
+ return fn.apply(null, all);
774
+ };
1061
775
  }
1062
- lastRngCell.set(null);
1063
- };
1064
- var getEl = function (editor) {
1065
- return editor.dom.get('mcepastebin');
1066
- };
1067
- var getHtml = function (editor) {
1068
- var pasteBinElm, pasteBinClones, i, dirtyWrappers, cleanWrapper;
1069
- var copyAndRemove = function (toElm, fromElm) {
1070
- toElm.appendChild(fromElm);
1071
- editor.dom.remove(fromElm, true);
1072
- };
1073
- pasteBinClones = global$3.grep(getPasteBinParent(editor).childNodes, function (elm) {
1074
- return elm.id === 'mcepastebin';
1075
- });
1076
- pasteBinElm = pasteBinClones.shift();
1077
- global$3.each(pasteBinClones, function (pasteBinClone) {
1078
- copyAndRemove(pasteBinElm, pasteBinClone);
1079
- });
1080
- dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm);
1081
- for (i = dirtyWrappers.length - 1; i >= 0; i--) {
1082
- cleanWrapper = editor.dom.create('div');
1083
- pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]);
1084
- copyAndRemove(cleanWrapper, dirtyWrappers[i]);
1085
- }
1086
- return pasteBinElm ? pasteBinElm.innerHTML : '';
1087
- };
1088
- var getLastRng = function (lastRng) {
1089
- return lastRng.get();
1090
- };
1091
- var isDefaultContent = function (pasteBinDefaultContent, content) {
1092
- return content === pasteBinDefaultContent;
1093
- };
1094
- var isPasteBin = function (elm) {
1095
- return elm && elm.id === 'mcepastebin';
1096
- };
1097
- var isDefault = function (editor, pasteBinDefaultContent) {
1098
- var pasteBinElm = getEl(editor);
1099
- return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML);
1100
- };
1101
- var PasteBin = function (editor) {
1102
- var lastRng = Cell(null);
1103
- var pasteBinDefaultContent = '%MCEPASTEBIN%';
1104
- return {
1105
- create: function () {
1106
- return create(editor, lastRng, pasteBinDefaultContent);
1107
- },
1108
- remove: function () {
1109
- return remove(editor, lastRng);
1110
- },
1111
- getEl: function () {
1112
- return getEl(editor);
1113
- },
1114
- getHtml: function () {
1115
- return getHtml(editor);
1116
- },
1117
- getLastRng: function () {
1118
- return getLastRng(lastRng);
1119
- },
1120
- isDefault: function () {
1121
- return isDefault(editor, pasteBinDefaultContent);
1122
- },
1123
- isDefaultContent: function (content) {
1124
- return isDefaultContent(pasteBinDefaultContent, content);
1125
- }
776
+ var never = constant(false);
777
+ var always = constant(true);
778
+
779
+ var never$1 = never;
780
+ var always$1 = always;
781
+ var none = function () {
782
+ return NONE;
783
+ };
784
+ var NONE = function () {
785
+ var eq = function (o) {
786
+ return o.isNone();
787
+ };
788
+ var call$$1 = function (thunk) {
789
+ return thunk();
790
+ };
791
+ var id = function (n) {
792
+ return n;
793
+ };
794
+ var noop$$1 = function () {
795
+ };
796
+ var nul = function () {
797
+ return null;
798
+ };
799
+ var undef = function () {
800
+ return undefined;
801
+ };
802
+ var me = {
803
+ fold: function (n, s) {
804
+ return n();
805
+ },
806
+ is: never$1,
807
+ isSome: never$1,
808
+ isNone: always$1,
809
+ getOr: id,
810
+ getOrThunk: call$$1,
811
+ getOrDie: function (msg) {
812
+ throw new Error(msg || 'error: getOrDie called on none.');
813
+ },
814
+ getOrNull: nul,
815
+ getOrUndefined: undef,
816
+ or: id,
817
+ orThunk: call$$1,
818
+ map: none,
819
+ ap: none,
820
+ each: noop$$1,
821
+ bind: none,
822
+ flatten: none,
823
+ exists: never$1,
824
+ forall: always$1,
825
+ filter: none,
826
+ equals: eq,
827
+ equals_: eq,
828
+ toArray: function () {
829
+ return [];
830
+ },
831
+ toString: constant('none()')
832
+ };
833
+ if (Object.freeze)
834
+ Object.freeze(me);
835
+ return me;
836
+ }();
837
+ var some = function (a) {
838
+ var constant_a = function () {
839
+ return a;
840
+ };
841
+ var self = function () {
842
+ return me;
843
+ };
844
+ var map = function (f) {
845
+ return some(f(a));
846
+ };
847
+ var bind = function (f) {
848
+ return f(a);
849
+ };
850
+ var me = {
851
+ fold: function (n, s) {
852
+ return s(a);
853
+ },
854
+ is: function (v) {
855
+ return a === v;
856
+ },
857
+ isSome: always$1,
858
+ isNone: never$1,
859
+ getOr: constant_a,
860
+ getOrThunk: constant_a,
861
+ getOrDie: constant_a,
862
+ getOrNull: constant_a,
863
+ getOrUndefined: constant_a,
864
+ or: self,
865
+ orThunk: self,
866
+ map: map,
867
+ ap: function (optfab) {
868
+ return optfab.fold(none, function (fab) {
869
+ return some(fab(a));
870
+ });
871
+ },
872
+ each: function (f) {
873
+ f(a);
874
+ },
875
+ bind: bind,
876
+ flatten: constant_a,
877
+ exists: bind,
878
+ forall: bind,
879
+ filter: function (f) {
880
+ return f(a) ? me : NONE;
881
+ },
882
+ equals: function (o) {
883
+ return o.is(a);
884
+ },
885
+ equals_: function (o, elementEq) {
886
+ return o.fold(never$1, function (b) {
887
+ return elementEq(a, b);
888
+ });
889
+ },
890
+ toArray: function () {
891
+ return [a];
892
+ },
893
+ toString: function () {
894
+ return 'some(' + a + ')';
895
+ }
896
+ };
897
+ return me;
898
+ };
899
+ var from = function (value) {
900
+ return value === null || value === undefined ? NONE : some(value);
901
+ };
902
+ var Option = {
903
+ some: some,
904
+ none: none,
905
+ from: from
1126
906
  };
1127
- };
1128
907
 
1129
- var Clipboard = function (editor, pasteFormat) {
1130
- var pasteBin = PasteBin(editor);
1131
- editor.on('preInit', function () {
1132
- return registerEventsAndFilters(editor, pasteBin, pasteFormat);
1133
- });
1134
- return {
1135
- pasteFormat: pasteFormat,
1136
- pasteHtml: function (html, internalFlag) {
1137
- return pasteHtml$1(editor, html, internalFlag);
1138
- },
1139
- pasteText: function (text) {
1140
- return pasteText(editor, text);
1141
- },
1142
- pasteImageData: function (e, rng) {
1143
- return pasteImageData(editor, e, rng);
1144
- },
1145
- getDataTransferItems: getDataTransferItems,
1146
- hasHtmlOrText: hasHtmlOrText,
1147
- hasContentType: hasContentType
1148
- };
1149
- };
908
+ var typeOf = function (x) {
909
+ if (x === null)
910
+ return 'null';
911
+ var t = typeof x;
912
+ if (t === 'object' && Array.prototype.isPrototypeOf(x))
913
+ return 'array';
914
+ if (t === 'object' && String.prototype.isPrototypeOf(x))
915
+ return 'string';
916
+ return t;
917
+ };
918
+ var isType = function (type) {
919
+ return function (value) {
920
+ return typeOf(value) === type;
921
+ };
922
+ };
923
+ var isFunction = isType('function');
1150
924
 
1151
- var noop = function () {
1152
- };
1153
- var hasWorkingClipboardApi = function (clipboardData) {
1154
- return global$1.iOS === false && clipboardData !== undefined && typeof clipboardData.setData === 'function' && $_1340csizjm0ofzpu.isMsEdge() !== true;
1155
- };
1156
- var setHtml5Clipboard = function (clipboardData, html, text) {
1157
- if (hasWorkingClipboardApi(clipboardData)) {
1158
- try {
1159
- clipboardData.clearData();
1160
- clipboardData.setData('text/html', html);
1161
- clipboardData.setData('text/plain', text);
1162
- clipboardData.setData($_21ba1xiqjm0ofzpc.internalHtmlMime(), html);
1163
- return true;
1164
- } catch (e) {
1165
- return false;
925
+ var map = function (xs, f) {
926
+ var len = xs.length;
927
+ var r = new Array(len);
928
+ for (var i = 0; i < len; i++) {
929
+ var x = xs[i];
930
+ r[i] = f(x, i, xs);
931
+ }
932
+ return r;
933
+ };
934
+ var each = function (xs, f) {
935
+ for (var i = 0, len = xs.length; i < len; i++) {
936
+ var x = xs[i];
937
+ f(x, i, xs);
1166
938
  }
1167
- } else {
1168
- return false;
1169
- }
1170
- };
1171
- var setClipboardData = function (evt, data, fallback, done) {
1172
- if (setHtml5Clipboard(evt.clipboardData, data.html, data.text)) {
1173
- evt.preventDefault();
1174
- done();
1175
- } else {
1176
- fallback(data.html, done);
1177
- }
1178
- };
1179
- var fallback = function (editor) {
1180
- return function (html, done) {
1181
- var markedHtml = $_21ba1xiqjm0ofzpc.mark(html);
1182
- var outer = editor.dom.create('div', {
1183
- 'contenteditable': 'false',
1184
- 'data-mce-bogus': 'all'
1185
- });
1186
- var inner = editor.dom.create('div', { contenteditable: 'true' }, markedHtml);
1187
- editor.dom.setStyles(outer, {
1188
- position: 'fixed',
1189
- top: '0',
1190
- left: '-3000px',
1191
- width: '1000px',
1192
- overflow: 'hidden'
1193
- });
1194
- outer.appendChild(inner);
1195
- editor.dom.add(editor.getBody(), outer);
1196
- var range = editor.selection.getRng();
1197
- inner.focus();
1198
- var offscreenRange = editor.dom.createRng();
1199
- offscreenRange.selectNodeContents(inner);
1200
- editor.selection.setRng(offscreenRange);
1201
- setTimeout(function () {
1202
- editor.selection.setRng(range);
1203
- outer.parentNode.removeChild(outer);
1204
- done();
1205
- }, 0);
1206
- };
1207
- };
1208
- var getData = function (editor) {
1209
- return {
1210
- html: editor.selection.getContent({ contextual: true }),
1211
- text: editor.selection.getContent({ format: 'text' })
1212
- };
1213
- };
1214
- var cut = function (editor) {
1215
- return function (evt) {
1216
- if (editor.selection.isCollapsed() === false) {
1217
- setClipboardData(evt, getData(editor), fallback(editor), function () {
939
+ };
940
+ var filter$1 = function (xs, pred) {
941
+ var r = [];
942
+ for (var i = 0, len = xs.length; i < len; i++) {
943
+ var x = xs[i];
944
+ if (pred(x, i, xs)) {
945
+ r.push(x);
946
+ }
947
+ }
948
+ return r;
949
+ };
950
+ var slice = Array.prototype.slice;
951
+ var from$1 = isFunction(Array.from) ? Array.from : function (x) {
952
+ return slice.call(x);
953
+ };
954
+
955
+ var nu = function (baseFn) {
956
+ var data = Option.none();
957
+ var callbacks = [];
958
+ var map$$1 = function (f) {
959
+ return nu(function (nCallback) {
960
+ get(function (data) {
961
+ nCallback(f(data));
962
+ });
963
+ });
964
+ };
965
+ var get = function (nCallback) {
966
+ if (isReady())
967
+ call(nCallback);
968
+ else
969
+ callbacks.push(nCallback);
970
+ };
971
+ var set = function (x) {
972
+ data = Option.some(x);
973
+ run(callbacks);
974
+ callbacks = [];
975
+ };
976
+ var isReady = function () {
977
+ return data.isSome();
978
+ };
979
+ var run = function (cbs) {
980
+ each(cbs, call);
981
+ };
982
+ var call = function (cb) {
983
+ data.each(function (x) {
1218
984
  setTimeout(function () {
1219
- editor.execCommand('Delete');
985
+ cb(x);
1220
986
  }, 0);
1221
987
  });
1222
- }
988
+ };
989
+ baseFn(set);
990
+ return {
991
+ get: get,
992
+ map: map$$1,
993
+ isReady: isReady
994
+ };
1223
995
  };
1224
- };
1225
- var copy = function (editor) {
1226
- return function (evt) {
1227
- if (editor.selection.isCollapsed() === false) {
1228
- setClipboardData(evt, getData(editor), fallback(editor), noop);
1229
- }
996
+ var pure$1 = function (a) {
997
+ return nu(function (callback) {
998
+ callback(a);
999
+ });
1000
+ };
1001
+ var LazyValue = {
1002
+ nu: nu,
1003
+ pure: pure$1
1230
1004
  };
1231
- };
1232
- var register$1 = function (editor) {
1233
- editor.on('cut', cut(editor));
1234
- editor.on('copy', copy(editor));
1235
- };
1236
- var $_41rkuj2jm0ofzq9 = { register: register$1 };
1237
1005
 
1238
- var global$10 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
1006
+ var bounce = function (f) {
1007
+ return function () {
1008
+ var args = [];
1009
+ for (var _i = 0; _i < arguments.length; _i++) {
1010
+ args[_i] = arguments[_i];
1011
+ }
1012
+ var me = this;
1013
+ setTimeout(function () {
1014
+ f.apply(me, args);
1015
+ }, 0);
1016
+ };
1017
+ };
1239
1018
 
1240
- var getCaretRangeFromEvent = function (editor, e) {
1241
- return global$10.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc());
1242
- };
1243
- var isPlainTextFileUrl = function (content) {
1244
- var plainTextContent = content['text/plain'];
1245
- return plainTextContent ? plainTextContent.indexOf('file://') === 0 : false;
1246
- };
1247
- var setFocusedRange = function (editor, rng) {
1248
- editor.focus();
1249
- editor.selection.setRng(rng);
1250
- };
1251
- var setup = function (editor, clipboard, draggingInternallyState) {
1252
- if ($_dbkrisijjm0ofzoy.shouldBlockDrop(editor)) {
1253
- editor.on('dragend dragover draggesture dragdrop drop drag', function (e) {
1254
- e.preventDefault();
1255
- e.stopPropagation();
1019
+ var nu$1 = function (baseFn) {
1020
+ var get = function (callback) {
1021
+ baseFn(bounce(callback));
1022
+ };
1023
+ var map = function (fab) {
1024
+ return nu$1(function (callback) {
1025
+ get(function (a) {
1026
+ var value = fab(a);
1027
+ callback(value);
1028
+ });
1029
+ });
1030
+ };
1031
+ var bind = function (aFutureB) {
1032
+ return nu$1(function (callback) {
1033
+ get(function (a) {
1034
+ aFutureB(a).get(callback);
1035
+ });
1036
+ });
1037
+ };
1038
+ var anonBind = function (futureB) {
1039
+ return nu$1(function (callback) {
1040
+ get(function (a) {
1041
+ futureB.get(callback);
1042
+ });
1043
+ });
1044
+ };
1045
+ var toLazy = function () {
1046
+ return LazyValue.nu(get);
1047
+ };
1048
+ var toCached = function () {
1049
+ var cache = null;
1050
+ return nu$1(function (callback) {
1051
+ if (cache === null) {
1052
+ cache = toLazy();
1053
+ }
1054
+ cache.get(callback);
1055
+ });
1056
+ };
1057
+ return {
1058
+ map: map,
1059
+ bind: bind,
1060
+ anonBind: anonBind,
1061
+ toLazy: toLazy,
1062
+ toCached: toCached,
1063
+ get: get
1064
+ };
1065
+ };
1066
+ var pure$2 = function (a) {
1067
+ return nu$1(function (callback) {
1068
+ callback(a);
1256
1069
  });
1257
- }
1258
- if (!$_dbkrisijjm0ofzoy.shouldPasteDataImages(editor)) {
1259
- editor.on('drop', function (e) {
1260
- var dataTransfer = e.dataTransfer;
1261
- if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
1262
- e.preventDefault();
1070
+ };
1071
+ var Future = {
1072
+ nu: nu$1,
1073
+ pure: pure$2
1074
+ };
1075
+
1076
+ var par = function (asyncValues, nu) {
1077
+ return nu(function (callback) {
1078
+ var r = [];
1079
+ var count = 0;
1080
+ var cb = function (i) {
1081
+ return function (value) {
1082
+ r[i] = value;
1083
+ count++;
1084
+ if (count >= asyncValues.length) {
1085
+ callback(r);
1086
+ }
1087
+ };
1088
+ };
1089
+ if (asyncValues.length === 0) {
1090
+ callback([]);
1091
+ } else {
1092
+ each(asyncValues, function (asyncValue, i) {
1093
+ asyncValue.get(cb(i));
1094
+ });
1263
1095
  }
1264
1096
  });
1265
- }
1266
- editor.on('drop', function (e) {
1267
- var dropContent, rng;
1268
- rng = getCaretRangeFromEvent(editor, e);
1269
- if (e.isDefaultPrevented() || draggingInternallyState.get()) {
1270
- return;
1097
+ };
1098
+
1099
+ var par$1 = function (futures) {
1100
+ return par(futures, Future.nu);
1101
+ };
1102
+ var mapM = function (array, fn) {
1103
+ var futures = map(array, fn);
1104
+ return par$1(futures);
1105
+ };
1106
+
1107
+ var pasteHtml$1 = function (editor, html, internalFlag) {
1108
+ var internal = internalFlag ? internalFlag : InternalHtml.isMarked(html);
1109
+ var args = ProcessFilters.process(editor, InternalHtml.unmark(html), internal);
1110
+ if (args.cancelled === false) {
1111
+ SmartPaste.insertContent(editor, args.content);
1112
+ }
1113
+ };
1114
+ var pasteText = function (editor, text) {
1115
+ text = editor.dom.encode(text).replace(/\r\n/g, '\n');
1116
+ text = Newlines.convert(text, editor.settings.forced_root_block, editor.settings.forced_root_block_attrs);
1117
+ pasteHtml$1(editor, text, false);
1118
+ };
1119
+ var getDataTransferItems = function (dataTransfer) {
1120
+ var items = {};
1121
+ var mceInternalUrlPrefix = 'data:text/mce-internal,';
1122
+ if (dataTransfer) {
1123
+ if (dataTransfer.getData) {
1124
+ var legacyText = dataTransfer.getData('Text');
1125
+ if (legacyText && legacyText.length > 0) {
1126
+ if (legacyText.indexOf(mceInternalUrlPrefix) === -1) {
1127
+ items['text/plain'] = legacyText;
1128
+ }
1129
+ }
1130
+ }
1131
+ if (dataTransfer.types) {
1132
+ for (var i = 0; i < dataTransfer.types.length; i++) {
1133
+ var contentType = dataTransfer.types[i];
1134
+ try {
1135
+ items[contentType] = dataTransfer.getData(contentType);
1136
+ } catch (ex) {
1137
+ items[contentType] = '';
1138
+ }
1139
+ }
1140
+ }
1141
+ }
1142
+ return items;
1143
+ };
1144
+ var getClipboardContent = function (editor, clipboardEvent) {
1145
+ var content = getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer);
1146
+ return Utils.isMsEdge() ? global$3.extend(content, { 'text/html': '' }) : content;
1147
+ };
1148
+ var hasContentType = function (clipboardContent, mimeType) {
1149
+ return mimeType in clipboardContent && clipboardContent[mimeType].length > 0;
1150
+ };
1151
+ var hasHtmlOrText = function (content) {
1152
+ return hasContentType(content, 'text/html') || hasContentType(content, 'text/plain');
1153
+ };
1154
+ var getBase64FromUri = function (uri) {
1155
+ var idx;
1156
+ idx = uri.indexOf(',');
1157
+ if (idx !== -1) {
1158
+ return uri.substr(idx + 1);
1271
1159
  }
1272
- dropContent = clipboard.getDataTransferItems(e.dataTransfer);
1273
- var internal = clipboard.hasContentType(dropContent, $_21ba1xiqjm0ofzpc.internalHtmlMime());
1274
- if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) {
1275
- return;
1160
+ return null;
1161
+ };
1162
+ var isValidDataUriImage = function (settings, imgElm) {
1163
+ return settings.images_dataimg_filter ? settings.images_dataimg_filter(imgElm) : true;
1164
+ };
1165
+ var extractFilename = function (editor, str) {
1166
+ var m = str.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);
1167
+ return m ? editor.dom.encode(m[1]) : null;
1168
+ };
1169
+ var uniqueId = Utils.createIdGenerator('mceclip');
1170
+ var pasteImage = function (editor, imageItem) {
1171
+ var base64 = getBase64FromUri(imageItem.uri);
1172
+ var id = uniqueId();
1173
+ var name$$1 = editor.settings.images_reuse_filename && imageItem.blob.name ? extractFilename(editor, imageItem.blob.name) : id;
1174
+ var img = new Image();
1175
+ img.src = imageItem.uri;
1176
+ if (isValidDataUriImage(editor.settings, img)) {
1177
+ var blobCache = editor.editorUpload.blobCache;
1178
+ var blobInfo = void 0, existingBlobInfo = void 0;
1179
+ existingBlobInfo = blobCache.findFirst(function (cachedBlobInfo) {
1180
+ return cachedBlobInfo.base64() === base64;
1181
+ });
1182
+ if (!existingBlobInfo) {
1183
+ blobInfo = blobCache.create(id, imageItem.blob, base64, name$$1);
1184
+ blobCache.add(blobInfo);
1185
+ } else {
1186
+ blobInfo = existingBlobInfo;
1187
+ }
1188
+ pasteHtml$1(editor, '<img src="' + blobInfo.blobUri() + '">', false);
1189
+ } else {
1190
+ pasteHtml$1(editor, '<img src="' + imageItem.uri + '">', false);
1276
1191
  }
1277
- if (rng && $_dbkrisijjm0ofzoy.shouldFilterDrop(editor)) {
1278
- var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];
1279
- if (content_1) {
1192
+ };
1193
+ var isClipboardEvent = function (event$$1) {
1194
+ return event$$1.type === 'paste';
1195
+ };
1196
+ var readBlobsAsDataUris = function (items) {
1197
+ return mapM(items, function (item) {
1198
+ return Future.nu(function (resolve) {
1199
+ var blob = item.getAsFile ? item.getAsFile() : item;
1200
+ var reader = new window.FileReader();
1201
+ reader.onload = function () {
1202
+ resolve({
1203
+ blob: blob,
1204
+ uri: reader.result
1205
+ });
1206
+ };
1207
+ reader.readAsDataURL(blob);
1208
+ });
1209
+ });
1210
+ };
1211
+ var getImagesFromDataTransfer = function (dataTransfer) {
1212
+ var items = dataTransfer.items ? map(from$1(dataTransfer.items), function (item) {
1213
+ return item.getAsFile();
1214
+ }) : [];
1215
+ var files = dataTransfer.files ? from$1(dataTransfer.files) : [];
1216
+ var images = filter$1(items.length > 0 ? items : files, function (file) {
1217
+ return /^image\/(jpeg|png|gif|bmp)$/.test(file.type);
1218
+ });
1219
+ return images;
1220
+ };
1221
+ var pasteImageData = function (editor, e, rng) {
1222
+ var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer;
1223
+ if (editor.settings.paste_data_images && dataTransfer) {
1224
+ var images = getImagesFromDataTransfer(dataTransfer);
1225
+ if (images.length > 0) {
1280
1226
  e.preventDefault();
1281
- global$2.setEditorTimeout(editor, function () {
1282
- editor.undoManager.transact(function () {
1283
- if (dropContent['mce-internal']) {
1284
- editor.execCommand('Delete');
1285
- }
1286
- setFocusedRange(editor, rng);
1287
- content_1 = $_1340csizjm0ofzpu.trimHtml(content_1);
1288
- if (!dropContent['text/html']) {
1289
- clipboard.pasteText(content_1);
1290
- } else {
1291
- clipboard.pasteHtml(content_1, internal);
1292
- }
1227
+ readBlobsAsDataUris(images).get(function (blobResults) {
1228
+ if (rng) {
1229
+ editor.selection.setRng(rng);
1230
+ }
1231
+ each(blobResults, function (result) {
1232
+ pasteImage(editor, result);
1293
1233
  });
1294
1234
  });
1235
+ return true;
1295
1236
  }
1296
1237
  }
1297
- });
1298
- editor.on('dragstart', function (e) {
1299
- draggingInternallyState.set(true);
1300
- });
1301
- editor.on('dragover dragend', function (e) {
1302
- if ($_dbkrisijjm0ofzoy.shouldPasteDataImages(editor) && draggingInternallyState.get() === false) {
1303
- e.preventDefault();
1304
- setFocusedRange(editor, getCaretRangeFromEvent(editor, e));
1238
+ return false;
1239
+ };
1240
+ var isBrokenAndroidClipboardEvent = function (e) {
1241
+ var clipboardData = e.clipboardData;
1242
+ return navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
1243
+ };
1244
+ var isKeyboardPasteEvent = function (e) {
1245
+ return global$4.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45;
1246
+ };
1247
+ var registerEventHandlers = function (editor, pasteBin, pasteFormat) {
1248
+ var keyboardPasteTimeStamp = 0;
1249
+ var keyboardPastePlainTextState;
1250
+ editor.on('keydown', function (e) {
1251
+ function removePasteBinOnKeyUp(e) {
1252
+ if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
1253
+ pasteBin.remove();
1254
+ }
1255
+ }
1256
+ if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
1257
+ keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86;
1258
+ if (keyboardPastePlainTextState && global$1.webkit && navigator.userAgent.indexOf('Version/') !== -1) {
1259
+ return;
1260
+ }
1261
+ e.stopImmediatePropagation();
1262
+ keyboardPasteTimeStamp = new Date().getTime();
1263
+ if (global$1.ie && keyboardPastePlainTextState) {
1264
+ e.preventDefault();
1265
+ Events.firePaste(editor, true);
1266
+ return;
1267
+ }
1268
+ pasteBin.remove();
1269
+ pasteBin.create();
1270
+ editor.once('keyup', removePasteBinOnKeyUp);
1271
+ editor.once('paste', function () {
1272
+ editor.off('keyup', removePasteBinOnKeyUp);
1273
+ });
1274
+ }
1275
+ });
1276
+ function insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal) {
1277
+ var content, isPlainTextHtml;
1278
+ if (hasContentType(clipboardContent, 'text/html')) {
1279
+ content = clipboardContent['text/html'];
1280
+ } else {
1281
+ content = pasteBin.getHtml();
1282
+ internal = internal ? internal : InternalHtml.isMarked(content);
1283
+ if (pasteBin.isDefaultContent(content)) {
1284
+ plainTextMode = true;
1285
+ }
1286
+ }
1287
+ content = Utils.trimHtml(content);
1288
+ pasteBin.remove();
1289
+ isPlainTextHtml = internal === false && Newlines.isPlainText(content);
1290
+ if (!content.length || isPlainTextHtml) {
1291
+ plainTextMode = true;
1292
+ }
1293
+ if (plainTextMode) {
1294
+ if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) {
1295
+ content = clipboardContent['text/plain'];
1296
+ } else {
1297
+ content = Utils.innerText(content);
1298
+ }
1299
+ }
1300
+ if (pasteBin.isDefaultContent(content)) {
1301
+ if (!isKeyBoardPaste) {
1302
+ editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.');
1303
+ }
1304
+ return;
1305
+ }
1306
+ if (plainTextMode) {
1307
+ pasteText(editor, content);
1308
+ } else {
1309
+ pasteHtml$1(editor, content, internal);
1310
+ }
1305
1311
  }
1306
- if (e.type === 'dragend') {
1307
- draggingInternallyState.set(false);
1312
+ var getLastRng = function () {
1313
+ return pasteBin.getLastRng() || editor.selection.getRng();
1314
+ };
1315
+ editor.on('paste', function (e) {
1316
+ var clipboardTimer = new Date().getTime();
1317
+ var clipboardContent = getClipboardContent(editor, e);
1318
+ var clipboardDelay = new Date().getTime() - clipboardTimer;
1319
+ var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp - clipboardDelay < 1000;
1320
+ var plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState;
1321
+ var internal = hasContentType(clipboardContent, InternalHtml.internalHtmlMime());
1322
+ keyboardPastePlainTextState = false;
1323
+ if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
1324
+ pasteBin.remove();
1325
+ return;
1326
+ }
1327
+ if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) {
1328
+ pasteBin.remove();
1329
+ return;
1330
+ }
1331
+ if (!isKeyBoardPaste) {
1332
+ e.preventDefault();
1333
+ }
1334
+ if (global$1.ie && (!isKeyBoardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) {
1335
+ pasteBin.create();
1336
+ editor.dom.bind(pasteBin.getEl(), 'paste', function (e) {
1337
+ e.stopPropagation();
1338
+ });
1339
+ editor.getDoc().execCommand('Paste', false, null);
1340
+ clipboardContent['text/html'] = pasteBin.getHtml();
1341
+ }
1342
+ if (hasContentType(clipboardContent, 'text/html')) {
1343
+ e.preventDefault();
1344
+ if (!internal) {
1345
+ internal = InternalHtml.isMarked(clipboardContent['text/html']);
1346
+ }
1347
+ insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
1348
+ } else {
1349
+ global$2.setEditorTimeout(editor, function () {
1350
+ insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
1351
+ }, 0);
1352
+ }
1353
+ });
1354
+ };
1355
+ var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) {
1356
+ registerEventHandlers(editor, pasteBin, pasteFormat);
1357
+ var src;
1358
+ editor.parser.addNodeFilter('img', function (nodes, name$$1, args) {
1359
+ var isPasteInsert = function (args) {
1360
+ return args.data && args.data.paste === true;
1361
+ };
1362
+ var remove = function (node) {
1363
+ if (!node.attr('data-mce-object') && src !== global$1.transparentSrc) {
1364
+ node.remove();
1365
+ }
1366
+ };
1367
+ var isWebKitFakeUrl = function (src) {
1368
+ return src.indexOf('webkit-fake-url') === 0;
1369
+ };
1370
+ var isDataUri = function (src) {
1371
+ return src.indexOf('data:') === 0;
1372
+ };
1373
+ if (!editor.settings.paste_data_images && isPasteInsert(args)) {
1374
+ var i = nodes.length;
1375
+ while (i--) {
1376
+ src = nodes[i].attributes.map.src;
1377
+ if (!src) {
1378
+ continue;
1379
+ }
1380
+ if (isWebKitFakeUrl(src)) {
1381
+ remove(nodes[i]);
1382
+ } else if (!editor.settings.allow_html_data_urls && isDataUri(src)) {
1383
+ remove(nodes[i]);
1384
+ }
1385
+ }
1386
+ }
1387
+ });
1388
+ };
1389
+
1390
+ var getPasteBinParent = function (editor) {
1391
+ return global$1.ie && editor.inline ? document.body : editor.getBody();
1392
+ };
1393
+ var isExternalPasteBin = function (editor) {
1394
+ return getPasteBinParent(editor) !== editor.getBody();
1395
+ };
1396
+ var delegatePasteEvents = function (editor, pasteBinElm, pasteBinDefaultContent) {
1397
+ if (isExternalPasteBin(editor)) {
1398
+ editor.dom.bind(pasteBinElm, 'paste keyup', function (e) {
1399
+ if (!isDefault(editor, pasteBinDefaultContent)) {
1400
+ editor.fire('paste');
1401
+ }
1402
+ });
1308
1403
  }
1309
- });
1310
- };
1311
- var $_81gqfwj3jm0ofzqd = { setup: setup };
1404
+ };
1405
+ var create = function (editor, lastRngCell, pasteBinDefaultContent) {
1406
+ var dom = editor.dom, body = editor.getBody();
1407
+ var pasteBinElm;
1408
+ lastRngCell.set(editor.selection.getRng());
1409
+ pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', {
1410
+ 'id': 'mcepastebin',
1411
+ 'class': 'mce-pastebin',
1412
+ 'contentEditable': true,
1413
+ 'data-mce-bogus': 'all',
1414
+ 'style': 'position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0'
1415
+ }, pasteBinDefaultContent);
1416
+ if (global$1.ie || global$1.gecko) {
1417
+ dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) === 'rtl' ? 65535 : -65535);
1418
+ }
1419
+ dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function (e) {
1420
+ e.stopPropagation();
1421
+ });
1422
+ delegatePasteEvents(editor, pasteBinElm, pasteBinDefaultContent);
1423
+ pasteBinElm.focus();
1424
+ editor.selection.select(pasteBinElm, true);
1425
+ };
1426
+ var remove = function (editor, lastRngCell) {
1427
+ if (getEl(editor)) {
1428
+ var pasteBinClone = void 0;
1429
+ var lastRng = lastRngCell.get();
1430
+ while (pasteBinClone = editor.dom.get('mcepastebin')) {
1431
+ editor.dom.remove(pasteBinClone);
1432
+ editor.dom.unbind(pasteBinClone);
1433
+ }
1434
+ if (lastRng) {
1435
+ editor.selection.setRng(lastRng);
1436
+ }
1437
+ }
1438
+ lastRngCell.set(null);
1439
+ };
1440
+ var getEl = function (editor) {
1441
+ return editor.dom.get('mcepastebin');
1442
+ };
1443
+ var getHtml = function (editor) {
1444
+ var pasteBinElm, pasteBinClones, i, dirtyWrappers, cleanWrapper;
1445
+ var copyAndRemove = function (toElm, fromElm) {
1446
+ toElm.appendChild(fromElm);
1447
+ editor.dom.remove(fromElm, true);
1448
+ };
1449
+ pasteBinClones = global$3.grep(getPasteBinParent(editor).childNodes, function (elm) {
1450
+ return elm.id === 'mcepastebin';
1451
+ });
1452
+ pasteBinElm = pasteBinClones.shift();
1453
+ global$3.each(pasteBinClones, function (pasteBinClone) {
1454
+ copyAndRemove(pasteBinElm, pasteBinClone);
1455
+ });
1456
+ dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm);
1457
+ for (i = dirtyWrappers.length - 1; i >= 0; i--) {
1458
+ cleanWrapper = editor.dom.create('div');
1459
+ pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]);
1460
+ copyAndRemove(cleanWrapper, dirtyWrappers[i]);
1461
+ }
1462
+ return pasteBinElm ? pasteBinElm.innerHTML : '';
1463
+ };
1464
+ var getLastRng = function (lastRng) {
1465
+ return lastRng.get();
1466
+ };
1467
+ var isDefaultContent = function (pasteBinDefaultContent, content) {
1468
+ return content === pasteBinDefaultContent;
1469
+ };
1470
+ var isPasteBin = function (elm) {
1471
+ return elm && elm.id === 'mcepastebin';
1472
+ };
1473
+ var isDefault = function (editor, pasteBinDefaultContent) {
1474
+ var pasteBinElm = getEl(editor);
1475
+ return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML);
1476
+ };
1477
+ var PasteBin = function (editor) {
1478
+ var lastRng = Cell(null);
1479
+ var pasteBinDefaultContent = '%MCEPASTEBIN%';
1480
+ return {
1481
+ create: function () {
1482
+ return create(editor, lastRng, pasteBinDefaultContent);
1483
+ },
1484
+ remove: function () {
1485
+ return remove(editor, lastRng);
1486
+ },
1487
+ getEl: function () {
1488
+ return getEl(editor);
1489
+ },
1490
+ getHtml: function () {
1491
+ return getHtml(editor);
1492
+ },
1493
+ getLastRng: function () {
1494
+ return getLastRng(lastRng);
1495
+ },
1496
+ isDefault: function () {
1497
+ return isDefault(editor, pasteBinDefaultContent);
1498
+ },
1499
+ isDefaultContent: function (content) {
1500
+ return isDefaultContent(pasteBinDefaultContent, content);
1501
+ }
1502
+ };
1503
+ };
1504
+
1505
+ var Clipboard = function (editor, pasteFormat) {
1506
+ var pasteBin = PasteBin(editor);
1507
+ editor.on('preInit', function () {
1508
+ return registerEventsAndFilters(editor, pasteBin, pasteFormat);
1509
+ });
1510
+ return {
1511
+ pasteFormat: pasteFormat,
1512
+ pasteHtml: function (html, internalFlag) {
1513
+ return pasteHtml$1(editor, html, internalFlag);
1514
+ },
1515
+ pasteText: function (text) {
1516
+ return pasteText(editor, text);
1517
+ },
1518
+ pasteImageData: function (e, rng) {
1519
+ return pasteImageData(editor, e, rng);
1520
+ },
1521
+ getDataTransferItems: getDataTransferItems,
1522
+ hasHtmlOrText: hasHtmlOrText,
1523
+ hasContentType: hasContentType
1524
+ };
1525
+ };
1312
1526
 
1313
- var setup$1 = function (editor) {
1314
- var plugin = editor.plugins.paste;
1315
- var preProcess = $_dbkrisijjm0ofzoy.getPreProcess(editor);
1316
- if (preProcess) {
1527
+ var noop$1 = function () {
1528
+ };
1529
+ var hasWorkingClipboardApi = function (clipboardData) {
1530
+ return global$1.iOS === false && clipboardData !== undefined && typeof clipboardData.setData === 'function' && Utils.isMsEdge() !== true;
1531
+ };
1532
+ var setHtml5Clipboard = function (clipboardData, html, text) {
1533
+ if (hasWorkingClipboardApi(clipboardData)) {
1534
+ try {
1535
+ clipboardData.clearData();
1536
+ clipboardData.setData('text/html', html);
1537
+ clipboardData.setData('text/plain', text);
1538
+ clipboardData.setData(InternalHtml.internalHtmlMime(), html);
1539
+ return true;
1540
+ } catch (e) {
1541
+ return false;
1542
+ }
1543
+ } else {
1544
+ return false;
1545
+ }
1546
+ };
1547
+ var setClipboardData = function (evt, data, fallback, done) {
1548
+ if (setHtml5Clipboard(evt.clipboardData, data.html, data.text)) {
1549
+ evt.preventDefault();
1550
+ done();
1551
+ } else {
1552
+ fallback(data.html, done);
1553
+ }
1554
+ };
1555
+ var fallback = function (editor) {
1556
+ return function (html, done) {
1557
+ var markedHtml = InternalHtml.mark(html);
1558
+ var outer = editor.dom.create('div', {
1559
+ 'contenteditable': 'false',
1560
+ 'data-mce-bogus': 'all'
1561
+ });
1562
+ var inner = editor.dom.create('div', { contenteditable: 'true' }, markedHtml);
1563
+ editor.dom.setStyles(outer, {
1564
+ position: 'fixed',
1565
+ top: '0',
1566
+ left: '-3000px',
1567
+ width: '1000px',
1568
+ overflow: 'hidden'
1569
+ });
1570
+ outer.appendChild(inner);
1571
+ editor.dom.add(editor.getBody(), outer);
1572
+ var range = editor.selection.getRng();
1573
+ inner.focus();
1574
+ var offscreenRange = editor.dom.createRng();
1575
+ offscreenRange.selectNodeContents(inner);
1576
+ editor.selection.setRng(offscreenRange);
1577
+ setTimeout(function () {
1578
+ editor.selection.setRng(range);
1579
+ outer.parentNode.removeChild(outer);
1580
+ done();
1581
+ }, 0);
1582
+ };
1583
+ };
1584
+ var getData = function (editor) {
1585
+ return {
1586
+ html: editor.selection.getContent({ contextual: true }),
1587
+ text: editor.selection.getContent({ format: 'text' })
1588
+ };
1589
+ };
1590
+ var isTableSelection = function (editor) {
1591
+ return !!editor.dom.getParent(editor.selection.getStart(), 'td[data-mce-selected],th[data-mce-selected]', editor.getBody());
1592
+ };
1593
+ var hasSelectedContent = function (editor) {
1594
+ return !editor.selection.isCollapsed() || isTableSelection(editor);
1595
+ };
1596
+ var cut = function (editor) {
1597
+ return function (evt) {
1598
+ if (hasSelectedContent(editor)) {
1599
+ setClipboardData(evt, getData(editor), fallback(editor), function () {
1600
+ setTimeout(function () {
1601
+ editor.execCommand('Delete');
1602
+ }, 0);
1603
+ });
1604
+ }
1605
+ };
1606
+ };
1607
+ var copy = function (editor) {
1608
+ return function (evt) {
1609
+ if (hasSelectedContent(editor)) {
1610
+ setClipboardData(evt, getData(editor), fallback(editor), noop$1);
1611
+ }
1612
+ };
1613
+ };
1614
+ var register$1 = function (editor) {
1615
+ editor.on('cut', cut(editor));
1616
+ editor.on('copy', copy(editor));
1617
+ };
1618
+ var CutCopy = { register: register$1 };
1619
+
1620
+ var global$a = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
1621
+
1622
+ var getCaretRangeFromEvent = function (editor, e) {
1623
+ return global$a.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc());
1624
+ };
1625
+ var isPlainTextFileUrl = function (content) {
1626
+ var plainTextContent = content['text/plain'];
1627
+ return plainTextContent ? plainTextContent.indexOf('file://') === 0 : false;
1628
+ };
1629
+ var setFocusedRange = function (editor, rng) {
1630
+ editor.focus();
1631
+ editor.selection.setRng(rng);
1632
+ };
1633
+ var setup = function (editor, clipboard, draggingInternallyState) {
1634
+ if (Settings.shouldBlockDrop(editor)) {
1635
+ editor.on('dragend dragover draggesture dragdrop drop drag', function (e) {
1636
+ e.preventDefault();
1637
+ e.stopPropagation();
1638
+ });
1639
+ }
1640
+ if (!Settings.shouldPasteDataImages(editor)) {
1641
+ editor.on('drop', function (e) {
1642
+ var dataTransfer = e.dataTransfer;
1643
+ if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
1644
+ e.preventDefault();
1645
+ }
1646
+ });
1647
+ }
1648
+ editor.on('drop', function (e) {
1649
+ var dropContent, rng;
1650
+ rng = getCaretRangeFromEvent(editor, e);
1651
+ if (e.isDefaultPrevented() || draggingInternallyState.get()) {
1652
+ return;
1653
+ }
1654
+ dropContent = clipboard.getDataTransferItems(e.dataTransfer);
1655
+ var internal = clipboard.hasContentType(dropContent, InternalHtml.internalHtmlMime());
1656
+ if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) {
1657
+ return;
1658
+ }
1659
+ if (rng && Settings.shouldFilterDrop(editor)) {
1660
+ var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];
1661
+ if (content_1) {
1662
+ e.preventDefault();
1663
+ global$2.setEditorTimeout(editor, function () {
1664
+ editor.undoManager.transact(function () {
1665
+ if (dropContent['mce-internal']) {
1666
+ editor.execCommand('Delete');
1667
+ }
1668
+ setFocusedRange(editor, rng);
1669
+ content_1 = Utils.trimHtml(content_1);
1670
+ if (!dropContent['text/html']) {
1671
+ clipboard.pasteText(content_1);
1672
+ } else {
1673
+ clipboard.pasteHtml(content_1, internal);
1674
+ }
1675
+ });
1676
+ });
1677
+ }
1678
+ }
1679
+ });
1680
+ editor.on('dragstart', function (e) {
1681
+ draggingInternallyState.set(true);
1682
+ });
1683
+ editor.on('dragover dragend', function (e) {
1684
+ if (Settings.shouldPasteDataImages(editor) && draggingInternallyState.get() === false) {
1685
+ e.preventDefault();
1686
+ setFocusedRange(editor, getCaretRangeFromEvent(editor, e));
1687
+ }
1688
+ if (e.type === 'dragend') {
1689
+ draggingInternallyState.set(false);
1690
+ }
1691
+ });
1692
+ };
1693
+ var DragDrop = { setup: setup };
1694
+
1695
+ var setup$1 = function (editor) {
1696
+ var plugin = editor.plugins.paste;
1697
+ var preProcess = Settings.getPreProcess(editor);
1698
+ if (preProcess) {
1699
+ editor.on('PastePreProcess', function (e) {
1700
+ preProcess.call(plugin, plugin, e);
1701
+ });
1702
+ }
1703
+ var postProcess = Settings.getPostProcess(editor);
1704
+ if (postProcess) {
1705
+ editor.on('PastePostProcess', function (e) {
1706
+ postProcess.call(plugin, plugin, e);
1707
+ });
1708
+ }
1709
+ };
1710
+ var PrePostProcess = { setup: setup$1 };
1711
+
1712
+ function addPreProcessFilter(editor, filterFunc) {
1317
1713
  editor.on('PastePreProcess', function (e) {
1318
- preProcess.call(plugin, plugin, e);
1714
+ e.content = filterFunc(editor, e.content, e.internal, e.wordContent);
1319
1715
  });
1320
1716
  }
1321
- var postProcess = $_dbkrisijjm0ofzoy.getPostProcess(editor);
1322
- if (postProcess) {
1717
+ function addPostProcessFilter(editor, filterFunc) {
1323
1718
  editor.on('PastePostProcess', function (e) {
1324
- postProcess.call(plugin, plugin, e);
1719
+ filterFunc(editor, e.node);
1325
1720
  });
1326
1721
  }
1327
- };
1328
- var $_y4g1hj5jm0ofzqg = { setup: setup$1 };
1329
-
1330
- function addPreProcessFilter(editor, filterFunc) {
1331
- editor.on('PastePreProcess', function (e) {
1332
- e.content = filterFunc(editor, e.content, e.internal, e.wordContent);
1333
- });
1334
- }
1335
- function addPostProcessFilter(editor, filterFunc) {
1336
- editor.on('PastePostProcess', function (e) {
1337
- filterFunc(editor, e.node);
1338
- });
1339
- }
1340
- function removeExplorerBrElementsAfterBlocks(editor, html) {
1341
- if (!$_52rjxviujm0ofzpl.isWordContent(html)) {
1722
+ function removeExplorerBrElementsAfterBlocks(editor, html) {
1723
+ if (!WordFilter.isWordContent(html)) {
1724
+ return html;
1725
+ }
1726
+ var blockElements = [];
1727
+ global$3.each(editor.schema.getBlockElements(), function (block, blockName) {
1728
+ blockElements.push(blockName);
1729
+ });
1730
+ var explorerBlocksRegExp = new RegExp('(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*', 'g');
1731
+ html = Utils.filter(html, [[
1732
+ explorerBlocksRegExp,
1733
+ '$1'
1734
+ ]]);
1735
+ html = Utils.filter(html, [
1736
+ [
1737
+ /<br><br>/g,
1738
+ '<BR><BR>'
1739
+ ],
1740
+ [
1741
+ /<br>/g,
1742
+ ' '
1743
+ ],
1744
+ [
1745
+ /<BR><BR>/g,
1746
+ '<br>'
1747
+ ]
1748
+ ]);
1342
1749
  return html;
1343
1750
  }
1344
- var blockElements = [];
1345
- global$3.each(editor.schema.getBlockElements(), function (block, blockName) {
1346
- blockElements.push(blockName);
1347
- });
1348
- var explorerBlocksRegExp = new RegExp('(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*', 'g');
1349
- html = $_1340csizjm0ofzpu.filter(html, [[
1350
- explorerBlocksRegExp,
1351
- '$1'
1352
- ]]);
1353
- html = $_1340csizjm0ofzpu.filter(html, [
1354
- [
1355
- /<br><br>/g,
1356
- '<BR><BR>'
1357
- ],
1358
- [
1359
- /<br>/g,
1360
- ' '
1361
- ],
1362
- [
1363
- /<BR><BR>/g,
1364
- '<br>'
1365
- ]
1366
- ]);
1367
- return html;
1368
- }
1369
- function removeWebKitStyles(editor, content, internal, isWordHtml) {
1370
- if (isWordHtml || internal) {
1371
- return content;
1372
- }
1373
- var webKitStylesSetting = $_dbkrisijjm0ofzoy.getWebkitStyles(editor);
1374
- var webKitStyles;
1375
- if ($_dbkrisijjm0ofzoy.shouldRemoveWebKitStyles(editor) === false || webKitStylesSetting === 'all') {
1376
- return content;
1377
- }
1378
- if (webKitStylesSetting) {
1379
- webKitStyles = webKitStylesSetting.split(/[, ]/);
1380
- }
1381
- if (webKitStyles) {
1382
- var dom_1 = editor.dom, node_1 = editor.selection.getNode();
1383
- content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function (all, before, value, after) {
1384
- var inputStyles = dom_1.parseStyle(dom_1.decode(value));
1385
- var outputStyles = {};
1386
- if (webKitStyles === 'none') {
1387
- return before + after;
1388
- }
1389
- for (var i = 0; i < webKitStyles.length; i++) {
1390
- var inputValue = inputStyles[webKitStyles[i]], currentValue = dom_1.getStyle(node_1, webKitStyles[i], true);
1391
- if (/color/.test(webKitStyles[i])) {
1392
- inputValue = dom_1.toHex(inputValue);
1393
- currentValue = dom_1.toHex(currentValue);
1751
+ function removeWebKitStyles(editor, content, internal, isWordHtml) {
1752
+ if (isWordHtml || internal) {
1753
+ return content;
1754
+ }
1755
+ var webKitStylesSetting = Settings.getWebkitStyles(editor);
1756
+ var webKitStyles;
1757
+ if (Settings.shouldRemoveWebKitStyles(editor) === false || webKitStylesSetting === 'all') {
1758
+ return content;
1759
+ }
1760
+ if (webKitStylesSetting) {
1761
+ webKitStyles = webKitStylesSetting.split(/[, ]/);
1762
+ }
1763
+ if (webKitStyles) {
1764
+ var dom_1 = editor.dom, node_1 = editor.selection.getNode();
1765
+ content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function (all, before, value, after) {
1766
+ var inputStyles = dom_1.parseStyle(dom_1.decode(value));
1767
+ var outputStyles = {};
1768
+ if (webKitStyles === 'none') {
1769
+ return before + after;
1394
1770
  }
1395
- if (currentValue !== inputValue) {
1396
- outputStyles[webKitStyles[i]] = inputValue;
1771
+ for (var i = 0; i < webKitStyles.length; i++) {
1772
+ var inputValue = inputStyles[webKitStyles[i]], currentValue = dom_1.getStyle(node_1, webKitStyles[i], true);
1773
+ if (/color/.test(webKitStyles[i])) {
1774
+ inputValue = dom_1.toHex(inputValue);
1775
+ currentValue = dom_1.toHex(currentValue);
1776
+ }
1777
+ if (currentValue !== inputValue) {
1778
+ outputStyles[webKitStyles[i]] = inputValue;
1779
+ }
1397
1780
  }
1398
- }
1399
- outputStyles = dom_1.serializeStyle(outputStyles, 'span');
1400
- if (outputStyles) {
1401
- return before + ' style="' + outputStyles + '"' + after;
1402
- }
1403
- return before + after;
1781
+ outputStyles = dom_1.serializeStyle(outputStyles, 'span');
1782
+ if (outputStyles) {
1783
+ return before + ' style="' + outputStyles + '"' + after;
1784
+ }
1785
+ return before + after;
1786
+ });
1787
+ } else {
1788
+ content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3');
1789
+ }
1790
+ content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function (all, before, value, after) {
1791
+ return before + ' style="' + value + '"' + after;
1404
1792
  });
1405
- } else {
1406
- content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3');
1407
- }
1408
- content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function (all, before, value, after) {
1409
- return before + ' style="' + value + '"' + after;
1410
- });
1411
- return content;
1412
- }
1413
- function removeUnderlineAndFontInAnchor(editor, root) {
1414
- editor.$('a', root).find('font,u').each(function (i, node) {
1415
- editor.dom.remove(node, true);
1416
- });
1417
- }
1418
- var setup$2 = function (editor) {
1419
- if (global$1.webkit) {
1420
- addPreProcessFilter(editor, removeWebKitStyles);
1421
- }
1422
- if (global$1.ie) {
1423
- addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks);
1424
- addPostProcessFilter(editor, removeUnderlineAndFontInAnchor);
1793
+ return content;
1425
1794
  }
1426
- };
1427
- var $_7229ubj6jm0ofzqi = { setup: setup$2 };
1428
-
1429
- var curry = function (f) {
1430
- var x = [];
1431
- for (var _i = 1; _i < arguments.length; _i++) {
1432
- x[_i - 1] = arguments[_i];
1795
+ function removeUnderlineAndFontInAnchor(editor, root) {
1796
+ editor.$('a', root).find('font,u').each(function (i, node) {
1797
+ editor.dom.remove(node, true);
1798
+ });
1433
1799
  }
1434
- var args = new Array(arguments.length - 1);
1435
- for (var i = 1; i < arguments.length; i++)
1436
- args[i - 1] = arguments[i];
1437
- return function () {
1438
- var x = [];
1439
- for (var _i = 0; _i < arguments.length; _i++) {
1440
- x[_i] = arguments[_i];
1800
+ var setup$2 = function (editor) {
1801
+ if (global$1.webkit) {
1802
+ addPreProcessFilter(editor, removeWebKitStyles);
1803
+ }
1804
+ if (global$1.ie) {
1805
+ addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks);
1806
+ addPostProcessFilter(editor, removeUnderlineAndFontInAnchor);
1441
1807
  }
1442
- var newArgs = new Array(arguments.length);
1443
- for (var j = 0; j < newArgs.length; j++)
1444
- newArgs[j] = arguments[j];
1445
- var all = args.concat(newArgs);
1446
- return f.apply(null, all);
1447
1808
  };
1448
- };
1809
+ var Quirks = { setup: setup$2 };
1449
1810
 
1450
- var stateChange = function (editor, clipboard, e) {
1451
- var ctrl = e.control;
1452
- ctrl.active(clipboard.pasteFormat.get() === 'text');
1453
- editor.on('PastePlainTextToggle', function (e) {
1454
- ctrl.active(e.state);
1455
- });
1456
- };
1457
- var register$2 = function (editor, clipboard) {
1458
- var postRender = curry(stateChange, editor, clipboard);
1459
- editor.addButton('pastetext', {
1460
- active: false,
1461
- icon: 'pastetext',
1462
- tooltip: 'Paste as text',
1463
- cmd: 'mceTogglePlainTextPaste',
1464
- onPostRender: postRender
1465
- });
1466
- editor.addMenuItem('pastetext', {
1467
- text: 'Paste as text',
1468
- selectable: true,
1469
- active: clipboard.pasteFormat,
1470
- cmd: 'mceTogglePlainTextPaste',
1471
- onPostRender: postRender
1472
- });
1473
- };
1474
- var $_8gccoyj7jm0ofzqu = { register: register$2 };
1811
+ var stateChange = function (editor, clipboard, e) {
1812
+ var ctrl = e.control;
1813
+ ctrl.active(clipboard.pasteFormat.get() === 'text');
1814
+ editor.on('PastePlainTextToggle', function (e) {
1815
+ ctrl.active(e.state);
1816
+ });
1817
+ };
1818
+ var register$2 = function (editor, clipboard) {
1819
+ var postRender = curry(stateChange, editor, clipboard);
1820
+ editor.addButton('pastetext', {
1821
+ active: false,
1822
+ icon: 'pastetext',
1823
+ tooltip: 'Paste as text',
1824
+ cmd: 'mceTogglePlainTextPaste',
1825
+ onPostRender: postRender
1826
+ });
1827
+ editor.addMenuItem('pastetext', {
1828
+ text: 'Paste as text',
1829
+ selectable: true,
1830
+ active: clipboard.pasteFormat,
1831
+ cmd: 'mceTogglePlainTextPaste',
1832
+ onPostRender: postRender
1833
+ });
1834
+ };
1835
+ var Buttons = { register: register$2 };
1475
1836
 
1476
- global.add('paste', function (editor) {
1477
- if ($_1wddxcidjm0ofzo9.hasProPlugin(editor) === false) {
1478
- var userIsInformedState = Cell(false);
1479
- var draggingInternallyState = Cell(false);
1480
- var pasteFormat = Cell($_dbkrisijjm0ofzoy.isPasteAsTextEnabled(editor) ? 'text' : 'html');
1481
- var clipboard = Clipboard(editor, pasteFormat);
1482
- var quirks = $_7229ubj6jm0ofzqi.setup(editor);
1483
- $_8gccoyj7jm0ofzqu.register(editor, clipboard);
1484
- $_4ny6o6igjm0ofzot.register(editor, clipboard, userIsInformedState);
1485
- $_y4g1hj5jm0ofzqg.setup(editor);
1486
- $_41rkuj2jm0ofzq9.register(editor);
1487
- $_81gqfwj3jm0ofzqd.setup(editor, clipboard, draggingInternallyState);
1488
- return $_9cpx3tifjm0ofzos.get(clipboard, quirks);
1837
+ global.add('paste', function (editor) {
1838
+ if (DetectProPlugin.hasProPlugin(editor) === false) {
1839
+ var userIsInformedState = Cell(false);
1840
+ var draggingInternallyState = Cell(false);
1841
+ var pasteFormat = Cell(Settings.isPasteAsTextEnabled(editor) ? 'text' : 'html');
1842
+ var clipboard = Clipboard(editor, pasteFormat);
1843
+ var quirks = Quirks.setup(editor);
1844
+ Buttons.register(editor, clipboard);
1845
+ Commands.register(editor, clipboard, userIsInformedState);
1846
+ PrePostProcess.setup(editor);
1847
+ CutCopy.register(editor);
1848
+ DragDrop.setup(editor, clipboard, draggingInternallyState);
1849
+ return Api.get(clipboard, quirks);
1850
+ }
1851
+ });
1852
+ function Plugin () {
1489
1853
  }
1490
- });
1491
- function Plugin () {
1492
- }
1493
1854
 
1494
- return Plugin;
1855
+ return Plugin;
1495
1856
 
1496
1857
  }());
1497
1858
  })();