swagr 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/swagr +15 -0
- data/examples/examples01/app.rb +6 -2
- data/examples/examples01/coffee/data_port.coffee +2 -0
- data/examples/examples01/static/css/codemirror.css +1247 -0
- data/examples/examples01/static/js/codemirror-compressed-3-0.js +5 -0
- data/examples/examples01/static/js/codemirror/keymap/emacs.js +30 -0
- data/examples/examples01/static/js/codemirror/keymap/vim.js +2298 -0
- data/examples/examples01/static/js/codemirror/lib/codemirror.css +239 -0
- data/examples/examples01/static/js/codemirror/lib/codemirror.js +4553 -0
- data/examples/examples01/static/js/codemirror/lib/util/closetag.js +85 -0
- data/examples/examples01/static/js/codemirror/lib/util/colorize.js +29 -0
- data/examples/examples01/static/js/codemirror/lib/util/continuecomment.js +36 -0
- data/examples/examples01/static/js/codemirror/lib/util/continuelist.js +28 -0
- data/examples/examples01/static/js/codemirror/lib/util/dialog.css +32 -0
- data/examples/examples01/static/js/codemirror/lib/util/dialog.js +75 -0
- data/examples/examples01/static/js/codemirror/lib/util/foldcode.js +182 -0
- data/examples/examples01/static/js/codemirror/lib/util/formatting.js +108 -0
- data/examples/examples01/static/js/codemirror/lib/util/javascript-hint.js +137 -0
- data/examples/examples01/static/js/codemirror/lib/util/loadmode.js +51 -0
- data/examples/examples01/static/js/codemirror/lib/util/match-highlighter.js +46 -0
- data/examples/examples01/static/js/codemirror/lib/util/matchbrackets.js +63 -0
- data/examples/examples01/static/js/codemirror/lib/util/multiplex.js +95 -0
- data/examples/examples01/static/js/codemirror/lib/util/overlay.js +59 -0
- data/examples/examples01/static/js/codemirror/lib/util/pig-hint.js +117 -0
- data/examples/examples01/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
- data/examples/examples01/static/js/codemirror/lib/util/runmode.js +52 -0
- data/examples/examples01/static/js/codemirror/lib/util/search.js +119 -0
- data/examples/examples01/static/js/codemirror/lib/util/searchcursor.js +119 -0
- data/examples/examples01/static/js/codemirror/lib/util/simple-hint.css +16 -0
- data/examples/examples01/static/js/codemirror/lib/util/simple-hint.js +102 -0
- data/examples/examples01/static/js/codemirror/lib/util/xml-hint.js +131 -0
- data/examples/examples01/static/js/codemirror/mode/clike/clike.js +300 -0
- data/examples/examples01/static/js/codemirror/mode/clike/index.html +103 -0
- data/examples/examples01/static/js/codemirror/mode/clike/scala.html +767 -0
- data/examples/examples01/static/js/codemirror/mode/clojure/clojure.js +206 -0
- data/examples/examples01/static/js/codemirror/mode/clojure/index.html +67 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/index.html +728 -0
- data/examples/examples01/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/examples/examples01/static/js/codemirror/mode/commonlisp/index.html +165 -0
- data/examples/examples01/static/js/codemirror/mode/css/css.js +465 -0
- data/examples/examples01/static/js/codemirror/mode/css/index.html +58 -0
- data/examples/examples01/static/js/codemirror/mode/css/test.js +501 -0
- data/examples/examples01/static/js/codemirror/mode/diff/diff.js +32 -0
- data/examples/examples01/static/js/codemirror/mode/diff/index.html +105 -0
- data/examples/examples01/static/js/codemirror/mode/ecl/ecl.js +192 -0
- data/examples/examples01/static/js/codemirror/mode/ecl/index.html +39 -0
- data/examples/examples01/static/js/codemirror/mode/erlang/erlang.js +463 -0
- data/examples/examples01/static/js/codemirror/mode/erlang/index.html +64 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/gfm.js +94 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/index.html +70 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/test.js +225 -0
- data/examples/examples01/static/js/codemirror/mode/go/go.js +165 -0
- data/examples/examples01/static/js/codemirror/mode/go/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/groovy/groovy.js +210 -0
- data/examples/examples01/static/js/codemirror/mode/groovy/index.html +73 -0
- data/examples/examples01/static/js/codemirror/mode/haskell/haskell.js +242 -0
- data/examples/examples01/static/js/codemirror/mode/haskell/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/haxe/haxe.js +429 -0
- data/examples/examples01/static/js/codemirror/mode/haxe/index.html +90 -0
- data/examples/examples01/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/examples/examples01/static/js/codemirror/mode/htmlembedded/index.html +49 -0
- data/examples/examples01/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
- data/examples/examples01/static/js/codemirror/mode/htmlmixed/index.html +52 -0
- data/examples/examples01/static/js/codemirror/mode/http/http.js +98 -0
- data/examples/examples01/static/js/codemirror/mode/http/index.html +32 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/index.html +88 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/javascript.js +411 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/typescript.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/jinja2/index.html +38 -0
- data/examples/examples01/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
- data/examples/examples01/static/js/codemirror/mode/less/index.html +741 -0
- data/examples/examples01/static/js/codemirror/mode/less/less.js +266 -0
- data/examples/examples01/static/js/codemirror/mode/lua/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/lua/lua.js +140 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/index.html +344 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/markdown.js +474 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/test.js +1266 -0
- data/examples/examples01/static/js/codemirror/mode/mysql/index.html +41 -0
- data/examples/examples01/static/js/codemirror/mode/mysql/mysql.js +203 -0
- data/examples/examples01/static/js/codemirror/mode/ntriples/index.html +33 -0
- data/examples/examples01/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
- data/examples/examples01/static/js/codemirror/mode/ocaml/index.html +131 -0
- data/examples/examples01/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/LICENSE +7 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/index.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/pascal.js +94 -0
- data/examples/examples01/static/js/codemirror/mode/perl/LICENSE +19 -0
- data/examples/examples01/static/js/codemirror/mode/perl/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/perl/perl.js +816 -0
- data/examples/examples01/static/js/codemirror/mode/php/index.html +51 -0
- data/examples/examples01/static/js/codemirror/mode/php/php.js +129 -0
- data/examples/examples01/static/js/codemirror/mode/pig/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/pig/pig.js +171 -0
- data/examples/examples01/static/js/codemirror/mode/plsql/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/plsql/plsql.js +216 -0
- data/examples/examples01/static/js/codemirror/mode/properties/index.html +41 -0
- data/examples/examples01/static/js/codemirror/mode/properties/properties.js +63 -0
- data/examples/examples01/static/js/codemirror/mode/python/LICENSE.txt +21 -0
- data/examples/examples01/static/js/codemirror/mode/python/index.html +124 -0
- data/examples/examples01/static/js/codemirror/mode/python/python.js +340 -0
- data/examples/examples01/static/js/codemirror/mode/r/LICENSE +24 -0
- data/examples/examples01/static/js/codemirror/mode/r/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/r/r.js +141 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/changes/index.html +53 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/index.html +99 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
- data/examples/examples01/static/js/codemirror/mode/rst/index.html +526 -0
- data/examples/examples01/static/js/codemirror/mode/rst/rst.js +314 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/LICENSE +24 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/index.html +173 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/ruby.js +195 -0
- data/examples/examples01/static/js/codemirror/mode/rust/index.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/rust/rust.js +432 -0
- data/examples/examples01/static/js/codemirror/mode/scheme/index.html +65 -0
- data/examples/examples01/static/js/codemirror/mode/scheme/scheme.js +230 -0
- data/examples/examples01/static/js/codemirror/mode/shell/index.html +51 -0
- data/examples/examples01/static/js/codemirror/mode/shell/shell.js +118 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/LICENSE +23 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/index.html +81 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/sieve.js +156 -0
- data/examples/examples01/static/js/codemirror/mode/smalltalk/index.html +57 -0
- data/examples/examples01/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
- data/examples/examples01/static/js/codemirror/mode/smarty/index.html +83 -0
- data/examples/examples01/static/js/codemirror/mode/smarty/smarty.js +148 -0
- data/examples/examples01/static/js/codemirror/mode/sparql/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/sparql/sparql.js +143 -0
- data/examples/examples01/static/js/codemirror/mode/stex/index.html +98 -0
- data/examples/examples01/static/js/codemirror/mode/stex/stex.js +175 -0
- data/examples/examples01/static/js/codemirror/mode/stex/test.js +343 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/index.html +81 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/tiki.css +26 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/tiki.js +309 -0
- data/examples/examples01/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
- data/examples/examples01/static/js/codemirror/mode/vb/index.html +88 -0
- data/examples/examples01/static/js/codemirror/mode/vb/vb.js +260 -0
- data/examples/examples01/static/js/codemirror/mode/vbscript/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
- data/examples/examples01/static/js/codemirror/mode/velocity/index.html +103 -0
- data/examples/examples01/static/js/codemirror/mode/velocity/velocity.js +144 -0
- data/examples/examples01/static/js/codemirror/mode/verilog/index.html +210 -0
- data/examples/examples01/static/js/codemirror/mode/verilog/verilog.js +182 -0
- data/examples/examples01/static/js/codemirror/mode/xml/index.html +45 -0
- data/examples/examples01/static/js/codemirror/mode/xml/xml.js +324 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/LICENSE +20 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/index.html +221 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/test.js +77 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/xquery.js +450 -0
- data/examples/examples01/static/js/codemirror/mode/yaml/index.html +68 -0
- data/examples/examples01/static/js/codemirror/mode/yaml/yaml.js +95 -0
- data/examples/examples01/static/js/codemirror/mode/z80/index.html +39 -0
- data/examples/examples01/static/js/codemirror/mode/z80/z80.js +113 -0
- data/examples/examples01/static/js/codemirror/theme/ambiance-mobile.css +6 -0
- data/examples/examples01/static/js/codemirror/theme/ambiance.css +76 -0
- data/examples/examples01/static/js/codemirror/theme/blackboard.css +25 -0
- data/examples/examples01/static/js/codemirror/theme/cobalt.css +18 -0
- data/examples/examples01/static/js/codemirror/theme/eclipse.css +25 -0
- data/examples/examples01/static/js/codemirror/theme/elegant.css +10 -0
- data/examples/examples01/static/js/codemirror/theme/erlang-dark.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/lesser-dark.css +44 -0
- data/examples/examples01/static/js/codemirror/theme/monokai.css +28 -0
- data/examples/examples01/static/js/codemirror/theme/neat.css +9 -0
- data/examples/examples01/static/js/codemirror/theme/night.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/rubyblue.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/solarized.css +207 -0
- data/examples/examples01/static/js/codemirror/theme/twilight.css +26 -0
- data/examples/examples01/static/js/codemirror/theme/vibrant-ink.css +27 -0
- data/examples/examples01/static/js/codemirror/theme/xq-dark.css +46 -0
- data/examples/examples01/static/js/d3.v3.min.js +2 -2
- data/examples/examples01/static/test/cm.html +33 -0
- data/examples/examples01/views/about.slim +15 -0
- data/examples/examples01/views/index.slim +1 -1
- data/examples/examples01/views/layout.slim +1 -0
- data/examples/examples01/views/layout_cm.slim +17 -0
- data/examples/examples01/views/navbar.slim +4 -4
- data/lib/swagr/version.rb +1 -1
- data/templates/app.rb +4 -0
- data/templates/static/js/codemirror/keymap/emacs.js +30 -0
- data/templates/static/js/codemirror/keymap/vim.js +2298 -0
- data/templates/static/js/codemirror/lib/codemirror.css +239 -0
- data/templates/static/js/codemirror/lib/codemirror.js +4553 -0
- data/templates/static/js/codemirror/lib/util/closetag.js +85 -0
- data/templates/static/js/codemirror/lib/util/colorize.js +29 -0
- data/templates/static/js/codemirror/lib/util/continuecomment.js +36 -0
- data/templates/static/js/codemirror/lib/util/continuelist.js +28 -0
- data/templates/static/js/codemirror/lib/util/dialog.css +32 -0
- data/templates/static/js/codemirror/lib/util/dialog.js +75 -0
- data/templates/static/js/codemirror/lib/util/foldcode.js +182 -0
- data/templates/static/js/codemirror/lib/util/formatting.js +108 -0
- data/templates/static/js/codemirror/lib/util/javascript-hint.js +137 -0
- data/templates/static/js/codemirror/lib/util/loadmode.js +51 -0
- data/templates/static/js/codemirror/lib/util/match-highlighter.js +46 -0
- data/templates/static/js/codemirror/lib/util/matchbrackets.js +63 -0
- data/templates/static/js/codemirror/lib/util/multiplex.js +95 -0
- data/templates/static/js/codemirror/lib/util/overlay.js +59 -0
- data/templates/static/js/codemirror/lib/util/pig-hint.js +117 -0
- data/templates/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
- data/templates/static/js/codemirror/lib/util/runmode.js +52 -0
- data/templates/static/js/codemirror/lib/util/search.js +119 -0
- data/templates/static/js/codemirror/lib/util/searchcursor.js +119 -0
- data/templates/static/js/codemirror/lib/util/simple-hint.css +16 -0
- data/templates/static/js/codemirror/lib/util/simple-hint.js +102 -0
- data/templates/static/js/codemirror/lib/util/xml-hint.js +131 -0
- data/templates/static/js/codemirror/mode/clike/clike.js +300 -0
- data/templates/static/js/codemirror/mode/clike/index.html +103 -0
- data/templates/static/js/codemirror/mode/clike/scala.html +767 -0
- data/templates/static/js/codemirror/mode/clojure/clojure.js +206 -0
- data/templates/static/js/codemirror/mode/clojure/index.html +67 -0
- data/templates/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
- data/templates/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/templates/static/js/codemirror/mode/coffeescript/index.html +728 -0
- data/templates/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/templates/static/js/codemirror/mode/commonlisp/index.html +165 -0
- data/templates/static/js/codemirror/mode/css/css.js +465 -0
- data/templates/static/js/codemirror/mode/css/index.html +58 -0
- data/templates/static/js/codemirror/mode/css/test.js +501 -0
- data/templates/static/js/codemirror/mode/diff/diff.js +32 -0
- data/templates/static/js/codemirror/mode/diff/index.html +105 -0
- data/templates/static/js/codemirror/mode/ecl/ecl.js +192 -0
- data/templates/static/js/codemirror/mode/ecl/index.html +39 -0
- data/templates/static/js/codemirror/mode/erlang/erlang.js +463 -0
- data/templates/static/js/codemirror/mode/erlang/index.html +64 -0
- data/templates/static/js/codemirror/mode/gfm/gfm.js +94 -0
- data/templates/static/js/codemirror/mode/gfm/index.html +70 -0
- data/templates/static/js/codemirror/mode/gfm/test.js +225 -0
- data/templates/static/js/codemirror/mode/go/go.js +165 -0
- data/templates/static/js/codemirror/mode/go/index.html +74 -0
- data/templates/static/js/codemirror/mode/groovy/groovy.js +210 -0
- data/templates/static/js/codemirror/mode/groovy/index.html +73 -0
- data/templates/static/js/codemirror/mode/haskell/haskell.js +242 -0
- data/templates/static/js/codemirror/mode/haskell/index.html +62 -0
- data/templates/static/js/codemirror/mode/haxe/haxe.js +429 -0
- data/templates/static/js/codemirror/mode/haxe/index.html +90 -0
- data/templates/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/templates/static/js/codemirror/mode/htmlembedded/index.html +49 -0
- data/templates/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
- data/templates/static/js/codemirror/mode/htmlmixed/index.html +52 -0
- data/templates/static/js/codemirror/mode/http/http.js +98 -0
- data/templates/static/js/codemirror/mode/http/index.html +32 -0
- data/templates/static/js/codemirror/mode/javascript/index.html +88 -0
- data/templates/static/js/codemirror/mode/javascript/javascript.js +411 -0
- data/templates/static/js/codemirror/mode/javascript/typescript.html +48 -0
- data/templates/static/js/codemirror/mode/jinja2/index.html +38 -0
- data/templates/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
- data/templates/static/js/codemirror/mode/less/index.html +741 -0
- data/templates/static/js/codemirror/mode/less/less.js +266 -0
- data/templates/static/js/codemirror/mode/lua/index.html +74 -0
- data/templates/static/js/codemirror/mode/lua/lua.js +140 -0
- data/templates/static/js/codemirror/mode/markdown/index.html +344 -0
- data/templates/static/js/codemirror/mode/markdown/markdown.js +474 -0
- data/templates/static/js/codemirror/mode/markdown/test.js +1266 -0
- data/templates/static/js/codemirror/mode/mysql/index.html +41 -0
- data/templates/static/js/codemirror/mode/mysql/mysql.js +203 -0
- data/templates/static/js/codemirror/mode/ntriples/index.html +33 -0
- data/templates/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
- data/templates/static/js/codemirror/mode/ocaml/index.html +131 -0
- data/templates/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
- data/templates/static/js/codemirror/mode/pascal/LICENSE +7 -0
- data/templates/static/js/codemirror/mode/pascal/index.html +48 -0
- data/templates/static/js/codemirror/mode/pascal/pascal.js +94 -0
- data/templates/static/js/codemirror/mode/perl/LICENSE +19 -0
- data/templates/static/js/codemirror/mode/perl/index.html +62 -0
- data/templates/static/js/codemirror/mode/perl/perl.js +816 -0
- data/templates/static/js/codemirror/mode/php/index.html +51 -0
- data/templates/static/js/codemirror/mode/php/php.js +129 -0
- data/templates/static/js/codemirror/mode/pig/index.html +42 -0
- data/templates/static/js/codemirror/mode/pig/pig.js +171 -0
- data/templates/static/js/codemirror/mode/plsql/index.html +62 -0
- data/templates/static/js/codemirror/mode/plsql/plsql.js +216 -0
- data/templates/static/js/codemirror/mode/properties/index.html +41 -0
- data/templates/static/js/codemirror/mode/properties/properties.js +63 -0
- data/templates/static/js/codemirror/mode/python/LICENSE.txt +21 -0
- data/templates/static/js/codemirror/mode/python/index.html +124 -0
- data/templates/static/js/codemirror/mode/python/python.js +340 -0
- data/templates/static/js/codemirror/mode/r/LICENSE +24 -0
- data/templates/static/js/codemirror/mode/r/index.html +74 -0
- data/templates/static/js/codemirror/mode/r/r.js +141 -0
- data/templates/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
- data/templates/static/js/codemirror/mode/rpm/changes/index.html +53 -0
- data/templates/static/js/codemirror/mode/rpm/spec/index.html +99 -0
- data/templates/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
- data/templates/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
- data/templates/static/js/codemirror/mode/rst/index.html +526 -0
- data/templates/static/js/codemirror/mode/rst/rst.js +314 -0
- data/templates/static/js/codemirror/mode/ruby/LICENSE +24 -0
- data/templates/static/js/codemirror/mode/ruby/index.html +173 -0
- data/templates/static/js/codemirror/mode/ruby/ruby.js +195 -0
- data/templates/static/js/codemirror/mode/rust/index.html +48 -0
- data/templates/static/js/codemirror/mode/rust/rust.js +432 -0
- data/templates/static/js/codemirror/mode/scheme/index.html +65 -0
- data/templates/static/js/codemirror/mode/scheme/scheme.js +230 -0
- data/templates/static/js/codemirror/mode/shell/index.html +51 -0
- data/templates/static/js/codemirror/mode/shell/shell.js +118 -0
- data/templates/static/js/codemirror/mode/sieve/LICENSE +23 -0
- data/templates/static/js/codemirror/mode/sieve/index.html +81 -0
- data/templates/static/js/codemirror/mode/sieve/sieve.js +156 -0
- data/templates/static/js/codemirror/mode/smalltalk/index.html +57 -0
- data/templates/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
- data/templates/static/js/codemirror/mode/smarty/index.html +83 -0
- data/templates/static/js/codemirror/mode/smarty/smarty.js +148 -0
- data/templates/static/js/codemirror/mode/sparql/index.html +42 -0
- data/templates/static/js/codemirror/mode/sparql/sparql.js +143 -0
- data/templates/static/js/codemirror/mode/stex/index.html +98 -0
- data/templates/static/js/codemirror/mode/stex/stex.js +175 -0
- data/templates/static/js/codemirror/mode/stex/test.js +343 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/templates/static/js/codemirror/mode/tiki/index.html +81 -0
- data/templates/static/js/codemirror/mode/tiki/tiki.css +26 -0
- data/templates/static/js/codemirror/mode/tiki/tiki.js +309 -0
- data/templates/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
- data/templates/static/js/codemirror/mode/vb/index.html +88 -0
- data/templates/static/js/codemirror/mode/vb/vb.js +260 -0
- data/templates/static/js/codemirror/mode/vbscript/index.html +42 -0
- data/templates/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
- data/templates/static/js/codemirror/mode/velocity/index.html +103 -0
- data/templates/static/js/codemirror/mode/velocity/velocity.js +144 -0
- data/templates/static/js/codemirror/mode/verilog/index.html +210 -0
- data/templates/static/js/codemirror/mode/verilog/verilog.js +182 -0
- data/templates/static/js/codemirror/mode/xml/index.html +45 -0
- data/templates/static/js/codemirror/mode/xml/xml.js +324 -0
- data/templates/static/js/codemirror/mode/xquery/LICENSE +20 -0
- data/templates/static/js/codemirror/mode/xquery/index.html +221 -0
- data/templates/static/js/codemirror/mode/xquery/test.js +77 -0
- data/templates/static/js/codemirror/mode/xquery/xquery.js +450 -0
- data/templates/static/js/codemirror/mode/yaml/index.html +68 -0
- data/templates/static/js/codemirror/mode/yaml/yaml.js +95 -0
- data/templates/static/js/codemirror/mode/z80/index.html +39 -0
- data/templates/static/js/codemirror/mode/z80/z80.js +113 -0
- data/templates/static/js/codemirror/theme/ambiance-mobile.css +6 -0
- data/templates/static/js/codemirror/theme/ambiance.css +76 -0
- data/templates/static/js/codemirror/theme/blackboard.css +25 -0
- data/templates/static/js/codemirror/theme/cobalt.css +18 -0
- data/templates/static/js/codemirror/theme/eclipse.css +25 -0
- data/templates/static/js/codemirror/theme/elegant.css +10 -0
- data/templates/static/js/codemirror/theme/erlang-dark.css +21 -0
- data/templates/static/js/codemirror/theme/lesser-dark.css +44 -0
- data/templates/static/js/codemirror/theme/monokai.css +28 -0
- data/templates/static/js/codemirror/theme/neat.css +9 -0
- data/templates/static/js/codemirror/theme/night.css +21 -0
- data/templates/static/js/codemirror/theme/rubyblue.css +21 -0
- data/templates/static/js/codemirror/theme/solarized.css +207 -0
- data/templates/static/js/codemirror/theme/twilight.css +26 -0
- data/templates/static/js/codemirror/theme/vibrant-ink.css +27 -0
- data/templates/static/js/codemirror/theme/xq-dark.css +46 -0
- data/templates/static/js/d3.v3.min.js +2 -2
- data/templates/static/test/cm.html +33 -0
- data/templates/views/about.slim +15 -0
- data/templates/views/index.slim +1 -1
- data/templates/views/layout.slim +1 -0
- data/templates/views/navbar.slim +4 -4
- metadata +347 -2
@@ -0,0 +1,81 @@
|
|
1
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2
|
+
<head>
|
3
|
+
<meta charset="utf-8">
|
4
|
+
<title>CodeMirror: Tiki wiki mode</title>
|
5
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
6
|
+
<script src="../../lib/codemirror.js"></script>
|
7
|
+
<script src="tiki.js"></script>
|
8
|
+
<link rel="stylesheet" href="tiki.css">
|
9
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
10
|
+
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11
|
+
</head>
|
12
|
+
<body style="padding: 20px;">
|
13
|
+
<h1>CodeMirror: Tiki wiki mode</h1>
|
14
|
+
|
15
|
+
<div><textarea id="code" name="code">
|
16
|
+
Headings
|
17
|
+
!Header 1
|
18
|
+
!!Header 2
|
19
|
+
!!!Header 3
|
20
|
+
!!!!Header 4
|
21
|
+
!!!!!Header 5
|
22
|
+
!!!!!!Header 6
|
23
|
+
|
24
|
+
Styling
|
25
|
+
-=titlebar=-
|
26
|
+
^^ Box on multi
|
27
|
+
lines
|
28
|
+
of content^^
|
29
|
+
__bold__
|
30
|
+
''italic''
|
31
|
+
===underline===
|
32
|
+
::center::
|
33
|
+
--Line Through--
|
34
|
+
|
35
|
+
Operators
|
36
|
+
~np~No parse~/np~
|
37
|
+
|
38
|
+
Link
|
39
|
+
[link|desc|nocache]
|
40
|
+
|
41
|
+
Wiki
|
42
|
+
((Wiki))
|
43
|
+
((Wiki|desc))
|
44
|
+
((Wiki|desc|timeout))
|
45
|
+
|
46
|
+
Table
|
47
|
+
||row1 col1|row1 col2|row1 col3
|
48
|
+
row2 col1|row2 col2|row2 col3
|
49
|
+
row3 col1|row3 col2|row3 col3||
|
50
|
+
|
51
|
+
Lists:
|
52
|
+
*bla
|
53
|
+
**bla-1
|
54
|
+
++continue-bla-1
|
55
|
+
***bla-2
|
56
|
+
++continue-bla-1
|
57
|
+
*bla
|
58
|
+
+continue-bla
|
59
|
+
#bla
|
60
|
+
** tra-la-la
|
61
|
+
+continue-bla
|
62
|
+
#bla
|
63
|
+
|
64
|
+
Plugin (standard):
|
65
|
+
{PLUGIN(attr="my attr")}
|
66
|
+
Plugin Body
|
67
|
+
{PLUGIN}
|
68
|
+
|
69
|
+
Plugin (inline):
|
70
|
+
{plugin attr="my attr"}
|
71
|
+
</textarea></div>
|
72
|
+
|
73
|
+
<script type="text/javascript">
|
74
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
75
|
+
mode: 'tiki',
|
76
|
+
lineNumbers: true
|
77
|
+
});
|
78
|
+
</script>
|
79
|
+
|
80
|
+
</body>
|
81
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
.cm-tw-syntaxerror {
|
2
|
+
color: #FFFFFF;
|
3
|
+
background-color: #990000;
|
4
|
+
}
|
5
|
+
|
6
|
+
.cm-tw-deleted {
|
7
|
+
text-decoration: line-through;
|
8
|
+
}
|
9
|
+
|
10
|
+
.cm-tw-header5 {
|
11
|
+
font-weight: bold;
|
12
|
+
}
|
13
|
+
.cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/
|
14
|
+
padding-left: 10px;
|
15
|
+
}
|
16
|
+
|
17
|
+
.cm-tw-box {
|
18
|
+
border-top-width: 0px ! important;
|
19
|
+
border-style: solid;
|
20
|
+
border-width: 1px;
|
21
|
+
border-color: inherit;
|
22
|
+
}
|
23
|
+
|
24
|
+
.cm-tw-underline {
|
25
|
+
text-decoration: underline;
|
26
|
+
}
|
@@ -0,0 +1,309 @@
|
|
1
|
+
CodeMirror.defineMode('tiki', function(config) {
|
2
|
+
function inBlock(style, terminator, returnTokenizer) {
|
3
|
+
return function(stream, state) {
|
4
|
+
while (!stream.eol()) {
|
5
|
+
if (stream.match(terminator)) {
|
6
|
+
state.tokenize = inText;
|
7
|
+
break;
|
8
|
+
}
|
9
|
+
stream.next();
|
10
|
+
}
|
11
|
+
|
12
|
+
if (returnTokenizer) state.tokenize = returnTokenizer;
|
13
|
+
|
14
|
+
return style;
|
15
|
+
};
|
16
|
+
}
|
17
|
+
|
18
|
+
function inLine(style) {
|
19
|
+
return function(stream, state) {
|
20
|
+
while(!stream.eol()) {
|
21
|
+
stream.next();
|
22
|
+
}
|
23
|
+
state.tokenize = inText;
|
24
|
+
return style;
|
25
|
+
};
|
26
|
+
}
|
27
|
+
|
28
|
+
function inText(stream, state) {
|
29
|
+
function chain(parser) {
|
30
|
+
state.tokenize = parser;
|
31
|
+
return parser(stream, state);
|
32
|
+
}
|
33
|
+
|
34
|
+
var sol = stream.sol();
|
35
|
+
var ch = stream.next();
|
36
|
+
|
37
|
+
//non start of line
|
38
|
+
switch (ch) { //switch is generally much faster than if, so it is used here
|
39
|
+
case "{": //plugin
|
40
|
+
stream.eat("/");
|
41
|
+
stream.eatSpace();
|
42
|
+
var tagName = "";
|
43
|
+
var c;
|
44
|
+
while ((c = stream.eat(/[^\s\u00a0=\"\'\/?(}]/))) tagName += c;
|
45
|
+
state.tokenize = inPlugin;
|
46
|
+
return "tag";
|
47
|
+
break;
|
48
|
+
case "_": //bold
|
49
|
+
if (stream.eat("_")) {
|
50
|
+
return chain(inBlock("strong", "__", inText));
|
51
|
+
}
|
52
|
+
break;
|
53
|
+
case "'": //italics
|
54
|
+
if (stream.eat("'")) {
|
55
|
+
// Italic text
|
56
|
+
return chain(inBlock("em", "''", inText));
|
57
|
+
}
|
58
|
+
break;
|
59
|
+
case "(":// Wiki Link
|
60
|
+
if (stream.eat("(")) {
|
61
|
+
return chain(inBlock("variable-2", "))", inText));
|
62
|
+
}
|
63
|
+
break;
|
64
|
+
case "[":// Weblink
|
65
|
+
return chain(inBlock("variable-3", "]", inText));
|
66
|
+
break;
|
67
|
+
case "|": //table
|
68
|
+
if (stream.eat("|")) {
|
69
|
+
return chain(inBlock("comment", "||"));
|
70
|
+
}
|
71
|
+
break;
|
72
|
+
case "-":
|
73
|
+
if (stream.eat("=")) {//titleBar
|
74
|
+
return chain(inBlock("header string", "=-", inText));
|
75
|
+
} else if (stream.eat("-")) {//deleted
|
76
|
+
return chain(inBlock("error tw-deleted", "--", inText));
|
77
|
+
}
|
78
|
+
break;
|
79
|
+
case "=": //underline
|
80
|
+
if (stream.match("==")) {
|
81
|
+
return chain(inBlock("tw-underline", "===", inText));
|
82
|
+
}
|
83
|
+
break;
|
84
|
+
case ":":
|
85
|
+
if (stream.eat(":")) {
|
86
|
+
return chain(inBlock("comment", "::"));
|
87
|
+
}
|
88
|
+
break;
|
89
|
+
case "^": //box
|
90
|
+
return chain(inBlock("tw-box", "^"));
|
91
|
+
break;
|
92
|
+
case "~": //np
|
93
|
+
if (stream.match("np~")) {
|
94
|
+
return chain(inBlock("meta", "~/np~"));
|
95
|
+
}
|
96
|
+
break;
|
97
|
+
}
|
98
|
+
|
99
|
+
//start of line types
|
100
|
+
if (sol) {
|
101
|
+
switch (ch) {
|
102
|
+
case "!": //header at start of line
|
103
|
+
if (stream.match('!!!!!')) {
|
104
|
+
return chain(inLine("header string"));
|
105
|
+
} else if (stream.match('!!!!')) {
|
106
|
+
return chain(inLine("header string"));
|
107
|
+
} else if (stream.match('!!!')) {
|
108
|
+
return chain(inLine("header string"));
|
109
|
+
} else if (stream.match('!!')) {
|
110
|
+
return chain(inLine("header string"));
|
111
|
+
} else {
|
112
|
+
return chain(inLine("header string"));
|
113
|
+
}
|
114
|
+
break;
|
115
|
+
case "*": //unordered list line item, or <li /> at start of line
|
116
|
+
case "#": //ordered list line item, or <li /> at start of line
|
117
|
+
case "+": //ordered list line item, or <li /> at start of line
|
118
|
+
return chain(inLine("tw-listitem bracket"));
|
119
|
+
break;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
//stream.eatWhile(/[&{]/); was eating up plugins, turned off to act less like html and more like tiki
|
124
|
+
return null;
|
125
|
+
}
|
126
|
+
|
127
|
+
var indentUnit = config.indentUnit;
|
128
|
+
|
129
|
+
// Return variables for tokenizers
|
130
|
+
var pluginName, type;
|
131
|
+
function inPlugin(stream, state) {
|
132
|
+
var ch = stream.next();
|
133
|
+
var peek = stream.peek();
|
134
|
+
|
135
|
+
if (ch == "}") {
|
136
|
+
state.tokenize = inText;
|
137
|
+
//type = ch == ")" ? "endPlugin" : "selfclosePlugin"; inPlugin
|
138
|
+
return "tag";
|
139
|
+
} else if (ch == "(" || ch == ")") {
|
140
|
+
return "bracket";
|
141
|
+
} else if (ch == "=") {
|
142
|
+
type = "equals";
|
143
|
+
|
144
|
+
if (peek == ">") {
|
145
|
+
ch = stream.next();
|
146
|
+
peek = stream.peek();
|
147
|
+
}
|
148
|
+
|
149
|
+
//here we detect values directly after equal character with no quotes
|
150
|
+
if (!/[\'\"]/.test(peek)) {
|
151
|
+
state.tokenize = inAttributeNoQuote();
|
152
|
+
}
|
153
|
+
//end detect values
|
154
|
+
|
155
|
+
return "operator";
|
156
|
+
} else if (/[\'\"]/.test(ch)) {
|
157
|
+
state.tokenize = inAttribute(ch);
|
158
|
+
return state.tokenize(stream, state);
|
159
|
+
} else {
|
160
|
+
stream.eatWhile(/[^\s\u00a0=\"\'\/?]/);
|
161
|
+
return "keyword";
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
function inAttribute(quote) {
|
166
|
+
return function(stream, state) {
|
167
|
+
while (!stream.eol()) {
|
168
|
+
if (stream.next() == quote) {
|
169
|
+
state.tokenize = inPlugin;
|
170
|
+
break;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
return "string";
|
174
|
+
};
|
175
|
+
}
|
176
|
+
|
177
|
+
function inAttributeNoQuote() {
|
178
|
+
return function(stream, state) {
|
179
|
+
while (!stream.eol()) {
|
180
|
+
var ch = stream.next();
|
181
|
+
var peek = stream.peek();
|
182
|
+
if (ch == " " || ch == "," || /[ )}]/.test(peek)) {
|
183
|
+
state.tokenize = inPlugin;
|
184
|
+
break;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
return "string";
|
188
|
+
};
|
189
|
+
}
|
190
|
+
|
191
|
+
var curState, setStyle;
|
192
|
+
function pass() {
|
193
|
+
for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
|
194
|
+
}
|
195
|
+
|
196
|
+
function cont() {
|
197
|
+
pass.apply(null, arguments);
|
198
|
+
return true;
|
199
|
+
}
|
200
|
+
|
201
|
+
function pushContext(pluginName, startOfLine) {
|
202
|
+
var noIndent = curState.context && curState.context.noIndent;
|
203
|
+
curState.context = {
|
204
|
+
prev: curState.context,
|
205
|
+
pluginName: pluginName,
|
206
|
+
indent: curState.indented,
|
207
|
+
startOfLine: startOfLine,
|
208
|
+
noIndent: noIndent
|
209
|
+
};
|
210
|
+
}
|
211
|
+
|
212
|
+
function popContext() {
|
213
|
+
if (curState.context) curState.context = curState.context.prev;
|
214
|
+
}
|
215
|
+
|
216
|
+
function element(type) {
|
217
|
+
if (type == "openPlugin") {curState.pluginName = pluginName; return cont(attributes, endplugin(curState.startOfLine));}
|
218
|
+
else if (type == "closePlugin") {
|
219
|
+
var err = false;
|
220
|
+
if (curState.context) {
|
221
|
+
err = curState.context.pluginName != pluginName;
|
222
|
+
popContext();
|
223
|
+
} else {
|
224
|
+
err = true;
|
225
|
+
}
|
226
|
+
if (err) setStyle = "error";
|
227
|
+
return cont(endcloseplugin(err));
|
228
|
+
}
|
229
|
+
else if (type == "string") {
|
230
|
+
if (!curState.context || curState.context.name != "!cdata") pushContext("!cdata");
|
231
|
+
if (curState.tokenize == inText) popContext();
|
232
|
+
return cont();
|
233
|
+
}
|
234
|
+
else return cont();
|
235
|
+
}
|
236
|
+
|
237
|
+
function endplugin(startOfLine) {
|
238
|
+
return function(type) {
|
239
|
+
if (
|
240
|
+
type == "selfclosePlugin" ||
|
241
|
+
type == "endPlugin"
|
242
|
+
)
|
243
|
+
return cont();
|
244
|
+
if (type == "endPlugin") {pushContext(curState.pluginName, startOfLine); return cont();}
|
245
|
+
return cont();
|
246
|
+
};
|
247
|
+
}
|
248
|
+
|
249
|
+
function endcloseplugin(err) {
|
250
|
+
return function(type) {
|
251
|
+
if (err) setStyle = "error";
|
252
|
+
if (type == "endPlugin") return cont();
|
253
|
+
return pass();
|
254
|
+
};
|
255
|
+
}
|
256
|
+
|
257
|
+
function attributes(type) {
|
258
|
+
if (type == "keyword") {setStyle = "attribute"; return cont(attributes);}
|
259
|
+
if (type == "equals") return cont(attvalue, attributes);
|
260
|
+
return pass();
|
261
|
+
}
|
262
|
+
function attvalue(type) {
|
263
|
+
if (type == "keyword") {setStyle = "string"; return cont();}
|
264
|
+
if (type == "string") return cont(attvaluemaybe);
|
265
|
+
return pass();
|
266
|
+
}
|
267
|
+
function attvaluemaybe(type) {
|
268
|
+
if (type == "string") return cont(attvaluemaybe);
|
269
|
+
else return pass();
|
270
|
+
}
|
271
|
+
return {
|
272
|
+
startState: function() {
|
273
|
+
return {tokenize: inText, cc: [], indented: 0, startOfLine: true, pluginName: null, context: null};
|
274
|
+
},
|
275
|
+
token: function(stream, state) {
|
276
|
+
if (stream.sol()) {
|
277
|
+
state.startOfLine = true;
|
278
|
+
state.indented = stream.indentation();
|
279
|
+
}
|
280
|
+
if (stream.eatSpace()) return null;
|
281
|
+
|
282
|
+
setStyle = type = pluginName = null;
|
283
|
+
var style = state.tokenize(stream, state);
|
284
|
+
if ((style || type) && style != "comment") {
|
285
|
+
curState = state;
|
286
|
+
while (true) {
|
287
|
+
var comb = state.cc.pop() || element;
|
288
|
+
if (comb(type || style)) break;
|
289
|
+
}
|
290
|
+
}
|
291
|
+
state.startOfLine = false;
|
292
|
+
return setStyle || style;
|
293
|
+
},
|
294
|
+
indent: function(state, textAfter) {
|
295
|
+
var context = state.context;
|
296
|
+
if (context && context.noIndent) return 0;
|
297
|
+
if (context && /^{\//.test(textAfter))
|
298
|
+
context = context.prev;
|
299
|
+
while (context && !context.startOfLine)
|
300
|
+
context = context.prev;
|
301
|
+
if (context) return context.indent + indentUnit;
|
302
|
+
else return 0;
|
303
|
+
},
|
304
|
+
electricChars: "/"
|
305
|
+
};
|
306
|
+
});
|
307
|
+
|
308
|
+
//I figure, why not
|
309
|
+
CodeMirror.defineMIME("text/tiki", "tiki");
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2012 Codility Limited, 107 Cheapside, London EC2V 6DN, UK
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,88 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<meta charset="utf-8">
|
4
|
+
<title>CodeMirror: VB.NET mode</title>
|
5
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
6
|
+
<script src="../../lib/codemirror.js"></script>
|
7
|
+
<script src="vb.js"></script>
|
8
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
9
|
+
<link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
|
10
|
+
<style>
|
11
|
+
.CodeMirror {border: 1px solid #aaa; height:210px; height: auto;}
|
12
|
+
.CodeMirror-scroll { overflow-x: auto; overflow-y: hidden;}
|
13
|
+
.CodeMirror pre { font-family: Inconsolata; font-size: 14px}
|
14
|
+
</style>
|
15
|
+
<script type="text/javascript" src="../../lib/util/runmode.js"></script>
|
16
|
+
</head>
|
17
|
+
<body onload="init()">
|
18
|
+
<h1>CodeMirror: VB.NET mode</h1>
|
19
|
+
<script type="text/javascript">
|
20
|
+
function test(golden, text) {
|
21
|
+
var ok = true;
|
22
|
+
var i = 0;
|
23
|
+
function callback(token, style, lineNo, pos){
|
24
|
+
//console.log(String(token) + " " + String(style) + " " + String(lineNo) + " " + String(pos));
|
25
|
+
var result = [String(token), String(style)];
|
26
|
+
if (golden[i][0] != result[0] || golden[i][1] != result[1]){
|
27
|
+
return "Error, expected: " + String(golden[i]) + ", got: " + String(result);
|
28
|
+
ok = false;
|
29
|
+
}
|
30
|
+
i++;
|
31
|
+
}
|
32
|
+
CodeMirror.runMode(text, "text/x-vb",callback);
|
33
|
+
|
34
|
+
if (ok) return "Tests OK";
|
35
|
+
}
|
36
|
+
function testTypes() {
|
37
|
+
var golden = [['Integer','keyword'],[' ','null'],['Float','keyword']]
|
38
|
+
var text = "Integer Float";
|
39
|
+
return test(golden,text);
|
40
|
+
}
|
41
|
+
function testIf(){
|
42
|
+
var golden = [['If','keyword'],[' ','null'],['True','keyword'],[' ','null'],['End','keyword'],[' ','null'],['If','keyword']];
|
43
|
+
var text = 'If True End If';
|
44
|
+
return test(golden, text);
|
45
|
+
}
|
46
|
+
function testDecl(){
|
47
|
+
var golden = [['Dim','keyword'],[' ','null'],['x','variable'],[' ','null'],['as','keyword'],[' ','null'],['Integer','keyword']];
|
48
|
+
var text = 'Dim x as Integer';
|
49
|
+
return test(golden, text);
|
50
|
+
}
|
51
|
+
function testAll(){
|
52
|
+
var result = "";
|
53
|
+
|
54
|
+
result += testTypes() + "\n";
|
55
|
+
result += testIf() + "\n";
|
56
|
+
result += testDecl() + "\n";
|
57
|
+
return result;
|
58
|
+
|
59
|
+
}
|
60
|
+
function initText(editor) {
|
61
|
+
var content = 'Class rocket\nPrivate quality as Double\nPublic Sub launch() as String\nif quality > 0.8\nlaunch = "Successful"\nElse\nlaunch = "Failed"\nEnd If\nEnd sub\nEnd class\n';
|
62
|
+
editor.setValue(content);
|
63
|
+
for (var i =0; i< editor.lineCount(); i++) editor.indentLine(i);
|
64
|
+
}
|
65
|
+
function init() {
|
66
|
+
editor = CodeMirror.fromTextArea(document.getElementById("solution"), {
|
67
|
+
lineNumbers: true,
|
68
|
+
mode: "text/x-vb",
|
69
|
+
readOnly: false,
|
70
|
+
tabMode: "shift"
|
71
|
+
});
|
72
|
+
runTest();
|
73
|
+
}
|
74
|
+
function runTest() {
|
75
|
+
document.getElementById('testresult').innerHTML = testAll();
|
76
|
+
initText(editor);
|
77
|
+
|
78
|
+
}
|
79
|
+
</script>
|
80
|
+
|
81
|
+
|
82
|
+
<div id="edit">
|
83
|
+
<textarea style="width:95%;height:200px;padding:5px;" name="solution" id="solution" ></textarea>
|
84
|
+
</div>
|
85
|
+
<pre id="testresult"></pre>
|
86
|
+
<p>MIME type defined: <code>text/x-vb</code>.</p>
|
87
|
+
|
88
|
+
</body></html>
|