glebtv-ckeditor 4.5.10.3 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ckeditor/config.js.erb +1 -1
  3. data/lib/ckeditor.rb +1 -0
  4. data/lib/ckeditor/version.rb +2 -2
  5. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +1 -1
  6. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +1 -1
  7. data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +1 -1
  8. data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +1 -1
  9. data/vendor/assets/javascripts/ckeditor/LICENSE.md +2 -2
  10. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +1 -1
  11. data/vendor/assets/javascripts/ckeditor/build-config.js +26 -26
  12. data/vendor/assets/javascripts/ckeditor/ckeditor.js +605 -576
  13. data/vendor/assets/javascripts/ckeditor/lang/en.js +2 -2
  14. data/vendor/assets/javascripts/ckeditor/lang/ru.js +2 -2
  15. data/vendor/assets/javascripts/ckeditor/plugins/CKCss/css/styles.css +9 -0
  16. data/vendor/assets/javascripts/ckeditor/plugins/CKCss/dialogs/ckcss.js +2 -1
  17. data/vendor/assets/javascripts/ckeditor/plugins/CKCss/plugin.js +3 -1
  18. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +6 -6
  19. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +3 -4
  20. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +4 -4
  21. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +4 -3
  22. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +1 -1
  23. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/LICENSE.md +21 -0
  24. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +183 -0
  25. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.css +341 -0
  26. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  27. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/comment.js +206 -0
  28. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/continuecomment.js +85 -0
  29. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.css +32 -0
  30. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +157 -0
  31. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +202 -0
  32. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +169 -0
  33. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +51 -0
  34. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +122 -0
  35. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchtags.js +66 -0
  36. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/trailingspace.js +27 -0
  37. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +105 -0
  38. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/comment-fold.js +59 -0
  39. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +150 -0
  40. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.css +20 -0
  41. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.js +146 -0
  42. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/indent-fold.js +44 -0
  43. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/markdown-fold.js +49 -0
  44. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +182 -0
  45. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +43 -0
  46. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +226 -0
  47. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/anyword-hint.js +41 -0
  48. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/css-hint.js +60 -0
  49. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/html-hint.js +348 -0
  50. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/javascript-hint.js +155 -0
  51. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.css +36 -0
  52. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.js +438 -0
  53. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/sql-hint.js +271 -0
  54. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/xml-hint.js +110 -0
  55. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/loadmode.js +64 -0
  56. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex.js +123 -0
  57. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex_test.js +33 -0
  58. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/overlay.js +85 -0
  59. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/simple.js +213 -0
  60. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/jump-to-line.js +49 -0
  61. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +165 -0
  62. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.css +8 -0
  63. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.js +97 -0
  64. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +252 -0
  65. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +189 -0
  66. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/active-line.js +74 -0
  67. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/mark-selection.js +118 -0
  68. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/selection-pointer.js +98 -0
  69. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify-html.js +952 -0
  70. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.js +2087 -0
  71. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -1
  72. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  73. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +9109 -0
  74. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -1
  75. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +1 -1
  76. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  77. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +1 -1
  78. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/bbcode.js +137 -0
  79. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/index.html +73 -0
  80. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/bbcodemixed.js +161 -0
  81. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/index.html +128 -0
  82. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/clike.js +785 -0
  83. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/index.html +360 -0
  84. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/scala.html +767 -0
  85. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/test.js +55 -0
  86. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/css.js +825 -0
  87. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss.html +103 -0
  88. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss_test.js +17 -0
  89. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/index.html +75 -0
  90. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less.html +152 -0
  91. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less_test.js +54 -0
  92. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss.html +157 -0
  93. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss_test.js +110 -0
  94. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/test.js +200 -0
  95. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/htmlembedded.js +28 -0
  96. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/index.html +60 -0
  97. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/htmlmixed.js +152 -0
  98. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/index.html +89 -0
  99. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/index.html +114 -0
  100. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/javascript.js +784 -0
  101. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/json-ld.html +72 -0
  102. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/test.js +247 -0
  103. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/typescript.html +61 -0
  104. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/index.html +64 -0
  105. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/php.js +234 -0
  106. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/test.js +154 -0
  107. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/index.html +61 -0
  108. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/test.js +51 -0
  109. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/xml.js +394 -0
  110. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +30 -24
  111. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +1 -1
  112. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +35 -0
  113. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +36 -0
  114. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +85 -0
  115. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +0 -1
  116. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +21 -15
  117. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +1 -1
  118. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +1 -1
  119. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
  120. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +9 -9
  121. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +12 -12
  122. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +1 -1
  123. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +1 -1
  124. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +1 -1
  125. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +1 -1
  126. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +1 -1
  127. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +11 -11
  128. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +1 -1
  129. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +1 -1
  130. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  131. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  132. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +1 -1
  133. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +1 -1
  134. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +28 -28
  135. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/LICENSE +0 -0
  136. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/README.md +0 -0
  137. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/LANG.js +3 -0
  138. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/en.js +0 -0
  139. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +3 -3
  140. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/plugin.js +1 -1
  141. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/readme.txt +0 -0
  142. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +1 -1
  143. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +25 -23
  144. data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
  145. data/vendor/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
  146. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
  147. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +1 -1
  148. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +1 -1
  149. data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +2 -2
  150. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +40 -29
  151. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +19 -19
  152. data/vendor/assets/javascripts/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +20 -0
  153. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
  154. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +2 -2
  155. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +1 -1
  156. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
  157. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
  158. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/assets/sample.css +70 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +85 -0
  160. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +1 -1
  161. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +1 -1
  162. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +1 -1
  163. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +1 -1
  164. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +2 -2
  165. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  166. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  168. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/css/wordcount.css +0 -0
  169. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +1 -1
  170. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +1 -1
  171. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +60 -13
  172. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcount.html +61 -0
  173. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcountWithMaxCount.html +110 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +9 -9
  175. data/vendor/assets/javascripts/ckeditor/plugins/wsc/skins/moono-lisa/wsc.css +43 -0
  176. data/vendor/assets/javascripts/ckeditor/plugins/youtube/LICENSE.md +15 -0
  177. data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
  178. data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/en.js +3 -1
  179. data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +1 -0
  180. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +448 -388
  181. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons16.png +0 -0
  182. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons16.svg +175 -0
  183. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons32.png +0 -0
  184. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons32.svg +167 -0
  185. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/locations.json +145 -0
  186. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +5 -0
  187. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +5 -0
  188. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +5 -0
  189. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +5 -0
  190. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +5 -0
  191. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +5 -0
  192. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +5 -0
  193. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +5 -0
  194. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +5 -0
  195. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/arrow.png +0 -0
  196. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/close.png +0 -0
  197. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/close.png +0 -0
  198. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/lock-open.png +0 -0
  199. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/lock.png +0 -0
  200. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/refresh.png +0 -0
  201. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/lock-open.png +0 -0
  202. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/lock.png +0 -0
  203. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/refresh.png +0 -0
  204. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/spinner.gif +0 -0
  205. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/readme.md +46 -0
  206. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/skin.js +7 -0
  207. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +1 -1
  208. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +1 -1
  209. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +1 -1
  210. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +1 -1
  211. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +1 -1
  212. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +2 -2
  213. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +2 -2
  214. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +2 -2
  215. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +2 -2
  216. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +2 -2
  217. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +2 -2
  218. data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
  219. data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
  220. data/vendor/assets/javascripts/ckeditor/skins/moono/images/anchor.png +0 -0
  221. data/vendor/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
  222. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/anchor.png +0 -0
  223. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png +0 -0
  224. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
  225. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
  226. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
  227. data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock-open.png +0 -0
  228. data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock.png +0 -0
  229. data/vendor/assets/javascripts/ckeditor/skins/moono/images/refresh.png +0 -0
  230. data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +3 -3
  231. data/vendor/assets/javascripts/ckeditor/styles.js +42 -16
  232. metadata +161 -105
  233. data/app/assets/javascripts/ckeditor/config_orig.js +0 -58
  234. data/vendor/assets/javascripts/ckeditor/README.md +0 -39
  235. data/vendor/assets/javascripts/ckeditor/config.js +0 -10
  236. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/af.js +0 -12
  237. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ar.js +0 -12
  238. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bg.js +0 -12
  239. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bn.js +0 -12
  240. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bs.js +0 -12
  241. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ca.js +0 -12
  242. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/cs.js +0 -12
  243. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/cy.js +0 -12
  244. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/da.js +0 -12
  245. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/de.js +0 -12
  246. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/el.js +0 -12
  247. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-au.js +0 -12
  248. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-ca.js +0 -12
  249. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-gb.js +0 -12
  250. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/eo.js +0 -12
  251. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/es.js +0 -12
  252. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/et.js +0 -12
  253. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/eu.js +0 -12
  254. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fa.js +0 -12
  255. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fi.js +0 -12
  256. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fo.js +0 -12
  257. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fr-ca.js +0 -12
  258. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fr.js +0 -12
  259. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/gl.js +0 -12
  260. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/gu.js +0 -12
  261. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/he.js +0 -12
  262. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hi.js +0 -12
  263. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hr.js +0 -12
  264. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hu.js +0 -12
  265. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/is.js +0 -12
  266. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/it.js +0 -12
  267. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ja.js +0 -12
  268. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ka.js +0 -12
  269. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/km.js +0 -12
  270. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ko.js +0 -12
  271. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ku.js +0 -12
  272. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/lt.js +0 -12
  273. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/lv.js +0 -12
  274. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/mk.js +0 -12
  275. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/mn.js +0 -12
  276. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ms.js +0 -12
  277. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/nb.js +0 -12
  278. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/nl.js +0 -12
  279. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/no.js +0 -12
  280. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pl.js +0 -12
  281. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pt-br.js +0 -12
  282. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pt.js +0 -12
  283. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ro.js +0 -12
  284. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sk.js +0 -12
  285. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sl.js +0 -12
  286. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sr-latn.js +0 -12
  287. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sr.js +0 -12
  288. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sv.js +0 -12
  289. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/th.js +0 -12
  290. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/tr.js +0 -12
  291. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ug.js +0 -12
  292. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/uk.js +0 -12
  293. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/vi.js +0 -12
  294. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/zh-cn.js +0 -12
  295. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/zh.js +0 -12
