glebtv-ckeditor 4.6.0 → 4.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (456) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +15 -22
  3. data/MIT-LICENSE +0 -0
  4. data/README.md +2 -325
  5. data/Rakefile +1 -2
  6. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_add.jpg +0 -0
  7. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_add.png +0 -0
  8. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_del.png +0 -0
  9. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/gal_more.gif +0 -0
  10. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/preloader.gif +0 -0
  11. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/avi.gif +0 -0
  12. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/ckfnothumb.gif +0 -0
  13. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/doc.gif +0 -0
  14. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/docx.gif +0 -0
  15. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/exe.gif +0 -0
  16. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/gz.gif +0 -0
  17. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/htm.gif +0 -0
  18. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/jpg.gif +0 -0
  19. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/mp3.gif +0 -0
  20. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/mpg.gif +0 -0
  21. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/pdf.gif +0 -0
  22. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/psd.gif +0 -0
  23. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/rar.gif +0 -0
  24. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/swf.gif +0 -0
  25. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/tar.gif +0 -0
  26. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/txt.gif +0 -0
  27. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/unknown.gif +0 -0
  28. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/wmv.gif +0 -0
  29. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/xls.gif +0 -0
  30. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/xlsx.gif +0 -0
  31. data/app/assets/{javascripts/ckeditor/filebrowser/images → images/ckeditor/filebrowser}/thumbs/zip.gif +0 -0
  32. data/app/assets/javascripts/ckeditor/application.js +0 -0
  33. data/app/assets/javascripts/ckeditor/config.js.erb +1 -2
  34. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/{application.js.erb → application.js} +4 -6
  35. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +0 -0
  36. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.endless-scroll.js +0 -0
  37. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.tmpl.min.js +0 -0
  38. data/app/assets/javascripts/ckeditor/filebrowser/javascripts/rails.js +0 -0
  39. data/app/assets/javascripts/ckeditor/init.js.erb +0 -0
  40. data/app/assets/stylesheets/ckeditor/application.css +1 -1
  41. data/app/assets/stylesheets/ckeditor/filebrowser/uploader.scss +172 -0
  42. data/app/controllers/ckeditor/application_controller.rb +9 -10
  43. data/app/controllers/ckeditor/attachment_files_controller.rb +11 -12
  44. data/app/controllers/ckeditor/pictures_controller.rb +10 -12
  45. data/app/helpers/ckeditor/application_helper.rb +1 -10
  46. data/app/views/ckeditor/attachment_files/index.html.erb +5 -5
  47. data/app/views/ckeditor/pictures/index.html.erb +5 -5
  48. data/app/views/ckeditor/shared/_asset.html.erb +18 -21
  49. data/app/views/ckeditor/shared/_asset_tmpl.html.erb +17 -20
  50. data/app/views/layouts/ckeditor/application.html.erb +3 -3
  51. data/config/locales/en.ckeditor.yml +0 -0
  52. data/config/locales/ru.ckeditor.yml +0 -0
  53. data/config/routes.rb +2 -2
  54. data/lib/ckeditor.rb +42 -34
  55. data/lib/ckeditor/asset_response.rb +74 -25
  56. data/lib/ckeditor/backend/carrierwave.rb +8 -5
  57. data/lib/ckeditor/backend/dragonfly.rb +5 -3
  58. data/lib/ckeditor/backend/paperclip.rb +15 -22
  59. data/lib/ckeditor/backend/refile.rb +6 -4
  60. data/lib/ckeditor/helpers/controllers.rb +15 -20
  61. data/lib/ckeditor/helpers/form_builder.rb +1 -1
  62. data/lib/ckeditor/helpers/form_helper.rb +0 -0
  63. data/lib/ckeditor/helpers/view_helper.rb +0 -0
  64. data/lib/ckeditor/hooks/cancan.rb +0 -2
  65. data/lib/ckeditor/hooks/formtastic.rb +2 -2
  66. data/lib/ckeditor/hooks/pundit.rb +1 -4
  67. data/lib/ckeditor/hooks/simple_form.rb +9 -14
  68. data/lib/ckeditor/http.rb +9 -11
  69. data/lib/ckeditor/orm/active_record.rb +1 -3
  70. data/lib/ckeditor/orm/base.rb +5 -5
  71. data/lib/ckeditor/orm/mongoid.rb +4 -6
  72. data/lib/ckeditor/paginatable.rb +3 -1
  73. data/lib/ckeditor/rails.rb +39 -0
  74. data/lib/ckeditor/text_area.rb +16 -15
  75. data/lib/ckeditor/utils.rb +45 -39
  76. data/lib/ckeditor/utils/content_type_detector.rb +7 -10
  77. data/lib/ckeditor/utils/javascript_code.rb +8 -3
  78. data/lib/ckeditor/version.rb +2 -2
  79. data/lib/generators/ckeditor/install_generator.rb +52 -30
  80. data/lib/generators/ckeditor/pundit_policy_generator.rb +1 -3
  81. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb +2 -2
  82. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb +1 -1
  83. data/lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb +1 -1
  84. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +6 -10
  85. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration_versioned.rb +22 -0
  86. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/asset.rb +1 -1
  87. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/attachment_file.rb +1 -1
  88. data/lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb +4 -4
  89. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +6 -10
  90. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration_versioned.rb +23 -0
  91. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/asset.rb +0 -0
  92. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb +3 -3
  93. data/lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb +5 -5
  94. data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +2 -5
  95. data/lib/generators/ckeditor/templates/active_record/paperclip/migration_versioned.rb +23 -0
  96. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/asset.rb +0 -0
  97. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/attachment_file.rb +0 -0
  98. data/lib/generators/ckeditor/templates/active_record/refile/ckeditor/picture.rb +0 -0
  99. data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +7 -12
  100. data/lib/generators/ckeditor/templates/active_record/refile/migration_versioned.rb +23 -0
  101. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb +0 -0
  102. data/lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb +4 -4
  103. data/lib/generators/ckeditor/templates/base/dragonfly/initializer.rb +4 -5
  104. data/lib/generators/ckeditor/templates/ckeditor.rb +16 -7
  105. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb +2 -2
  106. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb +1 -1
  107. data/lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb +1 -1
  108. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/asset.rb +0 -0
  109. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb +5 -5
  110. data/lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb +5 -5
  111. data/lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb +2 -2
  112. data/lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb +2 -2
  113. data/lib/glebtv-ckeditor.rb +0 -0
  114. data/lib/tasks/ckeditor.rake +6 -14
  115. data/test/controllers/attachment_files_controller_test.rb +0 -0
  116. data/test/controllers/pictures_controller_test.rb +0 -0
  117. data/test/dummy/Rakefile +0 -0
  118. data/test/dummy/app/assets/javascripts/application.js +0 -0
  119. data/test/dummy/app/assets/stylesheets/application.css +0 -0
  120. data/test/dummy/app/assets/stylesheets/scaffold.css +0 -0
  121. data/test/dummy/app/controllers/application_controller.rb +0 -0
  122. data/test/dummy/app/controllers/posts_controller.rb +0 -0
  123. data/test/dummy/app/helpers/application_helper.rb +0 -0
  124. data/test/dummy/app/helpers/posts_helper.rb +0 -0
  125. data/test/dummy/app/models/post.rb +0 -0
  126. data/test/dummy/app/views/layouts/application.html.erb +0 -0
  127. data/test/dummy/app/views/posts/_form.html.erb +0 -0
  128. data/test/dummy/app/views/posts/edit.html.erb +0 -0
  129. data/test/dummy/app/views/posts/index.html.erb +0 -0
  130. data/test/dummy/app/views/posts/new.html.erb +0 -0
  131. data/test/dummy/app/views/posts/show.html.erb +0 -0
  132. data/test/dummy/config.ru +0 -0
  133. data/test/dummy/config/application.rb +0 -0
  134. data/test/dummy/config/boot.rb +0 -0
  135. data/test/dummy/config/database.yml +0 -0
  136. data/test/dummy/config/environment.rb +0 -0
  137. data/test/dummy/config/environments/development.rb +0 -0
  138. data/test/dummy/config/environments/production.rb +0 -0
  139. data/test/dummy/config/environments/test.rb +0 -0
  140. data/test/dummy/config/initializers/assets.rb +1 -0
  141. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -0
  142. data/test/dummy/config/initializers/ckeditor.rb +0 -0
  143. data/test/dummy/config/initializers/cookies_serializer.rb +0 -0
  144. data/test/dummy/config/initializers/inflections.rb +0 -0
  145. data/test/dummy/config/initializers/mime_types.rb +0 -0
  146. data/test/dummy/config/initializers/paperclip.rb +3 -0
  147. data/test/dummy/config/initializers/session_store.rb +0 -0
  148. data/test/dummy/config/initializers/wrap_parameters.rb +0 -0
  149. data/test/dummy/config/locales/en.yml +0 -0
  150. data/test/dummy/config/mongoid.yml +0 -0
  151. data/test/dummy/config/routes.rb +0 -0
  152. data/test/dummy/config/secrets.yml +0 -0
  153. data/test/dummy/db/migrate/20110623120047_create_posts.rb +0 -0
  154. data/test/dummy/public/404.html +0 -0
  155. data/test/dummy/public/422.html +0 -0
  156. data/test/dummy/public/500.html +0 -0
  157. data/test/dummy/public/favicon.ico +0 -0
  158. data/test/dummy/script/rails +0 -0
  159. data/test/dummy/test/fixtures/files/rails.png +0 -0
  160. data/test/dummy/test/fixtures/files/rails.tar.gz +0 -0
  161. data/test/functional/posts_controller_test.rb +2 -3
  162. data/test/generators/install_generator_test.rb +2 -2
  163. data/test/integration/navigation_test.rb +0 -0
  164. data/test/models/attachment_file_test.rb +3 -8
  165. data/test/models/ckeditor_test.rb +1 -1
  166. data/test/models/picture_test.rb +0 -0
  167. data/test/models/utils_test.rb +6 -6
  168. data/test/orm/active_record.rb +0 -0
  169. data/test/orm/mongoid.rb +0 -0
  170. data/test/support/helpers.rb +0 -0
  171. data/test/support/integration_case.rb +0 -0
  172. data/test/support/raw_post.rb +0 -0
  173. data/test/support/routes.txt +0 -0
  174. data/test/test_helper.rb +1 -1
  175. data/vendor/assets/javascripts/ckeditor/CHANGES.md +1358 -0
  176. data/vendor/assets/javascripts/ckeditor/README.md +39 -0
  177. data/vendor/assets/javascripts/ckeditor/build-config.js +31 -30
  178. data/vendor/assets/javascripts/ckeditor/ckeditor.js +709 -675
  179. data/vendor/assets/javascripts/ckeditor/config.js +10 -0
  180. data/vendor/assets/javascripts/ckeditor/contents.css +208 -0
  181. data/vendor/assets/javascripts/ckeditor/lang/en.js +4 -4
  182. data/vendor/assets/javascripts/ckeditor/lang/ru.js +4 -4
  183. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +5 -5
  184. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +3 -2
  185. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
  186. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  187. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -1
  188. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -1
  189. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  190. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +6 -1
  191. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
  192. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -1
  193. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  194. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -1
  195. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -0
  196. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +230 -74
  197. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/abcdef.css +1 -1
  198. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +1 -1
  199. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +1 -1
  200. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +1 -1
  201. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +2 -3
  202. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +1 -1
  203. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +1 -1
  204. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +1 -1
  205. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +1 -1
  206. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/icecoder.css +1 -1
  207. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
  208. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +3 -3
  209. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/material.css +3 -3
  210. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +1 -1
  211. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +0 -2
  212. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +1 -1
  213. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +1 -1
  214. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +1 -1
  215. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +1 -1
  216. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +1 -1
  217. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/seti.css +1 -1
  218. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +1 -1
  219. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +1 -1
  220. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +1 -1
  221. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +1 -1
  222. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +1 -1
  223. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +1 -1
  224. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +1 -1
  225. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/yeti.css +1 -1
  226. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +2 -2
  227. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +2 -2
  228. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +2 -2
  229. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  230. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  231. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +1 -1
  232. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +4 -3
  233. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +23 -23
  234. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/hidpi/loremipsum.png +0 -0
  235. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/icons/loremipsum.png +0 -0
  236. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/en.js +0 -0
  237. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/lang/ru.js +2 -2
  238. data/vendor/assets/javascripts/ckeditor/plugins/loremipsum/plugin.js +2 -2
  239. data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +13 -7
  240. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +49 -39
  241. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/dialog.css +23 -0
  242. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +33 -19
  243. data/vendor/assets/javascripts/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +6 -1
  244. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
  245. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +4 -1
  246. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +92 -23
  247. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +81 -82
  248. data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon-hdpi.png +0 -0
  249. data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
  250. data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +2 -1
  251. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +448 -448
  252. data/vendor/assets/javascripts/ckeditor/samples/css/samples.css +1632 -0
  253. data/vendor/assets/javascripts/ckeditor/samples/img/github-top.png +0 -0
  254. data/vendor/assets/javascripts/ckeditor/samples/img/header-bg.png +0 -0
  255. data/vendor/assets/javascripts/ckeditor/samples/img/header-separator.png +0 -0
  256. data/vendor/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
  257. data/vendor/assets/javascripts/ckeditor/samples/img/navigation-tip.png +0 -0
  258. data/vendor/assets/javascripts/ckeditor/samples/index.html +128 -0
  259. data/vendor/assets/javascripts/ckeditor/samples/js/sample.js +53 -0
  260. data/vendor/assets/javascripts/ckeditor/samples/js/sf.js +17 -0
  261. data/vendor/assets/javascripts/ckeditor/samples/old/ajax.html +85 -0
  262. data/vendor/assets/javascripts/ckeditor/samples/old/api.html +210 -0
  263. data/vendor/assets/javascripts/ckeditor/samples/old/appendto.html +59 -0
  264. data/vendor/assets/javascripts/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
  265. data/vendor/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +204 -0
  266. data/vendor/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +59 -0
  267. data/vendor/assets/javascripts/ckeditor/samples/old/assets/sample.jpg +0 -0
  268. data/vendor/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +7 -0
  269. data/vendor/assets/javascripts/ckeditor/samples/old/datafiltering.html +508 -0
  270. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +48 -0
  271. data/vendor/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +190 -0
  272. data/vendor/assets/javascripts/ckeditor/samples/old/divreplace.html +144 -0
  273. data/vendor/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +106 -0
  274. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
  275. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
  276. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/assets/outputforflash/swfobject.js +19 -0
  277. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputforflash.html +283 -0
  278. data/vendor/assets/javascripts/ckeditor/samples/old/htmlwriter/outputhtml.html +224 -0
  279. data/vendor/assets/javascripts/ckeditor/samples/old/index.html +131 -0
  280. data/vendor/assets/javascripts/ckeditor/samples/old/inlineall.html +314 -0
  281. data/vendor/assets/javascripts/ckeditor/samples/old/inlinebycode.html +124 -0
  282. data/vendor/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +113 -0
  283. data/vendor/assets/javascripts/ckeditor/samples/old/jquery.html +103 -0
  284. data/vendor/assets/javascripts/ckeditor/samples/old/magicline/magicline.html +209 -0
  285. data/vendor/assets/javascripts/ckeditor/samples/old/readonly.html +76 -0
  286. data/vendor/assets/javascripts/ckeditor/samples/old/replacebyclass.html +60 -0
  287. data/vendor/assets/javascripts/ckeditor/samples/old/replacebycode.html +59 -0
  288. data/vendor/assets/javascripts/ckeditor/samples/old/sample.css +357 -0
  289. data/vendor/assets/javascripts/ckeditor/samples/old/sample.js +50 -0
  290. data/vendor/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +16 -0
  291. data/vendor/assets/javascripts/ckeditor/samples/old/tabindex.html +78 -0
  292. data/vendor/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +235 -0
  293. data/vendor/assets/javascripts/ckeditor/samples/old/uicolor.html +72 -0
  294. data/vendor/assets/javascripts/ckeditor/samples/old/uilanguages.html +122 -0
  295. data/vendor/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +80 -0
  296. data/vendor/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +234 -0
  297. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/css/fontello.css +55 -0
  298. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +10 -0
  299. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/config.json +28 -0
  300. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
  301. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.svg +14 -0
  302. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
  303. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
  304. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +446 -0
  305. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +13 -0
  306. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +9 -0
  307. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +33 -0
  308. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +14 -0
  309. data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/LICENSE.md → samples/toolbarconfigurator/lib/codemirror/LICENSE} +19 -21
  310. data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/css → samples/toolbarconfigurator/lib/codemirror}/codemirror.css +325 -341
  311. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +288 -0
  312. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +25 -0
  313. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +36 -0
  314. data/vendor/assets/javascripts/ckeditor/{plugins/codemirror/js/addon/hint → samples/toolbarconfigurator/lib/codemirror}/show-hint.css +38 -36
  315. data/vendor/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +16 -0
  316. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog.css +5 -0
  317. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie.css +5 -0
  318. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie7.css +5 -0
  319. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_ie8.css +5 -0
  320. data/vendor/assets/javascripts/ckeditor/skins/minimalist/dialog_iequirks.css +5 -0
  321. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor.css +5 -0
  322. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_gecko.css +5 -0
  323. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie.css +5 -0
  324. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie7.css +5 -0
  325. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_ie8.css +5 -0
  326. data/vendor/assets/javascripts/ckeditor/skins/minimalist/editor_iequirks.css +5 -0
  327. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons.png +0 -0
  328. data/vendor/assets/javascripts/ckeditor/skins/minimalist/icons_hidpi.png +0 -0
  329. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/arrow.png +0 -0
  330. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/close.png +0 -0
  331. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/close.png +0 -0
  332. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock-open.png +0 -0
  333. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/lock.png +0 -0
  334. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/hidpi/refresh.png +0 -0
  335. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/lock-open.png +0 -0
  336. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/lock.png +0 -0
  337. data/vendor/assets/javascripts/ckeditor/skins/minimalist/images/refresh.png +0 -0
  338. data/vendor/assets/javascripts/ckeditor/skins/minimalist/readme.md +7 -0
  339. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons16.png +0 -0
  340. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons16.svg +2374 -0
  341. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons32.png +0 -0
  342. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/icons32.svg +2722 -0
  343. data/vendor/assets/javascripts/ckeditor/skins/moono/dev/locations.json +145 -0
  344. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +1 -1
  345. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +1 -1
  346. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +1 -1
  347. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +1 -1
  348. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +1 -1
  349. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +1 -1
  350. data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
  351. data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
  352. data/vendor/assets/javascripts/ckeditor/skins/moono/skin.js +10 -0
  353. data/vendor/assets/javascripts/ckeditor/styles.js +1 -1
  354. metadata +182 -177
  355. data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.erb +0 -128
  356. data/app/views/rails_admin/main/_form_ck_editor.html.haml +0 -10
  357. data/app/views/rails_admin/main/_form_ck_editorml.html.haml +0 -11
  358. data/config/locales/bg.ckeditor.yml +0 -9
  359. data/config/locales/cs.ckeditor.yml +0 -9
  360. data/config/locales/de.ckeditor.yml +0 -9
  361. data/config/locales/el-GR.cdkeditor.yml +0 -9
  362. data/config/locales/es.ckeditor.yml +0 -9
  363. data/config/locales/fr.ckeditor.yml +0 -9
  364. data/config/locales/hu.ckeditor.yml +0 -9
  365. data/config/locales/it.ckeditor.yml +0 -9
  366. data/config/locales/ja.ckeditor.yml +0 -9
  367. data/config/locales/nb.ckeditor.yml +0 -9
  368. data/config/locales/nl.ckeditor.yml +0 -9
  369. data/config/locales/pl.ckeditor.yml +0 -9
  370. data/config/locales/pt-BR.ckeditor.yml +0 -9
  371. data/config/locales/pt-PT.ckeditor.yml +0 -9
  372. data/config/locales/sv-SE.ckeditor.yml +0 -9
  373. data/config/locales/tr.ckeditor.yml +0 -9
  374. data/config/locales/uk.ckeditor.yml +0 -9
  375. data/config/locales/zh-CN.ckeditor.yml +0 -9
  376. data/config/locales/zh-TW.ckeditor.yml +0 -9
  377. data/lib/ckeditor/engine.rb +0 -46
  378. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -12
  379. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +0 -183
  380. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/comment.js +0 -206
  381. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/continuecomment.js +0 -85
  382. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.css +0 -32
  383. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +0 -157
  384. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +0 -202
  385. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +0 -169
  386. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +0 -51
  387. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +0 -122
  388. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchtags.js +0 -66
  389. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/trailingspace.js +0 -27
  390. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +0 -105
  391. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/comment-fold.js +0 -59
  392. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +0 -150
  393. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.css +0 -20
  394. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.js +0 -146
  395. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/indent-fold.js +0 -44
  396. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/markdown-fold.js +0 -49
  397. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +0 -182
  398. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +0 -43
  399. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +0 -226
  400. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/anyword-hint.js +0 -41
  401. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/css-hint.js +0 -60
  402. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/html-hint.js +0 -348
  403. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/javascript-hint.js +0 -155
  404. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.js +0 -438
  405. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/sql-hint.js +0 -271
  406. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/xml-hint.js +0 -110
  407. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/loadmode.js +0 -64
  408. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex.js +0 -123
  409. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex_test.js +0 -33
  410. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/overlay.js +0 -85
  411. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/simple.js +0 -213
  412. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/jump-to-line.js +0 -49
  413. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +0 -165
  414. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.css +0 -8
  415. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.js +0 -97
  416. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +0 -252
  417. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +0 -189
  418. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/active-line.js +0 -74
  419. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/mark-selection.js +0 -118
  420. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/selection-pointer.js +0 -98
  421. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify-html.js +0 -952
  422. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.js +0 -2087
  423. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +0 -9109
  424. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/bbcode.js +0 -137
  425. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/index.html +0 -73
  426. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/bbcodemixed.js +0 -161
  427. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/index.html +0 -128
  428. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/clike.js +0 -785
  429. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/index.html +0 -360
  430. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/scala.html +0 -767
  431. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/test.js +0 -55
  432. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/css.js +0 -825
  433. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss.html +0 -103
  434. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss_test.js +0 -17
  435. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/index.html +0 -75
  436. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less.html +0 -152
  437. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less_test.js +0 -54
  438. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss.html +0 -157
  439. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss_test.js +0 -110
  440. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/test.js +0 -200
  441. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/htmlembedded.js +0 -28
  442. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/index.html +0 -60
  443. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/htmlmixed.js +0 -152
  444. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/index.html +0 -89
  445. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/index.html +0 -114
  446. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/javascript.js +0 -784
  447. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/json-ld.html +0 -72
  448. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/test.js +0 -247
  449. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/typescript.html +0 -61
  450. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/index.html +0 -64
  451. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/php.js +0 -234
  452. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/test.js +0 -154
  453. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/index.html +0 -61
  454. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/test.js +0 -51
  455. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/xml.js +0 -394
  456. data/vendor/assets/javascripts/ckeditor/plugins/youtube/LICENSE.md +0 -15
