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,250 @@
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
+ (function()
7
+ {
8
+ // Base HTML entities.
9
+ var htmlbase = 'nbsp,gt,lt,amp';
10
+
11
+ var entities =
12
+ // Latin-1 Entities
13
+ 'quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,' +
14
+ 'not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,' +
15
+ 'cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,' +
16
+
17
+ // Symbols
18
+ 'fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,' +
19
+ 'alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,' +
20
+ 'forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,' +
21
+ 'radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,' +
22
+ 'equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,' +
23
+ 'rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,' +
24
+
25
+ // Other Special Characters
26
+ 'circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,' +
27
+ 'rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,' +
28
+ 'euro';
29
+
30
+ // Latin Letters Entities
31
+ var latin =
32
+ 'Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,' +
33
+ 'Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,' +
34
+ 'Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,' +
35
+ 'agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,' +
36
+ 'ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,' +
37
+ 'otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,' +
38
+ 'OElig,oelig,Scaron,scaron,Yuml';
39
+
40
+ // Greek Letters Entities.
41
+ var greek =
42
+ 'Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,' +
43
+ 'Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,' +
44
+ 'beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,' +
45
+ 'omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,' +
46
+ 'upsih,piv';
47
+
48
+ /**
49
+ * Create a mapping table between one character and its entity form from a list of entity names.
50
+ * @param reverse {Boolean} Whether to create a reverse map from the entity string form to an actual character.
51
+ */
52
+ function buildTable( entities, reverse )
53
+ {
54
+ var table = {},
55
+ regex = [];
56
+
57
+ // Entities that the browsers DOM don't transform to the final char
58
+ // automatically.
59
+ var specialTable =
60
+ {
61
+ nbsp : '\u00A0', // IE | FF
62
+ shy : '\u00AD', // IE
63
+ gt : '\u003E', // IE | FF | -- | Opera
64
+ lt : '\u003C', // IE | FF | Safari | Opera
65
+ amp : '\u0026' // ALL
66
+ };
67
+
68
+ entities = entities.replace( /\b(nbsp|shy|gt|lt|amp)(?:,|$)/g, function( match, entity )
69
+ {
70
+ var org = reverse ? '&' + entity + ';' : specialTable[ entity ],
71
+ result = reverse ? specialTable[ entity ] : '&' + entity + ';';
72
+
73
+ table[ org ] = result;
74
+ regex.push( org );
75
+ return '';
76
+ });
77
+
78
+ if ( !reverse && entities )
79
+ {
80
+ // Transforms the entities string into an array.
81
+ entities = entities.split( ',' );
82
+
83
+ // Put all entities inside a DOM element, transforming them to their
84
+ // final chars.
85
+ var div = document.createElement( 'div' ),
86
+ chars;
87
+ div.innerHTML = '&' + entities.join( ';&' ) + ';';
88
+ chars = div.innerHTML;
89
+ div = null;
90
+
91
+ // Add all chars to the table.
92
+ for ( var i = 0 ; i < chars.length ; i++ )
93
+ {
94
+ var charAt = chars.charAt( i );
95
+ table[ charAt ] = '&' + entities[ i ] + ';';
96
+ regex.push( charAt );
97
+ }
98
+ }
99
+
100
+ table.regex = regex.join( reverse ? '|' : '' );
101
+
102
+ return table;
103
+ }
104
+
105
+ CKEDITOR.plugins.add( 'entities',
106
+ {
107
+ afterInit : function( editor )
108
+ {
109
+ var config = editor.config;
110
+
111
+ var dataProcessor = editor.dataProcessor,
112
+ htmlFilter = dataProcessor && dataProcessor.htmlFilter;
113
+
114
+ if ( htmlFilter )
115
+ {
116
+ // Mandatory HTML base entities.
117
+ var selectedEntities = '';
118
+
119
+ if ( config.basicEntities !== false )
120
+ selectedEntities += htmlbase;
121
+
122
+ if ( config.entities )
123
+ {
124
+ selectedEntities += ',' + entities;
125
+ if ( config.entities_latin )
126
+ selectedEntities += ',' + latin;
127
+
128
+ if ( config.entities_greek )
129
+ selectedEntities += ',' + greek;
130
+
131
+ if ( config.entities_additional )
132
+ selectedEntities += ',' + config.entities_additional;
133
+ }
134
+
135
+ var entitiesTable = buildTable( selectedEntities );
136
+
137
+ // Create the Regex used to find entities in the text, leave it matches nothing if entities are empty.
138
+ var entitiesRegex = entitiesTable.regex ? '[' + entitiesTable.regex + ']' : 'a^';
139
+ delete entitiesTable.regex;
140
+
141
+ if ( config.entities && config.entities_processNumerical )
142
+ entitiesRegex = '[^ -~]|' + entitiesRegex ;
143
+
144
+ entitiesRegex = new RegExp( entitiesRegex, 'g' );
145
+
146
+ function getEntity( character )
147
+ {
148
+ return config.entities_processNumerical == 'force' || !entitiesTable[ character ] ?
149
+ '&#' + character.charCodeAt(0) + ';'
150
+ : entitiesTable[ character ];
151
+ }
152
+
153
+ // Decode entities that the browsers has transformed
154
+ // at first place.
155
+ var baseEntitiesTable = buildTable( [ htmlbase, 'shy' ].join( ',' ) , true ),
156
+ baseEntitiesRegex = new RegExp( baseEntitiesTable.regex, 'g' );
157
+
158
+ function getChar( character )
159
+ {
160
+ return baseEntitiesTable[ character ];
161
+ }
162
+
163
+ htmlFilter.addRules(
164
+ {
165
+ text : function( text )
166
+ {
167
+ return text.replace( baseEntitiesRegex, getChar )
168
+ .replace( entitiesRegex, getEntity );
169
+ }
170
+ });
171
+ }
172
+ }
173
+ });
174
+ })();
175
+
176
+ /**
177
+ * Whether to escape basic HTML entities in the document, including:
178
+ * <ul>
179
+ * <li><code>nbsp</code></li>
180
+ * <li><code>gt</code></li>
181
+ * <li><code>lt</code></li>
182
+ * <li><code>amp</code></li>
183
+ * </ul>
184
+ * <strong>Note:</strong> It should not be subject to change unless when outputting a non-HTML data format like BBCode.
185
+ * @type Boolean
186
+ * @default <code>true</code>
187
+ * @example
188
+ * config.basicEntities = false;
189
+ */
190
+ CKEDITOR.config.basicEntities = true;
191
+
192
+ /**
193
+ * Whether to use HTML entities in the output.
194
+ * @name CKEDITOR.config.entities
195
+ * @type Boolean
196
+ * @default <code>true</code>
197
+ * @example
198
+ * config.entities = false;
199
+ */
200
+ CKEDITOR.config.entities = true;
201
+
202
+ /**
203
+ * Whether to convert some Latin characters (Latin alphabet No&#46; 1, ISO 8859-1)
204
+ * to HTML entities. The list of entities can be found in the
205
+ * <a href="http://www.w3.org/TR/html4/sgml/entities.html#h-24.2.1">W3C HTML 4.01 Specification, section 24.2.1</a>.
206
+ * @name CKEDITOR.config.entities_latin
207
+ * @type Boolean
208
+ * @default <code>true</code>
209
+ * @example
210
+ * config.entities_latin = false;
211
+ */
212
+ CKEDITOR.config.entities_latin = true;
213
+
214
+ /**
215
+ * Whether to convert some symbols, mathematical symbols, and Greek letters to
216
+ * HTML entities. This may be more relevant for users typing text written in Greek.
217
+ * The list of entities can be found in the
218
+ * <a href="http://www.w3.org/TR/html4/sgml/entities.html#h-24.3.1">W3C HTML 4.01 Specification, section 24.3.1</a>.
219
+ * @name CKEDITOR.config.entities_greek
220
+ * @type Boolean
221
+ * @default <code>true</code>
222
+ * @example
223
+ * config.entities_greek = false;
224
+ */
225
+ CKEDITOR.config.entities_greek = true;
226
+
227
+ /**
228
+ * Whether to convert all remaining characters not included in the ASCII
229
+ * character table to their relative decimal numeric representation of HTML entity.
230
+ * When set to <code>force</code>, it will convert all entities into this format.
231
+ * For example the phrase "This is Chinese: &#27721;&#35821;." is output
232
+ * as "This is Chinese: &amp;#27721;&amp;#35821;."
233
+ * @name CKEDITOR.config.entities_processNumerical
234
+ * @type Boolean|String
235
+ * @default <code>false</code>
236
+ * @example
237
+ * config.entities_processNumerical = true;
238
+ * config.entities_processNumerical = 'force'; //Converts from "&nbsp;" into "&#160;";
239
+ */
240
+
241
+ /**
242
+ * A comma separated list of additional entities to be used. Entity names
243
+ * or numbers must be used in a form that excludes the "&amp;" prefix and the ";" ending.
244
+ * @name CKEDITOR.config.entities_additional
245
+ * @default <code>'#39'</code> (The single quote (') character.)
246
+ * @type String
247
+ * @example
248
+ * config.entities_additional = '#1049'; // Adds Cyrillic capital letter Short I (&#1049;).
249
+ */
250
+ CKEDITOR.config.entities_additional = '#39';
@@ -0,0 +1,234 @@
1
+ (function () {
2
+ CKEDITOR.dialog.add('esp_attachment', function (editor) {
3
+ var selectableTargets = /^(_(?:self|top|parent|blank))$/;
4
+ var parseLink = function (editor, element) {
5
+ var href = element ? element.getAttribute('href') : '',
6
+ emailMatch, anchorMatch, urlMatch, retval = {};
7
+ retval.type = 'url';
8
+ retval.url = href;
9
+ if (element) {
10
+ var target = element.getAttribute('target');
11
+ retval.target = {};
12
+ if (target) {
13
+ var targetMatch = target.match(selectableTargets);
14
+ if (targetMatch) retval.target.type = retval.target.name = target;
15
+ else {
16
+ retval.target.type = 'frame';
17
+ retval.target.name = target
18
+ }
19
+ }
20
+ var me = this;
21
+ retval.title = element.getAttribute('title')
22
+ }
23
+ var elements = editor.document.getElementsByTag('img'),
24
+ realAnchors = new CKEDITOR.dom.nodeList(editor.document.$.anchors),
25
+ anchors = retval.anchors = [];
26
+ for (var i = 0; i < elements.count(); i++) {
27
+ var item = elements.getItem(i);
28
+ if (item.getAttribute('_cke_realelement') && item.getAttribute('_cke_real_element_type') == 'anchor') {
29
+ anchors.push(editor.restoreRealElement(item))
30
+ }
31
+ }
32
+ for (i = 0; i < realAnchors.count(); i++) anchors.push(realAnchors.getItem(i));
33
+ for (i = 0; i < anchors.length; i++) {
34
+ item = anchors[i];
35
+ anchors[i] = {
36
+ name: item.getAttribute('name'),
37
+ id: item.getAttribute('id')
38
+ }
39
+ }
40
+ this._.selectedElement = element;
41
+ return retval
42
+ };
43
+ var targetChanged = function () {
44
+ var dialog = this.getDialog(),
45
+ targetName = dialog.getContentElement('info', 'linkTargetName'),
46
+ value = this.getValue();
47
+ if (!targetName) return;
48
+ targetName.setLabel(editor.lang.link.targetFrameName);
49
+ this.getDialog().setValueOf('info', 'linkTargetName', value.charAt(0) == '_' ? value : '')
50
+ };
51
+
52
+ function parseUrl(url) {
53
+ var filename = url.split('/').pop();
54
+ var extname = filename.split('.').pop();
55
+ return {
56
+ filename: filename.replace(/%20/g, " "),
57
+ className: "attach_" + extname
58
+ }
59
+ }
60
+ return {
61
+ title: editor.lang.esp_attachment.title,
62
+ minWidth: 420,
63
+ minHeight: 200,
64
+ onShow: function () {
65
+ this.fakeObj = false;
66
+ var editor = this.getParentEditor(),
67
+ selection = editor.getSelection(),
68
+ ranges = selection.getRanges(),
69
+ element = null,
70
+ me = this;
71
+ if (ranges.length == 1) {
72
+ var rangeRoot = ranges[0].getCommonAncestor(true);
73
+ element = rangeRoot.getAscendant('a', true);
74
+ if (element && element.getAttribute('href')) {
75
+ selection.selectElement(element)
76
+ } else if ((element = rangeRoot.getAscendant('img', true)) && element.getAttribute('_cke_real_element_type') && element.getAttribute('_cke_real_element_type') == 'anchor') {
77
+ this.fakeObj = element;
78
+ element = editor.restoreRealElement(this.fakeObj);
79
+ selection.selectElement(this.fakeObj)
80
+ } else element = null
81
+ }
82
+ this.setupContent(parseLink.apply(this, [editor, element]))
83
+ },
84
+ onOk: function () {
85
+ var attributes = {
86
+ href: ''
87
+ },
88
+ removeAttributes = [],
89
+ data = {
90
+ href: attributes.href
91
+ },
92
+ me = this,
93
+ editor = this.getParentEditor();
94
+ this.commitContent(data);
95
+ var url = data.url || '';
96
+ attributes.href = (url.indexOf('/') === 0 || url.indexOf('http://') === 0) ? url : "http://" + url;
97
+ var file = parseUrl(url);
98
+ var title = data.title || '';
99
+ attributes.title = (data.title.length == 0) ? file.filename : data.title;
100
+ if (data.target) {
101
+ if (data.target.type != 'notSet' && data.target.name) attributes.target = data.target.name;
102
+ else removeAttributes.push('target');
103
+ removeAttributes.push('_cke_pa_onclick', 'onclick')
104
+ }
105
+ if (!this._.selectedElement) {
106
+ var selection = editor.getSelection(),
107
+ ranges = selection.getRanges();
108
+ if (ranges.length == 1 && ranges[0].collapsed) {
109
+ var text = new CKEDITOR.dom.text(attributes.title, editor.document);
110
+ ranges[0].insertNode(text);
111
+ ranges[0].selectNodeContents(text);
112
+ selection.selectRanges(ranges)
113
+ }
114
+ var style = new CKEDITOR.style({
115
+ element: 'a',
116
+ attributes: attributes
117
+ });
118
+ style.type = CKEDITOR.STYLE_INLINE;
119
+ style.apply(editor.document)
120
+ } else {
121
+ var element = this._.selectedElement;
122
+ if (CKEDITOR.env.ie && attributes.name != element.getAttribute('name')) {
123
+ var newElement = new CKEDITOR.dom.element('<a name="' + CKEDITOR.tools.htmlEncode(attributes.name) + '">', editor.document);
124
+ selection = editor.getSelection();
125
+ element.moveChildren(newElement);
126
+ element.copyAttributes(newElement, {
127
+ name: 1
128
+ });
129
+ newElement.replace(element);
130
+ element = newElement;
131
+ selection.selectElement(element)
132
+ }
133
+ element.setAttributes(attributes);
134
+ element.removeAttributes(removeAttributes);
135
+ if (element.getAttribute('title')) element.setHtml(element.getAttribute('title'));
136
+ if (element.getAttribute('name')) element.addClass('cke_anchor');
137
+ else element.removeClass('cke_anchor');
138
+ if (this.fakeObj) editor.createFakeElement(element, 'cke_anchor', 'anchor').replace(this.fakeObj);
139
+ delete this._.selectedElement
140
+ }
141
+ },
142
+ contents: [{
143
+ label: editor.lang.common.generalTab,
144
+ id: 'info',
145
+ accessKey: 'I',
146
+ elements: [{
147
+ type: 'vbox',
148
+ padding: 0,
149
+ children: [{
150
+ type: 'html',
151
+ html: '<span>' + CKEDITOR.tools.htmlEncode(editor.lang.esp_attachment.url) + '</span>'
152
+ }, {
153
+ type: 'hbox',
154
+ widths: ['320px', '80px'],
155
+ align: 'right',
156
+ children: [{
157
+ id: 'txtUrl',
158
+ type: 'text',
159
+ label: '',
160
+ validate: CKEDITOR.dialog.validate.notEmpty(editor.lang.flash.validateSrc),
161
+ setup: function (data) {
162
+ if (data.url) this.setValue(data.url);
163
+ this.select()
164
+ },
165
+ commit: function (data) {
166
+ data.url = this.getValue()
167
+ }
168
+ }, {
169
+ type: 'button',
170
+ id: 'browse',
171
+ filebrowser: 'info:txtUrl',
172
+ hidden: true,
173
+ align: 'center',
174
+ label: editor.lang.esp_attachment.browseServer
175
+ }]
176
+ }]
177
+ }, {
178
+ type: 'vbox',
179
+ padding: 0,
180
+ children: [{
181
+ id: 'txtAlt',
182
+ type: 'text',
183
+ label: editor.lang.esp_attachment.name,
184
+ setup: function (data) {
185
+ if (data.title) this.setValue(data.title)
186
+ },
187
+ commit: function (data) {
188
+ data.title = this.getValue()
189
+ }
190
+ }]
191
+ }, {
192
+ type: 'hbox',
193
+ widths: ['50%', '50%'],
194
+ children: [{
195
+ type: 'select',
196
+ id: 'linkTargetType',
197
+ label: editor.lang.link.target,
198
+ 'default': 'notSet',
199
+ style: 'width : 100%;',
200
+ 'items': [
201
+ [editor.lang.esp_attachment.link.targetNotSet, 'notSet'],
202
+ [editor.lang.esp_attachment.link.targetFrame, 'frame'],
203
+ [editor.lang.esp_attachment.link.targetNew, '_blank'],
204
+ [editor.lang.esp_attachment.link.targetTop, '_top'],
205
+ [editor.lang.esp_attachment.link.targetSelf, '_self'],
206
+ [editor.lang.esp_attachment.link.targetParent, '_parent']
207
+ ],
208
+ onChange: targetChanged,
209
+ setup: function (data) {
210
+ if (data.target) this.setValue(data.target.type)
211
+ },
212
+ commit: function (data) {
213
+ if (!data.target) data.target = {};
214
+ data.target.type = this.getValue()
215
+ }
216
+ }, {
217
+ type: 'text',
218
+ id: 'linkTargetName',
219
+ label: editor.lang.link.targetFrameName,
220
+ 'default': '',
221
+ setup: function (data) {
222
+ if (data.target) this.setValue(data.target.name)
223
+ },
224
+ commit: function (data) {
225
+ if (!data.target) data.target = {};
226
+ data.target.name = this.getValue()
227
+ }
228
+ }]
229
+ }]
230
+ }]
231
+ }
232
+ })
233
+ })();
234
+