@@ -0,0 +1,61 @@
1
+ <!DOCTYPE html>
2
+ <!--
3
+ Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
4
+ For licensing, see LICENSE.md or http://ckeditor.com/license
5
+ -->
6
+ <html>
7
+ <head>
8
+ <meta charset="utf-8">
9
+ <title>WordCount &mdash; CKEditor Sample</title>
10
+ <script src="../../../ckeditor.js"></script>
11
+ <link href="../../../samples/sample.css" rel="stylesheet">
12
+ <meta name="ckeditor-sample-name" content="WordCount plugin">
13
+ <meta name="ckeditor-sample-group" content="Plugins">
14
+ <meta name="ckeditor-sample-description" content="Counts the words an shows the word count in the footer of the editor.">
15
+ <meta name="ckeditor-sample-isnew" content="1">
16
+ <script>
17
+ CKEDITOR.disableAutoInline = true;
18
+ </script>
19
+ </head>
20
+ <body>
21
+ <h1 class="samples">
22
+ <a href="../../../samples/index.html">CKEditor Samples</a> &raquo; WordCount Plugin
23
+ </h1>
24
+
25
+ <div class="description">
26
+ <p>
27
+ WordCount Plugin for CKEditor that counts the words an shows the word count in the footer of the editor.</a>.
28
+ </p>
29
+ <p>
30
+ In order to use the new plugin, include it in the <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraPlugins">config.extraPlugins</a></code> configuration setting.
31
+ </p>
32
+ <pre class="samples">
33
+ CKEDITOR.replace( '<em>textarea_id</em>', {
34
+ <strong>extraPlugins: 'wordcount'</strong>
35
+ } );
36
+ </pre>
37
+ </div>
38
+
39
+ <textarea cols="80" id="editor1" name="editor1" rows="10">
40
+ This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.
41
+ </textarea>
42
+ <script>
43
+
44
+ CKEDITOR.replace('editor1', {
45
+ extraPlugins: 'wordcount'
46
+ });
47
+
48
+ </script>
49
+
50
+ <div id="footer">
51
+ <hr>
52
+ <p>
53
+ CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
54
+ </p>
55
+ <p id="copy">
56
+ Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
57
+ Knabben. All rights reserved.
58
+ </p>
59
+ </div>
60
+ </body>
61
+ </html>
@@ -0,0 +1,110 @@
1
+ <!DOCTYPE html>
2
+ <!--
3
+ Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
4
+ For licensing, see LICENSE.md or http://ckeditor.com/license
5
+ -->
6
+ <html>
7
+ <head>
8
+ <meta charset="utf-8">
9
+ <title>WordCount &mdash; CKEditor Sample</title>
10
+ <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
11
+ <script src="../../../ckeditor.js"></script>
12
+ <link href="../../../samples/sample.css" rel="stylesheet">
13
+ <meta name="ckeditor-sample-name" content="WordCount plugin">
14
+ <meta name="ckeditor-sample-group" content="Plugins">
15
+ <meta name="ckeditor-sample-description" content="Counts the words an shows the word count in the footer of the editor.">
16
+ <meta name="ckeditor-sample-isnew" content="1">
17
+ <script>
18
+ CKEDITOR.disableAutoInline = true;
19
+ </script>
20
+ </head>
21
+ <body>
22
+ <h1 class="samples">
23
+ <a href="../../../samples/index.html">CKEditor Samples</a> &raquo; WordCount Plugin
24
+ </h1>
25
+
26
+ <div class="description">
27
+ <p>
28
+ WordCount Plugin for CKEditor that counts the words an shows the word count in the footer of the editor.</a>.
29
+ </p>
30
+ <p>
31
+ In order to use the new plugin, include it in the <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraPlugins">config.extraPlugins</a></code> configuration setting.
32
+ </p>
33
+ <pre class="samples">
34
+ CKEDITOR.replace( '<em>textarea_id</em>', {
35
+ <strong>extraPlugins: 'wordcount',
36
+ maxWordCount: 4,
37
+ maxCharCount: 10,
38
+ // optional events
39
+ paragraphsCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
40
+ $("#informationparagraphs").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - paragraphs").show();
41
+ },
42
+ wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
43
+ $("#informationword").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - word").show();
44
+ },
45
+ charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
46
+ $("#informationchar").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - char").show();
47
+ },
48
+ charCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
49
+ $("#informationchar").css("background-color", "white").css("color", "black").hide();
50
+ },
51
+ paragraphsCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
52
+ $("#informationparagraphs").css("background-color", "white").css("color", "black").hide();
53
+ },
54
+ wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
55
+ $("#informationword").css("background-color", "white").css("color", "black").hide();
56
+ }</strong>
57
+ } );
58
+ </pre>
59
+ </div>
60
+
61
+ <textarea cols="80" id="editor1" name="editor1" rows="10">
62
+ This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.
63
+ </textarea>
64
+ <div id="informationchar"></div>
65
+ <div id="informationword"></div>
66
+ <div id="informationparagraphs"></div>
67
+ <script>
68
+
69
+ CKEDITOR.replace('editor1', {
70
+ extraPlugins: 'wordcount',
71
+ wordcount: {
72
+ showWordCount: true,
73
+ showCharCount: true,
74
+ maxWordCount: 4,
75
+ maxCharCount: 10,
76
+ paragraphsCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
77
+ $("#informationparagraphs").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - paragraphs").show();
78
+ },
79
+ wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
80
+ $("#informationword").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - word").show();
81
+ },
82
+ charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
83
+ $("#informationchar").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - char").show();
84
+ },
85
+ charCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
86
+ $("#informationchar").css("background-color", "white").css("color", "black").hide();
87
+ },
88
+ paragraphsCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
89
+ $("#informationparagraphs").css("background-color", "white").css("color", "black").hide();
90
+ },
91
+ wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
92
+ $("#informationword").css("background-color", "white").css("color", "black").hide();
93
+ }
94
+ }
95
+ });
96
+
97
+ </script>
98
+
99
+ <div id="footer">
100
+ <hr>
101
+ <p>
102
+ CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
103
+ </p>
104
+ <p id="copy">
105
+ Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
106
+ Knabben. All rights reserved.
107
+ </p>
108
+ </div>
109
+ </body>
110
+ </html>
@@ -19,9 +19,9 @@ for(var e=0;e<b.length;e++){var d=document.createElement("option");d.text=b[e];d
19
19
  a+";opacity: "+f+";filter: alpha(opacity\x3d"+100*f+");display: none;";k.id=d;h||e.appendChild(k);return{setDisable:function(){k.style.display="none"},setEnable:function(){k.style.display="block"}}},L=function(b,c,e){var d=new CKEDITOR.dom.element("div"),f=new CKEDITOR.dom.element("input"),h=new CKEDITOR.dom.element("label"),k="wscGrammerSuggest"+b+"_"+c;d.addClass("cke_dialog_ui_input_radio");d.setAttribute("role","presentation");d.setStyles({width:"97%",padding:"5px","white-space":"normal"});f.setAttributes({type:"radio",
20
20
  value:c,name:"wscGrammerSuggest",id:k});f.setStyles({"float":"left"});f.on("click",function(b){a.textNode.GrammTab.setValue(b.sender.getValue())});e?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"});d.append(f);d.append(h);return d},F=function(a){a=a||"true";null!==a&&"false"==a&&t()},w=function(b){var c=new I(b);b="wscLang"+a.dialog.getParentEditor().name;
21
21
  b=document.getElementById(b);var e=a.iframeNumber+"_"+a.dialog._.currentTabId;a.buildOptionLang(c.setLangList,a.dialog.getParentEditor().name);u[c.getCurrentLangGroup(a.selectingLang)].onShow();F(a.show_grammar);b.onchange=function(b){b=c.getCurrentLangGroup(this.value);var f=a.dialog._.currentTabId;u[b].onShow();F(a.show_grammar);a.div_overlay.setEnable();a.selectingLang=this.value;f=a.cmd[f];b&&u[b]&&u[b].allowedTabCommands[f]||(f=u[b].defaultTabCommand);for(var h in a.cmd)if(a.cmd[h]==f){a.previousTab=
22
- h;break}g.postMessage.send({message:{changeLang:a.selectingLang,text:a.dataTemp,cmd:f},target:a.targetFromFrame[e],id:"selectionLang_outer__page"})}},M=function(b){var c,e=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;b.getElement().hasClass("cke_disabled")?b.getElement().setStyle("color","#a0a0a0"):b.disable()};c=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;b.enable();b.getElement().setStyle("color",
23
- "#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(),e("ChangeTo_button"),e("ChangeAll")):(c("ChangeTo_button"),c("ChangeAll"));return b},O={iframeOnload:function(b){a.div_overlay.setEnable();b=a.dialog._.currentTabId;E(a.targetFromFrame[a.iframeNumber+
24
- "_"+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),e="";c instanceof Array&&(c=b.word[0]);e=c=c.split(",");a.textNode.SpellTab.setValue(e[0]);b=z(A);A.clear();for(c=0;c<e.length;c++){var d=document.createElement("option");d.text=e[c];d.value=e[c];b.$.add(d,c)}v();a.div_overlay.setDisable()},grammerSuggest:function(b){delete b.id;delete b.mocklangs;C();w(a.langList);var c=b.grammSuggest[0];a.grammerSuggest.getElement().setHtml("");
22
+ h;break}g.postMessage.send({message:{changeLang:a.selectingLang,interfaceLang:a.interfaceLang,text:a.dataTemp,cmd:f},target:a.targetFromFrame[e],id:"selectionLang_outer__page"})}},M=function(b){var c,e=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;b.getElement().hasClass("cke_disabled")?b.getElement().setStyle("color","#a0a0a0"):b.disable()};c=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;
23
+ 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(),e("ChangeTo_button"),e("ChangeAll")):(c("ChangeTo_button"),c("ChangeAll"));return b},O={iframeOnload:function(b){a.div_overlay.setEnable();b=a.dialog._.currentTabId;
24
+ 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),e="";c instanceof Array&&(c=b.word[0]);e=c=c.split(",");a.textNode.SpellTab.setValue(e[0]);b=z(A);A.clear();for(c=0;c<e.length;c++){var d=document.createElement("option");d.text=e[c];d.value=e[c];b.$.add(d,c)}v();a.div_overlay.setDisable()},grammerSuggest:function(b){delete b.id;delete b.mocklangs;C();w(a.langList);var c=b.grammSuggest[0];a.grammerSuggest.getElement().setHtml("");
25
25
  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,e=!0,d=0;d<c;d++)a.grammerSuggest.getElement().append(L(b[d],b[d],e)),e=!1;v();a.div_overlay.setDisable()},thesaurusSuggest:function(b){delete b.id;delete b.mocklangs;C();w(a.langList);a.selectNodeResponce=b;a.textNode.Thesaurus.reset();var c=z(a.selectNode.Categories),e=0;a.selectNode.Categories.clear();
26
26
  for(var d in b)b=document.createElement("option"),b.text=d,b.value=d,c.$.add(b,e),e++;c=a.selectNode.Categories.getInputElement().getChildren().$[0].value;a.selectNode.Categories.getInputElement().getChildren().$[0].selected=!0;a.buildOptionSynonyms(c);v();a.div_overlay.setDisable()},finish:function(b){delete b.id;N();b=a.dialog.getContentElement(a.dialog._.currentTabId,"BlockFinishChecking").getElement();b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.show();a.div_overlay.setDisable()},
