glebtv-ckeditor 4.7.3.1 → 4.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +0 -9
  3. data/app/assets/javascripts/ckeditor/config.js.erb +3 -3
  4. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +317 -313
  5. data/config/locales/bg.ckeditor.yml +9 -0
  6. data/config/locales/cs.ckeditor.yml +9 -0
  7. data/config/locales/de.ckeditor.yml +9 -0
  8. data/config/locales/el-GR.cdkeditor.yml +9 -0
  9. data/config/locales/es.ckeditor.yml +9 -0
  10. data/config/locales/fr.ckeditor.yml +9 -0
  11. data/config/locales/hu.ckeditor.yml +9 -0
  12. data/config/locales/it.ckeditor.yml +9 -0
  13. data/config/locales/ja.ckeditor.yml +9 -0
  14. data/config/locales/nb.ckeditor.yml +9 -0
  15. data/config/locales/nl.ckeditor.yml +9 -0
  16. data/config/locales/pl.ckeditor.yml +9 -0
  17. data/config/locales/pt-BR.ckeditor.yml +9 -0
  18. data/config/locales/pt-PT.ckeditor.yml +9 -0
  19. data/config/locales/pt.ckeditor.yml +9 -0
  20. data/config/locales/sq.ckeditor.yml +9 -0
  21. data/config/locales/sv-SE.ckeditor.yml +9 -0
  22. data/config/locales/tr.ckeditor.yml +9 -0
  23. data/config/locales/uk.ckeditor.yml +9 -0
  24. data/config/locales/zh-CN.ckeditor.yml +9 -0
  25. data/config/locales/zh-TW.ckeditor.yml +9 -0
  26. data/lib/ckeditor/asset_response.rb +6 -2
  27. data/lib/ckeditor/http.rb +5 -7
  28. data/lib/ckeditor/utils/content_type_detector.rb +3 -3
  29. data/lib/ckeditor/version.rb +2 -2
  30. data/vendor/assets/javascripts/ckeditor/CHANGES.md +1128 -849
  31. data/vendor/assets/javascripts/ckeditor/LICENSE.md +3 -3
  32. data/vendor/assets/javascripts/ckeditor/README.md +6 -6
  33. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +2 -2
  34. data/vendor/assets/javascripts/ckeditor/build-config.js +11 -6
  35. data/vendor/assets/javascripts/ckeditor/ckeditor.js +825 -688
  36. data/vendor/assets/javascripts/ckeditor/config.js +2 -2
  37. data/vendor/assets/javascripts/ckeditor/contents.css +7 -7
  38. data/vendor/assets/javascripts/ckeditor/lang/af.js +5 -0
  39. data/vendor/assets/javascripts/ckeditor/lang/ar.js +5 -0
  40. data/vendor/assets/javascripts/ckeditor/lang/az.js +5 -0
  41. data/vendor/assets/javascripts/ckeditor/lang/bg.js +5 -0
  42. data/vendor/assets/javascripts/ckeditor/lang/bn.js +5 -0
  43. data/vendor/assets/javascripts/ckeditor/lang/bs.js +5 -0
  44. data/vendor/assets/javascripts/ckeditor/lang/ca.js +5 -0
  45. data/vendor/assets/javascripts/ckeditor/lang/cs.js +5 -0
  46. data/vendor/assets/javascripts/ckeditor/lang/cy.js +5 -0
  47. data/vendor/assets/javascripts/ckeditor/lang/da.js +5 -0
  48. data/vendor/assets/javascripts/ckeditor/lang/de-ch.js +5 -0
  49. data/vendor/assets/javascripts/ckeditor/lang/de.js +5 -0
  50. data/vendor/assets/javascripts/ckeditor/lang/el.js +5 -0
  51. data/vendor/assets/javascripts/ckeditor/lang/en-au.js +5 -0
  52. data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +5 -0
  53. data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +5 -0
  54. data/vendor/assets/javascripts/ckeditor/lang/en.js +3 -3
  55. data/vendor/assets/javascripts/ckeditor/lang/eo.js +5 -0
  56. data/vendor/assets/javascripts/ckeditor/lang/es-mx.js +5 -0
  57. data/vendor/assets/javascripts/ckeditor/lang/es.js +5 -0
  58. data/vendor/assets/javascripts/ckeditor/lang/et.js +5 -0
  59. data/vendor/assets/javascripts/ckeditor/lang/eu.js +5 -0
  60. data/vendor/assets/javascripts/ckeditor/lang/fa.js +5 -0
  61. data/vendor/assets/javascripts/ckeditor/lang/fi.js +5 -0
  62. data/vendor/assets/javascripts/ckeditor/lang/fo.js +5 -0
  63. data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +5 -0
  64. data/vendor/assets/javascripts/ckeditor/lang/fr.js +5 -0
  65. data/vendor/assets/javascripts/ckeditor/lang/gl.js +5 -0
  66. data/vendor/assets/javascripts/ckeditor/lang/gu.js +5 -0
  67. data/vendor/assets/javascripts/ckeditor/lang/he.js +5 -0
  68. data/vendor/assets/javascripts/ckeditor/lang/hi.js +5 -0
  69. data/vendor/assets/javascripts/ckeditor/lang/hr.js +5 -0
  70. data/vendor/assets/javascripts/ckeditor/lang/hu.js +5 -0
  71. data/vendor/assets/javascripts/ckeditor/lang/id.js +5 -0
  72. data/vendor/assets/javascripts/ckeditor/lang/is.js +5 -0
  73. data/vendor/assets/javascripts/ckeditor/lang/it.js +5 -0
  74. data/vendor/assets/javascripts/ckeditor/lang/ja.js +5 -0
  75. data/vendor/assets/javascripts/ckeditor/lang/ka.js +5 -0
  76. data/vendor/assets/javascripts/ckeditor/lang/km.js +5 -0
  77. data/vendor/assets/javascripts/ckeditor/lang/ko.js +5 -0
  78. data/vendor/assets/javascripts/ckeditor/lang/ku.js +5 -0
  79. data/vendor/assets/javascripts/ckeditor/lang/lt.js +5 -0
  80. data/vendor/assets/javascripts/ckeditor/lang/lv.js +5 -0
  81. data/vendor/assets/javascripts/ckeditor/lang/mk.js +5 -0
  82. data/vendor/assets/javascripts/ckeditor/lang/mn.js +5 -0
  83. data/vendor/assets/javascripts/ckeditor/lang/ms.js +5 -0
  84. data/vendor/assets/javascripts/ckeditor/lang/nb.js +5 -0
  85. data/vendor/assets/javascripts/ckeditor/lang/nl.js +5 -0
  86. data/vendor/assets/javascripts/ckeditor/lang/no.js +5 -0
  87. data/vendor/assets/javascripts/ckeditor/lang/oc.js +5 -0
  88. data/vendor/assets/javascripts/ckeditor/lang/pl.js +5 -0
  89. data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +5 -0
  90. data/vendor/assets/javascripts/ckeditor/lang/pt.js +5 -0
  91. data/vendor/assets/javascripts/ckeditor/lang/ro.js +5 -0
  92. data/vendor/assets/javascripts/ckeditor/lang/ru.js +3 -3
  93. data/vendor/assets/javascripts/ckeditor/lang/si.js +5 -0
  94. data/vendor/assets/javascripts/ckeditor/lang/sk.js +5 -0
  95. data/vendor/assets/javascripts/ckeditor/lang/sl.js +5 -0
  96. data/vendor/assets/javascripts/ckeditor/lang/sq.js +5 -0
  97. data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +5 -0
  98. data/vendor/assets/javascripts/ckeditor/lang/sr.js +5 -0
  99. data/vendor/assets/javascripts/ckeditor/lang/sv.js +5 -0
  100. data/vendor/assets/javascripts/ckeditor/lang/th.js +5 -0
  101. data/vendor/assets/javascripts/ckeditor/lang/tr.js +5 -0
  102. data/vendor/assets/javascripts/ckeditor/lang/tt.js +5 -0
  103. data/vendor/assets/javascripts/ckeditor/lang/ug.js +5 -0
  104. data/vendor/assets/javascripts/ckeditor/lang/uk.js +5 -0
  105. data/vendor/assets/javascripts/ckeditor/lang/vi.js +5 -0
  106. data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +5 -0
  107. data/vendor/assets/javascripts/ckeditor/lang/zh.js +5 -0
  108. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -7
  109. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +2 -2
  110. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
  111. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +5 -5
  112. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png +0 -0
  113. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  114. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
  115. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  116. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
  117. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
  118. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
  119. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autocomplete.png +0 -0
  120. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/autoformat.png +0 -0
  121. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/commentselectedrange.png +0 -0
  122. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/searchcode.png +0 -0
  123. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/images/uncommentselectedrange.png +0 -0
  124. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -2
  125. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -2
  126. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  127. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -6
  128. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
  129. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.handlebars.min.js +1 -0
  130. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -2
  131. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  132. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -3
  133. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -1
  134. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +231 -217
  135. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/darcula.css +46 -0
  136. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/gruvbox-dark.css +34 -0
  137. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/idea.css +42 -0
  138. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
  139. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lucario.css +37 -0
  140. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +5 -0
  141. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/oceanic-next.css +44 -0
  142. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/shadowfox.css +52 -0
  143. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +0 -1
  144. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ssms.css +16 -0
  145. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +2 -2
  146. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +11 -11
  147. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +2 -2
  148. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +23 -23
  149. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +5 -5
  150. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +2 -2
  151. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +3 -3
  152. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +2 -2
  153. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +2 -2
  154. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +7 -7
  155. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +4 -3
  156. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +3 -3
  157. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +3 -3
  158. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  160. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +3 -3
  161. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +1259 -44
  162. data/vendor/assets/javascripts/ckeditor/plugins/image/icons/hidpi/image.png +0 -0
  163. data/vendor/assets/javascripts/ckeditor/plugins/image/icons/image.png +0 -0
  164. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/en.js +25 -0
  165. data/vendor/assets/javascripts/ckeditor/plugins/image/lang/ru.js +25 -0
  166. data/vendor/assets/javascripts/ckeditor/plugins/image/plugin.js +184 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
  168. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
  169. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/contents.css +35 -0
  170. data/vendor/assets/javascripts/ckeditor/plugins/image2/dev/image2.html +339 -0
  171. data/vendor/assets/javascripts/ckeditor/plugins/image2/dialogs/image2.js +553 -0
  172. data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
  173. data/vendor/assets/javascripts/ckeditor/plugins/image2/icons/image.png +0 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/en.js +21 -0
  175. data/vendor/assets/javascripts/ckeditor/plugins/image2/lang/ru.js +21 -0
  176. data/vendor/assets/javascripts/ckeditor/plugins/image2/plugin.js +1720 -0
  177. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
  178. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
  179. data/vendor/assets/javascripts/ckeditor/plugins/image2/samples/image2.html +68 -0
  180. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +1 -1
  181. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +2 -2
  182. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +28 -26
  183. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -7
  184. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +2 -2
  185. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +53 -51
  186. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +31 -32
  187. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +2 -2
  188. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +2 -2
  189. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +2 -2
  190. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +2 -2
  191. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +6 -6
  192. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +6 -6
  193. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +4 -4
  194. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -15
  195. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +2 -2
  196. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +2 -2
  197. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +2 -2
  198. data/vendor/assets/javascripts/ckeditor/plugins/widget/images/handle.png +0 -0
  199. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +1 -0
  200. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +2 -1
  201. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +468 -377
  202. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/maxParagraphs.html +26 -0
  203. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +82 -82
  204. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +449 -448
  205. data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +28 -23
  206. data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
  207. data/vendor/assets/javascripts/ckeditor/samples/img/logo.svg +13 -0
  208. data/vendor/assets/javascripts/ckeditor/samples/index.html +16 -16
  209. data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +4 -4
  210. data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +2 -2
  211. data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +5 -5
  212. data/vendor/assets/javascripts/ckeditor/samples/old/api.html +14 -14
  213. data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +7 -7
  214. data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +2 -2
  215. data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +4 -4
  216. data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +2 -2
  217. data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +14 -14
  218. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +2 -2
  219. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +8 -8
  220. data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +5 -5
  221. data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +8 -8
  222. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +6 -6
  223. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +7 -7
  224. data/vendor/assets/javascripts/ckeditor/samples/old/index.html +8 -5
  225. data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +10 -10
  226. data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +6 -6
  227. data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +6 -6
  228. data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +6 -6
  229. data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +5 -5
  230. data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +8 -8
  231. data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +5 -5
  232. data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +5 -5
  233. data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +2 -2
  234. data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +2 -2
  235. data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +2 -2
  236. data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/assets/sample.css +70 -0
  237. data/vendor/assets/javascripts/ckeditor/samples/old/stylesheetparser/stylesheetparser.html +85 -0
  238. data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +5 -5
  239. data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +8 -8
  240. data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +6 -6
  241. data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +8 -8
  242. data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +5 -5
  243. data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +6 -6
  244. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +12 -12
  245. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +123 -1
  246. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +1 -1
  247. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +1 -1
  248. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +1 -1
  249. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +1 -1
  250. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +1 -1
  251. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
  252. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
  253. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +3 -3
  254. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +3 -3
  255. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +3 -3
  256. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +3 -3
  257. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +3 -3
  258. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +3 -3
  259. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +3 -3
  260. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +3 -3
  261. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +3 -3
  262. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons.png +0 -0
  263. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/icons_hidpi.png +0 -0
  264. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/readme.md +3 -3
  265. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/skin.js +2 -2
  266. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +3 -3
  267. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +3 -3
  268. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +3 -3
  269. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +3 -3
  270. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +3 -3
  271. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +3 -3
  272. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +3 -3
  273. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +3 -3
  274. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +3 -3
  275. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +3 -3
  276. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +3 -3
  277. data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +4 -4
  278. data/vendor/assets/javascripts/ckeditor/skins/moono/skin.js +2 -2
  279. data/vendor/assets/javascripts/ckeditor/styles.js +4 -4
  280. metadata +179 -56
  281. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -169
  282. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +0 -7
  283. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +0 -7
  284. data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +0 -929
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>CKEditor</title>
6
+ <script src="../../../ckeditor.js"></script>
7
+ </head>
8
+ <body>
9
+ <textarea name="editor1"></textarea>
10
+ <script>
11
+ var config = {
12
+ extraPlugins: 'wordcount',
13
+ wordcount: {
14
+ maxParagraphs: 5,
15
+ showParagraphs: true,
16
+ showWordCount: false,
17
+ showRemaining: true
18
+ },
19
+ language: 'en'
20
+ }
21
+ </script>
22
+ <script>
23
+ CKEDITOR.replace( 'editor1' , config);
24
+ </script>
25
+ </body>
26
+ </html>
@@ -2,90 +2,90 @@
2
2
  Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.html or http://ckeditor.com/license
4
4
  */
5
- (function(){function z(a){return a&&a.domId&&a.getInputElement().$?a.getInputElement():a&&a.$?a:!1}function I(a){if(!a)throw"Languages-by-groups list are required for construct selectbox";var c=[],d="",e;for(e in a)for(var f in a[e]){var h=a[e][f];"en_US"==h?d=h:c.push(h)}c.sort();d&&c.unshift(d);return{getCurrentLangGroup:function(c){a:{for(var e in a)for(var d in a[e])if(d.toUpperCase()===c.toUpperCase()){c=e;break a}c=""}return c},setLangList:function(){var c={},e;for(e in a)for(var d in a[e])c[a[e][d]]=
6
- d;return c}()}}var g=function(){var a=function(a,b,e){e=e||{};var f=e.expires;if("number"==typeof f&&f){var h=new Date;h.setTime(h.getTime()+1E3*f);f=e.expires=h}f&&f.toUTCString&&(e.expires=f.toUTCString());b=encodeURIComponent(b);a=a+"\x3d"+b;for(var k in e)b=e[k],a+="; "+k,!0!==b&&(a+="\x3d"+b);document.cookie=a};return{postMessage:{init:function(a){window.addEventListener?window.addEventListener("message",a,!1):window.attachEvent("onmessage",a)},send:function(a){var b=Object.prototype.toString,
5
+ (function(){function A(a){return a&&a.domId&&a.getInputElement().$?a.getInputElement():a&&a.$?a:!1}function J(a){if(!a)throw"Languages-by-groups list are required for construct selectbox";var d=[],c="",e;for(e in a)for(var f in a[e]){var h=a[e][f];"en_US"==h?c=h:d.push(h)}d.sort();c&&d.unshift(c);return{getCurrentLangGroup:function(d){a:{for(var c in a)for(var e in a[c])if(e.toUpperCase()===d.toUpperCase()){d=c;break a}d=""}return d},setLangList:function(){var d={},c;for(c in a)for(var e in a[c])d[a[c][e]]=
6
+ e;return d}()}}var g=function(){var a=function(a,b,e){e=e||{};var f=e.expires;if("number"==typeof f&&f){var h=new Date;h.setTime(h.getTime()+1E3*f);f=e.expires=h}f&&f.toUTCString&&(e.expires=f.toUTCString());b=encodeURIComponent(b);a=a+"\x3d"+b;for(var k in e)b=e[k],a+="; "+k,!0!==b&&(a+="\x3d"+b);document.cookie=a};return{postMessage:{init:function(a){window.addEventListener?window.addEventListener("message",a,!1):window.attachEvent("onmessage",a)},send:function(a){var b=Object.prototype.toString,
7
7
  e=a.fn||null,f=a.id||"",h=a.target||window,k=a.message||{id:f};a.message&&"[object Object]"==b.call(a.message)&&(a.message.id?a.message.id:a.message.id=f,k=a.message);a=window.JSON.stringify(k,e);h.postMessage(a,"*")},unbindHandler:function(a){window.removeEventListener?window.removeEventListener("message",a,!1):window.detachEvent("onmessage",a)}},hash:{create:function(){},parse:function(){}},cookie:{set:a,get:function(a){return(a=document.cookie.match(new RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,
8
- "\\$1")+"\x3d([^;]*)")))?decodeURIComponent(a[1]):void 0},remove:function(c){a(c,"",{expires:-1})}},misc:{findFocusable:function(a){var b=null;a&&(b=a.find("a[href], area[href], input, select, textarea, button, *[tabindex], *[contenteditable]"));return b},isVisible:function(a){var b;(b=0===a.offsetWidth||0==a.offsetHeight)||(b="none"===(document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null).display:a.currentStyle?a.currentStyle.display:a.style.display));
8
+ "\\$1")+"\x3d([^;]*)")))?decodeURIComponent(a[1]):void 0},remove:function(d){a(d,"",{expires:-1})}},misc:{findFocusable:function(a){var b=null;a&&(b=a.find("a[href], area[href], input, select, textarea, button, *[tabindex], *[contenteditable]"));return b},isVisible:function(a){var b;(b=0===a.offsetWidth||0==a.offsetHeight)||(b="none"===(document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null).display:a.currentStyle?a.currentStyle.display:a.style.display));
9
9
  return!b},hasClass:function(a,b){return!(!a.className||!a.className.match(new RegExp("(\\s|^)"+b+"(\\s|$)")))}}}}(),a=a||{};a.TextAreaNumber=null;a.load=!0;a.cmd={SpellTab:"spell",Thesaurus:"thes",GrammTab:"grammar"};a.dialog=null;a.optionNode=null;a.selectNode=null;a.grammerSuggest=null;a.textNode={};a.iframeMain=null;a.dataTemp="";a.div_overlay=null;a.textNodeInfo={};a.selectNode={};a.selectNodeResponce={};a.langList=null;a.langSelectbox=null;a.banner="";a.show_grammar=null;a.div_overlay_no_check=
