esp-ckeditor 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +32 -0
  3. data/Rakefile +28 -0
  4. data/app/assets/javascripts/esp-ckeditor/_source/core/_bootstrap.js +87 -0
  5. data/app/assets/javascripts/esp-ckeditor/_source/core/ckeditor.js +141 -0
  6. data/app/assets/javascripts/esp-ckeditor/_source/core/ckeditor_base.js +227 -0
  7. data/app/assets/javascripts/esp-ckeditor/_source/core/ckeditor_basic.js +238 -0
  8. data/app/assets/javascripts/esp-ckeditor/_source/core/command.js +209 -0
  9. data/app/assets/javascripts/esp-ckeditor/_source/core/commanddefinition.js +129 -0
  10. data/app/assets/javascripts/esp-ckeditor/_source/core/config.js +423 -0
  11. data/app/assets/javascripts/esp-ckeditor/_source/core/dataprocessor.js +65 -0
  12. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/comment.js +32 -0
  13. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/document.js +251 -0
  14. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/documentfragment.js +49 -0
  15. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/domobject.js +258 -0
  16. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/element.js +1691 -0
  17. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/elementpath.js +119 -0
  18. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/event.js +145 -0
  19. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/node.js +696 -0
  20. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/nodelist.js +26 -0
  21. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/range.js +2054 -0
  22. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/rangelist.js +213 -0
  23. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/text.js +128 -0
  24. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/walker.js +462 -0
  25. data/app/assets/javascripts/esp-ckeditor/_source/core/dom/window.js +96 -0
  26. data/app/assets/javascripts/esp-ckeditor/_source/core/dom.js +20 -0
  27. data/app/assets/javascripts/esp-ckeditor/_source/core/dtd.js +266 -0
  28. data/app/assets/javascripts/esp-ckeditor/_source/core/editor.js +1060 -0
  29. data/app/assets/javascripts/esp-ckeditor/_source/core/editor_basic.js +186 -0
  30. data/app/assets/javascripts/esp-ckeditor/_source/core/env.js +305 -0
  31. data/app/assets/javascripts/esp-ckeditor/_source/core/event.js +342 -0
  32. data/app/assets/javascripts/esp-ckeditor/_source/core/eventInfo.js +120 -0
  33. data/app/assets/javascripts/esp-ckeditor/_source/core/focusmanager.js +152 -0
  34. data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/basicwriter.js +145 -0
  35. data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/cdata.js +43 -0
  36. data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/comment.js +60 -0
  37. data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/element.js +308 -0
  38. data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/filter.js +288 -0
  39. data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/fragment.js +518 -0
  40. data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/text.js +53 -0
  41. data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser.js +224 -0
  42. data/app/assets/javascripts/esp-ckeditor/_source/core/lang.js +157 -0
  43. data/app/assets/javascripts/esp-ckeditor/_source/core/loader.js +240 -0
  44. data/app/assets/javascripts/esp-ckeditor/_source/core/plugindefinition.js +83 -0
  45. data/app/assets/javascripts/esp-ckeditor/_source/core/plugins.js +103 -0
  46. data/app/assets/javascripts/esp-ckeditor/_source/core/resourcemanager.js +238 -0
  47. data/app/assets/javascripts/esp-ckeditor/_source/core/scriptloader.js +180 -0
  48. data/app/assets/javascripts/esp-ckeditor/_source/core/skins.js +184 -0
  49. data/app/assets/javascripts/esp-ckeditor/_source/core/themes.js +19 -0
  50. data/app/assets/javascripts/esp-ckeditor/_source/core/tools.js +763 -0
  51. data/app/assets/javascripts/esp-ckeditor/_source/core/ui.js +128 -0
  52. data/app/assets/javascripts/esp-ckeditor/_source/lang/_languages.js +27 -0
  53. data/app/assets/javascripts/esp-ckeditor/_source/lang/en.js +815 -0
  54. data/app/assets/javascripts/esp-ckeditor/_source/lang/ru.js +815 -0
  55. data/app/assets/javascripts/esp-ckeditor/_source/plugins/a11yhelp/dialogs/a11yhelp.js +222 -0
  56. data/app/assets/javascripts/esp-ckeditor/_source/plugins/a11yhelp/lang/en.js +108 -0
  57. data/app/assets/javascripts/esp-ckeditor/_source/plugins/a11yhelp/lang/he.js +216 -0
  58. data/app/assets/javascripts/esp-ckeditor/_source/plugins/a11yhelp/plugin.js +47 -0
  59. data/app/assets/javascripts/esp-ckeditor/_source/plugins/basicstyles/plugin.js +129 -0
  60. data/app/assets/javascripts/esp-ckeditor/_source/plugins/button/plugin.js +290 -0
  61. data/app/assets/javascripts/esp-ckeditor/_source/plugins/clipboard/dialogs/paste.js +223 -0
  62. data/app/assets/javascripts/esp-ckeditor/_source/plugins/clipboard/plugin.js +453 -0
  63. data/app/assets/javascripts/esp-ckeditor/_source/plugins/contextmenu/plugin.js +179 -0
  64. data/app/assets/javascripts/esp-ckeditor/_source/plugins/dialog/dialogDefinition.js +1166 -0
  65. data/app/assets/javascripts/esp-ckeditor/_source/plugins/dialog/plugin.js +3308 -0
  66. data/app/assets/javascripts/esp-ckeditor/_source/plugins/dialogadvtab/plugin.js +208 -0
  67. data/app/assets/javascripts/esp-ckeditor/_source/plugins/dialogui/plugin.js +1541 -0
  68. data/app/assets/javascripts/esp-ckeditor/_source/plugins/domiterator/plugin.js +361 -0
  69. data/app/assets/javascripts/esp-ckeditor/_source/plugins/editingblock/plugin.js +278 -0
  70. data/app/assets/javascripts/esp-ckeditor/_source/plugins/elementspath/plugin.js +218 -0
  71. data/app/assets/javascripts/esp-ckeditor/_source/plugins/enterkey/plugin.js +433 -0
  72. data/app/assets/javascripts/esp-ckeditor/_source/plugins/entities/plugin.js +250 -0
  73. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/dialogs/esp_attachment.js +234 -0
  74. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/images/esp_attachment.png +0 -0
  75. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/lang/en.js +22 -0
  76. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/lang/ru.js +22 -0
  77. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/lang/uk.js +22 -0
  78. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/plugin.js +23 -0
  79. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/dialogs/esp_audio.js +207 -0
  80. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/images/esp_audio.png +0 -0
  81. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/images/placeholder.png +0 -0
  82. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/lang/en.js +18 -0
  83. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/lang/ru.js +18 -0
  84. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/lang/uk.js +18 -0
  85. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/plugin.js +182 -0
  86. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_blockquote/dialogs/esp_blockquote.js +132 -0
  87. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_blockquote/plugin.js +235 -0
  88. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/dialogs/esp_image.js +1414 -0
  89. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/images/esp_image.png +0 -0
  90. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/lang/en.js +9 -0
  91. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/lang/ru.js +9 -0
  92. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/lang/uk.js +9 -0
  93. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/plugin.js +80 -0
  94. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/dialogs/esp_anchor.js +145 -0
  95. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/dialogs/esp_link.js +1396 -0
  96. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/images/anchor.png +0 -0
  97. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/images/esp_anchor.png +0 -0
  98. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/images/esp_link.png +0 -0
  99. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/images/esp_unlink.png +0 -0
  100. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/lang/en.js +8 -0
  101. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/lang/ru.js +8 -0
  102. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/lang/uk.js +8 -0
  103. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/plugin.js +379 -0
  104. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_address.png +0 -0
  105. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_blockquote.png +0 -0
  106. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_div.png +0 -0
  107. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h1.png +0 -0
  108. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h2.png +0 -0
  109. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h3.png +0 -0
  110. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h4.png +0 -0
  111. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h5.png +0 -0
  112. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h6.png +0 -0
  113. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_p.png +0 -0
  114. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_pre.png +0 -0
  115. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/esp_showblocks.png +0 -0
  116. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/plugin.js +163 -0
  117. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/dialogs/esp_video.js +277 -0
  118. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/images/esp_video.png +0 -0
  119. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/images/placeholder.png +0 -0
  120. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/lang/en.js +19 -0
  121. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/lang/ru.js +19 -0
  122. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/lang/uk.js +19 -0
  123. data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/plugin.js +182 -0
  124. data/app/assets/javascripts/esp-ckeditor/_source/plugins/fakeobjects/plugin.js +175 -0
  125. data/app/assets/javascripts/esp-ckeditor/_source/plugins/filebrowser/plugin.js +534 -0
  126. data/app/assets/javascripts/esp-ckeditor/_source/plugins/find/dialogs/find.js +915 -0
  127. data/app/assets/javascripts/esp-ckeditor/_source/plugins/find/plugin.js +47 -0
  128. data/app/assets/javascripts/esp-ckeditor/_source/plugins/floatpanel/plugin.js +428 -0
  129. data/app/assets/javascripts/esp-ckeditor/_source/plugins/format/plugin.js +197 -0
  130. data/app/assets/javascripts/esp-ckeditor/_source/plugins/htmldataprocessor/plugin.js +596 -0
  131. data/app/assets/javascripts/esp-ckeditor/_source/plugins/htmlwriter/plugin.js +319 -0
  132. data/app/assets/javascripts/esp-ckeditor/_source/plugins/image/dialogs/image.js +1407 -0
  133. data/app/assets/javascripts/esp-ckeditor/_source/plugins/image/plugin.js +81 -0
  134. data/app/assets/javascripts/esp-ckeditor/_source/plugins/indent/plugin.js +461 -0
  135. data/app/assets/javascripts/esp-ckeditor/_source/plugins/justify/plugin.js +253 -0
  136. data/app/assets/javascripts/esp-ckeditor/_source/plugins/keystrokes/plugin.js +225 -0
  137. data/app/assets/javascripts/esp-ckeditor/_source/plugins/list/plugin.js +774 -0
  138. data/app/assets/javascripts/esp-ckeditor/_source/plugins/listblock/plugin.js +266 -0
  139. data/app/assets/javascripts/esp-ckeditor/_source/plugins/liststyle/dialogs/liststyle.js +225 -0
  140. data/app/assets/javascripts/esp-ckeditor/_source/plugins/liststyle/plugin.js +66 -0
  141. data/app/assets/javascripts/esp-ckeditor/_source/plugins/maximize/plugin.js +353 -0
  142. data/app/assets/javascripts/esp-ckeditor/_source/plugins/menu/plugin.js +541 -0
  143. data/app/assets/javascripts/esp-ckeditor/_source/plugins/panel/plugin.js +400 -0
  144. data/app/assets/javascripts/esp-ckeditor/_source/plugins/pastefromword/filter/default.js +1367 -0
  145. data/app/assets/javascripts/esp-ckeditor/_source/plugins/pastefromword/plugin.js +141 -0
  146. data/app/assets/javascripts/esp-ckeditor/_source/plugins/pastetext/dialogs/pastetext.js +67 -0
  147. data/app/assets/javascripts/esp-ckeditor/_source/plugins/pastetext/plugin.js +98 -0
  148. data/app/assets/javascripts/esp-ckeditor/_source/plugins/popup/plugin.js +64 -0
  149. data/app/assets/javascripts/esp-ckeditor/_source/plugins/removeformat/plugin.js +185 -0
  150. data/app/assets/javascripts/esp-ckeditor/_source/plugins/resize/plugin.js +168 -0
  151. data/app/assets/javascripts/esp-ckeditor/_source/plugins/richcombo/plugin.js +381 -0
  152. data/app/assets/javascripts/esp-ckeditor/_source/plugins/selection/plugin.js +1729 -0
  153. data/app/assets/javascripts/esp-ckeditor/_source/plugins/showborders/plugin.js +207 -0
  154. data/app/assets/javascripts/esp-ckeditor/_source/plugins/sourcearea/plugin.js +209 -0
  155. data/app/assets/javascripts/esp-ckeditor/_source/plugins/styles/plugin.js +1700 -0
  156. data/app/assets/javascripts/esp-ckeditor/_source/plugins/styles/styles/default.js +88 -0
  157. data/app/assets/javascripts/esp-ckeditor/_source/plugins/stylescombo/plugin.js +218 -0
  158. data/app/assets/javascripts/esp-ckeditor/_source/plugins/tab/plugin.js +367 -0
  159. data/app/assets/javascripts/esp-ckeditor/_source/plugins/table/dialogs/table.js +623 -0
  160. data/app/assets/javascripts/esp-ckeditor/_source/plugins/table/plugin.js +78 -0
  161. data/app/assets/javascripts/esp-ckeditor/_source/plugins/tabletools/dialogs/tableCell.js +525 -0
  162. data/app/assets/javascripts/esp-ckeditor/_source/plugins/tabletools/plugin.js +1194 -0
  163. data/app/assets/javascripts/esp-ckeditor/_source/plugins/toolbar/plugin.js +545 -0
  164. data/app/assets/javascripts/esp-ckeditor/_source/plugins/undo/plugin.js +578 -0
  165. data/app/assets/javascripts/esp-ckeditor/_source/plugins/wysiwygarea/plugin.js +1347 -0
  166. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/dialog.css +988 -0
  167. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/editor.css +25 -0
  168. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/elementspath.css +73 -0
  169. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/icons.css +367 -0
  170. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/icons.png +0 -0
  171. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/icons_rtl.png +0 -0
  172. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/dialog_sides.gif +0 -0
  173. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/dialog_sides.png +0 -0
  174. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/dialog_sides_rtl.png +0 -0
  175. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/mini.gif +0 -0
  176. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/noimage.png +0 -0
  177. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/sprites.png +0 -0
  178. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/sprites_ie6.png +0 -0
  179. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/toolbar_start.gif +0 -0
  180. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/mainui.css +209 -0
  181. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/menu.css +232 -0
  182. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/panel.css +227 -0
  183. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/presets.css +49 -0
  184. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/reset.css +85 -0
  185. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/richcombo.css +287 -0
  186. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/skin.js +236 -0
  187. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/templates.css +88 -0
  188. data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/toolbar.css +412 -0
  189. data/app/assets/javascripts/esp-ckeditor/_source/themes/default/theme.js +407 -0
  190. data/app/assets/javascripts/esp-ckeditor/application.js +8 -0
  191. data/app/assets/javascripts/esp-ckeditor/ckeditor.js +137 -0
  192. data/app/assets/javascripts/esp-ckeditor/ckeditor.pack +194 -0
  193. data/app/assets/javascripts/esp-ckeditor/ckeditor_source.js +35 -0
  194. data/app/assets/javascripts/esp-ckeditor/ckpackager.jar +0 -0
  195. data/app/assets/javascripts/esp-ckeditor/ckpackager.txt +2 -0
  196. data/app/assets/javascripts/esp-ckeditor/config.js +147 -0
  197. data/app/assets/javascripts/esp-ckeditor/contents.css +38 -0
  198. data/app/assets/javascripts/esp-ckeditor/images/spacer.gif +0 -0
  199. data/app/assets/javascripts/esp-ckeditor/init_ckeditor.js +1 -0
  200. data/app/assets/javascripts/esp-ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +1 -0
  201. data/app/assets/javascripts/esp-ckeditor/plugins/a11yhelp/lang/en.js +1 -0
  202. data/app/assets/javascripts/esp-ckeditor/plugins/a11yhelp/lang/he.js +1 -0
  203. data/app/assets/javascripts/esp-ckeditor/plugins/a11yhelp/plugin.js +1 -0
  204. data/app/assets/javascripts/esp-ckeditor/plugins/basicstyles/plugin.js +1 -0
  205. data/app/assets/javascripts/esp-ckeditor/plugins/button/plugin.js +1 -0
  206. data/app/assets/javascripts/esp-ckeditor/plugins/clipboard/dialogs/paste.js +1 -0
  207. data/app/assets/javascripts/esp-ckeditor/plugins/clipboard/plugin.js +1 -0
  208. data/app/assets/javascripts/esp-ckeditor/plugins/contextmenu/plugin.js +1 -0
  209. data/app/assets/javascripts/esp-ckeditor/plugins/dialog/dialogDefinition.js +0 -0
  210. data/app/assets/javascripts/esp-ckeditor/plugins/dialog/plugin.js +1 -0
  211. data/app/assets/javascripts/esp-ckeditor/plugins/dialogadvtab/plugin.js +1 -0
  212. data/app/assets/javascripts/esp-ckeditor/plugins/dialogui/plugin.js +1 -0
  213. data/app/assets/javascripts/esp-ckeditor/plugins/domiterator/plugin.js +1 -0
  214. data/app/assets/javascripts/esp-ckeditor/plugins/editingblock/plugin.js +1 -0
  215. data/app/assets/javascripts/esp-ckeditor/plugins/elementspath/plugin.js +1 -0
  216. data/app/assets/javascripts/esp-ckeditor/plugins/enterkey/plugin.js +1 -0
  217. data/app/assets/javascripts/esp-ckeditor/plugins/entities/plugin.js +1 -0
  218. data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/dialogs/esp_attachment.js +1 -0
  219. data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/images/esp_attachment.png +0 -0
  220. data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/lang/en.js +1 -0
  221. data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/lang/ru.js +1 -0
  222. data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/lang/uk.js +1 -0
  223. data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/plugin.js +1 -0
  224. data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/dialogs/esp_audio.js +1 -0
  225. data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/images/esp_audio.png +0 -0
  226. data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/images/placeholder.png +0 -0
  227. data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/lang/en.js +1 -0
  228. data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/lang/ru.js +1 -0
  229. data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/lang/uk.js +1 -0
  230. data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/plugin.js +1 -0
  231. data/app/assets/javascripts/esp-ckeditor/plugins/esp_blockquote/dialogs/esp_blockquote.js +1 -0
  232. data/app/assets/javascripts/esp-ckeditor/plugins/esp_blockquote/plugin.js +1 -0
  233. data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/dialogs/esp_image.js +1 -0
  234. data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/images/esp_image.png +0 -0
  235. data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/lang/en.js +1 -0
  236. data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/lang/ru.js +1 -0
  237. data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/lang/uk.js +1 -0
  238. data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/plugin.js +1 -0
  239. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/dialogs/esp_anchor.js +1 -0
  240. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/dialogs/esp_link.js +1 -0
  241. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/images/anchor.png +0 -0
  242. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/images/esp_anchor.png +0 -0
  243. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/images/esp_link.png +0 -0
  244. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/images/esp_unlink.png +0 -0
  245. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/lang/en.js +1 -0
  246. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/lang/ru.js +1 -0
  247. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/lang/uk.js +1 -0
  248. data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/plugin.js +1 -0
  249. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_address.png +0 -0
  250. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_blockquote.png +0 -0
  251. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_div.png +0 -0
  252. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h1.png +0 -0
  253. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h2.png +0 -0
  254. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h3.png +0 -0
  255. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h4.png +0 -0
  256. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h5.png +0 -0
  257. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h6.png +0 -0
  258. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_p.png +0 -0
  259. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_pre.png +0 -0
  260. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/esp_showblocks.png +0 -0
  261. data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/plugin.js +1 -0
  262. data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/dialogs/esp_video.js +1 -0
  263. data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/images/esp_video.png +0 -0
  264. data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/images/placeholder.png +0 -0
  265. data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/lang/en.js +1 -0
  266. data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/lang/ru.js +1 -0
  267. data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/lang/uk.js +1 -0
  268. data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/plugin.js +1 -0
  269. data/app/assets/javascripts/esp-ckeditor/plugins/fakeobjects/plugin.js +1 -0
  270. data/app/assets/javascripts/esp-ckeditor/plugins/filebrowser/plugin.js +1 -0
  271. data/app/assets/javascripts/esp-ckeditor/plugins/find/dialogs/find.js +1 -0
  272. data/app/assets/javascripts/esp-ckeditor/plugins/find/plugin.js +1 -0
  273. data/app/assets/javascripts/esp-ckeditor/plugins/floatpanel/plugin.js +1 -0
  274. data/app/assets/javascripts/esp-ckeditor/plugins/format/plugin.js +1 -0
  275. data/app/assets/javascripts/esp-ckeditor/plugins/htmldataprocessor/plugin.js +1 -0
  276. data/app/assets/javascripts/esp-ckeditor/plugins/htmlwriter/plugin.js +1 -0
  277. data/app/assets/javascripts/esp-ckeditor/plugins/image/dialogs/image.js +1 -0
  278. data/app/assets/javascripts/esp-ckeditor/plugins/image/plugin.js +1 -0
  279. data/app/assets/javascripts/esp-ckeditor/plugins/indent/plugin.js +1 -0
  280. data/app/assets/javascripts/esp-ckeditor/plugins/justify/plugin.js +1 -0
  281. data/app/assets/javascripts/esp-ckeditor/plugins/keystrokes/plugin.js +1 -0
  282. data/app/assets/javascripts/esp-ckeditor/plugins/list/plugin.js +1 -0
  283. data/app/assets/javascripts/esp-ckeditor/plugins/listblock/plugin.js +1 -0
  284. data/app/assets/javascripts/esp-ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -0
  285. data/app/assets/javascripts/esp-ckeditor/plugins/liststyle/plugin.js +1 -0
  286. data/app/assets/javascripts/esp-ckeditor/plugins/maximize/plugin.js +1 -0
  287. data/app/assets/javascripts/esp-ckeditor/plugins/menu/plugin.js +1 -0
  288. data/app/assets/javascripts/esp-ckeditor/plugins/panel/plugin.js +1 -0
  289. data/app/assets/javascripts/esp-ckeditor/plugins/pastefromword/filter/default.js +1 -0
  290. data/app/assets/javascripts/esp-ckeditor/plugins/pastefromword/plugin.js +1 -0
  291. data/app/assets/javascripts/esp-ckeditor/plugins/pastetext/dialogs/pastetext.js +1 -0
  292. data/app/assets/javascripts/esp-ckeditor/plugins/pastetext/plugin.js +1 -0
  293. data/app/assets/javascripts/esp-ckeditor/plugins/popup/plugin.js +1 -0
  294. data/app/assets/javascripts/esp-ckeditor/plugins/removeformat/plugin.js +1 -0
  295. data/app/assets/javascripts/esp-ckeditor/plugins/resize/plugin.js +1 -0
  296. data/app/assets/javascripts/esp-ckeditor/plugins/richcombo/plugin.js +1 -0
  297. data/app/assets/javascripts/esp-ckeditor/plugins/selection/plugin.js +1 -0
  298. data/app/assets/javascripts/esp-ckeditor/plugins/showborders/plugin.js +1 -0
  299. data/app/assets/javascripts/esp-ckeditor/plugins/sourcearea/plugin.js +1 -0
  300. data/app/assets/javascripts/esp-ckeditor/plugins/styles/plugin.js +1 -0
  301. data/app/assets/javascripts/esp-ckeditor/plugins/styles/styles/default.js +1 -0
  302. data/app/assets/javascripts/esp-ckeditor/plugins/stylescombo/plugin.js +1 -0
  303. data/app/assets/javascripts/esp-ckeditor/plugins/tab/plugin.js +1 -0
  304. data/app/assets/javascripts/esp-ckeditor/plugins/table/dialogs/table.js +1 -0
  305. data/app/assets/javascripts/esp-ckeditor/plugins/table/plugin.js +1 -0
  306. data/app/assets/javascripts/esp-ckeditor/plugins/tabletools/dialogs/tableCell.js +1 -0
  307. data/app/assets/javascripts/esp-ckeditor/plugins/tabletools/plugin.js +1 -0
  308. data/app/assets/javascripts/esp-ckeditor/plugins/toolbar/plugin.js +1 -0
  309. data/app/assets/javascripts/esp-ckeditor/plugins/undo/plugin.js +1 -0
  310. data/app/assets/javascripts/esp-ckeditor/plugins/wysiwygarea/plugin.js +1 -0
  311. data/app/assets/javascripts/esp-ckeditor/skins/kama/dialog.css +988 -0
  312. data/app/assets/javascripts/esp-ckeditor/skins/kama/editor.css +25 -0
  313. data/app/assets/javascripts/esp-ckeditor/skins/kama/elementspath.css +73 -0
  314. data/app/assets/javascripts/esp-ckeditor/skins/kama/icons.css +367 -0
  315. data/app/assets/javascripts/esp-ckeditor/skins/kama/icons.png +0 -0
  316. data/app/assets/javascripts/esp-ckeditor/skins/kama/icons_rtl.png +0 -0
  317. data/app/assets/javascripts/esp-ckeditor/skins/kama/images/dialog_sides.gif +0 -0
  318. data/app/assets/javascripts/esp-ckeditor/skins/kama/images/dialog_sides.png +0 -0
  319. data/app/assets/javascripts/esp-ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
  320. data/app/assets/javascripts/esp-ckeditor/skins/kama/images/mini.gif +0 -0
  321. data/app/assets/javascripts/esp-ckeditor/skins/kama/images/noimage.png +0 -0
  322. data/app/assets/javascripts/esp-ckeditor/skins/kama/images/sprites.png +0 -0
  323. data/app/assets/javascripts/esp-ckeditor/skins/kama/images/sprites_ie6.png +0 -0
  324. data/app/assets/javascripts/esp-ckeditor/skins/kama/images/toolbar_start.gif +0 -0
  325. data/app/assets/javascripts/esp-ckeditor/skins/kama/mainui.css +209 -0
  326. data/app/assets/javascripts/esp-ckeditor/skins/kama/menu.css +232 -0
  327. data/app/assets/javascripts/esp-ckeditor/skins/kama/panel.css +227 -0
  328. data/app/assets/javascripts/esp-ckeditor/skins/kama/presets.css +49 -0
  329. data/app/assets/javascripts/esp-ckeditor/skins/kama/reset.css +85 -0
  330. data/app/assets/javascripts/esp-ckeditor/skins/kama/richcombo.css +287 -0
  331. data/app/assets/javascripts/esp-ckeditor/skins/kama/skin.js +236 -0
  332. data/app/assets/javascripts/esp-ckeditor/skins/kama/templates.css +88 -0
  333. data/app/assets/javascripts/esp-ckeditor/skins/kama/toolbar.css +412 -0
  334. data/app/inputs/ckeditor_input.rb +42 -0
  335. data/config/routes.rb +2 -0
  336. data/lib/esp-ckeditor/engine.rb +9 -0
  337. data/lib/esp-ckeditor/version.rb +3 -0
  338. data/lib/esp-ckeditor.rb +17 -0
  339. data/lib/tasks/esp-ckeditor_tasks.rake +4 -0
  340. metadata +434 -0
