gump 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +24 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +71 -0
  6. data/Rakefile +2 -0
  7. data/bin/gump +37 -0
  8. data/gump.gemspec +17 -0
  9. data/lib/gump.rb +50 -0
  10. data/lib/version.rb +3 -0
  11. data/server/assets/css/style.css +6949 -0
  12. data/server/assets/images/arrow.png +0 -0
  13. data/server/assets/images/logo.png +0 -0
  14. data/server/assets/js/bootstrap/dist/css/bootstrap-theme.css +347 -0
  15. data/server/assets/js/bootstrap/dist/css/bootstrap-theme.css.map +1 -0
  16. data/server/assets/js/bootstrap/dist/css/bootstrap-theme.min.css +7 -0
  17. data/server/assets/js/bootstrap/dist/css/bootstrap.css +5785 -0
  18. data/server/assets/js/bootstrap/dist/css/bootstrap.css.map +1 -0
  19. data/server/assets/js/bootstrap/dist/css/bootstrap.min.css +7 -0
  20. data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  21. data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +229 -0
  22. data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  23. data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  24. data/server/assets/js/bootstrap/dist/js/bootstrap.js +1951 -0
  25. data/server/assets/js/bootstrap/dist/js/bootstrap.min.js +6 -0
  26. data/server/assets/js/jquery.codemirror/.gitattributes +8 -0
  27. data/server/assets/js/jquery.codemirror/.gitignore +6 -0
  28. data/server/assets/js/jquery.codemirror/.travis.yml +3 -0
  29. data/server/assets/js/jquery.codemirror/AUTHORS +255 -0
  30. data/server/assets/js/jquery.codemirror/CONTRIBUTING.md +72 -0
  31. data/server/assets/js/jquery.codemirror/LICENSE +19 -0
  32. data/server/assets/js/jquery.codemirror/README.md +11 -0
  33. data/server/assets/js/jquery.codemirror/addon/comment/comment.js +145 -0
  34. data/server/assets/js/jquery.codemirror/addon/comment/continuecomment.js +54 -0
  35. data/server/assets/js/jquery.codemirror/addon/dialog/dialog.css +32 -0
  36. data/server/assets/js/jquery.codemirror/addon/dialog/dialog.js +121 -0
  37. data/server/assets/js/jquery.codemirror/addon/display/fullscreen.css +6 -0
  38. data/server/assets/js/jquery.codemirror/addon/display/fullscreen.js +31 -0
  39. data/server/assets/js/jquery.codemirror/addon/display/placeholder.js +48 -0
  40. data/server/assets/js/jquery.codemirror/addon/edit/closebrackets.js +82 -0
  41. data/server/assets/js/jquery.codemirror/addon/edit/closetag.js +89 -0
  42. data/server/assets/js/jquery.codemirror/addon/edit/continuelist.js +25 -0
  43. data/server/assets/js/jquery.codemirror/addon/edit/matchbrackets.js +87 -0
  44. data/server/assets/js/jquery.codemirror/addon/edit/matchtags.js +56 -0
  45. data/server/assets/js/jquery.codemirror/addon/edit/trailingspace.js +15 -0
  46. data/server/assets/js/jquery.codemirror/addon/fold/brace-fold.js +93 -0
  47. data/server/assets/js/jquery.codemirror/addon/fold/comment-fold.js +40 -0
  48. data/server/assets/js/jquery.codemirror/addon/fold/foldcode.js +75 -0
  49. data/server/assets/js/jquery.codemirror/addon/fold/foldgutter.css +21 -0
  50. data/server/assets/js/jquery.codemirror/addon/fold/foldgutter.js +124 -0
  51. data/server/assets/js/jquery.codemirror/addon/fold/indent-fold.js +30 -0
  52. data/server/assets/js/jquery.codemirror/addon/fold/xml-fold.js +167 -0
  53. data/server/assets/js/jquery.codemirror/addon/hint/anyword-hint.js +34 -0
  54. data/server/assets/js/jquery.codemirror/addon/hint/css-hint.js +50 -0
  55. data/server/assets/js/jquery.codemirror/addon/hint/html-hint.js +337 -0
  56. data/server/assets/js/jquery.codemirror/addon/hint/javascript-hint.js +131 -0
  57. data/server/assets/js/jquery.codemirror/addon/hint/pig-hint.js +121 -0
  58. data/server/assets/js/jquery.codemirror/addon/hint/python-hint.js +95 -0
  59. data/server/assets/js/jquery.codemirror/addon/hint/show-hint.css +38 -0
  60. data/server/assets/js/jquery.codemirror/addon/hint/show-hint.js +286 -0
  61. data/server/assets/js/jquery.codemirror/addon/hint/sql-hint.js +105 -0
  62. data/server/assets/js/jquery.codemirror/addon/hint/xml-hint.js +69 -0
  63. data/server/assets/js/jquery.codemirror/addon/lint/coffeescript-lint.js +27 -0
  64. data/server/assets/js/jquery.codemirror/addon/lint/css-lint.js +19 -0
  65. data/server/assets/js/jquery.codemirror/addon/lint/javascript-lint.js +126 -0
  66. data/server/assets/js/jquery.codemirror/addon/lint/json-lint.js +17 -0
  67. data/server/assets/js/jquery.codemirror/addon/lint/lint.css +73 -0
  68. data/server/assets/js/jquery.codemirror/addon/lint/lint.js +203 -0
  69. data/server/assets/js/jquery.codemirror/addon/merge/dep/diff_match_patch.js +50 -0
  70. data/server/assets/js/jquery.codemirror/addon/merge/merge.css +92 -0
  71. data/server/assets/js/jquery.codemirror/addon/merge/merge.js +474 -0
  72. data/server/assets/js/jquery.codemirror/addon/mode/loadmode.js +51 -0
  73. data/server/assets/js/jquery.codemirror/addon/mode/multiplex.js +101 -0
  74. data/server/assets/js/jquery.codemirror/addon/mode/multiplex_test.js +30 -0
  75. data/server/assets/js/jquery.codemirror/addon/mode/overlay.js +59 -0
  76. data/server/assets/js/jquery.codemirror/addon/runmode/colorize.js +29 -0
  77. data/server/assets/js/jquery.codemirror/addon/runmode/runmode-standalone.js +136 -0
  78. data/server/assets/js/jquery.codemirror/addon/runmode/runmode.js +56 -0
  79. data/server/assets/js/jquery.codemirror/addon/runmode/runmode.node.js +103 -0
  80. data/server/assets/js/jquery.codemirror/addon/scroll/scrollpastend.js +34 -0
  81. data/server/assets/js/jquery.codemirror/addon/search/match-highlighter.js +91 -0
  82. data/server/assets/js/jquery.codemirror/addon/search/search.js +133 -0
  83. data/server/assets/js/jquery.codemirror/addon/search/searchcursor.js +143 -0
  84. data/server/assets/js/jquery.codemirror/addon/selection/active-line.js +39 -0
  85. data/server/assets/js/jquery.codemirror/addon/selection/mark-selection.js +108 -0
  86. data/server/assets/js/jquery.codemirror/addon/tern/tern.css +85 -0
  87. data/server/assets/js/jquery.codemirror/addon/tern/tern.js +632 -0
  88. data/server/assets/js/jquery.codemirror/addon/tern/worker.js +41 -0
  89. data/server/assets/js/jquery.codemirror/addon/wrap/hardwrap.js +99 -0
  90. data/server/assets/js/jquery.codemirror/bin/authors.sh +6 -0
  91. data/server/assets/js/jquery.codemirror/bin/compress +92 -0
  92. data/server/assets/js/jquery.codemirror/bin/lint +16 -0
  93. data/server/assets/js/jquery.codemirror/bin/source-highlight +61 -0
  94. data/server/assets/js/jquery.codemirror/bower.json +15 -0
  95. data/server/assets/js/jquery.codemirror/demo/activeline.html +78 -0
  96. data/server/assets/js/jquery.codemirror/demo/anywordhint.html +79 -0
  97. data/server/assets/js/jquery.codemirror/demo/bidi.html +74 -0
  98. data/server/assets/js/jquery.codemirror/demo/btree.html +86 -0
  99. data/server/assets/js/jquery.codemirror/demo/buffers.html +109 -0
  100. data/server/assets/js/jquery.codemirror/demo/changemode.html +59 -0
  101. data/server/assets/js/jquery.codemirror/demo/closebrackets.html +63 -0
  102. data/server/assets/js/jquery.codemirror/demo/closetag.html +40 -0
  103. data/server/assets/js/jquery.codemirror/demo/complete.html +80 -0
  104. data/server/assets/js/jquery.codemirror/demo/emacs.html +75 -0
  105. data/server/assets/js/jquery.codemirror/demo/folding.html +75 -0
  106. data/server/assets/js/jquery.codemirror/demo/fullscreen.html +130 -0
  107. data/server/assets/js/jquery.codemirror/demo/hardwrap.html +69 -0
  108. data/server/assets/js/jquery.codemirror/demo/html5complete.html +54 -0
  109. data/server/assets/js/jquery.codemirror/demo/indentwrap.html +58 -0
  110. data/server/assets/js/jquery.codemirror/demo/lint.html +171 -0
  111. data/server/assets/js/jquery.codemirror/demo/loadmode.html +49 -0
  112. data/server/assets/js/jquery.codemirror/demo/marker.html +52 -0
  113. data/server/assets/js/jquery.codemirror/demo/markselection.html +45 -0
  114. data/server/assets/js/jquery.codemirror/demo/matchhighlighter.html +47 -0
  115. data/server/assets/js/jquery.codemirror/demo/matchtags.html +49 -0
  116. data/server/assets/js/jquery.codemirror/demo/merge.html +82 -0
  117. data/server/assets/js/jquery.codemirror/demo/multiplex.html +75 -0
  118. data/server/assets/js/jquery.codemirror/demo/mustache.html +68 -0
  119. data/server/assets/js/jquery.codemirror/demo/placeholder.html +45 -0
  120. data/server/assets/js/jquery.codemirror/demo/preview.html +88 -0
  121. data/server/assets/js/jquery.codemirror/demo/resize.html +58 -0
  122. data/server/assets/js/jquery.codemirror/demo/runmode.html +62 -0
  123. data/server/assets/js/jquery.codemirror/demo/search.html +94 -0
  124. data/server/assets/js/jquery.codemirror/demo/spanaffectswrapping_shim.html +85 -0
  125. data/server/assets/js/jquery.codemirror/demo/tern.html +129 -0
  126. data/server/assets/js/jquery.codemirror/demo/theme.html +121 -0
  127. data/server/assets/js/jquery.codemirror/demo/trailingspace.html +48 -0
  128. data/server/assets/js/jquery.codemirror/demo/variableheight.html +67 -0
  129. data/server/assets/js/jquery.codemirror/demo/vim.html +74 -0
  130. data/server/assets/js/jquery.codemirror/demo/visibletabs.html +62 -0
  131. data/server/assets/js/jquery.codemirror/demo/widget.html +85 -0
  132. data/server/assets/js/jquery.codemirror/demo/xmlcomplete.html +116 -0
  133. data/server/assets/js/jquery.codemirror/index.html +192 -0
  134. data/server/assets/js/jquery.codemirror/keymap/emacs.js +387 -0
  135. data/server/assets/js/jquery.codemirror/keymap/extra.js +43 -0
  136. data/server/assets/js/jquery.codemirror/keymap/vim.js +3703 -0
  137. data/server/assets/js/jquery.codemirror/lib/codemirror.css +263 -0
  138. data/server/assets/js/jquery.codemirror/lib/codemirror.js +5944 -0
  139. data/server/assets/js/jquery.codemirror/mode/apl/apl.js +160 -0
  140. data/server/assets/js/jquery.codemirror/mode/apl/index.html +72 -0
  141. data/server/assets/js/jquery.codemirror/mode/asterisk/asterisk.js +183 -0
  142. data/server/assets/js/jquery.codemirror/mode/asterisk/index.html +154 -0
  143. data/server/assets/js/jquery.codemirror/mode/clike/clike.js +362 -0
  144. data/server/assets/js/jquery.codemirror/mode/clike/index.html +195 -0
  145. data/server/assets/js/jquery.codemirror/mode/clike/scala.html +767 -0
  146. data/server/assets/js/jquery.codemirror/mode/clojure/clojure.js +224 -0
  147. data/server/assets/js/jquery.codemirror/mode/clojure/index.html +88 -0
  148. data/server/assets/js/jquery.codemirror/mode/cobol/cobol.js +240 -0
  149. data/server/assets/js/jquery.codemirror/mode/cobol/index.html +210 -0
  150. data/server/assets/js/jquery.codemirror/mode/coffeescript/coffeescript.js +354 -0
  151. data/server/assets/js/jquery.codemirror/mode/coffeescript/index.html +740 -0
  152. data/server/assets/js/jquery.codemirror/mode/commonlisp/commonlisp.js +105 -0
  153. data/server/assets/js/jquery.codemirror/mode/commonlisp/index.html +177 -0
  154. data/server/assets/js/jquery.codemirror/mode/css/css.js +639 -0
  155. data/server/assets/js/jquery.codemirror/mode/css/index.html +70 -0
  156. data/server/assets/js/jquery.codemirror/mode/css/scss.html +157 -0
  157. data/server/assets/js/jquery.codemirror/mode/css/scss_test.js +93 -0
  158. data/server/assets/js/jquery.codemirror/mode/css/test.js +142 -0
  159. data/server/assets/js/jquery.codemirror/mode/d/d.js +205 -0
  160. data/server/assets/js/jquery.codemirror/mode/d/index.html +273 -0
  161. data/server/assets/js/jquery.codemirror/mode/diff/diff.js +32 -0
  162. data/server/assets/js/jquery.codemirror/mode/diff/index.html +117 -0
  163. data/server/assets/js/jquery.codemirror/mode/dtd/dtd.js +127 -0
  164. data/server/assets/js/jquery.codemirror/mode/dtd/index.html +89 -0
  165. data/server/assets/js/jquery.codemirror/mode/ecl/ecl.js +192 -0
  166. data/server/assets/js/jquery.codemirror/mode/ecl/index.html +52 -0
  167. data/server/assets/js/jquery.codemirror/mode/eiffel/eiffel.js +147 -0
  168. data/server/assets/js/jquery.codemirror/mode/eiffel/index.html +430 -0
  169. data/server/assets/js/jquery.codemirror/mode/erlang/erlang.js +484 -0
  170. data/server/assets/js/jquery.codemirror/mode/erlang/index.html +75 -0
  171. data/server/assets/js/jquery.codemirror/mode/fortran/fortran.js +173 -0
  172. data/server/assets/js/jquery.codemirror/mode/fortran/index.html +81 -0
  173. data/server/assets/js/jquery.codemirror/mode/gas/gas.js +330 -0
  174. data/server/assets/js/jquery.codemirror/mode/gas/index.html +68 -0
  175. data/server/assets/js/jquery.codemirror/mode/gfm/gfm.js +97 -0
  176. data/server/assets/js/jquery.codemirror/mode/gfm/index.html +82 -0
  177. data/server/assets/js/jquery.codemirror/mode/gfm/test.js +112 -0
  178. data/server/assets/js/jquery.codemirror/mode/gherkin/gherkin.js +168 -0
  179. data/server/assets/js/jquery.codemirror/mode/gherkin/index.html +48 -0
  180. data/server/assets/js/jquery.codemirror/mode/go/go.js +168 -0
  181. data/server/assets/js/jquery.codemirror/mode/go/index.html +85 -0
  182. data/server/assets/js/jquery.codemirror/mode/groovy/groovy.js +211 -0
  183. data/server/assets/js/jquery.codemirror/mode/groovy/index.html +84 -0
  184. data/server/assets/js/jquery.codemirror/mode/haml/haml.js +153 -0
  185. data/server/assets/js/jquery.codemirror/mode/haml/index.html +79 -0
  186. data/server/assets/js/jquery.codemirror/mode/haml/test.js +94 -0
  187. data/server/assets/js/jquery.codemirror/mode/haskell/haskell.js +250 -0
  188. data/server/assets/js/jquery.codemirror/mode/haskell/index.html +73 -0
  189. data/server/assets/js/jquery.codemirror/mode/haxe/haxe.js +429 -0
  190. data/server/assets/js/jquery.codemirror/mode/haxe/index.html +103 -0
  191. data/server/assets/js/jquery.codemirror/mode/htmlembedded/htmlembedded.js +73 -0
  192. data/server/assets/js/jquery.codemirror/mode/htmlembedded/index.html +60 -0
  193. data/server/assets/js/jquery.codemirror/mode/htmlmixed/htmlmixed.js +104 -0
  194. data/server/assets/js/jquery.codemirror/mode/htmlmixed/index.html +85 -0
  195. data/server/assets/js/jquery.codemirror/mode/http/http.js +98 -0
  196. data/server/assets/js/jquery.codemirror/mode/http/index.html +45 -0
  197. data/server/assets/js/jquery.codemirror/mode/index.html +114 -0
  198. data/server/assets/js/jquery.codemirror/mode/jade/index.html +66 -0
  199. data/server/assets/js/jquery.codemirror/mode/jade/jade.js +90 -0
  200. data/server/assets/js/jquery.codemirror/mode/javascript/index.html +107 -0
  201. data/server/assets/js/jquery.codemirror/mode/javascript/javascript.js +617 -0
  202. data/server/assets/js/jquery.codemirror/mode/javascript/test.js +72 -0
  203. data/server/assets/js/jquery.codemirror/mode/javascript/typescript.html +61 -0
  204. data/server/assets/js/jquery.codemirror/mode/jinja2/index.html +50 -0
  205. data/server/assets/js/jquery.codemirror/mode/jinja2/jinja2.js +42 -0
  206. data/server/assets/js/jquery.codemirror/mode/julia/index.html +187 -0
  207. data/server/assets/js/jquery.codemirror/mode/julia/julia.js +262 -0
  208. data/server/assets/js/jquery.codemirror/mode/less/index.html +753 -0
  209. data/server/assets/js/jquery.codemirror/mode/less/less.js +346 -0
  210. data/server/assets/js/jquery.codemirror/mode/livescript/index.html +459 -0
  211. data/server/assets/js/jquery.codemirror/mode/livescript/livescript.js +267 -0
  212. data/server/assets/js/jquery.codemirror/mode/livescript/livescript.ls +266 -0
  213. data/server/assets/js/jquery.codemirror/mode/lua/index.html +86 -0
  214. data/server/assets/js/jquery.codemirror/mode/lua/lua.js +144 -0
  215. data/server/assets/js/jquery.codemirror/mode/markdown/index.html +359 -0
  216. data/server/assets/js/jquery.codemirror/mode/markdown/markdown.js +560 -0
  217. data/server/assets/js/jquery.codemirror/mode/markdown/test.js +664 -0
  218. data/server/assets/js/jquery.codemirror/mode/meta.js +91 -0
  219. data/server/assets/js/jquery.codemirror/mode/mirc/index.html +161 -0
  220. data/server/assets/js/jquery.codemirror/mode/mirc/mirc.js +177 -0
  221. data/server/assets/js/jquery.codemirror/mode/nginx/index.html +181 -0
  222. data/server/assets/js/jquery.codemirror/mode/nginx/nginx.js +163 -0
  223. data/server/assets/js/jquery.codemirror/mode/ntriples/index.html +45 -0
  224. data/server/assets/js/jquery.codemirror/mode/ntriples/ntriples.js +170 -0
  225. data/server/assets/js/jquery.codemirror/mode/ocaml/index.html +146 -0
  226. data/server/assets/js/jquery.codemirror/mode/ocaml/ocaml.js +116 -0
  227. data/server/assets/js/jquery.codemirror/mode/octave/index.html +95 -0
  228. data/server/assets/js/jquery.codemirror/mode/octave/octave.js +118 -0
  229. data/server/assets/js/jquery.codemirror/mode/pascal/index.html +61 -0
  230. data/server/assets/js/jquery.codemirror/mode/pascal/pascal.js +94 -0
  231. data/server/assets/js/jquery.codemirror/mode/pegjs/index.html +66 -0
  232. data/server/assets/js/jquery.codemirror/mode/pegjs/pegjs.js +103 -0
  233. data/server/assets/js/jquery.codemirror/mode/perl/index.html +75 -0
  234. data/server/assets/js/jquery.codemirror/mode/perl/perl.js +816 -0
  235. data/server/assets/js/jquery.codemirror/mode/php/index.html +62 -0
  236. data/server/assets/js/jquery.codemirror/mode/php/php.js +132 -0
  237. data/server/assets/js/jquery.codemirror/mode/pig/index.html +55 -0
  238. data/server/assets/js/jquery.codemirror/mode/pig/pig.js +171 -0
  239. data/server/assets/js/jquery.codemirror/mode/properties/index.html +53 -0
  240. data/server/assets/js/jquery.codemirror/mode/properties/properties.js +63 -0
  241. data/server/assets/js/jquery.codemirror/mode/python/index.html +187 -0
  242. data/server/assets/js/jquery.codemirror/mode/python/python.js +368 -0
  243. data/server/assets/js/jquery.codemirror/mode/q/index.html +144 -0
  244. data/server/assets/js/jquery.codemirror/mode/q/q.js +124 -0
  245. data/server/assets/js/jquery.codemirror/mode/r/index.html +86 -0
  246. data/server/assets/js/jquery.codemirror/mode/r/r.js +141 -0
  247. data/server/assets/js/jquery.codemirror/mode/rpm/changes/changes.js +19 -0
  248. data/server/assets/js/jquery.codemirror/mode/rpm/changes/index.html +67 -0
  249. data/server/assets/js/jquery.codemirror/mode/rpm/spec/index.html +114 -0
  250. data/server/assets/js/jquery.codemirror/mode/rpm/spec/spec.css +5 -0
  251. data/server/assets/js/jquery.codemirror/mode/rpm/spec/spec.js +66 -0
  252. data/server/assets/js/jquery.codemirror/mode/rst/index.html +534 -0
  253. data/server/assets/js/jquery.codemirror/mode/rst/rst.js +560 -0
  254. data/server/assets/js/jquery.codemirror/mode/ruby/index.html +185 -0
  255. data/server/assets/js/jquery.codemirror/mode/ruby/ruby.js +247 -0
  256. data/server/assets/js/jquery.codemirror/mode/rust/index.html +61 -0
  257. data/server/assets/js/jquery.codemirror/mode/rust/rust.js +436 -0
  258. data/server/assets/js/jquery.codemirror/mode/sass/index.html +66 -0
  259. data/server/assets/js/jquery.codemirror/mode/sass/sass.js +330 -0
  260. data/server/assets/js/jquery.codemirror/mode/scheme/index.html +77 -0
  261. data/server/assets/js/jquery.codemirror/mode/scheme/scheme.js +232 -0
  262. data/server/assets/js/jquery.codemirror/mode/shell/index.html +66 -0
  263. data/server/assets/js/jquery.codemirror/mode/shell/shell.js +118 -0
  264. data/server/assets/js/jquery.codemirror/mode/sieve/index.html +93 -0
  265. data/server/assets/js/jquery.codemirror/mode/sieve/sieve.js +183 -0
  266. data/server/assets/js/jquery.codemirror/mode/smalltalk/index.html +68 -0
  267. data/server/assets/js/jquery.codemirror/mode/smalltalk/smalltalk.js +151 -0
  268. data/server/assets/js/jquery.codemirror/mode/smarty/index.html +136 -0
  269. data/server/assets/js/jquery.codemirror/mode/smarty/smarty.js +205 -0
  270. data/server/assets/js/jquery.codemirror/mode/smartymixed/index.html +114 -0
  271. data/server/assets/js/jquery.codemirror/mode/smartymixed/smartymixed.js +175 -0
  272. data/server/assets/js/jquery.codemirror/mode/sparql/index.html +54 -0
  273. data/server/assets/js/jquery.codemirror/mode/sparql/sparql.js +145 -0
  274. data/server/assets/js/jquery.codemirror/mode/sql/index.html +75 -0
  275. data/server/assets/js/jquery.codemirror/mode/sql/sql.js +365 -0
  276. data/server/assets/js/jquery.codemirror/mode/stex/index.html +110 -0
  277. data/server/assets/js/jquery.codemirror/mode/stex/stex.js +246 -0
  278. data/server/assets/js/jquery.codemirror/mode/stex/test.js +120 -0
  279. data/server/assets/js/jquery.codemirror/mode/tcl/index.html +143 -0
  280. data/server/assets/js/jquery.codemirror/mode/tcl/tcl.js +131 -0
  281. data/server/assets/js/jquery.codemirror/mode/tiddlywiki/index.html +155 -0
  282. data/server/assets/js/jquery.codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  283. data/server/assets/js/jquery.codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
  284. data/server/assets/js/jquery.codemirror/mode/tiki/index.html +95 -0
  285. data/server/assets/js/jquery.codemirror/mode/tiki/tiki.css +26 -0
  286. data/server/assets/js/jquery.codemirror/mode/tiki/tiki.js +308 -0
  287. data/server/assets/js/jquery.codemirror/mode/toml/index.html +73 -0
  288. data/server/assets/js/jquery.codemirror/mode/toml/toml.js +71 -0
  289. data/server/assets/js/jquery.codemirror/mode/turtle/index.html +51 -0
  290. data/server/assets/js/jquery.codemirror/mode/turtle/turtle.js +145 -0
  291. data/server/assets/js/jquery.codemirror/mode/vb/index.html +103 -0
  292. data/server/assets/js/jquery.codemirror/mode/vb/vb.js +259 -0
  293. data/server/assets/js/jquery.codemirror/mode/vbscript/index.html +55 -0
  294. data/server/assets/js/jquery.codemirror/mode/vbscript/vbscript.js +334 -0
  295. data/server/assets/js/jquery.codemirror/mode/velocity/index.html +119 -0
  296. data/server/assets/js/jquery.codemirror/mode/velocity/velocity.js +186 -0
  297. data/server/assets/js/jquery.codemirror/mode/verilog/index.html +132 -0
  298. data/server/assets/js/jquery.codemirror/mode/verilog/verilog.js +182 -0
  299. data/server/assets/js/jquery.codemirror/mode/xml/index.html +57 -0
  300. data/server/assets/js/jquery.codemirror/mode/xml/xml.js +345 -0
  301. data/server/assets/js/jquery.codemirror/mode/xquery/index.html +210 -0
  302. data/server/assets/js/jquery.codemirror/mode/xquery/test.js +64 -0
  303. data/server/assets/js/jquery.codemirror/mode/xquery/xquery.js +432 -0
  304. data/server/assets/js/jquery.codemirror/mode/yaml/index.html +80 -0
  305. data/server/assets/js/jquery.codemirror/mode/yaml/yaml.js +97 -0
  306. data/server/assets/js/jquery.codemirror/mode/z80/index.html +52 -0
  307. data/server/assets/js/jquery.codemirror/mode/z80/z80.js +85 -0
  308. data/server/assets/js/jquery.codemirror/package.json +19 -0
  309. data/server/assets/js/jquery.codemirror/test/comment_test.js +51 -0
  310. data/server/assets/js/jquery.codemirror/test/doc_test.js +329 -0
  311. data/server/assets/js/jquery.codemirror/test/driver.js +139 -0
  312. data/server/assets/js/jquery.codemirror/test/emacs_test.js +135 -0
  313. data/server/assets/js/jquery.codemirror/test/index.html +209 -0
  314. data/server/assets/js/jquery.codemirror/test/lint/acorn.js +1593 -0
  315. data/server/assets/js/jquery.codemirror/test/lint/lint.js +139 -0
  316. data/server/assets/js/jquery.codemirror/test/lint/walk.js +216 -0
  317. data/server/assets/js/jquery.codemirror/test/mode_test.css +10 -0
  318. data/server/assets/js/jquery.codemirror/test/mode_test.js +200 -0
  319. data/server/assets/js/jquery.codemirror/test/phantom_driver.js +31 -0
  320. data/server/assets/js/jquery.codemirror/test/run.js +34 -0
  321. data/server/assets/js/jquery.codemirror/test/test.js +1562 -0
  322. data/server/assets/js/jquery.codemirror/test/vim_test.js +2391 -0
  323. data/server/assets/js/jquery.codemirror/theme/3024-day.css +34 -0
  324. data/server/assets/js/jquery.codemirror/theme/3024-night.css +34 -0
  325. data/server/assets/js/jquery.codemirror/theme/ambiance-mobile.css +5 -0
  326. data/server/assets/js/jquery.codemirror/theme/ambiance.css +70 -0
  327. data/server/assets/js/jquery.codemirror/theme/base16-dark.css +34 -0
  328. data/server/assets/js/jquery.codemirror/theme/base16-light.css +34 -0
  329. data/server/assets/js/jquery.codemirror/theme/blackboard.css +28 -0
  330. data/server/assets/js/jquery.codemirror/theme/cobalt.css +21 -0
  331. data/server/assets/js/jquery.codemirror/theme/eclipse.css +23 -0
  332. data/server/assets/js/jquery.codemirror/theme/elegant.css +13 -0
  333. data/server/assets/js/jquery.codemirror/theme/erlang-dark.css +30 -0
  334. data/server/assets/js/jquery.codemirror/theme/lesser-dark.css +47 -0
  335. data/server/assets/js/jquery.codemirror/theme/mbo.css +37 -0
  336. data/server/assets/js/jquery.codemirror/theme/midnight.css +43 -0
  337. data/server/assets/js/jquery.codemirror/theme/monokai.css +29 -0
  338. data/server/assets/js/jquery.codemirror/theme/neat.css +12 -0
  339. data/server/assets/js/jquery.codemirror/theme/night.css +24 -0
  340. data/server/assets/js/jquery.codemirror/theme/paraiso-dark.css +34 -0
  341. data/server/assets/js/jquery.codemirror/theme/paraiso-light.css +34 -0
  342. data/server/assets/js/jquery.codemirror/theme/rubyblue.css +23 -0
  343. data/server/assets/js/jquery.codemirror/theme/solarized.css +180 -0
  344. data/server/assets/js/jquery.codemirror/theme/the-matrix.css +26 -0
  345. data/server/assets/js/jquery.codemirror/theme/tomorrow-night-eighties.css +34 -0
  346. data/server/assets/js/jquery.codemirror/theme/twilight.css +28 -0
  347. data/server/assets/js/jquery.codemirror/theme/vibrant-ink.css +30 -0
  348. data/server/assets/js/jquery.codemirror/theme/xq-dark.css +49 -0
  349. data/server/assets/js/jquery.codemirror/theme/xq-light.css +43 -0
  350. data/server/assets/js/jquery.js +4 -0
  351. data/server/assets/js/jquery.nanoscroller/jquery.nanoscroller.js +2 -0
  352. data/server/assets/js/jquery.nanoscroller/nanoscroller.css +49 -0
  353. data/server/assets/js/tester.js +161 -0
  354. data/server/config.ru +2 -0
  355. data/server/server.rb +41 -0
  356. data/server/views/_content.erb +65 -0
  357. data/server/views/_sidebar.erb +32 -0
  358. data/server/views/index.erb +40 -0
  359. metadata +402 -0
