administrate-field-simple_mde_markdown 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (419) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +72 -0
  3. data/.circleci/setup-rubygems.sh +3 -0
  4. data/.gitignore +11 -0
  5. data/.rspec +3 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +8 -0
  8. data/Gemfile.lock +196 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +44 -0
  11. data/Rakefile +8 -0
  12. data/administrate-field-simple_mde_markdown.gemspec +31 -0
  13. data/app/assets/javascripts/administrate-field-simple_mde_markdown/application.js +6 -0
  14. data/app/assets/stylesheets/administrate-field-simple_mde_markdown/application.css +3 -0
  15. data/app/views/fields/simple_mde_markdown/_form.html.erb +6 -0
  16. data/app/views/fields/simple_mde_markdown/_index.html.erb +1 -0
  17. data/app/views/fields/simple_mde_markdown/_show.html.erb +1 -0
  18. data/lib/administrate/field/simple_mde_markdown.rb +31 -0
  19. data/node_modules/.bin/marked +1 -0
  20. data/node_modules/codemirror-spell-checker/.eslintrc +23 -0
  21. data/node_modules/codemirror-spell-checker/.npmignore +2 -0
  22. data/node_modules/codemirror-spell-checker/.travis.yml +18 -0
  23. data/node_modules/codemirror-spell-checker/CONTRIBUTING 2.md +10 -0
  24. data/node_modules/codemirror-spell-checker/CONTRIBUTING.md +10 -0
  25. data/node_modules/codemirror-spell-checker/LICENSE +22 -0
  26. data/node_modules/codemirror-spell-checker/README.md +50 -0
  27. data/node_modules/codemirror-spell-checker/bower.json +27 -0
  28. data/node_modules/codemirror-spell-checker/debug/.spell-checker 2.css.icloud +0 -0
  29. data/node_modules/codemirror-spell-checker/debug/spell-checker.css +9 -0
  30. data/node_modules/codemirror-spell-checker/debug/spell-checker.debug.js +2844 -0
  31. data/node_modules/codemirror-spell-checker/debug/spell-checker.js +2841 -0
  32. data/node_modules/codemirror-spell-checker/dist/.spell-checker.min 2.css.icloud +0 -0
  33. data/node_modules/codemirror-spell-checker/dist/en_US.aff +201 -0
  34. data/node_modules/codemirror-spell-checker/dist/en_US.dic +62120 -0
  35. data/node_modules/codemirror-spell-checker/dist/spell-checker.min 2.js +7 -0
  36. data/node_modules/codemirror-spell-checker/dist/spell-checker.min.css +7 -0
  37. data/node_modules/codemirror-spell-checker/dist/spell-checker.min.js +7 -0
  38. data/node_modules/codemirror-spell-checker/gulpfile.js +94 -0
  39. data/node_modules/codemirror-spell-checker/package.json +75 -0
  40. data/node_modules/codemirror-spell-checker/src/css/spell-checker.css +3 -0
  41. data/node_modules/codemirror-spell-checker/src/data/en_US.aff +201 -0
  42. data/node_modules/codemirror-spell-checker/src/data/en_US.dic +62120 -0
  43. data/node_modules/codemirror-spell-checker/src/js/spell-checker.js +119 -0
  44. data/node_modules/codemirror/.package 2.json.icloud +0 -0
  45. data/node_modules/codemirror/AUTHORS +773 -0
  46. data/node_modules/codemirror/CHANGELOG.md +1486 -0
  47. data/node_modules/codemirror/CONTRIBUTING.md +92 -0
  48. data/node_modules/codemirror/LICENSE +21 -0
  49. data/node_modules/codemirror/README.md +49 -0
  50. data/node_modules/codemirror/addon/comment/comment.js +209 -0
  51. data/node_modules/codemirror/addon/comment/continuecomment.js +78 -0
  52. data/node_modules/codemirror/addon/dialog/dialog.css +32 -0
  53. data/node_modules/codemirror/addon/dialog/dialog.js +161 -0
  54. data/node_modules/codemirror/addon/display/autorefresh.js +47 -0
  55. data/node_modules/codemirror/addon/display/fullscreen.css +6 -0
  56. data/node_modules/codemirror/addon/display/fullscreen.js +41 -0
  57. data/node_modules/codemirror/addon/display/panel.js +127 -0
  58. data/node_modules/codemirror/addon/display/placeholder.js +63 -0
  59. data/node_modules/codemirror/addon/display/rulers.js +51 -0
  60. data/node_modules/codemirror/addon/edit/closebrackets.js +187 -0
  61. data/node_modules/codemirror/addon/edit/closetag.js +175 -0
  62. data/node_modules/codemirror/addon/edit/continuelist.js +89 -0
  63. data/node_modules/codemirror/addon/edit/matchbrackets.js +145 -0
  64. data/node_modules/codemirror/addon/edit/matchtags.js +66 -0
  65. data/node_modules/codemirror/addon/edit/trailingspace.js +27 -0
  66. data/node_modules/codemirror/addon/fold/brace-fold.js +105 -0
  67. data/node_modules/codemirror/addon/fold/comment-fold.js +59 -0
  68. data/node_modules/codemirror/addon/fold/foldcode.js +152 -0
  69. data/node_modules/codemirror/addon/fold/foldgutter.css +20 -0
  70. data/node_modules/codemirror/addon/fold/foldgutter.js +146 -0
  71. data/node_modules/codemirror/addon/fold/indent-fold.js +48 -0
  72. data/node_modules/codemirror/addon/fold/markdown-fold.js +49 -0
  73. data/node_modules/codemirror/addon/fold/xml-fold.js +184 -0
  74. data/node_modules/codemirror/addon/hint/anyword-hint.js +41 -0
  75. data/node_modules/codemirror/addon/hint/css-hint.js +60 -0
  76. data/node_modules/codemirror/addon/hint/html-hint.js +348 -0
  77. data/node_modules/codemirror/addon/hint/javascript-hint.js +157 -0
  78. data/node_modules/codemirror/addon/hint/show-hint.css +36 -0
  79. data/node_modules/codemirror/addon/hint/show-hint.js +434 -0
  80. data/node_modules/codemirror/addon/hint/sql-hint.js +299 -0
  81. data/node_modules/codemirror/addon/hint/xml-hint.js +110 -0
  82. data/node_modules/codemirror/addon/lint/coffeescript-lint.js +47 -0
  83. data/node_modules/codemirror/addon/lint/css-lint.js +40 -0
  84. data/node_modules/codemirror/addon/lint/html-lint.js +53 -0
  85. data/node_modules/codemirror/addon/lint/javascript-lint.js +63 -0
  86. data/node_modules/codemirror/addon/lint/json-lint.js +40 -0
  87. data/node_modules/codemirror/addon/lint/lint.css +73 -0
  88. data/node_modules/codemirror/addon/lint/lint.js +252 -0
  89. data/node_modules/codemirror/addon/lint/yaml-lint.js +41 -0
  90. data/node_modules/codemirror/addon/merge/merge.css +119 -0
  91. data/node_modules/codemirror/addon/merge/merge.js +1002 -0
  92. data/node_modules/codemirror/addon/mode/loadmode.js +64 -0
  93. data/node_modules/codemirror/addon/mode/multiplex.js +131 -0
  94. data/node_modules/codemirror/addon/mode/multiplex_test.js +33 -0
  95. data/node_modules/codemirror/addon/mode/overlay.js +90 -0
  96. data/node_modules/codemirror/addon/mode/simple.js +216 -0
  97. data/node_modules/codemirror/addon/runmode/colorize.js +40 -0
  98. data/node_modules/codemirror/addon/runmode/runmode-standalone.js +158 -0
  99. data/node_modules/codemirror/addon/runmode/runmode.js +72 -0
  100. data/node_modules/codemirror/addon/runmode/runmode.node.js +197 -0
  101. data/node_modules/codemirror/addon/scroll/annotatescrollbar.js +122 -0
  102. data/node_modules/codemirror/addon/scroll/scrollpastend.js +48 -0
  103. data/node_modules/codemirror/addon/scroll/simplescrollbars.css +66 -0
  104. data/node_modules/codemirror/addon/scroll/simplescrollbars.js +152 -0
  105. data/node_modules/codemirror/addon/search/jump-to-line.js +50 -0
  106. data/node_modules/codemirror/addon/search/match-highlighter.js +165 -0
  107. data/node_modules/codemirror/addon/search/matchesonscrollbar.css +8 -0
  108. data/node_modules/codemirror/addon/search/matchesonscrollbar.js +97 -0
  109. data/node_modules/codemirror/addon/search/search.js +258 -0
  110. data/node_modules/codemirror/addon/search/searchcursor.js +293 -0
  111. data/node_modules/codemirror/addon/selection/active-line.js +72 -0
  112. data/node_modules/codemirror/addon/selection/mark-selection.js +119 -0
  113. data/node_modules/codemirror/addon/selection/selection-pointer.js +98 -0
  114. data/node_modules/codemirror/addon/tern/tern.css +87 -0
  115. data/node_modules/codemirror/addon/tern/tern.js +718 -0
  116. data/node_modules/codemirror/addon/tern/worker.js +44 -0
  117. data/node_modules/codemirror/addon/wrap/hardwrap.js +145 -0
  118. data/node_modules/codemirror/bin/source-highlight +48 -0
  119. data/node_modules/codemirror/keymap/emacs.js +417 -0
  120. data/node_modules/codemirror/keymap/sublime.js +691 -0
  121. data/node_modules/codemirror/keymap/vim.js +5467 -0
  122. data/node_modules/codemirror/lib/codemirror.css +346 -0
  123. data/node_modules/codemirror/lib/codemirror.js +9698 -0
  124. data/node_modules/codemirror/mode/apl/apl.js +174 -0
  125. data/node_modules/codemirror/mode/asciiarmor/asciiarmor.js +74 -0
  126. data/node_modules/codemirror/mode/asn.1/asn.1.js +204 -0
  127. data/node_modules/codemirror/mode/asterisk/asterisk.js +196 -0
  128. data/node_modules/codemirror/mode/brainfuck/brainfuck.js +85 -0
  129. data/node_modules/codemirror/mode/clike/clike.js +879 -0
  130. data/node_modules/codemirror/mode/clojure/clojure.js +292 -0
  131. data/node_modules/codemirror/mode/cmake/cmake.js +97 -0
  132. data/node_modules/codemirror/mode/cobol/cobol.js +255 -0
  133. data/node_modules/codemirror/mode/coffeescript/coffeescript.js +359 -0
  134. data/node_modules/codemirror/mode/commonlisp/commonlisp.js +124 -0
  135. data/node_modules/codemirror/mode/crystal/crystal.js +433 -0
  136. data/node_modules/codemirror/mode/css/css.js +832 -0
  137. data/node_modules/codemirror/mode/cypher/cypher.js +150 -0
  138. data/node_modules/codemirror/mode/d/d.js +223 -0
  139. data/node_modules/codemirror/mode/dart/dart.js +157 -0
  140. data/node_modules/codemirror/mode/diff/diff.js +47 -0
  141. data/node_modules/codemirror/mode/django/django.js +356 -0
  142. data/node_modules/codemirror/mode/dockerfile/dockerfile.js +211 -0
  143. data/node_modules/codemirror/mode/dtd/dtd.js +142 -0
  144. data/node_modules/codemirror/mode/dylan/dylan.js +352 -0
  145. data/node_modules/codemirror/mode/ebnf/ebnf.js +195 -0
  146. data/node_modules/codemirror/mode/ecl/ecl.js +206 -0
  147. data/node_modules/codemirror/mode/eiffel/eiffel.js +160 -0
  148. data/node_modules/codemirror/mode/elm/elm.js +205 -0
  149. data/node_modules/codemirror/mode/erlang/erlang.js +619 -0
  150. data/node_modules/codemirror/mode/factor/factor.js +85 -0
  151. data/node_modules/codemirror/mode/fcl/fcl.js +173 -0
  152. data/node_modules/codemirror/mode/forth/forth.js +180 -0
  153. data/node_modules/codemirror/mode/fortran/fortran.js +188 -0
  154. data/node_modules/codemirror/mode/gas/gas.js +345 -0
  155. data/node_modules/codemirror/mode/gfm/gfm.js +129 -0
  156. data/node_modules/codemirror/mode/gherkin/gherkin.js +178 -0
  157. data/node_modules/codemirror/mode/go/go.js +187 -0
  158. data/node_modules/codemirror/mode/groovy/groovy.js +230 -0
  159. data/node_modules/codemirror/mode/haml/haml.js +161 -0
  160. data/node_modules/codemirror/mode/handlebars/handlebars.js +66 -0
  161. data/node_modules/codemirror/mode/haskell-literate/haskell-literate.js +43 -0
  162. data/node_modules/codemirror/mode/haskell/haskell.js +268 -0
  163. data/node_modules/codemirror/mode/haxe/haxe.js +515 -0
  164. data/node_modules/codemirror/mode/htmlembedded/htmlembedded.js +37 -0
  165. data/node_modules/codemirror/mode/htmlmixed/htmlmixed.js +152 -0
  166. data/node_modules/codemirror/mode/http/http.js +113 -0
  167. data/node_modules/codemirror/mode/idl/idl.js +290 -0
  168. data/node_modules/codemirror/mode/javascript/javascript.js +899 -0
  169. data/node_modules/codemirror/mode/jinja2/jinja2.js +144 -0
  170. data/node_modules/codemirror/mode/jsx/jsx.js +148 -0
  171. data/node_modules/codemirror/mode/julia/julia.js +433 -0
  172. data/node_modules/codemirror/mode/livescript/livescript.js +280 -0
  173. data/node_modules/codemirror/mode/lua/lua.js +159 -0
  174. data/node_modules/codemirror/mode/markdown/markdown.js +884 -0
  175. data/node_modules/codemirror/mode/mathematica/mathematica.js +176 -0
  176. data/node_modules/codemirror/mode/mbox/mbox.js +129 -0
  177. data/node_modules/codemirror/mode/meta.js +217 -0
  178. data/node_modules/codemirror/mode/mirc/mirc.js +193 -0
  179. data/node_modules/codemirror/mode/mllike/mllike.js +359 -0
  180. data/node_modules/codemirror/mode/modelica/modelica.js +245 -0
  181. data/node_modules/codemirror/mode/mscgen/mscgen.js +175 -0
  182. data/node_modules/codemirror/mode/mumps/mumps.js +148 -0
  183. data/node_modules/codemirror/mode/nginx/nginx.js +178 -0
  184. data/node_modules/codemirror/mode/nsis/nsis.js +95 -0
  185. data/node_modules/codemirror/mode/ntriples/ntriples.js +195 -0
  186. data/node_modules/codemirror/mode/octave/octave.js +139 -0
  187. data/node_modules/codemirror/mode/oz/oz.js +252 -0
  188. data/node_modules/codemirror/mode/pascal/pascal.js +121 -0
  189. data/node_modules/codemirror/mode/pegjs/pegjs.js +114 -0
  190. data/node_modules/codemirror/mode/perl/perl.js +837 -0
  191. data/node_modules/codemirror/mode/php/php.js +234 -0
  192. data/node_modules/codemirror/mode/pig/pig.js +178 -0
  193. data/node_modules/codemirror/mode/powershell/powershell.js +398 -0
  194. data/node_modules/codemirror/mode/properties/properties 2.js +78 -0
  195. data/node_modules/codemirror/mode/properties/properties.js +78 -0
  196. data/node_modules/codemirror/mode/protobuf/protobuf.js +69 -0
  197. data/node_modules/codemirror/mode/pug/pug.js +591 -0
  198. data/node_modules/codemirror/mode/puppet/puppet.js +220 -0
  199. data/node_modules/codemirror/mode/python/python.js +409 -0
  200. data/node_modules/codemirror/mode/q/q.js +139 -0
  201. data/node_modules/codemirror/mode/r/r.js +190 -0
  202. data/node_modules/codemirror/mode/rpm/changes/index.html +66 -0
  203. data/node_modules/codemirror/mode/rpm/rpm.js +109 -0
  204. data/node_modules/codemirror/mode/rst/rst.js +557 -0
  205. data/node_modules/codemirror/mode/ruby/ruby.js +296 -0
  206. data/node_modules/codemirror/mode/rust/rust.js +72 -0
  207. data/node_modules/codemirror/mode/sas/sas.js +303 -0
  208. data/node_modules/codemirror/mode/sass/sass.js +454 -0
  209. data/node_modules/codemirror/mode/scheme/scheme.js +265 -0
  210. data/node_modules/codemirror/mode/shell/shell.js +152 -0
  211. data/node_modules/codemirror/mode/sieve/sieve.js +193 -0
  212. data/node_modules/codemirror/mode/slim/slim.js +575 -0
  213. data/node_modules/codemirror/mode/smalltalk/smalltalk.js +168 -0
  214. data/node_modules/codemirror/mode/smarty/smarty.js +225 -0
  215. data/node_modules/codemirror/mode/solr/solr.js +104 -0
  216. data/node_modules/codemirror/mode/soy/soy 2.js +359 -0
  217. data/node_modules/codemirror/mode/soy/soy.js +235 -0
  218. data/node_modules/codemirror/mode/sparql/sparql.js +180 -0
  219. data/node_modules/codemirror/mode/spreadsheet/spreadsheet.js +112 -0
  220. data/node_modules/codemirror/mode/sql/sql.js +499 -0
  221. data/node_modules/codemirror/mode/stex/stex.js +264 -0
  222. data/node_modules/codemirror/mode/stylus/stylus.js +771 -0
  223. data/node_modules/codemirror/mode/swift/swift.js +219 -0
  224. data/node_modules/codemirror/mode/tcl/tcl.js +139 -0
  225. data/node_modules/codemirror/mode/textile/textile.js +469 -0
  226. data/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  227. data/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.js +308 -0
  228. data/node_modules/codemirror/mode/tiki/tiki.css +26 -0
  229. data/node_modules/codemirror/mode/tiki/tiki.js +312 -0
  230. data/node_modules/codemirror/mode/toml/toml.js +88 -0
  231. data/node_modules/codemirror/mode/tornado/tornado.js +68 -0
  232. data/node_modules/codemirror/mode/troff/troff.js +84 -0
  233. data/node_modules/codemirror/mode/ttcn-cfg/ttcn-cfg.js +214 -0
  234. data/node_modules/codemirror/mode/ttcn/ttcn.js +283 -0
  235. data/node_modules/codemirror/mode/turtle/turtle.js +162 -0
  236. data/node_modules/codemirror/mode/twig/twig.js +141 -0
  237. data/node_modules/codemirror/mode/vb/vb.js +275 -0
  238. data/node_modules/codemirror/mode/vbscript/vbscript.js +350 -0
  239. data/node_modules/codemirror/mode/velocity/velocity.js +201 -0
  240. data/node_modules/codemirror/mode/verilog/verilog.js +675 -0
  241. data/node_modules/codemirror/mode/vhdl/vhdl.js +189 -0
  242. data/node_modules/codemirror/mode/vue/vue.js +77 -0
  243. data/node_modules/codemirror/mode/webidl/webidl.js +195 -0
  244. data/node_modules/codemirror/mode/xml/xml.js +402 -0
  245. data/node_modules/codemirror/mode/xquery/xquery.js +448 -0
  246. data/node_modules/codemirror/mode/yacas/yacas.js +204 -0
  247. data/node_modules/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +68 -0
  248. data/node_modules/codemirror/mode/yaml/yaml.js +120 -0
  249. data/node_modules/codemirror/mode/z80/z80.js +116 -0
  250. data/node_modules/codemirror/package.json +2395 -0
  251. data/node_modules/codemirror/rollup.config.js +20 -0
  252. data/node_modules/codemirror/src/codemirror.js +3 -0
  253. data/node_modules/codemirror/src/display/Display.js +106 -0
  254. data/node_modules/codemirror/src/display/focus.js +47 -0
  255. data/node_modules/codemirror/src/display/gutters.js +34 -0
  256. data/node_modules/codemirror/src/display/highlight_worker.js +55 -0
  257. data/node_modules/codemirror/src/display/line_numbers.js +48 -0
  258. data/node_modules/codemirror/src/display/mode_state.js +22 -0
  259. data/node_modules/codemirror/src/display/operations.js +205 -0
  260. data/node_modules/codemirror/src/display/scroll_events.js +115 -0
  261. data/node_modules/codemirror/src/display/scrollbars.js +193 -0
  262. data/node_modules/codemirror/src/display/scrolling.js +184 -0
  263. data/node_modules/codemirror/src/display/selection.js +158 -0
  264. data/node_modules/codemirror/src/display/update_display.js +260 -0
  265. data/node_modules/codemirror/src/display/update_line.js +188 -0
  266. data/node_modules/codemirror/src/display/update_lines.js +64 -0
  267. data/node_modules/codemirror/src/display/view_tracking.js +153 -0
  268. data/node_modules/codemirror/src/edit/CodeMirror.js +215 -0
  269. data/node_modules/codemirror/src/edit/commands.js +178 -0
  270. data/node_modules/codemirror/src/edit/deleteNearSelection.js +30 -0
  271. data/node_modules/codemirror/src/edit/drop_events.js +119 -0
  272. data/node_modules/codemirror/src/edit/fromTextArea.js +61 -0
  273. data/node_modules/codemirror/src/edit/global_events.js +42 -0
  274. data/node_modules/codemirror/src/edit/key_events.js +159 -0
  275. data/node_modules/codemirror/src/edit/legacy.js +62 -0
  276. data/node_modules/codemirror/src/edit/main.js +69 -0
  277. data/node_modules/codemirror/src/edit/methods.js +544 -0
  278. data/node_modules/codemirror/src/edit/mouse_events.js +407 -0
  279. data/node_modules/codemirror/src/edit/options.js +193 -0
  280. data/node_modules/codemirror/src/edit/utils.js +7 -0
  281. data/node_modules/codemirror/src/input/ContentEditableInput.js +527 -0
  282. data/node_modules/codemirror/src/input/TextareaInput.js +355 -0
  283. data/node_modules/codemirror/src/input/indent.js +71 -0
  284. data/node_modules/codemirror/src/input/input.js +135 -0
  285. data/node_modules/codemirror/src/input/keymap.js +148 -0
  286. data/node_modules/codemirror/src/input/keynames.js +17 -0
  287. data/node_modules/codemirror/src/input/movement.js +110 -0
  288. data/node_modules/codemirror/src/line/highlight.js +284 -0
  289. data/node_modules/codemirror/src/line/line_data.js +339 -0
  290. data/node_modules/codemirror/src/line/pos.js +40 -0
  291. data/node_modules/codemirror/src/line/saw_special_spans.js +10 -0
  292. data/node_modules/codemirror/src/line/spans.js +382 -0
  293. data/node_modules/codemirror/src/line/utils_line.js +85 -0
  294. data/node_modules/codemirror/src/measurement/position_measurement.js +699 -0
  295. data/node_modules/codemirror/src/measurement/widgets.js +26 -0
  296. data/node_modules/codemirror/src/model/Doc.js +432 -0
  297. data/node_modules/codemirror/src/model/change_measurement.js +61 -0
  298. data/node_modules/codemirror/src/model/changes.js +333 -0
  299. data/node_modules/codemirror/src/model/chunk.js +167 -0
  300. data/node_modules/codemirror/src/model/document_data.js +111 -0
  301. data/node_modules/codemirror/src/model/history.js +228 -0
  302. data/node_modules/codemirror/src/model/line_widget.js +78 -0
  303. data/node_modules/codemirror/src/model/mark_text.js +292 -0
  304. data/node_modules/codemirror/src/model/selection.js +84 -0
  305. data/node_modules/codemirror/src/model/selection_updates.js +208 -0
  306. data/node_modules/codemirror/src/modes.js +96 -0
  307. data/node_modules/codemirror/src/util/StringStream.js +90 -0
  308. data/node_modules/codemirror/src/util/bidi.js +214 -0
  309. data/node_modules/codemirror/src/util/browser.js +33 -0
  310. data/node_modules/codemirror/src/util/dom.js +97 -0
  311. data/node_modules/codemirror/src/util/event.js +103 -0
  312. data/node_modules/codemirror/src/util/feature_detection.js +84 -0
  313. data/node_modules/codemirror/src/util/misc.js +150 -0
  314. data/node_modules/codemirror/src/util/operation_group.js +72 -0
  315. data/node_modules/codemirror/theme/3024-day.css +41 -0
  316. data/node_modules/codemirror/theme/3024-night.css +39 -0
  317. data/node_modules/codemirror/theme/abcdef.css +32 -0
  318. data/node_modules/codemirror/theme/ambiance-mobile.css +5 -0
  319. data/node_modules/codemirror/theme/ambiance.css +74 -0
  320. data/node_modules/codemirror/theme/base16-dark.css +38 -0
  321. data/node_modules/codemirror/theme/base16-light.css +38 -0
  322. data/node_modules/codemirror/theme/bespin.css +34 -0
  323. data/node_modules/codemirror/theme/blackboard.css +32 -0
  324. data/node_modules/codemirror/theme/cobalt.css +25 -0
  325. data/node_modules/codemirror/theme/colorforth.css +33 -0
  326. data/node_modules/codemirror/theme/darcula.css +46 -0
  327. data/node_modules/codemirror/theme/dracula.css +40 -0
  328. data/node_modules/codemirror/theme/duotone-dark.css +35 -0
  329. data/node_modules/codemirror/theme/duotone-light.css +36 -0
  330. data/node_modules/codemirror/theme/eclipse.css +23 -0
  331. data/node_modules/codemirror/theme/elegant.css +13 -0
  332. data/node_modules/codemirror/theme/erlang-dark.css +34 -0
  333. data/node_modules/codemirror/theme/gruvbox-dark.css +37 -0
  334. data/node_modules/codemirror/theme/hopscotch.css +34 -0
  335. data/node_modules/codemirror/theme/icecoder.css +43 -0
  336. data/node_modules/codemirror/theme/idea.css +42 -0
  337. data/node_modules/codemirror/theme/isotope.css +34 -0
  338. data/node_modules/codemirror/theme/lesser-dark.css +47 -0
  339. data/node_modules/codemirror/theme/liquibyte.css +95 -0
  340. data/node_modules/codemirror/theme/lucario.css +37 -0
  341. data/node_modules/codemirror/theme/material.css +53 -0
  342. data/node_modules/codemirror/theme/mbo.css +37 -0
  343. data/node_modules/codemirror/theme/mdn-like.css +46 -0
  344. data/node_modules/codemirror/theme/midnight.css +43 -0
  345. data/node_modules/codemirror/theme/monokai.css +41 -0
  346. data/node_modules/codemirror/theme/neat.css +12 -0
  347. data/node_modules/codemirror/theme/neo.css +43 -0
  348. data/node_modules/codemirror/theme/night.css +27 -0
  349. data/node_modules/codemirror/theme/oceanic-next.css +44 -0
  350. data/node_modules/codemirror/theme/panda-syntax.css +85 -0
  351. data/node_modules/codemirror/theme/paraiso-dark.css +38 -0
  352. data/node_modules/codemirror/theme/paraiso-light.css +38 -0
  353. data/node_modules/codemirror/theme/pastel-on-dark.css +52 -0
  354. data/node_modules/codemirror/theme/railscasts.css +34 -0
  355. data/node_modules/codemirror/theme/rubyblue.css +25 -0
  356. data/node_modules/codemirror/theme/seti.css +44 -0
  357. data/node_modules/codemirror/theme/shadowfox.css +52 -0
  358. data/node_modules/codemirror/theme/solarized.css +168 -0
  359. data/node_modules/codemirror/theme/ssms.css +16 -0
  360. data/node_modules/codemirror/theme/the-matrix.css +30 -0
  361. data/node_modules/codemirror/theme/tomorrow-night-bright.css +35 -0
  362. data/node_modules/codemirror/theme/tomorrow-night-eighties.css +38 -0
  363. data/node_modules/codemirror/theme/ttcn.css +64 -0
  364. data/node_modules/codemirror/theme/twilight.css +32 -0
  365. data/node_modules/codemirror/theme/vibrant-ink.css +34 -0
  366. data/node_modules/codemirror/theme/xq-dark.css +53 -0
  367. data/node_modules/codemirror/theme/xq-light.css +43 -0
  368. data/node_modules/codemirror/theme/yeti.css +44 -0
  369. data/node_modules/codemirror/theme/zenburn.css +37 -0
  370. data/node_modules/marked/.editorconfig +16 -0
  371. data/node_modules/marked/.eslintignore +1 -0
  372. data/node_modules/marked/.eslintrc.json +28 -0
  373. data/node_modules/marked/.package 2.json.icloud +0 -0
  374. data/node_modules/marked/.travis.yml +47 -0
  375. data/node_modules/marked/Makefile +15 -0
  376. data/node_modules/marked/Makefile 2 +15 -0
  377. data/node_modules/marked/README 2.md +75 -0
  378. data/node_modules/marked/README.md +75 -0
  379. data/node_modules/marked/bin/marked +199 -0
  380. data/node_modules/marked/bower.json +23 -0
  381. data/node_modules/marked/component.json +10 -0
  382. data/node_modules/marked/index.js +1 -0
  383. data/node_modules/marked/jasmine.json +11 -0
  384. data/node_modules/marked/lib/marked 2.js +1604 -0
  385. data/node_modules/marked/lib/marked.js +1604 -0
  386. data/node_modules/marked/man/marked.1 +91 -0
  387. data/node_modules/marked/man/marked.1.txt +96 -0
  388. data/node_modules/marked/marked.min.js +6 -0
  389. data/node_modules/marked/package.json +95 -0
  390. data/node_modules/simplemde/.eslintrc +23 -0
  391. data/node_modules/simplemde/.npmignore +9 -0
  392. data/node_modules/simplemde/.travis.yml +18 -0
  393. data/node_modules/simplemde/CONTRIBUTING 2.md +10 -0
  394. data/node_modules/simplemde/CONTRIBUTING.md +10 -0
  395. data/node_modules/simplemde/LICENSE +22 -0
  396. data/node_modules/simplemde/README.md +331 -0
  397. data/node_modules/simplemde/bower.json +23 -0
  398. data/node_modules/simplemde/debug/.simplemde 2.css.icloud +0 -0
  399. data/node_modules/simplemde/debug/simplemde.css +676 -0
  400. data/node_modules/simplemde/debug/simplemde.debug.js +17023 -0
  401. data/node_modules/simplemde/debug/simplemde.js +17019 -0
  402. data/node_modules/simplemde/dist/simplemde.min.css +7 -0
  403. data/node_modules/simplemde/dist/simplemde.min.js +15 -0
  404. data/node_modules/simplemde/gulpfile.js +96 -0
  405. data/node_modules/simplemde/package.json +73 -0
  406. data/node_modules/simplemde/src/css/simplemde.css +328 -0
  407. data/node_modules/simplemde/src/js/codemirror/tablist 2.js +44 -0
  408. data/node_modules/simplemde/src/js/codemirror/tablist.js +44 -0
  409. data/node_modules/simplemde/src/js/simplemde.js +2028 -0
  410. data/node_modules/typo-js/README.md +45 -0
  411. data/node_modules/typo-js/dictionaries/en_US/.en_US 2.dic.icloud +0 -0
  412. data/node_modules/typo-js/dictionaries/en_US/README.md +7 -0
  413. data/node_modules/typo-js/dictionaries/en_US/en_US.aff +201 -0
  414. data/node_modules/typo-js/dictionaries/en_US/en_US.dic +62120 -0
  415. data/node_modules/typo-js/package.json +56 -0
  416. data/node_modules/typo-js/typo.js +931 -0
  417. data/package-lock.json +40 -0
  418. data/package.json +7 -0
  419. metadata +557 -0
