locomotivecms 4.1.1 → 4.2.0.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (301) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +4 -3
  4. data/Rakefile +4 -0
  5. data/app/api/locomotive/api.rb +1 -1
  6. data/app/assets/config/locomotive_manifest.js +2 -0
  7. data/app/assets/javascripts/locomotive.js +2 -2
  8. data/app/assets/stylesheets/locomotive/account.scss +0 -1
  9. data/app/assets/stylesheets/locomotive/application.scss +0 -1
  10. data/app/assets/stylesheets/locomotive/live_editing_error.scss +0 -1
  11. data/app/assets/stylesheets/locomotive/live_editing_iframe.scss +0 -1
  12. data/app/controllers/locomotive/base_controller.rb +1 -1
  13. data/app/controllers/locomotive/concerns/authorization_controller.rb +1 -1
  14. data/app/controllers/locomotive/concerns/redirect_to_main_host_controller.rb +1 -1
  15. data/app/controllers/locomotive/concerns/site_dispatcher_controller.rb +1 -1
  16. data/app/controllers/locomotive/errors_controller.rb +1 -1
  17. data/app/controllers/locomotive/my_account_controller.rb +1 -1
  18. data/app/controllers/locomotive/passwords_controller.rb +3 -1
  19. data/app/controllers/locomotive/registrations_controller.rb +3 -1
  20. data/app/controllers/locomotive/sessions_controller.rb +3 -1
  21. data/app/controllers/locomotive/sites_controller.rb +1 -1
  22. data/app/helpers/locomotive/base_helper.rb +2 -2
  23. data/app/helpers/locomotive/custom_fields_helper.rb +2 -2
  24. data/app/helpers/locomotive/shared/activities_helper.rb +1 -1
  25. data/app/inputs/locomotive/api_key_input.rb +1 -1
  26. data/app/mailers/locomotive/notifications.rb +1 -1
  27. data/app/models/locomotive/account.rb +1 -1
  28. data/app/models/locomotive/concerns/account/api_key.rb +1 -1
  29. data/app/models/locomotive/concerns/content_entry/csv.rb +1 -1
  30. data/app/models/locomotive/concerns/content_entry/slug.rb +5 -5
  31. data/app/models/locomotive/concerns/content_type/entry_template.rb +3 -3
  32. data/app/models/locomotive/concerns/page/templatized.rb +1 -1
  33. data/app/models/locomotive/concerns/shared/json_attribute.rb +21 -2
  34. data/app/models/locomotive/concerns/site/routes.rb +1 -1
  35. data/app/models/locomotive/content_entry.rb +2 -2
  36. data/app/models/locomotive/page.rb +3 -3
  37. data/app/models/locomotive/section.rb +1 -1
  38. data/app/models/locomotive/snippet.rb +1 -1
  39. data/app/models/locomotive/translation.rb +1 -1
  40. data/app/services/locomotive/content_entry_import_service.rb +1 -1
  41. data/app/services/locomotive/content_entry_service.rb +2 -2
  42. data/app/services/locomotive/content_type_service.rb +13 -3
  43. data/app/services/locomotive/custom_field_service.rb +2 -2
  44. data/app/services/locomotive/editor_service.rb +1 -1
  45. data/app/uploaders/locomotive/base_uploader.rb +0 -10
  46. data/app/views/locomotive/dashboard/_activity.html.slim +1 -1
  47. data/app/views/locomotive/page_content/_edit.json.jbuilder +50 -0
  48. data/app/views/locomotive/page_content/edit.html.erb +1 -1
  49. data/app/views/locomotive/page_content/edit.json.jbuilder +52 -50
  50. data/config/initializers/devise.rb +5 -2
  51. data/lib/generators/locomotive/install/templates/locomotive.rb +0 -5
  52. data/lib/locomotive/action_controller/responder.rb +1 -1
  53. data/lib/locomotive/configuration.rb +2 -2
  54. data/lib/locomotive/dependencies.rb +0 -2
  55. data/lib/locomotive/engine.rb +14 -2
  56. data/lib/locomotive/mongoid/patches.rb +47 -65
  57. data/lib/locomotive/steam/services/api_entry_submission_service.rb +1 -0
  58. data/lib/locomotive/version.rb +1 -1
  59. data/vendor/assets/javascripts/locomotive/codemirror/addons/comment/comment.js +203 -0
  60. data/vendor/assets/javascripts/locomotive/codemirror/addons/comment/continuecomment.js +85 -0
  61. data/vendor/assets/javascripts/locomotive/codemirror/addons/dialog/dialog.js +157 -0
  62. data/vendor/assets/javascripts/locomotive/codemirror/addons/display/autorefresh.js +47 -0
  63. data/vendor/assets/javascripts/locomotive/codemirror/addons/display/fullscreen.js +41 -0
  64. data/vendor/assets/javascripts/locomotive/codemirror/addons/display/panel.js +112 -0
  65. data/vendor/assets/javascripts/locomotive/codemirror/addons/display/placeholder.js +62 -0
  66. data/vendor/assets/javascripts/locomotive/codemirror/addons/display/rulers.js +51 -0
  67. data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/closebrackets.js +195 -0
  68. data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/closetag.js +169 -0
  69. data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/continuelist.js +51 -0
  70. data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/matchbrackets.js +120 -0
  71. data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/matchtags.js +66 -0
  72. data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/trailingspace.js +27 -0
  73. data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/brace-fold.js +105 -0
  74. data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/comment-fold.js +59 -0
  75. data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/foldcode.js +150 -0
  76. data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/foldgutter.js +146 -0
  77. data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/indent-fold.js +44 -0
  78. data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/markdown-fold.js +49 -0
  79. data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/xml-fold.js +182 -0
  80. data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/anyword-hint.js +41 -0
  81. data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/css-hint.js +60 -0
  82. data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/html-hint.js +348 -0
  83. data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/javascript-hint.js +146 -0
  84. data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/show-hint.js +437 -0
  85. data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/sql-hint.js +271 -0
  86. data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/xml-hint.js +110 -0
  87. data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/coffeescript-lint.js +41 -0
  88. data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/css-lint.js +35 -0
  89. data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/html-lint.js +46 -0
  90. data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/javascript-lint.js +136 -0
  91. data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/json-lint.js +31 -0
  92. data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/lint.js +239 -0
  93. data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/yaml-lint.js +28 -0
  94. data/vendor/assets/javascripts/locomotive/codemirror/addons/merge/merge.js +773 -0
  95. data/vendor/assets/javascripts/locomotive/codemirror/addons/mode/loadmode.js +64 -0
  96. data/vendor/assets/javascripts/locomotive/codemirror/addons/mode/multiplex.js +123 -0
  97. data/vendor/assets/javascripts/locomotive/codemirror/addons/mode/overlay.js +85 -0
  98. data/vendor/assets/javascripts/locomotive/codemirror/addons/mode/simple.js +213 -0
  99. data/vendor/assets/javascripts/locomotive/codemirror/addons/runmode/colorize.js +40 -0
  100. data/vendor/assets/javascripts/locomotive/codemirror/addons/runmode/runmode-standalone.js +157 -0
  101. data/vendor/assets/javascripts/locomotive/codemirror/addons/runmode/runmode.js +72 -0
  102. data/vendor/assets/javascripts/locomotive/codemirror/addons/runmode/runmode.node.js +179 -0
  103. data/vendor/assets/javascripts/locomotive/codemirror/addons/scroll/annotatescrollbar.js +118 -0
  104. data/vendor/assets/javascripts/locomotive/codemirror/addons/scroll/scrollpastend.js +48 -0
  105. data/vendor/assets/javascripts/locomotive/codemirror/addons/scroll/simplescrollbars.js +152 -0
  106. data/vendor/assets/javascripts/locomotive/codemirror/addons/search/jump-to-line.js +49 -0
  107. data/vendor/assets/javascripts/locomotive/codemirror/addons/search/match-highlighter.js +146 -0
  108. data/vendor/assets/javascripts/locomotive/codemirror/addons/search/matchesonscrollbar.js +97 -0
  109. data/vendor/assets/javascripts/locomotive/codemirror/addons/search/search.js +249 -0
  110. data/vendor/assets/javascripts/locomotive/codemirror/addons/search/searchcursor.js +189 -0
  111. data/vendor/assets/javascripts/locomotive/codemirror/addons/selection/active-line.js +74 -0
  112. data/vendor/assets/javascripts/locomotive/codemirror/addons/selection/mark-selection.js +118 -0
  113. data/vendor/assets/javascripts/locomotive/codemirror/addons/selection/selection-pointer.js +98 -0
  114. data/vendor/assets/javascripts/locomotive/codemirror/addons/tern/tern.js +701 -0
  115. data/vendor/assets/javascripts/locomotive/codemirror/addons/tern/worker.js +44 -0
  116. data/vendor/assets/javascripts/locomotive/codemirror/addons/wrap/hardwrap.js +144 -0
  117. data/vendor/assets/javascripts/locomotive/codemirror/keymaps/emacs.js +412 -0
  118. data/vendor/assets/javascripts/locomotive/codemirror/keymaps/sublime.js +580 -0
  119. data/vendor/assets/javascripts/locomotive/codemirror/keymaps/vim.js +5065 -0
  120. data/vendor/assets/javascripts/locomotive/codemirror/modes/apl.js +174 -0
  121. data/vendor/assets/javascripts/locomotive/codemirror/modes/asciiarmor.js +73 -0
  122. data/vendor/assets/javascripts/locomotive/codemirror/modes/asn.1.js +204 -0
  123. data/vendor/assets/javascripts/locomotive/codemirror/modes/asterisk.js +196 -0
  124. data/vendor/assets/javascripts/locomotive/codemirror/modes/brainfuck.js +85 -0
  125. data/vendor/assets/javascripts/locomotive/codemirror/modes/clike.js +786 -0
  126. data/vendor/assets/javascripts/locomotive/codemirror/modes/clojure.js +306 -0
  127. data/vendor/assets/javascripts/locomotive/codemirror/modes/cmake.js +97 -0
  128. data/vendor/assets/javascripts/locomotive/codemirror/modes/cobol.js +255 -0
  129. data/vendor/assets/javascripts/locomotive/codemirror/modes/coffeescript.js +355 -0
  130. data/vendor/assets/javascripts/locomotive/codemirror/modes/commonlisp.js +123 -0
  131. data/vendor/assets/javascripts/locomotive/codemirror/modes/crystal.js +391 -0
  132. data/vendor/assets/javascripts/locomotive/codemirror/modes/css.js +825 -0
  133. data/vendor/assets/javascripts/locomotive/codemirror/modes/cypher.js +146 -0
  134. data/vendor/assets/javascripts/locomotive/codemirror/modes/d.js +218 -0
  135. data/vendor/assets/javascripts/locomotive/codemirror/modes/dart.js +157 -0
  136. data/vendor/assets/javascripts/locomotive/codemirror/modes/diff.js +47 -0
  137. data/vendor/assets/javascripts/locomotive/codemirror/modes/django.js +356 -0
  138. data/vendor/assets/javascripts/locomotive/codemirror/modes/dockerfile.js +79 -0
  139. data/vendor/assets/javascripts/locomotive/codemirror/modes/dtd.js +142 -0
  140. data/vendor/assets/javascripts/locomotive/codemirror/modes/dylan.js +344 -0
  141. data/vendor/assets/javascripts/locomotive/codemirror/modes/ebnf.js +195 -0
  142. data/vendor/assets/javascripts/locomotive/codemirror/modes/ecl.js +206 -0
  143. data/vendor/assets/javascripts/locomotive/codemirror/modes/eiffel.js +160 -0
  144. data/vendor/assets/javascripts/locomotive/codemirror/modes/elm.js +205 -0
  145. data/vendor/assets/javascripts/locomotive/codemirror/modes/erlang.js +618 -0
  146. data/vendor/assets/javascripts/locomotive/codemirror/modes/factor.js +83 -0
  147. data/vendor/assets/javascripts/locomotive/codemirror/modes/fcl.js +173 -0
  148. data/vendor/assets/javascripts/locomotive/codemirror/modes/forth.js +180 -0
  149. data/vendor/assets/javascripts/locomotive/codemirror/modes/fortran.js +188 -0
  150. data/vendor/assets/javascripts/locomotive/codemirror/modes/gas.js +345 -0
  151. data/vendor/assets/javascripts/locomotive/codemirror/modes/gfm.js +130 -0
  152. data/vendor/assets/javascripts/locomotive/codemirror/modes/gherkin.js +178 -0
  153. data/vendor/assets/javascripts/locomotive/codemirror/modes/go.js +185 -0
  154. data/vendor/assets/javascripts/locomotive/codemirror/modes/groovy.js +230 -0
  155. data/vendor/assets/javascripts/locomotive/codemirror/modes/haml.js +161 -0
  156. data/vendor/assets/javascripts/locomotive/codemirror/modes/handlebars.js +62 -0
  157. data/vendor/assets/javascripts/locomotive/codemirror/modes/haskell-literate.js +43 -0
  158. data/vendor/assets/javascripts/locomotive/codemirror/modes/haskell.js +267 -0
  159. data/vendor/assets/javascripts/locomotive/codemirror/modes/haxe.js +515 -0
  160. data/vendor/assets/javascripts/locomotive/codemirror/modes/htmlembedded.js +28 -0
  161. data/vendor/assets/javascripts/locomotive/codemirror/modes/htmlmixed.js +152 -0
  162. data/vendor/assets/javascripts/locomotive/codemirror/modes/http.js +113 -0
  163. data/vendor/assets/javascripts/locomotive/codemirror/modes/idl.js +290 -0
  164. data/vendor/assets/javascripts/locomotive/codemirror/modes/jade.js +590 -0
  165. data/vendor/assets/javascripts/locomotive/codemirror/modes/javascript.js +748 -0
  166. data/vendor/assets/javascripts/locomotive/codemirror/modes/jinja2.js +142 -0
  167. data/vendor/assets/javascripts/locomotive/codemirror/modes/jsx.js +147 -0
  168. data/vendor/assets/javascripts/locomotive/codemirror/modes/julia.js +392 -0
  169. data/vendor/assets/javascripts/locomotive/codemirror/modes/livescript.js +280 -0
  170. data/vendor/assets/javascripts/locomotive/codemirror/modes/lua.js +159 -0
  171. data/vendor/assets/javascripts/locomotive/codemirror/modes/markdown.js +797 -0
  172. data/vendor/assets/javascripts/locomotive/codemirror/modes/mathematica.js +176 -0
  173. data/vendor/assets/javascripts/locomotive/codemirror/modes/mbox.js +129 -0
  174. data/vendor/assets/javascripts/locomotive/codemirror/modes/mirc.js +193 -0
  175. data/vendor/assets/javascripts/locomotive/codemirror/modes/mllike.js +205 -0
  176. data/vendor/assets/javascripts/locomotive/codemirror/modes/modelica.js +245 -0
  177. data/vendor/assets/javascripts/locomotive/codemirror/modes/mscgen.js +169 -0
  178. data/vendor/assets/javascripts/locomotive/codemirror/modes/mumps.js +148 -0
  179. data/vendor/assets/javascripts/locomotive/codemirror/modes/nginx.js +178 -0
  180. data/vendor/assets/javascripts/locomotive/codemirror/modes/nsis.js +95 -0
  181. data/vendor/assets/javascripts/locomotive/codemirror/modes/ntriples.js +186 -0
  182. data/vendor/assets/javascripts/locomotive/codemirror/modes/octave.js +135 -0
  183. data/vendor/assets/javascripts/locomotive/codemirror/modes/oz.js +252 -0
  184. data/vendor/assets/javascripts/locomotive/codemirror/modes/pascal.js +109 -0
  185. data/vendor/assets/javascripts/locomotive/codemirror/modes/pegjs.js +114 -0
  186. data/vendor/assets/javascripts/locomotive/codemirror/modes/perl.js +837 -0
  187. data/vendor/assets/javascripts/locomotive/codemirror/modes/php.js +234 -0
  188. data/vendor/assets/javascripts/locomotive/codemirror/modes/pig.js +178 -0
  189. data/vendor/assets/javascripts/locomotive/codemirror/modes/powershell.js +396 -0
  190. data/vendor/assets/javascripts/locomotive/codemirror/modes/properties.js +78 -0
  191. data/vendor/assets/javascripts/locomotive/codemirror/modes/protobuf.js +68 -0
  192. data/vendor/assets/javascripts/locomotive/codemirror/modes/puppet.js +220 -0
  193. data/vendor/assets/javascripts/locomotive/codemirror/modes/python.js +340 -0
  194. data/vendor/assets/javascripts/locomotive/codemirror/modes/q.js +139 -0
  195. data/vendor/assets/javascripts/locomotive/codemirror/modes/r.js +164 -0
  196. data/vendor/assets/javascripts/locomotive/codemirror/modes/rpm.js +109 -0
  197. data/vendor/assets/javascripts/locomotive/codemirror/modes/rst.js +557 -0
  198. data/vendor/assets/javascripts/locomotive/codemirror/modes/ruby.js +285 -0
  199. data/vendor/assets/javascripts/locomotive/codemirror/modes/rust.js +71 -0
  200. data/vendor/assets/javascripts/locomotive/codemirror/modes/sas.js +315 -0
  201. data/vendor/assets/javascripts/locomotive/codemirror/modes/sass.js +414 -0
  202. data/vendor/assets/javascripts/locomotive/codemirror/modes/scheme.js +249 -0
  203. data/vendor/assets/javascripts/locomotive/codemirror/modes/shell.js +139 -0
  204. data/vendor/assets/javascripts/locomotive/codemirror/modes/sieve.js +193 -0
  205. data/vendor/assets/javascripts/locomotive/codemirror/modes/slim.js +575 -0
  206. data/vendor/assets/javascripts/locomotive/codemirror/modes/smalltalk.js +168 -0
  207. data/vendor/assets/javascripts/locomotive/codemirror/modes/smarty.js +225 -0
  208. data/vendor/assets/javascripts/locomotive/codemirror/modes/solr.js +104 -0
  209. data/vendor/assets/javascripts/locomotive/codemirror/modes/soy.js +199 -0
  210. data/vendor/assets/javascripts/locomotive/codemirror/modes/sparql.js +180 -0
  211. data/vendor/assets/javascripts/locomotive/codemirror/modes/spreadsheet.js +112 -0
  212. data/vendor/assets/javascripts/locomotive/codemirror/modes/sql.js +413 -0
  213. data/vendor/assets/javascripts/locomotive/codemirror/modes/stex.js +251 -0
  214. data/vendor/assets/javascripts/locomotive/codemirror/modes/stylus.js +769 -0
  215. data/vendor/assets/javascripts/locomotive/codemirror/modes/swift.js +202 -0
  216. data/vendor/assets/javascripts/locomotive/codemirror/modes/tcl.js +139 -0
  217. data/vendor/assets/javascripts/locomotive/codemirror/modes/textile.js +469 -0
  218. data/vendor/assets/javascripts/locomotive/codemirror/modes/tiddlywiki.js +308 -0
  219. data/vendor/assets/javascripts/locomotive/codemirror/modes/tiki.js +312 -0
  220. data/vendor/assets/javascripts/locomotive/codemirror/modes/toml.js +88 -0
  221. data/vendor/assets/javascripts/locomotive/codemirror/modes/tornado.js +68 -0
  222. data/vendor/assets/javascripts/locomotive/codemirror/modes/troff.js +84 -0
  223. data/vendor/assets/javascripts/locomotive/codemirror/modes/ttcn-cfg.js +214 -0
  224. data/vendor/assets/javascripts/locomotive/codemirror/modes/ttcn.js +283 -0
  225. data/vendor/assets/javascripts/locomotive/codemirror/modes/turtle.js +162 -0
  226. data/vendor/assets/javascripts/locomotive/codemirror/modes/twig.js +141 -0
  227. data/vendor/assets/javascripts/locomotive/codemirror/modes/vb.js +276 -0
  228. data/vendor/assets/javascripts/locomotive/codemirror/modes/vbscript.js +350 -0
  229. data/vendor/assets/javascripts/locomotive/codemirror/modes/velocity.js +201 -0
  230. data/vendor/assets/javascripts/locomotive/codemirror/modes/verilog.js +537 -0
  231. data/vendor/assets/javascripts/locomotive/codemirror/modes/vhdl.js +189 -0
  232. data/vendor/assets/javascripts/locomotive/codemirror/modes/vue.js +69 -0
  233. data/vendor/assets/javascripts/locomotive/codemirror/modes/webidl.js +195 -0
  234. data/vendor/assets/javascripts/locomotive/codemirror/modes/xml.js +394 -0
  235. data/vendor/assets/javascripts/locomotive/codemirror/modes/xquery.js +437 -0
  236. data/vendor/assets/javascripts/locomotive/codemirror/modes/yacas.js +204 -0
  237. data/vendor/assets/javascripts/locomotive/codemirror/modes/yaml-frontmatter.js +68 -0
  238. data/vendor/assets/javascripts/locomotive/codemirror/modes/yaml.js +117 -0
  239. data/vendor/assets/javascripts/locomotive/codemirror/modes/z80.js +116 -0
  240. data/vendor/assets/javascripts/locomotive/codemirror.js +8922 -0
  241. data/vendor/assets/javascripts/locomotive/select2.js +436 -175
  242. data/vendor/assets/javascripts/locomotive/wysihtml5x-toolbar.js +1346 -564
  243. data/vendor/assets/stylesheets/locomotive/codemirror/addons/dialog/dialog.css +32 -0
  244. data/vendor/assets/stylesheets/locomotive/codemirror/addons/display/fullscreen.css +6 -0
  245. data/vendor/assets/stylesheets/locomotive/codemirror/addons/fold/foldgutter.css +20 -0
  246. data/vendor/assets/stylesheets/locomotive/codemirror/addons/hint/show-hint.css +37 -0
  247. data/vendor/assets/stylesheets/locomotive/codemirror/addons/lint/lint.css +73 -0
  248. data/vendor/assets/stylesheets/locomotive/codemirror/addons/merge/merge.css +113 -0
  249. data/vendor/assets/stylesheets/locomotive/codemirror/addons/scroll/simplescrollbars.css +66 -0
  250. data/vendor/assets/stylesheets/locomotive/codemirror/addons/search/matchesonscrollbar.css +8 -0
  251. data/vendor/assets/stylesheets/locomotive/codemirror/addons/tern/tern.css +87 -0
  252. data/vendor/assets/stylesheets/locomotive/codemirror/modes/tiddlywiki.css +14 -0
  253. data/vendor/assets/stylesheets/locomotive/codemirror/modes/tiki.css +26 -0
  254. data/vendor/assets/stylesheets/locomotive/codemirror/themes/3024-day.css +41 -0
  255. data/vendor/assets/stylesheets/locomotive/codemirror/themes/3024-night.css +39 -0
  256. data/vendor/assets/stylesheets/locomotive/codemirror/themes/abcdef.css +32 -0
  257. data/vendor/assets/stylesheets/locomotive/codemirror/themes/ambiance-mobile.css +5 -0
  258. data/vendor/assets/stylesheets/locomotive/codemirror/themes/ambiance.css +74 -0
  259. data/vendor/assets/stylesheets/locomotive/codemirror/themes/base16-dark.css +38 -0
  260. data/vendor/assets/stylesheets/locomotive/codemirror/themes/base16-light.css +38 -0
  261. data/vendor/assets/stylesheets/locomotive/codemirror/themes/bespin.css +34 -0
  262. data/vendor/assets/stylesheets/locomotive/codemirror/themes/blackboard.css +32 -0
  263. data/vendor/assets/stylesheets/locomotive/codemirror/themes/cobalt.css +25 -0
  264. data/vendor/assets/stylesheets/locomotive/codemirror/themes/colorforth.css +33 -0
  265. data/vendor/assets/stylesheets/locomotive/codemirror/themes/dracula.css +41 -0
  266. data/vendor/assets/stylesheets/locomotive/codemirror/themes/eclipse.css +23 -0
  267. data/vendor/assets/stylesheets/locomotive/codemirror/themes/elegant.css +13 -0
  268. data/vendor/assets/stylesheets/locomotive/codemirror/themes/erlang-dark.css +34 -0
  269. data/vendor/assets/stylesheets/locomotive/codemirror/themes/hopscotch.css +34 -0
  270. data/vendor/assets/stylesheets/locomotive/codemirror/themes/icecoder.css +43 -0
  271. data/vendor/assets/stylesheets/locomotive/codemirror/themes/isotope.css +34 -0
  272. data/vendor/assets/stylesheets/locomotive/codemirror/themes/lesser-dark.css +47 -0
  273. data/vendor/assets/stylesheets/locomotive/codemirror/themes/liquibyte.css +95 -0
  274. data/vendor/assets/stylesheets/locomotive/codemirror/themes/material.css +53 -0
  275. data/vendor/assets/stylesheets/locomotive/codemirror/themes/mbo.css +37 -0
  276. data/vendor/assets/stylesheets/locomotive/codemirror/themes/mdn-like.css +46 -0
  277. data/vendor/assets/stylesheets/locomotive/codemirror/themes/midnight.css +45 -0
  278. data/vendor/assets/stylesheets/locomotive/codemirror/themes/monokai.css +36 -0
  279. data/vendor/assets/stylesheets/locomotive/codemirror/themes/neat.css +12 -0
  280. data/vendor/assets/stylesheets/locomotive/codemirror/themes/neo.css +43 -0
  281. data/vendor/assets/stylesheets/locomotive/codemirror/themes/night.css +27 -0
  282. data/vendor/assets/stylesheets/locomotive/codemirror/themes/paraiso-dark.css +38 -0
  283. data/vendor/assets/stylesheets/locomotive/codemirror/themes/paraiso-light.css +38 -0
  284. data/vendor/assets/stylesheets/locomotive/codemirror/themes/pastel-on-dark.css +53 -0
  285. data/vendor/assets/stylesheets/locomotive/codemirror/themes/railscasts.css +34 -0
  286. data/vendor/assets/stylesheets/locomotive/codemirror/themes/rubyblue.css +25 -0
  287. data/vendor/assets/stylesheets/locomotive/codemirror/themes/seti.css +44 -0
  288. data/vendor/assets/stylesheets/locomotive/codemirror/themes/solarized.css +169 -0
  289. data/vendor/assets/stylesheets/locomotive/codemirror/themes/the-matrix.css +30 -0
  290. data/vendor/assets/stylesheets/locomotive/codemirror/themes/tomorrow-night-bright.css +35 -0
  291. data/vendor/assets/stylesheets/locomotive/codemirror/themes/tomorrow-night-eighties.css +38 -0
  292. data/vendor/assets/stylesheets/locomotive/codemirror/themes/ttcn.css +64 -0
  293. data/vendor/assets/stylesheets/locomotive/codemirror/themes/twilight.css +32 -0
  294. data/vendor/assets/stylesheets/locomotive/codemirror/themes/vibrant-ink.css +34 -0
  295. data/vendor/assets/stylesheets/locomotive/codemirror/themes/xq-dark.css +53 -0
  296. data/vendor/assets/stylesheets/locomotive/codemirror/themes/xq-light.css +43 -0
  297. data/vendor/assets/stylesheets/locomotive/codemirror/themes/yeti.css +44 -0
  298. data/vendor/assets/stylesheets/locomotive/codemirror/themes/zenburn.css +37 -0
  299. data/vendor/assets/stylesheets/locomotive/codemirror.css +347 -0
  300. data/vendor/assets/stylesheets/locomotive/select2.css +3 -6
  301. metadata +349 -128