27
27
  settext:function(b){delete b.id;a.dialog.getParentEditor().getCommand("checkspell");var c=a.dialog.getParentEditor();if(c.scayt&&c.wsc.isSsrvSame){var e=c.wsc.udn;e?c.wsc.DataStorage.setData("scayt_user_dictionary_name",e):c.wsc.DataStorage.setData("scayt_user_dictionary_name","")}try{c.focus()}catch(d){}c.setData(b.text,function(){a.dataTemp="";c.unlockSelection();c.fire("saveSnapshot");a.dialog.hide()})},ReplaceText:function(b){delete b.id;a.div_overlay.setEnable();a.dataTemp=b.text;a.selectingLang=
@@ -29,8 +29,8 @@ b.currentLang;(b.cmd="0"!==b.len&&b.len)?a.div_overlay.setDisable():window.setTi
29
29
  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 e=b.banner;a.dialog.getContentElement(a.dialog._.currentTabId,"banner").getElement().setHtml(e)}else a.setHeightFrame();"undefined"==c&&(a.userDictionaryName?(c=a.userDictionaryName,e={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:e,
30
30
  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,target:a.targetFromFrame[a.iframeNumber+"_"+a.dialog._.currentTabId]})},data:function(a){delete a.id},giveOptions:function(){},
