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,131 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
var Pos = CodeMirror.Pos;
|
|
3
|
+
|
|
4
|
+
function forEach(arr, f) {
|
|
5
|
+
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function arrayContains(arr, item) {
|
|
9
|
+
if (!Array.prototype.indexOf) {
|
|
10
|
+
var i = arr.length;
|
|
11
|
+
while (i--) {
|
|
12
|
+
if (arr[i] === item) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return arr.indexOf(item) != -1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function scriptHint(editor, keywords, getToken, options) {
|
|
22
|
+
// Find the token at the cursor
|
|
23
|
+
var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
|
|
24
|
+
if (/\b(?:string|comment)\b/.test(token.type)) return;
|
|
25
|
+
token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;
|
|
26
|
+
|
|
27
|
+
// If it's not a 'word-style' token, ignore the token.
|
|
28
|
+
if (!/^[\w$_]*$/.test(token.string)) {
|
|
29
|
+
token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
|
|
30
|
+
type: token.string == "." ? "property" : null};
|
|
31
|
+
}
|
|
32
|
+
// If it is a property, find out what it is a property of.
|
|
33
|
+
while (tprop.type == "property") {
|
|
34
|
+
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
|
35
|
+
if (tprop.string != ".") return;
|
|
36
|
+
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
|
37
|
+
if (!context) var context = [];
|
|
38
|
+
context.push(tprop);
|
|
39
|
+
}
|
|
40
|
+
return {list: getCompletions(token, context, keywords, options),
|
|
41
|
+
from: Pos(cur.line, token.start),
|
|
42
|
+
to: Pos(cur.line, token.end)};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function javascriptHint(editor, options) {
|
|
46
|
+
return scriptHint(editor, javascriptKeywords,
|
|
47
|
+
function (e, cur) {return e.getTokenAt(cur);},
|
|
48
|
+
options);
|
|
49
|
+
};
|
|
50
|
+
CodeMirror.javascriptHint = javascriptHint; // deprecated
|
|
51
|
+
CodeMirror.registerHelper("hint", "javascript", javascriptHint);
|
|
52
|
+
|
|
53
|
+
function getCoffeeScriptToken(editor, cur) {
|
|
54
|
+
// This getToken, it is for coffeescript, imitates the behavior of
|
|
55
|
+
// getTokenAt method in javascript.js, that is, returning "property"
|
|
56
|
+
// type and treat "." as indepenent token.
|
|
57
|
+
var token = editor.getTokenAt(cur);
|
|
58
|
+
if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') {
|
|
59
|
+
token.end = token.start;
|
|
60
|
+
token.string = '.';
|
|
61
|
+
token.type = "property";
|
|
62
|
+
}
|
|
63
|
+
else if (/^\.[\w$_]*$/.test(token.string)) {
|
|
64
|
+
token.type = "property";
|
|
65
|
+
token.start++;
|
|
66
|
+
token.string = token.string.replace(/\./, '');
|
|
67
|
+
}
|
|
68
|
+
return token;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function coffeescriptHint(editor, options) {
|
|
72
|
+
return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options);
|
|
73
|
+
}
|
|
74
|
+
CodeMirror.coffeescriptHint = coffeescriptHint; // deprecated
|
|
75
|
+
CodeMirror.registerHelper("hint", "coffeescript", coffeescriptHint);
|
|
76
|
+
|
|
77
|
+
var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " +
|
|
78
|
+
"toUpperCase toLowerCase split concat match replace search").split(" ");
|
|
79
|
+
var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " +
|
|
80
|
+
"lastIndexOf every some filter forEach map reduce reduceRight ").split(" ");
|
|
81
|
+
var funcProps = "prototype apply call bind".split(" ");
|
|
82
|
+
var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " +
|
|
83
|
+
"if in instanceof new null return switch throw true try typeof var void while with").split(" ");
|
|
84
|
+
var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " +
|
|
85
|
+
"if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");
|
|
86
|
+
|
|
87
|
+
function getCompletions(token, context, keywords, options) {
|
|
88
|
+
var found = [], start = token.string;
|
|
89
|
+
function maybeAdd(str) {
|
|
90
|
+
if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
|
|
91
|
+
}
|
|
92
|
+
function gatherCompletions(obj) {
|
|
93
|
+
if (typeof obj == "string") forEach(stringProps, maybeAdd);
|
|
94
|
+
else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
|
|
95
|
+
else if (obj instanceof Function) forEach(funcProps, maybeAdd);
|
|
96
|
+
for (var name in obj) maybeAdd(name);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (context && context.length) {
|
|
100
|
+
// If this is a property, see if it belongs to some object we can
|
|
101
|
+
// find in the current environment.
|
|
102
|
+
var obj = context.pop(), base;
|
|
103
|
+
if (obj.type && obj.type.indexOf("variable") === 0) {
|
|
104
|
+
if (options && options.additionalContext)
|
|
105
|
+
base = options.additionalContext[obj.string];
|
|
106
|
+
base = base || window[obj.string];
|
|
107
|
+
} else if (obj.type == "string") {
|
|
108
|
+
base = "";
|
|
109
|
+
} else if (obj.type == "atom") {
|
|
110
|
+
base = 1;
|
|
111
|
+
} else if (obj.type == "function") {
|
|
112
|
+
if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
|
|
113
|
+
(typeof window.jQuery == 'function'))
|
|
114
|
+
base = window.jQuery();
|
|
115
|
+
else if (window._ != null && (obj.string == '_') && (typeof window._ == 'function'))
|
|
116
|
+
base = window._();
|
|
117
|
+
}
|
|
118
|
+
while (base != null && context.length)
|
|
119
|
+
base = base[context.pop().string];
|
|
120
|
+
if (base != null) gatherCompletions(base);
|
|
121
|
+
} else {
|
|
122
|
+
// If not, just look in the window object and any local scope
|
|
123
|
+
// (reading into JS mode internals to get at the local and global variables)
|
|
124
|
+
for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
|
|
125
|
+
for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);
|
|
126
|
+
gatherCompletions(window);
|
|
127
|
+
forEach(keywords, maybeAdd);
|
|
128
|
+
}
|
|
129
|
+
return found;
|
|
130
|
+
}
|
|
131
|
+
})();
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
function forEach(arr, f) {
|
|
5
|
+
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function arrayContains(arr, item) {
|
|
9
|
+
if (!Array.prototype.indexOf) {
|
|
10
|
+
var i = arr.length;
|
|
11
|
+
while (i--) {
|
|
12
|
+
if (arr[i] === item) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return arr.indexOf(item) != -1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function scriptHint(editor, _keywords, getToken) {
|
|
22
|
+
// Find the token at the cursor
|
|
23
|
+
var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
|
|
24
|
+
// If it's not a 'word-style' token, ignore the token.
|
|
25
|
+
|
|
26
|
+
if (!/^[\w$_]*$/.test(token.string)) {
|
|
27
|
+
token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
|
|
28
|
+
className: token.string == ":" ? "pig-type" : null};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!context) var context = [];
|
|
32
|
+
context.push(tprop);
|
|
33
|
+
|
|
34
|
+
var completionList = getCompletions(token, context);
|
|
35
|
+
completionList = completionList.sort();
|
|
36
|
+
//prevent autocomplete for last word, instead show dropdown with one word
|
|
37
|
+
if(completionList.length == 1) {
|
|
38
|
+
completionList.push(" ");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return {list: completionList,
|
|
42
|
+
from: CodeMirror.Pos(cur.line, token.start),
|
|
43
|
+
to: CodeMirror.Pos(cur.line, token.end)};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function pigHint(editor) {
|
|
47
|
+
return scriptHint(editor, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
|
|
48
|
+
}
|
|
49
|
+
CodeMirror.pigHint = pigHint; // deprecated
|
|
50
|
+
CodeMirror.registerHelper("hint", "pig", pigHint);
|
|
51
|
+
|
|
52
|
+
var pigKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP "
|
|
53
|
+
+ "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL "
|
|
54
|
+
+ "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE "
|
|
55
|
+
+ "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE "
|
|
56
|
+
+ "NEQ MATCHES TRUE FALSE";
|
|
57
|
+
var pigKeywordsU = pigKeywords.split(" ");
|
|
58
|
+
var pigKeywordsL = pigKeywords.toLowerCase().split(" ");
|
|
59
|
+
|
|
60
|
+
var pigTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP";
|
|
61
|
+
var pigTypesU = pigTypes.split(" ");
|
|
62
|
+
var pigTypesL = pigTypes.toLowerCase().split(" ");
|
|
63
|
+
|
|
64
|
+
var pigBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL "
|
|
65
|
+
+ "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS "
|
|
66
|
+
+ "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG "
|
|
67
|
+
+ "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN "
|
|
68
|
+
+ "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER "
|
|
69
|
+
+ "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS "
|
|
70
|
+
+ "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA "
|
|
71
|
+
+ "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE "
|
|
72
|
+
+ "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG "
|
|
73
|
+
+ "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER";
|
|
74
|
+
var pigBuiltinsU = pigBuiltins.split(" ").join("() ").split(" ");
|
|
75
|
+
var pigBuiltinsL = pigBuiltins.toLowerCase().split(" ").join("() ").split(" ");
|
|
76
|
+
var pigBuiltinsC = ("BagSize BinStorage Bloom BuildBloom ConstantSize CubeDimensions DoubleAbs "
|
|
77
|
+
+ "DoubleAvg DoubleBase DoubleMax DoubleMin DoubleRound DoubleSum FloatAbs FloatAvg FloatMax "
|
|
78
|
+
+ "FloatMin FloatRound FloatSum GenericInvoker IntAbs IntAvg IntMax IntMin IntSum "
|
|
79
|
+
+ "InvokeForDouble InvokeForFloat InvokeForInt InvokeForLong InvokeForString Invoker "
|
|
80
|
+
+ "IsEmpty JsonLoader JsonMetadata JsonStorage LongAbs LongAvg LongMax LongMin LongSum MapSize "
|
|
81
|
+
+ "MonitoredUDF Nondeterministic OutputSchema PigStorage PigStreaming StringConcat StringMax "
|
|
82
|
+
+ "StringMin StringSize TextLoader TupleSize Utf8StorageConverter").split(" ").join("() ").split(" ");
|
|
83
|
+
|
|
84
|
+
function getCompletions(token, context) {
|
|
85
|
+
var found = [], start = token.string;
|
|
86
|
+
function maybeAdd(str) {
|
|
87
|
+
if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function gatherCompletions(obj) {
|
|
91
|
+
if(obj == ":") {
|
|
92
|
+
forEach(pigTypesL, maybeAdd);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
forEach(pigBuiltinsU, maybeAdd);
|
|
96
|
+
forEach(pigBuiltinsL, maybeAdd);
|
|
97
|
+
forEach(pigBuiltinsC, maybeAdd);
|
|
98
|
+
forEach(pigTypesU, maybeAdd);
|
|
99
|
+
forEach(pigTypesL, maybeAdd);
|
|
100
|
+
forEach(pigKeywordsU, maybeAdd);
|
|
101
|
+
forEach(pigKeywordsL, maybeAdd);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (context) {
|
|
106
|
+
// If this is a property, see if it belongs to some object we can
|
|
107
|
+
// find in the current environment.
|
|
108
|
+
var obj = context.pop(), base;
|
|
109
|
+
|
|
110
|
+
if (obj.type == "variable")
|
|
111
|
+
base = obj.string;
|
|
112
|
+
else if(obj.type == "variable-3")
|
|
113
|
+
base = ":" + obj.string;
|
|
114
|
+
|
|
115
|
+
while (base != null && context.length)
|
|
116
|
+
base = base[context.pop().string];
|
|
117
|
+
if (base != null) gatherCompletions(base);
|
|
118
|
+
}
|
|
119
|
+
return found;
|
|
120
|
+
}
|
|
121
|
+
})();
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
function forEach(arr, f) {
|
|
3
|
+
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
function arrayContains(arr, item) {
|
|
7
|
+
if (!Array.prototype.indexOf) {
|
|
8
|
+
var i = arr.length;
|
|
9
|
+
while (i--) {
|
|
10
|
+
if (arr[i] === item) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return arr.indexOf(item) != -1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function scriptHint(editor, _keywords, getToken) {
|
|
20
|
+
// Find the token at the cursor
|
|
21
|
+
var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
|
|
22
|
+
// If it's not a 'word-style' token, ignore the token.
|
|
23
|
+
|
|
24
|
+
if (!/^[\w$_]*$/.test(token.string)) {
|
|
25
|
+
token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
|
|
26
|
+
className: token.string == ":" ? "python-type" : null};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!context) var context = [];
|
|
30
|
+
context.push(tprop);
|
|
31
|
+
|
|
32
|
+
var completionList = getCompletions(token, context);
|
|
33
|
+
completionList = completionList.sort();
|
|
34
|
+
//prevent autocomplete for last word, instead show dropdown with one word
|
|
35
|
+
if(completionList.length == 1) {
|
|
36
|
+
completionList.push(" ");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return {list: completionList,
|
|
40
|
+
from: CodeMirror.Pos(cur.line, token.start),
|
|
41
|
+
to: CodeMirror.Pos(cur.line, token.end)};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function pythonHint(editor) {
|
|
45
|
+
return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
|
|
46
|
+
}
|
|
47
|
+
CodeMirror.pythonHint = pythonHint; // deprecated
|
|
48
|
+
CodeMirror.registerHelper("hint", "python", pythonHint);
|
|
49
|
+
|
|
50
|
+
var pythonKeywords = "and del from not while as elif global or with assert else if pass yield"
|
|
51
|
+
+ "break except import print class exec in raise continue finally is return def for lambda try";
|
|
52
|
+
var pythonKeywordsL = pythonKeywords.split(" ");
|
|
53
|
+
var pythonKeywordsU = pythonKeywords.toUpperCase().split(" ");
|
|
54
|
+
|
|
55
|
+
var pythonBuiltins = "abs divmod input open staticmethod all enumerate int ord str "
|
|
56
|
+
+ "any eval isinstance pow sum basestring execfile issubclass print super"
|
|
57
|
+
+ "bin file iter property tuple bool filter len range type"
|
|
58
|
+
+ "bytearray float list raw_input unichr callable format locals reduce unicode"
|
|
59
|
+
+ "chr frozenset long reload vars classmethod getattr map repr xrange"
|
|
60
|
+
+ "cmp globals max reversed zip compile hasattr memoryview round __import__"
|
|
61
|
+
+ "complex hash min set apply delattr help next setattr buffer"
|
|
62
|
+
+ "dict hex object slice coerce dir id oct sorted intern ";
|
|
63
|
+
var pythonBuiltinsL = pythonBuiltins.split(" ").join("() ").split(" ");
|
|
64
|
+
var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(" ").join("() ").split(" ");
|
|
65
|
+
|
|
66
|
+
function getCompletions(token, context) {
|
|
67
|
+
var found = [], start = token.string;
|
|
68
|
+
function maybeAdd(str) {
|
|
69
|
+
if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function gatherCompletions(_obj) {
|
|
73
|
+
forEach(pythonBuiltinsL, maybeAdd);
|
|
74
|
+
forEach(pythonBuiltinsU, maybeAdd);
|
|
75
|
+
forEach(pythonKeywordsL, maybeAdd);
|
|
76
|
+
forEach(pythonKeywordsU, maybeAdd);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (context) {
|
|
80
|
+
// If this is a property, see if it belongs to some object we can
|
|
81
|
+
// find in the current environment.
|
|
82
|
+
var obj = context.pop(), base;
|
|
83
|
+
|
|
84
|
+
if (obj.type == "variable")
|
|
85
|
+
base = obj.string;
|
|
86
|
+
else if(obj.type == "variable-3")
|
|
87
|
+
base = ":" + obj.string;
|
|
88
|
+
|
|
89
|
+
while (base != null && context.length)
|
|
90
|
+
base = base[context.pop().string];
|
|
91
|
+
if (base != null) gatherCompletions(base);
|
|
92
|
+
}
|
|
93
|
+
return found;
|
|
94
|
+
}
|
|
95
|
+
})();
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.CodeMirror-hints {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: 10;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
list-style: none;
|
|
6
|
+
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 2px;
|
|
9
|
+
|
|
10
|
+
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
11
|
+
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
12
|
+
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
13
|
+
border-radius: 3px;
|
|
14
|
+
border: 1px solid silver;
|
|
15
|
+
|
|
16
|
+
background: white;
|
|
17
|
+
font-size: 90%;
|
|
18
|
+
font-family: monospace;
|
|
19
|
+
|
|
20
|
+
max-height: 20em;
|
|
21
|
+
overflow-y: auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.CodeMirror-hint {
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0 4px;
|
|
27
|
+
border-radius: 2px;
|
|
28
|
+
max-width: 19em;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
white-space: pre;
|
|
31
|
+
color: black;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.CodeMirror-hint-active {
|
|
36
|
+
background: #08f;
|
|
37
|
+
color: white;
|
|
38
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var HINT_ELEMENT_CLASS = "CodeMirror-hint";
|
|
5
|
+
var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active";
|
|
6
|
+
|
|
7
|
+
CodeMirror.showHint = function(cm, getHints, options) {
|
|
8
|
+
// We want a single cursor position.
|
|
9
|
+
if (cm.somethingSelected()) return;
|
|
10
|
+
if (getHints == null) getHints = cm.getHelper(cm.getCursor(), "hint");
|
|
11
|
+
if (getHints == null) return;
|
|
12
|
+
|
|
13
|
+
if (cm.state.completionActive) cm.state.completionActive.close();
|
|
14
|
+
|
|
15
|
+
var completion = cm.state.completionActive = new Completion(cm, getHints, options || {});
|
|
16
|
+
CodeMirror.signal(cm, "startCompletion", cm);
|
|
17
|
+
if (completion.options.async)
|
|
18
|
+
getHints(cm, function(hints) { completion.showHints(hints); }, completion.options);
|
|
19
|
+
else
|
|
20
|
+
return completion.showHints(getHints(cm, completion.options));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function Completion(cm, getHints, options) {
|
|
24
|
+
this.cm = cm;
|
|
25
|
+
this.getHints = getHints;
|
|
26
|
+
this.options = options;
|
|
27
|
+
this.widget = this.onClose = null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Completion.prototype = {
|
|
31
|
+
close: function() {
|
|
32
|
+
if (!this.active()) return;
|
|
33
|
+
this.cm.state.completionActive = null;
|
|
34
|
+
|
|
35
|
+
if (this.widget) this.widget.close();
|
|
36
|
+
if (this.onClose) this.onClose();
|
|
37
|
+
CodeMirror.signal(this.cm, "endCompletion", this.cm);
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
active: function() {
|
|
41
|
+
return this.cm.state.completionActive == this;
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
pick: function(data, i) {
|
|
45
|
+
var completion = data.list[i];
|
|
46
|
+
if (completion.hint) completion.hint(this.cm, data, completion);
|
|
47
|
+
else this.cm.replaceRange(getText(completion), data.from, data.to);
|
|
48
|
+
this.close();
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
showHints: function(data) {
|
|
52
|
+
if (!data || !data.list.length || !this.active()) return this.close();
|
|
53
|
+
|
|
54
|
+
if (this.options.completeSingle != false && data.list.length == 1)
|
|
55
|
+
this.pick(data, 0);
|
|
56
|
+
else
|
|
57
|
+
this.showWidget(data);
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
showWidget: function(data) {
|
|
61
|
+
this.widget = new Widget(this, data);
|
|
62
|
+
CodeMirror.signal(data, "shown");
|
|
63
|
+
|
|
64
|
+
var debounce = null, completion = this, finished;
|
|
65
|
+
var closeOn = this.options.closeCharacters || /[\s()\[\]{};:>,]/;
|
|
66
|
+
var startPos = this.cm.getCursor(), startLen = this.cm.getLine(startPos.line).length;
|
|
67
|
+
|
|
68
|
+
function done() {
|
|
69
|
+
if (finished) return;
|
|
70
|
+
finished = true;
|
|
71
|
+
completion.close();
|
|
72
|
+
completion.cm.off("cursorActivity", activity);
|
|
73
|
+
if (data) CodeMirror.signal(data, "close");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function update() {
|
|
77
|
+
if (finished) return;
|
|
78
|
+
CodeMirror.signal(data, "update");
|
|
79
|
+
if (completion.options.async)
|
|
80
|
+
completion.getHints(completion.cm, finishUpdate, completion.options);
|
|
81
|
+
else
|
|
82
|
+
finishUpdate(completion.getHints(completion.cm, completion.options));
|
|
83
|
+
}
|
|
84
|
+
function finishUpdate(data_) {
|
|
85
|
+
data = data_;
|
|
86
|
+
if (finished) return;
|
|
87
|
+
if (!data || !data.list.length) return done();
|
|
88
|
+
completion.widget = new Widget(completion, data);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function activity() {
|
|
92
|
+
clearTimeout(debounce);
|
|
93
|
+
var pos = completion.cm.getCursor(), line = completion.cm.getLine(pos.line);
|
|
94
|
+
if (pos.line != startPos.line || line.length - pos.ch != startLen - startPos.ch ||
|
|
95
|
+
pos.ch < startPos.ch || completion.cm.somethingSelected() ||
|
|
96
|
+
(pos.ch && closeOn.test(line.charAt(pos.ch - 1)))) {
|
|
97
|
+
completion.close();
|
|
98
|
+
} else {
|
|
99
|
+
debounce = setTimeout(update, 170);
|
|
100
|
+
if (completion.widget) completion.widget.close();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
this.cm.on("cursorActivity", activity);
|
|
104
|
+
this.onClose = done;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
function getText(completion) {
|
|
109
|
+
if (typeof completion == "string") return completion;
|
|
110
|
+
else return completion.text;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function buildKeyMap(options, handle) {
|
|
114
|
+
var baseMap = {
|
|
115
|
+
Up: function() {handle.moveFocus(-1);},
|
|
116
|
+
Down: function() {handle.moveFocus(1);},
|
|
117
|
+
PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},
|
|
118
|
+
PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},
|
|
119
|
+
Home: function() {handle.setFocus(0);},
|
|
120
|
+
End: function() {handle.setFocus(handle.length - 1);},
|
|
121
|
+
Enter: handle.pick,
|
|
122
|
+
Tab: handle.pick,
|
|
123
|
+
Esc: handle.close
|
|
124
|
+
};
|
|
125
|
+
var ourMap = options.customKeys ? {} : baseMap;
|
|
126
|
+
function addBinding(key, val) {
|
|
127
|
+
var bound;
|
|
128
|
+
if (typeof val != "string")
|
|
129
|
+
bound = function(cm) { return val(cm, handle); };
|
|
130
|
+
// This mechanism is deprecated
|
|
131
|
+
else if (baseMap.hasOwnProperty(val))
|
|
132
|
+
bound = baseMap[val];
|
|
133
|
+
else
|
|
134
|
+
bound = val;
|
|
135
|
+
ourMap[key] = bound;
|
|
136
|
+
}
|
|
137
|
+
if (options.customKeys)
|
|
138
|
+
for (var key in options.customKeys) if (options.customKeys.hasOwnProperty(key))
|
|
139
|
+
addBinding(key, options.customKeys[key]);
|
|
140
|
+
if (options.extraKeys)
|
|
141
|
+
for (var key in options.extraKeys) if (options.extraKeys.hasOwnProperty(key))
|
|
142
|
+
addBinding(key, options.extraKeys[key]);
|
|
143
|
+
return ourMap;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function getHintElement(stopAt, el) {
|
|
147
|
+
while (el && el != stopAt) {
|
|
148
|
+
if (el.nodeName.toUpperCase() === "LI") return el;
|
|
149
|
+
el = el.parentNode;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function Widget(completion, data) {
|
|
154
|
+
this.completion = completion;
|
|
155
|
+
this.data = data;
|
|
156
|
+
var widget = this, cm = completion.cm, options = completion.options;
|
|
157
|
+
|
|
158
|
+
var hints = this.hints = document.createElement("ul");
|
|
159
|
+
hints.className = "CodeMirror-hints";
|
|
160
|
+
this.selectedHint = options.getDefaultSelection ? options.getDefaultSelection(cm,options,data) : 0;
|
|
161
|
+
|
|
162
|
+
var completions = data.list;
|
|
163
|
+
for (var i = 0; i < completions.length; ++i) {
|
|
164
|
+
var elt = hints.appendChild(document.createElement("li")), cur = completions[i];
|
|
165
|
+
var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
|
|
166
|
+
if (cur.className != null) className = cur.className + " " + className;
|
|
167
|
+
elt.className = className;
|
|
168
|
+
if (cur.render) cur.render(elt, data, cur);
|
|
169
|
+
else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));
|
|
170
|
+
elt.hintId = i;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
var pos = cm.cursorCoords(options.alignWithWord !== false ? data.from : null);
|
|
174
|
+
var left = pos.left, top = pos.bottom, below = true;
|
|
175
|
+
hints.style.left = left + "px";
|
|
176
|
+
hints.style.top = top + "px";
|
|
177
|
+
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
|
|
178
|
+
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
|
|
179
|
+
var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
|
|
180
|
+
(options.container || document.body).appendChild(hints);
|
|
181
|
+
var box = hints.getBoundingClientRect();
|
|
182
|
+
var overlapX = box.right - winW, overlapY = box.bottom - winH;
|
|
183
|
+
if (overlapX > 0) {
|
|
184
|
+
if (box.right - box.left > winW) {
|
|
185
|
+
hints.style.width = (winW - 5) + "px";
|
|
186
|
+
overlapX -= (box.right - box.left) - winW;
|
|
187
|
+
}
|
|
188
|
+
hints.style.left = (left = pos.left - overlapX) + "px";
|
|
189
|
+
}
|
|
190
|
+
if (overlapY > 0) {
|
|
191
|
+
var height = box.bottom - box.top;
|
|
192
|
+
if (box.top - (pos.bottom - pos.top) - height > 0) {
|
|
193
|
+
overlapY = height + (pos.bottom - pos.top);
|
|
194
|
+
below = false;
|
|
195
|
+
} else if (height > winH) {
|
|
196
|
+
hints.style.height = (winH - 5) + "px";
|
|
197
|
+
overlapY -= height - winH;
|
|
198
|
+
}
|
|
199
|
+
hints.style.top = (top = pos.bottom - overlapY) + "px";
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
cm.addKeyMap(this.keyMap = buildKeyMap(options, {
|
|
203
|
+
moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
|
|
204
|
+
setFocus: function(n) { widget.changeActive(n); },
|
|
205
|
+
menuSize: function() { return widget.screenAmount(); },
|
|
206
|
+
length: completions.length,
|
|
207
|
+
close: function() { completion.close(); },
|
|
208
|
+
pick: function() { widget.pick(); }
|
|
209
|
+
}));
|
|
210
|
+
|
|
211
|
+
if (options.closeOnUnfocus !== false) {
|
|
212
|
+
var closingOnBlur;
|
|
213
|
+
cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });
|
|
214
|
+
cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); });
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
var startScroll = cm.getScrollInfo();
|
|
218
|
+
cm.on("scroll", this.onScroll = function() {
|
|
219
|
+
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
|
|
220
|
+
var newTop = top + startScroll.top - curScroll.top;
|
|
221
|
+
var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);
|
|
222
|
+
if (!below) point += hints.offsetHeight;
|
|
223
|
+
if (point <= editor.top || point >= editor.bottom) return completion.close();
|
|
224
|
+
hints.style.top = newTop + "px";
|
|
225
|
+
hints.style.left = (left + startScroll.left - curScroll.left) + "px";
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
CodeMirror.on(hints, "dblclick", function(e) {
|
|
229
|
+
var t = getHintElement(hints, e.target || e.srcElement);
|
|
230
|
+
if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
CodeMirror.on(hints, "click", function(e) {
|
|
234
|
+
var t = getHintElement(hints, e.target || e.srcElement);
|
|
235
|
+
if (t && t.hintId != null) widget.changeActive(t.hintId);
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
CodeMirror.on(hints, "mousedown", function() {
|
|
239
|
+
setTimeout(function(){cm.focus();}, 20);
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
CodeMirror.signal(data, "select", completions[0], hints.firstChild);
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
Widget.prototype = {
|
|
247
|
+
close: function() {
|
|
248
|
+
if (this.completion.widget != this) return;
|
|
249
|
+
this.completion.widget = null;
|
|
250
|
+
this.hints.parentNode.removeChild(this.hints);
|
|
251
|
+
this.completion.cm.removeKeyMap(this.keyMap);
|
|
252
|
+
|
|
253
|
+
var cm = this.completion.cm;
|
|
254
|
+
if (this.completion.options.closeOnUnfocus !== false) {
|
|
255
|
+
cm.off("blur", this.onBlur);
|
|
256
|
+
cm.off("focus", this.onFocus);
|
|
257
|
+
}
|
|
258
|
+
cm.off("scroll", this.onScroll);
|
|
259
|
+
},
|
|
260
|
+
|
|
261
|
+
pick: function() {
|
|
262
|
+
this.completion.pick(this.data, this.selectedHint);
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
changeActive: function(i, avoidWrap) {
|
|
266
|
+
if (i >= this.data.list.length)
|
|
267
|
+
i = avoidWrap ? this.data.list.length - 1 : 0;
|
|
268
|
+
else if (i < 0)
|
|
269
|
+
i = avoidWrap ? 0 : this.data.list.length - 1;
|
|
270
|
+
if (this.selectedHint == i) return;
|
|
271
|
+
var node = this.hints.childNodes[this.selectedHint];
|
|
272
|
+
node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
|
|
273
|
+
node = this.hints.childNodes[this.selectedHint = i];
|
|
274
|
+
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
|
|
275
|
+
if (node.offsetTop < this.hints.scrollTop)
|
|
276
|
+
this.hints.scrollTop = node.offsetTop - 3;
|
|
277
|
+
else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
|
|
278
|
+
this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;
|
|
279
|
+
CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
screenAmount: function() {
|
|
283
|
+
return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
})();
|