@@ -0,0 +1,345 @@
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.defineMode("gas", function(_config, parserConfig) {
15
+ 'use strict';
16
+
17
+ // If an architecture is specified, its initialization function may
18
+ // populate this array with custom parsing functions which will be
19
+ // tried in the event that the standard functions do not find a match.
20
+ var custom = [];
21
+
22
+ // The symbol used to start a line comment changes based on the target
23
+ // architecture.
24
+ // If no architecture is pased in "parserConfig" then only multiline
25
+ // comments will have syntax support.
26
+ var lineCommentStartSymbol = "";
27
+
28
+ // These directives are architecture independent.
29
+ // Machine specific directives should go in their respective
30
+ // architecture initialization function.
31
+ // Reference:
32
+ // http://sourceware.org/binutils/docs/as/Pseudo-Ops.html#Pseudo-Ops
33
+ var directives = {
34
+ ".abort" : "builtin",
35
+ ".align" : "builtin",
36
+ ".altmacro" : "builtin",
37
+ ".ascii" : "builtin",
38
+ ".asciz" : "builtin",
39
+ ".balign" : "builtin",
40
+ ".balignw" : "builtin",
41
+ ".balignl" : "builtin",
42
+ ".bundle_align_mode" : "builtin",
43
+ ".bundle_lock" : "builtin",
44
+ ".bundle_unlock" : "builtin",
45
+ ".byte" : "builtin",
46
+ ".cfi_startproc" : "builtin",
47
+ ".comm" : "builtin",
48
+ ".data" : "builtin",
49
+ ".def" : "builtin",
50
+ ".desc" : "builtin",
51
+ ".dim" : "builtin",
52
+ ".double" : "builtin",
53
+ ".eject" : "builtin",
54
+ ".else" : "builtin",
55
+ ".elseif" : "builtin",
56
+ ".end" : "builtin",
57
+ ".endef" : "builtin",
58
+ ".endfunc" : "builtin",
59
+ ".endif" : "builtin",
60
+ ".equ" : "builtin",
61
+ ".equiv" : "builtin",
62
+ ".eqv" : "builtin",
63
+ ".err" : "builtin",
64
+ ".error" : "builtin",
65
+ ".exitm" : "builtin",
66
+ ".extern" : "builtin",
67
+ ".fail" : "builtin",
68
+ ".file" : "builtin",
69
+ ".fill" : "builtin",
70
+ ".float" : "builtin",
71
+ ".func" : "builtin",
72
+ ".global" : "builtin",
73
+ ".gnu_attribute" : "builtin",
74
+ ".hidden" : "builtin",
75
+ ".hword" : "builtin",
76
+ ".ident" : "builtin",
77
+ ".if" : "builtin",
78
+ ".incbin" : "builtin",
79
+ ".include" : "builtin",
80
+ ".int" : "builtin",
81
+ ".internal" : "builtin",
82
+ ".irp" : "builtin",
83
+ ".irpc" : "builtin",
84
+ ".lcomm" : "builtin",
85
+ ".lflags" : "builtin",
86
+ ".line" : "builtin",
87
+ ".linkonce" : "builtin",
88
+ ".list" : "builtin",
89
+ ".ln" : "builtin",
90
+ ".loc" : "builtin",
91
+ ".loc_mark_labels" : "builtin",
92
+ ".local" : "builtin",
93
+ ".long" : "builtin",
94
+ ".macro" : "builtin",
95
+ ".mri" : "builtin",
96
+ ".noaltmacro" : "builtin",
97
+ ".nolist" : "builtin",
98
+ ".octa" : "builtin",
99
+ ".offset" : "builtin",
100
+ ".org" : "builtin",
101
+ ".p2align" : "builtin",
102
+ ".popsection" : "builtin",
103
+ ".previous" : "builtin",
104
+ ".print" : "builtin",
105
+ ".protected" : "builtin",
106
+ ".psize" : "builtin",
107
+ ".purgem" : "builtin",
108
+ ".pushsection" : "builtin",
109
+ ".quad" : "builtin",
110
+ ".reloc" : "builtin",
111
+ ".rept" : "builtin",
112
+ ".sbttl" : "builtin",
113
+ ".scl" : "builtin",
114
+ ".section" : "builtin",
115
+ ".set" : "builtin",
116
+ ".short" : "builtin",
117
+ ".single" : "builtin",
118
+ ".size" : "builtin",
119
+ ".skip" : "builtin",
120
+ ".sleb128" : "builtin",
121
+ ".space" : "builtin",
122
+ ".stab" : "builtin",
123
+ ".string" : "builtin",
124
+ ".struct" : "builtin",
125
+ ".subsection" : "builtin",
126
+ ".symver" : "builtin",
127
+ ".tag" : "builtin",
128
+ ".text" : "builtin",
129
+ ".title" : "builtin",
130
+ ".type" : "builtin",
131
+ ".uleb128" : "builtin",
132
+ ".val" : "builtin",
133
+ ".version" : "builtin",
134
+ ".vtable_entry" : "builtin",
135
+ ".vtable_inherit" : "builtin",
136
+ ".warning" : "builtin",
137
+ ".weak" : "builtin",
138
+ ".weakref" : "builtin",
139
+ ".word" : "builtin"
140
+ };
141
+
142
+ var registers = {};
143
+
144
+ function x86(_parserConfig) {
145
+ lineCommentStartSymbol = "#";
146
+
147
+ registers.ax = "variable";
148
+ registers.eax = "variable-2";
149
+ registers.rax = "variable-3";
150
+
151
+ registers.bx = "variable";
152
+ registers.ebx = "variable-2";
153
+ registers.rbx = "variable-3";
154
+
155
+ registers.cx = "variable";
156
+ registers.ecx = "variable-2";
157
+ registers.rcx = "variable-3";
158
+
159
+ registers.dx = "variable";
160
+ registers.edx = "variable-2";
161
+ registers.rdx = "variable-3";
162
+
163
+ registers.si = "variable";
164
+ registers.esi = "variable-2";
165
+ registers.rsi = "variable-3";
166
+
167
+ registers.di = "variable";
168
+ registers.edi = "variable-2";
169
+ registers.rdi = "variable-3";
170
+
171
+ registers.sp = "variable";
172
+ registers.esp = "variable-2";
173
+ registers.rsp = "variable-3";
174
+
175
+ registers.bp = "variable";
176
+ registers.ebp = "variable-2";
177
+ registers.rbp = "variable-3";
178
+
179
+ registers.ip = "variable";
180
+ registers.eip = "variable-2";
181
+ registers.rip = "variable-3";
182
+
183
+ registers.cs = "keyword";
184
+ registers.ds = "keyword";
185
+ registers.ss = "keyword";
186
+ registers.es = "keyword";
187
+ registers.fs = "keyword";
188
+ registers.gs = "keyword";
189
+ }
190
+
191
+ function armv6(_parserConfig) {
192
+ // Reference:
193
+ // http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf
194
+ // http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf
195
+ lineCommentStartSymbol = "@";
196
+ directives.syntax = "builtin";
197
+
198
+ registers.r0 = "variable";
199
+ registers.r1 = "variable";
200
+ registers.r2 = "variable";
201
+ registers.r3 = "variable";
202
+ registers.r4 = "variable";
203
+ registers.r5 = "variable";
204
+ registers.r6 = "variable";
205
+ registers.r7 = "variable";
206
+ registers.r8 = "variable";
207
+ registers.r9 = "variable";
208
+ registers.r10 = "variable";
209
+ registers.r11 = "variable";
210
+ registers.r12 = "variable";
211
+
212
+ registers.sp = "variable-2";
213
+ registers.lr = "variable-2";
214
+ registers.pc = "variable-2";
215
+ registers.r13 = registers.sp;
216
+ registers.r14 = registers.lr;
217
+ registers.r15 = registers.pc;
218
+
219
+ custom.push(function(ch, stream) {
220
+ if (ch === '#') {
221
+ stream.eatWhile(/\w/);
222
+ return "number";
223
+ }
224
+ });
225
+ }
226
+
227
+ var arch = (parserConfig.architecture || "x86").toLowerCase();
228
+ if (arch === "x86") {
229
+ x86(parserConfig);
230
+ } else if (arch === "arm" || arch === "armv6") {
231
+ armv6(parserConfig);
232
+ }
233
+
234
+ function nextUntilUnescaped(stream, end) {
235
+ var escaped = false, next;
236
+ while ((next = stream.next()) != null) {
237
+ if (next === end && !escaped) {
238
+ return false;
239
+ }
240
+ escaped = !escaped && next === "\\";
241
+ }
242
+ return escaped;
243
+ }
244
+
245
+ function clikeComment(stream, state) {
246
+ var maybeEnd = false, ch;
247
+ while ((ch = stream.next()) != null) {
248
+ if (ch === "/" && maybeEnd) {
249
+ state.tokenize = null;
250
+ break;
251
+ }
252
+ maybeEnd = (ch === "*");
253
+ }
254
+ return "comment";
255
+ }
256
+
257
+ return {
258
+ startState: function() {
259
+ return {
260
+ tokenize: null
261
+ };
262
+ },
263
+
264
+ token: function(stream, state) {
265
+ if (state.tokenize) {
266
+ return state.tokenize(stream, state);
267
+ }
268
+
269
+ if (stream.eatSpace()) {
270
+ return null;
271
+ }
272
+
273
+ var style, cur, ch = stream.next();
274
+
275
+ if (ch === "/") {
276
+ if (stream.eat("*")) {
277
+ state.tokenize = clikeComment;
278
+ return clikeComment(stream, state);
279
+ }
280
+ }
281
+
282
+ if (ch === lineCommentStartSymbol) {
283
+ stream.skipToEnd();
284
+ return "comment";
285
+ }
286
+
287
+ if (ch === '"') {
288
+ nextUntilUnescaped(stream, '"');
289
+ return "string";
290
+ }
291
+
292
+ if (ch === '.') {
293
+ stream.eatWhile(/\w/);
294
+ cur = stream.current().toLowerCase();
295
+ style = directives[cur];
296
+ return style || null;
297
+ }
298
+
299
+ if (ch === '=') {
300
+ stream.eatWhile(/\w/);
301
+ return "tag";
302
+ }
303
+
304
+ if (ch === '{') {
305
+ return "braket";
306
+ }
307
+
308
+ if (ch === '}') {
309
+ return "braket";
310
+ }
311
+
312
+ if (/\d/.test(ch)) {
313
+ if (ch === "0" && stream.eat("x")) {
314
+ stream.eatWhile(/[0-9a-fA-F]/);
315
+ return "number";
316
+ }
317
+ stream.eatWhile(/\d/);
318
+ return "number";
319
+ }
320
+
321
+ if (/\w/.test(ch)) {
322
+ stream.eatWhile(/\w/);
323
+ if (stream.eat(":")) {
324
+ return 'tag';
325
+ }
326
+ cur = stream.current().toLowerCase();
327
+ style = registers[cur];
328
+ return style || null;
329
+ }
330
+
331
+ for (var i = 0; i < custom.length; i++) {
332
+ style = custom[i](ch, stream, state);
333
+ if (style) {
334
+ return style;
335
+ }
336
+ }
337
+ },
338
+
339
+ lineComment: lineCommentStartSymbol,
340
+ blockCommentStart: "/*",
341
+ blockCommentEnd: "*/"
342
+ };
343
+ });
344
+
345
+ });
@@ -0,0 +1,130 @@
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"), require("../markdown/markdown"), require("../../addon/mode/overlay"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../markdown/markdown", "../../addon/mode/overlay"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i
15
+
16
+ CodeMirror.defineMode("gfm", function(config, modeConfig) {
17
+ var codeDepth = 0;
18
+ function blankLine(state) {
19
+ state.code = false;
20
+ return null;
21
+ }
22
+ var gfmOverlay = {
23
+ startState: function() {
24
+ return {
25
+ code: false,
26
+ codeBlock: false,
27
+ ateSpace: false
28
+ };
29
+ },
30
+ copyState: function(s) {
31
+ return {
32
+ code: s.code,
33
+ codeBlock: s.codeBlock,
34
+ ateSpace: s.ateSpace
35
+ };
36
+ },
37
+ token: function(stream, state) {
38
+ state.combineTokens = null;
39
+
40
+ // Hack to prevent formatting override inside code blocks (block and inline)
41
+ if (state.codeBlock) {
42
+ if (stream.match(/^```+/)) {
43
+ state.codeBlock = false;
44
+ return null;
45
+ }
46
+ stream.skipToEnd();
47
+ return null;
48
+ }
49
+ if (stream.sol()) {
50
+ state.code = false;
51
+ }
52
+ if (stream.sol() && stream.match(/^```+/)) {
53
+ stream.skipToEnd();
54
+ state.codeBlock = true;
55
+ return null;
56
+ }
57
+ // If this block is changed, it may need to be updated in Markdown mode
58
+ if (stream.peek() === '`') {
59
+ stream.next();
60
+ var before = stream.pos;
61
+ stream.eatWhile('`');
62
+ var difference = 1 + stream.pos - before;
63
+ if (!state.code) {
64
+ codeDepth = difference;
65
+ state.code = true;
66
+ } else {
67
+ if (difference === codeDepth) { // Must be exact
68
+ state.code = false;
69
+ }
70
+ }
71
+ return null;
72
+ } else if (state.code) {
73
+ stream.next();
74
+ return null;
75
+ }
76
+ // Check if space. If so, links can be formatted later on
77
+ if (stream.eatSpace()) {
78
+ state.ateSpace = true;
79
+ return null;
80
+ }
81
+ if (stream.sol() || state.ateSpace) {
82
+ state.ateSpace = false;
83
+ if (modeConfig.gitHubSpice !== false) {
84
+ if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
85
+ // User/Project@SHA
86
+ // User@SHA
87
+ // SHA
88
+ state.combineTokens = true;
89
+ return "link";
90
+ } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
91
+ // User/Project#Num
92
+ // User#Num
93
+ // #Num
94
+ state.combineTokens = true;
95
+ return "link";
96
+ }
97
+ }
98
+ }
99
+ if (stream.match(urlRE) &&
100
+ stream.string.slice(stream.start - 2, stream.start) != "](" &&
101
+ (stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) {
102
+ // URLs
103
+ // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
104
+ // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine
105
+ // And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL
106
+ state.combineTokens = true;
107
+ return "link";
108
+ }
109
+ stream.next();
110
+ return null;
111
+ },
112
+ blankLine: blankLine
113
+ };
114
+
115
+ var markdownConfig = {
116
+ underscoresBreakWords: false,
117
+ taskLists: true,
118
+ fencedCodeBlocks: '```',
119
+ strikethrough: true
120
+ };
121
+ for (var attr in modeConfig) {
122
+ markdownConfig[attr] = modeConfig[attr];
123
+ }
124
+ markdownConfig.name = "markdown";
125
+ return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay);
126
+
127
+ }, "markdown");
128
+
129
+ CodeMirror.defineMIME("text/x-gfm", "gfm");
130
+ });
@@ -0,0 +1,178 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /*
5
+ Gherkin mode - http://www.cukes.info/
6
+ Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues
7
+ */
8
+
9
+ // Following Objs from Brackets implementation: https://github.com/tregusti/brackets-gherkin/blob/master/main.js
10
+ //var Quotes = {
11
+ // SINGLE: 1,
12
+ // DOUBLE: 2
13
+ //};
14
+
15
+ //var regex = {
16
+ // keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/
17
+ //};
18
+
19
+ (function(mod) {
20
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
21
+ mod(require("../../lib/codemirror"));
22
+ else if (typeof define == "function" && define.amd) // AMD
23
+ define(["../../lib/codemirror"], mod);
24
+ else // Plain browser env
25
+ mod(CodeMirror);
26
+ })(function(CodeMirror) {
27
+ "use strict";
28
+
29
+ CodeMirror.defineMode("gherkin", function () {
30
+ return {
31
+ startState: function () {
32
+ return {
33
+ lineNumber: 0,
34
+ tableHeaderLine: false,
35
+ allowFeature: true,
36
+ allowBackground: false,
37
+ allowScenario: false,
38
+ allowSteps: false,
39
+ allowPlaceholders: false,
40
+ allowMultilineArgument: false,
41
+ inMultilineString: false,
42
+ inMultilineTable: false,
43
+ inKeywordLine: false
44
+ };
45
+ },
46
+ token: function (stream, state) {
47
+ if (stream.sol()) {
48
+ state.lineNumber++;
49
+ state.inKeywordLine = false;
50
+ if (state.inMultilineTable) {
51
+ state.tableHeaderLine = false;
52
+ if (!stream.match(/\s*\|/, false)) {
53
+ state.allowMultilineArgument = false;
54
+ state.inMultilineTable = false;
55
+ }
56
+ }
57
+ }
58
+
59
+ stream.eatSpace();
60
+
61
+ if (state.allowMultilineArgument) {
62
+
63
+ // STRING
64
+ if (state.inMultilineString) {
65
+ if (stream.match('"""')) {
66
+ state.inMultilineString = false;
67
+ state.allowMultilineArgument = false;
68
+ } else {
69
+ stream.match(/.*/);
70
+ }
71
+ return "string";
72
+ }
73
+
74
+ // TABLE
75
+ if (state.inMultilineTable) {
76
+ if (stream.match(/\|\s*/)) {
77
+ return "bracket";
78
+ } else {
79
+ stream.match(/[^\|]*/);
80
+ return state.tableHeaderLine ? "header" : "string";
81
+ }
82
+ }
83
+
84
+ // DETECT START
85
+ if (stream.match('"""')) {
86
+ // String
87
+ state.inMultilineString = true;
88
+ return "string";
89
+ } else if (stream.match("|")) {
90
+ // Table
91
+ state.inMultilineTable = true;
92
+ state.tableHeaderLine = true;
93
+ return "bracket";
94
+ }
95
+
96
+ }
97
+
98
+ // LINE COMMENT
99
+ if (stream.match(/#.*/)) {
100
+ return "comment";
101
+
102
+ // TAG
103
+ } else if (!state.inKeywordLine && stream.match(/@\S+/)) {
104
+ return "tag";
105
+
106
+ // FEATURE
107
+ } else if (!state.inKeywordLine && state.allowFeature && stream.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)) {
108
+ state.allowScenario = true;
109
+ state.allowBackground = true;
110
+ state.allowPlaceholders = false;
111
+ state.allowSteps = false;
112
+ state.allowMultilineArgument = false;
113
+ state.inKeywordLine = true;
114
+ return "keyword";
115
+
116
+ // BACKGROUND
117
+ } else if (!state.inKeywordLine && state.allowBackground && stream.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)) {
118
+ state.allowPlaceholders = false;
119
+ state.allowSteps = true;
120
+ state.allowBackground = false;
121
+ state.allowMultilineArgument = false;
122
+ state.inKeywordLine = true;
123
+ return "keyword";
124
+
125
+ // SCENARIO OUTLINE
126
+ } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)) {
127
+ state.allowPlaceholders = true;
128
+ state.allowSteps = true;
129
+ state.allowMultilineArgument = false;
130
+ state.inKeywordLine = true;
131
+ return "keyword";
132
+
133
+ // EXAMPLES
134
+ } else if (state.allowScenario && stream.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)) {
135
+ state.allowPlaceholders = false;
136
+ state.allowSteps = true;
137
+ state.allowBackground = false;
138
+ state.allowMultilineArgument = true;
139
+ return "keyword";
140
+
141
+ // SCENARIO
142
+ } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)) {
143
+ state.allowPlaceholders = false;
144
+ state.allowSteps = true;
145
+ state.allowBackground = false;
146
+ state.allowMultilineArgument = false;
147
+ state.inKeywordLine = true;
148
+ return "keyword";
149
+
150
+ // STEPS
151
+ } else if (!state.inKeywordLine && state.allowSteps && stream.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)) {
152
+ state.inStep = true;
153
+ state.allowPlaceholders = true;
154
+ state.allowMultilineArgument = true;
155
+ state.inKeywordLine = true;
156
+ return "keyword";
157
+
158
+ // INLINE STRING
159
+ } else if (stream.match(/"[^"]*"?/)) {
160
+ return "string";
161
+
162
+ // PLACEHOLDER
163
+ } else if (state.allowPlaceholders && stream.match(/<[^>]*>?/)) {
164
+ return "variable";
165
+
166
+ // Fall through
167
+ } else {
168
+ stream.next();
169
+ stream.eatWhile(/[^@"<#]/);
170
+ return null;
171
+ }
172
+ }
173
+ };
174
+ });
175
+
176
+ CodeMirror.defineMIME("text/x-feature", "gherkin");
177
+
178
+ });