31
31
  setOptionsConfirmF:function(){},setOptionsConfirmT:function(){r.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,e,d){c=c||CKEDITOR.config.wsc_cmd;e=e||a.dataTemp;g.postMessage.send({message:{customerId:a.wsc_customerId,text:e,txt_ctrl:a.TextAreaNumber,cmd:c,cust_dic_ids:a.cust_dic_ids,
32
- udn:a.userDictionaryName,slang:a.selectingLang,reset_suggest:d||!1,sessionid:a.sessionid},target:b,id:"data_outer__page"});a.div_overlay.setEnable()},u={superset:{onShow:function(){a.dialog.showPage("Thesaurus");a.dialog.showPage("GrammTab");l()},allowedTabCommands:{spell:!0,grammar:!0,thes:!0},defaultTabCommand:"spell"},usual:{onShow:function(){x();t();l()},allowedTabCommands:{spell:!0},defaultTabCommand:"spell"},rtl:{onShow:function(){x();t();l()},allowedTabCommands:{spell:!0},defaultTabCommand:"spell"},
33
- spellgrammar:{onShow:function(){x();a.dialog.showPage("GrammTab");l()},allowedTabCommands:{spell:!0,grammar:!0},defaultTabCommand:"spell"},spellthes:{onShow:function(){a.dialog.showPage("Thesaurus");t();l()},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]]=h;return b[c]}}}(a.cmd)).getCmdByTab(CKEDITOR.config.wsc_cmd);b.selectPage(c);a.sendData(b)},x=function(){a.dialog.hidePage("Thesaurus")},
32
+ udn:a.userDictionaryName,slang:a.selectingLang,interfaceLang:a.interfaceLang,reset_suggest:d||!1,sessionid:a.sessionid},target:b,id:"data_outer__page"});a.div_overlay.setEnable()},u={superset:{onShow:function(){a.dialog.showPage("Thesaurus");a.dialog.showPage("GrammTab");l()},allowedTabCommands:{spell:!0,grammar:!0,thes:!0},defaultTabCommand:"spell"},usual:{onShow:function(){x();t();l()},allowedTabCommands:{spell:!0},defaultTabCommand:"spell"},rtl:{onShow:function(){x();t();l()},allowedTabCommands:{spell:!0},
33
+ defaultTabCommand:"spell"},spellgrammar:{onShow:function(){x();a.dialog.showPage("GrammTab");l()},allowedTabCommands:{spell:!0,grammar:!0},defaultTabCommand:"spell"},spellthes:{onShow:function(){a.dialog.showPage("Thesaurus");t();l()},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]]=h;return b[c]}}}(a.cmd)).getCmdByTab(CKEDITOR.config.wsc_cmd);b.selectPage(c);a.sendData(b)},x=function(){a.dialog.hidePage("Thesaurus")},
34
34
  t=function(){a.dialog.hidePage("GrammTab")},l=function(){a.dialog.showPage("SpellTab")},v=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(),c=document.activeElement,e;b.setStyles({display:"block",position:"absolute",left:"-9999px"});setTimeout(function(){b.removeStyle("display");
35
35
  b.removeStyle("position");b.removeStyle("left");b.hide();a.dialog._.editor.focusManager.currentActive.focusNext();e=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 d=0,f;d<e.count();d++){if(f=e.getItem(d),g.misc.isVisible(f.$)){try{f.$.focus()}catch(h){}break}}else try{c.focus()}catch(k){}},0)},C=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"BlockFinishChecking").getElement(),