@@ -0,0 +1,9 @@
1
+ CKEDITOR.plugins.setLang('esp_image', 'en',
2
+ {
3
+ esp_image:
4
+ {
5
+ image: "Image",
6
+ browseServer: "Browse"
7
+ }
8
+ });
9
+
@@ -0,0 +1,9 @@
1
+ CKEDITOR.plugins.setLang('esp_image', 'ru',
2
+ {
3
+ esp_image:
4
+ {
5
+ image: "Изображение",
6
+ browseServer: "Выбор"
7
+ }
8
+ });
9
+
@@ -0,0 +1,9 @@
1
+ CKEDITOR.plugins.setLang('esp_image', 'uk',
2
+ {
3
+ esp_image:
4
+ {
5
+ image: "Зображення",
6
+ browseServer: "Вибір"
7
+ }
8
+ });
9
+
@@ -0,0 +1,80 @@
1
+ /*
2
+ Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ CKEDITOR.plugins.add( 'esp_image',
7
+ {
8
+ lang: ['en', 'ru', 'uk'],
9
+ init : function( editor )
10
+ {
11
+ var pluginName = 'esp_image';
12
+
13
+ // Register the dialog.
14
+ CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/esp_image.js' );
15
+
16
+ // Register the command.
17
+ editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) );
18
+
19
+ // Register the toolbar button.
20
+ editor.ui.addButton( 'Esp_image',
21
+ {
22
+ label : editor.lang.esp_image.image,
23
+ command : pluginName,
24
+ icon: this.path + "images/esp_image.png"
25
+ });
26
+
27
+ editor.on( 'doubleclick', function( evt )
28
+ {
29
+ var element = evt.data.element;
30
+
31
+ if ( element.is( 'img' ) && !element.data( 'cke-realelement' ) && !element.isReadOnly() )
32
+ evt.data.dialog = 'esp_image';
33
+ });
34
+
35
+ // If the "menu" plugin is loaded, register the menu items.
36
+ if ( editor.addMenuItems )
37
+ {
38
+ editor.addMenuItems(
39
+ {
40
+ esp_image :
41
+ {
42
+ label : editor.lang.esp_image.menu,
43
+ command : 'esp_image',
44
+ group : 'esp_image'
45
+ }
46
+ });
47
+ }
48
+
49
+ // If the "contextmenu" plugin is loaded, register the listeners.
50
+ if ( editor.contextMenu )
51
+ {
52
+ editor.contextMenu.addListener( function( element, selection )
53
+ {
54
+ if ( !element || !element.is( 'img' ) || element.data( 'cke-realelement' ) || element.isReadOnly() )
55
+ return null;
56
+
57
+ return { esp_image : CKEDITOR.TRISTATE_OFF };
58
+ });
59
+ }
60
+ }
61
+ } );
62
+
63
+ /**
64
+ * Whether to remove links when emptying the link URL field in the image dialog.
65
+ * @type Boolean
66
+ * @default true
67
+ * @example
68
+ * config.image_removeLinkByEmptyURL = false;
69
+ */
70
+ CKEDITOR.config.esp_image_removeLinkByEmptyURL = true;
71
+
72
+ /**
73
+ * Padding text to set off the image in preview area.
74
+ * @name CKEDITOR.config.image_previewText
75
+ * @type String
76
+ * @default "Lorem ipsum dolor..." placehoder text.
77
+ * @example
78
+ * config.image_previewText = CKEDITOR.tools.repeat( '___ ', 100 );
79
+ */
80
+
@@ -0,0 +1,145 @@
1
+ /*
2
+ Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ CKEDITOR.dialog.add( 'esp_anchor', function( editor )
7
+ {
8
+ // Function called in onShow to load selected element.
9
+ var loadElements = function( element )
10
+ {
11
+ this._.selectedElement = element;
12
+
13
+ var attributeValue = element.data( 'cke-saved-name' );
14
+ this.setValueOf( 'info','txtName', attributeValue || '' );
15
+ };
16
+
17
+ function createFakeAnchor( editor, anchor )
18
+ {
19
+ return editor.createFakeElement( anchor, 'cke_anchor', 'anchor' );
20
+ }
21
+
22
+ return {
23
+ title : editor.lang.anchor.title,
24
+ minWidth : 300,
25
+ minHeight : 60,
26
+ onOk : function()
27
+ {
28
+ var name = this.getValueOf( 'info', 'txtName' );
29
+ var attributes =
30
+ {
31
+ name : name,
32
+ 'data-cke-saved-name' : name
33
+ };
34
+
35
+ if ( this._.selectedElement )
36
+ {
37
+ if ( this._.selectedElement.data( 'cke-realelement' ) )
38
+ {
39
+ var newFake = createFakeAnchor( editor, editor.document.createElement( 'a', { attributes: attributes } ) );
40
+ newFake.replace( this._.selectedElement );
41
+ }
42
+ else
43
+ this._.selectedElement.setAttributes( attributes );
44
+ }
45
+ else
46
+ {
47
+ var sel = editor.getSelection(),
48
+ range = sel && sel.getRanges()[ 0 ];
49
+
50
+ // Empty anchor
51
+ if ( range.collapsed )
52
+ {
53
+ if ( CKEDITOR.plugins.link.synAnchorSelector )
54
+ attributes[ 'class' ] = 'cke_anchor_empty';
55
+
56
+ if ( CKEDITOR.plugins.link.emptyAnchorFix )
57
+ {
58
+ attributes[ 'contenteditable' ] = 'false';
59
+ attributes[ 'data-cke-editable' ] = 1;
60
+ }
61
+
62
+ var anchor = editor.document.createElement( 'a', { attributes: attributes } );
63
+
64
+ // Transform the anchor into a fake element for browsers that need it.
65
+ if ( CKEDITOR.plugins.link.fakeAnchor )
66
+ anchor = createFakeAnchor( editor, anchor );
67
+
68
+ range.insertNode( anchor );
69
+ }
70
+ else
71
+ {
72
+ if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
73
+ attributes['class'] = 'cke_anchor';
74
+
75
+ // Apply style.
76
+ var style = new CKEDITOR.style( { element : 'a', attributes : attributes } );
77
+ style.type = CKEDITOR.STYLE_INLINE;
78
+ style.apply( editor.document );
79
+ }
80
+ }
81
+ },
82
+
83
+ onHide : function()
84
+ {
85
+ delete this._.selectedElement;
86
+ },
87
+
88
+ onShow : function()
89
+ {
90
+ var selection = editor.getSelection(),
91
+ fullySelected = selection.getSelectedElement(),
92
+ partialSelected;
93
+
94
+ // Detect the anchor under selection.
95
+ if ( fullySelected )
96
+ {
97
+ if ( CKEDITOR.plugins.link.fakeAnchor )
98
+ {
99
+ var realElement = CKEDITOR.plugins.link.tryRestoreFakeAnchor( editor, fullySelected );
100
+ realElement && loadElements.call( this, realElement );
101
+ this._.selectedElement = fullySelected;
102
+ }
103
+ else if ( fullySelected.is( 'a' ) && fullySelected.hasAttribute( 'name' ) )
104
+ loadElements.call( this, fullySelected );
105
+ }
106
+ else
107
+ {
108
+ partialSelected = CKEDITOR.plugins.link.getSelectedLink( editor );
109
+ if ( partialSelected )
110
+ {
111
+ loadElements.call( this, partialSelected );
112
+ selection.selectElement( partialSelected );
113
+ }
114
+ }
115
+
116
+ this.getContentElement( 'info', 'txtName' ).focus();
117
+ },
118
+ contents : [
119
+ {
120
+ id : 'info',
121
+ label : editor.lang.anchor.title,
122
+ accessKey : 'I',
123
+ elements :
124
+ [
125
+ {
126
+ type : 'text',
127
+ id : 'txtName',
128
+ label : editor.lang.anchor.name,
129
+ required: true,
130
+ validate : function()
131
+ {
132
+ if ( !this.getValue() )
133
+ {
134
+ alert( editor.lang.anchor.errorName );
135
+ return false;
136
+ }
137
+ return true;
138
+ }
139
+ }
140
+ ]
141
+ }
142
+ ]
143
+ };
144
+ } );
145
+
@@ -0,0 +1,1396 @@
1
+ /*
2
+ Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ CKEDITOR.dialog.add( 'esp_link', function( editor )
7
+ {
8
+ var plugin = CKEDITOR.plugins.esp_link;
9
+ // Handles the event when the "Target" selection box is changed.
10
+ var targetChanged = function()
11
+ {
12
+ var dialog = this.getDialog(),
13
+ popupFeatures = dialog.getContentElement( 'target', 'popupFeatures' ),
14
+ targetName = dialog.getContentElement( 'target', 'linkTargetName' ),
15
+ value = this.getValue();
16
+
17
+ if ( !popupFeatures || !targetName )
18
+ return;
19
+
20
+ popupFeatures = popupFeatures.getElement();
21
+ popupFeatures.hide();
22
+ targetName.setValue( '' );
23
+
24
+ switch ( value )
25
+ {
26
+ case 'frame' :
27
+ targetName.setLabel( editor.lang.link.targetFrameName );
28
+ targetName.getElement().show();
29
+ break;
30
+ case 'popup' :
31
+ popupFeatures.show();
32
+ targetName.setLabel( editor.lang.link.targetPopupName );
33
+ targetName.getElement().show();
34
+ break;
35
+ default :
36
+ targetName.setValue( value );
37
+ targetName.getElement().hide();
38
+ break;
39
+ }
40
+
41
+ };
42
+
43
+ // Handles the event when the "Type" selection box is changed.
44
+ var linkTypeChanged = function()
45
+ {
46
+ var dialog = this.getDialog(),
47
+ partIds = [ 'urlOptions', 'anchorOptions', 'emailOptions' ],
48
+ typeValue = this.getValue();
49
+
50
+ if ( typeValue == 'url' )
51
+ {
52
+ if ( editor.config.linkShowTargetTab )
53
+ dialog.showPage( 'target' );
54
+ }
55
+ else
56
+ {
57
+ dialog.hidePage( 'target' );
58
+ }
59
+
60
+ for ( var i = 0 ; i < partIds.length ; i++ )
61
+ {
62
+ var element = dialog.getContentElement( 'info', partIds[i] );
63
+ if ( !element )
64
+ continue;
65
+
66
+ element = element.getElement().getParent().getParent();
67
+ if ( partIds[i] == typeValue + 'Options' )
68
+ element.show();
69
+ else
70
+ element.hide();
71
+ }
72
+
73
+ dialog.layout();
74
+ };
75
+
76
+ // Loads the parameters in a selected link to the link dialog fields.
77
+ var javascriptProtocolRegex = /^javascript:/,
78
+ emailRegex = /^mailto:([^?]+)(?:\?(.+))?$/,
79
+ emailSubjectRegex = /subject=([^;?:@&=$,\/]*)/,
80
+ emailBodyRegex = /body=([^;?:@&=$,\/]*)/,
81
+ anchorRegex = /^#(.*)$/,
82
+ urlRegex = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
83
+ selectableTargets = /^(_(?:self|top|parent|blank))$/,
84
+ encodedEmailLinkRegex = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
85
+ functionCallProtectedEmailLinkRegex = /^javascript:([^(]+)\(([^)]+)\)$/;
86
+
87
+ var popupRegex =
88
+ /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/;
89
+ var popupFeaturesRegex = /(?:^|,)([^=]+)=(\d+|yes|no)/gi;
90
+
91
+ var parseLink = function( editor, element )
92
+ {
93
+ var href = ( element && ( element.data( 'cke-saved-href' ) || element.getAttribute( 'href' ) ) ) || '',
94
+ javascriptMatch,
95
+ emailMatch,
96
+ anchorMatch,
97
+ urlMatch,
98
+ retval = {};
99
+
100
+ if ( ( javascriptMatch = href.match( javascriptProtocolRegex ) ) )
101
+ {
102
+ if ( emailProtection == 'encode' )
103
+ {
104
+ href = href.replace( encodedEmailLinkRegex,
105
+ function ( match, protectedAddress, rest )
106
+ {
107
+ return 'mailto:' +
108
+ String.fromCharCode.apply( String, protectedAddress.split( ',' ) ) +
109
+ ( rest && unescapeSingleQuote( rest ) );
110
+ });
111
+ }
112
+ // Protected email link as function call.
113
+ else if ( emailProtection )
114
+ {
115
+ href.replace( functionCallProtectedEmailLinkRegex, function( match, funcName, funcArgs )
116
+ {
117
+ if ( funcName == compiledProtectionFunction.name )
118
+ {
119
+ retval.type = 'email';
120
+ var email = retval.email = {};
121
+
122
+ var paramRegex = /[^,\s]+/g,
123
+ paramQuoteRegex = /(^')|('$)/g,
124
+ paramsMatch = funcArgs.match( paramRegex ),
125
+ paramsMatchLength = paramsMatch.length,
126
+ paramName,
127
+ paramVal;
128
+
129
+ for ( var i = 0; i < paramsMatchLength; i++ )
130
+ {
131
+ paramVal = decodeURIComponent( unescapeSingleQuote( paramsMatch[ i ].replace( paramQuoteRegex, '' ) ) );
132
+ paramName = compiledProtectionFunction.params[ i ].toLowerCase();
133
+ email[ paramName ] = paramVal;
134
+ }
135
+ email.address = [ email.name, email.domain ].join( '@' );
136
+ }
137
+ } );
138
+ }
139
+ }
140
+
141
+ if ( !retval.type )
142
+ {
143
+ if ( ( anchorMatch = href.match( anchorRegex ) ) )
144
+ {
145
+ retval.type = 'anchor';
146
+ retval.anchor = {};
147
+ retval.anchor.name = retval.anchor.id = anchorMatch[1];
148
+ }
149
+ // Protected email link as encoded string.
150
+ else if ( ( emailMatch = href.match( emailRegex ) ) )
151
+ {
152
+ var subjectMatch = href.match( emailSubjectRegex ),
153
+ bodyMatch = href.match( emailBodyRegex );
154
+
155
+ retval.type = 'email';
156
+ var email = ( retval.email = {} );
157
+ email.address = emailMatch[ 1 ];
158
+ subjectMatch && ( email.subject = decodeURIComponent( subjectMatch[ 1 ] ) );
159
+ bodyMatch && ( email.body = decodeURIComponent( bodyMatch[ 1 ] ) );
160
+ }
161
+ // urlRegex matches empty strings, so need to check for href as well.
162
+ else if ( href && ( urlMatch = href.match( urlRegex ) ) )
163
+ {
164
+ retval.type = 'url';
165
+ retval.url = {};
166
+ retval.url.protocol = urlMatch[1];
167
+ retval.url.url = urlMatch[2];
168
+ }
169
+ else
170
+ retval.type = 'url';
171
+ }
172
+
173
+ // Load target and popup settings.
174
+ if ( element )
175
+ {
176
+ var target = element.getAttribute( 'target' );
177
+ retval.target = {};
178
+ retval.adv = {};
179
+
180
+ // IE BUG: target attribute is an empty string instead of null in IE if it's not set.
181
+ if ( !target )
182
+ {
183
+ var onclick = element.data( 'cke-pa-onclick' ) || element.getAttribute( 'onclick' ),
184
+ onclickMatch = onclick && onclick.match( popupRegex );
185
+ if ( onclickMatch )
186
+ {
187
+ retval.target.type = 'popup';
188
+ retval.target.name = onclickMatch[1];
189
+
190
+ var featureMatch;
191
+ while ( ( featureMatch = popupFeaturesRegex.exec( onclickMatch[2] ) ) )
192
+ {
193
+ // Some values should remain numbers (#7300)
194
+ if ( ( featureMatch[2] == 'yes' || featureMatch[2] == '1' ) && !( featureMatch[1] in { height:1, width:1, top:1, left:1 } ) )
195
+ retval.target[ featureMatch[1] ] = true;
196
+ else if ( isFinite( featureMatch[2] ) )
197
+ retval.target[ featureMatch[1] ] = featureMatch[2];
198
+ }
199
+ }
200
+ }
201
+ else
202
+ {
203
+ var targetMatch = target.match( selectableTargets );
204
+ if ( targetMatch )
205
+ retval.target.type = retval.target.name = target;
206
+ else
207
+ {
208
+ retval.target.type = 'frame';
209
+ retval.target.name = target;
210
+ }
211
+ }
212
+
213
+ var me = this;
214
+ var advAttr = function( inputName, attrName )
215
+ {
216
+ var value = element.getAttribute( attrName );
217
+ if ( value !== null )
218
+ retval.adv[ inputName ] = value || '';
219
+ };
220
+ advAttr( 'advId', 'id' );
221
+ advAttr( 'advLangDir', 'dir' );
222
+ advAttr( 'advAccessKey', 'accessKey' );
223
+
224
+ retval.adv.advName =
225
+ element.data( 'cke-saved-name' )
226
+ || element.getAttribute( 'name' )
227
+ || '';
228
+ advAttr( 'advLangCode', 'lang' );
229
+ advAttr( 'advTabIndex', 'tabindex' );
230
+ advAttr( 'advTitle', 'title' );
231
+ advAttr( 'advContentType', 'type' );
232
+ CKEDITOR.plugins.esp_link.synAnchorSelector ?
233
+ retval.adv.advCSSClasses = getLinkClass( element )
234
+ : advAttr( 'advCSSClasses', 'class' );
235
+ advAttr( 'advCharset', 'charset' );
236
+ advAttr( 'advStyles', 'style' );
237
+ advAttr( 'advRel', 'rel' );
238
+ }
239
+
240
+ // Find out whether we have any anchors in the editor.
241
+ var anchors = retval.anchors = [],
242
+ item;
243
+
244
+ // For some browsers we set contenteditable="false" on anchors, making document.anchors not to include them, so we must traverse the links manually (#7893).
245
+ if ( CKEDITOR.plugins.esp_link.emptyAnchorFix )
246
+ {
247
+ var links = editor.document.getElementsByTag( 'a' );
248
+ for ( i = 0, count = links.count(); i < count; i++ )
249
+ {
250
+ item = links.getItem( i );
251
+ if ( item.data( 'cke-saved-name' ) || item.hasAttribute( 'name' ) )
252
+ anchors.push( { name : item.data( 'cke-saved-name' ) || item.getAttribute( 'name' ), id : item.getAttribute( 'id' ) } );
253
+ }
254
+ }
255
+ else
256
+ {
257
+ var anchorList = new CKEDITOR.dom.nodeList( editor.document.$.anchors );
258
+ for ( var i = 0, count = anchorList.count(); i < count; i++ )
259
+ {
260
+ item = anchorList.getItem( i );
261
+ anchors[ i ] = { name : item.getAttribute( 'name' ), id : item.getAttribute( 'id' ) };
262
+ }
263
+ }
264
+
265
+ if ( CKEDITOR.plugins.esp_link.fakeAnchor )
266
+ {
267
+ var imgs = editor.document.getElementsByTag( 'img' );
268
+ for ( i = 0, count = imgs.count(); i < count; i++ )
269
+ {
270
+ if ( ( item = CKEDITOR.plugins.esp_link.tryRestoreFakeAnchor( editor, imgs.getItem( i ) ) ) )
271
+ anchors.push( { name : item.getAttribute( 'name' ), id : item.getAttribute( 'id' ) } );
272
+ }
273
+ }
274
+
275
+ // Record down the selected element in the dialog.
276
+ this._.selectedElement = element;
277
+ return retval;
278
+ };
279
+
280
+ var setupParams = function( page, data )
281
+ {
282
+ if ( data[page] )
283
+ this.setValue( data[page][this.id] || '' );
284
+ };
285
+
286
+ var setupPopupParams = function( data )
287
+ {
288
+ return setupParams.call( this, 'target', data );
289
+ };
290
+
291
+ var setupAdvParams = function( data )
292
+ {
293
+ return setupParams.call( this, 'adv', data );
294
+ };
295
+
296
+ var commitParams = function( page, data )
297
+ {
298
+ if ( !data[page] )
299
+ data[page] = {};
300
+
301
+ data[page][this.id] = this.getValue() || '';
302
+ };
303
+
304
+ var commitPopupParams = function( data )
305
+ {
306
+ return commitParams.call( this, 'target', data );
307
+ };
308
+
309
+ var commitAdvParams = function( data )
310
+ {
311
+ return commitParams.call( this, 'adv', data );
312
+ };
313
+
314
+ function unescapeSingleQuote( str )
315
+ {
316
+ return str.replace( /\\'/g, '\'' );
317
+ }
318
+
319
+ function escapeSingleQuote( str )
320
+ {
321
+ return str.replace( /'/g, '\\$&' );
322
+ }
323
+
324
+ var emailProtection = editor.config.emailProtection || '';
325
+
326
+ // Compile the protection function pattern.
327
+ if ( emailProtection && emailProtection != 'encode' )
328
+ {
329
+ var compiledProtectionFunction = {};
330
+
331
+ emailProtection.replace( /^([^(]+)\(([^)]+)\)$/, function( match, funcName, params )
332
+ {
333
+ compiledProtectionFunction.name = funcName;
334
+ compiledProtectionFunction.params = [];
335
+ params.replace( /[^,\s]+/g, function( param )
336
+ {
337
+ compiledProtectionFunction.params.push( param );
338
+ } );
339
+ } );
340
+ }
341
+
342
+ function protectEmailLinkAsFunction( email )
343
+ {
344
+ var retval,
345
+ name = compiledProtectionFunction.name,
346
+ params = compiledProtectionFunction.params,
347
+ paramName,
348
+ paramValue;
349
+
350
+ retval = [ name, '(' ];
351
+ for ( var i = 0; i < params.length; i++ )
352
+ {
353
+ paramName = params[ i ].toLowerCase();
354
+ paramValue = email[ paramName ];
355
+
356
+ i > 0 && retval.push( ',' );
357
+ retval.push( '\'',
358
+ paramValue ?
359
+ escapeSingleQuote( encodeURIComponent( email[ paramName ] ) )
360
+ : '',
361
+ '\'');
362
+ }
363
+ retval.push( ')' );
364
+ return retval.join( '' );
365
+ }
366
+
367
+ function protectEmailAddressAsEncodedString( address )
368
+ {
369
+ var charCode,
370
+ length = address.length,
371
+ encodedChars = [];
372
+ for ( var i = 0; i < length; i++ )
373
+ {
374
+ charCode = address.charCodeAt( i );
375
+ encodedChars.push( charCode );
376
+ }
377
+ return 'String.fromCharCode(' + encodedChars.join( ',' ) + ')';
378
+ }
379
+
380
+ function getLinkClass( ele )
381
+ {
382
+ var className = ele.getAttribute( 'class' );
383
+ return className ? className.replace( /\s*(?:cke_anchor_empty|cke_anchor)(?:\s*$)?/g, '' ) : '';
384
+ }
385
+
386
+ var commonLang = editor.lang.common,
387
+ linkLang = editor.lang.link;
388
+
389
+ return {
390
+ title : linkLang.title,
391
+ minWidth : 350,
392
+ minHeight : 230,
393
+ contents : [
394
+ {
395
+ id : 'info',
396
+ label : linkLang.info,
397
+ title : linkLang.info,
398
+ elements :
399
+ [
400
+ {
401
+ id : 'linkType',
402
+ type : 'select',
403
+ label : linkLang.type,
404
+ 'default' : 'url',
405
+ items :
406
+ [
407
+ [ linkLang.toUrl, 'url' ],
408
+ [ linkLang.toAnchor, 'anchor' ],
409
+ [ linkLang.toEmail, 'email' ]
410
+ ],
411
+ onChange : linkTypeChanged,
412
+ setup : function( data )
413
+ {
414
+ if ( data.type )
415
+ this.setValue( data.type );
416
+ },
417
+ commit : function( data )
418
+ {
419
+ data.type = this.getValue();
420
+ }
421
+ },
422
+ {
423
+ type : 'vbox',
424
+ id : 'urlOptions',
425
+ children :
426
+ [
427
+ {
428
+ type : 'hbox',
429
+ widths : [ '25%', '75%' ],
430
+ children :
431
+ [
432
+ {
433
+ id : 'protocol',
434
+ type : 'select',
435
+ label : commonLang.protocol,
436
+ 'default' : 'http://',
437
+ items :
438
+ [
439
+ // Force 'ltr' for protocol names in BIDI. (#5433)
440
+ [ 'http://\u200E', 'http://' ],
441
+ [ 'https://\u200E', 'https://' ],
442
+ [ 'ftp://\u200E', 'ftp://' ],
443
+ [ 'news://\u200E', 'news://' ],
444
+ [ linkLang.other , '' ]
445
+ ],
446
+ setup : function( data )
447
+ {
448
+ if ( data.url )
449
+ this.setValue( data.url.protocol || '' );
450
+ },
451
+ commit : function( data )
452
+ {
453
+ if ( !data.url )
454
+ data.url = {};
455
+
456
+ data.url.protocol = this.getValue();
457
+ }
458
+ },
459
+ {
460
+ type : 'text',
461
+ id : 'url',
462
+ label : commonLang.url,
463
+ required: true,
464
+ onLoad : function ()
465
+ {
466
+ this.allowOnChange = true;
467
+ },
468
+ onKeyUp : function()
469
+ {
470
+ this.allowOnChange = false;
471
+ var protocolCmb = this.getDialog().getContentElement( 'info', 'protocol' ),
472
+ url = this.getValue(),
473
+ urlOnChangeProtocol = /^(http|https|ftp|news):\/\/(?=.)/i,
474
+ urlOnChangeTestOther = /^((javascript:)|[#\/\.\?])/i;
475
+
476
+ var protocol = urlOnChangeProtocol.exec( url );
477
+ if ( protocol )
478
+ {
479
+ this.setValue( url.substr( protocol[ 0 ].length ) );
480
+ protocolCmb.setValue( protocol[ 0 ].toLowerCase() );
481
+ }
482
+ else if ( urlOnChangeTestOther.test( url ) )
483
+ protocolCmb.setValue( '' );
484
+
485
+ this.allowOnChange = true;
486
+ },
487
+ onChange : function()
488
+ {
489
+ if ( this.allowOnChange ) // Dont't call on dialog load.
490
+ this.onKeyUp();
491
+ },
492
+ validate : function()
493
+ {
494
+ var dialog = this.getDialog();
495
+
496
+ if ( dialog.getContentElement( 'info', 'linkType' ) &&
497
+ dialog.getValueOf( 'info', 'linkType' ) != 'url' )
498
+ return true;
499
+
500
+ if ( this.getDialog().fakeObj ) // Edit Anchor.
501
+ return true;
502
+
503
+ var func = CKEDITOR.dialog.validate.notEmpty( linkLang.noUrl );
504
+ return func.apply( this );
505
+ },
506
+ setup : function( data )
507
+ {
508
+ this.allowOnChange = false;
509
+ if ( data.url )
510
+ this.setValue( data.url.url );
511
+ this.allowOnChange = true;
512
+
513
+ },
514
+ commit : function( data )
515
+ {
516
+ // IE will not trigger the onChange event if the mouse has been used
517
+ // to carry all the operations #4724
518
+ this.onChange();
519
+
520
+ if ( !data.url )
521
+ data.url = {};
522
+
523
+ data.url.url = this.getValue();
524
+ this.allowOnChange = false;
525
+ }
526
+ }
527
+ ],
528
+ setup : function( data )
529
+ {
530
+ if ( !this.getDialog().getContentElement( 'info', 'linkType' ) )
531
+ this.getElement().show();
532
+ }
533
+ },
534
+ {
535
+ type : 'button',
536
+ id : 'browse',
537
+ hidden : 'true',
538
+ filebrowser : 'info:url',
539
+ label : editor.lang.esp_link.browseServer
540
+ }
541
+ ]
542
+ },
543
+ {
544
+ type : 'vbox',
545
+ id : 'anchorOptions',
546
+ width : 260,
547
+ align : 'center',
548
+ padding : 0,
549
+ children :
550
+ [
551
+ {
552
+ type : 'fieldset',
553
+ id : 'selectAnchorText',
554
+ label : linkLang.selectAnchor,
555
+ setup : function( data )
556
+ {
557
+ if ( data.anchors.length > 0 )
558
+ this.getElement().show();
559
+ else
560
+ this.getElement().hide();
561
+ },
562
+ children :
563
+ [
564
+ {
565
+ type : 'hbox',
566
+ id : 'selectAnchor',
567
+ children :
568
+ [
569
+ {
570
+ type : 'select',
571
+ id : 'anchorName',
572
+ 'default' : '',
573
+ label : linkLang.anchorName,
574
+ style : 'width: 100%;',
575
+ items :
576
+ [
577
+ [ '' ]
578
+ ],
579
+ setup : function( data )
580
+ {
581
+ this.clear();
582
+ this.add( '' );
583
+ for ( var i = 0 ; i < data.anchors.length ; i++ )
584
+ {
585
+ if ( data.anchors[i].name )
586
+ this.add( data.anchors[i].name );
587
+ }
588
+
589
+ if ( data.anchor )
590
+ this.setValue( data.anchor.name );
591
+
592
+ var linkType = this.getDialog().getContentElement( 'info', 'linkType' );
593
+ if ( linkType && linkType.getValue() == 'email' )
594
+ this.focus();
595
+ },
596
+ commit : function( data )
597
+ {
598
+ if ( !data.anchor )
599
+ data.anchor = {};
600
+
601
+ data.anchor.name = this.getValue();
602
+ }
603
+ },
604
+ {
605
+ type : 'select',
606
+ id : 'anchorId',
607
+ 'default' : '',
608
+ label : linkLang.anchorId,
609
+ style : 'width: 100%;',
610
+ items :
611
+ [
612
+ [ '' ]
613
+ ],
614
+ setup : function( data )
615
+ {
616
+ this.clear();
617
+ this.add( '' );
618
+ for ( var i = 0 ; i < data.anchors.length ; i++ )
619
+ {
620
+ if ( data.anchors[i].id )
621
+ this.add( data.anchors[i].id );
622
+ }
623
+
624
+ if ( data.anchor )
625
+ this.setValue( data.anchor.id );
626
+ },
627
+ commit : function( data )
628
+ {
629
+ if ( !data.anchor )
630
+ data.anchor = {};
631
+
632
+ data.anchor.id = this.getValue();
633
+ }
634
+ }
635
+ ],
636
+ setup : function( data )
637
+ {
638
+ if ( data.anchors.length > 0 )
639
+ this.getElement().show();
640
+ else
641
+ this.getElement().hide();
642
+ }
643
+ }
644
+ ]
645
+ },
646
+ {
647
+ type : 'html',
648
+ id : 'noAnchors',
649
+ style : 'text-align: center;',
650
+ html : '<div role="label" tabIndex="-1">' + CKEDITOR.tools.htmlEncode( linkLang.noAnchors ) + '</div>',
651
+ // Focus the first element defined in above html.
652
+ focus : true,
653
+ setup : function( data )
654
+ {
655
+ if ( data.anchors.length < 1 )
656
+ this.getElement().show();
657
+ else
658
+ this.getElement().hide();
659
+ }
660
+ }
661
+ ],
662
+ setup : function( data )
663
+ {
664
+ if ( !this.getDialog().getContentElement( 'info', 'linkType' ) )
665
+ this.getElement().hide();
666
+ }
667
+ },
668
+ {
669
+ type : 'vbox',
670
+ id : 'emailOptions',
671
+ padding : 1,
672
+ children :
673
+ [
674
+ {
675
+ type : 'text',
676
+ id : 'emailAddress',
677
+ label : linkLang.emailAddress,
678
+ required : true,
679
+ validate : function()
680
+ {
681
+ var dialog = this.getDialog();
682
+
683
+ if ( !dialog.getContentElement( 'info', 'linkType' ) ||
684
+ dialog.getValueOf( 'info', 'linkType' ) != 'email' )
685
+ return true;
686
+
687
+ var func = CKEDITOR.dialog.validate.notEmpty( linkLang.noEmail );
688
+ return func.apply( this );
689
+ },
690
+ setup : function( data )
691
+ {
692
+ if ( data.email )
693
+ this.setValue( data.email.address );
694
+
695
+ var linkType = this.getDialog().getContentElement( 'info', 'linkType' );
696
+ if ( linkType && linkType.getValue() == 'email' )
697
+ this.select();
698
+ },
699
+ commit : function( data )
700
+ {
701
+ if ( !data.email )
702
+ data.email = {};
703
+
704
+ data.email.address = this.getValue();
705
+ }
706
+ },
707
+ {
708
+ type : 'text',
709
+ id : 'emailSubject',
710
+ label : linkLang.emailSubject,
711
+ setup : function( data )
712
+ {
713
+ if ( data.email )
714
+ this.setValue( data.email.subject );
715
+ },
716
+ commit : function( data )
717
+ {
718
+ if ( !data.email )
719
+ data.email = {};
720
+
721
+ data.email.subject = this.getValue();
722
+ }
723
+ },
724
+ {
725
+ type : 'textarea',
726
+ id : 'emailBody',
727
+ label : linkLang.emailBody,
728
+ rows : 3,
729
+ 'default' : '',
730
+ setup : function( data )
731
+ {
732
+ if ( data.email )
733
+ this.setValue( data.email.body );
734
+ },
735
+ commit : function( data )
736
+ {
737
+ if ( !data.email )
738
+ data.email = {};
739
+
740
+ data.email.body = this.getValue();
741
+ }
742
+ }
743
+ ],
744
+ setup : function( data )
745
+ {
746
+ if ( !this.getDialog().getContentElement( 'info', 'linkType' ) )
747
+ this.getElement().hide();
748
+ }
749
+ }
750
+ ]
751
+ },
752
+ {
753
+ id : 'target',
754
+ label : linkLang.target,
755
+ title : linkLang.target,
756
+ elements :
757
+ [
758
+ {
759
+ type : 'hbox',
760
+ widths : [ '50%', '50%' ],
761
+ children :
762
+ [
763
+ {
764
+ type : 'select',
765
+ id : 'linkTargetType',
766
+ label : commonLang.target,
767
+ 'default' : 'notSet',
768
+ style : 'width : 100%;',
769
+ 'items' :
770
+ [
771
+ [ commonLang.notSet, 'notSet' ],
772
+ [ linkLang.targetFrame, 'frame' ],
773
+ [ linkLang.targetPopup, 'popup' ],
774
+ [ commonLang.targetNew, '_blank' ],
775
+ [ commonLang.targetTop, '_top' ],
776
+ [ commonLang.targetSelf, '_self' ],
777
+ [ commonLang.targetParent, '_parent' ]
778
+ ],
779
+ onChange : targetChanged,
780
+ setup : function( data )
781
+ {
782
+ if ( data.target )
783
+ this.setValue( data.target.type || 'notSet' );
784
+ targetChanged.call( this );
785
+ },
786
+ commit : function( data )
787
+ {
788
+ if ( !data.target )
789
+ data.target = {};
790
+
791
+ data.target.type = this.getValue();
792
+ }
793
+ },
794
+ {
795
+ type : 'text',
796
+ id : 'linkTargetName',
797
+ label : linkLang.targetFrameName,
798
+ 'default' : '',
799
+ setup : function( data )
800
+ {
801
+ if ( data.target )
802
+ this.setValue( data.target.name );
803
+ },
804
+ commit : function( data )
805
+ {
806
+ if ( !data.target )
807
+ data.target = {};
808
+
809
+ data.target.name = this.getValue().replace(/\W/gi, '');
810
+ }
811
+ }
812
+ ]
813
+ },
814
+ {
815
+ type : 'vbox',
816
+ width : '100%',
817
+ align : 'center',
818
+ padding : 2,
819
+ id : 'popupFeatures',
820
+ children :
821
+ [
822
+ {
823
+ type : 'fieldset',
824
+ label : linkLang.popupFeatures,
825
+ children :
826
+ [
827
+ {
828
+ type : 'hbox',
829
+ children :
830
+ [
831
+ {
832
+ type : 'checkbox',
833
+ id : 'resizable',
834
+ label : linkLang.popupResizable,
835
+ setup : setupPopupParams,
836
+ commit : commitPopupParams
837
+ },
838
+ {
839
+ type : 'checkbox',
840
+ id : 'status',
841
+ label : linkLang.popupStatusBar,
842
+ setup : setupPopupParams,
843
+ commit : commitPopupParams
844
+
845
+ }
846
+ ]
847
+ },
848
+ {
849
+ type : 'hbox',
850
+ children :
851
+ [
852
+ {
853
+ type : 'checkbox',
854
+ id : 'location',
855
+ label : linkLang.popupLocationBar,
856
+ setup : setupPopupParams,
857
+ commit : commitPopupParams
858
+
859
+ },
860
+ {
861
+ type : 'checkbox',
862
+ id : 'toolbar',
863
+ label : linkLang.popupToolbar,
864
+ setup : setupPopupParams,
865
+ commit : commitPopupParams
866
+
867
+ }
868
+ ]
869
+ },
870
+ {
871
+ type : 'hbox',
872
+ children :
873
+ [
874
+ {
875
+ type : 'checkbox',
876
+ id : 'menubar',
877
+ label : linkLang.popupMenuBar,
878
+ setup : setupPopupParams,
879
+ commit : commitPopupParams
880
+
881
+ },
882
+ {
883
+ type : 'checkbox',
884
+ id : 'fullscreen',
885
+ label : linkLang.popupFullScreen,
886
+ setup : setupPopupParams,
887
+ commit : commitPopupParams
888
+
889
+ }
890
+ ]
891
+ },
892
+ {
893
+ type : 'hbox',
894
+ children :
895
+ [
896
+ {
897
+ type : 'checkbox',
898
+ id : 'scrollbars',
899
+ label : linkLang.popupScrollBars,
900
+ setup : setupPopupParams,
901
+ commit : commitPopupParams
902
+
903
+ },
904
+ {
905
+ type : 'checkbox',
906
+ id : 'dependent',
907
+ label : linkLang.popupDependent,
908
+ setup : setupPopupParams,
909
+ commit : commitPopupParams
910
+
911
+ }
912
+ ]
913
+ },
914
+ {
915
+ type : 'hbox',
916
+ children :
917
+ [
918
+ {
919
+ type : 'text',
920
+ widths : [ '50%', '50%' ],
921
+ labelLayout : 'horizontal',
922
+ label : commonLang.width,
923
+ id : 'width',
924
+ setup : setupPopupParams,
925
+ commit : commitPopupParams
926
+
927
+ },
928
+ {
929
+ type : 'text',
930
+ labelLayout : 'horizontal',
931
+ widths : [ '50%', '50%' ],
932
+ label : linkLang.popupLeft,
933
+ id : 'left',
934
+ setup : setupPopupParams,
935
+ commit : commitPopupParams
936
+
937
+ }
938
+ ]
939
+ },
940
+ {
941
+ type : 'hbox',
942
+ children :
943
+ [
944
+ {
945
+ type : 'text',
946
+ labelLayout : 'horizontal',
947
+ widths : [ '50%', '50%' ],
948
+ label : commonLang.height,
949
+ id : 'height',
950
+ setup : setupPopupParams,
951
+ commit : commitPopupParams
952
+
953
+ },
954
+ {
955
+ type : 'text',
956
+ labelLayout : 'horizontal',
957
+ label : linkLang.popupTop,
958
+ widths : [ '50%', '50%' ],
959
+ id : 'top',
960
+ setup : setupPopupParams,
961
+ commit : commitPopupParams
962
+
963
+ }
964
+ ]
965
+ }
966
+ ]
967
+ }
968
+ ]
969
+ }
970
+ ]
971
+ },
972
+ {
973
+ id : 'advanced',
974
+ label : linkLang.advanced,
975
+ title : linkLang.advanced,
976
+ elements :
977
+ [
978
+ {
979
+ type : 'vbox',
980
+ padding : 1,
981
+ children :
982
+ [
983
+ {
984
+ type : 'hbox',
985
+ widths : [ '45%', '35%', '20%' ],
986
+ children :
987
+ [
988
+ {
989
+ type : 'text',
990
+ id : 'advId',
991
+ label : linkLang.id,
992
+ setup : setupAdvParams,
993
+ commit : commitAdvParams
994
+ },
995
+ {
996
+ type : 'select',
997
+ id : 'advLangDir',
998
+ label : linkLang.langDir,
999
+ 'default' : '',
1000
+ style : 'width:110px',
1001
+ items :
1002
+ [
1003
+ [ commonLang.notSet, '' ],
1004
+ [ linkLang.langDirLTR, 'ltr' ],
1005
+ [ linkLang.langDirRTL, 'rtl' ]
1006
+ ],
1007
+ setup : setupAdvParams,
1008
+ commit : commitAdvParams
1009
+ },
1010
+ {
1011
+ type : 'text',
1012
+ id : 'advAccessKey',
1013
+ width : '80px',
1014
+ label : linkLang.acccessKey,
1015
+ maxLength : 1,
1016
+ setup : setupAdvParams,
1017
+ commit : commitAdvParams
1018
+
1019
+ }
1020
+ ]
1021
+ },
1022
+ {
1023
+ type : 'hbox',
1024
+ widths : [ '45%', '35%', '20%' ],
1025
+ children :
1026
+ [
1027
+ {
1028
+ type : 'text',
1029
+ label : linkLang.name,
1030
+ id : 'advName',
1031
+ setup : setupAdvParams,
1032
+ commit : commitAdvParams
1033
+
1034
+ },
1035
+ {
1036
+ type : 'text',
1037
+ label : linkLang.langCode,
1038
+ id : 'advLangCode',
1039
+ width : '110px',
1040
+ 'default' : '',
1041
+ setup : setupAdvParams,
1042
+ commit : commitAdvParams
1043
+
1044
+ },
1045
+ {
1046
+ type : 'text',
1047
+ label : linkLang.tabIndex,
1048
+ id : 'advTabIndex',
1049
+ width : '80px',
1050
+ maxLength : 5,
1051
+ setup : setupAdvParams,
1052
+ commit : commitAdvParams
1053
+
1054
+ }
1055
+ ]
1056
+ }
1057
+ ]
1058
+ },
1059
+ {
1060
+ type : 'vbox',
1061
+ padding : 1,
1062
+ children :
1063
+ [
1064
+ {
1065
+ type : 'hbox',
1066
+ widths : [ '45%', '55%' ],
1067
+ children :
1068
+ [
1069
+ {
1070
+ type : 'text',
1071
+ label : linkLang.advisoryTitle,
1072
+ 'default' : '',
1073
+ id : 'advTitle',
1074
+ setup : setupAdvParams,
1075
+ commit : commitAdvParams
1076
+
1077
+ },
1078
+ {
1079
+ type : 'text',
1080
+ label : linkLang.advisoryContentType,
1081
+ 'default' : '',
1082
+ id : 'advContentType',
1083
+ setup : setupAdvParams,
1084
+ commit : commitAdvParams
1085
+
1086
+ }
1087
+ ]
1088
+ },
1089
+ {
1090
+ type : 'hbox',
1091
+ widths : [ '45%', '55%' ],
1092
+ children :
1093
+ [
1094
+ {
1095
+ type : 'text',
1096
+ label : linkLang.cssClasses,
1097
+ 'default' : '',
1098
+ id : 'advCSSClasses',
1099
+ setup : setupAdvParams,
1100
+ commit : commitAdvParams
1101
+
1102
+ },
1103
+ {
1104
+ type : 'text',
1105
+ label : linkLang.charset,
1106
+ 'default' : '',
1107
+ id : 'advCharset',
1108
+ setup : setupAdvParams,
1109
+ commit : commitAdvParams
1110
+
1111
+ }
1112
+ ]
1113
+ },
1114
+ {
1115
+ type : 'hbox',
1116
+ widths : [ '45%', '55%' ],
1117
+ children :
1118
+ [
1119
+ {
1120
+ type : 'text',
1121
+ label : linkLang.rel,
1122
+ 'default' : '',
1123
+ id : 'advRel',
1124
+ setup : setupAdvParams,
1125
+ commit : commitAdvParams
1126
+ },
1127
+ {
1128
+ type : 'text',
1129
+ label : linkLang.styles,
1130
+ 'default' : '',
1131
+ id : 'advStyles',
1132
+ validate : CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ),
1133
+ setup : setupAdvParams,
1134
+ commit : commitAdvParams
1135
+ }
1136
+ ]
1137
+ }
1138
+ ]
1139
+ }
1140
+ ]
1141
+ }
1142
+ ],
1143
+ onShow : function()
1144
+ {
1145
+ var editor = this.getParentEditor(),
1146
+ selection = editor.getSelection(),
1147
+ element = null;
1148
+
1149
+ // Fill in all the relevant fields if there's already one link selected.
1150
+ if ( ( element = plugin.getSelectedLink( editor ) ) && element.hasAttribute( 'href' ) )
1151
+ selection.selectElement( element );
1152
+ else
1153
+ element = null;
1154
+
1155
+ this.setupContent( parseLink.apply( this, [ editor, element ] ) );
1156
+ },
1157
+ onOk : function()
1158
+ {
1159
+ var attributes = {},
1160
+ removeAttributes = [],
1161
+ data = {},
1162
+ me = this,
1163
+ editor = this.getParentEditor();
1164
+
1165
+ this.commitContent( data );
1166
+
1167
+ // Compose the URL.
1168
+ switch ( data.type || 'url' )
1169
+ {
1170
+ case 'url':
1171
+ var protocol = ( data.url && data.url.protocol != undefined ) ? data.url.protocol : 'http://',
1172
+ url = ( data.url && CKEDITOR.tools.trim( data.url.url ) ) || '';
1173
+ attributes[ 'data-cke-saved-href' ] = ( url.indexOf( '/' ) === 0 ) ? url : protocol + url;
1174
+ break;
1175
+ case 'anchor':
1176
+ var name = ( data.anchor && data.anchor.name ),
1177
+ id = ( data.anchor && data.anchor.id );
1178
+ attributes[ 'data-cke-saved-href' ] = '#' + ( name || id || '' );
1179
+ break;
1180
+ case 'email':
1181
+
1182
+ var linkHref,
1183
+ email = data.email,
1184
+ address = email.address;
1185
+
1186
+ switch( emailProtection )
1187
+ {
1188
+ case '' :
1189
+ case 'encode' :
1190
+ {
1191
+ var subject = encodeURIComponent( email.subject || '' ),
1192
+ body = encodeURIComponent( email.body || '' );
1193
+
1194
+ // Build the e-mail parameters first.
1195
+ var argList = [];
1196
+ subject && argList.push( 'subject=' + subject );
1197
+ body && argList.push( 'body=' + body );
1198
+ argList = argList.length ? '?' + argList.join( '&' ) : '';
1199
+
1200
+ if ( emailProtection == 'encode' )
1201
+ {
1202
+ linkHref = [ 'javascript:void(location.href=\'mailto:\'+',
1203
+ protectEmailAddressAsEncodedString( address ) ];
1204
+ // parameters are optional.
1205
+ argList && linkHref.push( '+\'', escapeSingleQuote( argList ), '\'' );
1206
+
1207
+ linkHref.push( ')' );
1208
+ }
1209
+ else
1210
+ linkHref = [ 'mailto:', address, argList ];
1211
+
1212
+ break;
1213
+ }
1214
+ default :
1215
+ {
1216
+ // Separating name and domain.
1217
+ var nameAndDomain = address.split( '@', 2 );
1218
+ email.name = nameAndDomain[ 0 ];
1219
+ email.domain = nameAndDomain[ 1 ];
1220
+
1221
+ linkHref = [ 'javascript:', protectEmailLinkAsFunction( email ) ];
1222
+ }
1223
+ }
1224
+
1225
+ attributes[ 'data-cke-saved-href' ] = linkHref.join( '' );
1226
+ break;
1227
+ }
1228
+
1229
+ // Popups and target.
1230
+ if ( data.target )
1231
+ {
1232
+ if ( data.target.type == 'popup' )
1233
+ {
1234
+ var onclickList = [ 'window.open(this.href, \'',
1235
+ data.target.name || '', '\', \'' ];
1236
+ var featureList = [ 'resizable', 'status', 'location', 'toolbar', 'menubar', 'fullscreen',
1237
+ 'scrollbars', 'dependent' ];
1238
+ var featureLength = featureList.length;
1239
+ var addFeature = function( featureName )
1240
+ {
1241
+ if ( data.target[ featureName ] )
1242
+ featureList.push( featureName + '=' + data.target[ featureName ] );
1243
+ };
1244
+
1245
+ for ( var i = 0 ; i < featureLength ; i++ )
1246
+ featureList[i] = featureList[i] + ( data.target[ featureList[i] ] ? '=yes' : '=no' ) ;
1247
+ addFeature( 'width' );
1248
+ addFeature( 'left' );
1249
+ addFeature( 'height' );
1250
+ addFeature( 'top' );
1251
+
1252
+ onclickList.push( featureList.join( ',' ), '\'); return false;' );
1253
+ attributes[ 'data-cke-pa-onclick' ] = onclickList.join( '' );
1254
+
1255
+ // Add the "target" attribute. (#5074)
1256
+ removeAttributes.push( 'target' );
1257
+ }
1258
+ else
1259
+ {
1260
+ if ( data.target.type != 'notSet' && data.target.name )
1261
+ attributes.target = data.target.name;
1262
+ else
1263
+ removeAttributes.push( 'target' );
1264
+
1265
+ removeAttributes.push( 'data-cke-pa-onclick', 'onclick' );
1266
+ }
1267
+ }
1268
+
1269
+ // Advanced attributes.
1270
+ if ( data.adv )
1271
+ {
1272
+ var advAttr = function( inputName, attrName )
1273
+ {
1274
+ var value = data.adv[ inputName ];
1275
+ if ( value )
1276
+ attributes[attrName] = value;
1277
+ else
1278
+ removeAttributes.push( attrName );
1279
+ };
1280
+
1281
+ advAttr( 'advId', 'id' );
1282
+ advAttr( 'advLangDir', 'dir' );
1283
+ advAttr( 'advAccessKey', 'accessKey' );
1284
+
1285
+ if ( data.adv[ 'advName' ] )
1286
+ attributes[ 'name' ] = attributes[ 'data-cke-saved-name' ] = data.adv[ 'advName' ];
1287
+ else
1288
+ removeAttributes = removeAttributes.concat( [ 'data-cke-saved-name', 'name' ] );
1289
+
1290
+ advAttr( 'advLangCode', 'lang' );
1291
+ advAttr( 'advTabIndex', 'tabindex' );
1292
+ advAttr( 'advTitle', 'title' );
1293
+ advAttr( 'advContentType', 'type' );
1294
+ advAttr( 'advCSSClasses', 'class' );
1295
+ advAttr( 'advCharset', 'charset' );
1296
+ advAttr( 'advStyles', 'style' );
1297
+ advAttr( 'advRel', 'rel' );
1298
+ }
1299
+
1300
+
1301
+ // Browser need the "href" fro copy/paste link to work. (#6641)
1302
+ attributes.href = attributes[ 'data-cke-saved-href' ];
1303
+
1304
+ if ( !this._.selectedElement )
1305
+ {
1306
+ // Create element if current selection is collapsed.
1307
+ var selection = editor.getSelection(),
1308
+ ranges = selection.getRanges( true );
1309
+ if ( ranges.length == 1 && ranges[0].collapsed )
1310
+ {
1311
+ // Short mailto link text view (#5736).
1312
+ var text = new CKEDITOR.dom.text( data.type == 'email' ?
1313
+ data.email.address : attributes[ 'data-cke-saved-href' ], editor.document );
1314
+ ranges[0].insertNode( text );
1315
+ ranges[0].selectNodeContents( text );
1316
+ selection.selectRanges( ranges );
1317
+ }
1318
+
1319
+ // Apply style.
1320
+ var style = new CKEDITOR.style( { element : 'a', attributes : attributes } );
1321
+ style.type = CKEDITOR.STYLE_INLINE; // need to override... dunno why.
1322
+ style.apply( editor.document );
1323
+ }
1324
+ else
1325
+ {
1326
+ // We're only editing an existing link, so just overwrite the attributes.
1327
+ var element = this._.selectedElement,
1328
+ href = element.data( 'cke-saved-href' ),
1329
+ textView = element.getHtml();
1330
+
1331
+ element.setAttributes( attributes );
1332
+ element.removeAttributes( removeAttributes );
1333
+
1334
+ if ( data.adv && data.adv.advName && CKEDITOR.plugins.esp_link.synAnchorSelector )
1335
+ element.addClass( element.getChildCount() ? 'cke_anchor' : 'cke_anchor_empty' );
1336
+
1337
+ // Update text view when user changes protocol (#4612).
1338
+ if ( href == textView || data.type == 'email' && textView.indexOf( '@' ) != -1 )
1339
+ {
1340
+ // Short mailto link text view (#5736).
1341
+ element.setHtml( data.type == 'email' ?
1342
+ data.email.address : attributes[ 'data-cke-saved-href' ] );
1343
+ }
1344
+
1345
+ delete this._.selectedElement;
1346
+ }
1347
+ },
1348
+ onLoad : function()
1349
+ {
1350
+ if ( !editor.config.linkShowAdvancedTab )
1351
+ this.hidePage( 'advanced' ); //Hide Advanded tab.
1352
+
1353
+ if ( !editor.config.linkShowTargetTab )
1354
+ this.hidePage( 'target' ); //Hide Target tab.
1355
+
1356
+ },
1357
+ // Inital focus on 'url' field if link is of type URL.
1358
+ onFocus : function()
1359
+ {
1360
+ var linkType = this.getContentElement( 'info', 'linkType' ),
1361
+ urlField;
1362
+ if ( linkType && linkType.getValue() == 'url' )
1363
+ {
1364
+ urlField = this.getContentElement( 'info', 'url' );
1365
+ urlField.select();
1366
+ }
1367
+ }
1368
+ };
1369
+ });
1370
+
1371
+ /**
1372
+ * The e-mail address anti-spam protection option. The protection will be
1373
+ * applied when creating or modifying e-mail links through the editor interface.<br>
1374
+ * Two methods of protection can be choosed:
1375
+ * <ol> <li>The e-mail parts (name, domain and any other query string) are
1376
+ * assembled into a function call pattern. Such function must be
1377
+ * provided by the developer in the pages that will use the contents.
1378
+ * <li>Only the e-mail address is obfuscated into a special string that
1379
+ * has no meaning for humans or spam bots, but which is properly
1380
+ * rendered and accepted by the browser.</li></ol>
1381
+ * Both approaches require JavaScript to be enabled.
1382
+ * @name CKEDITOR.config.emailProtection
1383
+ * @since 3.1
1384
+ * @type String
1385
+ * @default '' (empty string = disabled)
1386
+ * @example
1387
+ * // href="mailto:tester@ckeditor.com?subject=subject&body=body"
1388
+ * config.emailProtection = '';
1389
+ * @example
1390
+ * // href="<a href=\"javascript:void(location.href=\'mailto:\'+String.fromCharCode(116,101,115,116,101,114,64,99,107,101,100,105,116,111,114,46,99,111,109)+\'?subject=subject&body=body\')\">e-mail</a>"
1391
+ * config.emailProtection = 'encode';
1392
+ * @example
1393
+ * // href="javascript:mt('tester','ckeditor.com','subject','body')"
1394
+ * config.emailProtection = 'mt(NAME,DOMAIN,SUBJECT,BODY)';
1395
+ */
1396
+