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,785 +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
- function Context(indented, column, type, info, align, prev) {
15
- this.indented = indented;
16
- this.column = column;
17
- this.type = type;
18
- this.info = info;
19
- this.align = align;
20
- this.prev = prev;
21
- }
22
- function pushContext(state, col, type, info) {
23
- var indent = state.indented;
24
- if (state.context && state.context.type == "statement" && type != "statement")
25
- indent = state.context.indented;
26
- return state.context = new Context(indent, col, type, info, null, state.context);
27
- }
28
- function popContext(state) {
29
- var t = state.context.type;
30
- if (t == ")" || t == "]" || t == "}")
31
- state.indented = state.context.indented;
32
- return state.context = state.context.prev;
33
- }
34
-
35
- function typeBefore(stream, state, pos) {
36
- if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
37
- if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
38
- if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
39
- }
40
-
41
- function isTopScope(context) {
42
- for (;;) {
43
- if (!context || context.type == "top") return true;
44
- if (context.type == "}" && context.prev.info != "namespace") return false;
45
- context = context.prev;
46
- }
47
- }
48
-
49
- CodeMirror.defineMode("clike", function(config, parserConfig) {
50
- var indentUnit = config.indentUnit,
51
- statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
52
- dontAlignCalls = parserConfig.dontAlignCalls,
53
- keywords = parserConfig.keywords || {},
54
- types = parserConfig.types || {},
55
- builtin = parserConfig.builtin || {},
56
- blockKeywords = parserConfig.blockKeywords || {},
57
- defKeywords = parserConfig.defKeywords || {},
58
- atoms = parserConfig.atoms || {},
59
- hooks = parserConfig.hooks || {},
60
- multiLineStrings = parserConfig.multiLineStrings,
61
- indentStatements = parserConfig.indentStatements !== false,
62
- indentSwitch = parserConfig.indentSwitch !== false,
63
- namespaceSeparator = parserConfig.namespaceSeparator,
64
- isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
65
- numberStart = parserConfig.numberStart || /[\d\.]/,
66
- number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
67
- isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/;
68
-
69
- var curPunc, isDefKeyword;
70
-
71
- function tokenBase(stream, state) {
72
- var ch = stream.next();
73
- if (hooks[ch]) {
74
- var result = hooks[ch](stream, state);
75
- if (result !== false) return result;
76
- }
77
- if (ch == '"' || ch == "'") {
78
- state.tokenize = tokenString(ch);
79
- return state.tokenize(stream, state);
80
- }
81
- if (isPunctuationChar.test(ch)) {
82
- curPunc = ch;
83
- return null;
84
- }
85
- if (numberStart.test(ch)) {
86
- stream.backUp(1)
87
- if (stream.match(number)) return "number"
88
- stream.next()
89
- }
90
- if (ch == "/") {
91
- if (stream.eat("*")) {
92
- state.tokenize = tokenComment;
93
- return tokenComment(stream, state);
94
- }
95
- if (stream.eat("/")) {
96
- stream.skipToEnd();
97
- return "comment";
98
- }
99
- }
100
- if (isOperatorChar.test(ch)) {
101
- while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {}
102
- return "operator";
103
- }
104
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
105
- if (namespaceSeparator) while (stream.match(namespaceSeparator))
106
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
107
-
108
- var cur = stream.current();
109
- if (contains(keywords, cur)) {
110
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
111
- if (contains(defKeywords, cur)) isDefKeyword = true;
112
- return "keyword";
113
- }
114
- if (contains(types, cur)) return "variable-3";
115
- if (contains(builtin, cur)) {
116
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
117
- return "builtin";
118
- }
119
- if (contains(atoms, cur)) return "atom";
120
- return "variable";
121
- }
122
-
123
- function tokenString(quote) {
124
- return function(stream, state) {
125
- var escaped = false, next, end = false;
126
- while ((next = stream.next()) != null) {
127
- if (next == quote && !escaped) {end = true; break;}
128
- escaped = !escaped && next == "\\";
129
- }
130
- if (end || !(escaped || multiLineStrings))
131
- state.tokenize = null;
132
- return "string";
133
- };
134
- }
135
-
136
- function tokenComment(stream, state) {
137
- var maybeEnd = false, ch;
138
- while (ch = stream.next()) {
139
- if (ch == "/" && maybeEnd) {
140
- state.tokenize = null;
141
- break;
142
- }
143
- maybeEnd = (ch == "*");
144
- }
145
- return "comment";
146
- }
147
-
148
- function maybeEOL(stream, state) {
149
- if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context))
150
- state.typeAtEndOfLine = typeBefore(stream, state, stream.pos)
151
- }
152
-
153
- // Interface
154
-
155
- return {
156
- startState: function(basecolumn) {
157
- return {
158
- tokenize: null,
159
- context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
160
- indented: 0,
161
- startOfLine: true,
162
- prevToken: null
163
- };
164
- },
165
-
166
- token: function(stream, state) {
167
- var ctx = state.context;
168
- if (stream.sol()) {
169
- if (ctx.align == null) ctx.align = false;
170
- state.indented = stream.indentation();
171
- state.startOfLine = true;
172
- }
173
- if (stream.eatSpace()) { maybeEOL(stream, state); return null; }
174
- curPunc = isDefKeyword = null;
175
- var style = (state.tokenize || tokenBase)(stream, state);
176
- if (style == "comment" || style == "meta") return style;
177
- if (ctx.align == null) ctx.align = true;
178
-
179
- if (curPunc == ";" || curPunc == ":" || (curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)))
180
- while (state.context.type == "statement") popContext(state);
181
- else if (curPunc == "{") pushContext(state, stream.column(), "}");
182
- else if (curPunc == "[") pushContext(state, stream.column(), "]");
183
- else if (curPunc == "(") pushContext(state, stream.column(), ")");
184
- else if (curPunc == "}") {
185
- while (ctx.type == "statement") ctx = popContext(state);
186
- if (ctx.type == "}") ctx = popContext(state);
187
- while (ctx.type == "statement") ctx = popContext(state);
188
- }
189
- else if (curPunc == ctx.type) popContext(state);
190
- else if (indentStatements &&
191
- (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
192
- (ctx.type == "statement" && curPunc == "newstatement"))) {
193
- pushContext(state, stream.column(), "statement", stream.current());
194
- }
195
-
196
- if (style == "variable" &&
197
- ((state.prevToken == "def" ||
198
- (parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) &&
199
- isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
200
- style = "def";
201
-
202
- if (hooks.token) {
203
- var result = hooks.token(stream, state, style);
204
- if (result !== undefined) style = result;
205
- }
206
-
207
- if (style == "def" && parserConfig.styleDefs === false) style = "variable";
208
-
209
- state.startOfLine = false;
210
- state.prevToken = isDefKeyword ? "def" : style || curPunc;
211
- maybeEOL(stream, state);
212
- return style;
213
- },
214
-
215
- indent: function(state, textAfter) {
216
- if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
217
- var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
218
- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
219
- if (parserConfig.dontIndentStatements)
220
- while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info))
221
- ctx = ctx.prev
222
- if (hooks.indent) {
223
- var hook = hooks.indent(state, ctx, textAfter);
224
- if (typeof hook == "number") return hook
225
- }
226
- var closing = firstChar == ctx.type;
227
- var switchBlock = ctx.prev && ctx.prev.info == "switch";
228
- if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
229
- while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
230
- return ctx.indented
231
- }
232
- if (ctx.type == "statement")
233
- return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
234
- if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
235
- return ctx.column + (closing ? 0 : 1);
236
- if (ctx.type == ")" && !closing)
237
- return ctx.indented + statementIndentUnit;
238
-
239
- return ctx.indented + (closing ? 0 : indentUnit) +
240
- (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
241
- },
242
-
243
- electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
244
- blockCommentStart: "/*",
245
- blockCommentEnd: "*/",
246
- lineComment: "//",
247
- fold: "brace"
248
- };
249
- });
250
-
251
- function words(str) {
252
- var obj = {}, words = str.split(" ");
253
- for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
254
- return obj;
255
- }
256
- function contains(words, word) {
257
- if (typeof words === "function") {
258
- return words(word);
259
- } else {
260
- return words.propertyIsEnumerable(word);
261
- }
262
- }
263
- var cKeywords = "auto if break case register continue return default do sizeof " +
264
- "static else struct switch extern typedef union for goto while enum const volatile";
265
- var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
266
-
267
- function cppHook(stream, state) {
268
- if (!state.startOfLine) return false
269
- for (var ch, next = null; ch = stream.peek();) {
270
- if (ch == "\\" && stream.match(/^.$/)) {
271
- next = cppHook
272
- break
273
- } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
274
- break
275
- }
276
- stream.next()
277
- }
278
- state.tokenize = next
279
- return "meta"
280
- }
281
-
282
- function pointerHook(_stream, state) {
283
- if (state.prevToken == "variable-3") return "variable-3";
284
- return false;
285
- }
286
-
287
- function cpp14Literal(stream) {
288
- stream.eatWhile(/[\w\.']/);
289
- return "number";
290
- }
291
-
292
- function cpp11StringHook(stream, state) {
293
- stream.backUp(1);
294
- // Raw strings.
295
- if (stream.match(/(R|u8R|uR|UR|LR)/)) {
296
- var match = stream.match(/"([^\s\\()]{0,16})\(/);
297
- if (!match) {
298
- return false;
299
- }
300
- state.cpp11RawStringDelim = match[1];
301
- state.tokenize = tokenRawString;
302
- return tokenRawString(stream, state);
303
- }
304
- // Unicode strings/chars.
305
- if (stream.match(/(u8|u|U|L)/)) {
306
- if (stream.match(/["']/, /* eat */ false)) {
307
- return "string";
308
- }
309
- return false;
310
- }
311
- // Ignore this hook.
312
- stream.next();
313
- return false;
314
- }
315
-
316
- function cppLooksLikeConstructor(word) {
317
- var lastTwo = /(\w+)::(\w+)$/.exec(word);
318
- return lastTwo && lastTwo[1] == lastTwo[2];
319
- }
320
-
321
- // C#-style strings where "" escapes a quote.
322
- function tokenAtString(stream, state) {
323
- var next;
324
- while ((next = stream.next()) != null) {
325
- if (next == '"' && !stream.eat('"')) {
326
- state.tokenize = null;
327
- break;
328
- }
329
- }
330
- return "string";
331
- }
332
-
333
- // C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where
334
- // <delim> can be a string up to 16 characters long.
335
- function tokenRawString(stream, state) {
336
- // Escape characters that have special regex meanings.
337
- var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
338
- var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
339
- if (match)
340
- state.tokenize = null;
341
- else
342
- stream.skipToEnd();
343
- return "string";
344
- }
345
-
346
- function def(mimes, mode) {
347
- if (typeof mimes == "string") mimes = [mimes];
348
- var words = [];
349
- function add(obj) {
350
- if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
351
- words.push(prop);
352
- }
353
- add(mode.keywords);
354
- add(mode.types);
355
- add(mode.builtin);
356
- add(mode.atoms);
357
- if (words.length) {
358
- mode.helperType = mimes[0];
359
- CodeMirror.registerHelper("hintWords", mimes[0], words);
360
- }
361
-
362
- for (var i = 0; i < mimes.length; ++i)
363
- CodeMirror.defineMIME(mimes[i], mode);
364
- }
365
-
366
- def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
367
- name: "clike",
368
- keywords: words(cKeywords),
369
- types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
370
- "int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
371
- "uint32_t uint64_t"),
372
- blockKeywords: words("case do else for if switch while struct"),
373
- defKeywords: words("struct"),
374
- typeFirstDefinitions: true,
375
- atoms: words("null true false"),
376
- hooks: {"#": cppHook, "*": pointerHook},
377
- modeProps: {fold: ["brace", "include"]}
378
- });
379
-
380
- def(["text/x-c++src", "text/x-c++hdr"], {
381
- name: "clike",
382
- keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
383
- "static_cast typeid catch operator template typename class friend private " +
384
- "this using const_cast inline public throw virtual delete mutable protected " +
385
- "alignas alignof constexpr decltype nullptr noexcept thread_local final " +
386
- "static_assert override"),
387
- types: words(cTypes + " bool wchar_t"),
388
- blockKeywords: words("catch class do else finally for if struct switch try while"),
389
- defKeywords: words("class namespace struct enum union"),
390
- typeFirstDefinitions: true,
391
- atoms: words("true false null"),
392
- dontIndentStatements: /^template$/,
393
- hooks: {
394
- "#": cppHook,
395
- "*": pointerHook,
396
- "u": cpp11StringHook,
397
- "U": cpp11StringHook,
398
- "L": cpp11StringHook,
399
- "R": cpp11StringHook,
400
- "0": cpp14Literal,
401
- "1": cpp14Literal,
402
- "2": cpp14Literal,
403
- "3": cpp14Literal,
404
- "4": cpp14Literal,
405
- "5": cpp14Literal,
406
- "6": cpp14Literal,
407
- "7": cpp14Literal,
408
- "8": cpp14Literal,
409
- "9": cpp14Literal,
410
- token: function(stream, state, style) {
411
- if (style == "variable" && stream.peek() == "(" &&
412
- (state.prevToken == ";" || state.prevToken == null ||
413
- state.prevToken == "}") &&
414
- cppLooksLikeConstructor(stream.current()))
415
- return "def";
416
- }
417
- },
418
- namespaceSeparator: "::",
419
- modeProps: {fold: ["brace", "include"]}
420
- });
421
-
422
- def("text/x-java", {
423
- name: "clike",
424
- keywords: words("abstract assert break case catch class const continue default " +
425
- "do else enum extends final finally float for goto if implements import " +
426
- "instanceof interface native new package private protected public " +
427
- "return static strictfp super switch synchronized this throw throws transient " +
428
- "try volatile while"),
429
- types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
430
- "Integer Long Number Object Short String StringBuffer StringBuilder Void"),
431
- blockKeywords: words("catch class do else finally for if switch try while"),
432
- defKeywords: words("class interface package enum"),
433
- typeFirstDefinitions: true,
434
- atoms: words("true false null"),
435
- number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
436
- hooks: {
437
- "@": function(stream) {
438
- stream.eatWhile(/[\w\$_]/);
439
- return "meta";
440
- }
441
- },
442
- modeProps: {fold: ["brace", "import"]}
443
- });
444
-
445
- def("text/x-csharp", {
446
- name: "clike",
447
- keywords: words("abstract as async await base break case catch checked class const continue" +
448
- " default delegate do else enum event explicit extern finally fixed for" +
449
- " foreach goto if implicit in interface internal is lock namespace new" +
450
- " operator out override params private protected public readonly ref return sealed" +
451
- " sizeof stackalloc static struct switch this throw try typeof unchecked" +
452
- " unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
453
- " global group into join let orderby partial remove select set value var yield"),
454
- types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
455
- " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
456
- " UInt64 bool byte char decimal double short int long object" +
457
- " sbyte float string ushort uint ulong"),
458
- blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
459
- defKeywords: words("class interface namespace struct var"),
460
- typeFirstDefinitions: true,
461
- atoms: words("true false null"),
462
- hooks: {
463
- "@": function(stream, state) {
464
- if (stream.eat('"')) {
465
- state.tokenize = tokenAtString;
466
- return tokenAtString(stream, state);
467
- }
468
- stream.eatWhile(/[\w\$_]/);
469
- return "meta";
470
- }
471
- }
472
- });
473
-
474
- function tokenTripleString(stream, state) {
475
- var escaped = false;
476
- while (!stream.eol()) {
477
- if (!escaped && stream.match('"""')) {
478
- state.tokenize = null;
479
- break;
480
- }
481
- escaped = stream.next() == "\\" && !escaped;
482
- }
483
- return "string";
484
- }
485
-
486
- def("text/x-scala", {
487
- name: "clike",
488
- keywords: words(
489
-
490
- /* scala */
491
- "abstract case catch class def do else extends final finally for forSome if " +
492
- "implicit import lazy match new null object override package private protected return " +
493
- "sealed super this throw trait try type val var while with yield _ : = => <- <: " +
494
- "<% >: # @ " +
495
-
496
- /* package scala */
497
- "assert assume require print println printf readLine readBoolean readByte readShort " +
498
- "readChar readInt readLong readFloat readDouble " +
499
-
500
- ":: #:: "
501
- ),
502
- types: words(
503
- "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
504
- "Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " +
505
- "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
506
- "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
507
- "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
508
-
509
- /* package java.lang */
510
- "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
511
- "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
512
- "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
513
- "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
514
- ),
515
- multiLineStrings: true,
516
- blockKeywords: words("catch class do else finally for forSome if match switch try while"),
517
- defKeywords: words("class def object package trait type val var"),
518
- atoms: words("true false null"),
519
- indentStatements: false,
520
- indentSwitch: false,
521
- hooks: {
522
- "@": function(stream) {
523
- stream.eatWhile(/[\w\$_]/);
524
- return "meta";
525
- },
526
- '"': function(stream, state) {
527
- if (!stream.match('""')) return false;
528
- state.tokenize = tokenTripleString;
529
- return state.tokenize(stream, state);
530
- },
531
- "'": function(stream) {
532
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
533
- return "atom";
534
- },
535
- "=": function(stream, state) {
536
- var cx = state.context
537
- if (cx.type == "}" && cx.align && stream.eat(">")) {
538
- state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev)
539
- return "operator"
540
- } else {
541
- return false
542
- }
543
- }
544
- },
545
- modeProps: {closeBrackets: {triples: '"'}}
546
- });
547
-
548
- function tokenKotlinString(tripleString){
549
- return function (stream, state) {
550
- var escaped = false, next, end = false;
551
- while (!stream.eol()) {
552
- if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
553
- if (tripleString && stream.match('"""')) {end = true; break;}
554
- next = stream.next();
555
- if(!escaped && next == "$" && stream.match('{'))
556
- stream.skipTo("}");
557
- escaped = !escaped && next == "\\" && !tripleString;
558
- }
559
- if (end || !tripleString)
560
- state.tokenize = null;
561
- return "string";
562
- }
563
- }
564
-
565
- def("text/x-kotlin", {
566
- name: "clike",
567
- keywords: words(
568
- /*keywords*/
569
- "package as typealias class interface this super val " +
570
- "var fun for is in This throw return " +
571
- "break continue object if else while do try when !in !is as? " +
572
-
573
- /*soft keywords*/
574
- "file import where by get set abstract enum open inner override private public internal " +
575
- "protected catch finally out final vararg reified dynamic companion constructor init " +
576
- "sealed field property receiver param sparam lateinit data inline noinline tailrec " +
577
- "external annotation crossinline const operator infix"
578
- ),
579
- types: words(
580
- /* package java.lang */
581
- "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
582
- "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
583
- "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
584
- "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
585
- ),
586
- intendSwitch: false,
587
- indentStatements: false,
588
- multiLineStrings: true,
589
- blockKeywords: words("catch class do else finally for if where try while enum"),
590
- defKeywords: words("class val var object package interface fun"),
591
- atoms: words("true false null this"),
592
- hooks: {
593
- '"': function(stream, state) {
594
- state.tokenize = tokenKotlinString(stream.match('""'));
595
- return state.tokenize(stream, state);
596
- }
597
- },
598
- modeProps: {closeBrackets: {triples: '"'}}
599
- });
600
-
601
- def(["x-shader/x-vertex", "x-shader/x-fragment"], {
602
- name: "clike",
603
- keywords: words("sampler1D sampler2D sampler3D samplerCube " +
604
- "sampler1DShadow sampler2DShadow " +
605
- "const attribute uniform varying " +
606
- "break continue discard return " +
607
- "for while do if else struct " +
608
- "in out inout"),
609
- types: words("float int bool void " +
610
- "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
611
- "mat2 mat3 mat4"),
612
- blockKeywords: words("for while do if else struct"),
613
- builtin: words("radians degrees sin cos tan asin acos atan " +
614
- "pow exp log exp2 sqrt inversesqrt " +
615
- "abs sign floor ceil fract mod min max clamp mix step smoothstep " +
616
- "length distance dot cross normalize ftransform faceforward " +
617
- "reflect refract matrixCompMult " +
618
- "lessThan lessThanEqual greaterThan greaterThanEqual " +
619
- "equal notEqual any all not " +
620
- "texture1D texture1DProj texture1DLod texture1DProjLod " +
621
- "texture2D texture2DProj texture2DLod texture2DProjLod " +
622
- "texture3D texture3DProj texture3DLod texture3DProjLod " +
623
- "textureCube textureCubeLod " +
624
- "shadow1D shadow2D shadow1DProj shadow2DProj " +
625
- "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
626
- "dFdx dFdy fwidth " +
627
- "noise1 noise2 noise3 noise4"),
628
- atoms: words("true false " +
629
- "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
630
- "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
631
- "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
632
- "gl_FogCoord gl_PointCoord " +
633
- "gl_Position gl_PointSize gl_ClipVertex " +
634
- "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
635
- "gl_TexCoord gl_FogFragCoord " +
636
- "gl_FragCoord gl_FrontFacing " +
637
- "gl_FragData gl_FragDepth " +
638
- "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
639
- "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
640
- "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
641
- "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
642
- "gl_ProjectionMatrixInverseTranspose " +
643
- "gl_ModelViewProjectionMatrixInverseTranspose " +
644
- "gl_TextureMatrixInverseTranspose " +
645
- "gl_NormalScale gl_DepthRange gl_ClipPlane " +
646
- "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
647
- "gl_FrontLightModelProduct gl_BackLightModelProduct " +
648
- "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
649
- "gl_FogParameters " +
650
- "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
651
- "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
652
- "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
653
- "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
654
- "gl_MaxDrawBuffers"),
655
- indentSwitch: false,
656
- hooks: {"#": cppHook},
657
- modeProps: {fold: ["brace", "include"]}
658
- });
659
-
660
- def("text/x-nesc", {
661
- name: "clike",
662
- keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
663
- "implementation includes interface module new norace nx_struct nx_union post provides " +
664
- "signal task uses abstract extends"),
665
- types: words(cTypes),
666
- blockKeywords: words("case do else for if switch while struct"),
667
- atoms: words("null true false"),
668
- hooks: {"#": cppHook},
669
- modeProps: {fold: ["brace", "include"]}
670
- });
671
-
672
- def("text/x-objectivec", {
673
- name: "clike",
674
- keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in " +
675
- "inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
676
- types: words(cTypes),
677
- atoms: words("YES NO NULL NILL ON OFF true false"),
678
- hooks: {
679
- "@": function(stream) {
680
- stream.eatWhile(/[\w\$]/);
681
- return "keyword";
682
- },
683
- "#": cppHook,
684
- indent: function(_state, ctx, textAfter) {
685
- if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented
686
- }
687
- },
688
- modeProps: {fold: "brace"}
689
- });
690
-
691
- def("text/x-squirrel", {
692
- name: "clike",
693
- keywords: words("base break clone continue const default delete enum extends function in class" +
694
- " foreach local resume return this throw typeof yield constructor instanceof static"),
695
- types: words(cTypes),
696
- blockKeywords: words("case catch class else for foreach if switch try while"),
697
- defKeywords: words("function local class"),
698
- typeFirstDefinitions: true,
699
- atoms: words("true false null"),
700
- hooks: {"#": cppHook},
701
- modeProps: {fold: ["brace", "include"]}
702
- });
703
-
704
- // Ceylon Strings need to deal with interpolation
705
- var stringTokenizer = null;
706
- function tokenCeylonString(type) {
707
- return function(stream, state) {
708
- var escaped = false, next, end = false;
709
- while (!stream.eol()) {
710
- if (!escaped && stream.match('"') &&
711
- (type == "single" || stream.match('""'))) {
712
- end = true;
713
- break;
714
- }
715
- if (!escaped && stream.match('``')) {
716
- stringTokenizer = tokenCeylonString(type);
717
- end = true;
718
- break;
719
- }
720
- next = stream.next();
721
- escaped = type == "single" && !escaped && next == "\\";
722
- }
723
- if (end)
724
- state.tokenize = null;
725
- return "string";
726
- }
727
- }
728
-
729
- def("text/x-ceylon", {
730
- name: "clike",
731
- keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" +
732
- " exists extends finally for function given if import in interface is let module new" +
733
- " nonempty object of out outer package return satisfies super switch then this throw" +
734
- " try value void while"),
735
- types: function(word) {
736
- // In Ceylon all identifiers that start with an uppercase are types
737
- var first = word.charAt(0);
738
- return (first === first.toUpperCase() && first !== first.toLowerCase());
739
- },
740
- blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
741
- defKeywords: words("class dynamic function interface module object package value"),
742
- builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" +
743
- " native optional sealed see serializable shared suppressWarnings tagged throws variable"),
744
- isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
745
- isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
746
- numberStart: /[\d#$]/,
747
- number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
748
- multiLineStrings: true,
749
- typeFirstDefinitions: true,
750
- atoms: words("true false null larger smaller equal empty finished"),
751
- indentSwitch: false,
752
- styleDefs: false,
753
- hooks: {
754
- "@": function(stream) {
755
- stream.eatWhile(/[\w\$_]/);
756
- return "meta";
757
- },
758
- '"': function(stream, state) {
759
- state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
760
- return state.tokenize(stream, state);
761
- },
762
- '`': function(stream, state) {
763
- if (!stringTokenizer || !stream.match('`')) return false;
764
- state.tokenize = stringTokenizer;
765
- stringTokenizer = null;
766
- return state.tokenize(stream, state);
767
- },
768
- "'": function(stream) {
769
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
770
- return "atom";
771
- },
772
- token: function(_stream, state, style) {
773
- if ((style == "variable" || style == "variable-3") &&
774
- state.prevToken == ".") {
775
- return "variable-2";
776
- }
777
- }
778
- },
779
- modeProps: {
780
- fold: ["brace", "import"],
781
- closeBrackets: {triples: '"'}
782
- }
783
- });
784
-
785
- });