@@ -1,33 +0,0 @@
1
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
- // Distributed under an MIT license: http://codemirror.net/LICENSE
3
-
4
- (function() {
5
- CodeMirror.defineMode("markdown_with_stex", function(){
6
- var inner = CodeMirror.getMode({}, "stex");
7
- var outer = CodeMirror.getMode({}, "markdown");
8
-
9
- var innerOptions = {
10
- open: '$',
11
- close: '$',
12
- mode: inner,
13
- delimStyle: 'delim',
14
- innerStyle: 'inner'
15
- };
16
-
17
- return CodeMirror.multiplexingMode(outer, innerOptions);
18
- });
19
-
20
- var mode = CodeMirror.getMode({}, "markdown_with_stex");
21
-
22
- function MT(name) {
23
- test.mode(
24
- name,
25
- mode,
26
- Array.prototype.slice.call(arguments, 1),
27
- 'multiplexing');
28
- }
29
-
30
- MT(
31
- "stexInsideMarkdown",
32
- "[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]");
33
- })();
@@ -1,85 +0,0 @@
1
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
- // Distributed under an MIT license: http://codemirror.net/LICENSE
3
-
4
- // Utility function that allows modes to be combined. The mode given
5
- // as the base argument takes care of most of the normal mode
6
- // functionality, but a second (typically simple) mode is used, which
7
- // can override the style of text. Both modes get to parse all of the
8
- // text, but when both assign a non-null style to a piece of code, the
9
- // overlay wins, unless the combine argument was true and not overridden,
10
- // or state.overlay.combineTokens was true, in which case the styles are
11
- // combined.
12
-
13
- (function(mod) {
14
- if (typeof exports == "object" && typeof module == "object") // CommonJS
15
- mod(require("../../lib/codemirror"));
16
- else if (typeof define == "function" && define.amd) // AMD
17
- define(["../../lib/codemirror"], mod);
18
- else // Plain browser env
19
- mod(CodeMirror);
20
- })(function(CodeMirror) {
21
- "use strict";
22
-
23
- CodeMirror.overlayMode = function(base, overlay, combine) {
24
- return {
25
- startState: function() {
26
- return {
27
- base: CodeMirror.startState(base),
28
- overlay: CodeMirror.startState(overlay),
29
- basePos: 0, baseCur: null,
30
- overlayPos: 0, overlayCur: null,
31
- streamSeen: null
32
- };
33
- },
34
- copyState: function(state) {
35
- return {
36
- base: CodeMirror.copyState(base, state.base),
37
- overlay: CodeMirror.copyState(overlay, state.overlay),
38
- basePos: state.basePos, baseCur: null,
39
- overlayPos: state.overlayPos, overlayCur: null
40
- };
41
- },
42
-
43
- token: function(stream, state) {
44
- if (stream != state.streamSeen ||
45
- Math.min(state.basePos, state.overlayPos) < stream.start) {
46
- state.streamSeen = stream;
47
- state.basePos = state.overlayPos = stream.start;
48
- }
49
-
50
- if (stream.start == state.basePos) {
51
- state.baseCur = base.token(stream, state.base);
52
- state.basePos = stream.pos;
53
- }
54
- if (stream.start == state.overlayPos) {
55
- stream.pos = stream.start;
56
- state.overlayCur = overlay.token(stream, state.overlay);
57
- state.overlayPos = stream.pos;
58
- }
59
- stream.pos = Math.min(state.basePos, state.overlayPos);
60
-
61
- // state.overlay.combineTokens always takes precedence over combine,
62
- // unless set to null
63
- if (state.overlayCur == null) return state.baseCur;
64
- else if (state.baseCur != null &&
65
- state.overlay.combineTokens ||
66
- combine && state.overlay.combineTokens == null)
67
- return state.baseCur + " " + state.overlayCur;
68
- else return state.overlayCur;
69
- },
70
-
71
- indent: base.indent && function(state, textAfter) {
72
- return base.indent(state.base, textAfter);
73
- },
74
- electricChars: base.electricChars,
75
-
76
- innerMode: function(state) { return {state: state.base, mode: base}; },
77
-
78
- blankLine: function(state) {
79
- if (base.blankLine) base.blankLine(state.base);
80
- if (overlay.blankLine) overlay.blankLine(state.overlay);
81
- }
82
- };
83
- };
84
-
85
- });
@@ -1,213 +0,0 @@
1
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
- // Distributed under an MIT license: http://codemirror.net/LICENSE
3
-
4
- (function(mod) {
5
- if (typeof exports == "object" && typeof module == "object") // CommonJS
6
- mod(require("../../lib/codemirror"));
7
- else if (typeof define == "function" && define.amd) // AMD
8
- define(["../../lib/codemirror"], mod);
9
- else // Plain browser env
10
- mod(CodeMirror);
11
- })(function(CodeMirror) {
12
- "use strict";
13
-
14
- CodeMirror.defineSimpleMode = function(name, states) {
15
- CodeMirror.defineMode(name, function(config) {
16
- return CodeMirror.simpleMode(config, states);
17
- });
18
- };
19
-
20
- CodeMirror.simpleMode = function(config, states) {
21
- ensureState(states, "start");
22
- var states_ = {}, meta = states.meta || {}, hasIndentation = false;
23
- for (var state in states) if (state != meta && states.hasOwnProperty(state)) {
24
- var list = states_[state] = [], orig = states[state];
25
- for (var i = 0; i < orig.length; i++) {
26
- var data = orig[i];
27
- list.push(new Rule(data, states));
28
- if (data.indent || data.dedent) hasIndentation = true;
29
- }
30
- }
31
- var mode = {
32
- startState: function() {
33
- return {state: "start", pending: null,
34
- local: null, localState: null,
35
- indent: hasIndentation ? [] : null};
36
- },
37
- copyState: function(state) {
38
- var s = {state: state.state, pending: state.pending,
39
- local: state.local, localState: null,
40
- indent: state.indent && state.indent.slice(0)};
41
- if (state.localState)
42
- s.localState = CodeMirror.copyState(state.local.mode, state.localState);
43
- if (state.stack)
44
- s.stack = state.stack.slice(0);
45
- for (var pers = state.persistentStates; pers; pers = pers.next)
46
- s.persistentStates = {mode: pers.mode,
47
- spec: pers.spec,
48
- state: pers.state == state.localState ? s.localState : CodeMirror.copyState(pers.mode, pers.state),
49
- next: s.persistentStates};
50
- return s;
51
- },
52
- token: tokenFunction(states_, config),
53
- innerMode: function(state) { return state.local && {mode: state.local.mode, state: state.localState}; },
54
- indent: indentFunction(states_, meta)
55
- };
56
- if (meta) for (var prop in meta) if (meta.hasOwnProperty(prop))
57
- mode[prop] = meta[prop];
58
- return mode;
59
- };
60
-
61
- function ensureState(states, name) {
62
- if (!states.hasOwnProperty(name))
63
- throw new Error("Undefined state " + name + " in simple mode");
64
- }
65
-
66
- function toRegex(val, caret) {
67
- if (!val) return /(?:)/;
68
- var flags = "";
69
- if (val instanceof RegExp) {
70
- if (val.ignoreCase) flags = "i";
71
- val = val.source;
72
- } else {
73
- val = String(val);
74
- }
75
- return new RegExp((caret === false ? "" : "^") + "(?:" + val + ")", flags);
76
- }
77
-
78
- function asToken(val) {
79
- if (!val) return null;
80
- if (typeof val == "string") return val.replace(/\./g, " ");
81
- var result = [];
82
- for (var i = 0; i < val.length; i++)
83
- result.push(val[i] && val[i].replace(/\./g, " "));
84
- return result;
85
- }
86
-
87
- function Rule(data, states) {
88
- if (data.next || data.push) ensureState(states, data.next || data.push);
89
- this.regex = toRegex(data.regex);
90
- this.token = asToken(data.token);
91
- this.data = data;
92
- }
93
-
94
- function tokenFunction(states, config) {
95
- return function(stream, state) {
96
- if (state.pending) {
97
- var pend = state.pending.shift();
98
- if (state.pending.length == 0) state.pending = null;
99
- stream.pos += pend.text.length;
100
- return pend.token;
101
- }
102
-
103
- if (state.local) {
104
- if (state.local.end && stream.match(state.local.end)) {
105
- var tok = state.local.endToken || null;
106
- state.local = state.localState = null;
107
- return tok;
108
- } else {
109
- var tok = state.local.mode.token(stream, state.localState), m;
110
- if (state.local.endScan && (m = state.local.endScan.exec(stream.current())))
111
- stream.pos = stream.start + m.index;
112
- return tok;
113
- }
114
- }
115
-
116
- var curState = states[state.state];
117
- for (var i = 0; i < curState.length; i++) {
118
- var rule = curState[i];
119
- var matches = (!rule.data.sol || stream.sol()) && stream.match(rule.regex);
120
- if (matches) {
121
- if (rule.data.next) {
122
- state.state = rule.data.next;
123
- } else if (rule.data.push) {
124
- (state.stack || (state.stack = [])).push(state.state);
125
- state.state = rule.data.push;
126
- } else if (rule.data.pop && state.stack && state.stack.length) {
127
- state.state = state.stack.pop();
128
- }
129
-
130
- if (rule.data.mode)
131
- enterLocalMode(config, state, rule.data.mode, rule.token);
132
- if (rule.data.indent)
133
- state.indent.push(stream.indentation() + config.indentUnit);
134
- if (rule.data.dedent)
135
- state.indent.pop();
136
- if (matches.length > 2) {
137
- state.pending = [];
138
- for (var j = 2; j < matches.length; j++)
139
- if (matches[j])
140
- state.pending.push({text: matches[j], token: rule.token[j - 1]});
141
- stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0));
142
- return rule.token[0];
143
- } else if (rule.token && rule.token.join) {
144
- return rule.token[0];
145
- } else {
146
- return rule.token;
147
- }
148
- }
149
- }
150
- stream.next();
151
- return null;
152
- };
153
- }
154
-
155
- function cmp(a, b) {
156
- if (a === b) return true;
157
- if (!a || typeof a != "object" || !b || typeof b != "object") return false;
158
- var props = 0;
159
- for (var prop in a) if (a.hasOwnProperty(prop)) {
160
- if (!b.hasOwnProperty(prop) || !cmp(a[prop], b[prop])) return false;
161
- props++;
162
- }
163
- for (var prop in b) if (b.hasOwnProperty(prop)) props--;
164
- return props == 0;
165
- }
166
-
167
- function enterLocalMode(config, state, spec, token) {
168
- var pers;
169
- if (spec.persistent) for (var p = state.persistentStates; p && !pers; p = p.next)
170
- if (spec.spec ? cmp(spec.spec, p.spec) : spec.mode == p.mode) pers = p;
171
- var mode = pers ? pers.mode : spec.mode || CodeMirror.getMode(config, spec.spec);
172
- var lState = pers ? pers.state : CodeMirror.startState(mode);
173
- if (spec.persistent && !pers)
174
- state.persistentStates = {mode: mode, spec: spec.spec, state: lState, next: state.persistentStates};
175
-
176
- state.localState = lState;
177
- state.local = {mode: mode,
178
- end: spec.end && toRegex(spec.end),
179
- endScan: spec.end && spec.forceEnd !== false && toRegex(spec.end, false),
180
- endToken: token && token.join ? token[token.length - 1] : token};
181
- }
182
-
183
- function indexOf(val, arr) {
184
- for (var i = 0; i < arr.length; i++) if (arr[i] === val) return true;
185
- }
186
-
187
- function indentFunction(states, meta) {
188
- return function(state, textAfter, line) {
189
- if (state.local && state.local.mode.indent)
190
- return state.local.mode.indent(state.localState, textAfter, line);
191
- if (state.indent == null || state.local || meta.dontIndentStates && indexOf(state.state, meta.dontIndentStates) > -1)
192
- return CodeMirror.Pass;
193
-
194
- var pos = state.indent.length - 1, rules = states[state.state];
195
- scan: for (;;) {
196
- for (var i = 0; i < rules.length; i++) {
197
- var rule = rules[i];
198
- if (rule.data.dedent && rule.data.dedentIfLineStart !== false) {
199
- var m = rule.regex.exec(textAfter);
200
- if (m && m[0]) {
201
- pos--;
202
- if (rule.next || rule.push) rules = states[rule.next || rule.push];
203
- textAfter = textAfter.slice(m[0].length);
204
- continue scan;
205
- }
206
- }
207
- }
208
- break;
209
- }
210
- return pos < 0 ? 0 : state.indent[pos];
211
- };
212
- }
213
- });
@@ -1,49 +0,0 @@
1
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
- // Distributed under an MIT license: http://codemirror.net/LICENSE
3
-
4
- // Defines jumpToLine command. Uses dialog.js if present.
5
-
6
- (function(mod) {
7
- if (typeof exports == "object" && typeof module == "object") // CommonJS
8
- mod(require("../../lib/codemirror"), require("../dialog/dialog"));
9
- else if (typeof define == "function" && define.amd) // AMD
10
- define(["../../lib/codemirror", "../dialog/dialog"], mod);
11
- else // Plain browser env
12
- mod(CodeMirror);
13
- })(function(CodeMirror) {
14
- "use strict";
15
-
16
- function dialog(cm, text, shortText, deflt, f) {
17
- if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
18
- else f(prompt(shortText, deflt));
19
- }
20
-
21
- var jumpDialog =
22
- 'Jump to line: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use line:column or scroll% syntax)</span>';
23
-
24
- function interpretLine(cm, string) {
25
- var num = Number(string)
26
- if (/^[-+]/.test(string)) return cm.getCursor().line + num
27
- else return num - 1
28
- }
29
-
30
- CodeMirror.commands.jumpToLine = function(cm) {
31
- var cur = cm.getCursor();
32
- dialog(cm, jumpDialog, "Jump to line:", (cur.line + 1) + ":" + cur.ch, function(posStr) {
33
- if (!posStr) return;
34
-
35
- var match;
36
- if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) {
37
- cm.setCursor(interpretLine(cm, match[1]), Number(match[2]))
38
- } else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) {
39
- var line = Math.round(cm.lineCount() * Number(match[1]) / 100);
40
- if (/^[-+]/.test(match[1])) line = cur.line + line + 1;
41
- cm.setCursor(line - 1, cur.ch);
42
- } else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) {
43
- cm.setCursor(interpretLine(cm, match[1]), cur.ch);
44
- }
45
- });
46
- };
47
-
48
- CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine";
49
- });
@@ -1,165 +0,0 @@
1
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
- // Distributed under an MIT license: http://codemirror.net/LICENSE
3
-
4
- // Highlighting text that matches the selection
5
- //
6
- // Defines an option highlightSelectionMatches, which, when enabled,
7
- // will style strings that match the selection throughout the
8
- // document.
9
- //
10
- // The option can be set to true to simply enable it, or to a
11
- // {minChars, style, wordsOnly, showToken, delay} object to explicitly
12
- // configure it. minChars is the minimum amount of characters that should be
13
- // selected for the behavior to occur, and style is the token style to
14
- // apply to the matches. This will be prefixed by "cm-" to create an
15
- // actual CSS class name. If wordsOnly is enabled, the matches will be
16
- // highlighted only if the selected text is a word. showToken, when enabled,
17
- // will cause the current token to be highlighted when nothing is selected.
18
- // delay is used to specify how much time to wait, in milliseconds, before
19
- // highlighting the matches. If annotateScrollbar is enabled, the occurences
20
- // will be highlighted on the scrollbar via the matchesonscrollbar addon.
21
-
22
- (function(mod) {
23
- if (typeof exports == "object" && typeof module == "object") // CommonJS
24
- mod(require("../../lib/codemirror"), require("./matchesonscrollbar"));
25
- else if (typeof define == "function" && define.amd) // AMD
26
- define(["../../lib/codemirror", "./matchesonscrollbar"], mod);
27
- else // Plain browser env
28
- mod(CodeMirror);
29
- })(function(CodeMirror) {
30
- "use strict";
31
-
32
- var defaults = {
33
- style: "matchhighlight",
34
- minChars: 2,
35
- delay: 100,
36
- wordsOnly: false,
37
- annotateScrollbar: false,
38
- showToken: false,
39
- trim: true
40
- }
41
-
42
- function State(options) {
43
- this.options = {}
44
- for (var name in defaults)
45
- this.options[name] = (options && options.hasOwnProperty(name) ? options : defaults)[name]
46
- this.overlay = this.timeout = null;
47
- this.matchesonscroll = null;
48
- this.active = false;
49
- }
50
-
51
- CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
52
- if (old && old != CodeMirror.Init) {
53
- removeOverlay(cm);
54
- clearTimeout(cm.state.matchHighlighter.timeout);
55
- cm.state.matchHighlighter = null;
56
- cm.off("cursorActivity", cursorActivity);
57
- cm.off("focus", onFocus)
58
- }
59
- if (val) {
60
- var state = cm.state.matchHighlighter = new State(val);
61
- if (cm.hasFocus()) {
62
- state.active = true
63
- highlightMatches(cm)
64
- } else {
65
- cm.on("focus", onFocus)
66
- }
67
- cm.on("cursorActivity", cursorActivity);
68
- }
69
- });
70
-
71
- function cursorActivity(cm) {
72
- var state = cm.state.matchHighlighter;
73
- if (state.active || cm.hasFocus()) scheduleHighlight(cm, state)
74
- }
75
-
76
- function onFocus(cm) {
77
- var state = cm.state.matchHighlighter
78
- if (!state.active) {
79
- state.active = true
80
- scheduleHighlight(cm, state)
81
- }
82
- }
83
-
84
- function scheduleHighlight(cm, state) {
85
- clearTimeout(state.timeout);
86
- state.timeout = setTimeout(function() {highlightMatches(cm);}, state.options.delay);
87
- }
88
-
89
- function addOverlay(cm, query, hasBoundary, style) {
90
- var state = cm.state.matchHighlighter;
91
- cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
92
- if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) {
93
- var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
94
- state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false,
95
- {className: "CodeMirror-selection-highlight-scrollbar"});
96
- }
97
- }
98
-
99
- function removeOverlay(cm) {
100
- var state = cm.state.matchHighlighter;
101
- if (state.overlay) {
102
- cm.removeOverlay(state.overlay);
103
- state.overlay = null;
104
- if (state.matchesonscroll) {
105
- state.matchesonscroll.clear();
106
- state.matchesonscroll = null;
107
- }
108
- }
109
- }
110
-
111
- function highlightMatches(cm) {
112
- cm.operation(function() {
113
- var state = cm.state.matchHighlighter;
114
- removeOverlay(cm);
115
- if (!cm.somethingSelected() && state.options.showToken) {
116
- var re = state.options.showToken === true ? /[\w$]/ : state.options.showToken;
117
- var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
118
- while (start && re.test(line.charAt(start - 1))) --start;
119
- while (end < line.length && re.test(line.charAt(end))) ++end;
120
- if (start < end)
121
- addOverlay(cm, line.slice(start, end), re, state.options.style);
122
- return;
123
- }
124
- var from = cm.getCursor("from"), to = cm.getCursor("to");
125
- if (from.line != to.line) return;
126
- if (state.options.wordsOnly && !isWord(cm, from, to)) return;
127
- var selection = cm.getRange(from, to)
128
- if (state.options.trim) selection = selection.replace(/^\s+|\s+$/g, "")
129
- if (selection.length >= state.options.minChars)
130
- addOverlay(cm, selection, false, state.options.style);
131
- });
132
- }
133
-
134
- function isWord(cm, from, to) {
135
- var str = cm.getRange(from, to);
136
- if (str.match(/^\w+$/) !== null) {
137
- if (from.ch > 0) {
138
- var pos = {line: from.line, ch: from.ch - 1};
139
- var chr = cm.getRange(pos, from);
140
- if (chr.match(/\W/) === null) return false;
141
- }
142
- if (to.ch < cm.getLine(from.line).length) {
143
- var pos = {line: to.line, ch: to.ch + 1};
144
- var chr = cm.getRange(to, pos);
145
- if (chr.match(/\W/) === null) return false;
146
- }
147
- return true;
148
- } else return false;
149
- }
150
-
151
- function boundariesAround(stream, re) {
152
- return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) &&
153
- (stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos)));
154
- }
155
-
156
- function makeOverlay(query, hasBoundary, style) {
157
- return {token: function(stream) {
158
- if (stream.match(query) &&
159
- (!hasBoundary || boundariesAround(stream, hasBoundary)))
160
- return style;
161
- stream.next();
162
- stream.skipTo(query.charAt(0)) || stream.skipToEnd();
163
- }};
164
- }
165
- });