gump 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +71 -0
- data/Rakefile +2 -0
- data/bin/gump +37 -0
- data/gump.gemspec +17 -0
- data/lib/gump.rb +50 -0
- data/lib/version.rb +3 -0
- data/server/assets/css/style.css +6949 -0
- data/server/assets/images/arrow.png +0 -0
- data/server/assets/images/logo.png +0 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap-theme.css +347 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap-theme.css.map +1 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap-theme.min.css +7 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap.css +5785 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap.css.map +1 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap.min.css +7 -0
- data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +229 -0
- data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- data/server/assets/js/bootstrap/dist/js/bootstrap.js +1951 -0
- data/server/assets/js/bootstrap/dist/js/bootstrap.min.js +6 -0
- data/server/assets/js/jquery.codemirror/.gitattributes +8 -0
- data/server/assets/js/jquery.codemirror/.gitignore +6 -0
- data/server/assets/js/jquery.codemirror/.travis.yml +3 -0
- data/server/assets/js/jquery.codemirror/AUTHORS +255 -0
- data/server/assets/js/jquery.codemirror/CONTRIBUTING.md +72 -0
- data/server/assets/js/jquery.codemirror/LICENSE +19 -0
- data/server/assets/js/jquery.codemirror/README.md +11 -0
- data/server/assets/js/jquery.codemirror/addon/comment/comment.js +145 -0
- data/server/assets/js/jquery.codemirror/addon/comment/continuecomment.js +54 -0
- data/server/assets/js/jquery.codemirror/addon/dialog/dialog.css +32 -0
- data/server/assets/js/jquery.codemirror/addon/dialog/dialog.js +121 -0
- data/server/assets/js/jquery.codemirror/addon/display/fullscreen.css +6 -0
- data/server/assets/js/jquery.codemirror/addon/display/fullscreen.js +31 -0
- data/server/assets/js/jquery.codemirror/addon/display/placeholder.js +48 -0
- data/server/assets/js/jquery.codemirror/addon/edit/closebrackets.js +82 -0
- data/server/assets/js/jquery.codemirror/addon/edit/closetag.js +89 -0
- data/server/assets/js/jquery.codemirror/addon/edit/continuelist.js +25 -0
- data/server/assets/js/jquery.codemirror/addon/edit/matchbrackets.js +87 -0
- data/server/assets/js/jquery.codemirror/addon/edit/matchtags.js +56 -0
- data/server/assets/js/jquery.codemirror/addon/edit/trailingspace.js +15 -0
- data/server/assets/js/jquery.codemirror/addon/fold/brace-fold.js +93 -0
- data/server/assets/js/jquery.codemirror/addon/fold/comment-fold.js +40 -0
- data/server/assets/js/jquery.codemirror/addon/fold/foldcode.js +75 -0
- data/server/assets/js/jquery.codemirror/addon/fold/foldgutter.css +21 -0
- data/server/assets/js/jquery.codemirror/addon/fold/foldgutter.js +124 -0
- data/server/assets/js/jquery.codemirror/addon/fold/indent-fold.js +30 -0
- data/server/assets/js/jquery.codemirror/addon/fold/xml-fold.js +167 -0
- data/server/assets/js/jquery.codemirror/addon/hint/anyword-hint.js +34 -0
- data/server/assets/js/jquery.codemirror/addon/hint/css-hint.js +50 -0
- data/server/assets/js/jquery.codemirror/addon/hint/html-hint.js +337 -0
- data/server/assets/js/jquery.codemirror/addon/hint/javascript-hint.js +131 -0
- data/server/assets/js/jquery.codemirror/addon/hint/pig-hint.js +121 -0
- data/server/assets/js/jquery.codemirror/addon/hint/python-hint.js +95 -0
- data/server/assets/js/jquery.codemirror/addon/hint/show-hint.css +38 -0
- data/server/assets/js/jquery.codemirror/addon/hint/show-hint.js +286 -0
- data/server/assets/js/jquery.codemirror/addon/hint/sql-hint.js +105 -0
- data/server/assets/js/jquery.codemirror/addon/hint/xml-hint.js +69 -0
- data/server/assets/js/jquery.codemirror/addon/lint/coffeescript-lint.js +27 -0
- data/server/assets/js/jquery.codemirror/addon/lint/css-lint.js +19 -0
- data/server/assets/js/jquery.codemirror/addon/lint/javascript-lint.js +126 -0
- data/server/assets/js/jquery.codemirror/addon/lint/json-lint.js +17 -0
- data/server/assets/js/jquery.codemirror/addon/lint/lint.css +73 -0
- data/server/assets/js/jquery.codemirror/addon/lint/lint.js +203 -0
- data/server/assets/js/jquery.codemirror/addon/merge/dep/diff_match_patch.js +50 -0
- data/server/assets/js/jquery.codemirror/addon/merge/merge.css +92 -0
- data/server/assets/js/jquery.codemirror/addon/merge/merge.js +474 -0
- data/server/assets/js/jquery.codemirror/addon/mode/loadmode.js +51 -0
- data/server/assets/js/jquery.codemirror/addon/mode/multiplex.js +101 -0
- data/server/assets/js/jquery.codemirror/addon/mode/multiplex_test.js +30 -0
- data/server/assets/js/jquery.codemirror/addon/mode/overlay.js +59 -0
- data/server/assets/js/jquery.codemirror/addon/runmode/colorize.js +29 -0
- data/server/assets/js/jquery.codemirror/addon/runmode/runmode-standalone.js +136 -0
- data/server/assets/js/jquery.codemirror/addon/runmode/runmode.js +56 -0
- data/server/assets/js/jquery.codemirror/addon/runmode/runmode.node.js +103 -0
- data/server/assets/js/jquery.codemirror/addon/scroll/scrollpastend.js +34 -0
- data/server/assets/js/jquery.codemirror/addon/search/match-highlighter.js +91 -0
- data/server/assets/js/jquery.codemirror/addon/search/search.js +133 -0
- data/server/assets/js/jquery.codemirror/addon/search/searchcursor.js +143 -0
- data/server/assets/js/jquery.codemirror/addon/selection/active-line.js +39 -0
- data/server/assets/js/jquery.codemirror/addon/selection/mark-selection.js +108 -0
- data/server/assets/js/jquery.codemirror/addon/tern/tern.css +85 -0
- data/server/assets/js/jquery.codemirror/addon/tern/tern.js +632 -0
- data/server/assets/js/jquery.codemirror/addon/tern/worker.js +41 -0
- data/server/assets/js/jquery.codemirror/addon/wrap/hardwrap.js +99 -0
- data/server/assets/js/jquery.codemirror/bin/authors.sh +6 -0
- data/server/assets/js/jquery.codemirror/bin/compress +92 -0
- data/server/assets/js/jquery.codemirror/bin/lint +16 -0
- data/server/assets/js/jquery.codemirror/bin/source-highlight +61 -0
- data/server/assets/js/jquery.codemirror/bower.json +15 -0
- data/server/assets/js/jquery.codemirror/demo/activeline.html +78 -0
- data/server/assets/js/jquery.codemirror/demo/anywordhint.html +79 -0
- data/server/assets/js/jquery.codemirror/demo/bidi.html +74 -0
- data/server/assets/js/jquery.codemirror/demo/btree.html +86 -0
- data/server/assets/js/jquery.codemirror/demo/buffers.html +109 -0
- data/server/assets/js/jquery.codemirror/demo/changemode.html +59 -0
- data/server/assets/js/jquery.codemirror/demo/closebrackets.html +63 -0
- data/server/assets/js/jquery.codemirror/demo/closetag.html +40 -0
- data/server/assets/js/jquery.codemirror/demo/complete.html +80 -0
- data/server/assets/js/jquery.codemirror/demo/emacs.html +75 -0
- data/server/assets/js/jquery.codemirror/demo/folding.html +75 -0
- data/server/assets/js/jquery.codemirror/demo/fullscreen.html +130 -0
- data/server/assets/js/jquery.codemirror/demo/hardwrap.html +69 -0
- data/server/assets/js/jquery.codemirror/demo/html5complete.html +54 -0
- data/server/assets/js/jquery.codemirror/demo/indentwrap.html +58 -0
- data/server/assets/js/jquery.codemirror/demo/lint.html +171 -0
- data/server/assets/js/jquery.codemirror/demo/loadmode.html +49 -0
- data/server/assets/js/jquery.codemirror/demo/marker.html +52 -0
- data/server/assets/js/jquery.codemirror/demo/markselection.html +45 -0
- data/server/assets/js/jquery.codemirror/demo/matchhighlighter.html +47 -0
- data/server/assets/js/jquery.codemirror/demo/matchtags.html +49 -0
- data/server/assets/js/jquery.codemirror/demo/merge.html +82 -0
- data/server/assets/js/jquery.codemirror/demo/multiplex.html +75 -0
- data/server/assets/js/jquery.codemirror/demo/mustache.html +68 -0
- data/server/assets/js/jquery.codemirror/demo/placeholder.html +45 -0
- data/server/assets/js/jquery.codemirror/demo/preview.html +88 -0
- data/server/assets/js/jquery.codemirror/demo/resize.html +58 -0
- data/server/assets/js/jquery.codemirror/demo/runmode.html +62 -0
- data/server/assets/js/jquery.codemirror/demo/search.html +94 -0
- data/server/assets/js/jquery.codemirror/demo/spanaffectswrapping_shim.html +85 -0
- data/server/assets/js/jquery.codemirror/demo/tern.html +129 -0
- data/server/assets/js/jquery.codemirror/demo/theme.html +121 -0
- data/server/assets/js/jquery.codemirror/demo/trailingspace.html +48 -0
- data/server/assets/js/jquery.codemirror/demo/variableheight.html +67 -0
- data/server/assets/js/jquery.codemirror/demo/vim.html +74 -0
- data/server/assets/js/jquery.codemirror/demo/visibletabs.html +62 -0
- data/server/assets/js/jquery.codemirror/demo/widget.html +85 -0
- data/server/assets/js/jquery.codemirror/demo/xmlcomplete.html +116 -0
- data/server/assets/js/jquery.codemirror/index.html +192 -0
- data/server/assets/js/jquery.codemirror/keymap/emacs.js +387 -0
- data/server/assets/js/jquery.codemirror/keymap/extra.js +43 -0
- data/server/assets/js/jquery.codemirror/keymap/vim.js +3703 -0
- data/server/assets/js/jquery.codemirror/lib/codemirror.css +263 -0
- data/server/assets/js/jquery.codemirror/lib/codemirror.js +5944 -0
- data/server/assets/js/jquery.codemirror/mode/apl/apl.js +160 -0
- data/server/assets/js/jquery.codemirror/mode/apl/index.html +72 -0
- data/server/assets/js/jquery.codemirror/mode/asterisk/asterisk.js +183 -0
- data/server/assets/js/jquery.codemirror/mode/asterisk/index.html +154 -0
- data/server/assets/js/jquery.codemirror/mode/clike/clike.js +362 -0
- data/server/assets/js/jquery.codemirror/mode/clike/index.html +195 -0
- data/server/assets/js/jquery.codemirror/mode/clike/scala.html +767 -0
- data/server/assets/js/jquery.codemirror/mode/clojure/clojure.js +224 -0
- data/server/assets/js/jquery.codemirror/mode/clojure/index.html +88 -0
- data/server/assets/js/jquery.codemirror/mode/cobol/cobol.js +240 -0
- data/server/assets/js/jquery.codemirror/mode/cobol/index.html +210 -0
- data/server/assets/js/jquery.codemirror/mode/coffeescript/coffeescript.js +354 -0
- data/server/assets/js/jquery.codemirror/mode/coffeescript/index.html +740 -0
- data/server/assets/js/jquery.codemirror/mode/commonlisp/commonlisp.js +105 -0
- data/server/assets/js/jquery.codemirror/mode/commonlisp/index.html +177 -0
- data/server/assets/js/jquery.codemirror/mode/css/css.js +639 -0
- data/server/assets/js/jquery.codemirror/mode/css/index.html +70 -0
- data/server/assets/js/jquery.codemirror/mode/css/scss.html +157 -0
- data/server/assets/js/jquery.codemirror/mode/css/scss_test.js +93 -0
- data/server/assets/js/jquery.codemirror/mode/css/test.js +142 -0
- data/server/assets/js/jquery.codemirror/mode/d/d.js +205 -0
- data/server/assets/js/jquery.codemirror/mode/d/index.html +273 -0
- data/server/assets/js/jquery.codemirror/mode/diff/diff.js +32 -0
- data/server/assets/js/jquery.codemirror/mode/diff/index.html +117 -0
- data/server/assets/js/jquery.codemirror/mode/dtd/dtd.js +127 -0
- data/server/assets/js/jquery.codemirror/mode/dtd/index.html +89 -0
- data/server/assets/js/jquery.codemirror/mode/ecl/ecl.js +192 -0
- data/server/assets/js/jquery.codemirror/mode/ecl/index.html +52 -0
- data/server/assets/js/jquery.codemirror/mode/eiffel/eiffel.js +147 -0
- data/server/assets/js/jquery.codemirror/mode/eiffel/index.html +430 -0
- data/server/assets/js/jquery.codemirror/mode/erlang/erlang.js +484 -0
- data/server/assets/js/jquery.codemirror/mode/erlang/index.html +75 -0
- data/server/assets/js/jquery.codemirror/mode/fortran/fortran.js +173 -0
- data/server/assets/js/jquery.codemirror/mode/fortran/index.html +81 -0
- data/server/assets/js/jquery.codemirror/mode/gas/gas.js +330 -0
- data/server/assets/js/jquery.codemirror/mode/gas/index.html +68 -0
- data/server/assets/js/jquery.codemirror/mode/gfm/gfm.js +97 -0
- data/server/assets/js/jquery.codemirror/mode/gfm/index.html +82 -0
- data/server/assets/js/jquery.codemirror/mode/gfm/test.js +112 -0
- data/server/assets/js/jquery.codemirror/mode/gherkin/gherkin.js +168 -0
- data/server/assets/js/jquery.codemirror/mode/gherkin/index.html +48 -0
- data/server/assets/js/jquery.codemirror/mode/go/go.js +168 -0
- data/server/assets/js/jquery.codemirror/mode/go/index.html +85 -0
- data/server/assets/js/jquery.codemirror/mode/groovy/groovy.js +211 -0
- data/server/assets/js/jquery.codemirror/mode/groovy/index.html +84 -0
- data/server/assets/js/jquery.codemirror/mode/haml/haml.js +153 -0
- data/server/assets/js/jquery.codemirror/mode/haml/index.html +79 -0
- data/server/assets/js/jquery.codemirror/mode/haml/test.js +94 -0
- data/server/assets/js/jquery.codemirror/mode/haskell/haskell.js +250 -0
- data/server/assets/js/jquery.codemirror/mode/haskell/index.html +73 -0
- data/server/assets/js/jquery.codemirror/mode/haxe/haxe.js +429 -0
- data/server/assets/js/jquery.codemirror/mode/haxe/index.html +103 -0
- data/server/assets/js/jquery.codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/server/assets/js/jquery.codemirror/mode/htmlembedded/index.html +60 -0
- data/server/assets/js/jquery.codemirror/mode/htmlmixed/htmlmixed.js +104 -0
- data/server/assets/js/jquery.codemirror/mode/htmlmixed/index.html +85 -0
- data/server/assets/js/jquery.codemirror/mode/http/http.js +98 -0
- data/server/assets/js/jquery.codemirror/mode/http/index.html +45 -0
- data/server/assets/js/jquery.codemirror/mode/index.html +114 -0
- data/server/assets/js/jquery.codemirror/mode/jade/index.html +66 -0
- data/server/assets/js/jquery.codemirror/mode/jade/jade.js +90 -0
- data/server/assets/js/jquery.codemirror/mode/javascript/index.html +107 -0
- data/server/assets/js/jquery.codemirror/mode/javascript/javascript.js +617 -0
- data/server/assets/js/jquery.codemirror/mode/javascript/test.js +72 -0
- data/server/assets/js/jquery.codemirror/mode/javascript/typescript.html +61 -0
- data/server/assets/js/jquery.codemirror/mode/jinja2/index.html +50 -0
- data/server/assets/js/jquery.codemirror/mode/jinja2/jinja2.js +42 -0
- data/server/assets/js/jquery.codemirror/mode/julia/index.html +187 -0
- data/server/assets/js/jquery.codemirror/mode/julia/julia.js +262 -0
- data/server/assets/js/jquery.codemirror/mode/less/index.html +753 -0
- data/server/assets/js/jquery.codemirror/mode/less/less.js +346 -0
- data/server/assets/js/jquery.codemirror/mode/livescript/index.html +459 -0
- data/server/assets/js/jquery.codemirror/mode/livescript/livescript.js +267 -0
- data/server/assets/js/jquery.codemirror/mode/livescript/livescript.ls +266 -0
- data/server/assets/js/jquery.codemirror/mode/lua/index.html +86 -0
- data/server/assets/js/jquery.codemirror/mode/lua/lua.js +144 -0
- data/server/assets/js/jquery.codemirror/mode/markdown/index.html +359 -0
- data/server/assets/js/jquery.codemirror/mode/markdown/markdown.js +560 -0
- data/server/assets/js/jquery.codemirror/mode/markdown/test.js +664 -0
- data/server/assets/js/jquery.codemirror/mode/meta.js +91 -0
- data/server/assets/js/jquery.codemirror/mode/mirc/index.html +161 -0
- data/server/assets/js/jquery.codemirror/mode/mirc/mirc.js +177 -0
- data/server/assets/js/jquery.codemirror/mode/nginx/index.html +181 -0
- data/server/assets/js/jquery.codemirror/mode/nginx/nginx.js +163 -0
- data/server/assets/js/jquery.codemirror/mode/ntriples/index.html +45 -0
- data/server/assets/js/jquery.codemirror/mode/ntriples/ntriples.js +170 -0
- data/server/assets/js/jquery.codemirror/mode/ocaml/index.html +146 -0
- data/server/assets/js/jquery.codemirror/mode/ocaml/ocaml.js +116 -0
- data/server/assets/js/jquery.codemirror/mode/octave/index.html +95 -0
- data/server/assets/js/jquery.codemirror/mode/octave/octave.js +118 -0
- data/server/assets/js/jquery.codemirror/mode/pascal/index.html +61 -0
- data/server/assets/js/jquery.codemirror/mode/pascal/pascal.js +94 -0
- data/server/assets/js/jquery.codemirror/mode/pegjs/index.html +66 -0
- data/server/assets/js/jquery.codemirror/mode/pegjs/pegjs.js +103 -0
- data/server/assets/js/jquery.codemirror/mode/perl/index.html +75 -0
- data/server/assets/js/jquery.codemirror/mode/perl/perl.js +816 -0
- data/server/assets/js/jquery.codemirror/mode/php/index.html +62 -0
- data/server/assets/js/jquery.codemirror/mode/php/php.js +132 -0
- data/server/assets/js/jquery.codemirror/mode/pig/index.html +55 -0
- data/server/assets/js/jquery.codemirror/mode/pig/pig.js +171 -0
- data/server/assets/js/jquery.codemirror/mode/properties/index.html +53 -0
- data/server/assets/js/jquery.codemirror/mode/properties/properties.js +63 -0
- data/server/assets/js/jquery.codemirror/mode/python/index.html +187 -0
- data/server/assets/js/jquery.codemirror/mode/python/python.js +368 -0
- data/server/assets/js/jquery.codemirror/mode/q/index.html +144 -0
- data/server/assets/js/jquery.codemirror/mode/q/q.js +124 -0
- data/server/assets/js/jquery.codemirror/mode/r/index.html +86 -0
- data/server/assets/js/jquery.codemirror/mode/r/r.js +141 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/changes/changes.js +19 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/changes/index.html +67 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/spec/index.html +114 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/spec/spec.css +5 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/spec/spec.js +66 -0
- data/server/assets/js/jquery.codemirror/mode/rst/index.html +534 -0
- data/server/assets/js/jquery.codemirror/mode/rst/rst.js +560 -0
- data/server/assets/js/jquery.codemirror/mode/ruby/index.html +185 -0
- data/server/assets/js/jquery.codemirror/mode/ruby/ruby.js +247 -0
- data/server/assets/js/jquery.codemirror/mode/rust/index.html +61 -0
- data/server/assets/js/jquery.codemirror/mode/rust/rust.js +436 -0
- data/server/assets/js/jquery.codemirror/mode/sass/index.html +66 -0
- data/server/assets/js/jquery.codemirror/mode/sass/sass.js +330 -0
- data/server/assets/js/jquery.codemirror/mode/scheme/index.html +77 -0
- data/server/assets/js/jquery.codemirror/mode/scheme/scheme.js +232 -0
- data/server/assets/js/jquery.codemirror/mode/shell/index.html +66 -0
- data/server/assets/js/jquery.codemirror/mode/shell/shell.js +118 -0
- data/server/assets/js/jquery.codemirror/mode/sieve/index.html +93 -0
- data/server/assets/js/jquery.codemirror/mode/sieve/sieve.js +183 -0
- data/server/assets/js/jquery.codemirror/mode/smalltalk/index.html +68 -0
- data/server/assets/js/jquery.codemirror/mode/smalltalk/smalltalk.js +151 -0
- data/server/assets/js/jquery.codemirror/mode/smarty/index.html +136 -0
- data/server/assets/js/jquery.codemirror/mode/smarty/smarty.js +205 -0
- data/server/assets/js/jquery.codemirror/mode/smartymixed/index.html +114 -0
- data/server/assets/js/jquery.codemirror/mode/smartymixed/smartymixed.js +175 -0
- data/server/assets/js/jquery.codemirror/mode/sparql/index.html +54 -0
- data/server/assets/js/jquery.codemirror/mode/sparql/sparql.js +145 -0
- data/server/assets/js/jquery.codemirror/mode/sql/index.html +75 -0
- data/server/assets/js/jquery.codemirror/mode/sql/sql.js +365 -0
- data/server/assets/js/jquery.codemirror/mode/stex/index.html +110 -0
- data/server/assets/js/jquery.codemirror/mode/stex/stex.js +246 -0
- data/server/assets/js/jquery.codemirror/mode/stex/test.js +120 -0
- data/server/assets/js/jquery.codemirror/mode/tcl/index.html +143 -0
- data/server/assets/js/jquery.codemirror/mode/tcl/tcl.js +131 -0
- data/server/assets/js/jquery.codemirror/mode/tiddlywiki/index.html +155 -0
- data/server/assets/js/jquery.codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/server/assets/js/jquery.codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/server/assets/js/jquery.codemirror/mode/tiki/index.html +95 -0
- data/server/assets/js/jquery.codemirror/mode/tiki/tiki.css +26 -0
- data/server/assets/js/jquery.codemirror/mode/tiki/tiki.js +308 -0
- data/server/assets/js/jquery.codemirror/mode/toml/index.html +73 -0
- data/server/assets/js/jquery.codemirror/mode/toml/toml.js +71 -0
- data/server/assets/js/jquery.codemirror/mode/turtle/index.html +51 -0
- data/server/assets/js/jquery.codemirror/mode/turtle/turtle.js +145 -0
- data/server/assets/js/jquery.codemirror/mode/vb/index.html +103 -0
- data/server/assets/js/jquery.codemirror/mode/vb/vb.js +259 -0
- data/server/assets/js/jquery.codemirror/mode/vbscript/index.html +55 -0
- data/server/assets/js/jquery.codemirror/mode/vbscript/vbscript.js +334 -0
- data/server/assets/js/jquery.codemirror/mode/velocity/index.html +119 -0
- data/server/assets/js/jquery.codemirror/mode/velocity/velocity.js +186 -0
- data/server/assets/js/jquery.codemirror/mode/verilog/index.html +132 -0
- data/server/assets/js/jquery.codemirror/mode/verilog/verilog.js +182 -0
- data/server/assets/js/jquery.codemirror/mode/xml/index.html +57 -0
- data/server/assets/js/jquery.codemirror/mode/xml/xml.js +345 -0
- data/server/assets/js/jquery.codemirror/mode/xquery/index.html +210 -0
- data/server/assets/js/jquery.codemirror/mode/xquery/test.js +64 -0
- data/server/assets/js/jquery.codemirror/mode/xquery/xquery.js +432 -0
- data/server/assets/js/jquery.codemirror/mode/yaml/index.html +80 -0
- data/server/assets/js/jquery.codemirror/mode/yaml/yaml.js +97 -0
- data/server/assets/js/jquery.codemirror/mode/z80/index.html +52 -0
- data/server/assets/js/jquery.codemirror/mode/z80/z80.js +85 -0
- data/server/assets/js/jquery.codemirror/package.json +19 -0
- data/server/assets/js/jquery.codemirror/test/comment_test.js +51 -0
- data/server/assets/js/jquery.codemirror/test/doc_test.js +329 -0
- data/server/assets/js/jquery.codemirror/test/driver.js +139 -0
- data/server/assets/js/jquery.codemirror/test/emacs_test.js +135 -0
- data/server/assets/js/jquery.codemirror/test/index.html +209 -0
- data/server/assets/js/jquery.codemirror/test/lint/acorn.js +1593 -0
- data/server/assets/js/jquery.codemirror/test/lint/lint.js +139 -0
- data/server/assets/js/jquery.codemirror/test/lint/walk.js +216 -0
- data/server/assets/js/jquery.codemirror/test/mode_test.css +10 -0
- data/server/assets/js/jquery.codemirror/test/mode_test.js +200 -0
- data/server/assets/js/jquery.codemirror/test/phantom_driver.js +31 -0
- data/server/assets/js/jquery.codemirror/test/run.js +34 -0
- data/server/assets/js/jquery.codemirror/test/test.js +1562 -0
- data/server/assets/js/jquery.codemirror/test/vim_test.js +2391 -0
- data/server/assets/js/jquery.codemirror/theme/3024-day.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/3024-night.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/ambiance-mobile.css +5 -0
- data/server/assets/js/jquery.codemirror/theme/ambiance.css +70 -0
- data/server/assets/js/jquery.codemirror/theme/base16-dark.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/base16-light.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/blackboard.css +28 -0
- data/server/assets/js/jquery.codemirror/theme/cobalt.css +21 -0
- data/server/assets/js/jquery.codemirror/theme/eclipse.css +23 -0
- data/server/assets/js/jquery.codemirror/theme/elegant.css +13 -0
- data/server/assets/js/jquery.codemirror/theme/erlang-dark.css +30 -0
- data/server/assets/js/jquery.codemirror/theme/lesser-dark.css +47 -0
- data/server/assets/js/jquery.codemirror/theme/mbo.css +37 -0
- data/server/assets/js/jquery.codemirror/theme/midnight.css +43 -0
- data/server/assets/js/jquery.codemirror/theme/monokai.css +29 -0
- data/server/assets/js/jquery.codemirror/theme/neat.css +12 -0
- data/server/assets/js/jquery.codemirror/theme/night.css +24 -0
- data/server/assets/js/jquery.codemirror/theme/paraiso-dark.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/paraiso-light.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/rubyblue.css +23 -0
- data/server/assets/js/jquery.codemirror/theme/solarized.css +180 -0
- data/server/assets/js/jquery.codemirror/theme/the-matrix.css +26 -0
- data/server/assets/js/jquery.codemirror/theme/tomorrow-night-eighties.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/twilight.css +28 -0
- data/server/assets/js/jquery.codemirror/theme/vibrant-ink.css +30 -0
- data/server/assets/js/jquery.codemirror/theme/xq-dark.css +49 -0
- data/server/assets/js/jquery.codemirror/theme/xq-light.css +43 -0
- data/server/assets/js/jquery.js +4 -0
- data/server/assets/js/jquery.nanoscroller/jquery.nanoscroller.js +2 -0
- data/server/assets/js/jquery.nanoscroller/nanoscroller.css +49 -0
- data/server/assets/js/tester.js +161 -0
- data/server/config.ru +2 -0
- data/server/server.rb +41 -0
- data/server/views/_content.erb +65 -0
- data/server/views/_sidebar.erb +32 -0
- data/server/views/index.erb +40 -0
- metadata +402 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var listRE = /^(\s*)([*+-]|(\d+)\.)(\s*)/,
|
|
5
|
+
unorderedBullets = '*+-';
|
|
6
|
+
|
|
7
|
+
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
|
|
8
|
+
var pos = cm.getCursor(),
|
|
9
|
+
inList = cm.getStateAfter(pos.line).list !== false,
|
|
10
|
+
match;
|
|
11
|
+
|
|
12
|
+
if (!inList || !(match = cm.getLine(pos.line).match(listRE))) {
|
|
13
|
+
cm.execCommand('newlineAndIndent');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var indent = match[1], after = match[4];
|
|
18
|
+
var bullet = unorderedBullets.indexOf(match[2]) >= 0
|
|
19
|
+
? match[2]
|
|
20
|
+
: (parseInt(match[3], 10) + 1) + '.';
|
|
21
|
+
|
|
22
|
+
cm.replaceSelection('\n' + indent + bullet + after, 'end');
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
}());
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
|
3
|
+
(document.documentMode == null || document.documentMode < 8);
|
|
4
|
+
|
|
5
|
+
var Pos = CodeMirror.Pos;
|
|
6
|
+
|
|
7
|
+
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
|
8
|
+
function findMatchingBracket(cm, where, strict) {
|
|
9
|
+
var state = cm.state.matchBrackets;
|
|
10
|
+
var maxScanLen = (state && state.maxScanLineLength) || 10000;
|
|
11
|
+
var maxScanLines = (state && state.maxScanLines) || 100;
|
|
12
|
+
|
|
13
|
+
var cur = where || cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;
|
|
14
|
+
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
|
15
|
+
if (!match) return null;
|
|
16
|
+
var forward = match.charAt(1) == ">", d = forward ? 1 : -1;
|
|
17
|
+
if (strict && forward != (pos == cur.ch)) return null;
|
|
18
|
+
var style = cm.getTokenTypeAt(Pos(cur.line, pos + 1));
|
|
19
|
+
|
|
20
|
+
var stack = [line.text.charAt(pos)], re = /[(){}[\]]/;
|
|
21
|
+
function scan(line, lineNo, start) {
|
|
22
|
+
if (!line.text) return;
|
|
23
|
+
var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1;
|
|
24
|
+
if (line.text.length > maxScanLen) return null;
|
|
25
|
+
if (start != null) pos = start + d;
|
|
26
|
+
for (; pos != end; pos += d) {
|
|
27
|
+
var ch = line.text.charAt(pos);
|
|
28
|
+
if (re.test(ch) && cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style) {
|
|
29
|
+
var match = matching[ch];
|
|
30
|
+
if (match.charAt(1) == ">" == forward) stack.push(ch);
|
|
31
|
+
else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false};
|
|
32
|
+
else if (!stack.length) return {pos: pos, match: true};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
for (var i = cur.line, found, e = forward ? Math.min(i + maxScanLines, cm.lineCount()) : Math.max(-1, i - maxScanLines); i != e; i+=d) {
|
|
37
|
+
if (i == cur.line) found = scan(line, i, pos);
|
|
38
|
+
else found = scan(cm.getLineHandle(i), i);
|
|
39
|
+
if (found) break;
|
|
40
|
+
}
|
|
41
|
+
return {from: Pos(cur.line, pos), to: found && Pos(i, found.pos),
|
|
42
|
+
match: found && found.match, forward: forward};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function matchBrackets(cm, autoclear) {
|
|
46
|
+
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
|
47
|
+
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
|
48
|
+
var found = findMatchingBracket(cm);
|
|
49
|
+
if (!found || cm.getLine(found.from.line).length > maxHighlightLen ||
|
|
50
|
+
found.to && cm.getLine(found.to.line).length > maxHighlightLen)
|
|
51
|
+
return;
|
|
52
|
+
|
|
53
|
+
var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
|
54
|
+
var one = cm.markText(found.from, Pos(found.from.line, found.from.ch + 1), {className: style});
|
|
55
|
+
var two = found.to && cm.markText(found.to, Pos(found.to.line, found.to.ch + 1), {className: style});
|
|
56
|
+
// Kludge to work around the IE bug from issue #1193, where text
|
|
57
|
+
// input stops going to the textare whever this fires.
|
|
58
|
+
if (ie_lt8 && cm.state.focused) cm.display.input.focus();
|
|
59
|
+
var clear = function() {
|
|
60
|
+
cm.operation(function() { one.clear(); two && two.clear(); });
|
|
61
|
+
};
|
|
62
|
+
if (autoclear) setTimeout(clear, 800);
|
|
63
|
+
else return clear;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var currentlyHighlighted = null;
|
|
67
|
+
function doMatchBrackets(cm) {
|
|
68
|
+
cm.operation(function() {
|
|
69
|
+
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
|
70
|
+
if (!cm.somethingSelected()) currentlyHighlighted = matchBrackets(cm, false);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
|
75
|
+
if (old && old != CodeMirror.Init)
|
|
76
|
+
cm.off("cursorActivity", doMatchBrackets);
|
|
77
|
+
if (val) {
|
|
78
|
+
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
|
79
|
+
cm.on("cursorActivity", doMatchBrackets);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
|
84
|
+
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict){
|
|
85
|
+
return findMatchingBracket(this, pos, strict);
|
|
86
|
+
});
|
|
87
|
+
})();
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
|
|
5
|
+
if (old && old != CodeMirror.Init) {
|
|
6
|
+
cm.off("cursorActivity", doMatchTags);
|
|
7
|
+
cm.off("viewportChange", maybeUpdateMatch);
|
|
8
|
+
clear(cm);
|
|
9
|
+
}
|
|
10
|
+
if (val) {
|
|
11
|
+
cm.state.matchBothTags = typeof val == "object" && val.bothTags;
|
|
12
|
+
cm.on("cursorActivity", doMatchTags);
|
|
13
|
+
cm.on("viewportChange", maybeUpdateMatch);
|
|
14
|
+
doMatchTags(cm);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
function clear(cm) {
|
|
19
|
+
if (cm.state.tagHit) cm.state.tagHit.clear();
|
|
20
|
+
if (cm.state.tagOther) cm.state.tagOther.clear();
|
|
21
|
+
cm.state.tagHit = cm.state.tagOther = null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function doMatchTags(cm) {
|
|
25
|
+
cm.state.failedTagMatch = false;
|
|
26
|
+
cm.operation(function() {
|
|
27
|
+
clear(cm);
|
|
28
|
+
if (cm.somethingSelected()) return;
|
|
29
|
+
var cur = cm.getCursor(), range = cm.getViewport();
|
|
30
|
+
range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
|
|
31
|
+
var match = CodeMirror.findMatchingTag(cm, cur, range);
|
|
32
|
+
if (!match) return;
|
|
33
|
+
if (cm.state.matchBothTags) {
|
|
34
|
+
var hit = match.at == "open" ? match.open : match.close;
|
|
35
|
+
if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"});
|
|
36
|
+
}
|
|
37
|
+
var other = match.at == "close" ? match.open : match.close;
|
|
38
|
+
if (other)
|
|
39
|
+
cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
|
|
40
|
+
else
|
|
41
|
+
cm.state.failedTagMatch = true;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function maybeUpdateMatch(cm) {
|
|
46
|
+
if (cm.state.failedTagMatch) doMatchTags(cm);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
CodeMirror.commands.toMatchingTag = function(cm) {
|
|
50
|
+
var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
|
|
51
|
+
if (found) {
|
|
52
|
+
var other = found.at == "close" ? found.open : found.close;
|
|
53
|
+
if (other) cm.setSelection(other.to, other.from);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
})();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
|
|
2
|
+
if (prev == CodeMirror.Init) prev = false;
|
|
3
|
+
if (prev && !val)
|
|
4
|
+
cm.removeOverlay("trailingspace");
|
|
5
|
+
else if (!prev && val)
|
|
6
|
+
cm.addOverlay({
|
|
7
|
+
token: function(stream) {
|
|
8
|
+
for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
|
|
9
|
+
if (i > stream.pos) { stream.pos = i; return null; }
|
|
10
|
+
stream.pos = l;
|
|
11
|
+
return "trailingspace";
|
|
12
|
+
},
|
|
13
|
+
name: "trailingspace"
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
CodeMirror.registerHelper("fold", "brace", function(cm, start) {
|
|
2
|
+
var line = start.line, lineText = cm.getLine(line);
|
|
3
|
+
var startCh, tokenType;
|
|
4
|
+
|
|
5
|
+
function findOpening(openCh) {
|
|
6
|
+
for (var at = start.ch, pass = 0;;) {
|
|
7
|
+
var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1);
|
|
8
|
+
if (found == -1) {
|
|
9
|
+
if (pass == 1) break;
|
|
10
|
+
pass = 1;
|
|
11
|
+
at = lineText.length;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (pass == 1 && found < start.ch) break;
|
|
15
|
+
tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
|
|
16
|
+
if (!/^(comment|string)/.test(tokenType)) return found + 1;
|
|
17
|
+
at = found - 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var startToken = "{", endToken = "}", startCh = findOpening("{");
|
|
22
|
+
if (startCh == null) {
|
|
23
|
+
startToken = "[", endToken = "]";
|
|
24
|
+
startCh = findOpening("[");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (startCh == null) return;
|
|
28
|
+
var count = 1, lastLine = cm.lastLine(), end, endCh;
|
|
29
|
+
outer: for (var i = line; i <= lastLine; ++i) {
|
|
30
|
+
var text = cm.getLine(i), pos = i == line ? startCh : 0;
|
|
31
|
+
for (;;) {
|
|
32
|
+
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
|
|
33
|
+
if (nextOpen < 0) nextOpen = text.length;
|
|
34
|
+
if (nextClose < 0) nextClose = text.length;
|
|
35
|
+
pos = Math.min(nextOpen, nextClose);
|
|
36
|
+
if (pos == text.length) break;
|
|
37
|
+
if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) {
|
|
38
|
+
if (pos == nextOpen) ++count;
|
|
39
|
+
else if (!--count) { end = i; endCh = pos; break outer; }
|
|
40
|
+
}
|
|
41
|
+
++pos;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (end == null || line == end && endCh == startCh) return;
|
|
45
|
+
return {from: CodeMirror.Pos(line, startCh),
|
|
46
|
+
to: CodeMirror.Pos(end, endCh)};
|
|
47
|
+
});
|
|
48
|
+
CodeMirror.braceRangeFinder = CodeMirror.fold.brace; // deprecated
|
|
49
|
+
|
|
50
|
+
CodeMirror.registerHelper("fold", "import", function(cm, start) {
|
|
51
|
+
function hasImport(line) {
|
|
52
|
+
if (line < cm.firstLine() || line > cm.lastLine()) return null;
|
|
53
|
+
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
|
|
54
|
+
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
|
|
55
|
+
if (start.type != "keyword" || start.string != "import") return null;
|
|
56
|
+
// Now find closing semicolon, return its position
|
|
57
|
+
for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) {
|
|
58
|
+
var text = cm.getLine(i), semi = text.indexOf(";");
|
|
59
|
+
if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var start = start.line, has = hasImport(start), prev;
|
|
64
|
+
if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1))
|
|
65
|
+
return null;
|
|
66
|
+
for (var end = has.end;;) {
|
|
67
|
+
var next = hasImport(end.line + 1);
|
|
68
|
+
if (next == null) break;
|
|
69
|
+
end = next.end;
|
|
70
|
+
}
|
|
71
|
+
return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end};
|
|
72
|
+
});
|
|
73
|
+
CodeMirror.importRangeFinder = CodeMirror.fold["import"]; // deprecated
|
|
74
|
+
|
|
75
|
+
CodeMirror.registerHelper("fold", "include", function(cm, start) {
|
|
76
|
+
function hasInclude(line) {
|
|
77
|
+
if (line < cm.firstLine() || line > cm.lastLine()) return null;
|
|
78
|
+
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
|
|
79
|
+
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
|
|
80
|
+
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var start = start.line, has = hasInclude(start);
|
|
84
|
+
if (has == null || hasInclude(start - 1) != null) return null;
|
|
85
|
+
for (var end = start;;) {
|
|
86
|
+
var next = hasInclude(end + 1);
|
|
87
|
+
if (next == null) break;
|
|
88
|
+
++end;
|
|
89
|
+
}
|
|
90
|
+
return {from: CodeMirror.Pos(start, has + 1),
|
|
91
|
+
to: cm.clipPos(CodeMirror.Pos(end))};
|
|
92
|
+
});
|
|
93
|
+
CodeMirror.includeRangeFinder = CodeMirror.fold.include; // deprecated
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
CodeMirror.registerHelper("fold", "comment", function(cm, start) {
|
|
2
|
+
var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd;
|
|
3
|
+
if (!startToken || !endToken) return;
|
|
4
|
+
var line = start.line, lineText = cm.getLine(line);
|
|
5
|
+
|
|
6
|
+
var startCh;
|
|
7
|
+
for (var at = start.ch, pass = 0;;) {
|
|
8
|
+
var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1);
|
|
9
|
+
if (found == -1) {
|
|
10
|
+
if (pass == 1) return;
|
|
11
|
+
pass = 1;
|
|
12
|
+
at = lineText.length;
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
if (pass == 1 && found < start.ch) return;
|
|
16
|
+
if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) {
|
|
17
|
+
startCh = found + startToken.length;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
at = found - 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var depth = 1, lastLine = cm.lastLine(), end, endCh;
|
|
24
|
+
outer: for (var i = line; i <= lastLine; ++i) {
|
|
25
|
+
var text = cm.getLine(i), pos = i == line ? startCh : 0;
|
|
26
|
+
for (;;) {
|
|
27
|
+
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
|
|
28
|
+
if (nextOpen < 0) nextOpen = text.length;
|
|
29
|
+
if (nextClose < 0) nextClose = text.length;
|
|
30
|
+
pos = Math.min(nextOpen, nextClose);
|
|
31
|
+
if (pos == text.length) break;
|
|
32
|
+
if (pos == nextOpen) ++depth;
|
|
33
|
+
else if (!--depth) { end = i; endCh = pos; break outer; }
|
|
34
|
+
++pos;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (end == null || line == end && endCh == startCh) return;
|
|
38
|
+
return {from: CodeMirror.Pos(line, startCh),
|
|
39
|
+
to: CodeMirror.Pos(end, endCh)};
|
|
40
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
function doFold(cm, pos, options, force) {
|
|
5
|
+
var finder = options && (options.call ? options : options.rangeFinder);
|
|
6
|
+
if (!finder) finder = cm.getHelper(pos, "fold");
|
|
7
|
+
if (!finder) return;
|
|
8
|
+
if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
|
|
9
|
+
var minSize = options && options.minFoldSize || 0;
|
|
10
|
+
|
|
11
|
+
function getRange(allowFolded) {
|
|
12
|
+
var range = finder(cm, pos);
|
|
13
|
+
if (!range || range.to.line - range.from.line < minSize) return null;
|
|
14
|
+
var marks = cm.findMarksAt(range.from);
|
|
15
|
+
for (var i = 0; i < marks.length; ++i) {
|
|
16
|
+
if (marks[i].__isFold && force !== "fold") {
|
|
17
|
+
if (!allowFolded) return null;
|
|
18
|
+
range.cleared = true;
|
|
19
|
+
marks[i].clear();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return range;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var range = getRange(true);
|
|
26
|
+
if (options && options.scanUp) while (!range && pos.line > cm.firstLine()) {
|
|
27
|
+
pos = CodeMirror.Pos(pos.line - 1, 0);
|
|
28
|
+
range = getRange(false);
|
|
29
|
+
}
|
|
30
|
+
if (!range || range.cleared || force === "unfold") return;
|
|
31
|
+
|
|
32
|
+
var myWidget = makeWidget(options);
|
|
33
|
+
CodeMirror.on(myWidget, "mousedown", function() { myRange.clear(); });
|
|
34
|
+
var myRange = cm.markText(range.from, range.to, {
|
|
35
|
+
replacedWith: myWidget,
|
|
36
|
+
clearOnEnter: true,
|
|
37
|
+
__isFold: true
|
|
38
|
+
});
|
|
39
|
+
myRange.on("clear", function(from, to) {
|
|
40
|
+
CodeMirror.signal(cm, "unfold", cm, from, to);
|
|
41
|
+
});
|
|
42
|
+
CodeMirror.signal(cm, "fold", cm, range.from, range.to);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function makeWidget(options) {
|
|
46
|
+
var widget = (options && options.widget) || "\u2194";
|
|
47
|
+
if (typeof widget == "string") {
|
|
48
|
+
var text = document.createTextNode(widget);
|
|
49
|
+
widget = document.createElement("span");
|
|
50
|
+
widget.appendChild(text);
|
|
51
|
+
widget.className = "CodeMirror-foldmarker";
|
|
52
|
+
}
|
|
53
|
+
return widget;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Clumsy backwards-compatible interface
|
|
57
|
+
CodeMirror.newFoldFunction = function(rangeFinder, widget) {
|
|
58
|
+
return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// New-style interface
|
|
62
|
+
CodeMirror.defineExtension("foldCode", function(pos, options, force) {
|
|
63
|
+
doFold(this, pos, options, force);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
CodeMirror.registerHelper("fold", "combine", function() {
|
|
67
|
+
var funcs = Array.prototype.slice.call(arguments, 0);
|
|
68
|
+
return function(cm, start) {
|
|
69
|
+
for (var i = 0; i < funcs.length; ++i) {
|
|
70
|
+
var found = funcs[i](cm, start);
|
|
71
|
+
if (found) return found;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
})();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.CodeMirror-foldmarker {
|
|
2
|
+
color: blue;
|
|
3
|
+
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
|
|
4
|
+
font-family: arial;
|
|
5
|
+
line-height: .3;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
}
|
|
8
|
+
.CodeMirror-foldgutter {
|
|
9
|
+
width: .7em;
|
|
10
|
+
}
|
|
11
|
+
.CodeMirror-foldgutter-open,
|
|
12
|
+
.CodeMirror-foldgutter-folded {
|
|
13
|
+
color: #555;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
.CodeMirror-foldgutter-open:after {
|
|
17
|
+
content: "\25BE";
|
|
18
|
+
}
|
|
19
|
+
.CodeMirror-foldgutter-folded:after {
|
|
20
|
+
content: "\25B8";
|
|
21
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
CodeMirror.defineOption("foldGutter", false, function(cm, val, old) {
|
|
5
|
+
if (old && old != CodeMirror.Init) {
|
|
6
|
+
cm.clearGutter(cm.state.foldGutter.options.gutter);
|
|
7
|
+
cm.state.foldGutter = null;
|
|
8
|
+
cm.off("gutterClick", onGutterClick);
|
|
9
|
+
cm.off("change", onChange);
|
|
10
|
+
cm.off("viewportChange", onViewportChange);
|
|
11
|
+
cm.off("fold", onFold);
|
|
12
|
+
cm.off("unfold", onFold);
|
|
13
|
+
cm.off("swapDoc", updateInViewport);
|
|
14
|
+
}
|
|
15
|
+
if (val) {
|
|
16
|
+
cm.state.foldGutter = new State(parseOptions(val));
|
|
17
|
+
updateInViewport(cm);
|
|
18
|
+
cm.on("gutterClick", onGutterClick);
|
|
19
|
+
cm.on("change", onChange);
|
|
20
|
+
cm.on("viewportChange", onViewportChange);
|
|
21
|
+
cm.on("fold", onFold);
|
|
22
|
+
cm.on("unfold", onFold);
|
|
23
|
+
cm.on("swapDoc", updateInViewport);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var Pos = CodeMirror.Pos;
|
|
28
|
+
|
|
29
|
+
function State(options) {
|
|
30
|
+
this.options = options;
|
|
31
|
+
this.from = this.to = 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function parseOptions(opts) {
|
|
35
|
+
if (opts === true) opts = {};
|
|
36
|
+
if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter";
|
|
37
|
+
if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open";
|
|
38
|
+
if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded";
|
|
39
|
+
return opts;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function isFolded(cm, line) {
|
|
43
|
+
var marks = cm.findMarksAt(Pos(line));
|
|
44
|
+
for (var i = 0; i < marks.length; ++i)
|
|
45
|
+
if (marks[i].__isFold && marks[i].find().from.line == line) return true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function marker(spec) {
|
|
49
|
+
if (typeof spec == "string") {
|
|
50
|
+
var elt = document.createElement("div");
|
|
51
|
+
elt.className = spec;
|
|
52
|
+
return elt;
|
|
53
|
+
} else {
|
|
54
|
+
return spec.cloneNode(true);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function updateFoldInfo(cm, from, to) {
|
|
59
|
+
var opts = cm.state.foldGutter.options, cur = from;
|
|
60
|
+
cm.eachLine(from, to, function(line) {
|
|
61
|
+
var mark = null;
|
|
62
|
+
if (isFolded(cm, cur)) {
|
|
63
|
+
mark = marker(opts.indicatorFolded);
|
|
64
|
+
} else {
|
|
65
|
+
var pos = Pos(cur, 0), func = opts.rangeFinder || cm.getHelper(pos, "fold");
|
|
66
|
+
var range = func && func(cm, pos);
|
|
67
|
+
if (range && range.from.line + 1 < range.to.line)
|
|
68
|
+
mark = marker(opts.indicatorOpen);
|
|
69
|
+
}
|
|
70
|
+
cm.setGutterMarker(line, opts.gutter, mark);
|
|
71
|
+
++cur;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function updateInViewport(cm) {
|
|
76
|
+
var vp = cm.getViewport(), state = cm.state.foldGutter;
|
|
77
|
+
if (!state) return;
|
|
78
|
+
cm.operation(function() {
|
|
79
|
+
updateFoldInfo(cm, vp.from, vp.to);
|
|
80
|
+
});
|
|
81
|
+
state.from = vp.from; state.to = vp.to;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function onGutterClick(cm, line, gutter) {
|
|
85
|
+
var opts = cm.state.foldGutter.options;
|
|
86
|
+
if (gutter != opts.gutter) return;
|
|
87
|
+
cm.foldCode(Pos(line, 0), opts.rangeFinder);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function onChange(cm) {
|
|
91
|
+
var state = cm.state.foldGutter, opts = cm.state.foldGutter.options;
|
|
92
|
+
state.from = state.to = 0;
|
|
93
|
+
clearTimeout(state.changeUpdate);
|
|
94
|
+
state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function onViewportChange(cm) {
|
|
98
|
+
var state = cm.state.foldGutter, opts = cm.state.foldGutter.options;
|
|
99
|
+
clearTimeout(state.changeUpdate);
|
|
100
|
+
state.changeUpdate = setTimeout(function() {
|
|
101
|
+
var vp = cm.getViewport();
|
|
102
|
+
if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
|
|
103
|
+
updateInViewport(cm);
|
|
104
|
+
} else {
|
|
105
|
+
cm.operation(function() {
|
|
106
|
+
if (vp.from < state.from) {
|
|
107
|
+
updateFoldInfo(cm, vp.from, state.from);
|
|
108
|
+
state.from = vp.from;
|
|
109
|
+
}
|
|
110
|
+
if (vp.to > state.to) {
|
|
111
|
+
updateFoldInfo(cm, state.to, vp.to);
|
|
112
|
+
state.to = vp.to;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}, opts.updateViewportTimeSpan || 400);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function onFold(cm, from) {
|
|
120
|
+
var state = cm.state.foldGutter, line = from.line;
|
|
121
|
+
if (line >= state.from && line < state.to)
|
|
122
|
+
updateFoldInfo(cm, line, line + 1);
|
|
123
|
+
}
|
|
124
|
+
})();
|