@@ -0,0 +1,346 @@
1
+ /*
2
+ LESS mode - http://www.lesscss.org/
3
+ Ported to CodeMirror by Peter Kroon <plakroon@gmail.com>
4
+ Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues
5
+ GitHub: @peterkroon
6
+ */
7
+
8
+ CodeMirror.defineMode("less", function(config) {
9
+ var indentUnit = config.indentUnit, type;
10
+ function ret(style, tp) {type = tp; return style;}
11
+
12
+ var selectors = /(^\:root$|^\:nth\-child$|^\:nth\-last\-child$|^\:nth\-of\-type$|^\:nth\-last\-of\-type$|^\:first\-child$|^\:last\-child$|^\:first\-of\-type$|^\:last\-of\-type$|^\:only\-child$|^\:only\-of\-type$|^\:empty$|^\:link|^\:visited$|^\:active$|^\:hover$|^\:focus$|^\:target$|^\:lang$|^\:enabled^\:disabled$|^\:checked$|^\:first\-line$|^\:first\-letter$|^\:before$|^\:after$|^\:not$|^\:required$|^\:invalid$)/;
13
+
14
+ function tokenBase(stream, state) {
15
+ var ch = stream.next();
16
+
17
+ if (ch == "@") {stream.eatWhile(/[\w\-]/); return ret("meta", stream.current());}
18
+ else if (ch == "/" && stream.eat("*")) {
19
+ state.tokenize = tokenCComment;
20
+ return tokenCComment(stream, state);
21
+ } else if (ch == "<" && stream.eat("!")) {
22
+ state.tokenize = tokenSGMLComment;
23
+ return tokenSGMLComment(stream, state);
24
+ } else if (ch == "=") ret(null, "compare");
25
+ else if (ch == "|" && stream.eat("=")) return ret(null, "compare");
26
+ else if (ch == "\"" || ch == "'") {
27
+ state.tokenize = tokenString(ch);
28
+ return state.tokenize(stream, state);
29
+ } else if (ch == "/") { // e.g.: .png will not be parsed as a class
30
+ if(stream.eat("/")){
31
+ state.tokenize = tokenSComment;
32
+ return tokenSComment(stream, state);
33
+ } else {
34
+ if(type == "string" || type == "(") return ret("string", "string");
35
+ if(state.stack[state.stack.length-1] !== undefined) return ret(null, ch);
36
+ stream.eatWhile(/[\a-zA-Z0-9\-_.\s]/);
37
+ if( /\/|\)|#/.test(stream.peek() || (stream.eatSpace() && stream.peek() === ")")) || stream.eol() )return ret("string", "string"); // let url(/images/logo.png) without quotes return as string
38
+ }
39
+ } else if (ch == "!") {
40
+ stream.match(/^\s*\w*/);
41
+ return ret("keyword", "important");
42
+ } else if (/\d/.test(ch)) {
43
+ stream.eatWhile(/[\w.%]/);
44
+ return ret("number", "unit");
45
+ } else if (/[,+<>*\/]/.test(ch)) {
46
+ if(stream.peek() == "=" || type == "a")return ret("string", "string");
47
+ if(ch === ",")return ret(null, ch);
48
+ return ret(null, "select-op");
49
+ } else if (/[;{}:\[\]()~\|]/.test(ch)) {
50
+ if(ch == ":"){
51
+ stream.eatWhile(/[a-z\\\-]/);
52
+ if( selectors.test(stream.current()) ){
53
+ return ret("tag", "tag");
54
+ } else if(stream.peek() == ":"){//::-webkit-search-decoration
55
+ stream.next();
56
+ stream.eatWhile(/[a-z\\\-]/);
57
+ if(stream.current().match(/\:\:\-(o|ms|moz|webkit)\-/))return ret("string", "string");
58
+ if( selectors.test(stream.current().substring(1)) )return ret("tag", "tag");
59
+ return ret(null, ch);
60
+ } else {
61
+ return ret(null, ch);
62
+ }
63
+ } else if(ch == "~"){
64
+ if(type == "r")return ret("string", "string");
65
+ } else {
66
+ return ret(null, ch);
67
+ }
68
+ } else if (ch == ".") {
69
+ if(type == "(")return ret("string", "string"); // allow url(../image.png)
70
+ stream.eatWhile(/[\a-zA-Z0-9\-_]/);
71
+ if(stream.peek() === " ")stream.eatSpace();
72
+ if(stream.peek() === ")" || type === ":")return ret("number", "unit");//rgba(0,0,0,.25);
73
+ else if(stream.current().length >1){
74
+ if(state.stack[state.stack.length-1] === "rule" && stream.peek().match(/{|,|\+|\(/) === null)return ret("number", "unit");
75
+ }
76
+ return ret("tag", "tag");
77
+ } else if (ch == "#") {
78
+ //we don't eat white-space, we want the hex color and or id only
79
+ stream.eatWhile(/[A-Za-z0-9]/);
80
+ //check if there is a proper hex color length e.g. #eee || #eeeEEE
81
+ if(stream.current().length == 4 || stream.current().length == 7){
82
+ if(stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false) != null){//is there a valid hex color value present in the current stream
83
+ //when not a valid hex value, parse as id
84
+ if(stream.current().substring(1) != stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false))return ret("atom", "tag");
85
+ //eat white-space
86
+ stream.eatSpace();
87
+ //when hex value declaration doesn't end with [;,] but is does with a slash/cc comment treat it as an id, just like the other hex values that don't end with[;,]
88
+ if( /[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(stream.peek()) ){
89
+ if(type === "select-op")return ret("number", "unit"); else return ret("atom", "tag");
90
+ }
91
+ //#time { color: #aaa }
92
+ else if(stream.peek() == "}" )return ret("number", "unit");
93
+ //we have a valid hex color value, parse as id whenever an element/class is defined after the hex(id) value e.g. #eee aaa || #eee .aaa
94
+ else if( /[a-zA-Z\\]/.test(stream.peek()) )return ret("atom", "tag");
95
+ //when a hex value is on the end of a line, parse as id
96
+ else if(stream.eol())return ret("atom", "tag");
97
+ //default
98
+ else return ret("number", "unit");
99
+ } else {//when not a valid hexvalue in the current stream e.g. #footer
100
+ stream.eatWhile(/[\w\\\-]/);
101
+ return ret("atom", stream.current());
102
+ }
103
+ } else {//when not a valid hexvalue length
104
+ stream.eatWhile(/[\w\\\-]/);
105
+ if(state.stack[state.stack.length-1] === "rule")return ret("atom", stream.current());return ret("atom", stream.current());
106
+ return ret("atom", "tag");
107
+ }
108
+ } else if (ch == "&") {
109
+ stream.eatWhile(/[\w\-]/);
110
+ return ret(null, ch);
111
+ } else {
112
+ stream.eatWhile(/[\w\\\-_%.{]/);
113
+ if(stream.current().match(/\\/) !== null){
114
+ if(stream.current().charAt(stream.current().length-1) === "\\"){
115
+ stream.eat(/\'|\"|\)|\(/);
116
+ while(stream.eatWhile(/[\w\\\-_%.{]/)){
117
+ stream.eat(/\'|\"|\)|\(/);
118
+ }
119
+ return ret("string", stream.current());
120
+ }
121
+ } //else if(type === "tag")return ret("tag", "tag");
122
+ else if(type == "string"){
123
+ if(state.stack[state.stack.length-1] === "{" && stream.peek() === ":")return ret("variable", "variable");
124
+ if(stream.peek() === "/")stream.eatWhile(/[\w\\\-_%.{:\/]/);
125
+ return ret(type, stream.current());
126
+ } else if(stream.current().match(/(^http$|^https$)/) != null){
127
+ stream.eatWhile(/[\w\\\-_%.{:\/]/);
128
+ if(stream.peek() === "/")stream.eatWhile(/[\w\\\-_%.{:\/]/);
129
+ return ret("string", "string");
130
+ } else if(stream.peek() == "<" || stream.peek() == ">" || stream.peek() == "+"){
131
+ if(type === "(" && (stream.current() === "n" || stream.current() === "-n"))return ret("string", stream.current());
132
+ return ret("tag", "tag");
133
+ } else if( /\(/.test(stream.peek()) ){
134
+ if(stream.current() === "when")return ret("variable","variable");
135
+ else if(state.stack[state.stack.length-1] === "@media" && stream.current() === "and")return ret("variable",stream.current());
136
+ return ret(null, ch);
137
+ } else if (stream.peek() == "/" && state.stack[state.stack.length-1] !== undefined){ // url(dir/center/image.png)
138
+ if(stream.peek() === "/")stream.eatWhile(/[\w\\\-_%.{:\/]/);
139
+ return ret("string", stream.current());
140
+ } else if( stream.current().match(/\-\d|\-.\d/) ){ // match e.g.: -5px -0.4 etc... only colorize the minus sign
141
+ //commment out these 2 comment if you want the minus sign to be parsed as null -500px
142
+ //stream.backUp(stream.current().length-1);
143
+ //return ret(null, ch);
144
+ return ret("number", "unit");
145
+ } else if( /\/|[\s\)]/.test(stream.peek() || stream.eol() || (stream.eatSpace() && stream.peek() == "/")) && stream.current().indexOf(".") !== -1){
146
+ if(stream.current().substring(stream.current().length-1,stream.current().length) == "{"){
147
+ stream.backUp(1);
148
+ return ret("tag", "tag");
149
+ }//end if
150
+ stream.eatSpace();
151
+ if( /[{<>.a-zA-Z\/]/.test(stream.peek()) || stream.eol() )return ret("tag", "tag"); // e.g. button.icon-plus
152
+ return ret("string", "string"); // let url(/images/logo.png) without quotes return as string
153
+ } else if( stream.eol() || stream.peek() == "[" || stream.peek() == "#" || type == "tag" ){
154
+
155
+ if(stream.current().substring(stream.current().length-1,stream.current().length) == "{")stream.backUp(1);
156
+ else if(state.stack[state.stack.length-1] === "border-color" || state.stack[state.stack.length-1] === "background-position" || state.stack[state.stack.length-1] === "font-family")return ret(null, stream.current());
157
+ else if(type === "tag")return ret("tag", "tag");
158
+ else if((type === ":" || type === "unit") && state.stack[state.stack.length-1] === "rule")return ret(null, stream.current());
159
+ else if(state.stack[state.stack.length-1] === "rule" && type === "tag")return ret("string", stream.current());
160
+ else if(state.stack[state.stack.length-1] === ";" && type === ":")return ret(null, stream.current());
161
+ //else if(state.stack[state.stack.length-1] === ";" || type === "")return ret("variable", stream.current());
162
+ else if(stream.peek() === "#" && type !== undefined && type.match(/\+|,|tag|select\-op|}|{|;/g) === null)return ret("string", stream.current());
163
+ else if(type === "variable")return ret(null, stream.current());
164
+ else if(state.stack[state.stack.length-1] === "{" && type === "comment")return ret("variable", stream.current());
165
+ else if(state.stack.length === 0 && (type === ";" || type === "comment"))return ret("tag", stream.current());
166
+ else if((state.stack[state.stack.length-1] === "{" || type === ";") && state.stack[state.stack.length-1] !== "@media{")return ret("variable", stream.current());
167
+ else if(state.stack[state.stack.length-2] === "{" && state.stack[state.stack.length-1] === ";")return ret("variable", stream.current());
168
+
169
+ return ret("tag", "tag");
170
+ } else if(type == "compare" || type == "a" || type == "("){
171
+ return ret("string", "string");
172
+ } else if(type == "|" || stream.current() == "-" || type == "["){
173
+ if(type == "|" && stream.peek().match(/\]|=|\~/) !== null)return ret("number", stream.current());
174
+ else if(type == "|" )return ret("tag", "tag");
175
+ else if(type == "["){
176
+ stream.eatWhile(/\w\-/);
177
+ return ret("number", stream.current());
178
+ }
179
+ return ret(null, ch);
180
+ } else if((stream.peek() == ":") || ( stream.eatSpace() && stream.peek() == ":")) {
181
+ stream.next();
182
+ var t_v = stream.peek() == ":" ? true : false;
183
+ if(!t_v){
184
+ var old_pos = stream.pos;
185
+ var sc = stream.current().length;
186
+ stream.eatWhile(/[a-z\\\-]/);
187
+ var new_pos = stream.pos;
188
+ if(stream.current().substring(sc-1).match(selectors) != null){
189
+ stream.backUp(new_pos-(old_pos-1));
190
+ return ret("tag", "tag");
191
+ } else stream.backUp(new_pos-(old_pos-1));
192
+ } else {
193
+ stream.backUp(1);
194
+ }
195
+ if(t_v)return ret("tag", "tag"); else return ret("variable", "variable");
196
+ } else if(state.stack[state.stack.length-1] === "font-family" || state.stack[state.stack.length-1] === "background-position" || state.stack[state.stack.length-1] === "border-color"){
197
+ return ret(null, null);
198
+ } else {
199
+
200
+ if(state.stack[state.stack.length-1] === null && type === ":")return ret(null, stream.current());
201
+
202
+ //else if((type === ")" && state.stack[state.stack.length-1] === "rule") || (state.stack[state.stack.length-2] === "{" && state.stack[state.stack.length-1] === "rule" && type === "variable"))return ret(null, stream.current());
203
+
204
+ else if(/\^|\$/.test(stream.current()) && stream.peek().match(/\~|=/) !== null)return ret("string", "string");//att^=val
205
+
206
+ else if(type === "unit" && state.stack[state.stack.length-1] === "rule")return ret(null, "unit");
207
+ else if(type === "unit" && state.stack[state.stack.length-1] === ";")return ret(null, "unit");
208
+ else if(type === ")" && state.stack[state.stack.length-1] === "rule")return ret(null, "unit");
209
+ else if(type && type.match("@") !== null && state.stack[state.stack.length-1] === "rule")return ret(null, "unit");
210
+ //else if(type === "unit" && state.stack[state.stack.length-1] === "rule")return ret(null, stream.current());
211
+
212
+ else if((type === ";" || type === "}" || type === ",") && state.stack[state.stack.length-1] === ";")return ret("tag", stream.current());
213
+ else if((type === ";" && stream.peek() !== undefined && stream.peek().match(/{|./) === null) || (type === ";" && stream.eatSpace() && stream.peek().match(/{|./) === null))return ret("variable", stream.current());
214
+ else if((type === "@media" && state.stack[state.stack.length-1] === "@media") || type === "@namespace")return ret("tag", stream.current());
215
+
216
+ else if(type === "{" && state.stack[state.stack.length-1] === ";" && stream.peek() === "{")return ret("tag", "tag");
217
+ else if((type === "{" || type === ":") && state.stack[state.stack.length-1] === ";")return ret(null, stream.current());
218
+ else if((state.stack[state.stack.length-1] === "{" && stream.eatSpace() && stream.peek().match(/.|#/) === null) || type === "select-op" || (state.stack[state.stack.length-1] === "rule" && type === ",") )return ret("tag", "tag");
219
+ else if(type === "variable" && state.stack[state.stack.length-1] === "rule")return ret("tag", "tag");
220
+ else if((stream.eatSpace() && stream.peek() === "{") || stream.eol() || stream.peek() === "{")return ret("tag", "tag");
221
+ //this one messes up indentation
222
+ //else if((type === "}" && stream.peek() !== ":") || (type === "}" && stream.eatSpace() && stream.peek() !== ":"))return(type, "tag");
223
+
224
+ else if(type === ")" && (stream.current() == "and" || stream.current() == "and "))return ret("variable", "variable");
225
+ else if(type === ")" && (stream.current() == "when" || stream.current() == "when "))return ret("variable", "variable");
226
+ else if(type === ")" || type === "comment" || type === "{")return ret("tag", "tag");
227
+ else if(stream.sol())return ret("tag", "tag");
228
+ else if((stream.eatSpace() && stream.peek() === "#") || stream.peek() === "#")return ret("tag", "tag");
229
+ else if(state.stack.length === 0)return ret("tag", "tag");
230
+ else if(type === ";" && stream.peek() !== undefined && stream.peek().match(/^[.|\#]/g) !== null)return ret("tag", "tag");
231
+
232
+ else if(type === ":"){stream.eatSpace();return ret(null, stream.current());}
233
+
234
+ else if(stream.current() === "and " || stream.current() === "and")return ret("variable", stream.current());
235
+ else if(type === ";" && state.stack[state.stack.length-1] === "{")return ret("variable", stream.current());
236
+
237
+ else if(state.stack[state.stack.length-1] === "rule")return ret(null, stream.current());
238
+
239
+ return ret("tag", stream.current());
240
+ }
241
+ }
242
+ }
243
+
244
+ function tokenSComment(stream, state) { // SComment = Slash comment
245
+ stream.skipToEnd();
246
+ state.tokenize = tokenBase;
247
+ return ret("comment", "comment");
248
+ }
249
+
250
+ function tokenCComment(stream, state) {
251
+ var maybeEnd = false, ch;
252
+ while ((ch = stream.next()) != null) {
253
+ if (maybeEnd && ch == "/") {
254
+ state.tokenize = tokenBase;
255
+ break;
256
+ }
257
+ maybeEnd = (ch == "*");
258
+ }
259
+ return ret("comment", "comment");
260
+ }
261
+
262
+ function tokenSGMLComment(stream, state) {
263
+ var dashes = 0, ch;
264
+ while ((ch = stream.next()) != null) {
265
+ if (dashes >= 2 && ch == ">") {
266
+ state.tokenize = tokenBase;
267
+ break;
268
+ }
269
+ dashes = (ch == "-") ? dashes + 1 : 0;
270
+ }
271
+ return ret("comment", "comment");
272
+ }
273
+
274
+ function tokenString(quote) {
275
+ return function(stream, state) {
276
+ var escaped = false, ch;
277
+ while ((ch = stream.next()) != null) {
278
+ if (ch == quote && !escaped)
279
+ break;
280
+ escaped = !escaped && ch == "\\";
281
+ }
282
+ if (!escaped) state.tokenize = tokenBase;
283
+ return ret("string", "string");
284
+ };
285
+ }
286
+
287
+ return {
288
+ startState: function(base) {
289
+ return {tokenize: tokenBase,
290
+ baseIndent: base || 0,
291
+ stack: []};
292
+ },
293
+
294
+ token: function(stream, state) {
295
+ if (stream.eatSpace()) return null;
296
+ var style = state.tokenize(stream, state);
297
+
298
+ var context = state.stack[state.stack.length-1];
299
+ if (type == "hash" && context == "rule") style = "atom";
300
+ else if (style == "variable") {
301
+ if (context == "rule") style = null; //"tag"
302
+ else if (!context || context == "@media{") {
303
+ style = stream.current() == "when" ? "variable" :
304
+ /[\s,|\s\)|\s]/.test(stream.peek()) ? "tag" : type;
305
+ }
306
+ }
307
+
308
+ if (context == "rule" && /^[\{\};]$/.test(type))
309
+ state.stack.pop();
310
+ if (type == "{") {
311
+ if (context == "@media") state.stack[state.stack.length-1] = "@media{";
312
+ else state.stack.push("{");
313
+ }
314
+ else if (type == "}") state.stack.pop();
315
+ else if (type == "@media") state.stack.push("@media");
316
+ else if (stream.current() === "font-family") state.stack[state.stack.length-1] = "font-family";
317
+ else if (stream.current() === "background-position") state.stack[state.stack.length-1] = "background-position";
318
+ else if (stream.current() === "border-color") state.stack[state.stack.length-1] = "border-color";
319
+ else if (context == "{" && type != "comment" && type !== "tag") state.stack.push("rule");
320
+ else if (stream.peek() === ":" && stream.current().match(/@|#/) === null) style = type;
321
+ if(type === ";" && (state.stack[state.stack.length-1] == "font-family" || state.stack[state.stack.length-1] == "background-position" || state.stack[state.stack.length-1] == "border-color"))state.stack[state.stack.length-1] = stream.current();
322
+ else if(type === "tag" && stream.peek() === ")" && stream.current().match(/\:/) === null){type = null; style = null;}
323
+ // ????
324
+ else if((type === "variable" && stream.peek() === ")") || (type === "variable" && stream.eatSpace() && stream.peek() === ")"))return ret(null,stream.current());
325
+ return style;
326
+ },
327
+
328
+ indent: function(state, textAfter) {
329
+ var n = state.stack.length;
330
+ if (/^\}/.test(textAfter))
331
+ n -= state.stack[state.stack.length-1] === "rule" ? 2 : 1;
332
+ else if (state.stack[state.stack.length-2] === "{")
333
+ n -= state.stack[state.stack.length-1] === "rule" ? 1 : 0;
334
+ return state.baseIndent + n * indentUnit;
335
+ },
336
+
337
+ electricChars: "}",
338
+ blockCommentStart: "/*",
339
+ blockCommentEnd: "*/",
340
+ lineComment: "//"
341
+ };
342
+ });
343
+
344
+ CodeMirror.defineMIME("text/x-less", "less");
345
+ if (!CodeMirror.mimeModes.hasOwnProperty("text/css"))
346
+ CodeMirror.defineMIME("text/css", "less");
@@ -0,0 +1,459 @@
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: LiveScript mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/solarized.css">
9
+ <script src="../../lib/codemirror.js"></script>
10
+ <script src="livescript.js"></script>
11
+ <style>.CodeMirror {font-size: 80%;border-top: 1px solid silver; border-bottom: 1px solid silver;}</style>
12
+ <div id=nav>
13
+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
14
+
15
+ <ul>
16
+ <li><a href="../../index.html">Home</a>
17
+ <li><a href="../../doc/manual.html">Manual</a>
18
+ <li><a href="https://github.com/marijnh/codemirror">Code</a>
19
+ </ul>
20
+ <ul>
21
+ <li><a href="../index.html">Language modes</a>
22
+ <li><a class=active href="#">LiveScript</a>
23
+ </ul>
24
+ </div>
25
+
26
+ <article>
27
+ <h2>LiveScript mode</h2>
28
+ <form><textarea id="code" name="code">
29
+ # LiveScript mode for CodeMirror
30
+ # The following script, prelude.ls, is used to
31
+ # demonstrate LiveScript mode for CodeMirror.
32
+ # https://github.com/gkz/prelude-ls
33
+
34
+ export objToFunc = objToFunc = (obj) ->
35
+ (key) -> obj[key]
36
+
37
+ export each = (f, xs) -->
38
+ if typeof! xs is \Object
39
+ for , x of xs then f x
40
+ else
41
+ for x in xs then f x
42
+ xs
43
+
44
+ export map = (f, xs) -->
45
+ f = objToFunc f if typeof! f isnt \Function
46
+ type = typeof! xs
47
+ if type is \Object
48
+ {[key, f x] for key, x of xs}
49
+ else
50
+ result = [f x for x in xs]
51
+ if type is \String then result * '' else result
52
+
53
+ export filter = (f, xs) -->
54
+ f = objToFunc f if typeof! f isnt \Function
55
+ type = typeof! xs
56
+ if type is \Object
57
+ {[key, x] for key, x of xs when f x}
58
+ else
59
+ result = [x for x in xs when f x]
60
+ if type is \String then result * '' else result
61
+
62
+ export reject = (f, xs) -->
63
+ f = objToFunc f if typeof! f isnt \Function
64
+ type = typeof! xs
65
+ if type is \Object
66
+ {[key, x] for key, x of xs when not f x}
67
+ else
68
+ result = [x for x in xs when not f x]
69
+ if type is \String then result * '' else result
70
+
71
+ export partition = (f, xs) -->
72
+ f = objToFunc f if typeof! f isnt \Function
73
+ type = typeof! xs
74
+ if type is \Object
75
+ passed = {}
76
+ failed = {}
77
+ for key, x of xs
78
+ (if f x then passed else failed)[key] = x
79
+ else
80
+ passed = []
81
+ failed = []
82
+ for x in xs
83
+ (if f x then passed else failed)push x
84
+ if type is \String
85
+ passed *= ''
86
+ failed *= ''
87
+ [passed, failed]
88
+
89
+ export find = (f, xs) -->
90
+ f = objToFunc f if typeof! f isnt \Function
91
+ if typeof! xs is \Object
92
+ for , x of xs when f x then return x
93
+ else
94
+ for x in xs when f x then return x
95
+ void
96
+
97
+ export head = export first = (xs) ->
98
+ return void if not xs.length
99
+ xs.0
100
+
101
+ export tail = (xs) ->
102
+ return void if not xs.length
103
+ xs.slice 1
104
+
105
+ export last = (xs) ->
106
+ return void if not xs.length
107
+ xs[*-1]
108
+
109
+ export initial = (xs) ->
110
+ return void if not xs.length
111
+ xs.slice 0 xs.length - 1
112
+
113
+ export empty = (xs) ->
114
+ if typeof! xs is \Object
115
+ for x of xs then return false
116
+ return yes
117
+ not xs.length
118
+
119
+ export values = (obj) ->
120
+ [x for , x of obj]
121
+
122
+ export keys = (obj) ->
123
+ [x for x of obj]
124
+
125
+ export len = (xs) ->
126
+ xs = values xs if typeof! xs is \Object
127
+ xs.length
128
+
129
+ export cons = (x, xs) -->
130
+ if typeof! xs is \String then x + xs else [x] ++ xs
131
+
132
+ export append = (xs, ys) -->
133
+ if typeof! ys is \String then xs + ys else xs ++ ys
134
+
135
+ export join = (sep, xs) -->
136
+ xs = values xs if typeof! xs is \Object
137
+ xs.join sep
138
+
139
+ export reverse = (xs) ->
140
+ if typeof! xs is \String
141
+ then (xs / '')reverse! * ''
142
+ else xs.slice!reverse!
143
+
144
+ export fold = export foldl = (f, memo, xs) -->
145
+ if typeof! xs is \Object
146
+ for , x of xs then memo = f memo, x
147
+ else
148
+ for x in xs then memo = f memo, x
149
+ memo
150
+
151
+ export fold1 = export foldl1 = (f, xs) --> fold f, xs.0, xs.slice 1
152
+
153
+ export foldr = (f, memo, xs) --> fold f, memo, xs.slice!reverse!
154
+
155
+ export foldr1 = (f, xs) -->
156
+ xs.=slice!reverse!
157
+ fold f, xs.0, xs.slice 1
158
+
159
+ export unfoldr = export unfold = (f, b) -->
160
+ if (f b)?
161
+ [that.0] ++ unfoldr f, that.1
162
+ else
163
+ []
164
+
165
+ export andList = (xs) ->
166
+ for x in xs when not x
167
+ return false
168
+ true
169
+
170
+ export orList = (xs) ->
171
+ for x in xs when x
172
+ return true
173
+ false
174
+
175
+ export any = (f, xs) -->
176
+ f = objToFunc f if typeof! f isnt \Function
177
+ for x in xs when f x
178
+ return yes
179
+ no
180
+
181
+ export all = (f, xs) -->
182
+ f = objToFunc f if typeof! f isnt \Function
183
+ for x in xs when not f x
184
+ return no
185
+ yes
186
+
187
+ export unique = (xs) ->
188
+ result = []
189
+ if typeof! xs is \Object
190
+ for , x of xs when x not in result then result.push x
191
+ else
192
+ for x in xs when x not in result then result.push x
193
+ if typeof! xs is \String then result * '' else result
194
+
195
+ export sort = (xs) ->
196
+ xs.concat!sort (x, y) ->
197
+ | x > y => 1
198
+ | x < y => -1
199
+ | _ => 0
200
+
201
+ export sortBy = (f, xs) -->
202
+ return [] unless xs.length
203
+ xs.concat!sort f
204
+
205
+ export compare = (f, x, y) -->
206
+ | (f x) > (f y) => 1
207
+ | (f x) < (f y) => -1
208
+ | otherwise => 0
209
+
210
+ export sum = (xs) ->
211
+ result = 0
212
+ if typeof! xs is \Object
213
+ for , x of xs then result += x
214
+ else
215
+ for x in xs then result += x
216
+ result
217
+
218
+ export product = (xs) ->
219
+ result = 1
220
+ if typeof! xs is \Object
221
+ for , x of xs then result *= x
222
+ else
223
+ for x in xs then result *= x
224
+ result
225
+
226
+ export mean = export average = (xs) -> (sum xs) / len xs
227
+
228
+ export concat = (xss) -> fold append, [], xss
229
+
230
+ export concatMap = (f, xs) --> fold ((memo, x) -> append memo, f x), [], xs
231
+
232
+ export listToObj = (xs) ->
233
+ {[x.0, x.1] for x in xs}
234
+
235
+ export maximum = (xs) -> fold1 (>?), xs
236
+
237
+ export minimum = (xs) -> fold1 (<?), xs
238
+
239
+ export scan = export scanl = (f, memo, xs) -->
240
+ last = memo
241
+ if typeof! xs is \Object
242
+ then [memo] ++ [last = f last, x for , x of xs]
243
+ else [memo] ++ [last = f last, x for x in xs]
244
+
245
+ export scan1 = export scanl1 = (f, xs) --> scan f, xs.0, xs.slice 1
246
+
247
+ export scanr = (f, memo, xs) -->
248
+ xs.=slice!reverse!
249
+ scan f, memo, xs .reverse!
250
+
251
+ export scanr1 = (f, xs) -->
252
+ xs.=slice!reverse!
253
+ scan f, xs.0, xs.slice 1 .reverse!
254
+
255
+ export replicate = (n, x) -->
256
+ result = []
257
+ i = 0
258
+ while i < n, ++i then result.push x
259
+ result
260
+
261
+ export take = (n, xs) -->
262
+ | n <= 0
263
+ if typeof! xs is \String then '' else []
264
+ | not xs.length => xs
265
+ | otherwise => xs.slice 0, n
266
+
267
+ export drop = (n, xs) -->
268
+ | n <= 0 => xs
269
+ | not xs.length => xs
270
+ | otherwise => xs.slice n
271
+
272
+ export splitAt = (n, xs) --> [(take n, xs), (drop n, xs)]
273
+
274
+ export takeWhile = (p, xs) -->
275
+ return xs if not xs.length
276
+ p = objToFunc p if typeof! p isnt \Function
277
+ result = []
278
+ for x in xs
279
+ break if not p x
280
+ result.push x
281
+ if typeof! xs is \String then result * '' else result
282
+
283
+ export dropWhile = (p, xs) -->
284
+ return xs if not xs.length
285
+ p = objToFunc p if typeof! p isnt \Function
286
+ i = 0
287
+ for x in xs
288
+ break if not p x
289
+ ++i
290
+ drop i, xs
291
+
292
+ export span = (p, xs) --> [(takeWhile p, xs), (dropWhile p, xs)]
293
+
294
+ export breakIt = (p, xs) --> span (not) << p, xs
295
+
296
+ export zip = (xs, ys) -->
297
+ result = []
298
+ for zs, i in [xs, ys]
299
+ for z, j in zs
300
+ result.push [] if i is 0
301
+ result[j]?push z
302
+ result
303
+
304
+ export zipWith = (f,xs, ys) -->
305
+ f = objToFunc f if typeof! f isnt \Function
306
+ if not xs.length or not ys.length
307
+ []
308
+ else
309
+ [f.apply this, zs for zs in zip.call this, xs, ys]
310
+
311
+ export zipAll = (...xss) ->
312
+ result = []
313
+ for xs, i in xss
314
+ for x, j in xs
315
+ result.push [] if i is 0
316
+ result[j]?push x
317
+ result
318
+
319
+ export zipAllWith = (f, ...xss) ->
320
+ f = objToFunc f if typeof! f isnt \Function
321
+ if not xss.0.length or not xss.1.length
322
+ []
323
+ else
324
+ [f.apply this, xs for xs in zipAll.apply this, xss]
325
+
326
+ export compose = (...funcs) ->
327
+ ->
328
+ args = arguments
329
+ for f in funcs
330
+ args = [f.apply this, args]
331
+ args.0
332
+
333
+ export curry = (f) ->
334
+ curry$ f # using util method curry$ from livescript
335
+
336
+ export id = (x) -> x
337
+
338
+ export flip = (f, x, y) --> f y, x
339
+
340
+ export fix = (f) ->
341
+ ( (g, x) -> -> f(g g) ...arguments ) do
342
+ (g, x) -> -> f(g g) ...arguments
343
+
344
+ export lines = (str) ->
345
+ return [] if not str.length
346
+ str / \\n
347
+
348
+ export unlines = (strs) -> strs * \\n
349
+
350
+ export words = (str) ->
351
+ return [] if not str.length
352
+ str / /[ ]+/
353
+
354
+ export unwords = (strs) -> strs * ' '
355
+
356
+ export max = (>?)
357
+
358
+ export min = (<?)
359
+
360
+ export negate = (x) -> -x
361
+
362
+ export abs = Math.abs
363
+
364
+ export signum = (x) ->
365
+ | x < 0 => -1
366
+ | x > 0 => 1
367
+ | otherwise => 0
368
+
369
+ export quot = (x, y) --> ~~(x / y)
370
+
371
+ export rem = (%)
372
+
373
+ export div = (x, y) --> Math.floor x / y
374
+
375
+ export mod = (%%)
376
+
377
+ export recip = (1 /)
378
+
379
+ export pi = Math.PI
380
+
381
+ export tau = pi * 2
382
+
383
+ export exp = Math.exp
384
+
385
+ export sqrt = Math.sqrt
386
+
387
+ # changed from log as log is a
388
+ # common function for logging things
389
+ export ln = Math.log
390
+
391
+ export pow = (^)
392
+
393
+ export sin = Math.sin
394
+
395
+ export tan = Math.tan
396
+
397
+ export cos = Math.cos
398
+
399
+ export asin = Math.asin
400
+
401
+ export acos = Math.acos
402
+
403
+ export atan = Math.atan
404
+
405
+ export atan2 = (x, y) --> Math.atan2 x, y
406
+
407
+ # sinh
408
+ # tanh
409
+ # cosh
410
+ # asinh
411
+ # atanh
412
+ # acosh
413
+
414
+ export truncate = (x) -> ~~x
415
+
416
+ export round = Math.round
417
+
418
+ export ceiling = Math.ceil
419
+
420
+ export floor = Math.floor
421
+
422
+ export isItNaN = (x) -> x isnt x
423
+
424
+ export even = (x) -> x % 2 == 0
425
+
426
+ export odd = (x) -> x % 2 != 0
427
+
428
+ export gcd = (x, y) -->
429
+ x = Math.abs x
430
+ y = Math.abs y
431
+ until y is 0
432
+ z = x % y
433
+ x = y
434
+ y = z
435
+ x
436
+
437
+ export lcm = (x, y) -->
438
+ Math.abs Math.floor (x / (gcd x, y) * y)
439
+
440
+ # meta
441
+ export installPrelude = !(target) ->
442
+ unless target.prelude?isInstalled
443
+ target <<< out$ # using out$ generated by livescript
444
+ target <<< target.prelude.isInstalled = true
445
+
446
+ export prelude = out$
447
+ </textarea></form>
448
+ <script>
449
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
450
+ theme: "solarized light",
451
+ lineNumbers: true
452
+ });
453
+ </script>
454
+
455
+ <p><strong>MIME types defined:</strong> <code>text/x-livescript</code>.</p>
456
+
457
+ <p>The LiveScript mode was written by Kenneth Bentley (<a href="LICENSE">license</a>).</p>
458
+
459
+ </article>