36
36
  c=document.activeElement,e;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();e=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 d=0,f;d<e.count();d++){if(f=e.getItem(d),g.misc.isVisible(f.$)){try{f.$.focus()}catch(h){}break}}else try{c.focus()}catch(k){}},
@@ -46,15 +46,15 @@ e.src=d;document.getElementsByTagName("head")[0].appendChild(e);e.onload=c;e.onr
46
46
  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=this;x();t();l();b.plugins.scayt&&e()},onShow:function(){a.dialog=this;b.lockSelection(b.getSelection());
47
47
  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?"http:":document.location.protocol,d=b.config.wsc_customLoaderScript||d+"//loader.webspellchecker.net/sproxy_fck/sproxy.php?plugin\x3dfck2\x26customerid\x3d"+
48
48
  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,a.loadIconEmptyEditor=CKEDITOR.config.wsc.DefaultParams.iconPathEmptyEditor,a.LangComparer=new CKEDITOR.config.wsc.DefaultParams._SP_FCK_LangCompare):
49
- (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)||"en_US";a.selectingLang=a.currentLang;
50
- 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",background:"#fff url("+a.loadIconEmptyEditor+") no-repeat 50% 50%",target:a.OverlayPlace});c&&(H(a.dialog),a.dialog.setupContent(a.dialog));
49
+ (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)||"en_US";a.interfaceLang=b.config.wsc_interfaceLang;
50
+ 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",background:"#fff url("+a.loadIconEmptyEditor+") no-repeat 50% 50%",target:a.OverlayPlace});c&&(H(a.dialog),a.dialog.setupContent(a.dialog));
51
51
  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/","")+"/script/ssrv.cgi");!d||f||b.config.scayt_servicePath||(d.split("//"),e=d.split("//")[1].split("/")[0],
52
52
  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),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),