@@ -0,0 +1,433 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://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("crystal", function(config) {
15
+ function wordRegExp(words, end) {
16
+ return new RegExp((end ? "" : "^") + "(?:" + words.join("|") + ")" + (end ? "$" : "\\b"));
17
+ }
18
+
19
+ function chain(tokenize, stream, state) {
20
+ state.tokenize.push(tokenize);
21
+ return tokenize(stream, state);
22
+ }
23
+
24
+ var operators = /^(?:[-+/%|&^]|\*\*?|[<>]{2})/;
25
+ var conditionalOperators = /^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/;
26
+ var indexingOperators = /^(?:\[\][?=]?)/;
27
+ var anotherOperators = /^(?:\.(?:\.{2})?|->|[?:])/;
28
+ var idents = /^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/;
29
+ var types = /^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/;
30
+ var keywords = wordRegExp([
31
+ "abstract", "alias", "as", "asm", "begin", "break", "case", "class", "def", "do",
32
+ "else", "elsif", "end", "ensure", "enum", "extend", "for", "fun", "if",
33
+ "include", "instance_sizeof", "lib", "macro", "module", "next", "of", "out", "pointerof",
34
+ "private", "protected", "rescue", "return", "require", "select", "sizeof", "struct",
35
+ "super", "then", "type", "typeof", "uninitialized", "union", "unless", "until", "when", "while", "with",
36
+ "yield", "__DIR__", "__END_LINE__", "__FILE__", "__LINE__"
37
+ ]);
38
+ var atomWords = wordRegExp(["true", "false", "nil", "self"]);
39
+ var indentKeywordsArray = [
40
+ "def", "fun", "macro",
41
+ "class", "module", "struct", "lib", "enum", "union",
42
+ "do", "for"
43
+ ];
44
+ var indentKeywords = wordRegExp(indentKeywordsArray);
45
+ var indentExpressionKeywordsArray = ["if", "unless", "case", "while", "until", "begin", "then"];
46
+ var indentExpressionKeywords = wordRegExp(indentExpressionKeywordsArray);
47
+ var dedentKeywordsArray = ["end", "else", "elsif", "rescue", "ensure"];
48
+ var dedentKeywords = wordRegExp(dedentKeywordsArray);
49
+ var dedentPunctualsArray = ["\\)", "\\}", "\\]"];
50
+ var dedentPunctuals = new RegExp("^(?:" + dedentPunctualsArray.join("|") + ")$");
51
+ var nextTokenizer = {
52
+ "def": tokenFollowIdent, "fun": tokenFollowIdent, "macro": tokenMacroDef,
53
+ "class": tokenFollowType, "module": tokenFollowType, "struct": tokenFollowType,
54
+ "lib": tokenFollowType, "enum": tokenFollowType, "union": tokenFollowType
55
+ };
56
+ var matching = {"[": "]", "{": "}", "(": ")", "<": ">"};
57
+
58
+ function tokenBase(stream, state) {
59
+ if (stream.eatSpace()) {
60
+ return null;
61
+ }
62
+
63
+ // Macros
64
+ if (state.lastToken != "\\" && stream.match("{%", false)) {
65
+ return chain(tokenMacro("%", "%"), stream, state);
66
+ }
67
+
68
+ if (state.lastToken != "\\" && stream.match("{{", false)) {
69
+ return chain(tokenMacro("{", "}"), stream, state);
70
+ }
71
+
72
+ // Comments
73
+ if (stream.peek() == "#") {
74
+ stream.skipToEnd();
75
+ return "comment";
76
+ }
77
+
78
+ // Variables and keywords
79
+ var matched;
80
+ if (stream.match(idents)) {
81
+ stream.eat(/[?!]/);
82
+
83
+ matched = stream.current();
84
+ if (stream.eat(":")) {
85
+ return "atom";
86
+ } else if (state.lastToken == ".") {
87
+ return "property";
88
+ } else if (keywords.test(matched)) {
89
+ if (indentKeywords.test(matched)) {
90
+ if (!(matched == "fun" && state.blocks.indexOf("lib") >= 0) && !(matched == "def" && state.lastToken == "abstract")) {
91
+ state.blocks.push(matched);
92
+ state.currentIndent += 1;
93
+ }
94
+ } else if ((state.lastStyle == "operator" || !state.lastStyle) && indentExpressionKeywords.test(matched)) {
95
+ state.blocks.push(matched);
96
+ state.currentIndent += 1;
97
+ } else if (matched == "end") {
98
+ state.blocks.pop();
99
+ state.currentIndent -= 1;
100
+ }
101
+
102
+ if (nextTokenizer.hasOwnProperty(matched)) {
103
+ state.tokenize.push(nextTokenizer[matched]);
104
+ }
105
+
106
+ return "keyword";
107
+ } else if (atomWords.test(matched)) {
108
+ return "atom";
109
+ }
110
+
111
+ return "variable";
112
+ }
113
+
114
+ // Class variables and instance variables
115
+ // or attributes
116
+ if (stream.eat("@")) {
117
+ if (stream.peek() == "[") {
118
+ return chain(tokenNest("[", "]", "meta"), stream, state);
119
+ }
120
+
121
+ stream.eat("@");
122
+ stream.match(idents) || stream.match(types);
123
+ return "variable-2";
124
+ }
125
+
126
+ // Constants and types
127
+ if (stream.match(types)) {
128
+ return "tag";
129
+ }
130
+
131
+ // Symbols or ':' operator
132
+ if (stream.eat(":")) {
133
+ if (stream.eat("\"")) {
134
+ return chain(tokenQuote("\"", "atom", false), stream, state);
135
+ } else if (stream.match(idents) || stream.match(types) ||
136
+ stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators)) {
137
+ return "atom";
138
+ }
139
+ stream.eat(":");
140
+ return "operator";
141
+ }
142
+
143
+ // Strings
144
+ if (stream.eat("\"")) {
145
+ return chain(tokenQuote("\"", "string", true), stream, state);
146
+ }
147
+
148
+ // Strings or regexps or macro variables or '%' operator
149
+ if (stream.peek() == "%") {
150
+ var style = "string";
151
+ var embed = true;
152
+ var delim;
153
+
154
+ if (stream.match("%r")) {
155
+ // Regexps
156
+ style = "string-2";
157
+ delim = stream.next();
158
+ } else if (stream.match("%w")) {
159
+ embed = false;
160
+ delim = stream.next();
161
+ } else if (stream.match("%q")) {
162
+ embed = false;
163
+ delim = stream.next();
164
+ } else {
165
+ if(delim = stream.match(/^%([^\w\s=])/)) {
166
+ delim = delim[1];
167
+ } else if (stream.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)) {
168
+ // Macro variables
169
+ return "meta";
170
+ } else {
171
+ // '%' operator
172
+ return "operator";
173
+ }
174
+ }
175
+
176
+ if (matching.hasOwnProperty(delim)) {
177
+ delim = matching[delim];
178
+ }
179
+ return chain(tokenQuote(delim, style, embed), stream, state);
180
+ }
181
+
182
+ // Here Docs
183
+ if (matched = stream.match(/^<<-('?)([A-Z]\w*)\1/)) {
184
+ return chain(tokenHereDoc(matched[2], !matched[1]), stream, state)
185
+ }
186
+
187
+ // Characters
188
+ if (stream.eat("'")) {
189
+ stream.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/);
190
+ stream.eat("'");
191
+ return "atom";
192
+ }
193
+
194
+ // Numbers
195
+ if (stream.eat("0")) {
196
+ if (stream.eat("x")) {
197
+ stream.match(/^[0-9a-fA-F]+/);
198
+ } else if (stream.eat("o")) {
199
+ stream.match(/^[0-7]+/);
200
+ } else if (stream.eat("b")) {
201
+ stream.match(/^[01]+/);
202
+ }
203
+ return "number";
204
+ }
205
+
206
+ if (stream.eat(/^\d/)) {
207
+ stream.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/);
208
+ return "number";
209
+ }
210
+
211
+ // Operators
212
+ if (stream.match(operators)) {
213
+ stream.eat("="); // Operators can follow assign symbol.
214
+ return "operator";
215
+ }
216
+
217
+ if (stream.match(conditionalOperators) || stream.match(anotherOperators)) {
218
+ return "operator";
219
+ }
220
+
221
+ // Parens and braces
222
+ if (matched = stream.match(/[({[]/, false)) {
223
+ matched = matched[0];
224
+ return chain(tokenNest(matched, matching[matched], null), stream, state);
225
+ }
226
+
227
+ // Escapes
228
+ if (stream.eat("\\")) {
229
+ stream.next();
230
+ return "meta";
231
+ }
232
+
233
+ stream.next();
234
+ return null;
235
+ }
236
+
237
+ function tokenNest(begin, end, style, started) {
238
+ return function (stream, state) {
239
+ if (!started && stream.match(begin)) {
240
+ state.tokenize[state.tokenize.length - 1] = tokenNest(begin, end, style, true);
241
+ state.currentIndent += 1;
242
+ return style;
243
+ }
244
+
245
+ var nextStyle = tokenBase(stream, state);
246
+ if (stream.current() === end) {
247
+ state.tokenize.pop();
248
+ state.currentIndent -= 1;
249
+ nextStyle = style;
250
+ }
251
+
252
+ return nextStyle;
253
+ };
254
+ }
255
+
256
+ function tokenMacro(begin, end, started) {
257
+ return function (stream, state) {
258
+ if (!started && stream.match("{" + begin)) {
259
+ state.currentIndent += 1;
260
+ state.tokenize[state.tokenize.length - 1] = tokenMacro(begin, end, true);
261
+ return "meta";
262
+ }
263
+
264
+ if (stream.match(end + "}")) {
265
+ state.currentIndent -= 1;
266
+ state.tokenize.pop();
267
+ return "meta";
268
+ }
269
+
270
+ return tokenBase(stream, state);
271
+ };
272
+ }
273
+
274
+ function tokenMacroDef(stream, state) {
275
+ if (stream.eatSpace()) {
276
+ return null;
277
+ }
278
+
279
+ var matched;
280
+ if (matched = stream.match(idents)) {
281
+ if (matched == "def") {
282
+ return "keyword";
283
+ }
284
+ stream.eat(/[?!]/);
285
+ }
286
+
287
+ state.tokenize.pop();
288
+ return "def";
289
+ }
290
+
291
+ function tokenFollowIdent(stream, state) {
292
+ if (stream.eatSpace()) {
293
+ return null;
294
+ }
295
+
296
+ if (stream.match(idents)) {
297
+ stream.eat(/[!?]/);
298
+ } else {
299
+ stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators);
300
+ }
301
+ state.tokenize.pop();
302
+ return "def";
303
+ }
304
+
305
+ function tokenFollowType(stream, state) {
306
+ if (stream.eatSpace()) {
307
+ return null;
308
+ }
309
+
310
+ stream.match(types);
311
+ state.tokenize.pop();
312
+ return "def";
313
+ }
314
+
315
+ function tokenQuote(end, style, embed) {
316
+ return function (stream, state) {
317
+ var escaped = false;
318
+
319
+ while (stream.peek()) {
320
+ if (!escaped) {
321
+ if (stream.match("{%", false)) {
322
+ state.tokenize.push(tokenMacro("%", "%"));
323
+ return style;
324
+ }
325
+
326
+ if (stream.match("{{", false)) {
327
+ state.tokenize.push(tokenMacro("{", "}"));
328
+ return style;
329
+ }
330
+
331
+ if (embed && stream.match("#{", false)) {
332
+ state.tokenize.push(tokenNest("#{", "}", "meta"));
333
+ return style;
334
+ }
335
+
336
+ var ch = stream.next();
337
+
338
+ if (ch == end) {
339
+ state.tokenize.pop();
340
+ return style;
341
+ }
342
+
343
+ escaped = embed && ch == "\\";
344
+ } else {
345
+ stream.next();
346
+ escaped = false;
347
+ }
348
+ }
349
+
350
+ return style;
351
+ };
352
+ }
353
+
354
+ function tokenHereDoc(phrase, embed) {
355
+ return function (stream, state) {
356
+ if (stream.sol()) {
357
+ stream.eatSpace()
358
+ if (stream.match(phrase)) {
359
+ state.tokenize.pop();
360
+ return "string";
361
+ }
362
+ }
363
+
364
+ var escaped = false;
365
+ while (stream.peek()) {
366
+ if (!escaped) {
367
+ if (stream.match("{%", false)) {
368
+ state.tokenize.push(tokenMacro("%", "%"));
369
+ return "string";
370
+ }
371
+
372
+ if (stream.match("{{", false)) {
373
+ state.tokenize.push(tokenMacro("{", "}"));
374
+ return "string";
375
+ }
376
+
377
+ if (embed && stream.match("#{", false)) {
378
+ state.tokenize.push(tokenNest("#{", "}", "meta"));
379
+ return "string";
380
+ }
381
+
382
+ escaped = embed && stream.next() == "\\";
383
+ } else {
384
+ stream.next();
385
+ escaped = false;
386
+ }
387
+ }
388
+
389
+ return "string";
390
+ }
391
+ }
392
+
393
+ return {
394
+ startState: function () {
395
+ return {
396
+ tokenize: [tokenBase],
397
+ currentIndent: 0,
398
+ lastToken: null,
399
+ lastStyle: null,
400
+ blocks: []
401
+ };
402
+ },
403
+
404
+ token: function (stream, state) {
405
+ var style = state.tokenize[state.tokenize.length - 1](stream, state);
406
+ var token = stream.current();
407
+
408
+ if (style && style != "comment") {
409
+ state.lastToken = token;
410
+ state.lastStyle = style;
411
+ }
412
+
413
+ return style;
414
+ },
415
+
416
+ indent: function (state, textAfter) {
417
+ textAfter = textAfter.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g, "");
418
+
419
+ if (dedentKeywords.test(textAfter) || dedentPunctuals.test(textAfter)) {
420
+ return config.indentUnit * (state.currentIndent - 1);
421
+ }
422
+
423
+ return config.indentUnit * state.currentIndent;
424
+ },
425
+
426
+ fold: "indent",
427
+ electricInput: wordRegExp(dedentPunctualsArray.concat(dedentKeywordsArray), true),
428
+ lineComment: '#'
429
+ };
430
+ });
431
+
432
+ CodeMirror.defineMIME("text/x-crystal", "crystal");
433
+ });
@@ -0,0 +1,832 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://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("css", function(config, parserConfig) {
15
+ var inline = parserConfig.inline
16
+ if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
17
+
18
+ var indentUnit = config.indentUnit,
19
+ tokenHooks = parserConfig.tokenHooks,
20
+ documentTypes = parserConfig.documentTypes || {},
21
+ mediaTypes = parserConfig.mediaTypes || {},
22
+ mediaFeatures = parserConfig.mediaFeatures || {},
23
+ mediaValueKeywords = parserConfig.mediaValueKeywords || {},
24
+ propertyKeywords = parserConfig.propertyKeywords || {},
25
+ nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
26
+ fontProperties = parserConfig.fontProperties || {},
27
+ counterDescriptors = parserConfig.counterDescriptors || {},
28
+ colorKeywords = parserConfig.colorKeywords || {},
29
+ valueKeywords = parserConfig.valueKeywords || {},
30
+ allowNested = parserConfig.allowNested,
31
+ lineComment = parserConfig.lineComment,
32
+ supportsAtComponent = parserConfig.supportsAtComponent === true;
33
+
34
+ var type, override;
35
+ function ret(style, tp) { type = tp; return style; }
36
+
37
+ // Tokenizers
38
+
39
+ function tokenBase(stream, state) {
40
+ var ch = stream.next();
41
+ if (tokenHooks[ch]) {
42
+ var result = tokenHooks[ch](stream, state);
43
+ if (result !== false) return result;
44
+ }
45
+ if (ch == "@") {
46
+ stream.eatWhile(/[\w\\\-]/);
47
+ return ret("def", stream.current());
48
+ } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {
49
+ return ret(null, "compare");
50
+ } else if (ch == "\"" || ch == "'") {
51
+ state.tokenize = tokenString(ch);
52
+ return state.tokenize(stream, state);
53
+ } else if (ch == "#") {
54
+ stream.eatWhile(/[\w\\\-]/);
55
+ return ret("atom", "hash");
56
+ } else if (ch == "!") {
57
+ stream.match(/^\s*\w*/);
58
+ return ret("keyword", "important");
59
+ } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {
60
+ stream.eatWhile(/[\w.%]/);
61
+ return ret("number", "unit");
62
+ } else if (ch === "-") {
63
+ if (/[\d.]/.test(stream.peek())) {
64
+ stream.eatWhile(/[\w.%]/);
65
+ return ret("number", "unit");
66
+ } else if (stream.match(/^-[\w\\\-]+/)) {
67
+ stream.eatWhile(/[\w\\\-]/);
68
+ if (stream.match(/^\s*:/, false))
69
+ return ret("variable-2", "variable-definition");
70
+ return ret("variable-2", "variable");
71
+ } else if (stream.match(/^\w+-/)) {
72
+ return ret("meta", "meta");
73
+ }
74
+ } else if (/[,+>*\/]/.test(ch)) {
75
+ return ret(null, "select-op");
76
+ } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
77
+ return ret("qualifier", "qualifier");
78
+ } else if (/[:;{}\[\]\(\)]/.test(ch)) {
79
+ return ret(null, ch);
80
+ } else if (((ch == "u" || ch == "U") && stream.match(/rl(-prefix)?\(/i)) ||
81
+ ((ch == "d" || ch == "D") && stream.match("omain(", true, true)) ||
82
+ ((ch == "r" || ch == "R") && stream.match("egexp(", true, true))) {
83
+ stream.backUp(1);
84
+ state.tokenize = tokenParenthesized;
85
+ return ret("property", "word");
86
+ } else if (/[\w\\\-]/.test(ch)) {
87
+ stream.eatWhile(/[\w\\\-]/);
88
+ return ret("property", "word");
89
+ } else {
90
+ return ret(null, null);
91
+ }
92
+ }
93
+
94
+ function tokenString(quote) {
95
+ return function(stream, state) {
96
+ var escaped = false, ch;
97
+ while ((ch = stream.next()) != null) {
98
+ if (ch == quote && !escaped) {
99
+ if (quote == ")") stream.backUp(1);
100
+ break;
101
+ }
102
+ escaped = !escaped && ch == "\\";
103
+ }
104
+ if (ch == quote || !escaped && quote != ")") state.tokenize = null;
105
+ return ret("string", "string");
106
+ };
107
+ }
108
+
109
+ function tokenParenthesized(stream, state) {
110
+ stream.next(); // Must be '('
111
+ if (!stream.match(/\s*[\"\')]/, false))
112
+ state.tokenize = tokenString(")");
113
+ else
114
+ state.tokenize = null;
115
+ return ret(null, "(");
116
+ }
117
+
118
+ // Context management
119
+
120
+ function Context(type, indent, prev) {
121
+ this.type = type;
122
+ this.indent = indent;
123
+ this.prev = prev;
124
+ }
125
+
126
+ function pushContext(state, stream, type, indent) {
127
+ state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);
128
+ return type;
129
+ }
130
+
131
+ function popContext(state) {
132
+ if (state.context.prev)
133
+ state.context = state.context.prev;
134
+ return state.context.type;
135
+ }
136
+
137
+ function pass(type, stream, state) {
138
+ return states[state.context.type](type, stream, state);
139
+ }
140
+ function popAndPass(type, stream, state, n) {
141
+ for (var i = n || 1; i > 0; i--)
142
+ state.context = state.context.prev;
143
+ return pass(type, stream, state);
144
+ }
145
+
146
+ // Parser
147
+
148
+ function wordAsValue(stream) {
149
+ var word = stream.current().toLowerCase();
150
+ if (valueKeywords.hasOwnProperty(word))
151
+ override = "atom";
152
+ else if (colorKeywords.hasOwnProperty(word))
153
+ override = "keyword";
154
+ else
155
+ override = "variable";
156
+ }
157
+
158
+ var states = {};
159
+
160
+ states.top = function(type, stream, state) {
161
+ if (type == "{") {
162
+ return pushContext(state, stream, "block");
163
+ } else if (type == "}" && state.context.prev) {
164
+ return popContext(state);
165
+ } else if (supportsAtComponent && /@component/i.test(type)) {
166
+ return pushContext(state, stream, "atComponentBlock");
167
+ } else if (/^@(-moz-)?document$/i.test(type)) {
168
+ return pushContext(state, stream, "documentTypes");
169
+ } else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) {
170
+ return pushContext(state, stream, "atBlock");
171
+ } else if (/^@(font-face|counter-style)/i.test(type)) {
172
+ state.stateArg = type;
173
+ return "restricted_atBlock_before";
174
+ } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) {
175
+ return "keyframes";
176
+ } else if (type && type.charAt(0) == "@") {
177
+ return pushContext(state, stream, "at");
178
+ } else if (type == "hash") {
179
+ override = "builtin";
180
+ } else if (type == "word") {
181
+ override = "tag";
182
+ } else if (type == "variable-definition") {
183
+ return "maybeprop";
184
+ } else if (type == "interpolation") {
185
+ return pushContext(state, stream, "interpolation");
186
+ } else if (type == ":") {
187
+ return "pseudo";
188
+ } else if (allowNested && type == "(") {
189
+ return pushContext(state, stream, "parens");
190
+ }
191
+ return state.context.type;
192
+ };
193
+
194
+ states.block = function(type, stream, state) {
195
+ if (type == "word") {
196
+ var word = stream.current().toLowerCase();
197
+ if (propertyKeywords.hasOwnProperty(word)) {
198
+ override = "property";
199
+ return "maybeprop";
200
+ } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
201
+ override = "string-2";
202
+ return "maybeprop";
203
+ } else if (allowNested) {
204
+ override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
205
+ return "block";
206
+ } else {
207
+ override += " error";
208
+ return "maybeprop";
209
+ }
210
+ } else if (type == "meta") {
211
+ return "block";
212
+ } else if (!allowNested && (type == "hash" || type == "qualifier")) {
213
+ override = "error";
214
+ return "block";
215
+ } else {
216
+ return states.top(type, stream, state);
217
+ }
218
+ };
219
+
220
+ states.maybeprop = function(type, stream, state) {
221
+ if (type == ":") return pushContext(state, stream, "prop");
222
+ return pass(type, stream, state);
223
+ };
224
+
225
+ states.prop = function(type, stream, state) {
226
+ if (type == ";") return popContext(state);
227
+ if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");
228
+ if (type == "}" || type == "{") return popAndPass(type, stream, state);
229
+ if (type == "(") return pushContext(state, stream, "parens");
230
+
231
+ if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
232
+ override += " error";
233
+ } else if (type == "word") {
234
+ wordAsValue(stream);
235
+ } else if (type == "interpolation") {
236
+ return pushContext(state, stream, "interpolation");
237
+ }
238
+ return "prop";
239
+ };
240
+
241
+ states.propBlock = function(type, _stream, state) {
242
+ if (type == "}") return popContext(state);
243
+ if (type == "word") { override = "property"; return "maybeprop"; }
244
+ return state.context.type;
245
+ };
246
+
247
+ states.parens = function(type, stream, state) {
248
+ if (type == "{" || type == "}") return popAndPass(type, stream, state);
249
+ if (type == ")") return popContext(state);
250
+ if (type == "(") return pushContext(state, stream, "parens");
251
+ if (type == "interpolation") return pushContext(state, stream, "interpolation");
252
+ if (type == "word") wordAsValue(stream);
253
+ return "parens";
254
+ };
255
+
256
+ states.pseudo = function(type, stream, state) {
257
+ if (type == "meta") return "pseudo";
258
+
259
+ if (type == "word") {
260
+ override = "variable-3";
261
+ return state.context.type;
262
+ }
263
+ return pass(type, stream, state);
264
+ };
265
+
266
+ states.documentTypes = function(type, stream, state) {
267
+ if (type == "word" && documentTypes.hasOwnProperty(stream.current())) {
268
+ override = "tag";
269
+ return state.context.type;
270
+ } else {
271
+ return states.atBlock(type, stream, state);
272
+ }
273
+ };
274
+
275
+ states.atBlock = function(type, stream, state) {
276
+ if (type == "(") return pushContext(state, stream, "atBlock_parens");
277
+ if (type == "}" || type == ";") return popAndPass(type, stream, state);
278
+ if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
279
+
280
+ if (type == "interpolation") return pushContext(state, stream, "interpolation");
281
+
282
+ if (type == "word") {
283
+ var word = stream.current().toLowerCase();
284
+ if (word == "only" || word == "not" || word == "and" || word == "or")
285
+ override = "keyword";
286
+ else if (mediaTypes.hasOwnProperty(word))
287
+ override = "attribute";
288
+ else if (mediaFeatures.hasOwnProperty(word))
289
+ override = "property";
290
+ else if (mediaValueKeywords.hasOwnProperty(word))
291
+ override = "keyword";
292
+ else if (propertyKeywords.hasOwnProperty(word))
293
+ override = "property";
294
+ else if (nonStandardPropertyKeywords.hasOwnProperty(word))
295
+ override = "string-2";
296
+ else if (valueKeywords.hasOwnProperty(word))
297
+ override = "atom";
298
+ else if (colorKeywords.hasOwnProperty(word))
299
+ override = "keyword";
300
+ else
301
+ override = "error";
302
+ }
303
+ return state.context.type;
304
+ };
305
+
306
+ states.atComponentBlock = function(type, stream, state) {
307
+ if (type == "}")
308
+ return popAndPass(type, stream, state);
309
+ if (type == "{")
310
+ return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false);
311
+ if (type == "word")
312
+ override = "error";
313
+ return state.context.type;
314
+ };
315
+
316
+ states.atBlock_parens = function(type, stream, state) {
317
+ if (type == ")") return popContext(state);
318
+ if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
319
+ return states.atBlock(type, stream, state);
320
+ };
321
+
322
+ states.restricted_atBlock_before = function(type, stream, state) {
323
+ if (type == "{")
324
+ return pushContext(state, stream, "restricted_atBlock");
325
+ if (type == "word" && state.stateArg == "@counter-style") {
326
+ override = "variable";
327
+ return "restricted_atBlock_before";
328
+ }
329
+ return pass(type, stream, state);
330
+ };
331
+
332
+ states.restricted_atBlock = function(type, stream, state) {
333
+ if (type == "}") {
334
+ state.stateArg = null;
335
+ return popContext(state);
336
+ }
337
+ if (type == "word") {
338
+ if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||
339
+ (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))
340
+ override = "error";
341
+ else
342
+ override = "property";
343
+ return "maybeprop";
344
+ }
345
+ return "restricted_atBlock";
346
+ };
347
+
348
+ states.keyframes = function(type, stream, state) {
349
+ if (type == "word") { override = "variable"; return "keyframes"; }
350
+ if (type == "{") return pushContext(state, stream, "top");
351
+ return pass(type, stream, state);
352
+ };
353
+
354
+ states.at = function(type, stream, state) {
355
+ if (type == ";") return popContext(state);
356
+ if (type == "{" || type == "}") return popAndPass(type, stream, state);
357
+ if (type == "word") override = "tag";
358
+ else if (type == "hash") override = "builtin";
359
+ return "at";
360
+ };
361
+
362
+ states.interpolation = function(type, stream, state) {
363
+ if (type == "}") return popContext(state);
364
+ if (type == "{" || type == ";") return popAndPass(type, stream, state);
365
+ if (type == "word") override = "variable";
366
+ else if (type != "variable" && type != "(" && type != ")") override = "error";
367
+ return "interpolation";
368
+ };
369
+
370
+ return {
371
+ startState: function(base) {
372
+ return {tokenize: null,
373
+ state: inline ? "block" : "top",
374
+ stateArg: null,
375
+ context: new Context(inline ? "block" : "top", base || 0, null)};
376
+ },
377
+
378
+ token: function(stream, state) {
379
+ if (!state.tokenize && stream.eatSpace()) return null;
380
+ var style = (state.tokenize || tokenBase)(stream, state);
381
+ if (style && typeof style == "object") {
382
+ type = style[1];
383
+ style = style[0];
384
+ }
385
+ override = style;
386
+ if (type != "comment")
387
+ state.state = states[state.state](type, stream, state);
388
+ return override;
389
+ },
390
+
391
+ indent: function(state, textAfter) {
392
+ var cx = state.context, ch = textAfter && textAfter.charAt(0);
393
+ var indent = cx.indent;
394
+ if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
395
+ if (cx.prev) {
396
+ if (ch == "}" && (cx.type == "block" || cx.type == "top" ||
397
+ cx.type == "interpolation" || cx.type == "restricted_atBlock")) {
398
+ // Resume indentation from parent context.
399
+ cx = cx.prev;
400
+ indent = cx.indent;
401
+ } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
402
+ ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
403
+ // Dedent relative to current context.
404
+ indent = Math.max(0, cx.indent - indentUnit);
405
+ }
406
+ }
407
+ return indent;
408
+ },
409
+
410
+ electricChars: "}",
411
+ blockCommentStart: "/*",
412
+ blockCommentEnd: "*/",
413
+ blockCommentContinue: " * ",
414
+ lineComment: lineComment,
415
+ fold: "brace"
416
+ };
417
+ });
418
+
419
+ function keySet(array) {
420
+ var keys = {};
421
+ for (var i = 0; i < array.length; ++i) {
422
+ keys[array[i].toLowerCase()] = true;
423
+ }
424
+ return keys;
425
+ }
426
+
427
+ var documentTypes_ = [
428
+ "domain", "regexp", "url", "url-prefix"
429
+ ], documentTypes = keySet(documentTypes_);
430
+
431
+ var mediaTypes_ = [
432
+ "all", "aural", "braille", "handheld", "print", "projection", "screen",
433
+ "tty", "tv", "embossed"
434
+ ], mediaTypes = keySet(mediaTypes_);
435
+
436
+ var mediaFeatures_ = [
437
+ "width", "min-width", "max-width", "height", "min-height", "max-height",
438
+ "device-width", "min-device-width", "max-device-width", "device-height",
439
+ "min-device-height", "max-device-height", "aspect-ratio",
440
+ "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
441
+ "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
442
+ "max-color", "color-index", "min-color-index", "max-color-index",
443
+ "monochrome", "min-monochrome", "max-monochrome", "resolution",
444
+ "min-resolution", "max-resolution", "scan", "grid", "orientation",
445
+ "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
446
+ "pointer", "any-pointer", "hover", "any-hover"
447
+ ], mediaFeatures = keySet(mediaFeatures_);
448
+
449
+ var mediaValueKeywords_ = [
450
+ "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
451
+ "interlace", "progressive"
452
+ ], mediaValueKeywords = keySet(mediaValueKeywords_);
453
+
454
+ var propertyKeywords_ = [
455
+ "align-content", "align-items", "align-self", "alignment-adjust",
456
+ "alignment-baseline", "anchor-point", "animation", "animation-delay",
457
+ "animation-direction", "animation-duration", "animation-fill-mode",
458
+ "animation-iteration-count", "animation-name", "animation-play-state",
459
+ "animation-timing-function", "appearance", "azimuth", "backface-visibility",
460
+ "background", "background-attachment", "background-blend-mode", "background-clip",
461
+ "background-color", "background-image", "background-origin", "background-position",
462
+ "background-repeat", "background-size", "baseline-shift", "binding",
463
+ "bleed", "bookmark-label", "bookmark-level", "bookmark-state",
464
+ "bookmark-target", "border", "border-bottom", "border-bottom-color",
465
+ "border-bottom-left-radius", "border-bottom-right-radius",
466
+ "border-bottom-style", "border-bottom-width", "border-collapse",
467
+ "border-color", "border-image", "border-image-outset",
468
+ "border-image-repeat", "border-image-slice", "border-image-source",
469
+ "border-image-width", "border-left", "border-left-color",
470
+ "border-left-style", "border-left-width", "border-radius", "border-right",
471
+ "border-right-color", "border-right-style", "border-right-width",
472
+ "border-spacing", "border-style", "border-top", "border-top-color",
473
+ "border-top-left-radius", "border-top-right-radius", "border-top-style",
474
+ "border-top-width", "border-width", "bottom", "box-decoration-break",
475
+ "box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
476
+ "caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
477
+ "column-fill", "column-gap", "column-rule", "column-rule-color",
478
+ "column-rule-style", "column-rule-width", "column-span", "column-width",
479
+ "columns", "content", "counter-increment", "counter-reset", "crop", "cue",
480
+ "cue-after", "cue-before", "cursor", "direction", "display",
481
+ "dominant-baseline", "drop-initial-after-adjust",
482
+ "drop-initial-after-align", "drop-initial-before-adjust",
483
+ "drop-initial-before-align", "drop-initial-size", "drop-initial-value",
484
+ "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
485
+ "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
486
+ "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",
487
+ "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust",
488
+ "font-stretch", "font-style", "font-synthesis", "font-variant",
489
+ "font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
490
+ "font-variant-ligatures", "font-variant-numeric", "font-variant-position",
491
+ "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
492
+ "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap",
493
+ "grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap",
494
+ "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
495
+ "grid-template-rows", "hanging-punctuation", "height", "hyphens",
496
+ "icon", "image-orientation", "image-rendering", "image-resolution",
497
+ "inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
498
+ "line-break", "line-height", "line-stacking", "line-stacking-ruby",
499
+ "line-stacking-shift", "line-stacking-strategy", "list-style",
500
+ "list-style-image", "list-style-position", "list-style-type", "margin",
501
+ "margin-bottom", "margin-left", "margin-right", "margin-top",
502
+ "marks", "marquee-direction", "marquee-loop",
503
+ "marquee-play-count", "marquee-speed", "marquee-style", "max-height",
504
+ "max-width", "min-height", "min-width", "mix-blend-mode", "move-to", "nav-down", "nav-index",
505
+ "nav-left", "nav-right", "nav-up", "object-fit", "object-position",
506
+ "opacity", "order", "orphans", "outline",
507
+ "outline-color", "outline-offset", "outline-style", "outline-width",
508
+ "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
509
+ "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
510
+ "page", "page-break-after", "page-break-before", "page-break-inside",
511
+ "page-policy", "pause", "pause-after", "pause-before", "perspective",
512
+ "perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
513
+ "presentation-level", "punctuation-trim", "quotes", "region-break-after",
514
+ "region-break-before", "region-break-inside", "region-fragment",
515
+ "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
516
+ "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",
517
+ "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin",
518
+ "shape-outside", "size", "speak", "speak-as", "speak-header",
519
+ "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
520
+ "tab-size", "table-layout", "target", "target-name", "target-new",
521
+ "target-position", "text-align", "text-align-last", "text-decoration",
522
+ "text-decoration-color", "text-decoration-line", "text-decoration-skip",
523
+ "text-decoration-style", "text-emphasis", "text-emphasis-color",
524
+ "text-emphasis-position", "text-emphasis-style", "text-height",
525
+ "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",
526
+ "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position",
527
+ "text-wrap", "top", "transform", "transform-origin", "transform-style",
528
+ "transition", "transition-delay", "transition-duration",
529
+ "transition-property", "transition-timing-function", "unicode-bidi",
530
+ "user-select", "vertical-align", "visibility", "voice-balance", "voice-duration",
531
+ "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
532
+ "voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break",
533
+ "word-spacing", "word-wrap", "z-index",
534
+ // SVG-specific
535
+ "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
536
+ "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
537
+ "color-interpolation", "color-interpolation-filters",
538
+ "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",
539
+ "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke",
540
+ "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",
541
+ "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",
542
+ "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",
543
+ "glyph-orientation-vertical", "text-anchor", "writing-mode"
544
+ ], propertyKeywords = keySet(propertyKeywords_);
545
+
546
+ var nonStandardPropertyKeywords_ = [
547
+ "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
548
+ "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
549
+ "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside",
550
+ "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
551
+ "searchfield-results-decoration", "zoom"
552
+ ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
553
+
554
+ var fontProperties_ = [
555
+ "font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
556
+ "font-stretch", "font-weight", "font-style"
557
+ ], fontProperties = keySet(fontProperties_);
558
+
559
+ var counterDescriptors_ = [
560
+ "additive-symbols", "fallback", "negative", "pad", "prefix", "range",
561
+ "speak-as", "suffix", "symbols", "system"
562
+ ], counterDescriptors = keySet(counterDescriptors_);
563
+
564
+ var colorKeywords_ = [
565
+ "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
566
+ "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
567
+ "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
568
+ "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
569
+ "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
570
+ "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
571
+ "darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
572
+ "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
573
+ "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
574
+ "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
575
+ "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
576
+ "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
577
+ "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
578
+ "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
579
+ "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
580
+ "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
581
+ "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
582
+ "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",
583
+ "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered",
584
+ "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",
585
+ "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
586
+ "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
587
+ "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
588
+ "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
589
+ "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
590
+ "whitesmoke", "yellow", "yellowgreen"
591
+ ], colorKeywords = keySet(colorKeywords_);
592
+
593
+ var valueKeywords_ = [
594
+ "above", "absolute", "activeborder", "additive", "activecaption", "afar",
595
+ "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate",
596
+ "always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
597
+ "arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
598
+ "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",
599
+ "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
600
+ "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
601
+ "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
602
+ "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
603
+ "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
604
+ "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
605
+ "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
606
+ "compact", "condensed", "contain", "content", "contents",
607
+ "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
608
+ "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
609
+ "decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
610
+ "destination-in", "destination-out", "destination-over", "devanagari", "difference",
611
+ "disc", "discard", "disclosure-closed", "disclosure-open", "document",
612
+ "dot-dash", "dot-dot-dash",
613
+ "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
614
+ "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
615
+ "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
616
+ "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
617
+ "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
618
+ "ethiopic-halehame-gez", "ethiopic-halehame-om-et",
619
+ "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
620
+ "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
621
+ "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
622
+ "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
623
+ "forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
624
+ "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
625
+ "help", "hidden", "hide", "higher", "highlight", "highlighttext",
626
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
627
+ "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
628
+ "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
629
+ "inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
630
+ "italic", "japanese-formal", "japanese-informal", "justify", "kannada",
631
+ "katakana", "katakana-iroha", "keep-all", "khmer",
632
+ "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
633
+ "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten",
634
+ "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
635
+ "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
636
+ "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
637
+ "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d",
638
+ "media-controls-background", "media-current-time-display",
639
+ "media-fullscreen-button", "media-mute-button", "media-play-button",
640
+ "media-return-to-realtime-button", "media-rewind-button",
641
+ "media-seek-back-button", "media-seek-forward-button", "media-slider",
642
+ "media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
643
+ "media-volume-slider-container", "media-volume-sliderthumb", "medium",
644
+ "menu", "menulist", "menulist-button", "menulist-text",
645
+ "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
646
+ "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
647
+ "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
648
+ "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
649
+ "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote",
650
+ "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
651
+ "outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
652
+ "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter",
653
+ "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
654
+ "progress", "push-button", "radial-gradient", "radio", "read-only",
655
+ "read-write", "read-write-plaintext-only", "rectangle", "region",
656
+ "relative", "repeat", "repeating-linear-gradient",
657
+ "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
658
+ "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
659
+ "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
660
+ "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
661
+ "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
662
+ "searchfield-cancel-button", "searchfield-decoration",
663
+ "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
664
+ "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
665
+ "simp-chinese-formal", "simp-chinese-informal", "single",
666
+ "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
667
+ "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
668
+ "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
669
+ "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
670
+ "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
671
+ "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
672
+ "table-caption", "table-cell", "table-column", "table-column-group",
673
+ "table-footer-group", "table-header-group", "table-row", "table-row-group",
674
+ "tamil",
675
+ "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
676
+ "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
677
+ "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
678
+ "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
679
+ "trad-chinese-formal", "trad-chinese-informal", "transform",
680
+ "translate", "translate3d", "translateX", "translateY", "translateZ",
681
+ "transparent", "ultra-condensed", "ultra-expanded", "underline", "unset", "up",
682
+ "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
683
+ "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
684
+ "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
685
+ "visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
686
+ "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor",
687
+ "xx-large", "xx-small"
688
+ ], valueKeywords = keySet(valueKeywords_);
689
+
690
+ var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)
691
+ .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)
692
+ .concat(valueKeywords_);
693
+ CodeMirror.registerHelper("hintWords", "css", allWords);
694
+
695
+ function tokenCComment(stream, state) {
696
+ var maybeEnd = false, ch;
697
+ while ((ch = stream.next()) != null) {
698
+ if (maybeEnd && ch == "/") {
699
+ state.tokenize = null;
700
+ break;
701
+ }
702
+ maybeEnd = (ch == "*");
703
+ }
704
+ return ["comment", "comment"];
705
+ }
706
+
707
+ CodeMirror.defineMIME("text/css", {
708
+ documentTypes: documentTypes,
709
+ mediaTypes: mediaTypes,
710
+ mediaFeatures: mediaFeatures,
711
+ mediaValueKeywords: mediaValueKeywords,
712
+ propertyKeywords: propertyKeywords,
713
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
714
+ fontProperties: fontProperties,
715
+ counterDescriptors: counterDescriptors,
716
+ colorKeywords: colorKeywords,
717
+ valueKeywords: valueKeywords,
718
+ tokenHooks: {
719
+ "/": function(stream, state) {
720
+ if (!stream.eat("*")) return false;
721
+ state.tokenize = tokenCComment;
722
+ return tokenCComment(stream, state);
723
+ }
724
+ },
725
+ name: "css"
726
+ });
727
+
728
+ CodeMirror.defineMIME("text/x-scss", {
729
+ mediaTypes: mediaTypes,
730
+ mediaFeatures: mediaFeatures,
731
+ mediaValueKeywords: mediaValueKeywords,
732
+ propertyKeywords: propertyKeywords,
733
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
734
+ colorKeywords: colorKeywords,
735
+ valueKeywords: valueKeywords,
736
+ fontProperties: fontProperties,
737
+ allowNested: true,
738
+ lineComment: "//",
739
+ tokenHooks: {
740
+ "/": function(stream, state) {
741
+ if (stream.eat("/")) {
742
+ stream.skipToEnd();
743
+ return ["comment", "comment"];
744
+ } else if (stream.eat("*")) {
745
+ state.tokenize = tokenCComment;
746
+ return tokenCComment(stream, state);
747
+ } else {
748
+ return ["operator", "operator"];
749
+ }
750
+ },
751
+ ":": function(stream) {
752
+ if (stream.match(/\s*\{/, false))
753
+ return [null, null]
754
+ return false;
755
+ },
756
+ "$": function(stream) {
757
+ stream.match(/^[\w-]+/);
758
+ if (stream.match(/^\s*:/, false))
759
+ return ["variable-2", "variable-definition"];
760
+ return ["variable-2", "variable"];
761
+ },
762
+ "#": function(stream) {
763
+ if (!stream.eat("{")) return false;
764
+ return [null, "interpolation"];
765
+ }
766
+ },
767
+ name: "css",
768
+ helperType: "scss"
769
+ });
770
+
771
+ CodeMirror.defineMIME("text/x-less", {
772
+ mediaTypes: mediaTypes,
773
+ mediaFeatures: mediaFeatures,
774
+ mediaValueKeywords: mediaValueKeywords,
775
+ propertyKeywords: propertyKeywords,
776
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
777
+ colorKeywords: colorKeywords,
778
+ valueKeywords: valueKeywords,
779
+ fontProperties: fontProperties,
780
+ allowNested: true,
781
+ lineComment: "//",
782
+ tokenHooks: {
783
+ "/": function(stream, state) {
784
+ if (stream.eat("/")) {
785
+ stream.skipToEnd();
786
+ return ["comment", "comment"];
787
+ } else if (stream.eat("*")) {
788
+ state.tokenize = tokenCComment;
789
+ return tokenCComment(stream, state);
790
+ } else {
791
+ return ["operator", "operator"];
792
+ }
793
+ },
794
+ "@": function(stream) {
795
+ if (stream.eat("{")) return [null, "interpolation"];
796
+ if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, false)) return false;
797
+ stream.eatWhile(/[\w\\\-]/);
798
+ if (stream.match(/^\s*:/, false))
799
+ return ["variable-2", "variable-definition"];
800
+ return ["variable-2", "variable"];
801
+ },
802
+ "&": function() {
803
+ return ["atom", "atom"];
804
+ }
805
+ },
806
+ name: "css",
807
+ helperType: "less"
808
+ });
809
+
810
+ CodeMirror.defineMIME("text/x-gss", {
811
+ documentTypes: documentTypes,
812
+ mediaTypes: mediaTypes,
813
+ mediaFeatures: mediaFeatures,
814
+ propertyKeywords: propertyKeywords,
815
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
816
+ fontProperties: fontProperties,
817
+ counterDescriptors: counterDescriptors,
818
+ colorKeywords: colorKeywords,
819
+ valueKeywords: valueKeywords,
820
+ supportsAtComponent: true,
821
+ tokenHooks: {
822
+ "/": function(stream, state) {
823
+ if (!stream.eat("*")) return false;
824
+ state.tokenize = tokenCComment;
825
+ return tokenCComment(stream, state);
826
+ }
827
+ },
828
+ name: "css",
829
+ helperType: "gss"
830
+ });
831
+
832
+ });