glebtv-ckeditor 4.0.2.7 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (281) hide show
  1. checksums.yaml +7 -0
  2. data/README.rdoc +5 -195
  3. data/{vendor → app}/assets/javascripts/ckeditor/CHANGES.md +56 -0
  4. data/{vendor → app}/assets/javascripts/ckeditor/LICENSE.md +0 -0
  5. data/{vendor → app}/assets/javascripts/ckeditor/README.md +0 -0
  6. data/{vendor → app}/assets/javascripts/ckeditor/build-config.js +0 -0
  7. data/app/assets/javascripts/ckeditor/ckeditor.js +881 -0
  8. data/{vendor → app}/assets/javascripts/ckeditor/config.js.erb +0 -0
  9. data/app/assets/javascripts/ckeditor/contents.css +103 -0
  10. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_add.jpg +0 -0
  11. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_add.png +0 -0
  12. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_del.png +0 -0
  13. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/gal_more.gif +0 -0
  14. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/preloader.gif +0 -0
  15. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/avi.gif +0 -0
  16. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/ckfnothumb.gif +0 -0
  17. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/doc.gif +0 -0
  18. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/docx.gif +0 -0
  19. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/exe.gif +0 -0
  20. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/gz.gif +0 -0
  21. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/htm.gif +0 -0
  22. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/jpg.gif +0 -0
  23. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/mp3.gif +0 -0
  24. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/mpg.gif +0 -0
  25. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/pdf.gif +0 -0
  26. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/psd.gif +0 -0
  27. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/rar.gif +0 -0
  28. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/swf.gif +0 -0
  29. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/tar.gif +0 -0
  30. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/txt.gif +0 -0
  31. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/unknown.gif +0 -0
  32. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/wmv.gif +0 -0
  33. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/xls.gif +0 -0
  34. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/xlsx.gif +0 -0
  35. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/images/thumbs/zip.gif +0 -0
  36. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/application.js +0 -0
  37. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +0 -0
  38. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.min.js +0 -0
  39. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.tmpl.min.js +0 -0
  40. data/{vendor → app}/assets/javascripts/ckeditor/filebrowser/javascripts/rails.js +0 -0
  41. data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css +118 -0
  42. data/app/assets/javascripts/ckeditor/{init.js → init.js.erb} +1 -1
  43. data/{vendor → app}/assets/javascripts/ckeditor/lang/en.js +1 -1
  44. data/{vendor → app}/assets/javascripts/ckeditor/lang/ru.js +1 -1
  45. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/ckcss.png +0 -0
  46. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/css/styles.css +0 -0
  47. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/dialogs/ckcss.js +0 -0
  48. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/lang/en.js +0 -0
  49. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/lang/ru.js +0 -0
  50. data/{vendor → app}/assets/javascripts/ckeditor/plugins/CKCss/plugin.js +0 -0
  51. data/{vendor → app}/assets/javascripts/ckeditor/plugins/LoremIpsum/images/icon.png +0 -0
  52. data/{vendor → app}/assets/javascripts/ckeditor/plugins/LoremIpsum/images/icon1.png +0 -0
  53. data/{vendor → app}/assets/javascripts/ckeditor/plugins/LoremIpsum/plugin.js +0 -0
  54. data/{vendor → app}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +0 -0
  55. data/{vendor → app}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +0 -0
  56. data/{vendor → app}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +0 -0
  57. data/{vendor → app}/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -0
  58. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +38 -0
  59. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.css +246 -245
  60. data/app/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
  61. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoComplete.png +0 -0
  62. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoFormat.png +0 -0
  63. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/icons/CommentSelectedRange.png +0 -0
  64. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/SearchCode.png +0 -0
  65. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/icons/UncommentSelectedRange.png +0 -0
  66. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +81 -76
  67. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +52 -0
  68. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +1 -2
  69. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuecomment.js +44 -0
  70. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +25 -0
  71. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +0 -0
  72. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +31 -0
  73. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +32 -0
  74. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +64 -0
  75. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +0 -0
  76. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +0 -0
  77. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +0 -0
  78. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +131 -131
  79. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +8 -9
  80. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -0
  81. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +264 -132
  82. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -0
  83. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +1 -0
  84. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +1 -0
  85. data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/css.js +337 -235
  86. data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/htmlmixed.js +0 -0
  87. data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/javascript.js +17 -6
  88. data/{vendor/assets/javascripts/ckeditor/plugins/codemirror/js → app/assets/javascripts/ckeditor/plugins/codemirror/js/mode}/xml.js +9 -5
  89. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +4 -2
  90. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +0 -0
  91. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +146 -34
  92. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +0 -1
  93. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +0 -1
  94. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +0 -0
  95. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +0 -0
  96. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +1 -1
  97. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +0 -0
  98. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +5 -5
  99. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +0 -0
  100. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +0 -0
  101. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +0 -0
  102. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +0 -0
  103. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +0 -0
  104. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +0 -0
  105. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +0 -0
  106. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +0 -0
  107. data/{vendor → app}/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +0 -0
  108. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +43 -0
  109. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/icons/bgcolor.png +0 -0
  110. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/icons/textcolor.png +0 -0
  111. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/lang/en.js +0 -0
  112. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/lang/ru.js +0 -0
  113. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colorbutton/plugin.js +6 -2
  114. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +0 -0
  115. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/lang/en.js +0 -0
  116. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/lang/ru.js +0 -0
  117. data/{vendor → app}/assets/javascripts/ckeditor/plugins/colordialog/plugin.js +1 -1
  118. data/{vendor → app}/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +0 -0
  119. data/{vendor → app}/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
  120. data/{vendor → app}/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +10 -9
  121. data/{vendor → app}/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
  122. data/{vendor → app}/assets/javascripts/ckeditor/plugins/font/lang/en.js +0 -0
  123. data/{vendor → app}/assets/javascripts/ckeditor/plugins/font/lang/ru.js +0 -0
  124. data/{vendor → app}/assets/javascripts/ckeditor/plugins/font/plugin.js +5 -2
  125. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/dialogs/hs.js +0 -0
  126. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/icon.png +0 -0
  127. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/lang/en.js +0 -0
  128. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/lang/ru.js +0 -0
  129. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/plugin.js +0 -0
  130. data/{vendor → app}/assets/javascripts/ckeditor/plugins/highslide/readme.txt +0 -0
  131. data/app/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  132. data/{vendor → app}/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -0
  133. data/app/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +43 -0
  134. data/{vendor → app}/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
  135. data/{vendor → app}/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +0 -0
  136. data/{vendor → app}/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +15 -15
  137. data/{vendor → app}/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
  138. data/{vendor → app}/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
  139. data/{vendor → app}/assets/javascripts/ckeditor/plugins/mediaembed/images/icon.png +0 -0
  140. data/{vendor → app}/assets/javascripts/ckeditor/plugins/oembed/images/icon.png +0 -0
  141. data/app/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.js +68 -0
  142. data/app/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.min.js +68 -0
  143. data/{vendor → app}/assets/javascripts/ckeditor/plugins/panelbutton/plugin.js +0 -0
  144. data/app/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +31 -0
  145. data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +0 -0
  146. data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/README.md +0 -0
  147. data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +0 -0
  148. data/{vendor → app}/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -0
  149. data/{vendor → app}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +0 -0
  150. data/{vendor → app}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +0 -0
  151. data/app/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +21 -0
  152. data/{vendor → app}/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +0 -0
  153. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +0 -0
  154. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/README.md +0 -0
  155. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -0
  156. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -0
  157. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -0
  158. data/{vendor → app}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +0 -0
  159. data/app/assets/javascripts/ckeditor/samples/ajax.html +82 -0
  160. data/app/assets/javascripts/ckeditor/samples/api.html +207 -0
  161. data/app/assets/javascripts/ckeditor/samples/appendto.html +57 -0
  162. data/app/assets/javascripts/ckeditor/samples/assets/inlineall/logo.png +0 -0
  163. data/app/assets/javascripts/ckeditor/samples/assets/outputxhtml/outputxhtml.css +204 -0
  164. data/app/assets/javascripts/ckeditor/samples/assets/posteddata.php +59 -0
  165. data/app/assets/javascripts/ckeditor/samples/assets/sample.css +3 -0
  166. data/app/assets/javascripts/ckeditor/samples/assets/sample.jpg +0 -0
  167. data/app/assets/javascripts/ckeditor/samples/assets/uilanguages/languages.js +7 -0
  168. data/app/assets/javascripts/ckeditor/samples/datafiltering.html +401 -0
  169. data/app/assets/javascripts/ckeditor/samples/divreplace.html +141 -0
  170. data/app/assets/javascripts/ckeditor/samples/index.html +125 -0
  171. data/app/assets/javascripts/ckeditor/samples/inlineall.html +311 -0
  172. data/app/assets/javascripts/ckeditor/samples/inlinebycode.html +122 -0
  173. data/app/assets/javascripts/ckeditor/samples/plugins/dialog/assets/my_dialog.js +48 -0
  174. data/app/assets/javascripts/ckeditor/samples/plugins/dialog/dialog.html +187 -0
  175. data/app/assets/javascripts/ckeditor/samples/plugins/enterkey/enterkey.html +103 -0
  176. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
  177. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
  178. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/swfobject.js +18 -0
  179. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputforflash.html +280 -0
  180. data/app/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputhtml.html +221 -0
  181. data/app/assets/javascripts/ckeditor/samples/plugins/magicline/magicline.html +207 -0
  182. data/{vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples → app/assets/javascripts/ckeditor/samples/plugins/stylesheetparser}/assets/sample.css +70 -70
  183. data/{vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples → app/assets/javascripts/ckeditor/samples/plugins/stylesheetparser}/stylesheetparser.html +82 -82
  184. data/app/assets/javascripts/ckeditor/samples/plugins/toolbar/toolbar.html +232 -0
  185. data/app/assets/javascripts/ckeditor/samples/plugins/wysiwygarea/fullpage.html +77 -0
  186. data/app/assets/javascripts/ckeditor/samples/readonly.html +73 -0
  187. data/app/assets/javascripts/ckeditor/samples/replacebyclass.html +57 -0
  188. data/app/assets/javascripts/ckeditor/samples/replacebycode.html +56 -0
  189. data/app/assets/javascripts/ckeditor/samples/sample.css +339 -0
  190. data/app/assets/javascripts/ckeditor/samples/sample.js +33 -0
  191. data/app/assets/javascripts/ckeditor/samples/sample_posteddata.php +16 -0
  192. data/app/assets/javascripts/ckeditor/samples/tabindex.html +75 -0
  193. data/app/assets/javascripts/ckeditor/samples/uicolor.html +69 -0
  194. data/app/assets/javascripts/ckeditor/samples/uilanguages.html +119 -0
  195. data/app/assets/javascripts/ckeditor/samples/xhtmlstyle.html +231 -0
  196. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog.css +0 -0
  197. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +0 -0
  198. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +0 -0
  199. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +0 -0
  200. data/app/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +5 -0
  201. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/dialog_opera.css +0 -0
  202. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/editor.css +1 -1
  203. data/{vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css → app/assets/javascripts/ckeditor/skins/moono/editor_gecko.css} +1 -1
  204. data/{vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css → app/assets/javascripts/ckeditor/skins/moono/editor_ie.css} +1 -1
  205. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +1 -1
  206. data/app/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +5 -0
  207. data/{vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css → app/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css} +1 -1
  208. data/app/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
  209. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/images/arrow.png +0 -0
  210. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
  211. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/images/mini.png +0 -0
  212. data/{vendor → app}/assets/javascripts/ckeditor/skins/moono/readme.md +0 -0
  213. data/{vendor → app}/assets/javascripts/ckeditor/styles.js +1 -2
  214. data/app/controllers/ckeditor/application_controller.rb +6 -12
  215. data/app/controllers/ckeditor/attachment_files_controller.rb +6 -2
  216. data/app/controllers/ckeditor/pictures_controller.rb +6 -2
  217. data/app/views/ckeditor/shared/_asset.html.erb +4 -4
  218. data/app/views/ckeditor/shared/_asset_tmpl.html.erb +1 -1
  219. data/lib/ckeditor.rb +91 -19
  220. data/lib/ckeditor/engine.rb +5 -8
  221. data/lib/ckeditor/helpers/controllers.rb +7 -3
  222. data/lib/ckeditor/helpers/form_builder.rb +1 -1
  223. data/lib/ckeditor/helpers/form_helper.rb +12 -15
  224. data/lib/ckeditor/helpers/view_helper.rb +1 -1
  225. data/lib/ckeditor/hooks/cancan.rb +46 -0
  226. data/lib/ckeditor/hooks/simple_form.rb +11 -0
  227. data/lib/ckeditor/orm/active_record.rb +1 -3
  228. data/lib/ckeditor/orm/base.rb +4 -0
  229. data/lib/ckeditor/orm/mongoid.rb +1 -3
  230. data/lib/ckeditor/utils.rb +25 -8
  231. data/lib/ckeditor/version.rb +2 -2
  232. data/lib/generators/ckeditor/install_generator.rb +2 -2
  233. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +2 -2
  234. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +4 -4
  235. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +4 -4
  236. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +1 -1
  237. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +4 -4
  238. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +8 -8
  239. data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +6 -6
  240. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +1 -7
  241. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +1 -7
  242. data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +3 -3
  243. data/lib/generators/ckeditor/templates/ckeditor.rb +3 -0
  244. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +1 -1
  245. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +4 -4
  246. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +4 -4
  247. data/test/dummy/app/views/posts/_form.html.erb +3 -3
  248. data/test/dummy/script/rails +0 -0
  249. data/test/functional/posts_controller_test.rb +3 -3
  250. metadata +346 -321
  251. data/vendor/assets/javascripts/ckeditor/ckeditor.js +0 -830
  252. data/vendor/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.sass +0 -102
  253. data/vendor/assets/javascripts/ckeditor/plugins/code/code/code.js +0 -48
  254. data/vendor/assets/javascripts/ckeditor/plugins/code/images/code.png +0 -0
  255. data/vendor/assets/javascripts/ckeditor/plugins/code/plugin.js +0 -17
  256. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +0 -1
  257. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +0 -29
  258. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +0 -28
  259. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/foldcode/foldcode.js +0 -183
  260. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +0 -1
  261. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +0 -1
  262. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +0 -1
  263. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +0 -1
  264. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  265. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +0 -41
  266. data/vendor/assets/javascripts/ckeditor/plugins/mediaembed/plugin.js +0 -67
  267. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/de.js +0 -12
  268. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/en.js +0 -12
  269. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/fr.js +0 -14
  270. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/nl.js +0 -12
  271. data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/ru.js +0 -12
  272. data/vendor/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.js +0 -912
  273. data/vendor/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.min.js +0 -1
  274. data/vendor/assets/javascripts/ckeditor/plugins/oembed/plugin.js +0 -102
  275. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +0 -31
  276. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +0 -13
  277. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +0 -138
  278. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +0 -20
  279. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +0 -689
  280. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +0 -1245
  281. data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