10
10
  null;a.targetFromFrame={};a.onLoadOverlay=null;a.LocalizationComing={};a.OverlayPlace=null;a.sessionid="";a.LocalizationButton={ChangeTo_button:{instance:null,text:"Change to",localizationID:"ChangeTo"},ChangeAll:{instance:null,text:"Change All"},IgnoreWord:{instance:null,text:"Ignore word"},IgnoreAllWords:{instance:null,text:"Ignore all words"},Options:{instance:null,text:"Options",optionsDialog:{instance:null}},AddWord:{instance:null,text:"Add word"},FinishChecking_button:{instance:null,text:"Finish Checking",
11
- localizationID:"FinishChecking"},Option_button:{instance:null,text:"Options",localizationID:"Options"},FinishChecking_button_block:{instance:null,text:"Finish Checking",localizationID:"FinishChecking"}};a.LocalizationLabel={ChangeTo_label:{instance:null,text:"Change to",localizationID:"ChangeTo"},Suggestions:{instance:null,text:"Suggestions"},Categories:{instance:null,text:"Categories"},Synonyms:{instance:null,text:"Synonyms"}};var J=function(b){var c,d,e;for(e in b){if(c=a.dialog.getContentElement(a.dialog._.currentTabId,
12
- e))c=c.getElement();else if(b[e].instance)c=b[e].instance.getElement().getFirst()||b[e].instance.getElement();else continue;d=b[e].localizationID||e;c.setText(a.LocalizationComing[d])}},K=function(b){var c,d,e;for(e in b)c=a.dialog.getContentElement(a.dialog._.currentTabId,e),c||(c=b[e].instance),c.setLabel&&(d=b[e].localizationID||e,c.setLabel(a.LocalizationComing[d]+":"))},t,A;a.framesetHtml=function(b){return"\x3ciframe id\x3d"+a.iframeNumber+"_"+b+' frameborder\x3d"0" allowtransparency\x3d"1" style\x3d"width:100%;border: 1px solid #AEB3B9;overflow: auto;background:#fff; border-radius: 3px;"\x3e\x3c/iframe\x3e'};
13
- a.setIframe=function(b,c){var d;d=a.framesetHtml(c);var e=a.iframeNumber+"_"+c;b.getElement().setHtml(d);d=document.getElementById(e);d=d.contentWindow?d.contentWindow:d.contentDocument.document?d.contentDocument.document:d.contentDocument;d.document.open();d.document.write('\x3c!DOCTYPE html\x3e\x3chtml\x3e\x3chead\x3e\x3cmeta charset\x3d"UTF-8"\x3e\x3ctitle\x3eiframe\x3c/title\x3e\x3cstyle\x3ehtml,body{margin: 0;height: 100%;font: 13px/1.555 "Trebuchet MS", sans-serif;}a{color: #888;font-weight: bold;text-decoration: none;border-bottom: 1px solid #888;}.main-box {color:#252525;padding: 3px 5px;text-align: justify;}.main-box p{margin: 0 0 14px;}.main-box .cerr{color: #f00000;border-bottom-color: #f00000;}\x3c/style\x3e\x3c/head\x3e\x3cbody\x3e\x3cdiv id\x3d"content" class\x3d"main-box"\x3e\x3c/div\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"spelltext" name\x3d"spelltext" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadsuggestfirst" name\x3d"loadsuggestfirst" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadspellsuggestall" name\x3d"loadspellsuggestall" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadOptionsForm" name\x3d"loadOptionsForm" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3cscript\x3e(function(window) {var ManagerPostMessage \x3d function() {var _init \x3d function(handler) {if (document.addEventListener) {window.addEventListener("message", handler, false);} else {window.attachEvent("onmessage", handler);};};var _sendCmd \x3d function(o) {var str,type \x3d Object.prototype.toString,fn \x3d o.fn || null,id \x3d o.id || "",target \x3d o.target || window,message \x3d o.message || { "id": id };if (o.message \x26\x26 type.call(o.message) \x3d\x3d "[object Object]") {(o.message["id"]) ? o.message["id"] : o.message["id"] \x3d id;message \x3d o.message;};str \x3d JSON.stringify(message, fn);target.postMessage(str, "*");};return {init: _init,send: _sendCmd};};var manageMessageTmp \x3d new ManagerPostMessage;var appString \x3d (function(){var spell \x3d parent.CKEDITOR.config.wsc.DefaultParams.scriptPath;var serverUrl \x3d parent.CKEDITOR.config.wsc.DefaultParams.serviceHost;return serverUrl + spell;})();function loadScript(src, callback) {var scriptTag \x3d document.createElement("script");scriptTag.type \x3d "text/javascript";callback ? callback : callback \x3d function() {};if(scriptTag.readyState) {scriptTag.onreadystatechange \x3d function() {if (scriptTag.readyState \x3d\x3d "loaded" ||scriptTag.readyState \x3d\x3d "complete") {scriptTag.onreadystatechange \x3d null;setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();}};}else{scriptTag.onload \x3d function() {setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();};};scriptTag.src \x3d src;document.getElementsByTagName("head")[0].appendChild(scriptTag);};window.onload \x3d function(){loadScript(appString, function(){manageMessageTmp.send({"id": "iframeOnload","target": window.parent});});}})(this);\x3c/script\x3e\x3c/body\x3e\x3c/html\x3e');
14
- d.document.close();a.div_overlay.setEnable()};a.setCurrentIframe=function(b){a.setIframe(a.dialog._.contents[b].Content,b)};a.setHeightBannerFrame=function(){var b=a.dialog.getContentElement("SpellTab","banner").getElement(),c=a.dialog.getContentElement("GrammTab","banner").getElement(),d=a.dialog.getContentElement("Thesaurus","banner").getElement();b.setStyle("height","90px");c.setStyle("height","90px");d.setStyle("height","90px")};a.setHeightFrame=function(){document.getElementById(a.iframeNumber+
15
- "_"+a.dialog._.currentTabId).style.height="240px"};a.sendData=function(b){var c=b._.currentTabId,d=b._.contents[c].Content,e,f;a.previousTab=c;a.setIframe(d,c);var h=function(h){c=b._.currentTabId;h=h||window.event;h.data.getTarget().is("a")&&c!==a.previousTab&&(a.previousTab=c,d=b._.contents[c].Content,e=a.iframeNumber+"_"+c,a.div_overlay.setEnable(),d.getElement().getChildCount()?E(a.targetFromFrame[e],a.cmd[c]):(a.setIframe(d,c),f=document.getElementById(e),a.targetFromFrame[e]=f.contentWindow))};
16
- b.parts.tabs.removeListener("click",h);b.parts.tabs.on("click",h)};a.buildSelectLang=function(a){var c=new CKEDITOR.dom.element("div"),d=new CKEDITOR.dom.element("select");a="wscLang"+a;c.addClass("cke_dialog_ui_input_select");c.setAttribute("role","presentation");c.setStyles({height:"auto",position:"absolute",right:"0",top:"-1px",width:"160px","white-space":"normal"});d.setAttribute("id",a);d.addClass("cke_dialog_ui_input_select");d.setStyles({width:"160px"});c.append(d);return c};a.buildOptionLang=
17
- function(b,c){var d=document.getElementById("wscLang"+c),e=document.createDocumentFragment(),f,h,k=[];if(0===d.options.length){for(f in b)k.push([f,b[f]]);k.sort();for(var p=0;p<k.length;p++)f=document.createElement("option"),f.setAttribute("value",k[p][1]),h=document.createTextNode(k[p][0]),f.appendChild(h),e.appendChild(f);d.appendChild(e)}for(e=0;e<d.options.length;e++)d.options[e].value==a.selectingLang&&(d.options[e].selected="selected")};a.buildOptionSynonyms=function(b){b=a.selectNodeResponce[b];
18
- var c=z(a.selectNode.Synonyms);a.selectNode.Synonyms.clear();for(var d=0;d<b.length;d++){var e=document.createElement("option");e.text=b[d];e.value=b[d];c.$.add(e,d)}a.selectNode.Synonyms.getInputElement().$.firstChild.selected=!0;a.textNode.Thesaurus.setValue(a.selectNode.Synonyms.getInputElement().getValue())};var B=function(a){var c=document,d=a.target||c.body,e=a.id||"overlayBlock",f=a.opacity||"0.9";a=a.background||"#f1f1f1";var h=c.getElementById(e),k=h||c.createElement("div");k.style.cssText=
19
- "position: absolute;top:30px;bottom:41px;left:1px;right:1px;z-index: 10020;padding:0;margin:0;background:"+a+";opacity: "+f+";filter: alpha(opacity\x3d"+100*f+");display: none;";k.id=e;h||d.appendChild(k);return{setDisable:function(){k.style.display="none"},setEnable:function(){k.style.display="block"}}},L=function(b,c,d){var e=new CKEDITOR.dom.element("div"),f=new CKEDITOR.dom.element("input"),h=new CKEDITOR.dom.element("label"),k="wscGrammerSuggest"+b+"_"+c;e.addClass("cke_dialog_ui_input_radio");
20
- e.setAttribute("role","presentation");e.setStyles({width:"97%",padding:"5px","white-space":"normal"});f.setAttributes({type:"radio",value:c,name:"wscGrammerSuggest",id:k});f.setStyles({"float":"left"});f.on("click",function(b){a.textNode.GrammTab.setValue(b.sender.getValue())});d?f.setAttribute("checked",!0):!1;f.addClass("cke_dialog_ui_radio_input");h.appendText(b);h.setAttribute("for",k);h.setStyles({display:"block","line-height":"16px","margin-left":"18px","white-space":"normal"});e.append(f);
21
- e.append(h);return e},F=function(a){a=a||"true";null!==a&&"false"==a&&u()},w=function(b){var c=new I(b);b="wscLang"+a.dialog.getParentEditor().name;b=document.getElementById(b);var d,e=a.iframeNumber+"_"+a.dialog._.currentTabId;a.buildOptionLang(c.setLangList,a.dialog.getParentEditor().name);if(d=c.getCurrentLangGroup(a.selectingLang))v[d].onShow();F(a.show_grammar);b.onchange=function(b){b=c.getCurrentLangGroup(this.value);var d=a.dialog._.currentTabId;v[b].onShow();F(a.show_grammar);a.div_overlay.setEnable();
22
- a.selectingLang=this.value;d=a.cmd[d];b&&v[b]&&v[b].allowedTabCommands[d]||(d=v[b].defaultTabCommand);for(var k in a.cmd)if(a.cmd[k]==d){a.previousTab=k;break}g.postMessage.send({message:{changeLang:a.selectingLang,interfaceLang:a.interfaceLang,text:a.dataTemp,cmd:d},target:a.targetFromFrame[e],id:"selectionLang_outer__page"})}},M=function(b){var c,d=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;b.getElement().hasClass("cke_disabled")?b.getElement().setStyle("color",
23
- "#a0a0a0"):b.disable()};c=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;b.enable();b.getElement().setStyle("color","#333")};"no_any_suggestions"==b?(b="No suggestions",c=a.dialog.getContentElement(a.dialog._.currentTabId,"ChangeTo_button")||a.LocalizationButton.ChangeTo_button.instance,c.disable(),c=a.dialog.getContentElement(a.dialog._.currentTabId,"ChangeAll")||a.LocalizationButton.ChangeAll.instance,c.disable(),d("ChangeTo_button"),d("ChangeAll")):
24
- (c("ChangeTo_button"),c("ChangeAll"));return b},O={iframeOnload:function(b){b=a.dialog._.currentTabId;E(a.targetFromFrame[a.iframeNumber+"_"+b],a.cmd[b])},suggestlist:function(b){delete b.id;a.div_overlay_no_check.setDisable();C();w(a.langList);var c=M(b.word),d="";c instanceof Array&&(c=b.word[0]);d=c=c.split(",");a.textNode.SpellTab.setValue(d[0]);b=z(A);A.clear();for(c=0;c<d.length;c++){var e=document.createElement("option");e.text=d[c];e.value=d[c];b.$.add(e,c)}l();a.div_overlay.setDisable()},
25
- grammerSuggest:function(b){delete b.id;delete b.mocklangs;C();w(a.langList);var c=b.grammSuggest[0];a.grammerSuggest.getElement().setHtml("");a.textNode.GrammTab.reset();a.textNode.GrammTab.setValue(c);a.textNodeInfo.GrammTab.getElement().setHtml("");a.textNodeInfo.GrammTab.getElement().setText(b.info);b=b.grammSuggest;for(var c=b.length,d=!0,e=0;e<c;e++)a.grammerSuggest.getElement().append(L(b[e],b[e],d)),d=!1;l();a.div_overlay.setDisable()},thesaurusSuggest:function(b){delete b.id;delete b.mocklangs;
26
- C();w(a.langList);a.selectNodeResponce=b;a.textNode.Thesaurus.reset();var c=z(a.selectNode.Categories),d=0;a.selectNode.Categories.clear();for(var e in b)b=document.createElement("option"),b.text=e,b.value=e,c.$.add(b,d),d++;c=a.selectNode.Categories.getInputElement().getChildren().$[0].value;a.selectNode.Categories.getInputElement().getChildren().$[0].selected=!0;a.buildOptionSynonyms(c);l();a.div_overlay.setDisable()},finish:function(b){delete b.id;N();b=a.dialog.getContentElement(a.dialog._.currentTabId,
27
- "BlockFinishChecking").getElement();b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.show();a.div_overlay.setDisable()},settext:function(b){delete b.id;a.dialog.getParentEditor().getCommand("checkspell");var c=a.dialog.getParentEditor();if(c.scayt&&c.wsc.isSsrvSame){var d=c.wsc.udn;d?c.wsc.DataStorage.setData("scayt_user_dictionary_name",d):c.wsc.DataStorage.setData("scayt_user_dictionary_name","")}try{c.focus()}catch(e){}c.setData(b.text,function(){a.dataTemp="";c.unlockSelection();
28
- c.fire("saveSnapshot");a.dialog.hide()})},ReplaceText:function(b){delete b.id;a.div_overlay.setEnable();a.dataTemp=b.text;a.selectingLang=b.currentLang;(b.cmd="0"!==b.len&&b.len)?a.div_overlay.setDisable():window.setTimeout(function(){try{a.div_overlay.setDisable()}catch(b){}},500);J(a.LocalizationButton);K(a.LocalizationLabel)},options_checkbox_send:function(b){delete b.id;b={osp:g.cookie.get("osp"),udn:g.cookie.get("udn"),cust_dic_ids:a.cust_dic_ids};g.postMessage.send({message:b,target:a.targetFromFrame[a.iframeNumber+
29
- "_"+a.dialog._.currentTabId],id:"options_outer__page"})},getOptions:function(b){var c=b.DefOptions.udn;a.LocalizationComing=b.DefOptions.localizationButtonsAndText;a.show_grammar=b.show_grammar;a.langList=b.lang;a.bnr=b.bannerId;a.sessionid=b.sessionid;if(b.bannerId){a.setHeightBannerFrame();var d=b.banner;a.dialog.getContentElement(a.dialog._.currentTabId,"banner").getElement().setHtml(d)}else a.setHeightFrame();"undefined"==c&&(a.userDictionaryName?(c=a.userDictionaryName,d={osp:g.cookie.get("osp"),
30
- udn:a.userDictionaryName,cust_dic_ids:a.cust_dic_ids,id:"options_dic_send",udnCmd:"create"},g.postMessage.send({message:d,target:a.targetFromFrame[void 0]})):c="");g.cookie.set("osp",b.DefOptions.osp);g.cookie.set("udn",c);g.cookie.set("cust_dic_ids",b.DefOptions.cust_dic_ids);g.postMessage.send({id:"giveOptions"})},options_dic_send:function(b){b={osp:g.cookie.get("osp"),udn:g.cookie.get("udn"),cust_dic_ids:a.cust_dic_ids,id:"options_dic_send",udnCmd:g.cookie.get("udnCmd")};g.postMessage.send({message:b,
31
- target:a.targetFromFrame[a.iframeNumber+"_"+a.dialog._.currentTabId]})},data:function(a){delete a.id},giveOptions:function(){},setOptionsConfirmF:function(){},setOptionsConfirmT:function(){t.setValue("")},clickBusy:function(){a.div_overlay.setEnable()},suggestAllCame:function(){a.div_overlay.setDisable();a.div_overlay_no_check.setDisable()},TextCorrect:function(){w(a.langList)}},G=function(a){a=a||window.event;if((a=window.JSON.parse(a.data))&&a.id)O[a.id](a)},E=function(b,c,d,e){c=c||CKEDITOR.config.wsc_cmd;
32
- d=d||a.dataTemp;g.postMessage.send({message:{customerId:a.wsc_customerId,text:d,txt_ctrl:a.TextAreaNumber,cmd:c,cust_dic_ids:a.cust_dic_ids,udn:a.userDictionaryName,slang:a.selectingLang,interfaceLang:a.interfaceLang,reset_suggest:e||!1,sessionid:a.sessionid},target:b,id:"data_outer__page"});a.div_overlay.setEnable()},v={superset:{onShow:function(){a.dialog.showPage("Thesaurus");a.dialog.showPage("GrammTab");q()},allowedTabCommands:{spell:!0,grammar:!0,thes:!0},defaultTabCommand:"spell"},usual:{onShow:function(){x();
33
- u();q()},allowedTabCommands:{spell:!0},defaultTabCommand:"spell"},rtl:{onShow:function(){x();u();q()},allowedTabCommands:{spell:!0},defaultTabCommand:"spell"},spellgrammar:{onShow:function(){x();a.dialog.showPage("GrammTab");q()},allowedTabCommands:{spell:!0,grammar:!0},defaultTabCommand:"spell"},spellthes:{onShow:function(){a.dialog.showPage("Thesaurus");u();q()},allowedTabCommands:{spell:!0,thes:!0},defaultTabCommand:"spell"}},H=function(b){var c=(new function(a){var b={};return{getCmdByTab:function(c){for(var h in a)b[a[h]]=
34
- h;return b[c]}}}(a.cmd)).getCmdByTab(CKEDITOR.config.wsc_cmd);l();b.selectPage(c);a.sendData(b)},x=function(){a.dialog.hidePage("Thesaurus")},u=function(){a.dialog.hidePage("GrammTab")},q=function(){a.dialog.showPage("SpellTab")},l=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"bottomGroup").getElement();b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.show()},N=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"bottomGroup").getElement(),
35
- c=document.activeElement,d;b.setStyles({display:"block",position:"absolute",left:"-9999px"});setTimeout(function(){b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.hide();a.dialog._.editor.focusManager.currentActive.focusNext();d=g.misc.findFocusable(a.dialog.parts.contents);if(g.misc.hasClass(c,"cke_dialog_tab")||g.misc.hasClass(c,"cke_dialog_contents_body")||!g.misc.isVisible(c))for(var e=0,f;e<d.count();e++){if(f=d.getItem(e),g.misc.isVisible(f.$)){try{f.$.focus()}catch(h){}break}}else try{c.focus()}catch(k){}},
36
- 0)},C=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"BlockFinishChecking").getElement(),c=document.activeElement,d;b.setStyles({display:"block",position:"absolute",left:"-9999px"});setTimeout(function(){b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.hide();a.dialog._.editor.focusManager.currentActive.focusNext();d=g.misc.findFocusable(a.dialog.parts.contents);if(g.misc.hasClass(c,"cke_dialog_tab")||g.misc.hasClass(c,"cke_dialog_contents_body")||!g.misc.isVisible(c))for(var e=
37
- 0,f;e<d.count();e++){if(f=d.getItem(e),g.misc.isVisible(f.$)){try{f.$.focus()}catch(h){}break}}else try{c.focus()}catch(k){}},0)};CKEDITOR.dialog.add("checkspell",function(b){function c(a){var c=parseInt(b.config.wsc_left,10),e=parseInt(b.config.wsc_top,10),d=parseInt(b.config.wsc_width,10),g=parseInt(b.config.wsc_height,10),m=CKEDITOR.document.getWindow().getViewPaneSize();a.getPosition();var n=a.getSize(),r=0;if(!a._.resized){var r=n.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||
38
- CKEDITOR.env.opera||CKEDITOR.env.ie&&CKEDITOR.env.quirks)),D=n.width-a.parts.contents.getSize("width",1);if(d<f.minWidth||isNaN(d))d=f.minWidth;d>m.width-D&&(d=m.width-D);if(g<f.minHeight||isNaN(g))g=f.minHeight;g>m.height-r&&(g=m.height-r);n.width=d+D;n.height=g+r;a._.fromResizeEvent=!1;a.resize(d,g);setTimeout(function(){a._.fromResizeEvent=!1;CKEDITOR.dialog.fire("resize",{dialog:a,width:d,height:g},b)},300)}a._.moved||(r=isNaN(c)&&isNaN(e)?0:1,isNaN(c)&&(c=(m.width-n.width)/2),0>c&&(c=0),c>m.width-
39
- n.width&&(c=m.width-n.width),isNaN(e)&&(e=(m.height-n.height)/2),0>e&&(e=0),e>m.height-n.height&&(e=m.height-n.height),a.move(c,e,r))}function d(){b.wsc={};(function(a){var b={separator:"\x3c$\x3e",getDataType:function(a){return"undefined"===typeof a?"undefined":null===a?"null":Object.prototype.toString.call(a).slice(8,-1)},convertDataToString:function(a){return this.getDataType(a).toLowerCase()+this.separator+a},restoreDataFromString:function(a){var b=a,c;a=this.backCompatibility(a);if("string"===
40
- typeof a)switch(b=a.indexOf(this.separator),c=a.substring(0,b),b=a.substring(b+this.separator.length),c){case "boolean":b="true"===b;break;case "number":b=parseFloat(b);break;case "array":b=""===b?[]:b.split(",");break;case "null":b=null;break;case "undefined":b=void 0}return b},backCompatibility:function(a){var b=a,c;"string"===typeof a&&(c=a.indexOf(this.separator),0>c&&(b=parseFloat(a),isNaN(b)&&("["===a[0]&&"]"===a[a.length-1]?(a=a.replace("[",""),a=a.replace("]",""),b=""===a?[]:a.split(",")):
41
- b="true"===a||"false"===a?"true"===a:a),b=this.convertDataToString(b)));return b}},c={get:function(a){return b.restoreDataFromString(window.localStorage.getItem(a))},set:function(a,c){var d=b.convertDataToString(c);window.localStorage.setItem(a,d)},del:function(a){window.localStorage.removeItem(a)},clear:function(){window.localStorage.clear()}},e={expiration:31622400,get:function(a){return b.restoreDataFromString(this.getCookie(a))},set:function(a,c){var d=b.convertDataToString(c);this.setCookie(a,
42
- d,{expires:this.expiration})},del:function(a){this.deleteCookie(a)},getCookie:function(a){return(a=document.cookie.match(new RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"\x3d([^;]*)")))?decodeURIComponent(a[1]):void 0},setCookie:function(a,b,c){c=c||{};var d=c.expires;if("number"===typeof d&&d){var e=new Date;e.setTime(e.getTime()+1E3*d);d=c.expires=e}d&&d.toUTCString&&(c.expires=d.toUTCString());b=encodeURIComponent(b);a=a+"\x3d"+b;for(var h in c)b=c[h],a+="; "+h,!0!==b&&(a+=
43
- "\x3d"+b);document.cookie=a},deleteCookie:function(a){this.setCookie(a,null,{expires:-1})},clear:function(){for(var a=document.cookie.split(";"),b=0;b<a.length;b++){var c=a[b],d=c.indexOf("\x3d"),c=-1<d?c.substr(0,d):c;this.deleteCookie(c)}}},d=window.localStorage?c:e;a.DataStorage={getData:function(a){return d.get(a)},setData:function(a,b){d.set(a,b)},deleteData:function(a){d.del(a)},clear:function(){d.clear()}}})(b.wsc);b.wsc.operationWithUDN=function(b,c){g.postMessage.send({message:{udn:c,id:"operationWithUDN",
44
- udnCmd:b},target:a.targetFromFrame[a.iframeNumber+"_"+a.dialog._.currentTabId]})};b.wsc.getLocalStorageUDN=function(){var a=b.wsc.DataStorage.getData("scayt_user_dictionary_name");if(a)return a};b.wsc.getLocalStorageUD=function(){var a=b.wsc.DataStorage.getData("scayt_user_dictionary");if(a)return a};b.wsc.addWords=function(a,c){var d=b.config.wsc.DefaultParams.serviceHost+b.config.wsc.DefaultParams.ssrvHost+"?cmd\x3ddictionary\x26format\x3djson\x26customerid\x3d1%3AncttD3-fIoSf2-huzwE4-Y5muI2-mD0Tt-kG9Wz-UEDFC-tYu243-1Uq474-d9Z2l3\x26action\x3daddword\x26word\x3d"+
11
+ localizationID:"FinishChecking"},Option_button:{instance:null,text:"Options",localizationID:"Options"},FinishChecking_button_block:{instance:null,text:"Finish Checking",localizationID:"FinishChecking"}};a.LocalizationLabel={ChangeTo_label:{instance:null,text:"Change to",localizationID:"ChangeTo"},Suggestions:{instance:null,text:"Suggestions"},Categories:{instance:null,text:"Categories"},Synonyms:{instance:null,text:"Synonyms"}};var K=function(b){var d,c,e;for(e in b){if(d=a.dialog.getContentElement(a.dialog._.currentTabId,
12
+ e))d=d.getElement();else if(b[e].instance)d=b[e].instance.getElement().getFirst()||b[e].instance.getElement();else continue;c=b[e].localizationID||e;d.setText(a.LocalizationComing[c])}},L=function(b){var d,c,e;for(e in b)d=a.dialog.getContentElement(a.dialog._.currentTabId,e),d||(d=b[e].instance),d.setLabel&&(c=b[e].localizationID||e,d.setLabel(a.LocalizationComing[c]+":"))},t,B;a.framesetHtml=function(b){return"\x3ciframe id\x3d"+a.iframeNumber+"_"+b+' frameborder\x3d"0" allowtransparency\x3d"1" style\x3d"width:100%;border: 1px solid #AEB3B9;overflow: auto;background:#fff; border-radius: 3px;"\x3e\x3c/iframe\x3e'};
13
+ a.setIframe=function(b,d){var c;c=a.framesetHtml(d);var e=a.iframeNumber+"_"+d;b.getElement().setHtml(c);c=document.getElementById(e);c=c.contentWindow?c.contentWindow:c.contentDocument.document?c.contentDocument.document:c.contentDocument;c.document.open();c.document.write('\x3c!DOCTYPE html\x3e\x3chtml\x3e\x3chead\x3e\x3cmeta charset\x3d"UTF-8"\x3e\x3ctitle\x3eiframe\x3c/title\x3e\x3cstyle\x3ehtml,body{margin: 0;height: 100%;font: 13px/1.555 "Trebuchet MS", sans-serif;}a{color: #888;font-weight: bold;text-decoration: none;border-bottom: 1px solid #888;}.main-box {color:#252525;padding: 3px 5px;text-align: justify;}.main-box p{margin: 0 0 14px;}.main-box .cerr{color: #f00000;border-bottom-color: #f00000;}\x3c/style\x3e\x3c/head\x3e\x3cbody\x3e\x3cdiv id\x3d"content" class\x3d"main-box"\x3e\x3c/div\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"spelltext" name\x3d"spelltext" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadsuggestfirst" name\x3d"loadsuggestfirst" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadspellsuggestall" name\x3d"loadspellsuggestall" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadOptionsForm" name\x3d"loadOptionsForm" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3cscript\x3e(function(window) {var ManagerPostMessage \x3d function() {var _init \x3d function(handler) {if (document.addEventListener) {window.addEventListener("message", handler, false);} else {window.attachEvent("onmessage", handler);};};var _sendCmd \x3d function(o) {var str,type \x3d Object.prototype.toString,fn \x3d o.fn || null,id \x3d o.id || "",target \x3d o.target || window,message \x3d o.message || { "id": id };if (o.message \x26\x26 type.call(o.message) \x3d\x3d "[object Object]") {(o.message["id"]) ? o.message["id"] : o.message["id"] \x3d id;message \x3d o.message;};str \x3d JSON.stringify(message, fn);target.postMessage(str, "*");};return {init: _init,send: _sendCmd};};var manageMessageTmp \x3d new ManagerPostMessage;var appString \x3d (function(){var spell \x3d parent.CKEDITOR.config.wsc.DefaultParams.scriptPath;var serverUrl \x3d parent.CKEDITOR.config.wsc.DefaultParams.serviceHost;return serverUrl + spell;})();function loadScript(src, callback) {var scriptTag \x3d document.createElement("script");scriptTag.type \x3d "text/javascript";callback ? callback : callback \x3d function() {};if(scriptTag.readyState) {scriptTag.onreadystatechange \x3d function() {if (scriptTag.readyState \x3d\x3d "loaded" ||scriptTag.readyState \x3d\x3d "complete") {scriptTag.onreadystatechange \x3d null;setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();}};}else{scriptTag.onload \x3d function() {setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();};};scriptTag.src \x3d src;document.getElementsByTagName("head")[0].appendChild(scriptTag);};window.onload \x3d function(){loadScript(appString, function(){manageMessageTmp.send({"id": "iframeOnload","target": window.parent});});}})(this);\x3c/script\x3e\x3c/body\x3e\x3c/html\x3e');
14
+ c.document.close();a.div_overlay.setEnable()};a.setCurrentIframe=function(b){a.setIframe(a.dialog._.contents[b].Content,b)};a.setHeightBannerFrame=function(){var b=a.dialog.getContentElement("SpellTab","banner").getElement(),d=a.dialog.getContentElement("GrammTab","banner").getElement(),c=a.dialog.getContentElement("Thesaurus","banner").getElement();b.setStyle("height","90px");d.setStyle("height","90px");c.setStyle("height","90px")};a.setHeightFrame=function(){document.getElementById(a.iframeNumber+
15
+ "_"+a.dialog._.currentTabId).style.height="240px"};a.sendData=function(b){var d=b._.currentTabId,c=b._.contents[d].Content,e,f;a.previousTab=d;a.setIframe(c,d);var h=function(h){d=b._.currentTabId;h=h||window.event;h.data.getTarget().is("a")&&d!==a.previousTab&&(a.previousTab=d,c=b._.contents[d].Content,e=a.iframeNumber+"_"+d,a.div_overlay.setEnable(),c.getElement().getChildCount()?F(a.targetFromFrame[e],a.cmd[d]):(a.setIframe(c,d),f=document.getElementById(e),a.targetFromFrame[e]=f.contentWindow))};
16
+ b.parts.tabs.removeListener("click",h);b.parts.tabs.on("click",h)};a.buildSelectLang=function(a){var d=new CKEDITOR.dom.element("div"),c=new CKEDITOR.dom.element("select");a="wscLang"+a;d.addClass("cke_dialog_ui_input_select");d.setAttribute("role","presentation");d.setStyles({height:"auto",position:"absolute",right:"0",top:"-1px",width:"160px","white-space":"normal"});c.setAttribute("id",a);c.addClass("cke_dialog_ui_input_select");c.setStyles({width:"160px"});d.append(c);return d};a.buildOptionLang=
17
+ function(b,d){var c=document.getElementById("wscLang"+d),e=document.createDocumentFragment(),f,h,k=[];if(0===c.options.length){for(f in b)k.push([f,b[f]]);k.sort();for(var l=0;l<k.length;l++)f=document.createElement("option"),f.setAttribute("value",k[l][1]),h=document.createTextNode(k[l][0]),f.appendChild(h),e.appendChild(f);c.appendChild(e)}for(e=0;e<c.options.length;e++)c.options[e].value==a.selectingLang&&(c.options[e].selected="selected")};a.buildOptionSynonyms=function(b){b=a.selectNodeResponce[b];
18
+ var d=A(a.selectNode.Synonyms);a.selectNode.Synonyms.clear();for(var c=0;c<b.length;c++){var e=document.createElement("option");e.text=b[c];e.value=b[c];d.$.add(e,c)}a.selectNode.Synonyms.getInputElement().$.firstChild.selected=!0;a.textNode.Thesaurus.setValue(a.selectNode.Synonyms.getInputElement().getValue())};var C=function(a){var d=document,c=a.target||d.body,e=a.id||"overlayBlock",f=a.opacity||"0.9";a=a.background||"#f1f1f1";var h=d.getElementById(e),k=h||d.createElement("div");k.style.cssText=
19
+ "position: absolute;top:30px;bottom:41px;left:1px;right:1px;z-index: 10020;padding:0;margin:0;background:"+a+";opacity: "+f+";filter: alpha(opacity\x3d"+100*f+");display: none;";k.id=e;h||c.appendChild(k);return{setDisable:function(){k.style.display="none"},setEnable:function(){k.style.display="block"}}},M=function(b,d,c){var e=new CKEDITOR.dom.element("div"),f=new CKEDITOR.dom.element("input"),h=new CKEDITOR.dom.element("label"),k="wscGrammerSuggest"+b+"_"+d;e.addClass("cke_dialog_ui_input_radio");
20
+ e.setAttribute("role","presentation");e.setStyles({width:"97%",padding:"5px","white-space":"normal"});f.setAttributes({type:"radio",value:d,name:"wscGrammerSuggest",id:k});f.setStyles({"float":"left"});f.on("click",function(b){a.textNode.GrammTab.setValue(b.sender.getValue())});c?f.setAttribute("checked",!0):!1;f.addClass("cke_dialog_ui_radio_input");h.appendText(b);h.setAttribute("for",k);h.setStyles({display:"block","line-height":"16px","margin-left":"18px","white-space":"normal"});e.append(f);
21
+ e.append(h);return e},G=function(a){a=a||"true";null!==a&&"false"==a&&u()},w=function(b){var d=new J(b);b="wscLang"+a.dialog.getParentEditor().name;b=document.getElementById(b);var c,e=a.iframeNumber+"_"+a.dialog._.currentTabId;a.buildOptionLang(d.setLangList,a.dialog.getParentEditor().name);if(c=d.getCurrentLangGroup(a.selectingLang))v[c].onShow();G(a.show_grammar);b.onchange=function(b){b=d.getCurrentLangGroup(this.value);var c=a.dialog._.currentTabId;v[b].onShow();G(a.show_grammar);a.div_overlay.setEnable();
22
+ a.selectingLang=this.value;c=a.cmd[c];b&&v[b]&&v[b].allowedTabCommands[c]||(c=v[b].defaultTabCommand);for(var k in a.cmd)if(a.cmd[k]==c){a.previousTab=k;break}g.postMessage.send({message:{changeLang:a.selectingLang,interfaceLang:a.interfaceLang,text:a.dataTemp,cmd:c},target:a.targetFromFrame[e],id:"selectionLang_outer__page"})}},N=function(b){var d,c=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;b.getElement().hasClass("cke_disabled")?b.getElement().setStyle("color",
23
+ "#a0a0a0"):b.disable()};d=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;b.enable();b.getElement().setStyle("color","#333")};"no_any_suggestions"==b?(b="No suggestions",d=a.dialog.getContentElement(a.dialog._.currentTabId,"ChangeTo_button")||a.LocalizationButton.ChangeTo_button.instance,d.disable(),d=a.dialog.getContentElement(a.dialog._.currentTabId,"ChangeAll")||a.LocalizationButton.ChangeAll.instance,d.disable(),c("ChangeTo_button"),c("ChangeAll")):
24
+ (d("ChangeTo_button"),d("ChangeAll"));return b},P={iframeOnload:function(b){b=a.dialog._.currentTabId;F(a.targetFromFrame[a.iframeNumber+"_"+b],a.cmd[b])},suggestlist:function(b){delete b.id;a.div_overlay_no_check.setDisable();D();w(a.langList);var d=N(b.word),c="";d instanceof Array&&(d=b.word[0]);c=d=d.split(",");a.textNode.SpellTab.setValue(c[0]);b=A(B);B.clear();for(d=0;d<c.length;d++){var e=document.createElement("option");e.text=c[d];e.value=c[d];b.$.add(e,d)}p();a.div_overlay.setDisable()},
25
+ grammerSuggest:function(b){delete b.id;delete b.mocklangs;D();w(a.langList);var d=b.grammSuggest[0];a.grammerSuggest.getElement().setHtml("");a.textNode.GrammTab.reset();a.textNode.GrammTab.setValue(d);a.textNodeInfo.GrammTab.getElement().setHtml("");a.textNodeInfo.GrammTab.getElement().setText(b.info);b=b.grammSuggest;for(var d=b.length,c=!0,e=0;e<d;e++)a.grammerSuggest.getElement().append(M(b[e],b[e],c)),c=!1;p();a.div_overlay.setDisable()},thesaurusSuggest:function(b){delete b.id;delete b.mocklangs;
26
+ D();w(a.langList);a.selectNodeResponce=b;a.textNode.Thesaurus.reset();var d=A(a.selectNode.Categories),c=0;a.selectNode.Categories.clear();for(var e in b)b=document.createElement("option"),b.text=e,b.value=e,d.$.add(b,c),c++;d=a.selectNode.Categories.getInputElement().getChildren().$[0].value;a.selectNode.Categories.getInputElement().getChildren().$[0].selected=!0;a.buildOptionSynonyms(d);p();a.div_overlay.setDisable()},finish:function(b){delete b.id;O();b=a.dialog.getContentElement(a.dialog._.currentTabId,
27
+ "BlockFinishChecking").getElement();b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.show();a.div_overlay.setDisable()},settext:function(b){function d(){try{c.focus()}catch(d){}c.setData(b.text,function(){a.dataTemp="";c.unlockSelection();c.fire("saveSnapshot");a.dialog.hide()})}delete b.id;a.dialog.getParentEditor().getCommand("checkspell");var c=a.dialog.getParentEditor(),e=CKEDITOR.plugins.scayt,f=c.scayt;if(e&&c.wsc){var h=c.wsc.udn,k=c.wsc.ud,l,g;if(f){var x=function(){if(k)for(l=
28
+ k.split(","),g=0;g<l.length;g+=1)f.addWordToUserDictionary(l[g]);else c.wsc.DataStorage.setData("scayt_user_dictionary",[]);d()};e.state.scayt[c.name]&&f.setMarkupPaused(!1);h?(c.wsc.DataStorage.setData("scayt_user_dictionary_name",h),f.restoreUserDictionary(h,x,x)):(c.wsc.DataStorage.setData("scayt_user_dictionary_name",""),f.removeUserDictionary(void 0,x,x))}else h?c.wsc.DataStorage.setData("scayt_user_dictionary_name",h):c.wsc.DataStorage.setData("scayt_user_dictionary_name",""),k&&(l=k.split(","),
29
+ c.wsc.DataStorage.setData("scayt_user_dictionary",l)),d()}},ReplaceText:function(b){delete b.id;a.div_overlay.setEnable();a.dataTemp=b.text;a.selectingLang=b.currentLang;(b.cmd="0"!==b.len&&b.len)?a.div_overlay.setDisable():window.setTimeout(function(){try{a.div_overlay.setDisable()}catch(b){}},500);K(a.LocalizationButton);L(a.LocalizationLabel)},options_checkbox_send:function(b){delete b.id;b={osp:g.cookie.get("osp"),udn:g.cookie.get("udn"),cust_dic_ids:a.cust_dic_ids};g.postMessage.send({message:b,
30
+ target:a.targetFromFrame[a.iframeNumber+"_"+a.dialog._.currentTabId],id:"options_outer__page"})},getOptions:function(b){var d=b.DefOptions.udn;a.LocalizationComing=b.DefOptions.localizationButtonsAndText;a.show_grammar=b.show_grammar;a.langList=b.lang;a.bnr=b.bannerId;a.sessionid=b.sessionid;if(b.bannerId){a.setHeightBannerFrame();var c=b.banner;a.dialog.getContentElement(a.dialog._.currentTabId,"banner").getElement().setHtml(c)}else a.setHeightFrame();"undefined"==d&&(a.userDictionaryName?(d=a.userDictionaryName,
31
+ c={osp:g.cookie.get("osp"),udn:a.userDictionaryName,cust_dic_ids:a.cust_dic_ids,id:"options_dic_send",udnCmd:"create"},g.postMessage.send({message:c,target:a.targetFromFrame[void 0]})):d="");g.cookie.set("osp",b.DefOptions.osp);g.cookie.set("udn",d);g.cookie.set("cust_dic_ids",b.DefOptions.cust_dic_ids);g.postMessage.send({id:"giveOptions"})},options_dic_send:function(b){b={osp:g.cookie.get("osp"),udn:g.cookie.get("udn"),cust_dic_ids:a.cust_dic_ids,id:"options_dic_send",udnCmd:g.cookie.get("udnCmd")};
32
+ g.postMessage.send({message:b,target:a.targetFromFrame[a.iframeNumber+"_"+a.dialog._.currentTabId]})},data:function(a){delete a.id},giveOptions:function(){},setOptionsConfirmF:function(){},setOptionsConfirmT:function(){t.setValue("")},clickBusy:function(){a.div_overlay.setEnable()},suggestAllCame:function(){a.div_overlay.setDisable();a.div_overlay_no_check.setDisable()},TextCorrect:function(){w(a.langList)}},H=function(a){a=a||window.event;if((a=window.JSON.parse(a.data))&&a.id)P[a.id](a)},F=function(b,
33
+ d,c,e){d=d||CKEDITOR.config.wsc_cmd;c=c||a.dataTemp;g.postMessage.send({message:{customerId:a.wsc_customerId,text:c,txt_ctrl:a.TextAreaNumber,cmd:d,cust_dic_ids:a.cust_dic_ids,udn:a.userDictionaryName,slang:a.selectingLang,interfaceLang:a.interfaceLang,reset_suggest:e||!1,sessionid:a.sessionid},target:b,id:"data_outer__page"});a.div_overlay.setEnable()},v={superset:{onShow:function(){a.dialog.showPage("Thesaurus");a.dialog.showPage("GrammTab");q()},allowedTabCommands:{spell:!0,grammar:!0,thes:!0},
34
+ defaultTabCommand:"spell"},usual:{onShow:function(){y();u();q()},allowedTabCommands:{spell:!0},defaultTabCommand:"spell"},rtl:{onShow:function(){y();u();q()},allowedTabCommands:{spell:!0},defaultTabCommand:"spell"},spellgrammar:{onShow:function(){y();a.dialog.showPage("GrammTab");q()},allowedTabCommands:{spell:!0,grammar:!0},defaultTabCommand:"spell"},spellthes:{onShow:function(){a.dialog.showPage("Thesaurus");u();q()},allowedTabCommands:{spell:!0,thes:!0},defaultTabCommand:"spell"}},I=function(b){var d=
35
+ (new function(a){var b={};return{getCmdByTab:function(d){for(var h in a)b[a[h]]=h;return b[d]}}}(a.cmd)).getCmdByTab(CKEDITOR.config.wsc_cmd);p();b.selectPage(d);a.sendData(b)},y=function(){a.dialog.hidePage("Thesaurus")},u=function(){a.dialog.hidePage("GrammTab")},q=function(){a.dialog.showPage("SpellTab")},p=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"bottomGroup").getElement();b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.show()},O=function(){var b=
36
+ a.dialog.getContentElement(a.dialog._.currentTabId,"bottomGroup").getElement(),d=document.activeElement,c;b.setStyles({display:"block",position:"absolute",left:"-9999px"});setTimeout(function(){b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.hide();a.dialog._.editor.focusManager.currentActive.focusNext();c=g.misc.findFocusable(a.dialog.parts.contents);if(g.misc.hasClass(d,"cke_dialog_tab")||g.misc.hasClass(d,"cke_dialog_contents_body")||!g.misc.isVisible(d))for(var e=0,
37
+ f;e<c.count();e++){if(f=c.getItem(e),g.misc.isVisible(f.$)){try{f.$.focus()}catch(h){}break}}else try{d.focus()}catch(k){}},0)},D=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"BlockFinishChecking").getElement(),d=document.activeElement,c;b.setStyles({display:"block",position:"absolute",left:"-9999px"});setTimeout(function(){b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.hide();a.dialog._.editor.focusManager.currentActive.focusNext();c=g.misc.findFocusable(a.dialog.parts.contents);
38
+ if(g.misc.hasClass(d,"cke_dialog_tab")||g.misc.hasClass(d,"cke_dialog_contents_body")||!g.misc.isVisible(d))for(var e=0,f;e<c.count();e++){if(f=c.getItem(e),g.misc.isVisible(f.$)){try{f.$.focus()}catch(h){}break}}else try{d.focus()}catch(k){}},0)};CKEDITOR.dialog.add("checkspell",function(b){function d(a){var c=parseInt(b.config.wsc_left,10),d=parseInt(b.config.wsc_top,10),e=parseInt(b.config.wsc_width,10),g=parseInt(b.config.wsc_height,10),m=CKEDITOR.document.getWindow().getViewPaneSize();a.getPosition();
39
+ var n=a.getSize(),r=0;if(!a._.resized){var r=n.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.opera||CKEDITOR.env.ie&&CKEDITOR.env.quirks)),E=n.width-a.parts.contents.getSize("width",1);if(e<f.minWidth||isNaN(e))e=f.minWidth;e>m.width-E&&(e=m.width-E);if(g<f.minHeight||isNaN(g))g=f.minHeight;g>m.height-r&&(g=m.height-r);n.width=e+E;n.height=g+r;a._.fromResizeEvent=!1;a.resize(e,g);setTimeout(function(){a._.fromResizeEvent=!1;CKEDITOR.dialog.fire("resize",{dialog:a,width:e,
40
+ height:g},b)},300)}a._.moved||(r=isNaN(c)&&isNaN(d)?0:1,isNaN(c)&&(c=(m.width-n.width)/2),0>c&&(c=0),c>m.width-n.width&&(c=m.width-n.width),isNaN(d)&&(d=(m.height-n.height)/2),0>d&&(d=0),d>m.height-n.height&&(d=m.height-n.height),a.move(c,d,r))}function c(){b.wsc={};(function(a){var b={separator:"\x3c$\x3e",getDataType:function(a){return"undefined"===typeof a?"undefined":null===a?"null":Object.prototype.toString.call(a).slice(8,-1)},convertDataToString:function(a){return this.getDataType(a).toLowerCase()+
41
+ this.separator+a},restoreDataFromString:function(a){var b=a,c;a=this.backCompatibility(a);if("string"===typeof a)switch(b=a.indexOf(this.separator),c=a.substring(0,b),b=a.substring(b+this.separator.length),c){case "boolean":b="true"===b;break;case "number":b=parseFloat(b);break;case "array":b=""===b?[]:b.split(",");break;case "null":b=null;break;case "undefined":b=void 0}return b},backCompatibility:function(a){var b=a,c;"string"===typeof a&&(c=a.indexOf(this.separator),0>c&&(b=parseFloat(a),isNaN(b)&&
42
+ ("["===a[0]&&"]"===a[a.length-1]?(a=a.replace("[",""),a=a.replace("]",""),b=""===a?[]:a.split(",")):b="true"===a||"false"===a?"true"===a:a),b=this.convertDataToString(b)));return b}},c={get:function(a){return b.restoreDataFromString(window.localStorage.getItem(a))},set:function(a,c){var d=b.convertDataToString(c);window.localStorage.setItem(a,d)},del:function(a){window.localStorage.removeItem(a)},clear:function(){window.localStorage.clear()}},d={expiration:31622400,get:function(a){return b.restoreDataFromString(this.getCookie(a))},
43
+ set:function(a,c){var d=b.convertDataToString(c);this.setCookie(a,d,{expires:this.expiration})},del:function(a){this.deleteCookie(a)},getCookie:function(a){return(a=document.cookie.match(new RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"\x3d([^;]*)")))?decodeURIComponent(a[1]):void 0},setCookie:function(a,b,c){c=c||{};var d=c.expires;if("number"===typeof d&&d){var e=new Date;e.setTime(e.getTime()+1E3*d);d=c.expires=e}d&&d.toUTCString&&(c.expires=d.toUTCString());b=encodeURIComponent(b);
44
+ a=a+"\x3d"+b;for(var h in c)b=c[h],a+="; "+h,!0!==b&&(a+="\x3d"+b);document.cookie=a},deleteCookie:function(a){this.setCookie(a,null,{expires:-1})},clear:function(){for(var a=document.cookie.split(";"),b=0;b<a.length;b++){var c=a[b],d=c.indexOf("\x3d"),c=-1<d?c.substr(0,d):c;this.deleteCookie(c)}}},e=window.localStorage?c:d;a.DataStorage={getData:function(a){return e.get(a)},setData:function(a,b){e.set(a,b)},deleteData:function(a){e.del(a)},clear:function(){e.clear()}}})(b.wsc);b.wsc.operationWithUDN=
45
+ function(b,c){g.postMessage.send({message:{udn:c,id:"operationWithUDN",udnCmd:b},target:a.targetFromFrame[a.iframeNumber+"_"+a.dialog._.currentTabId]})};b.wsc.getLocalStorageUDN=function(){var a=b.wsc.DataStorage.getData("scayt_user_dictionary_name");if(a)return a};b.wsc.getLocalStorageUD=function(){var a=b.wsc.DataStorage.getData("scayt_user_dictionary");if(a)return a};b.wsc.addWords=function(a,c){var d=b.config.wsc.DefaultParams.serviceHost+b.config.wsc.DefaultParams.ssrvHost+"?cmd\x3ddictionary\x26format\x3djson\x26customerid\x3d1%3AncttD3-fIoSf2-huzwE4-Y5muI2-mD0Tt-kG9Wz-UEDFC-tYu243-1Uq474-d9Z2l3\x26action\x3daddword\x26word\x3d"+
45
46
  a+"\x26callback\x3dtoString\x26synchronization\x3dtrue",e=document.createElement("script");e.type="text/javascript";e.src=d;document.getElementsByTagName("head")[0].appendChild(e);e.onload=c;e.onreadystatechange=function(){"loaded"===this.readyState&&c()}};b.wsc.cgiOrigin=function(){var a=b.config.wsc.DefaultParams.serviceHost.split("/");return a[0]+"//"+a[2]};b.wsc.isSsrvSame=!1}var e=function(c){this.getElement().focus();a.div_overlay.setEnable();c=a.dialog._.currentTabId;var d=a.iframeNumber+"_"+
46
47
  c,e=a.textNode[c].getValue(),f=this.getElement().getAttribute("title-cmd");g.postMessage.send({message:{cmd:f,tabId:c,new_word:e},target:a.targetFromFrame[d],id:"cmd_outer__page"});"ChangeTo"!=f&&"ChangeAll"!=f||b.fire("saveSnapshot");"FinishChecking"==f&&b.config.wsc_onFinish.call(CKEDITOR.document.getWindow().getFrame())},f={minWidth:560,minHeight:444};return{title:b.config.wsc_dialogTitle||b.lang.wsc.title,minWidth:f.minWidth,minHeight:f.minHeight,buttons:[CKEDITOR.dialog.cancelButton],onLoad:function(){a.dialog=
47
- this;x();u();q();b.plugins.scayt&&d()},onShow:function(){a.dialog=this;b.lockSelection(b.getSelection());a.TextAreaNumber="cke_textarea_"+b.name;g.postMessage.init(G);a.dataTemp=b.getData();a.OverlayPlace=a.dialog.parts.tabs.getParent().$;if(CKEDITOR&&CKEDITOR.config){a.wsc_customerId=b.config.wsc_customerId;a.cust_dic_ids=b.config.wsc_customDictionaryIds;a.userDictionaryName=b.config.wsc_userDictionaryName;a.defaultLanguage=CKEDITOR.config.defaultLanguage;var d="file:"==document.location.protocol?
48
- "http:":document.location.protocol,d=b.config.wsc_customLoaderScript||d+"//www.webspellchecker.net/spellcheck3/script/ssrv.cgi?plugin\x3dfck2\x26customerid\x3d"+a.wsc_customerId+"\x26cmd\x3dscript\x26doc\x3dwsc\x26schema\x3d22";c(this);CKEDITOR.scriptLoader.load(d,function(c){CKEDITOR.config&&CKEDITOR.config.wsc&&CKEDITOR.config.wsc.DefaultParams?(a.serverLocationHash=CKEDITOR.config.wsc.DefaultParams.serviceHost,a.logotype=CKEDITOR.config.wsc.DefaultParams.logoPath,a.loadIcon=CKEDITOR.config.wsc.DefaultParams.iconPath,
49
- a.loadIconEmptyEditor=CKEDITOR.config.wsc.DefaultParams.iconPathEmptyEditor,a.LangComparer=new CKEDITOR.config.wsc.DefaultParams._SP_FCK_LangCompare):(a.serverLocationHash=DefaultParams.serviceHost,a.logotype=DefaultParams.logoPath,a.loadIcon=DefaultParams.iconPath,a.loadIconEmptyEditor=DefaultParams.iconPathEmptyEditor,a.LangComparer=new _SP_FCK_LangCompare);a.pluginPath=CKEDITOR.getUrl(b.plugins.wsc.path);a.iframeNumber=a.TextAreaNumber;a.templatePath=a.pluginPath+"dialogs/tmp.html";a.LangComparer.setDefaulLangCode(a.defaultLanguage);
50
- a.currentLang=b.config.wsc_lang||a.LangComparer.getSPLangCode(b.langCode)||"en_US";a.interfaceLang=b.config.wsc_interfaceLang;a.selectingLang=a.currentLang;a.div_overlay=new B({opacity:"1",background:"#fff url("+a.loadIcon+") no-repeat 50% 50%",target:a.OverlayPlace});var d=a.dialog.parts.tabs.getId(),d=CKEDITOR.document.getById(d);d.setStyle("width","97%");d.getElementsByTag("DIV").count()||d.append(a.buildSelectLang(a.dialog.getParentEditor().name));a.div_overlay_no_check=new B({opacity:"1",id:"no_check_over",
51
- background:"#fff url("+a.loadIconEmptyEditor+") no-repeat 50% 50%",target:a.OverlayPlace});c&&(H(a.dialog),a.dialog.setupContent(a.dialog));b.plugins.scayt&&(b.wsc.isSsrvSame=function(){var a=CKEDITOR.config.wsc.DefaultParams.serviceHost.replace("lf/22/js/../../../","").split("//")[1],c=CKEDITOR.config.wsc.DefaultParams.ssrvHost,d=b.config.scayt_srcUrl,e,h,f,g,p;window.SCAYT&&window.SCAYT.CKSCAYT&&(f=SCAYT.CKSCAYT.prototype.basePath,f.split("//"),g=f.split("//")[1].split("/")[0],p=f.split(g+"/")[1].replace("/lf/scayt3/ckscayt/",
52
- "")+"/script/ssrv.cgi");!d||f||b.config.scayt_servicePath||(d.split("//"),e=d.split("//")[1].split("/")[0],h=d.split(e+"/")[1].replace("/lf/scayt3/ckscayt/ckscayt.js","")+"/script/ssrv.cgi");return"//"+a+c==="//"+(b.config.scayt_serviceHost||g||e)+"/"+(b.config.scayt_servicePath||p||h)}());if(window.SCAYT&&b.wsc&&b.wsc.isSsrvSame){var e=b.wsc.cgiOrigin();b.wsc.syncIsDone=!1;c=function(a){a.origin===e&&(a=JSON.parse(a.data),a.ud&&"undefined"!==a.ud?b.wsc.ud=a.ud:"undefined"===a.ud&&(b.wsc.ud=void 0),
53
- a.udn&&"undefined"!==a.udn?b.wsc.udn=a.udn:"undefined"===a.udn&&(b.wsc.udn=void 0),b.wsc.syncIsDone||(h(b.wsc.ud),b.wsc.syncIsDone=!0))};var h=function(c){c=b.wsc.getLocalStorageUD();var d;c instanceof Array&&(d=c.toString());void 0!==d&&""!==d&&setTimeout(function(){b.wsc.addWords(d,function(){H(a.dialog);a.dialog.setupContent(a.dialog)})},400)};window.addEventListener?addEventListener("message",c,!1):window.attachEvent("onmessage",c);setTimeout(function(){var a=b.wsc.getLocalStorageUDN();void 0!==
54
- a&&b.wsc.operationWithUDN("restore",a)},500)}})}else a.dialog.hide()},onHide:function(){var c=CKEDITOR.plugins.scayt,d=b.scayt;b.unlockSelection();c&&d&&c.state[b.name]&&d.setMarkupPaused(!1);a.dataTemp="";a.sessionid="";g.postMessage.unbindHandler(G);if(b.plugins.scayt&&b.wsc&&b.wsc.isSsrvSame){var c=b.wsc.udn,e=b.wsc.ud,f,l;b.scayt?(c?(b.wsc.DataStorage.setData("scayt_user_dictionary_name",c),b.scayt.restoreUserDictionary(c)):(b.wsc.DataStorage.setData("scayt_user_dictionary_name",""),b.scayt.removeUserDictionary()),
55
- e&&setTimeout(function(){f=e.split(",");for(l=0;l<f.length;l+=1)b.scayt.addWordToUserDictionary(f[l])},200),e||b.wsc.DataStorage.setData("scayt_user_dictionary",[])):(c?b.wsc.DataStorage.setData("scayt_user_dictionary_name",c):b.wsc.DataStorage.setData("scayt_user_dictionary_name",""),e&&(f=e.split(","),b.wsc.DataStorage.setData("scayt_user_dictionary",f)))}},contents:[{id:"SpellTab",label:"SpellChecker",accessKey:"S",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"\x3cdiv\x3e\x3c/div\x3e"},
56
- {type:"html",id:"Content",label:"spellContent",html:"",setup:function(b){b=a.iframeNumber+"_"+b._.currentTabId;var c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"hbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",widths:["50%","50%"],className:"wsc-spelltab-bottom",children:[{type:"hbox",id:"leftCol",align:"left",width:"50%",children:[{type:"vbox",id:"rightCol1",widths:["50%","50%"],children:[{type:"text",id:"ChangeTo_label",label:a.LocalizationLabel.ChangeTo_label.text+
57
- ":",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",width:"140px","default":"",onShow:function(){a.textNode.SpellTab=this;a.LocalizationLabel.ChangeTo_label.instance=this},onHide:function(){this.reset()}},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"text",id:"labelSuggestions",label:a.LocalizationLabel.Suggestions.text+":",onShow:function(){a.LocalizationLabel.Suggestions.instance=this;this.getInputElement().setStyles({display:"none"})}},
58
- {type:"html",id:"logo",html:"",setup:function(b){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"left"})}}]},{type:"select",id:"list_of_suggestions",labelStyle:"font: 12px/25px arial, sans-serif;",size:"6",inputStyle:"width: 140px; height: auto;",items:[["loading..."]],onShow:function(){A=this},onChange:function(){a.textNode.SpellTab.setValue(this.getValue())}}]}]}]},{type:"hbox",id:"rightCol",align:"right",width:"50%",children:[{type:"vbox",id:"rightCol_col__left",
59
- widths:["50%","50%","50%","50%"],children:[{type:"button",id:"ChangeTo_button",label:a.LocalizationButton.ChangeTo_button.text,title:"Change to",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd","ChangeTo");a.LocalizationButton.ChangeTo_button.instance=this},onClick:e},{type:"button",id:"ChangeAll",label:a.LocalizationButton.ChangeAll.text,title:"Change All",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.ChangeAll.instance=
60
- this},onClick:e},{type:"button",id:"AddWord",label:a.LocalizationButton.AddWord.text,title:"Add word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.AddWord.instance=this},onClick:e},{type:"button",id:"FinishChecking_button",label:a.LocalizationButton.FinishChecking_button.text,title:"Finish Checking",style:"width: 100%;margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking");a.LocalizationButton.FinishChecking_button.instance=
61
- this},onClick:e}]},{type:"vbox",id:"rightCol_col__right",widths:["50%","50%","50%"],children:[{type:"button",id:"IgnoreWord",label:a.LocalizationButton.IgnoreWord.text,title:"Ignore word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.IgnoreWord.instance=this},onClick:e},{type:"button",id:"IgnoreAllWords",label:a.LocalizationButton.IgnoreAllWords.text,title:"Ignore all words",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
62
- this.id);a.LocalizationButton.IgnoreAllWords.instance=this},onClick:e},{type:"button",id:"Options",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){a.LocalizationButton.Options.instance=this;"file:"==document.location.protocol&&this.disable()},onClick:function(){this.getElement().focus();"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):(y=document.activeElement,b.openDialog("options"))}}]}]}]},
63
- {type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().setStyles({display:"block",position:"absolute",left:"-9999px"})},onHide:l,children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",setup:function(){this.getChild()[0].getElement().$.src=a.logotype;this.getChild()[0].getElement().getParent().setStyles({"text-align":"center"})},children:[{type:"html",id:"logo",html:""}]}]},{type:"hbox",
64
- id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"Option_button",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);"file:"==document.location.protocol&&this.disable()},onClick:function(){this.getElement().focus();"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):(y=document.activeElement,
65
- b.openDialog("options"))}},{type:"button",id:"FinishChecking_button_block",label:a.LocalizationButton.FinishChecking_button_block.text,title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking")},onClick:e}]}]}]}]},{id:"GrammTab",label:"Grammar",accessKey:"G",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"\x3cdiv\x3e\x3c/div\x3e"},{type:"html",id:"Content",label:"GrammarContent",html:"",setup:function(){var b=a.iframeNumber+
66
- "_"+a.dialog._.currentTabId,c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"vbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",children:[{type:"hbox",id:"leftCol",widths:["66%","34%"],children:[{type:"vbox",children:[{type:"text",id:"text",label:"Change to:",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",inputStyle:"float: right; width: 200px;","default":"",onShow:function(){a.textNode.GrammTab=this},onHide:function(){this.reset()}},{type:"html",
67
- id:"html_text",html:"\x3cdiv style\x3d'min-height: 17px; line-height: 17px; padding: 5px; text-align: left;background: #F1F1F1;color: #595959; white-space: normal!important;'\x3e\x3c/div\x3e",onShow:function(b){a.textNodeInfo.GrammTab=this}},{type:"html",id:"radio",html:"",onShow:function(){a.grammerSuggest=this}}]},{type:"vbox",children:[{type:"button",id:"ChangeTo_button",label:"Change to",title:"Change to",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",
68
- "ChangeTo")},onClick:e},{type:"button",id:"IgnoreWord",label:"Ignore word",title:"Ignore word",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:e},{type:"button",id:"IgnoreAllWords",label:"Ignore Problem",title:"Ignore Problem",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:e},{type:"button",id:"FinishChecking_button",label:a.LocalizationButton.FinishChecking_button.text,
69
- title:"Finish Checking",style:"width: 133px; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking")},onClick:e}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().setStyles({display:"block",position:"absolute",left:"-9999px"})},onHide:l,children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",children:[{type:"html",
70
- id:"logo",html:"",setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"FinishChecking_button_block",label:a.LocalizationButton.FinishChecking_button_block.text,title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking")},onClick:e}]}]}]}]},
71
- {id:"Thesaurus",label:"Thesaurus",accessKey:"T",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"\x3cdiv\x3e\x3c/div\x3e"},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(){var b=a.iframeNumber+"_"+a.dialog._.currentTabId,c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"vbox",id:"bottomGroup",style:"width:560px; margin: -10px auto; overflow: hidden;",children:[{type:"hbox",widths:["75%","25%"],children:[{type:"vbox",children:[{type:"hbox",
72
- widths:["65%","35%"],children:[{type:"text",id:"ChangeTo_label",label:a.LocalizationLabel.ChangeTo_label.text+":",labelLayout:"horizontal",inputStyle:"width: 160px;",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onShow:function(b){a.textNode.Thesaurus=this;a.LocalizationLabel.ChangeTo_label.instance=this},onHide:function(){this.reset()}},{type:"button",id:"ChangeTo_button",label:a.LocalizationButton.ChangeTo_button.text,title:"Change to",style:"width: 121px; margin-top: 1px;",onLoad:function(){this.getElement().setAttribute("title-cmd",
73
- "ChangeTo");a.LocalizationButton.ChangeTo_button.instance=this},onClick:e}]},{type:"hbox",children:[{type:"select",id:"Categories",label:a.LocalizationLabel.Categories.text+":",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",items:[],onShow:function(){a.selectNode.Categories=this;a.LocalizationLabel.Categories.instance=this},onChange:function(){a.buildOptionSynonyms(this.getValue())}},{type:"select",id:"Synonyms",label:a.LocalizationLabel.Synonyms.text+
74
- ":",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",items:[],onShow:function(){a.selectNode.Synonyms=this;a.textNode.Thesaurus.setValue(this.getValue());a.LocalizationLabel.Synonyms.instance=this},onChange:function(b){a.textNode.Thesaurus.setValue(this.getValue())}}]}]},{type:"vbox",width:"120px",style:"margin-top:46px;",children:[{type:"html",id:"logotype",label:"WebSpellChecker.net",html:"",setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}},
75
- {type:"button",id:"FinishChecking_button",label:a.LocalizationButton.FinishChecking_button.text,title:"Finish Checking",style:"width: 100%; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking")},onClick:e}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().setStyles({display:"block",position:"absolute",left:"-9999px"})},children:[{type:"hbox",id:"leftCol",
76
- align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",children:[{type:"html",id:"logo",html:"",setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"FinishChecking_button_block",label:a.LocalizationButton.FinishChecking_button_block.text,title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
77
- "FinishChecking")},onClick:e}]}]}]}]}]}});var y=null;CKEDITOR.dialog.add("options",function(b){var c=null,d={},e={},f=null,h=null;g.cookie.get("udn");g.cookie.get("osp");b=function(a){h=this.getElement().getAttribute("title-cmd");a=[];a[0]=e.IgnoreAllCapsWords;a[1]=e.IgnoreWordsNumbers;a[2]=e.IgnoreMixedCaseWords;a[3]=e.IgnoreDomainNames;a=a.toString().replace(/,/g,"");g.cookie.set("osp",a);g.cookie.set("udnCmd",h?h:"ignore");"delete"!=h&&(a="",""!==t.getValue()&&(a=t.getValue()),g.cookie.set("udn",
78
- a));g.postMessage.send({id:"options_dic_send"})};var k=function(){f.getElement().setHtml(a.LocalizationComing.error);f.getElement().show()};return{title:a.LocalizationComing.Options,minWidth:430,minHeight:130,resizable:CKEDITOR.DIALOG_RESIZE_NONE,contents:[{id:"OptionsTab",label:"Options",accessKey:"O",elements:[{type:"hbox",id:"options_error",children:[{type:"html",style:"display: block;text-align: center;white-space: normal!important; font-size: 12px;color:red",html:"\x3cdiv\x3e\x3c/div\x3e",onShow:function(){f=
79
- this}}]},{type:"vbox",id:"Options_content",children:[{type:"hbox",id:"Options_manager",widths:["52%","48%"],children:[{type:"fieldset",label:"Spell Checking Options",style:"border: none;margin-top: 13px;padding: 10px 0 10px 10px",onShow:function(){this.getInputElement().$.children[0].innerHTML=a.LocalizationComing.SpellCheckingOptions},children:[{type:"vbox",id:"Options_checkbox",children:[{type:"checkbox",id:"IgnoreAllCapsWords",label:"Ignore All-Caps Words",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",
80
- style:"float:left; min-height: 16px;","default":"",onClick:function(){e[this.id]=this.getValue()?1:0}},{type:"checkbox",id:"IgnoreWordsNumbers",label:"Ignore Words with Numbers",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){e[this.id]=this.getValue()?1:0}},{type:"checkbox",id:"IgnoreMixedCaseWords",label:"Ignore Mixed-Case Words",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",
81
- style:"float:left; min-height: 16px;","default":"",onClick:function(){e[this.id]=this.getValue()?1:0}},{type:"checkbox",id:"IgnoreDomainNames",label:"Ignore Domain Names",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){e[this.id]=this.getValue()?1:0}}]}]},{type:"vbox",id:"Options_DictionaryName",children:[{type:"text",id:"DictionaryName",style:"margin-bottom: 10px",label:"Dictionary Name:",
82
- labelLayout:"vertical",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onLoad:function(){t=this;var b=a.userDictionaryName?a.userDictionaryName:(g.cookie.get("udn"),this.getValue());this.setValue(b)},onShow:function(){t=this;var b=g.cookie.get("udn")?g.cookie.get("udn"):this.getValue();this.setValue(b);this.setLabel(a.LocalizationComing.DictionaryName)},onHide:function(){this.reset()}},{type:"hbox",id:"Options_buttons",children:[{type:"vbox",id:"Options_leftCol_col",widths:["50%","50%"],
83
- children:[{type:"button",id:"create",label:"Create",title:"Create",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Create)},onClick:b},{type:"button",id:"restore",label:"Restore",title:"Restore",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Restore)},
84
- onClick:b}]},{type:"vbox",id:"Options_rightCol_col",widths:["50%","50%"],children:[{type:"button",id:"rename",label:"Rename",title:"Rename",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Rename)},onClick:b},{type:"button",id:"delete",label:"Remove",title:"Remove",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||
85
- this.getElement()).setText(a.LocalizationComing.Remove)},onClick:b}]}]}]}]},{type:"hbox",id:"Options_text",children:[{type:"html",style:"text-align: justify;margin-top: 15px;white-space: normal!important; font-size: 12px;color:#777;",html:"\x3cdiv\x3e"+a.LocalizationComing.OptionsTextIntro+"\x3c/div\x3e",onShow:function(){this.getElement().setText(a.LocalizationComing.OptionsTextIntro)}}]}]}]}],buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton],onOk:function(){var a=[];a[0]=e.IgnoreAllCapsWords;
86
- a[1]=e.IgnoreWordsNumbers;a[2]=e.IgnoreMixedCaseWords;a[3]=e.IgnoreDomainNames;a=a.toString().replace(/,/g,"");g.cookie.set("osp",a);g.postMessage.send({id:"options_checkbox_send"});f.getElement().hide();f.getElement().setHtml(" ")},onLoad:function(){c=this;d.IgnoreAllCapsWords=c.getContentElement("OptionsTab","IgnoreAllCapsWords");d.IgnoreWordsNumbers=c.getContentElement("OptionsTab","IgnoreWordsNumbers");d.IgnoreMixedCaseWords=c.getContentElement("OptionsTab","IgnoreMixedCaseWords");d.IgnoreDomainNames=
87
- c.getContentElement("OptionsTab","IgnoreDomainNames")},onShow:function(){g.postMessage.init(k);var b=g.cookie.get("osp").split("");e.IgnoreAllCapsWords=b[0];e.IgnoreWordsNumbers=b[1];e.IgnoreMixedCaseWords=b[2];e.IgnoreDomainNames=b[3];parseInt(e.IgnoreAllCapsWords,10)?d.IgnoreAllCapsWords.setValue("checked",!1):d.IgnoreAllCapsWords.setValue("",!1);parseInt(e.IgnoreWordsNumbers,10)?d.IgnoreWordsNumbers.setValue("checked",!1):d.IgnoreWordsNumbers.setValue("",!1);parseInt(e.IgnoreMixedCaseWords,10)?
88
- d.IgnoreMixedCaseWords.setValue("checked",!1):d.IgnoreMixedCaseWords.setValue("",!1);parseInt(e.IgnoreDomainNames,10)?d.IgnoreDomainNames.setValue("checked",!1):d.IgnoreDomainNames.setValue("",!1);e.IgnoreAllCapsWords=d.IgnoreAllCapsWords.getValue()?1:0;e.IgnoreWordsNumbers=d.IgnoreWordsNumbers.getValue()?1:0;e.IgnoreMixedCaseWords=d.IgnoreMixedCaseWords.getValue()?1:0;e.IgnoreDomainNames=d.IgnoreDomainNames.getValue()?1:0;d.IgnoreAllCapsWords.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreAllCapsWords;
89
- d.IgnoreWordsNumbers.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreWordsWithNumbers;d.IgnoreMixedCaseWords.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreMixedCaseWords;d.IgnoreDomainNames.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreDomainNames},onHide:function(){g.postMessage.unbindHandler(k);if(y)try{y.focus()}catch(a){}}}});CKEDITOR.dialog.on("resize",function(b){b=b.data;var c=b.dialog,d=CKEDITOR.document.getById(a.iframeNumber+"_"+c._.currentTabId);
90
- "checkspell"==c._.name&&(a.bnr?d&&d.setSize("height",b.height-310):d&&d.setSize("height",b.height-220),c._.fromResizeEvent&&!c._.resized&&(c._.resized=!0),c._.fromResizeEvent=!0)});CKEDITOR.on("dialogDefinition",function(b){if("checkspell"===b.data.name){var c=b.data.definition;a.onLoadOverlay=new B({opacity:"1",background:"#fff",target:c.dialog.parts.tabs.getParent().$});a.onLoadOverlay.setEnable();c.dialog.on("cancel",function(b){c.dialog.getParentEditor().config.wsc_onClose.call(this.document.getWindow().getFrame());
91
- a.div_overlay.setDisable();a.onLoadOverlay.setDisable();return!1},this,null,-1)}})})();
48
+ this;y();u();q();b.plugins.scayt&&c()},onShow:function(){a.dialog=this;b.lockSelection(b.getSelection());a.TextAreaNumber="cke_textarea_"+b.name;g.postMessage.init(H);a.dataTemp=b.getData();a.OverlayPlace=a.dialog.parts.tabs.getParent().$;if(CKEDITOR&&CKEDITOR.config){a.wsc_customerId=b.config.wsc_customerId;a.cust_dic_ids=b.config.wsc_customDictionaryIds;a.userDictionaryName=b.config.wsc_userDictionaryName;a.defaultLanguage=CKEDITOR.config.defaultLanguage;var c="file:"==document.location.protocol?
49
+ "http:":document.location.protocol,c=b.config.wsc_customLoaderScript||c+"//www.webspellchecker.net/spellcheck31/lf/22/js/wsc_fck2plugin.js";d(this);CKEDITOR.scriptLoader.load(c,function(c){CKEDITOR.config&&CKEDITOR.config.wsc&&CKEDITOR.config.wsc.DefaultParams?(a.serverLocationHash=CKEDITOR.config.wsc.DefaultParams.serviceHost,a.logotype=CKEDITOR.config.wsc.DefaultParams.logoPath,a.loadIcon=CKEDITOR.config.wsc.DefaultParams.iconPath,a.loadIconEmptyEditor=CKEDITOR.config.wsc.DefaultParams.iconPathEmptyEditor,
50
+ a.LangComparer=new CKEDITOR.config.wsc.DefaultParams._SP_FCK_LangCompare):(a.serverLocationHash=DefaultParams.serviceHost,a.logotype=DefaultParams.logoPath,a.loadIcon=DefaultParams.iconPath,a.loadIconEmptyEditor=DefaultParams.iconPathEmptyEditor,a.LangComparer=new _SP_FCK_LangCompare);a.pluginPath=CKEDITOR.getUrl(b.plugins.wsc.path);a.iframeNumber=a.TextAreaNumber;a.templatePath=a.pluginPath+"dialogs/tmp.html";a.LangComparer.setDefaulLangCode(a.defaultLanguage);a.currentLang=b.config.wsc_lang||a.LangComparer.getSPLangCode(b.langCode)||
51
+ "en_US";a.interfaceLang=b.config.wsc_interfaceLang;a.selectingLang=a.currentLang;a.div_overlay=new C({opacity:"1",background:"#fff url("+a.loadIcon+") no-repeat 50% 50%",target:a.OverlayPlace});var d=a.dialog.parts.tabs.getId(),d=CKEDITOR.document.getById(d);d.setStyle("width","97%");d.getElementsByTag("DIV").count()||d.append(a.buildSelectLang(a.dialog.getParentEditor().name));a.div_overlay_no_check=new C({opacity:"1",id:"no_check_over",background:"#fff url("+a.loadIconEmptyEditor+") no-repeat 50% 50%",
52
+ target:a.OverlayPlace});c&&(I(a.dialog),a.dialog.setupContent(a.dialog));b.plugins.scayt&&(b.wsc.isSsrvSame=function(){var a=CKEDITOR.config.wsc.DefaultParams.serviceHost.replace("lf/22/js/../../../","").split("//")[1],c=CKEDITOR.config.wsc.DefaultParams.ssrvHost,d=b.config.scayt_srcUrl,e,f,h,g,l;window.SCAYT&&window.SCAYT.CKSCAYT&&(h=SCAYT.CKSCAYT.prototype.basePath,h.split("//"),g=h.split("//")[1].split("/")[0],l=h.split(g+"/")[1].replace("/lf/scayt3/ckscayt/","")+"/script/ssrv.cgi");!d||h||b.config.scayt_servicePath||
53
+ (d.split("//"),e=d.split("//")[1].split("/")[0],f=d.split(e+"/")[1].replace("/lf/scayt3/ckscayt/ckscayt.js","")+"/script/ssrv.cgi");return"//"+a+c==="//"+(b.config.scayt_serviceHost||g||e)+"/"+(b.config.scayt_servicePath||l||f)}());if(window.SCAYT&&b.wsc){var e=b.wsc.cgiOrigin();b.wsc.syncIsDone=!1;c=function(a){a.origin===e&&(a=JSON.parse(a.data),a.ud&&"undefined"!==a.ud?b.wsc.ud=a.ud:"undefined"===a.ud&&(b.wsc.ud=void 0),a.udn&&"undefined"!==a.udn?b.wsc.udn=a.udn:"undefined"===a.udn&&(b.wsc.udn=
54
+ void 0),b.wsc.syncIsDone||(f(b.wsc.ud),b.wsc.syncIsDone=!0))};var f=function(c){c=b.wsc.getLocalStorageUD();var d;c instanceof Array&&(d=c.toString());void 0!==d&&""!==d&&setTimeout(function(){b.wsc.addWords(d,function(){I(a.dialog);a.dialog.setupContent(a.dialog)})},400)};window.addEventListener?addEventListener("message",c,!1):window.attachEvent("onmessage",c);setTimeout(function(){var a=b.wsc.getLocalStorageUDN();void 0!==a&&b.wsc.operationWithUDN("restore",a)},500)}})}else a.dialog.hide()},onHide:function(){b.unlockSelection();
55
+ a.dataTemp="";a.sessionid="";g.postMessage.unbindHandler(H)},contents:[{id:"SpellTab",label:"SpellChecker",accessKey:"S",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"\x3cdiv\x3e\x3c/div\x3e"},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(b){b=a.iframeNumber+"_"+b._.currentTabId;var c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"hbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",widths:["50%","50%"],className:"wsc-spelltab-bottom",
56
+ children:[{type:"hbox",id:"leftCol",align:"left",width:"50%",children:[{type:"vbox",id:"rightCol1",widths:["50%","50%"],children:[{type:"text",id:"ChangeTo_label",label:a.LocalizationLabel.ChangeTo_label.text+":",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",width:"140px","default":"",onShow:function(){a.textNode.SpellTab=this;a.LocalizationLabel.ChangeTo_label.instance=this},onHide:function(){this.reset()}},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",
57
+ id:"rightCol_col__left",children:[{type:"text",id:"labelSuggestions",label:a.LocalizationLabel.Suggestions.text+":",onShow:function(){a.LocalizationLabel.Suggestions.instance=this;this.getInputElement().setStyles({display:"none"})}},{type:"html",id:"logo",html:"",setup:function(b){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"left"})}}]},{type:"select",id:"list_of_suggestions",labelStyle:"font: 12px/25px arial, sans-serif;",size:"6",inputStyle:"width: 140px; height: auto;",
58
+ items:[["loading..."]],onShow:function(){B=this},onChange:function(){a.textNode.SpellTab.setValue(this.getValue())}}]}]}]},{type:"hbox",id:"rightCol",align:"right",width:"50%",children:[{type:"vbox",id:"rightCol_col__left",widths:["50%","50%","50%","50%"],children:[{type:"button",id:"ChangeTo_button",label:a.LocalizationButton.ChangeTo_button.text,title:"Change to",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd","ChangeTo");a.LocalizationButton.ChangeTo_button.instance=
59
+ this},onClick:e},{type:"button",id:"ChangeAll",label:a.LocalizationButton.ChangeAll.text,title:"Change All",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.ChangeAll.instance=this},onClick:e},{type:"button",id:"AddWord",label:a.LocalizationButton.AddWord.text,title:"Add word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.AddWord.instance=this},onClick:e},{type:"button",
60
+ id:"FinishChecking_button",label:a.LocalizationButton.FinishChecking_button.text,title:"Finish Checking",style:"width: 100%;margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking");a.LocalizationButton.FinishChecking_button.instance=this},onClick:e}]},{type:"vbox",id:"rightCol_col__right",widths:["50%","50%","50%"],children:[{type:"button",id:"IgnoreWord",label:a.LocalizationButton.IgnoreWord.text,title:"Ignore word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
61
+ this.id);a.LocalizationButton.IgnoreWord.instance=this},onClick:e},{type:"button",id:"IgnoreAllWords",label:a.LocalizationButton.IgnoreAllWords.text,title:"Ignore all words",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.IgnoreAllWords.instance=this},onClick:e},{type:"button",id:"Options",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){a.LocalizationButton.Options.instance=this;"file:"==
62
+ document.location.protocol&&this.disable()},onClick:function(){this.getElement().focus();"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):(z=document.activeElement,b.openDialog("options"))}}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().setStyles({display:"block",position:"absolute",left:"-9999px"})},onHide:p,children:[{type:"hbox",id:"leftCol",
63
+ align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",setup:function(){this.getChild()[0].getElement().$.src=a.logotype;this.getChild()[0].getElement().getParent().setStyles({"text-align":"center"})},children:[{type:"html",id:"logo",html:""}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"Option_button",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
64
+ this.id);"file:"==document.location.protocol&&this.disable()},onClick:function(){this.getElement().focus();"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):(z=document.activeElement,b.openDialog("options"))}},{type:"button",id:"FinishChecking_button_block",label:a.LocalizationButton.FinishChecking_button_block.text,title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking")},
65
+ onClick:e}]}]}]}]},{id:"GrammTab",label:"Grammar",accessKey:"G",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"\x3cdiv\x3e\x3c/div\x3e"},{type:"html",id:"Content",label:"GrammarContent",html:"",setup:function(){var b=a.iframeNumber+"_"+a.dialog._.currentTabId,c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"vbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",children:[{type:"hbox",id:"leftCol",widths:["66%","34%"],children:[{type:"vbox",children:[{type:"text",
66
+ id:"text",label:"Change to:",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",inputStyle:"float: right; width: 200px;","default":"",onShow:function(){a.textNode.GrammTab=this},onHide:function(){this.reset()}},{type:"html",id:"html_text",html:"\x3cdiv style\x3d'min-height: 17px; line-height: 17px; padding: 5px; text-align: left;background: #F1F1F1;color: #595959; white-space: normal!important;'\x3e\x3c/div\x3e",onShow:function(b){a.textNodeInfo.GrammTab=this}},{type:"html",
67
+ id:"radio",html:"",onShow:function(){a.grammerSuggest=this}}]},{type:"vbox",children:[{type:"button",id:"ChangeTo_button",label:"Change to",title:"Change to",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd","ChangeTo")},onClick:e},{type:"button",id:"IgnoreWord",label:"Ignore word",title:"Ignore word",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:e},{type:"button",id:"IgnoreAllWords",
68
+ label:"Ignore Problem",title:"Ignore Problem",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:e},{type:"button",id:"FinishChecking_button",label:a.LocalizationButton.FinishChecking_button.text,title:"Finish Checking",style:"width: 133px; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking")},onClick:e}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",
69
+ widths:["70%","30%"],onShow:function(){this.getElement().setStyles({display:"block",position:"absolute",left:"-9999px"})},onHide:p,children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",children:[{type:"html",id:"logo",html:"",setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",
70
+ id:"FinishChecking_button_block",label:a.LocalizationButton.FinishChecking_button_block.text,title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking")},onClick:e}]}]}]}]},{id:"Thesaurus",label:"Thesaurus",accessKey:"T",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"\x3cdiv\x3e\x3c/div\x3e"},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(){var b=a.iframeNumber+"_"+a.dialog._.currentTabId,c=document.getElementById(b);
71
+ a.targetFromFrame[b]=c.contentWindow}},{type:"vbox",id:"bottomGroup",style:"width:560px; margin: -10px auto; overflow: hidden;",children:[{type:"hbox",widths:["75%","25%"],children:[{type:"vbox",children:[{type:"hbox",widths:["65%","35%"],children:[{type:"text",id:"ChangeTo_label",label:a.LocalizationLabel.ChangeTo_label.text+":",labelLayout:"horizontal",inputStyle:"width: 160px;",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onShow:function(b){a.textNode.Thesaurus=this;a.LocalizationLabel.ChangeTo_label.instance=
72
+ this},onHide:function(){this.reset()}},{type:"button",id:"ChangeTo_button",label:a.LocalizationButton.ChangeTo_button.text,title:"Change to",style:"width: 121px; margin-top: 1px;",onLoad:function(){this.getElement().setAttribute("title-cmd","ChangeTo");a.LocalizationButton.ChangeTo_button.instance=this},onClick:e}]},{type:"hbox",children:[{type:"select",id:"Categories",label:a.LocalizationLabel.Categories.text+":",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",
73
+ items:[],onShow:function(){a.selectNode.Categories=this;a.LocalizationLabel.Categories.instance=this},onChange:function(){a.buildOptionSynonyms(this.getValue())}},{type:"select",id:"Synonyms",label:a.LocalizationLabel.Synonyms.text+":",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",items:[],onShow:function(){a.selectNode.Synonyms=this;a.textNode.Thesaurus.setValue(this.getValue());a.LocalizationLabel.Synonyms.instance=this},onChange:function(b){a.textNode.Thesaurus.setValue(this.getValue())}}]}]},
74
+ {type:"vbox",width:"120px",style:"margin-top:46px;",children:[{type:"html",id:"logotype",label:"WebSpellChecker.net",html:"",setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}},{type:"button",id:"FinishChecking_button",label:a.LocalizationButton.FinishChecking_button.text,title:"Finish Checking",style:"width: 100%; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking")},onClick:e}]}]}]},
75
+ {type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().setStyles({display:"block",position:"absolute",left:"-9999px"})},children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",children:[{type:"html",id:"logo",html:"",setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right",
76
+ width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"FinishChecking_button_block",label:a.LocalizationButton.FinishChecking_button_block.text,title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking")},onClick:e}]}]}]}]}]}});var z=null;CKEDITOR.dialog.add("options",function(b){var d=null,c={},e={},f=null,h=null;g.cookie.get("udn");g.cookie.get("osp");b=function(a){h=this.getElement().getAttribute("title-cmd");
77
+ a=[];a[0]=e.IgnoreAllCapsWords;a[1]=e.IgnoreWordsNumbers;a[2]=e.IgnoreMixedCaseWords;a[3]=e.IgnoreDomainNames;a=a.toString().replace(/,/g,"");g.cookie.set("osp",a);g.cookie.set("udnCmd",h?h:"ignore");"delete"!=h&&(a="",""!==t.getValue()&&(a=t.getValue()),g.cookie.set("udn",a));g.postMessage.send({id:"options_dic_send"})};var k=function(){f.getElement().setHtml(a.LocalizationComing.error);f.getElement().show()};return{title:a.LocalizationComing.Options,minWidth:430,minHeight:130,resizable:CKEDITOR.DIALOG_RESIZE_NONE,
78
+ contents:[{id:"OptionsTab",label:"Options",accessKey:"O",elements:[{type:"hbox",id:"options_error",children:[{type:"html",style:"display: block;text-align: center;white-space: normal!important; font-size: 12px;color:red",html:"\x3cdiv\x3e\x3c/div\x3e",onShow:function(){f=this}}]},{type:"vbox",id:"Options_content",children:[{type:"hbox",id:"Options_manager",widths:["52%","48%"],children:[{type:"fieldset",label:"Spell Checking Options",style:"border: none;margin-top: 13px;padding: 10px 0 10px 10px",
79
+ onShow:function(){this.getInputElement().$.children[0].innerHTML=a.LocalizationComing.SpellCheckingOptions},children:[{type:"vbox",id:"Options_checkbox",children:[{type:"checkbox",id:"IgnoreAllCapsWords",label:"Ignore All-Caps Words",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){e[this.id]=this.getValue()?1:0}},{type:"checkbox",id:"IgnoreWordsNumbers",label:"Ignore Words with Numbers",
80
+ labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){e[this.id]=this.getValue()?1:0}},{type:"checkbox",id:"IgnoreMixedCaseWords",label:"Ignore Mixed-Case Words",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){e[this.id]=this.getValue()?1:0}},{type:"checkbox",
81
+ id:"IgnoreDomainNames",label:"Ignore Domain Names",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){e[this.id]=this.getValue()?1:0}}]}]},{type:"vbox",id:"Options_DictionaryName",children:[{type:"text",id:"DictionaryName",style:"margin-bottom: 10px",label:"Dictionary Name:",labelLayout:"vertical",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onLoad:function(){t=
82
+ this;var b=a.userDictionaryName?a.userDictionaryName:(g.cookie.get("udn"),this.getValue());this.setValue(b)},onShow:function(){t=this;var b=g.cookie.get("udn")?g.cookie.get("udn"):this.getValue();this.setValue(b);this.setLabel(a.LocalizationComing.DictionaryName)},onHide:function(){this.reset()}},{type:"hbox",id:"Options_buttons",children:[{type:"vbox",id:"Options_leftCol_col",widths:["50%","50%"],children:[{type:"button",id:"create",label:"Create",title:"Create",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
83
+ this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Create)},onClick:b},{type:"button",id:"restore",label:"Restore",title:"Restore",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Restore)},onClick:b}]},{type:"vbox",id:"Options_rightCol_col",widths:["50%","50%"],children:[{type:"button",id:"rename",label:"Rename",
84
+ title:"Rename",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Rename)},onClick:b},{type:"button",id:"delete",label:"Remove",title:"Remove",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Remove)},onClick:b}]}]}]}]},{type:"hbox",
85
+ id:"Options_text",children:[{type:"html",style:"text-align: justify;margin-top: 15px;white-space: normal!important; font-size: 12px;color:#777;",html:"\x3cdiv\x3e"+a.LocalizationComing.OptionsTextIntro+"\x3c/div\x3e",onShow:function(){this.getElement().setText(a.LocalizationComing.OptionsTextIntro)}}]}]}]}],buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton],onOk:function(){var a=[];a[0]=e.IgnoreAllCapsWords;a[1]=e.IgnoreWordsNumbers;a[2]=e.IgnoreMixedCaseWords;a[3]=e.IgnoreDomainNames;
86
+ a=a.toString().replace(/,/g,"");g.cookie.set("osp",a);g.postMessage.send({id:"options_checkbox_send"});f.getElement().hide();f.getElement().setHtml(" ")},onLoad:function(){d=this;c.IgnoreAllCapsWords=d.getContentElement("OptionsTab","IgnoreAllCapsWords");c.IgnoreWordsNumbers=d.getContentElement("OptionsTab","IgnoreWordsNumbers");c.IgnoreMixedCaseWords=d.getContentElement("OptionsTab","IgnoreMixedCaseWords");c.IgnoreDomainNames=d.getContentElement("OptionsTab","IgnoreDomainNames")},onShow:function(){g.postMessage.init(k);
87
+ var b=g.cookie.get("osp").split("");e.IgnoreAllCapsWords=b[0];e.IgnoreWordsNumbers=b[1];e.IgnoreMixedCaseWords=b[2];e.IgnoreDomainNames=b[3];parseInt(e.IgnoreAllCapsWords,10)?c.IgnoreAllCapsWords.setValue("checked",!1):c.IgnoreAllCapsWords.setValue("",!1);parseInt(e.IgnoreWordsNumbers,10)?c.IgnoreWordsNumbers.setValue("checked",!1):c.IgnoreWordsNumbers.setValue("",!1);parseInt(e.IgnoreMixedCaseWords,10)?c.IgnoreMixedCaseWords.setValue("checked",!1):c.IgnoreMixedCaseWords.setValue("",!1);parseInt(e.IgnoreDomainNames,
88
+ 10)?c.IgnoreDomainNames.setValue("checked",!1):c.IgnoreDomainNames.setValue("",!1);e.IgnoreAllCapsWords=c.IgnoreAllCapsWords.getValue()?1:0;e.IgnoreWordsNumbers=c.IgnoreWordsNumbers.getValue()?1:0;e.IgnoreMixedCaseWords=c.IgnoreMixedCaseWords.getValue()?1:0;e.IgnoreDomainNames=c.IgnoreDomainNames.getValue()?1:0;c.IgnoreAllCapsWords.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreAllCapsWords;c.IgnoreWordsNumbers.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreWordsWithNumbers;
89
+ c.IgnoreMixedCaseWords.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreMixedCaseWords;c.IgnoreDomainNames.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreDomainNames},onHide:function(){g.postMessage.unbindHandler(k);if(z)try{z.focus()}catch(a){}}}});CKEDITOR.dialog.on("resize",function(b){b=b.data;var d=b.dialog,c=CKEDITOR.document.getById(a.iframeNumber+"_"+d._.currentTabId);"checkspell"==d._.name&&(a.bnr?c&&c.setSize("height",b.height-310):c&&c.setSize("height",b.height-
90
+ 220),d._.fromResizeEvent&&!d._.resized&&(d._.resized=!0),d._.fromResizeEvent=!0)});CKEDITOR.on("dialogDefinition",function(b){if("checkspell"===b.data.name){var d=b.data.definition;a.onLoadOverlay=new C({opacity:"1",background:"#fff",target:d.dialog.parts.tabs.getParent().$});a.onLoadOverlay.setEnable();d.dialog.on("cancel",function(b){d.dialog.getParentEditor().config.wsc_onClose.call(this.document.getWindow().getFrame());a.div_overlay.setDisable();a.onLoadOverlay.setDisable();return!1},this,null,
91
+ -1)}})})();
@@ -1,448 +1,449 @@
1
- /*
2
- * Youtube Embed Plugin
3
- *
4
- * @author Jonnas Fonini <jonnasfonini@gmail.com>
5
- * @version 2.1.8
6
- */
7
- (function () {
8
- CKEDITOR.plugins.add('youtube', {
9
- lang: [ 'en', 'ru' ],
10
- init: function (editor) {
11
- editor.addCommand('youtube', new CKEDITOR.dialogCommand('youtube', {
12
- allowedContent: 'div{*}(*); iframe{*}[!width,!height,!src,!frameborder,!allowfullscreen]; object param[*]; a[*]; img[*]'
13
- }));
14
-
15
- editor.ui.addButton('Youtube', {
16
- label : editor.lang.youtube.button,
17
- toolbar : 'insert',
18
- command : 'youtube',
19
- icon : this.path + 'images/icon.png'
20
- });
21
-
22
- CKEDITOR.dialog.add('youtube', function (instance) {
23
- var video,
24
- disabled = editor.config.youtube_disabled_fields || [];
25
-
26
- return {
27
- title : editor.lang.youtube.title,
28
- minWidth : 510,
29
- minHeight : 200,
30
- onShow: function () {
31
- for (var i = 0; i < disabled.length; i++) {
32
- this.getContentElement('youtubePlugin', disabled[i]).disable();
33
- }
34
- },
35
- contents :
36
- [{
37
- id : 'youtubePlugin',
38
- expand : true,
39
- elements :
40
- [{
41
- id : 'txtEmbed',
42
- type : 'textarea',
43
- label : editor.lang.youtube.txtEmbed,
44
- onChange : function (api) {
45
- handleEmbedChange(this, api);
46
- },
47
- onKeyUp : function (api) {
48
- handleEmbedChange(this, api);
49
- },
50
- validate : function () {
51
- if (this.isEnabled()) {
52
- if (!this.getValue()) {
53
- alert(editor.lang.youtube.noCode);
54
- return false;
55
- }
56
- else
57
- if (this.getValue().length === 0 || this.getValue().indexOf('//') === -1) {
58
- alert(editor.lang.youtube.invalidEmbed);
59
- return false;
60
- }
61
- }
62
- }
63
- },
64
- {
65
- type : 'html',
66
- html : editor.lang.youtube.or + '<hr>'
67
- },
68
- {
69
- type : 'hbox',
70
- widths : [ '70%', '15%', '15%' ],
71
- children :
72
- [
73
- {
74
- id : 'txtUrl',
75
- type : 'text',
76
- label : editor.lang.youtube.txtUrl,
77
- onChange : function (api) {
78
- handleLinkChange(this, api);
79
- },
80
- onKeyUp : function (api) {
81
- handleLinkChange(this, api);
82
- },
83
- validate : function () {
84
- if (this.isEnabled()) {
85
- if (!this.getValue()) {
86
- alert(editor.lang.youtube.noCode);
87
- return false;
88
- }
89
- else{
90
- video = ytVidId(this.getValue());
91
-
92
- if (this.getValue().length === 0 || video === false)
93
- {
94
- alert(editor.lang.youtube.invalidUrl);
95
- return false;
96
- }
97
- }
98
- }
99
- }
100
- },
101
- {
102
- type : 'text',
103
- id : 'txtWidth',
104
- width : '60px',
105
- label : editor.lang.youtube.txtWidth,
106
- 'default' : editor.config.youtube_width != null ? editor.config.youtube_width : '640',
107
- validate : function () {
108
- if (this.getValue()) {
109
- var width = parseInt (this.getValue()) || 0;
110
-
111
- if (width === 0) {
112
- alert(editor.lang.youtube.invalidWidth);
113
- return false;
114
- }
115
- }
116
- else {
117
- alert(editor.lang.youtube.noWidth);
118
- return false;
119
- }
120
- }
121
- },
122
- {
123
- type : 'text',
124
- id : 'txtHeight',
125
- width : '60px',
126
- label : editor.lang.youtube.txtHeight,
127
- 'default' : editor.config.youtube_height != null ? editor.config.youtube_height : '360',
128
- validate : function () {
129
- if (this.getValue()) {
130
- var height = parseInt(this.getValue()) || 0;
131
-
132
- if (height === 0) {
133
- alert(editor.lang.youtube.invalidHeight);
134
- return false;
135
- }
136
- }
137
- else {
138
- alert(editor.lang.youtube.noHeight);
139
- return false;
140
- }
141
- }
142
- }
143
- ]
144
- },
145
- {
146
- type : 'hbox',
147
- widths : [ '55%', '45%' ],
148
- children :
149
- [
150
- {
151
- id : 'chkResponsive',
152
- type : 'checkbox',
153
- label : editor.lang.youtube.txtResponsive,
154
- 'default' : editor.config.youtube_responsive != null ? editor.config.youtube_responsive : false
155
- },
156
- {
157
- id : 'chkNoEmbed',
158
- type : 'checkbox',
159
- label : editor.lang.youtube.txtNoEmbed,
160
- 'default' : editor.config.youtube_noembed != null ? editor.config.youtube_noembed : false
161
- }
162
- ]
163
- },
164
- {
165
- type : 'hbox',
166
- widths : [ '55%', '45%' ],
167
- children :
168
- [
169
- {
170
- id : 'chkRelated',
171
- type : 'checkbox',
172
- 'default' : editor.config.youtube_related != null ? editor.config.youtube_related : true,
173
- label : editor.lang.youtube.chkRelated
174
- },
175
- {
176
- id : 'chkOlderCode',
177
- type : 'checkbox',
178
- 'default' : editor.config.youtube_older != null ? editor.config.youtube_older : false,
179
- label : editor.lang.youtube.chkOlderCode
180
- }
181
- ]
182
- },
183
- {
184
- type : 'hbox',
185
- widths : [ '55%', '45%' ],
186
- children :
187
- [
188
- {
189
- id : 'chkPrivacy',
190
- type : 'checkbox',
191
- label : editor.lang.youtube.chkPrivacy,
192
- 'default' : editor.config.youtube_privacy != null ? editor.config.youtube_privacy : false
193
- },
194
- {
195
- id : 'chkAutoplay',
196
- type : 'checkbox',
197
- 'default' : editor.config.youtube_autoplay != null ? editor.config.youtube_autoplay : false,
198
- label : editor.lang.youtube.chkAutoplay
199
- }
200
- ]
201
- },
202
- {
203
- type : 'hbox',
204
- widths : [ '55%', '45%'],
205
- children :
206
- [
207
- {
208
- id : 'txtStartAt',
209
- type : 'text',
210
- label : editor.lang.youtube.txtStartAt,
211
- validate : function () {
212
- if (this.getValue()) {
213
- var str = this.getValue();
214
-
215
- if (!/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/i.test(str)) {
216
- alert(editor.lang.youtube.invalidTime);
217
- return false;
218
- }
219
- }
220
- }
221
- },
222
- {
223
- id : 'chkControls',
224
- type : 'checkbox',
225
- 'default' : editor.config.youtube_controls != null ? editor.config.youtube_controls : true,
226
- label : editor.lang.youtube.chkControls
227
- }
228
- ]
229
- }
230
- ]
231
- }
232
- ],
233
- onOk: function()
234
- {
235
- var content = '';
236
- var responsiveStyle = '';
237
-
238
- if (this.getContentElement('youtubePlugin', 'txtEmbed').isEnabled()) {
239
- content = this.getValueOf('youtubePlugin', 'txtEmbed');
240
- }
241
- else {
242
- var url = 'https://', params = [], startSecs;
243
- var width = this.getValueOf('youtubePlugin', 'txtWidth');
244
- var height = this.getValueOf('youtubePlugin', 'txtHeight');
245
-
246
- if (this.getContentElement('youtubePlugin', 'chkPrivacy').getValue() === true) {
247
- url += 'www.youtube-nocookie.com/';
248
- }
249
- else {
250
- url += 'www.youtube.com/';
251
- }
252
-
253
- url += 'embed/' + video;
254
-
255
- if (this.getContentElement('youtubePlugin', 'chkRelated').getValue() === false) {
256
- params.push('rel=0');
257
- }
258
-
259
- if (this.getContentElement('youtubePlugin', 'chkAutoplay').getValue() === true) {
260
- params.push('autoplay=1');
261
- }
262
-
263
- if (this.getContentElement('youtubePlugin', 'chkControls').getValue() === false) {
264
- params.push('controls=0');
265
- }
266
-
267
- startSecs = this.getValueOf('youtubePlugin', 'txtStartAt');
268
-
269
- if (startSecs) {
270
- var seconds = hmsToSeconds(startSecs);
271
-
272
- params.push('start=' + seconds);
273
- }
274
-
275
- if (params.length > 0) {
276
- url = url + '?' + params.join('&');
277
- }
278
-
279
- if (this.getContentElement('youtubePlugin', 'chkResponsive').getValue() === true) {
280
- content += '<div class="youtube-embed-wrapper" style="position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden">';
281
- responsiveStyle = 'style="position:absolute;top:0;left:0;width:100%;height:100%"';
282
- }
283
-
284
- if (this.getContentElement('youtubePlugin', 'chkOlderCode').getValue() === true) {
285
- url = url.replace('embed/', 'v/');
286
- url = url.replace(/&/g, '&amp;');
287
-
288
- if (url.indexOf('?') === -1) {
289
- url += '?';
290
- }
291
- else {
292
- url += '&amp;';
293
- }
294
- url += 'hl=' + (this.getParentEditor().config.language ? this.getParentEditor().config.language : 'en') + '&amp;version=3';
295
-
296
- content += '<object width="' + width + '" height="' + height + '" ' + responsiveStyle + '>';
297
- content += '<param name="movie" value="' + url + '"></param>';
298
- content += '<param name="allowFullScreen" value="true"></param>';
299
- content += '<param name="allowscriptaccess" value="always"></param>';
300
- content += '<embed src="' + url + '" type="application/x-shockwave-flash" ';
301
- content += 'width="' + width + '" height="' + height + '" '+ responsiveStyle + ' allowscriptaccess="always" ';
302
- content += 'allowfullscreen="true"></embed>';
303
- content += '</object>';
304
- }
305
- else
306
- if (this.getContentElement('youtubePlugin', 'chkNoEmbed').getValue() === true) {
307
- var imgSrc = '//img.youtube.com/vi/' + video + '/sddefault.jpg';
308
- content += '<a href="' + url + '" ><img width="' + width + '" height="' + height + '" src="' + imgSrc + '" ' + responsiveStyle + '/></a>';
309
- }
310
- else {
311
- content += '<iframe width="' + width + '" height="' + height + '" src="' + url + '" ' + responsiveStyle;
312
- content += 'frameborder="0" allowfullscreen></iframe>';
313
- }
314
-
315
- if (this.getContentElement('youtubePlugin', 'chkResponsive').getValue() === true) {
316
- content += '</div>';
317
- }
318
- }
319
-
320
- var element = CKEDITOR.dom.element.createFromHtml(content);
321
- var instance = this.getParentEditor();
322
- instance.insertElement(element);
323
- }
324
- };
325
- });
326
- }
327
- });
328
- })();
329
-
330
- function handleLinkChange(el, api) {
331
- var video = ytVidId(el.getValue());
332
- var time = ytVidTime(el.getValue());
333
-
334
- if (el.getValue().length > 0) {
335
- el.getDialog().getContentElement('youtubePlugin', 'txtEmbed').disable();
336
- }
337
- else {
338
- el.getDialog().getContentElement('youtubePlugin', 'txtEmbed').enable();
339
- }
340
-
341
- if (video && time) {
342
- var seconds = timeParamToSeconds(time);
343
- var hms = secondsToHms(seconds);
344
- el.getDialog().getContentElement('youtubePlugin', 'txtStartAt').setValue(hms);
345
- }
346
- }
347
-
348
- function handleEmbedChange(el, api) {
349
- if (el.getValue().length > 0) {
350
- el.getDialog().getContentElement('youtubePlugin', 'txtUrl').disable();
351
- }
352
- else {
353
- el.getDialog().getContentElement('youtubePlugin', 'txtUrl').enable();
354
- }
355
- }
356
-
357
-
358
- /**
359
- * JavaScript function to match (and return) the video Id
360
- * of any valid Youtube Url, given as input string.
361
- * @author: Stephan Schmitz <eyecatchup@gmail.com>
362
- * @url: http://stackoverflow.com/a/10315969/624466
363
- */
364
- function ytVidId(url) {
365
- var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
366
- return (url.match(p)) ? RegExp.$1 : false;
367
- }
368
-
369
- /**
370
- * Matches and returns time param in YouTube Urls.
371
- */
372
- function ytVidTime(url) {
373
- var p = /t=([0-9hms]+)/;
374
- return (url.match(p)) ? RegExp.$1 : false;
375
- }
376
-
377
- /**
378
- * Converts time in hms format to seconds only
379
- */
380
- function hmsToSeconds(time) {
381
- var arr = time.split(':'), s = 0, m = 1;
382
-
383
- while (arr.length > 0) {
384
- s += m * parseInt(arr.pop(), 10);
385
- m *= 60;
386
- }
387
-
388
- return s;
389
- }
390
-
391
- /**
392
- * Converts seconds to hms format
393
- */
394
- function secondsToHms(seconds) {
395
- var h = Math.floor(seconds / 3600);
396
- var m = Math.floor((seconds / 60) % 60);
397
- var s = seconds % 60;
398
-
399
- var pad = function (n) {
400
- n = String(n);
401
- return n.length >= 2 ? n : "0" + n;
402
- };
403
-
404
- if (h > 0) {
405
- return pad(h) + ':' + pad(m) + ':' + pad(s);
406
- }
407
- else {
408
- return pad(m) + ':' + pad(s);
409
- }
410
- }
411
-
412
- /**
413
- * Converts time in youtube t-param format to seconds
414
- */
415
- function timeParamToSeconds(param) {
416
- var componentValue = function (si) {
417
- var regex = new RegExp('(\\d+)' + si);
418
- return param.match(regex) ? parseInt(RegExp.$1, 10) : 0;
419
- };
420
-
421
- return componentValue('h') * 3600
422
- + componentValue('m') * 60
423
- + componentValue('s');
424
- }
425
-
426
- /**
427
- * Converts seconds into youtube t-param value, e.g. 1h4m30s
428
- */
429
- function secondsToTimeParam(seconds) {
430
- var h = Math.floor(seconds / 3600);
431
- var m = Math.floor((seconds / 60) % 60);
432
- var s = seconds % 60;
433
- var param = '';
434
-
435
- if (h > 0) {
436
- param += h + 'h';
437
- }
438
-
439
- if (m > 0) {
440
- param += m + 'm';
441
- }
442
-
443
- if (s > 0) {
444
- param += s + 's';
445
- }
446
-
447
- return param;
448
- }
1
+ /*
2
+ * Youtube Embed Plugin
3
+ *
4
+ * @author Jonnas Fonini <jonnasfonini@gmail.com>
5
+ * @version 2.1.13
6
+ */
7
+ (function () {
8
+ CKEDITOR.plugins.add('youtube', {
9
+ lang: [ 'en', 'bg', 'pt', 'pt-br', 'ja', 'hu', 'it', 'fr', 'tr', 'ru', 'de', 'ar', 'nl', 'pl', 'vi', 'zh', 'el', 'he', 'es', 'nb', 'nn', 'fi', 'et', 'sk', 'cs', 'ko', 'eu', 'uk'],
10
+ init: function (editor) {
11
+ editor.addCommand('youtube', new CKEDITOR.dialogCommand('youtube', {
12
+ allowedContent: 'div{*}(*); iframe{*}[!width,!height,!src,!frameborder,!allowfullscreen,!allow]; object param[*]; a[*]; img[*]'
13
+ }));
14
+
15
+ editor.ui.addButton('Youtube', {
16
+ label : editor.lang.youtube.button,
17
+ toolbar : 'insert',
18
+ command : 'youtube',
19
+ icon : this.path + 'images/icon.png'
20
+ });
21
+
22
+ CKEDITOR.dialog.add('youtube', function (instance) {
23
+ var video,
24
+ disabled = editor.config.youtube_disabled_fields || [];
25
+
26
+ return {
27
+ title : editor.lang.youtube.title,
28
+ minWidth : 510,
29
+ minHeight : 200,
30
+ onShow: function () {
31
+ for (var i = 0; i < disabled.length; i++) {
32
+ this.getContentElement('youtubePlugin', disabled[i]).disable();
33
+ }
34
+ },
35
+ contents :
36
+ [{
37
+ id : 'youtubePlugin',
38
+ expand : true,
39
+ elements :
40
+ [{
41
+ id : 'txtEmbed',
42
+ type : 'textarea',
43
+ label : editor.lang.youtube.txtEmbed,
44
+ onChange : function (api) {
45
+ handleEmbedChange(this, api);
46
+ },
47
+ onKeyUp : function (api) {
48
+ handleEmbedChange(this, api);
49
+ },
50
+ validate : function () {
51
+ if (this.isEnabled()) {
52
+ if (!this.getValue()) {
53
+ alert(editor.lang.youtube.noCode);
54
+ return false;
55
+ }
56
+ else
57
+ if (this.getValue().length === 0 || this.getValue().indexOf('//') === -1) {
58
+ alert(editor.lang.youtube.invalidEmbed);
59
+ return false;
60
+ }
61
+ }
62
+ }
63
+ },
64
+ {
65
+ type : 'html',
66
+ html : editor.lang.youtube.or + '<hr>'
67
+ },
68
+ {
69
+ type : 'hbox',
70
+ widths : [ '70%', '15%', '15%' ],
71
+ children :
72
+ [
73
+ {
74
+ id : 'txtUrl',
75
+ type : 'text',
76
+ label : editor.lang.youtube.txtUrl,
77
+ onChange : function (api) {
78
+ handleLinkChange(this, api);
79
+ },
80
+ onKeyUp : function (api) {
81
+ handleLinkChange(this, api);
82
+ },
83
+ validate : function () {
84
+ if (this.isEnabled()) {
85
+ if (!this.getValue()) {
86
+ alert(editor.lang.youtube.noCode);
87
+ return false;
88
+ }
89
+ else{
90
+ video = ytVidId(this.getValue());
91
+
92
+ if (this.getValue().length === 0 || video === false)
93
+ {
94
+ alert(editor.lang.youtube.invalidUrl);
95
+ return false;
96
+ }
97
+ }
98
+ }
99
+ }
100
+ },
101
+ {
102
+ type : 'text',
103
+ id : 'txtWidth',
104
+ width : '60px',
105
+ label : editor.lang.youtube.txtWidth,
106
+ 'default' : editor.config.youtube_width != null ? editor.config.youtube_width : '640',
107
+ validate : function () {
108
+ if (this.getValue()) {
109
+ var width = parseInt (this.getValue()) || 0;
110
+
111
+ if (width === 0) {
112
+ alert(editor.lang.youtube.invalidWidth);
113
+ return false;
114
+ }
115
+ }
116
+ else {
117
+ alert(editor.lang.youtube.noWidth);
118
+ return false;
119
+ }
120
+ }
121
+ },
122
+ {
123
+ type : 'text',
124
+ id : 'txtHeight',
125
+ width : '60px',
126
+ label : editor.lang.youtube.txtHeight,
127
+ 'default' : editor.config.youtube_height != null ? editor.config.youtube_height : '360',
128
+ validate : function () {
129
+ if (this.getValue()) {
130
+ var height = parseInt(this.getValue()) || 0;
131
+
132
+ if (height === 0) {
133
+ alert(editor.lang.youtube.invalidHeight);
134
+ return false;
135
+ }
136
+ }
137
+ else {
138
+ alert(editor.lang.youtube.noHeight);
139
+ return false;
140
+ }
141
+ }
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ type : 'hbox',
147
+ widths : [ '55%', '45%' ],
148
+ children :
149
+ [
150
+ {
151
+ id : 'chkResponsive',
152
+ type : 'checkbox',
153
+ label : editor.lang.youtube.txtResponsive,
154
+ 'default' : editor.config.youtube_responsive != null ? editor.config.youtube_responsive : false
155
+ },
156
+ {
157
+ id : 'chkNoEmbed',
158
+ type : 'checkbox',
159
+ label : editor.lang.youtube.txtNoEmbed,
160
+ 'default' : editor.config.youtube_noembed != null ? editor.config.youtube_noembed : false
161
+ }
162
+ ]
163
+ },
164
+ {
165
+ type : 'hbox',
166
+ widths : [ '55%', '45%' ],
167
+ children :
168
+ [
169
+ {
170
+ id : 'chkRelated',
171
+ type : 'checkbox',
172
+ 'default' : editor.config.youtube_related != null ? editor.config.youtube_related : true,
173
+ label : editor.lang.youtube.chkRelated
174
+ },
175
+ {
176
+ id : 'chkOlderCode',
177
+ type : 'checkbox',
178
+ 'default' : editor.config.youtube_older != null ? editor.config.youtube_older : false,
179
+ label : editor.lang.youtube.chkOlderCode
180
+ }
181
+ ]
182
+ },
183
+ {
184
+ type : 'hbox',
185
+ widths : [ '55%', '45%' ],
186
+ children :
187
+ [
188
+ {
189
+ id : 'chkPrivacy',
190
+ type : 'checkbox',
191
+ label : editor.lang.youtube.chkPrivacy,
192
+ 'default' : editor.config.youtube_privacy != null ? editor.config.youtube_privacy : false
193
+ },
194
+ {
195
+ id : 'chkAutoplay',
196
+ type : 'checkbox',
197
+ 'default' : editor.config.youtube_autoplay != null ? editor.config.youtube_autoplay : false,
198
+ label : editor.lang.youtube.chkAutoplay
199
+ }
200
+ ]
201
+ },
202
+ {
203
+ type : 'hbox',
204
+ widths : [ '55%', '45%'],
205
+ children :
206
+ [
207
+ {
208
+ id : 'txtStartAt',
209
+ type : 'text',
210
+ label : editor.lang.youtube.txtStartAt,
211
+ validate : function () {
212
+ if (this.getValue()) {
213
+ var str = this.getValue();
214
+
215
+ if (!/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/i.test(str)) {
216
+ alert(editor.lang.youtube.invalidTime);
217
+ return false;
218
+ }
219
+ }
220
+ }
221
+ },
222
+ {
223
+ id : 'chkControls',
224
+ type : 'checkbox',
225
+ 'default' : editor.config.youtube_controls != null ? editor.config.youtube_controls : true,
226
+ label : editor.lang.youtube.chkControls
227
+ }
228
+ ]
229
+ }
230
+ ]
231
+ }
232
+ ],
233
+ onOk: function()
234
+ {
235
+ var content = '';
236
+ var responsiveStyle = '';
237
+
238
+ if (this.getContentElement('youtubePlugin', 'txtEmbed').isEnabled()) {
239
+ content = this.getValueOf('youtubePlugin', 'txtEmbed');
240
+ }
241
+ else {
242
+ var url = 'https://', params = [], startSecs, paramAutoplay='';
243
+ var width = this.getValueOf('youtubePlugin', 'txtWidth');
244
+ var height = this.getValueOf('youtubePlugin', 'txtHeight');
245
+
246
+ if (this.getContentElement('youtubePlugin', 'chkPrivacy').getValue() === true) {
247
+ url += 'www.youtube-nocookie.com/';
248
+ }
249
+ else {
250
+ url += 'www.youtube.com/';
251
+ }
252
+
253
+ url += 'embed/' + video;
254
+
255
+ if (this.getContentElement('youtubePlugin', 'chkRelated').getValue() === false) {
256
+ params.push('rel=0');
257
+ }
258
+
259
+ if (this.getContentElement('youtubePlugin', 'chkAutoplay').getValue() === true) {
260
+ params.push('autoplay=1');
261
+ paramAutoplay='autoplay';
262
+ }
263
+
264
+ if (this.getContentElement('youtubePlugin', 'chkControls').getValue() === false) {
265
+ params.push('controls=0');
266
+ }
267
+
268
+ startSecs = this.getValueOf('youtubePlugin', 'txtStartAt');
269
+
270
+ if (startSecs) {
271
+ var seconds = hmsToSeconds(startSecs);
272
+
273
+ params.push('start=' + seconds);
274
+ }
275
+
276
+ if (params.length > 0) {
277
+ url = url + '?' + params.join('&');
278
+ }
279
+
280
+ if (this.getContentElement('youtubePlugin', 'chkResponsive').getValue() === true) {
281
+ content += '<div class="youtube-embed-wrapper" style="position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden">';
282
+ responsiveStyle = 'style="position:absolute;top:0;left:0;width:100%;height:100%"';
283
+ }
284
+
285
+ if (this.getContentElement('youtubePlugin', 'chkOlderCode').getValue() === true) {
286
+ url = url.replace('embed/', 'v/');
287
+ url = url.replace(/&/g, '&amp;');
288
+
289
+ if (url.indexOf('?') === -1) {
290
+ url += '?';
291
+ }
292
+ else {
293
+ url += '&amp;';
294
+ }
295
+ url += 'hl=' + (this.getParentEditor().config.language ? this.getParentEditor().config.language : 'en') + '&amp;version=3';
296
+
297
+ content += '<object width="' + width + '" height="' + height + '" ' + responsiveStyle + '>';
298
+ content += '<param name="movie" value="' + url + '"></param>';
299
+ content += '<param name="allowFullScreen" value="true"></param>';
300
+ content += '<param name="allowscriptaccess" value="always"></param>';
301
+ content += '<embed src="' + url + '" type="application/x-shockwave-flash" ';
302
+ content += 'width="' + width + '" height="' + height + '" '+ responsiveStyle + ' allowscriptaccess="always" ';
303
+ content += 'allowfullscreen="true"></embed>';
304
+ content += '</object>';
305
+ }
306
+ else
307
+ if (this.getContentElement('youtubePlugin', 'chkNoEmbed').getValue() === true) {
308
+ var imgSrc = '//img.youtube.com/vi/' + video + '/sddefault.jpg';
309
+ content += '<a href="' + url + '" ><img width="' + width + '" height="' + height + '" src="' + imgSrc + '" ' + responsiveStyle + '/></a>';
310
+ }
311
+ else {
312
+ content += '<iframe allow="' + paramAutoplay + ';" width="' + width + '" height="' + height + '" src="' + url + '" ' + responsiveStyle;
313
+ content += 'frameborder="0" allowfullscreen></iframe>';
314
+ }
315
+
316
+ if (this.getContentElement('youtubePlugin', 'chkResponsive').getValue() === true) {
317
+ content += '</div>';
318
+ }
319
+ }
320
+
321
+ var element = CKEDITOR.dom.element.createFromHtml(content);
322
+ var instance = this.getParentEditor();
323
+ instance.insertElement(element);
324
+ }
325
+ };
326
+ });
327
+ }
328
+ });
329
+ })();
330
+
331
+ function handleLinkChange(el, api) {
332
+ var video = ytVidId(el.getValue());
333
+ var time = ytVidTime(el.getValue());
334
+
335
+ if (el.getValue().length > 0) {
336
+ el.getDialog().getContentElement('youtubePlugin', 'txtEmbed').disable();
337
+ }
338
+ else {
339
+ el.getDialog().getContentElement('youtubePlugin', 'txtEmbed').enable();
340
+ }
341
+
342
+ if (video && time) {
343
+ var seconds = timeParamToSeconds(time);
344
+ var hms = secondsToHms(seconds);
345
+ el.getDialog().getContentElement('youtubePlugin', 'txtStartAt').setValue(hms);
346
+ }
347
+ }
348
+
349
+ function handleEmbedChange(el, api) {
350
+ if (el.getValue().length > 0) {
351
+ el.getDialog().getContentElement('youtubePlugin', 'txtUrl').disable();
352
+ }
353
+ else {
354
+ el.getDialog().getContentElement('youtubePlugin', 'txtUrl').enable();
355
+ }
356
+ }
357
+
358
+
359
+ /**
360
+ * JavaScript function to match (and return) the video Id
361
+ * of any valid Youtube Url, given as input string.
362
+ * @author: Stephan Schmitz <eyecatchup@gmail.com>
363
+ * @url: http://stackoverflow.com/a/10315969/624466
364
+ */
365
+ function ytVidId(url) {
366
+ var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
367
+ return (url.match(p)) ? RegExp.$1 : false;
368
+ }
369
+
370
+ /**
371
+ * Matches and returns time param in YouTube Urls.
372
+ */
373
+ function ytVidTime(url) {
374
+ var p = /t=([0-9hms]+)/;
375
+ return (url.match(p)) ? RegExp.$1 : false;
376
+ }
377
+
378
+ /**
379
+ * Converts time in hms format to seconds only
380
+ */
381
+ function hmsToSeconds(time) {
382
+ var arr = time.split(':'), s = 0, m = 1;
383
+
384
+ while (arr.length > 0) {
385
+ s += m * parseInt(arr.pop(), 10);
386
+ m *= 60;
387
+ }
388
+
389
+ return s;
390
+ }
391
+
392
+ /**
393
+ * Converts seconds to hms format
394
+ */
395
+ function secondsToHms(seconds) {
396
+ var h = Math.floor(seconds / 3600);
397
+ var m = Math.floor((seconds / 60) % 60);
398
+ var s = seconds % 60;
399
+
400
+ var pad = function (n) {
401
+ n = String(n);
402
+ return n.length >= 2 ? n : "0" + n;
403
+ };
404
+
405
+ if (h > 0) {
406
+ return pad(h) + ':' + pad(m) + ':' + pad(s);
407
+ }
408
+ else {
409
+ return pad(m) + ':' + pad(s);
410
+ }
411
+ }
412
+
413
+ /**
414
+ * Converts time in youtube t-param format to seconds
415
+ */
416
+ function timeParamToSeconds(param) {
417
+ var componentValue = function (si) {
418
+ var regex = new RegExp('(\\d+)' + si);
419
+ return param.match(regex) ? parseInt(RegExp.$1, 10) : 0;
420
+ };
421
+
422
+ return componentValue('h') * 3600
423
+ + componentValue('m') * 60
424
+ + componentValue('s');
425
+ }
426
+
427
+ /**
428
+ * Converts seconds into youtube t-param value, e.g. 1h4m30s
429
+ */
430
+ function secondsToTimeParam(seconds) {
431
+ var h = Math.floor(seconds / 3600);
432
+ var m = Math.floor((seconds / 60) % 60);
433
+ var s = seconds % 60;
434
+ var param = '';
435
+
436
+ if (h > 0) {
437
+ param += h + 'h';
438
+ }
439
+
440
+ if (m > 0) {
441
+ param += m + 'm';
442
+ }
443
+
444
+ if (s > 0) {
445
+ param += s + 's';
446
+ }
447
+
448
+ return param;
449
+ }