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.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/application.js +2 -0
- data/app/assets/javascripts/codemirror.js +29 -0
- data/app/assets/javascripts/codemirror_fluentd.js +59 -0
- data/app/assets/stylesheets/application.css +6 -0
- data/app/views/fluentd/settings/edit.html.haml +1 -1
- data/app/views/shared/vue/_setting.html.erb +1 -1
- data/bower.json +2 -1
- data/lib/fluentd-ui/version.rb +1 -1
- data/spec/features/source_and_output_spec.rb +16 -6
- data/vendor/assets/javascripts/bower/codemirror/.bower.json +29 -0
- data/vendor/assets/javascripts/bower/codemirror/AUTHORS +423 -0
- data/vendor/assets/javascripts/bower/codemirror/CONTRIBUTING.md +76 -0
- data/vendor/assets/javascripts/bower/codemirror/LICENSE +19 -0
- data/vendor/assets/javascripts/bower/codemirror/README.md +11 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/comment/comment.js +183 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/comment/continuecomment.js +85 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.css +32 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.js +155 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.css +6 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.js +41 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/panel.js +94 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/placeholder.js +58 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/rulers.js +64 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/closebrackets.js +159 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/closetag.js +159 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/continuelist.js +51 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchbrackets.js +120 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchtags.js +66 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/trailingspace.js +27 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/brace-fold.js +105 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/comment-fold.js +57 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldcode.js +145 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.css +20 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.js +134 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/indent-fold.js +44 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/markdown-fold.js +49 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/xml-fold.js +182 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/anyword-hint.js +41 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/css-hint.js +56 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/html-hint.js +348 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/javascript-hint.js +146 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.css +38 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.js +389 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/sql-hint.js +197 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/xml-hint.js +110 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/coffeescript-lint.js +41 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/css-lint.js +35 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/javascript-lint.js +136 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/json-lint.js +31 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.css +73 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.js +204 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/yaml-lint.js +28 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.css +112 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.js +643 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/loadmode.js +64 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex.js +118 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex_test.js +33 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/overlay.js +85 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/simple.js +213 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/colorize.js +40 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode-standalone.js +157 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.js +72 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.node.js +120 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/annotatescrollbar.js +76 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/scrollpastend.js +46 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.css +66 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.js +139 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/match-highlighter.js +128 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.css +8 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.js +90 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/search.js +164 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/searchcursor.js +189 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/selection/active-line.js +71 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/selection/mark-selection.js +118 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.css +86 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.js +670 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/tern/worker.js +44 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/wrap/hardwrap.js +139 -0
- data/vendor/assets/javascripts/bower/codemirror/bower.json +16 -0
- data/vendor/assets/javascripts/bower/codemirror/keymap/emacs.js +411 -0
- data/vendor/assets/javascripts/bower/codemirror/keymap/sublime.js +540 -0
- data/vendor/assets/javascripts/bower/codemirror/keymap/vim.js +4901 -0
- data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.css +309 -0
- data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.js +8029 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/apl/apl.js +175 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/asterisk/asterisk.js +198 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/clike/clike.js +489 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/clike/scala.html +767 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/clojure/clojure.js +243 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/cobol/cobol.js +255 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/coffeescript/coffeescript.js +369 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/commonlisp/commonlisp.js +122 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/css.js +717 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/less.html +152 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/less_test.js +51 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/scss.html +157 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/scss_test.js +110 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/test.js +135 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/cypher/cypher.js +146 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/d/d.js +218 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/dart/dart.js +50 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/diff/diff.js +47 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/django/django.js +67 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/dockerfile/dockerfile.js +76 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/dtd/dtd.js +142 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/dylan/dylan.js +299 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ebnf/ebnf.js +195 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ecl/ecl.js +207 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/eiffel/eiffel.js +162 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/erlang/erlang.js +622 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/fortran/fortran.js +188 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/gas/gas.js +345 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/gfm/gfm.js +123 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/gfm/test.js +213 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/gherkin/gherkin.js +178 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/go/go.js +184 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/groovy/groovy.js +226 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/haml/haml.js +159 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/haml/test.js +97 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/haskell/haskell.js +267 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/haxe/haxe.js +518 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/htmlembedded/htmlembedded.js +86 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/htmlmixed/htmlmixed.js +121 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/http/http.js +113 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/idl/idl.js +290 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/jade/jade.js +590 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/javascript.js +686 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/json-ld.html +72 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/test.js +200 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/typescript.html +61 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/jinja2/jinja2.js +142 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/julia/julia.js +301 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/kotlin/kotlin.js +280 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/livescript/livescript.js +280 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/lua/lua.js +159 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/markdown/markdown.js +765 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/markdown/test.js +754 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/meta.js +165 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/mirc/mirc.js +193 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/mllike/mllike.js +205 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/modelica/modelica.js +245 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/nginx/nginx.js +178 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ntriples/ntriples.js +186 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/octave/octave.js +135 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/pascal/pascal.js +109 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/pegjs/pegjs.js +114 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/perl/perl.js +832 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/php/php.js +226 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/php/test.js +154 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/pig/pig.js +188 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/properties/properties.js +78 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/puppet/puppet.js +220 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/python/python.js +359 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/q/q.js +139 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/r/r.js +162 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/rpm/rpm.js +101 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/rst/rst.js +557 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ruby/ruby.js +285 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ruby/test.js +14 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/rust/rust.js +451 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/sass/sass.js +327 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/scheme/scheme.js +248 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/shell/shell.js +139 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/shell/test.js +58 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/sieve/sieve.js +193 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/slim/slim.js +575 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/slim/test.js +96 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/smalltalk/smalltalk.js +168 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/smarty/smarty.js +221 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/smartymixed/smartymixed.js +197 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/solr/solr.js +104 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/soy/soy.js +198 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/sparql/sparql.js +174 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/spreadsheet/spreadsheet.js +109 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/sql/sql.js +391 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/stex/stex.js +251 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/stex/test.js +123 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tcl/tcl.js +147 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/textile/test.js +417 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/textile/textile.js +469 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.js +369 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.css +26 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.js +323 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/toml/toml.js +88 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tornado/tornado.js +68 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/turtle/turtle.js +162 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/vb/vb.js +274 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/vbscript/vbscript.js +350 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/velocity/velocity.js +201 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/verilog/test.js +273 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/verilog/verilog.js +364 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/xml/test.js +51 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/xml/xml.js +384 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/xquery/test.js +67 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/xquery/xquery.js +447 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/yaml/yaml.js +117 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/z80/z80.js +100 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/3024-day.css +38 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/3024-night.css +37 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/ambiance-mobile.css +5 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/ambiance.css +77 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/base16-dark.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/base16-light.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/blackboard.css +30 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/cobalt.css +23 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/eclipse.css +23 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/elegant.css +13 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/erlang-dark.css +32 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/lesser-dark.css +45 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/mbo.css +35 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/mdn-like.css +44 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/midnight.css +45 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/monokai.css +31 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/neat.css +12 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/neo.css +43 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/night.css +26 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-dark.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-light.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/pastel-on-dark.css +50 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/rubyblue.css +23 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/solarized.css +165 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/the-matrix.css +28 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-bright.css +35 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-eighties.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/twilight.css +30 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/vibrant-ink.css +32 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/xq-dark.css +51 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/xq-light.css +43 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/zenburn.css +37 -0
- 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
|
+
});
|