@@ -19,7 +19,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
19
19
  "function": kw("function"), "catch": kw("catch"),
20
20
  "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
21
21
  "in": operator, "typeof": operator, "instanceof": operator,
22
- "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom
22
+ "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
23
+ "this": kw("this")
23
24
  };
24
25
 
25
26
  // Extend the 'normal' keywords with the TypeScript language extensions
@@ -52,7 +53,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
52
53
  return jsKeywords;
53
54
  }();
54
55
 
55
- var isOperatorChar = /[+\-*&%=<>!?|]/;
56
+ var isOperatorChar = /[+\-*&%=<>!?|~^]/;
56
57
 
57
58
  function chain(stream, state, f) {
58
59
  state.tokenize = f;
@@ -148,7 +149,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
148
149
 
149
150
  // Parser
150
151
 
151
- var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
152
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true};
152
153
 
153
154
  function JSLexical(indented, column, type, align, prev, info) {
154
155
  this.indented = indented;
@@ -300,11 +301,21 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
300
301
  function property(type) {
301
302
  if (type == "variable") {cx.marked = "property"; return cont();}
302
303
  }
303
- function objprop(type) {
304
- if (type == "variable") cx.marked = "property";
305
- else if (type == "number" || type == "string") cx.marked = type + " property";
304
+ function objprop(type, value) {
305
+ if (type == "variable") {
306
+ cx.marked = "property";
307
+ if (value == "get" || value == "set") return cont(getterSetter);
308
+ } else if (type == "number" || type == "string") {
309
+ cx.marked = type + " property";
310
+ }
306
311
  if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression);
307
312
  }
313
+ function getterSetter(type) {
314
+ if (type == ":") return cont(expression);
315
+ if (type != "variable") return cont(expect(":"), expression);
316
+ cx.marked = "property";
317
+ return cont(functiondef);
318
+ }
308
319
  function commasep(what, end) {
309
320
  function proceed(type) {
310
321
  if (type == ",") return cont(what, proceed);
@@ -1,5 +1,7 @@
1
1
  CodeMirror.defineMode("xml", function(config, parserConfig) {
2
2
  var indentUnit = config.indentUnit;
3
+ var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1;
4
+
3
5
  var Kludges = parserConfig.htmlMode ? {
4
6
  autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
5
7
  'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
@@ -165,7 +167,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
165
167
  };
166
168
  }
167
169
 
168
- var curState, setStyle;
170
+ var curState, curStream, setStyle;
169
171
  function pass() {
170
172
  for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
171
173
  }
@@ -191,6 +193,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
191
193
  function element(type) {
192
194
  if (type == "openTag") {
193
195
  curState.tagName = tagName;
196
+ curState.tagStart = curStream.column();
194
197
  return cont(attributes, endtag(curState.startOfLine));
195
198
  } else if (type == "closeTag") {
196
199
  var err = false;
@@ -212,7 +215,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
212
215
  function endtag(startOfLine) {
213
216
  return function(type) {
214
217
  var tagName = curState.tagName;
215
- curState.tagName = null;
218
+ curState.tagName = curState.tagStart = null;
216
219
  if (type == "selfcloseTag" ||
217
220
  (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))) {
218
221
  maybePopContext(tagName.toLowerCase());
@@ -274,11 +277,11 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
274
277
 
275
278
  return {
276
279
  startState: function() {
277
- return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};
280
+ return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, tagStart: null, context: null};
278
281
  },
279
282
 
280
283
  token: function(stream, state) {
281
- if (stream.sol()) {
284
+ if (!state.tagName && stream.sol()) {
282
285
  state.startOfLine = true;
283
286
  state.indented = stream.indentation();
284
287
  }
@@ -288,7 +291,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
288
291
  var style = state.tokenize(stream, state);
289
292
  state.type = type;
290
293
  if ((style || type) && style != "comment") {
291
- curState = state;
294
+ curState = state; curStream = stream;
292
295
  while (true) {
293
296
  var comb = state.cc.pop() || element;
294
297
  if (comb(type || style)) break;
@@ -303,6 +306,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
303
306
  if ((state.tokenize != inTag && state.tokenize != inText) ||
304
307
  context && context.noIndent)
305
308
  return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
309
+ if (state.tagName) return state.tagStart + indentUnit * multilineTagIndentFactor;
306
310
  if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
307
311
  if (context && /^<\//.test(textAfter))
308
312
  context = context.prev;
@@ -3,8 +3,10 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.html or http://ckeditor.com/license
4
4
  */
5
5
  CKEDITOR.plugins.setLang( 'codemirror', 'en', {
6
- toolbar: 'Source',
6
+ toolbar: 'Source',
7
+ searchCode: 'Search Source',
7
8
  autoFormat: 'Format Selection',
8
9
  commentSelectedRange: 'Comment Selection',
9
- uncommentSelectedRange: 'Uncomment Selection'
10
+ uncommentSelectedRange: 'Uncomment Selection',
11
+ autoCompleteToggle: 'Enable/Disable HTML Tag Autocomplete'
10
12
  });
@@ -8,10 +8,10 @@
8
8
 
9
9
  (function() {
10
10
  CKEDITOR.plugins.add('codemirror', {
11
- icons: 'AutoFormat,CommentSelectedRange,UncommentSelectedRange',
11
+ icons: 'SearchCode,AutoFormat,CommentSelectedRange,UncommentSelectedRange,AutoComplete',
12
12
  lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh',
13
13
  init: function(editor) {
14
- var rootPath = this.path;
14
+ var rootPath = this.path;
15
15
  // Default Config
16
16
  var defaultConfig = {
17
17
  theme: 'default',
@@ -19,7 +19,8 @@
19
19
  lineNumbers: true,
20
20
  lineWrapping: true,
21
21
  autoCloseTags: true,
22
- autoCloseBrackets: true,
22
+ autoCloseBrackets: true,
23
+ continueComments: true,
23
24
  enableSearchTools: true,
24
25
  enableCodeFolding: true,
25
26
  enableCodeFormatting: true,
@@ -30,7 +31,9 @@
30
31
  highlightMatches: true,
31
32
  showFormatButton: true,
32
33
  showCommentButton: true,
33
- showUncommentButton: true
34
+ showSearchButton: true,
35
+ showUncommentButton: true,
36
+ showAutoCompleteButton: true
34
37
  };
35
38
  // Get Config & Lang
36
39
  var config = CKEDITOR.tools.extend(defaultConfig, editor.config.codemirror || {}, true);
@@ -42,25 +45,31 @@
42
45
  if (editor.config.codemirror_autoFormatOnStart) {
43
46
  config.autoFormatOnStart = editor.config.codemirror_autoFormatOnStart;
44
47
  }
45
- CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.min.css');
46
48
 
47
- if (config.theme.length && config.theme != 'default') {
48
- CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css');
49
- }
50
- CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.min.js', function() {
51
- CKEDITOR.scriptLoader.load(getCodeMirrorScripts());
52
- });
53
49
  // Source mode isn't available in inline mode yet.
54
- if (editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE) {
50
+ if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
55
51
  return;
56
52
  }
53
+
57
54
  var sourcearea = CKEDITOR.plugins.sourcearea;
58
55
  editor.addMode('source', function(callback) {
59
- if (typeof(CodeMirror) == 'undefined') {
60
- CKEDITOR.scriptLoader.load([rootPath + 'js/codemirror.min.js'].concat(getCodeMirrorScripts()), function() {
61
- loadCodeMirror(editor);
62
- callback();
56
+ if (typeof (CodeMirror) == 'undefined') {
57
+
58
+ CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.min.css');
59
+
60
+ if (config.theme.length && config.theme != 'default') {
61
+ CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css');
62
+ }
63
+
64
+ CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.js', function() {
65
+
66
+ CKEDITOR.scriptLoader.load(getCodeMirrorScripts(), function() {
67
+ loadCodeMirror(editor);
68
+ callback();
69
+ });
63
70
  });
71
+
72
+
64
73
  } else {
65
74
  loadCodeMirror(editor);
66
75
  callback();
@@ -69,8 +78,8 @@
69
78
 
70
79
  function getCodeMirrorScripts() {
71
80
  var scriptFiles = [rootPath + 'js/codemirror.modes.min.js', rootPath + 'js/codemirror.addons.min.js'];
72
-
73
- if (config.enableSearchTools) {
81
+
82
+ if (config.enableSearchTools) {
74
83
  scriptFiles.push(rootPath + 'js/codemirror.search-addons.min.js');
75
84
  }
76
85
  return scriptFiles;
@@ -79,6 +88,7 @@
79
88
  function loadCodeMirror(editor) {
80
89
  var contentsSpace = editor.ui.space('contents'),
81
90
  textarea = contentsSpace.getDocument().createElement('textarea');
91
+
82
92
  textarea.setStyles(
83
93
  CKEDITOR.tools.extend({
84
94
  // IE7 has overflow the <textarea> from wrapping table cell.
@@ -109,6 +119,15 @@
109
119
 
110
120
  codemirror = editor.id;
111
121
 
122
+ /*CodeMirror.commands.autocomplete = function(cm) {
123
+ CodeMirror.showHint(cm, CodeMirror.htmlHint);
124
+ };*/
125
+
126
+ // Enable Code Folding (Requires 'lineNumbers' to be set to 'true')
127
+ if (config.lineNumbers && config.enableCodeFolding) {
128
+ window["foldFunc_" + editor.id] = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder);
129
+ }
130
+
112
131
  window["codemirror_" + editor.id] = CodeMirror.fromTextArea(sourceAreaElement.$, {
113
132
  mode: 'text/html',
114
133
  matchBrackets: config.matchBrackets,
@@ -117,21 +136,23 @@
117
136
  lineNumbers: config.lineNumbers,
118
137
  lineWrapping: config.lineWrapping,
119
138
  autoCloseTags: config.autoCloseTags,
120
- autoCloseBrackets: config.autoCloseBrackets,
139
+ autoCloseBrackets: config.autoCloseBrackets,
121
140
  highlightSelectionMatches: config.highlightMatches,
141
+ continueComments: config.continueComments,
122
142
  theme: config.theme,
143
+ //extraKeys: {"Ctrl-Space": "autocomplete"},
144
+ extraKeys: { "Ctrl-Q": function(codeMirror_Editor) { window["foldFunc_" + editor.id](codeMirror_Editor, codeMirror_Editor.getCursor().line); } },
123
145
  onKeyEvent: function(codeMirror_Editor, evt) {
124
146
  if (config.enableCodeFormatting) {
125
- if (evt.type == "keydown" && evt.ctrlKey && evt.keyCode == 75 && !evt.shiftKey && !evt.altKey) {
126
- var range = getSelectedRange();
147
+ var range = getSelectedRange();
148
+ if (evt.type === "keydown" && evt.ctrlKey && evt.keyCode === 75 && !evt.shiftKey && !evt.altKey) {
127
149
  window["codemirror_" + editor.id].commentRange(true, range.from, range.to);
128
- } else if (evt.type == "keydown" && evt.ctrlKey && evt.keyCode == 75 && evt.shiftKey && !evt.altKey) {
129
- var range = getSelectedRange();
150
+ } else if (evt.type === "keydown" && evt.ctrlKey && evt.keyCode === 75 && evt.shiftKey && !evt.altKey) {
130
151
  window["codemirror_" + editor.id].commentRange(false, range.from, range.to);
131
152
  if (config.autoFormatOnUncomment) {
132
153
  window["codemirror_" + editor.id].autoFormatRange(range.from, range.to);
133
154
  }
134
- } else if (evt.type == "keydown" && evt.ctrlKey && evt.keyCode == 75 && !evt.shiftKey && evt.altKey) {
155
+ } else if (evt.type === "keydown" && evt.ctrlKey && evt.keyCode === 75 && !evt.shiftKey && evt.altKey) {
135
156
  window["codemirror_" + editor.id].autoFormatRange(range.from, range.to);
136
157
  }
137
158
  }
@@ -167,9 +188,10 @@
167
188
  }, 300);
168
189
  });
169
190
  window["codemirror_" + editor.id].setSize(holderWidth, holderHeight);
191
+
170
192
  // Enable Code Folding (Requires 'lineNumbers' to be set to 'true')
171
193
  if (config.lineNumbers && config.enableCodeFolding) {
172
- window["codemirror_" + editor.id].on("gutterClick", CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder));
194
+ window["codemirror_" + editor.id].on("gutterClick", window["foldFunc_" + editor.id]);
173
195
  }
174
196
  // Highlight Active Line
175
197
  if (config.highlightActiveLine) {
@@ -182,6 +204,11 @@
182
204
  }
183
205
  });
184
206
  }
207
+
208
+ // Run config.onLoad callback, if present.
209
+ if (typeof config.onLoad === 'function') {
210
+ config.onLoad(window["codemirror_" + editor.id], editor);
211
+ }
185
212
  }
186
213
 
187
214
  editor.addCommand('source', sourcearea.commands.source);
@@ -193,51 +220,98 @@
193
220
  });
194
221
  }
195
222
  if (config.enableCodeFormatting) {
223
+ editor.addCommand('searchCode', sourcearea.commands.searchCode);
196
224
  editor.addCommand('autoFormat', sourcearea.commands.autoFormat);
197
225
  editor.addCommand('commentSelectedRange', sourcearea.commands.commentSelectedRange);
198
226
  editor.addCommand('uncommentSelectedRange', sourcearea.commands.uncommentSelectedRange);
227
+ editor.addCommand('autoCompleteToggle', sourcearea.commands.autoCompleteToggle);
228
+
199
229
  if (editor.ui.addButton) {
230
+ if (config.showFormatButton || config.showCommentButton || config.showUncommentButton || config.showSearchButton) {
231
+ editor.ui.add('-', CKEDITOR.UI_SEPARATOR, { toolbar: 'mode,30' });
232
+ }
233
+ if (config.showSearchButton && config.enableSearchTools) {
234
+ editor.ui.addButton('searchCode', {
235
+ label: lang.searchCode,
236
+ command: 'searchCode',
237
+ toolbar: 'mode,40'
238
+ });
239
+ }
200
240
  if (config.showFormatButton) {
201
241
  editor.ui.addButton('autoFormat', {
202
242
  label: lang.autoFormat,
203
243
  command: 'autoFormat',
204
- toolbar: 'mode,20'
244
+ toolbar: 'mode,50'
205
245
  });
206
246
  }
207
247
  if (config.showCommentButton) {
208
248
  editor.ui.addButton('CommentSelectedRange', {
209
249
  label: lang.commentSelectedRange,
210
250
  command: 'commentSelectedRange',
211
- toolbar: 'mode,30'
251
+ toolbar: 'mode,60'
212
252
  });
213
253
  }
214
254
  if (config.showUncommentButton) {
215
255
  editor.ui.addButton('UncommentSelectedRange', {
216
256
  label: lang.uncommentSelectedRange,
217
257
  command: 'uncommentSelectedRange',
218
- toolbar: 'mode,40'
258
+ toolbar: 'mode,70'
259
+ });
260
+ }
261
+ if (config.showAutoCompleteButton) {
262
+ editor.ui.addButton('AutoComplete', {
263
+ label: lang.autoCompleteToggle,
264
+ command: 'autoCompleteToggle',
265
+ toolbar: 'mode,80'
219
266
  });
220
267
  }
221
268
  }
222
269
  }
223
- editor.on('mode', function() {
224
- editor.getCommand('source').setState(editor.mode == 'source' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
270
+ editor.on('mode', function () {
271
+ editor.getCommand('source').setState(editor.mode === 'source' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
272
+
273
+ if (editor.mode === 'source') {
274
+ editor.getCommand('autoCompleteToggle').setState(window["codemirror_" + editor.id].config.autoCloseTags ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
275
+ }
276
+
225
277
  });
226
278
  editor.on('resize', function() {
227
- if (window["editable_" + editor.id] && editor.mode == 'source') {
279
+ if (window["editable_" + editor.id] && editor.mode === 'source') {
228
280
  var holderElement = window["editable_" + editor.id].getParent();
229
281
  var holderHeight = holderElement.$.clientHeight + 'px';
230
282
  var holderWidth = holderElement.$.clientWidth + 'px';
231
283
  window["codemirror_" + editor.id].setSize(holderWidth, holderHeight);
232
284
  }
233
285
  });
286
+
287
+ var selectAllCommand = editor.commands.selectAll;
288
+
289
+ if (selectAllCommand != null) {
290
+ selectAllCommand.on('exec', function () {
291
+ if (editor.mode === 'source') {
292
+ window["codemirror_" + editor.id].setSelection({
293
+ line: 0,
294
+ ch: 0
295
+ }, {
296
+ line: window["codemirror_" + editor.id].lineCount(),
297
+ ch: 0
298
+ });
299
+ }
300
+ });
301
+ }
234
302
  }
235
303
  });
236
304
  var sourceEditable = CKEDITOR.tools.createClass({
237
305
  base: CKEDITOR.editable,
238
306
  proto: {
239
307
  setData: function(data) {
308
+
240
309
  this.setValue(data);
310
+
311
+ if (this.codeMirror != null) {
312
+ this.codeMirror.setValue(data);
313
+ }
314
+
241
315
  this.editor.fire('dataReady');
242
316
  },
243
317
  getData: function() {
@@ -257,7 +331,13 @@
257
331
  editorID: null,
258
332
  detach: function() {
259
333
  window["codemirror_" + this.editorID].toTextArea();
334
+
335
+ // Free Memory on destroy
336
+ window["editable_" + this.editorID] = null;
337
+ window["codemirror_" + this.editorID] = null;
338
+
260
339
  sourceEditable.baseProto.detach.call(this);
340
+
261
341
  this.clearCustomData();
262
342
  this.remove();
263
343
  }
@@ -274,12 +354,26 @@ CKEDITOR.plugins.sourcearea = {
274
354
  editorFocus: false,
275
355
  readOnly: 1,
276
356
  exec: function(editor) {
277
- if (editor.mode == 'wysiwyg') editor.fire('saveSnapshot');
357
+ if (editor.mode === 'wysiwyg') {
358
+ editor.fire('saveSnapshot');
359
+ }
278
360
  editor.getCommand('source').setState(CKEDITOR.TRISTATE_DISABLED);
279
- editor.setMode(editor.mode == 'source' ? 'wysiwyg' : 'source');
361
+ editor.setMode(editor.mode === 'source' ? 'wysiwyg' : 'source');
280
362
  },
281
363
  canUndo: false
282
364
  },
365
+ searchCode: {
366
+ modes: {
367
+ wysiwyg: 0,
368
+ source: 1
369
+ },
370
+ editorFocus: false,
371
+ readOnly: 1,
372
+ exec: function(editor) {
373
+ CodeMirror.commands.find(window["codemirror_" + editor.id]);
374
+ },
375
+ canUndo: true
376
+ },
283
377
  autoFormat: {
284
378
  modes: {
285
379
  wysiwyg: 0,
@@ -288,7 +382,7 @@ CKEDITOR.plugins.sourcearea = {
288
382
  editorFocus: false,
289
383
  readOnly: 1,
290
384
  exec: function(editor) {
291
- var range = {
385
+ var range = {
292
386
  from: window["codemirror_" + editor.id].getCursor(true),
293
387
  to: window["codemirror_" + editor.id].getCursor(false)
294
388
  };
@@ -330,6 +424,24 @@ CKEDITOR.plugins.sourcearea = {
330
424
  }
331
425
  },
332
426
  canUndo: true
427
+ },
428
+ autoCompleteToggle: {
429
+ modes: {
430
+ wysiwyg: 0,
431
+ source: 1
432
+ },
433
+ editorFocus: false,
434
+ readOnly: 1,
435
+ exec: function (editor) {
436
+ if (this.state == CKEDITOR.TRISTATE_ON) {
437
+ window["codemirror_" + editor.id].setOption("autoCloseTags", false);
438
+ } else if (this.state == CKEDITOR.TRISTATE_OFF) {
439
+ window["codemirror_" + editor.id].setOption("autoCloseTags", true);
440
+ }
441
+
442
+ this.toggleState();
443
+ },
444
+ canUndo: true
333
445
  }
334
446
  }
335
447
  };