fluentd-ui 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd-ui might be problematic. Click here for more details.

Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +4 -0
  3. data/Gemfile.lock +1 -1
  4. data/app/assets/javascripts/application.js +2 -0
  5. data/app/assets/javascripts/codemirror.js +29 -0
  6. data/app/assets/javascripts/codemirror_fluentd.js +59 -0
  7. data/app/assets/stylesheets/application.css +6 -0
  8. data/app/views/fluentd/settings/edit.html.haml +1 -1
  9. data/app/views/shared/vue/_setting.html.erb +1 -1
  10. data/bower.json +2 -1
  11. data/lib/fluentd-ui/version.rb +1 -1
  12. data/spec/features/source_and_output_spec.rb +16 -6
  13. data/vendor/assets/javascripts/bower/codemirror/.bower.json +29 -0
  14. data/vendor/assets/javascripts/bower/codemirror/AUTHORS +423 -0
  15. data/vendor/assets/javascripts/bower/codemirror/CONTRIBUTING.md +76 -0
  16. data/vendor/assets/javascripts/bower/codemirror/LICENSE +19 -0
  17. data/vendor/assets/javascripts/bower/codemirror/README.md +11 -0
  18. data/vendor/assets/javascripts/bower/codemirror/addon/comment/comment.js +183 -0
  19. data/vendor/assets/javascripts/bower/codemirror/addon/comment/continuecomment.js +85 -0
  20. data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.css +32 -0
  21. data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.js +155 -0
  22. data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.css +6 -0
  23. data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.js +41 -0
  24. data/vendor/assets/javascripts/bower/codemirror/addon/display/panel.js +94 -0
  25. data/vendor/assets/javascripts/bower/codemirror/addon/display/placeholder.js +58 -0
  26. data/vendor/assets/javascripts/bower/codemirror/addon/display/rulers.js +64 -0
  27. data/vendor/assets/javascripts/bower/codemirror/addon/edit/closebrackets.js +159 -0
  28. data/vendor/assets/javascripts/bower/codemirror/addon/edit/closetag.js +159 -0
  29. data/vendor/assets/javascripts/bower/codemirror/addon/edit/continuelist.js +51 -0
  30. data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchbrackets.js +120 -0
  31. data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchtags.js +66 -0
  32. data/vendor/assets/javascripts/bower/codemirror/addon/edit/trailingspace.js +27 -0
  33. data/vendor/assets/javascripts/bower/codemirror/addon/fold/brace-fold.js +105 -0
  34. data/vendor/assets/javascripts/bower/codemirror/addon/fold/comment-fold.js +57 -0
  35. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldcode.js +145 -0
  36. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.css +20 -0
  37. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.js +134 -0
  38. data/vendor/assets/javascripts/bower/codemirror/addon/fold/indent-fold.js +44 -0
  39. data/vendor/assets/javascripts/bower/codemirror/addon/fold/markdown-fold.js +49 -0
  40. data/vendor/assets/javascripts/bower/codemirror/addon/fold/xml-fold.js +182 -0
  41. data/vendor/assets/javascripts/bower/codemirror/addon/hint/anyword-hint.js +41 -0
  42. data/vendor/assets/javascripts/bower/codemirror/addon/hint/css-hint.js +56 -0
  43. data/vendor/assets/javascripts/bower/codemirror/addon/hint/html-hint.js +348 -0
  44. data/vendor/assets/javascripts/bower/codemirror/addon/hint/javascript-hint.js +146 -0
  45. data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.css +38 -0
  46. data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.js +389 -0
  47. data/vendor/assets/javascripts/bower/codemirror/addon/hint/sql-hint.js +197 -0
  48. data/vendor/assets/javascripts/bower/codemirror/addon/hint/xml-hint.js +110 -0
  49. data/vendor/assets/javascripts/bower/codemirror/addon/lint/coffeescript-lint.js +41 -0
  50. data/vendor/assets/javascripts/bower/codemirror/addon/lint/css-lint.js +35 -0
  51. data/vendor/assets/javascripts/bower/codemirror/addon/lint/javascript-lint.js +136 -0
  52. data/vendor/assets/javascripts/bower/codemirror/addon/lint/json-lint.js +31 -0
  53. data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.css +73 -0
  54. data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.js +204 -0
  55. data/vendor/assets/javascripts/bower/codemirror/addon/lint/yaml-lint.js +28 -0
  56. data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.css +112 -0
  57. data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.js +643 -0
  58. data/vendor/assets/javascripts/bower/codemirror/addon/mode/loadmode.js +64 -0
  59. data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex.js +118 -0
  60. data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex_test.js +33 -0
  61. data/vendor/assets/javascripts/bower/codemirror/addon/mode/overlay.js +85 -0
  62. data/vendor/assets/javascripts/bower/codemirror/addon/mode/simple.js +213 -0
  63. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/colorize.js +40 -0
  64. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode-standalone.js +157 -0
  65. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.js +72 -0
  66. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.node.js +120 -0
  67. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/annotatescrollbar.js +76 -0
  68. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/scrollpastend.js +46 -0
  69. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.css +66 -0
  70. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.js +139 -0
  71. data/vendor/assets/javascripts/bower/codemirror/addon/search/match-highlighter.js +128 -0
  72. data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.css +8 -0
  73. data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.js +90 -0
  74. data/vendor/assets/javascripts/bower/codemirror/addon/search/search.js +164 -0
  75. data/vendor/assets/javascripts/bower/codemirror/addon/search/searchcursor.js +189 -0
  76. data/vendor/assets/javascripts/bower/codemirror/addon/selection/active-line.js +71 -0
  77. data/vendor/assets/javascripts/bower/codemirror/addon/selection/mark-selection.js +118 -0
  78. data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.css +86 -0
  79. data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.js +670 -0
  80. data/vendor/assets/javascripts/bower/codemirror/addon/tern/worker.js +44 -0
  81. data/vendor/assets/javascripts/bower/codemirror/addon/wrap/hardwrap.js +139 -0
  82. data/vendor/assets/javascripts/bower/codemirror/bower.json +16 -0
  83. data/vendor/assets/javascripts/bower/codemirror/keymap/emacs.js +411 -0
  84. data/vendor/assets/javascripts/bower/codemirror/keymap/sublime.js +540 -0
  85. data/vendor/assets/javascripts/bower/codemirror/keymap/vim.js +4901 -0
  86. data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.css +309 -0
  87. data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.js +8029 -0
  88. data/vendor/assets/javascripts/bower/codemirror/mode/apl/apl.js +175 -0
  89. data/vendor/assets/javascripts/bower/codemirror/mode/asterisk/asterisk.js +198 -0
  90. data/vendor/assets/javascripts/bower/codemirror/mode/clike/clike.js +489 -0
  91. data/vendor/assets/javascripts/bower/codemirror/mode/clike/scala.html +767 -0
  92. data/vendor/assets/javascripts/bower/codemirror/mode/clojure/clojure.js +243 -0
  93. data/vendor/assets/javascripts/bower/codemirror/mode/cobol/cobol.js +255 -0
  94. data/vendor/assets/javascripts/bower/codemirror/mode/coffeescript/coffeescript.js +369 -0
  95. data/vendor/assets/javascripts/bower/codemirror/mode/commonlisp/commonlisp.js +122 -0
  96. data/vendor/assets/javascripts/bower/codemirror/mode/css/css.js +717 -0
  97. data/vendor/assets/javascripts/bower/codemirror/mode/css/less.html +152 -0
  98. data/vendor/assets/javascripts/bower/codemirror/mode/css/less_test.js +51 -0
  99. data/vendor/assets/javascripts/bower/codemirror/mode/css/scss.html +157 -0
  100. data/vendor/assets/javascripts/bower/codemirror/mode/css/scss_test.js +110 -0
  101. data/vendor/assets/javascripts/bower/codemirror/mode/css/test.js +135 -0
  102. data/vendor/assets/javascripts/bower/codemirror/mode/cypher/cypher.js +146 -0
  103. data/vendor/assets/javascripts/bower/codemirror/mode/d/d.js +218 -0
  104. data/vendor/assets/javascripts/bower/codemirror/mode/dart/dart.js +50 -0
  105. data/vendor/assets/javascripts/bower/codemirror/mode/diff/diff.js +47 -0
  106. data/vendor/assets/javascripts/bower/codemirror/mode/django/django.js +67 -0
  107. data/vendor/assets/javascripts/bower/codemirror/mode/dockerfile/dockerfile.js +76 -0
  108. data/vendor/assets/javascripts/bower/codemirror/mode/dtd/dtd.js +142 -0
  109. data/vendor/assets/javascripts/bower/codemirror/mode/dylan/dylan.js +299 -0
  110. data/vendor/assets/javascripts/bower/codemirror/mode/ebnf/ebnf.js +195 -0
  111. data/vendor/assets/javascripts/bower/codemirror/mode/ecl/ecl.js +207 -0
  112. data/vendor/assets/javascripts/bower/codemirror/mode/eiffel/eiffel.js +162 -0
  113. data/vendor/assets/javascripts/bower/codemirror/mode/erlang/erlang.js +622 -0
  114. data/vendor/assets/javascripts/bower/codemirror/mode/fortran/fortran.js +188 -0
  115. data/vendor/assets/javascripts/bower/codemirror/mode/gas/gas.js +345 -0
  116. data/vendor/assets/javascripts/bower/codemirror/mode/gfm/gfm.js +123 -0
  117. data/vendor/assets/javascripts/bower/codemirror/mode/gfm/test.js +213 -0
  118. data/vendor/assets/javascripts/bower/codemirror/mode/gherkin/gherkin.js +178 -0
  119. data/vendor/assets/javascripts/bower/codemirror/mode/go/go.js +184 -0
  120. data/vendor/assets/javascripts/bower/codemirror/mode/groovy/groovy.js +226 -0
  121. data/vendor/assets/javascripts/bower/codemirror/mode/haml/haml.js +159 -0
  122. data/vendor/assets/javascripts/bower/codemirror/mode/haml/test.js +97 -0
  123. data/vendor/assets/javascripts/bower/codemirror/mode/haskell/haskell.js +267 -0
  124. data/vendor/assets/javascripts/bower/codemirror/mode/haxe/haxe.js +518 -0
  125. data/vendor/assets/javascripts/bower/codemirror/mode/htmlembedded/htmlembedded.js +86 -0
  126. data/vendor/assets/javascripts/bower/codemirror/mode/htmlmixed/htmlmixed.js +121 -0
  127. data/vendor/assets/javascripts/bower/codemirror/mode/http/http.js +113 -0
  128. data/vendor/assets/javascripts/bower/codemirror/mode/idl/idl.js +290 -0
  129. data/vendor/assets/javascripts/bower/codemirror/mode/jade/jade.js +590 -0
  130. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/javascript.js +686 -0
  131. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/json-ld.html +72 -0
  132. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/test.js +200 -0
  133. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/typescript.html +61 -0
  134. data/vendor/assets/javascripts/bower/codemirror/mode/jinja2/jinja2.js +142 -0
  135. data/vendor/assets/javascripts/bower/codemirror/mode/julia/julia.js +301 -0
  136. data/vendor/assets/javascripts/bower/codemirror/mode/kotlin/kotlin.js +280 -0
  137. data/vendor/assets/javascripts/bower/codemirror/mode/livescript/livescript.js +280 -0
  138. data/vendor/assets/javascripts/bower/codemirror/mode/lua/lua.js +159 -0
  139. data/vendor/assets/javascripts/bower/codemirror/mode/markdown/markdown.js +765 -0
  140. data/vendor/assets/javascripts/bower/codemirror/mode/markdown/test.js +754 -0
  141. data/vendor/assets/javascripts/bower/codemirror/mode/meta.js +165 -0
  142. data/vendor/assets/javascripts/bower/codemirror/mode/mirc/mirc.js +193 -0
  143. data/vendor/assets/javascripts/bower/codemirror/mode/mllike/mllike.js +205 -0
  144. data/vendor/assets/javascripts/bower/codemirror/mode/modelica/modelica.js +245 -0
  145. data/vendor/assets/javascripts/bower/codemirror/mode/nginx/nginx.js +178 -0
  146. data/vendor/assets/javascripts/bower/codemirror/mode/ntriples/ntriples.js +186 -0
  147. data/vendor/assets/javascripts/bower/codemirror/mode/octave/octave.js +135 -0
  148. data/vendor/assets/javascripts/bower/codemirror/mode/pascal/pascal.js +109 -0
  149. data/vendor/assets/javascripts/bower/codemirror/mode/pegjs/pegjs.js +114 -0
  150. data/vendor/assets/javascripts/bower/codemirror/mode/perl/perl.js +832 -0
  151. data/vendor/assets/javascripts/bower/codemirror/mode/php/php.js +226 -0
  152. data/vendor/assets/javascripts/bower/codemirror/mode/php/test.js +154 -0
  153. data/vendor/assets/javascripts/bower/codemirror/mode/pig/pig.js +188 -0
  154. data/vendor/assets/javascripts/bower/codemirror/mode/properties/properties.js +78 -0
  155. data/vendor/assets/javascripts/bower/codemirror/mode/puppet/puppet.js +220 -0
  156. data/vendor/assets/javascripts/bower/codemirror/mode/python/python.js +359 -0
  157. data/vendor/assets/javascripts/bower/codemirror/mode/q/q.js +139 -0
  158. data/vendor/assets/javascripts/bower/codemirror/mode/r/r.js +162 -0
  159. data/vendor/assets/javascripts/bower/codemirror/mode/rpm/rpm.js +101 -0
  160. data/vendor/assets/javascripts/bower/codemirror/mode/rst/rst.js +557 -0
  161. data/vendor/assets/javascripts/bower/codemirror/mode/ruby/ruby.js +285 -0
  162. data/vendor/assets/javascripts/bower/codemirror/mode/ruby/test.js +14 -0
  163. data/vendor/assets/javascripts/bower/codemirror/mode/rust/rust.js +451 -0
  164. data/vendor/assets/javascripts/bower/codemirror/mode/sass/sass.js +327 -0
  165. data/vendor/assets/javascripts/bower/codemirror/mode/scheme/scheme.js +248 -0
  166. data/vendor/assets/javascripts/bower/codemirror/mode/shell/shell.js +139 -0
  167. data/vendor/assets/javascripts/bower/codemirror/mode/shell/test.js +58 -0
  168. data/vendor/assets/javascripts/bower/codemirror/mode/sieve/sieve.js +193 -0
  169. data/vendor/assets/javascripts/bower/codemirror/mode/slim/slim.js +575 -0
  170. data/vendor/assets/javascripts/bower/codemirror/mode/slim/test.js +96 -0
  171. data/vendor/assets/javascripts/bower/codemirror/mode/smalltalk/smalltalk.js +168 -0
  172. data/vendor/assets/javascripts/bower/codemirror/mode/smarty/smarty.js +221 -0
  173. data/vendor/assets/javascripts/bower/codemirror/mode/smartymixed/smartymixed.js +197 -0
  174. data/vendor/assets/javascripts/bower/codemirror/mode/solr/solr.js +104 -0
  175. data/vendor/assets/javascripts/bower/codemirror/mode/soy/soy.js +198 -0
  176. data/vendor/assets/javascripts/bower/codemirror/mode/sparql/sparql.js +174 -0
  177. data/vendor/assets/javascripts/bower/codemirror/mode/spreadsheet/spreadsheet.js +109 -0
  178. data/vendor/assets/javascripts/bower/codemirror/mode/sql/sql.js +391 -0
  179. data/vendor/assets/javascripts/bower/codemirror/mode/stex/stex.js +251 -0
  180. data/vendor/assets/javascripts/bower/codemirror/mode/stex/test.js +123 -0
  181. data/vendor/assets/javascripts/bower/codemirror/mode/tcl/tcl.js +147 -0
  182. data/vendor/assets/javascripts/bower/codemirror/mode/textile/test.js +417 -0
  183. data/vendor/assets/javascripts/bower/codemirror/mode/textile/textile.js +469 -0
  184. data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  185. data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.js +369 -0
  186. data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.css +26 -0
  187. data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.js +323 -0
  188. data/vendor/assets/javascripts/bower/codemirror/mode/toml/toml.js +88 -0
  189. data/vendor/assets/javascripts/bower/codemirror/mode/tornado/tornado.js +68 -0
  190. data/vendor/assets/javascripts/bower/codemirror/mode/turtle/turtle.js +162 -0
  191. data/vendor/assets/javascripts/bower/codemirror/mode/vb/vb.js +274 -0
  192. data/vendor/assets/javascripts/bower/codemirror/mode/vbscript/vbscript.js +350 -0
  193. data/vendor/assets/javascripts/bower/codemirror/mode/velocity/velocity.js +201 -0
  194. data/vendor/assets/javascripts/bower/codemirror/mode/verilog/test.js +273 -0
  195. data/vendor/assets/javascripts/bower/codemirror/mode/verilog/verilog.js +364 -0
  196. data/vendor/assets/javascripts/bower/codemirror/mode/xml/test.js +51 -0
  197. data/vendor/assets/javascripts/bower/codemirror/mode/xml/xml.js +384 -0
  198. data/vendor/assets/javascripts/bower/codemirror/mode/xquery/test.js +67 -0
  199. data/vendor/assets/javascripts/bower/codemirror/mode/xquery/xquery.js +447 -0
  200. data/vendor/assets/javascripts/bower/codemirror/mode/yaml/yaml.js +117 -0
  201. data/vendor/assets/javascripts/bower/codemirror/mode/z80/z80.js +100 -0
  202. data/vendor/assets/javascripts/bower/codemirror/theme/3024-day.css +38 -0
  203. data/vendor/assets/javascripts/bower/codemirror/theme/3024-night.css +37 -0
  204. data/vendor/assets/javascripts/bower/codemirror/theme/ambiance-mobile.css +5 -0
  205. data/vendor/assets/javascripts/bower/codemirror/theme/ambiance.css +77 -0
  206. data/vendor/assets/javascripts/bower/codemirror/theme/base16-dark.css +36 -0
  207. data/vendor/assets/javascripts/bower/codemirror/theme/base16-light.css +36 -0
  208. data/vendor/assets/javascripts/bower/codemirror/theme/blackboard.css +30 -0
  209. data/vendor/assets/javascripts/bower/codemirror/theme/cobalt.css +23 -0
  210. data/vendor/assets/javascripts/bower/codemirror/theme/eclipse.css +23 -0
  211. data/vendor/assets/javascripts/bower/codemirror/theme/elegant.css +13 -0
  212. data/vendor/assets/javascripts/bower/codemirror/theme/erlang-dark.css +32 -0
  213. data/vendor/assets/javascripts/bower/codemirror/theme/lesser-dark.css +45 -0
  214. data/vendor/assets/javascripts/bower/codemirror/theme/mbo.css +35 -0
  215. data/vendor/assets/javascripts/bower/codemirror/theme/mdn-like.css +44 -0
  216. data/vendor/assets/javascripts/bower/codemirror/theme/midnight.css +45 -0
  217. data/vendor/assets/javascripts/bower/codemirror/theme/monokai.css +31 -0
  218. data/vendor/assets/javascripts/bower/codemirror/theme/neat.css +12 -0
  219. data/vendor/assets/javascripts/bower/codemirror/theme/neo.css +43 -0
  220. data/vendor/assets/javascripts/bower/codemirror/theme/night.css +26 -0
  221. data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-dark.css +36 -0
  222. data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-light.css +36 -0
  223. data/vendor/assets/javascripts/bower/codemirror/theme/pastel-on-dark.css +50 -0
  224. data/vendor/assets/javascripts/bower/codemirror/theme/rubyblue.css +23 -0
  225. data/vendor/assets/javascripts/bower/codemirror/theme/solarized.css +165 -0
  226. data/vendor/assets/javascripts/bower/codemirror/theme/the-matrix.css +28 -0
  227. data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-bright.css +35 -0
  228. data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-eighties.css +36 -0
  229. data/vendor/assets/javascripts/bower/codemirror/theme/twilight.css +30 -0
  230. data/vendor/assets/javascripts/bower/codemirror/theme/vibrant-ink.css +32 -0
  231. data/vendor/assets/javascripts/bower/codemirror/theme/xq-dark.css +51 -0
  232. data/vendor/assets/javascripts/bower/codemirror/theme/xq-light.css +43 -0
  233. data/vendor/assets/javascripts/bower/codemirror/theme/zenburn.css +37 -0
  234. metadata +225 -2