53
53
  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!==a&&b.wsc.operationWithUDN("restore",a)},500)}})}else a.dialog.hide()},onHide:function(){var c=CKEDITOR.plugins.scayt,
54
54
  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()),e&&setTimeout(function(){f=e.split(",");for(l=0;l<f.length;l+=1)b.scayt.addWordToUserDictionary(f[l])},
55
55
  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"},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(b){b=a.iframeNumber+"_"+
56
- 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%"],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=
57
- 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"})}},{type:"html",id:"logo",html:'\x3cimg width\x3d"99" height\x3d"68" border\x3d"0" src\x3d"" title\x3d"WebSpellChecker.net" alt\x3d"WebSpellChecker.net" style\x3d"display: inline-block;"\x3e',
56
+ 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+":",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",width:"140px",
57
+ "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"})}},{type:"html",id:"logo",html:'\x3cimg width\x3d"99" height\x3d"68" border\x3d"0" src\x3d"" title\x3d"WebSpellChecker.net" alt\x3d"WebSpellChecker.net" style\x3d"display: inline-block;"\x3e',
58
58
  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",widths:["50%","50%",
59
59
  "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:d},{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
60
  this},onClick:d},{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:d},{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=
@@ -0,0 +1,43 @@
1
+ .cke_dialog_body #overlayBlock,
2
+ .cke_dialog_body #no_check_over
3
+ {
4
+ top: 39px !important;
5
+ }
6
+
7
+ div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_vbox td > .cke_dialog_ui_button:first-child
8
+ {
9
+ margin-top: 4px;
10
+ }
11
+
12
+ div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_hbox_first .cke_dialog_ui_select > label
13
+ {
14
+ margin-left: 0;
15
+ }
16
+
17
+ div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_hbox_first .cke_dialog_ui_select div.cke_dialog_ui_input_select
18
+ {
19
+ width: 140px !important;
20
+ }
21
+
22
+ div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_hbox_first .cke_dialog_ui_select select.cke_dialog_ui_input_select,
23
+ div[name=Thesaurus] div.cke_dialog_ui_input_select select.cke_dialog_ui_input_select
24
+ {
25
+ margin-top: 1px;
26
+ }
27
+
28
+ div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_hbox_first .cke_dialog_ui_select select.cke_dialog_ui_input_select:focus,
29
+ div[name=Thesaurus] div.cke_dialog_ui_input_select select.cke_dialog_ui_input_select:focus
30
+ {
31
+ margin-top: 0;
32
+ }
33
+
34
+ div[name=GrammTab] .cke_dialog_ui_vbox tbody > tr:first-child .cke_dialog_ui_button,
35
+ div[name=Thesaurus] .cke_dialog_ui_vbox tbody > tr:first-child .cke_dialog_ui_button
36
+ {
37
+ margin-top: 4px !important;
38
+ }
39
+
40
+ div[name=Thesaurus] div.cke_dialog_ui_input_select
41
+ {
42
+ width: 180px !important;
43
+ }
@@ -0,0 +1,15 @@
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+ Version 2, December 2004
3
+
4
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified
7
+ copies of this license document, and changing it is allowed as long
8
+ as the name is changed.
9
+
10
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+
13
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
14
+
15
+
@@ -10,6 +10,7 @@ CKEDITOR.plugins.setLang('youtube', 'en', {
10
10
  chkPrivacy : 'Enable privacy-enhanced mode',
11
11
  chkOlderCode : 'Use old embed code',
12
12
  chkAutoplay: 'Autoplay',
13
+ chkControls: 'Show player controls',
13
14
  noCode : 'You must input an embed code or URL',
14
15
  invalidEmbed : 'The embed code you\'ve entered doesn\'t appear to be valid',
15
16
  invalidUrl : 'The URL you\'ve entered doesn\'t appear to be valid',
@@ -19,5 +20,6 @@ CKEDITOR.plugins.setLang('youtube', 'en', {
19
20
  noHeight : 'You must inform the height',
20
21
  invalidHeight : 'Inform a valid height',
21
22
  invalidTime : 'Inform a valid start time',
22
- txtResponsive : 'Make Responsive (ignore width and height, fit to width)'
23
+ txtResponsive : 'Make Responsive (ignore width and height, fit to width)',
24
+ txtNoEmbed : 'Video image and link only'
23
25
  });
@@ -10,6 +10,7 @@ CKEDITOR.plugins.setLang('youtube', 'ru', {
10
10
  chkPrivacy : 'Включить режим повышенной конфиденциальности',
11
11
  chkOlderCode : 'Использовать старый код вставки',
12
12
  chkAutoplay: 'Автозапуск',
13
+ chkControls: 'Показать панель управления',
13
14
  noCode : 'Вы должны ввести HTML-код или адрес',
14
15
  invalidEmbed : 'Ваш HTML-код не похож на правильный',
15
16
  invalidUrl : 'Ваш адрес видео не похож на правильный',
@@ -1,388 +1,448 @@
1
- /*
2
- * Youtube Embed Plugin
3
- *
4
- * @author Jonnas Fonini <contato@fonini.net>
5
- * @version 2.0.9
6
- */
7
- ( function() {
8
- CKEDITOR.plugins.add( 'youtube',
9
- {
10
- lang: [ 'en', 'pt', 'ja', 'hu', 'it', 'fr', 'tr', 'ru', 'de', 'ar', 'nl', 'pl', 'vi', 'zh', 'el', 'he', 'es', 'nb', 'nn', 'fi', 'et', 'sk', 'cs'],
11
- init: function( editor )
12
- {
13
- editor.addCommand( 'youtube', new CKEDITOR.dialogCommand( 'youtube', {
14
- allowedContent: 'div{*}; iframe{*}[!width,!height,!src,!frameborder,!allowfullscreen]; object param[*]'
15
- }));
16
-
17
- editor.ui.addButton( 'Youtube',
18
- {
19
- label : editor.lang.youtube.button,
20
- toolbar : 'insert',
21
- command : 'youtube',
22
- icon : this.path + 'images/icon.png'
23
- });
24
-
25
- CKEDITOR.dialog.add( 'youtube', function ( instance )
26
- {
27
- var video;
28
-
29
- return {
30
- title : editor.lang.youtube.title,
31
- minWidth : 500,
32
- minHeight : 200,
33
- contents :
34
- [{
35
- id : 'youtubePlugin',
36
- expand : true,
37
- elements :
38
- [{
39
- id : 'txtEmbed',
40
- type : 'textarea',
41
- label : editor.lang.youtube.txtEmbed,
42
- autofocus : 'autofocus',
43
- onChange : function ( api )
44
- {
45
- handleEmbedChange( this, api );
46
- },
47
- onKeyUp : function ( api )
48
- {
49
- handleEmbedChange( this, api );
50
- },
51
- validate : function ()
52
- {
53
- if ( this.isEnabled() )
54
- {
55
- if ( !this.getValue() )
56
- {
57
- alert( editor.lang.youtube.noCode );
58
- return false;
59
- }
60
- else
61
- if ( this.getValue().length === 0 || this.getValue().indexOf( '//' ) === -1 )
62
- {
63
- alert( editor.lang.youtube.invalidEmbed );
64
- return false;
65
- }
66
- }
67
- }
68
- },
69
- {
70
- type : 'html',
71
- html : editor.lang.youtube.or + '<hr>'
72
- },
73
- {
74
- type : 'hbox',
75
- widths : [ '70%', '15%', '15%' ],
76
- children :
77
- [
78
- {
79
- id : 'txtUrl',
80
- type : 'text',
81
- label : editor.lang.youtube.txtUrl,
82
- onChange : function ( api )
83
- {
84
- handleLinkChange( this, api );
85
- },
86
- onKeyUp : function ( api )
87
- {
88
- handleLinkChange( this, api );
89
- },
90
- validate : function ()
91
- {
92
- if ( this.isEnabled() )
93
- {
94
- if ( !this.getValue() )
95
- {
96
- alert( editor.lang.youtube.noCode );
97
- return false;
98
- }
99
- else{
100
- video = ytVidId(this.getValue());
101
-
102
- if ( this.getValue().length === 0 || video === false)
103
- {
104
- alert( editor.lang.youtube.invalidUrl );
105
- return false;
106
- }
107
- }
108
- }
109
- }
110
- },
111
- {
112
- type : 'text',
113
- id : 'txtWidth',
114
- width : '60px',
115
- label : editor.lang.youtube.txtWidth,
116
- 'default' : editor.config.youtube_width != null ? editor.config.youtube_width : '640',
117
- validate : function ()
118
- {
119
- if ( this.getValue() )
120
- {
121
- var width = parseInt ( this.getValue() ) || 0;
122
-
123
- if ( width === 0 )
124
- {
125
- alert( editor.lang.youtube.invalidWidth );
126
- return false;
127
- }
128
- }
129
- else {
130
- alert( editor.lang.youtube.noWidth );
131
- return false;
132
- }
133
- }
134
- },
135
- {
136
- type : 'text',
137
- id : 'txtHeight',
138
- width : '60px',
139
- label : editor.lang.youtube.txtHeight,
140
- 'default' : editor.config.youtube_height != null ? editor.config.youtube_height : '360',
141
- validate : function ()
142
- {
143
- if ( this.getValue() )
144
- {
145
- var height = parseInt ( this.getValue() ) || 0;
146
-
147
- if ( height === 0 )
148
- {
149
- alert( editor.lang.youtube.invalidHeight );
150
- return false;
151
- }
152
- }
153
- else {
154
- alert( editor.lang.youtube.noHeight );
155
- return false;
156
- }
157
- }
158
- }
159
- ]
160
- },
161
- {
162
- type : 'hbox',
163
- widths : [ '100%' ],
164
- children :
165
- [
166
- {
167
- id : 'chkResponsive',
168
- type : 'checkbox',
169
- label : editor.lang.youtube.txtResponsive,
170
- 'default' : editor.config.youtube_responsive != null ? editor.config.youtube_responsive : false
171
- }
172
- ]
173
- },
174
- {
175
- type : 'hbox',
176
- widths : [ '55%', '45%' ],
177
- children :
178
- [
179
- {
180
- id : 'chkRelated',
181
- type : 'checkbox',
182
- 'default' : editor.config.youtube_related != null ? editor.config.youtube_related : true,
183
- label : editor.lang.youtube.chkRelated
184
- },
185
- {
186
- id : 'chkOlderCode',
187
- type : 'checkbox',
188
- 'default' : editor.config.youtube_older != null ? editor.config.youtube_older : false,
189
- label : editor.lang.youtube.chkOlderCode
190
- }
191
- ]
192
- },
193
- {
194
- type : 'hbox',
195
- widths : [ '55%', '45%' ],
196
- children :
197
- [
198
- {
199
- id : 'chkPrivacy',
200
- type : 'checkbox',
201
- label : editor.lang.youtube.chkPrivacy,
202
- 'default' : editor.config.youtube_privacy != null ? editor.config.youtube_privacy : false
203
- },
204
- {
205
- id : 'chkAutoplay',
206
- type : 'checkbox',
207
- 'default' : editor.config.youtube_autoplay != null ? editor.config.youtube_autoplay : false,
208
- label : editor.lang.youtube.chkAutoplay
209
- }
210
- ]
211
- },
212
- {
213
- type : 'hbox',
214
- widths : [ '55%', '45%'],
215
- children :
216
- [
217
- {
218
- id : 'txtStartAt',
219
- type : 'text',
220
- label : editor.lang.youtube.txtStartAt,
221
- validate : function ()
222
- {
223
- if ( this.getValue() )
224
- {
225
- var str = this.getValue();
226
-
227
- if ( !/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/i.test( str ) )
228
- {
229
- alert( editor.lang.youtube.invalidTime );
230
- return false;
231
- }
232
- }
233
- }
234
- },
235
- {
236
- id: 'empty',
237
- type: 'html',
238
- html: ''
239
- }
240
- ]
241
- }
242
- ]
243
- }
244
- ],
245
- onOk: function()
246
- {
247
- var content = '';
248
- var responsiveStyle='';
249
-
250
- if ( this.getContentElement( 'youtubePlugin', 'txtEmbed' ).isEnabled() )
251
- {
252
- content = this.getValueOf( 'youtubePlugin', 'txtEmbed' );
253
- }
254
- else {
255
- var url = '//', params = [], startSecs;
256
- var width = this.getValueOf( 'youtubePlugin', 'txtWidth' );
257
- var height = this.getValueOf( 'youtubePlugin', 'txtHeight' );
258
-
259
- if ( this.getContentElement( 'youtubePlugin', 'chkPrivacy' ).getValue() === true )
260
- {
261
- url += 'www.youtube-nocookie.com/';
262
- }
263
- else {
264
- url += 'www.youtube.com/';
265
- }
266
-
267
- url += 'embed/' + video;
268
-
269
- if ( this.getContentElement( 'youtubePlugin', 'chkRelated' ).getValue() === false )
270
- {
271
- params.push('rel=0');
272
- }
273
-
274
- if ( this.getContentElement( 'youtubePlugin', 'chkAutoplay' ).getValue() === true )
275
- {
276
- params.push('autoplay=1');
277
- }
278
-
279
- startSecs = this.getValueOf( 'youtubePlugin', 'txtStartAt' );
280
- if ( startSecs ){
281
- var seconds = hmsToSeconds( startSecs );
282
-
283
- params.push('start=' + seconds);
284
- }
285
-
286
- if ( params.length > 0 )
287
- {
288
- url = url + '?' + params.join( '&' );
289
- }
290
-
291
- if ( this.getContentElement( 'youtubePlugin', 'chkResponsive').getValue() === true ) {
292
- content += '<div class="youtube-embed-wrapper" style="position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden;">';
293
- responsiveStyle = 'style="position: absolute;top: 0;left: 0;width: 100%;height: 100%;"';
294
- }
295
-
296
- if ( this.getContentElement( 'youtubePlugin', 'chkOlderCode' ).getValue() === true )
297
- {
298
- url = url.replace('embed/', 'v/');
299
- url = url.replace(/&/g, '&amp;');
300
-
301
- if ( url.indexOf('?') === -1 )
302
- {
303
- url += '?';
304
- }
305
- else {
306
- url += '&amp;';
307
- }
308
- url += 'hl=' + (this.getParentEditor().config.language ? this.getParentEditor().config.language : 'en') + '&amp;version=3';
309
-
310
- content += '<object width="' + width + '" height="' + height + '" ' + responsiveStyle + '>';
311
- content += '<param name="movie" value="' + url + '"></param>';
312
- content += '<param name="allowFullScreen" value="true"></param>';
313
- content += '<param name="allowscriptaccess" value="always"></param>';
314
- content += '<embed src="' + url + '" type="application/x-shockwave-flash" ';
315
- content += 'width="' + width + '" height="' + height + '" '+ responsiveStyle + ' allowscriptaccess="always" ';
316
- content += 'allowfullscreen="true"></embed>';
317
- content += '</object>';
318
- }
319
- else {
320
- content += '<iframe width="' + width + '" height="' + height + '" src="' + url + '" ' + responsiveStyle;
321
- content += 'frameborder="0" allowfullscreen></iframe>';
322
- }
323
-
324
- if ( this.getContentElement( 'youtubePlugin', 'chkResponsive').getValue() === true ) {
325
- content += '</div>';
326
- }
327
- }
328
-
329
- var element = CKEDITOR.dom.element.createFromHtml( content );
330
- var instance = this.getParentEditor();
331
- instance.insertElement(element);
332
- }
333
- };
334
- });
335
- }
336
- });
337
- })();
338
-
339
- function handleLinkChange( el, api )
340
- {
341
- if ( el.getValue().length > 0 )
342
- {
343
- el.getDialog().getContentElement( 'youtubePlugin', 'txtEmbed' ).disable();
344
- }
345
- else {
346
- el.getDialog().getContentElement( 'youtubePlugin', 'txtEmbed' ).enable();
347
- }
348
- }
349
-
350
- function handleEmbedChange( el, api )
351
- {
352
- if ( el.getValue().length > 0 )
353
- {
354
- el.getDialog().getContentElement( 'youtubePlugin', 'txtUrl' ).disable();
355
- }
356
- else {
357
- el.getDialog().getContentElement( 'youtubePlugin', 'txtUrl' ).enable();
358
- }
359
- }
360
-
361
-
362
- /**
363
- * JavaScript function to match (and return) the video Id
364
- * of any valid Youtube Url, given as input string.
365
- * @author: Stephan Schmitz <eyecatchup@gmail.com>
366
- * @url: http://stackoverflow.com/a/10315969/624466
367
- */
368
- function ytVidId( url )
369
- {
370
- var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
371
- return ( url.match( p ) ) ? RegExp.$1 : false;
372
- }
373
-
374
- /**
375
- * Converts time in hms format to seconds only
376
- */
377
- function hmsToSeconds( time )
378
- {
379
- var arr = time.split(':'), s = 0, m = 1;
380
-
381
- while (arr.length > 0)
382
- {
383
- s += m * parseInt(arr.pop(), 10);
384
- m *= 60;
385
- }
386
-
387
- return s;
388
- }
1
+ /*
2
+ * Youtube Embed Plugin
3
+ *
4
+ * @author Jonnas Fonini <jonnasfonini@gmail.com>
5
+ * @version 2.1.5
6
+ */
7
+ (function () {
8
+ CKEDITOR.plugins.add('youtube', {
9
+ lang: [ 'en', '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'],
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
+ }