@@ -0,0 +1,96 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh
5
+
6
+ (function() {
7
+ var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "slim");
8
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
9
+
10
+ // Requires at least one media query
11
+ MT("elementName",
12
+ "[tag h1] Hey There");
13
+
14
+ MT("oneElementPerLine",
15
+ "[tag h1] Hey There .h2");
16
+
17
+ MT("idShortcut",
18
+ "[attribute&def #test] Hey There");
19
+
20
+ MT("tagWithIdShortcuts",
21
+ "[tag h1][attribute&def #test] Hey There");
22
+
23
+ MT("classShortcut",
24
+ "[attribute&qualifier .hello] Hey There");
25
+
26
+ MT("tagWithIdAndClassShortcuts",
27
+ "[tag h1][attribute&def #test][attribute&qualifier .hello] Hey There");
28
+
29
+ MT("docType",
30
+ "[keyword doctype] xml");
31
+
32
+ MT("comment",
33
+ "[comment / Hello WORLD]");
34
+
35
+ MT("notComment",
36
+ "[tag h1] This is not a / comment ");
37
+
38
+ MT("attributes",
39
+ "[tag a]([attribute title]=[string \"test\"]) [attribute href]=[string \"link\"]}");
40
+
41
+ MT("multiLineAttributes",
42
+ "[tag a]([attribute title]=[string \"test\"]",
43
+ " ) [attribute href]=[string \"link\"]}");
44
+
45
+ MT("htmlCode",
46
+ "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket </][tag h1][tag&bracket >]");
47
+
48
+ MT("rubyBlock",
49
+ "[operator&special =][variable-2 @item]");
50
+
51
+ MT("selectorRubyBlock",
52
+ "[tag a][attribute&qualifier .test][operator&special =] [variable-2 @item]");
53
+
54
+ MT("nestedRubyBlock",
55
+ "[tag a]",
56
+ " [operator&special =][variable puts] [string \"test\"]");
57
+
58
+ MT("multilinePlaintext",
59
+ "[tag p]",
60
+ " | Hello,",
61
+ " World");
62
+
63
+ MT("multilineRuby",
64
+ "[tag p]",
65
+ " [comment /# this is a comment]",
66
+ " [comment and this is a comment too]",
67
+ " | Date/Time",
68
+ " [operator&special -] [variable now] [operator =] [tag DateTime][operator .][property now]",
69
+ " [tag strong][operator&special =] [variable now]",
70
+ " [operator&special -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])",
71
+ " [operator&special =][string \"Happy\"]",
72
+ " [operator&special =][string \"Belated\"]",
73
+ " [operator&special =][string \"Birthday\"]");
74
+
75
+ MT("multilineComment",
76
+ "[comment /]",
77
+ " [comment Multiline]",
78
+ " [comment Comment]");
79
+
80
+ MT("hamlAfterRubyTag",
81
+ "[attribute&qualifier .block]",
82
+ " [tag strong][operator&special =] [variable now]",
83
+ " [attribute&qualifier .test]",
84
+ " [operator&special =][variable now]",
85
+ " [attribute&qualifier .right]");
86
+
87
+ MT("stretchedRuby",
88
+ "[operator&special =] [variable puts] [string \"Hello\"],",
89
+ " [string \"World\"]");
90
+
91
+ MT("interpolationInHashAttribute",
92
+ "[tag div]{[attribute id] = [string \"]#{[variable test]}[string _]#{[variable ting]}[string \"]} test");
93
+
94
+ MT("interpolationInHTMLAttribute",
95
+ "[tag div]([attribute title]=[string \"]#{[variable test]}[string _]#{[variable ting]()}[string \"]) Test");
96
+ })();
@@ -0,0 +1,168 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode('smalltalk', function(config) {
15
+
16
+ var specialChars = /[+\-\/\\*~<>=@%|&?!.,:;^]/;
17
+ var keywords = /true|false|nil|self|super|thisContext/;
18
+
19
+ var Context = function(tokenizer, parent) {
20
+ this.next = tokenizer;
21
+ this.parent = parent;
22
+ };
23
+
24
+ var Token = function(name, context, eos) {
25
+ this.name = name;
26
+ this.context = context;
27
+ this.eos = eos;
28
+ };
29
+
30
+ var State = function() {
31
+ this.context = new Context(next, null);
32
+ this.expectVariable = true;
33
+ this.indentation = 0;
34
+ this.userIndentationDelta = 0;
35
+ };
36
+
37
+ State.prototype.userIndent = function(indentation) {
38
+ this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0;
39
+ };
40
+
41
+ var next = function(stream, context, state) {
42
+ var token = new Token(null, context, false);
43
+ var aChar = stream.next();
44
+
45
+ if (aChar === '"') {
46
+ token = nextComment(stream, new Context(nextComment, context));
47
+
48
+ } else if (aChar === '\'') {
49
+ token = nextString(stream, new Context(nextString, context));
50
+
51
+ } else if (aChar === '#') {
52
+ if (stream.peek() === '\'') {
53
+ stream.next();
54
+ token = nextSymbol(stream, new Context(nextSymbol, context));
55
+ } else {
56
+ if (stream.eatWhile(/[^\s.{}\[\]()]/))
57
+ token.name = 'string-2';
58
+ else
59
+ token.name = 'meta';
60
+ }
61
+
62
+ } else if (aChar === '$') {
63
+ if (stream.next() === '<') {
64
+ stream.eatWhile(/[^\s>]/);
65
+ stream.next();
66
+ }
67
+ token.name = 'string-2';
68
+
69
+ } else if (aChar === '|' && state.expectVariable) {
70
+ token.context = new Context(nextTemporaries, context);
71
+
72
+ } else if (/[\[\]{}()]/.test(aChar)) {
73
+ token.name = 'bracket';
74
+ token.eos = /[\[{(]/.test(aChar);
75
+
76
+ if (aChar === '[') {
77
+ state.indentation++;
78
+ } else if (aChar === ']') {
79
+ state.indentation = Math.max(0, state.indentation - 1);
80
+ }
81
+
82
+ } else if (specialChars.test(aChar)) {
83
+ stream.eatWhile(specialChars);
84
+ token.name = 'operator';
85
+ token.eos = aChar !== ';'; // ; cascaded message expression
86
+
87
+ } else if (/\d/.test(aChar)) {
88
+ stream.eatWhile(/[\w\d]/);
89
+ token.name = 'number';
90
+
91
+ } else if (/[\w_]/.test(aChar)) {
92
+ stream.eatWhile(/[\w\d_]/);
93
+ token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null;
94
+
95
+ } else {
96
+ token.eos = state.expectVariable;
97
+ }
98
+
99
+ return token;
100
+ };
101
+
102
+ var nextComment = function(stream, context) {
103
+ stream.eatWhile(/[^"]/);
104
+ return new Token('comment', stream.eat('"') ? context.parent : context, true);
105
+ };
106
+
107
+ var nextString = function(stream, context) {
108
+ stream.eatWhile(/[^']/);
109
+ return new Token('string', stream.eat('\'') ? context.parent : context, false);
110
+ };
111
+
112
+ var nextSymbol = function(stream, context) {
113
+ stream.eatWhile(/[^']/);
114
+ return new Token('string-2', stream.eat('\'') ? context.parent : context, false);
115
+ };
116
+
117
+ var nextTemporaries = function(stream, context) {
118
+ var token = new Token(null, context, false);
119
+ var aChar = stream.next();
120
+
121
+ if (aChar === '|') {
122
+ token.context = context.parent;
123
+ token.eos = true;
124
+
125
+ } else {
126
+ stream.eatWhile(/[^|]/);
127
+ token.name = 'variable';
128
+ }
129
+
130
+ return token;
131
+ };
132
+
133
+ return {
134
+ startState: function() {
135
+ return new State;
136
+ },
137
+
138
+ token: function(stream, state) {
139
+ state.userIndent(stream.indentation());
140
+
141
+ if (stream.eatSpace()) {
142
+ return null;
143
+ }
144
+
145
+ var token = state.context.next(stream, state.context, state);
146
+ state.context = token.context;
147
+ state.expectVariable = token.eos;
148
+
149
+ return token.name;
150
+ },
151
+
152
+ blankLine: function(state) {
153
+ state.userIndent(0);
154
+ },
155
+
156
+ indent: function(state, textAfter) {
157
+ var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta;
158
+ return (state.indentation + i) * config.indentUnit;
159
+ },
160
+
161
+ electricChars: ']'
162
+ };
163
+
164
+ });
165
+
166
+ CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'});
167
+
168
+ });
@@ -0,0 +1,221 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /**
5
+ * Smarty 2 and 3 mode.
6
+ */
7
+
8
+ (function(mod) {
9
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
10
+ mod(require("../../lib/codemirror"));
11
+ else if (typeof define == "function" && define.amd) // AMD
12
+ define(["../../lib/codemirror"], mod);
13
+ else // Plain browser env
14
+ mod(CodeMirror);
15
+ })(function(CodeMirror) {
16
+ "use strict";
17
+
18
+ CodeMirror.defineMode("smarty", function(config) {
19
+ "use strict";
20
+
21
+ // our default settings; check to see if they're overridden
22
+ var settings = {
23
+ rightDelimiter: '}',
24
+ leftDelimiter: '{',
25
+ smartyVersion: 2 // for backward compatibility
26
+ };
27
+ if (config.hasOwnProperty("leftDelimiter")) {
28
+ settings.leftDelimiter = config.leftDelimiter;
29
+ }
30
+ if (config.hasOwnProperty("rightDelimiter")) {
31
+ settings.rightDelimiter = config.rightDelimiter;
32
+ }
33
+ if (config.hasOwnProperty("smartyVersion") && config.smartyVersion === 3) {
34
+ settings.smartyVersion = 3;
35
+ }
36
+
37
+ var keyFunctions = ["debug", "extends", "function", "include", "literal"];
38
+ var last;
39
+ var regs = {
40
+ operatorChars: /[+\-*&%=<>!?]/,
41
+ validIdentifier: /[a-zA-Z0-9_]/,
42
+ stringChar: /['"]/
43
+ };
44
+
45
+ var helpers = {
46
+ cont: function(style, lastType) {
47
+ last = lastType;
48
+ return style;
49
+ },
50
+ chain: function(stream, state, parser) {
51
+ state.tokenize = parser;
52
+ return parser(stream, state);
53
+ }
54
+ };
55
+
56
+
57
+ // our various parsers
58
+ var parsers = {
59
+
60
+ // the main tokenizer
61
+ tokenizer: function(stream, state) {
62
+ if (stream.match(settings.leftDelimiter, true)) {
63
+ if (stream.eat("*")) {
64
+ return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter));
65
+ } else {
66
+ // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode
67
+ state.depth++;
68
+ var isEol = stream.eol();
69
+ var isFollowedByWhitespace = /\s/.test(stream.peek());
70
+ if (settings.smartyVersion === 3 && settings.leftDelimiter === "{" && (isEol || isFollowedByWhitespace)) {
71
+ state.depth--;
72
+ return null;
73
+ } else {
74
+ state.tokenize = parsers.smarty;
75
+ last = "startTag";
76
+ return "tag";
77
+ }
78
+ }
79
+ } else {
80
+ stream.next();
81
+ return null;
82
+ }
83
+ },
84
+
85
+ // parsing Smarty content
86
+ smarty: function(stream, state) {
87
+ if (stream.match(settings.rightDelimiter, true)) {
88
+ if (settings.smartyVersion === 3) {
89
+ state.depth--;
90
+ if (state.depth <= 0) {
91
+ state.tokenize = parsers.tokenizer;
92
+ }
93
+ } else {
94
+ state.tokenize = parsers.tokenizer;
95
+ }
96
+ return helpers.cont("tag", null);
97
+ }
98
+
99
+ if (stream.match(settings.leftDelimiter, true)) {
100
+ state.depth++;
101
+ return helpers.cont("tag", "startTag");
102
+ }
103
+
104
+ var ch = stream.next();
105
+ if (ch == "$") {
106
+ stream.eatWhile(regs.validIdentifier);
107
+ return helpers.cont("variable-2", "variable");
108
+ } else if (ch == "|") {
109
+ return helpers.cont("operator", "pipe");
110
+ } else if (ch == ".") {
111
+ return helpers.cont("operator", "property");
112
+ } else if (regs.stringChar.test(ch)) {
113
+ state.tokenize = parsers.inAttribute(ch);
114
+ return helpers.cont("string", "string");
115
+ } else if (regs.operatorChars.test(ch)) {
116
+ stream.eatWhile(regs.operatorChars);
117
+ return helpers.cont("operator", "operator");
118
+ } else if (ch == "[" || ch == "]") {
119
+ return helpers.cont("bracket", "bracket");
120
+ } else if (ch == "(" || ch == ")") {
121
+ return helpers.cont("bracket", "operator");
122
+ } else if (/\d/.test(ch)) {
123
+ stream.eatWhile(/\d/);
124
+ return helpers.cont("number", "number");
125
+ } else {
126
+
127
+ if (state.last == "variable") {
128
+ if (ch == "@") {
129
+ stream.eatWhile(regs.validIdentifier);
130
+ return helpers.cont("property", "property");
131
+ } else if (ch == "|") {
132
+ stream.eatWhile(regs.validIdentifier);
133
+ return helpers.cont("qualifier", "modifier");
134
+ }
135
+ } else if (state.last == "pipe") {
136
+ stream.eatWhile(regs.validIdentifier);
137
+ return helpers.cont("qualifier", "modifier");
138
+ } else if (state.last == "whitespace") {
139
+ stream.eatWhile(regs.validIdentifier);
140
+ return helpers.cont("attribute", "modifier");
141
+ } if (state.last == "property") {
142
+ stream.eatWhile(regs.validIdentifier);
143
+ return helpers.cont("property", null);
144
+ } else if (/\s/.test(ch)) {
145
+ last = "whitespace";
146
+ return null;
147
+ }
148
+
149
+ var str = "";
150
+ if (ch != "/") {
151
+ str += ch;
152
+ }
153
+ var c = null;
154
+ while (c = stream.eat(regs.validIdentifier)) {
155
+ str += c;
156
+ }
157
+ for (var i=0, j=keyFunctions.length; i<j; i++) {
158
+ if (keyFunctions[i] == str) {
159
+ return helpers.cont("keyword", "keyword");
160
+ }
161
+ }
162
+ if (/\s/.test(ch)) {
163
+ return null;
164
+ }
165
+ return helpers.cont("tag", "tag");
166
+ }
167
+ },
168
+
169
+ inAttribute: function(quote) {
170
+ return function(stream, state) {
171
+ var prevChar = null;
172
+ var currChar = null;
173
+ while (!stream.eol()) {
174
+ currChar = stream.peek();
175
+ if (stream.next() == quote && prevChar !== '\\') {
176
+ state.tokenize = parsers.smarty;
177
+ break;
178
+ }
179
+ prevChar = currChar;
180
+ }
181
+ return "string";
182
+ };
183
+ },
184
+
185
+ inBlock: function(style, terminator) {
186
+ return function(stream, state) {
187
+ while (!stream.eol()) {
188
+ if (stream.match(terminator)) {
189
+ state.tokenize = parsers.tokenizer;
190
+ break;
191
+ }
192
+ stream.next();
193
+ }
194
+ return style;
195
+ };
196
+ }
197
+ };
198
+
199
+
200
+ // the public API for CodeMirror
201
+ return {
202
+ startState: function() {
203
+ return {
204
+ tokenize: parsers.tokenizer,
205
+ mode: "smarty",
206
+ last: null,
207
+ depth: 0
208
+ };
209
+ },
210
+ token: function(stream, state) {
211
+ var style = state.tokenize(stream, state);
212
+ state.last = last;
213
+ return style;
214
+ },
215
+ electricChars: ""
216
+ };
217
+ });
218
+
219
+ CodeMirror.defineMIME("text/x-smarty", "smarty");
220
+
221
+ });