├── .build.yml
├── .gitignore
├── CHANGELOG.md
├── LICENCE.txt
├── README.md
├── favicon
├── gorilla16.png
├── gorilla16.pxi
├── gorilla32.png
└── gorilla32.pxi
├── project.clj
├── resources
├── gorilla-repl-client
│ ├── css
│ │ ├── codemirror-hint.css
│ │ ├── gorilla.css
│ │ ├── output.css
│ │ ├── viewer.css
│ │ └── worksheet.css
│ ├── favicon.ico
│ ├── js-viewer
│ │ ├── bitbucket.js
│ │ ├── github.js
│ │ ├── main-viewer.js
│ │ ├── segment-viewer.js
│ │ └── worksheet-viewer.js
│ ├── js
│ │ ├── codeDialog.js
│ │ ├── codemirrorVM.js
│ │ ├── commandProcessor.js
│ │ ├── completions.js
│ │ ├── docViewer.js
│ │ ├── eventbus.js
│ │ ├── main.js
│ │ ├── mathJaxViewer.js
│ │ ├── outputViewer.js
│ │ ├── palette.js
│ │ ├── renderer.js
│ │ ├── repl-ws.js
│ │ ├── saveDialog.js
│ │ ├── segment.js
│ │ ├── utils.js
│ │ ├── worksheet.js
│ │ ├── worksheetParser.js
│ │ └── worksheetParser.pegjs
│ ├── jslib
│ │ ├── codemirror-4.5
│ │ │ ├── addon
│ │ │ │ ├── comment
│ │ │ │ │ ├── comment.js
│ │ │ │ │ └── continuecomment.js
│ │ │ │ ├── dialog
│ │ │ │ │ ├── dialog.css
│ │ │ │ │ └── dialog.js
│ │ │ │ ├── display
│ │ │ │ │ ├── fullscreen.css
│ │ │ │ │ ├── fullscreen.js
│ │ │ │ │ ├── placeholder.js
│ │ │ │ │ └── rulers.js
│ │ │ │ ├── edit
│ │ │ │ │ ├── closebrackets.js
│ │ │ │ │ ├── closetag.js
│ │ │ │ │ ├── continuelist.js
│ │ │ │ │ ├── matchbrackets.js
│ │ │ │ │ ├── matchtags.js
│ │ │ │ │ └── trailingspace.js
│ │ │ │ ├── fold
│ │ │ │ │ ├── brace-fold.js
│ │ │ │ │ ├── comment-fold.js
│ │ │ │ │ ├── foldcode.js
│ │ │ │ │ ├── foldgutter.css
│ │ │ │ │ ├── foldgutter.js
│ │ │ │ │ ├── indent-fold.js
│ │ │ │ │ ├── markdown-fold.js
│ │ │ │ │ └── xml-fold.js
│ │ │ │ ├── hint
│ │ │ │ │ ├── anyword-hint.js
│ │ │ │ │ ├── css-hint.js
│ │ │ │ │ ├── html-hint.js
│ │ │ │ │ ├── javascript-hint.js
│ │ │ │ │ ├── python-hint.js
│ │ │ │ │ ├── show-hint.css
│ │ │ │ │ ├── show-hint.js
│ │ │ │ │ ├── sql-hint.js
│ │ │ │ │ └── xml-hint.js
│ │ │ │ ├── lint
│ │ │ │ │ ├── coffeescript-lint.js
│ │ │ │ │ ├── css-lint.js
│ │ │ │ │ ├── javascript-lint.js
│ │ │ │ │ ├── json-lint.js
│ │ │ │ │ ├── lint.css
│ │ │ │ │ ├── lint.js
│ │ │ │ │ └── yaml-lint.js
│ │ │ │ ├── merge
│ │ │ │ │ ├── merge.css
│ │ │ │ │ └── merge.js
│ │ │ │ ├── mode
│ │ │ │ │ ├── loadmode.js
│ │ │ │ │ ├── multiplex.js
│ │ │ │ │ ├── multiplex_test.js
│ │ │ │ │ └── overlay.js
│ │ │ │ ├── runmode
│ │ │ │ │ ├── colorize.js
│ │ │ │ │ ├── runmode-standalone.js
│ │ │ │ │ ├── runmode.js
│ │ │ │ │ └── runmode.node.js
│ │ │ │ ├── scroll
│ │ │ │ │ └── scrollpastend.js
│ │ │ │ ├── search
│ │ │ │ │ ├── match-highlighter.js
│ │ │ │ │ ├── search.js
│ │ │ │ │ └── searchcursor.js
│ │ │ │ ├── selection
│ │ │ │ │ ├── active-line.js
│ │ │ │ │ └── mark-selection.js
│ │ │ │ ├── tern
│ │ │ │ │ ├── tern.css
│ │ │ │ │ ├── tern.js
│ │ │ │ │ └── worker.js
│ │ │ │ └── wrap
│ │ │ │ │ └── hardwrap.js
│ │ │ ├── keymap
│ │ │ │ ├── emacs.js
│ │ │ │ ├── sublime.js
│ │ │ │ └── vim.js
│ │ │ ├── lib
│ │ │ │ ├── codemirror.css
│ │ │ │ └── codemirror.js
│ │ │ ├── mode
│ │ │ │ ├── apl
│ │ │ │ │ ├── apl.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── asterisk
│ │ │ │ │ ├── asterisk.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── clike
│ │ │ │ │ ├── clike.js
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── scala.html
│ │ │ │ ├── clojure
│ │ │ │ │ ├── clojure.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── cobol
│ │ │ │ │ ├── cobol.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── coffeescript
│ │ │ │ │ ├── coffeescript.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── commonlisp
│ │ │ │ │ ├── commonlisp.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── css
│ │ │ │ │ ├── css.js
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── less.html
│ │ │ │ │ ├── less_test.js
│ │ │ │ │ ├── scss.html
│ │ │ │ │ ├── scss_test.js
│ │ │ │ │ └── test.js
│ │ │ │ ├── cypher
│ │ │ │ │ ├── cypher.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── d
│ │ │ │ │ ├── d.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── diff
│ │ │ │ │ ├── diff.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── django
│ │ │ │ │ ├── django.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── dtd
│ │ │ │ │ ├── dtd.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── dylan
│ │ │ │ │ ├── dylan.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── ecl
│ │ │ │ │ ├── ecl.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── eiffel
│ │ │ │ │ ├── eiffel.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── erlang
│ │ │ │ │ ├── erlang.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── fortran
│ │ │ │ │ ├── fortran.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── gas
│ │ │ │ │ ├── gas.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── gfm
│ │ │ │ │ ├── gfm.js
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── test.js
│ │ │ │ ├── gherkin
│ │ │ │ │ ├── gherkin.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── go
│ │ │ │ │ ├── go.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── groovy
│ │ │ │ │ ├── groovy.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── haml
│ │ │ │ │ ├── haml.js
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── test.js
│ │ │ │ ├── haskell
│ │ │ │ │ ├── haskell.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── haxe
│ │ │ │ │ ├── haxe.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── htmlembedded
│ │ │ │ │ ├── htmlembedded.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── htmlmixed
│ │ │ │ │ ├── htmlmixed.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── http
│ │ │ │ │ ├── http.js
│ │ │ │ │ └── index.html
│ │ │ │ ├── index.html
│ │ │ │ ├── jade
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── jade.js
│ │ │ │ ├── javascript
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── javascript.js
│ │ │ │ │ ├── json-ld.html
│ │ │ │ │ ├── test.js
│ │ │ │ │ └── typescript.html
│ │ │ │ ├── jinja2
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── jinja2.js
│ │ │ │ ├── julia
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── julia.js
│ │ │ │ ├── kotlin
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── kotlin.js
│ │ │ │ ├── livescript
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── livescript.js
│ │ │ │ ├── lua
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── lua.js
│ │ │ │ ├── markdown
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── markdown.js
│ │ │ │ │ └── test.js
│ │ │ │ ├── meta.js
│ │ │ │ ├── mirc
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── mirc.js
│ │ │ │ ├── mllike
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── mllike.js
│ │ │ │ ├── nginx
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── nginx.js
│ │ │ │ ├── ntriples
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── ntriples.js
│ │ │ │ ├── octave
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── octave.js
│ │ │ │ ├── pascal
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── pascal.js
│ │ │ │ ├── pegjs
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── pegjs.js
│ │ │ │ ├── perl
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── perl.js
│ │ │ │ ├── php
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── php.js
│ │ │ │ │ └── test.js
│ │ │ │ ├── pig
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── pig.js
│ │ │ │ ├── properties
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── properties.js
│ │ │ │ ├── puppet
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── puppet.js
│ │ │ │ ├── python
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── python.js
│ │ │ │ ├── q
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── q.js
│ │ │ │ ├── r
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── r.js
│ │ │ │ ├── rpm
│ │ │ │ │ ├── changes
│ │ │ │ │ │ └── index.html
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── rpm.js
│ │ │ │ ├── rst
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── rst.js
│ │ │ │ ├── ruby
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── ruby.js
│ │ │ │ │ └── test.js
│ │ │ │ ├── rust
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── rust.js
│ │ │ │ ├── sass
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── sass.js
│ │ │ │ ├── scheme
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── scheme.js
│ │ │ │ ├── shell
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── shell.js
│ │ │ │ │ └── test.js
│ │ │ │ ├── sieve
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── sieve.js
│ │ │ │ ├── slim
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── slim.js
│ │ │ │ │ └── test.js
│ │ │ │ ├── smalltalk
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── smalltalk.js
│ │ │ │ ├── smarty
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── smarty.js
│ │ │ │ ├── smartymixed
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── smartymixed.js
│ │ │ │ ├── solr
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── solr.js
│ │ │ │ ├── sparql
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── sparql.js
│ │ │ │ ├── sql
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── sql.js
│ │ │ │ ├── stex
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── stex.js
│ │ │ │ │ └── test.js
│ │ │ │ ├── tcl
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── tcl.js
│ │ │ │ ├── tiddlywiki
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── tiddlywiki.css
│ │ │ │ │ └── tiddlywiki.js
│ │ │ │ ├── tiki
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── tiki.css
│ │ │ │ │ └── tiki.js
│ │ │ │ ├── toml
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── toml.js
│ │ │ │ ├── turtle
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── turtle.js
│ │ │ │ ├── vb
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── vb.js
│ │ │ │ ├── vbscript
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── vbscript.js
│ │ │ │ ├── velocity
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── velocity.js
│ │ │ │ ├── verilog
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── test.js
│ │ │ │ │ └── verilog.js
│ │ │ │ ├── xml
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── test.js
│ │ │ │ │ └── xml.js
│ │ │ │ ├── xquery
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── test.js
│ │ │ │ │ └── xquery.js
│ │ │ │ ├── yaml
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── yaml.js
│ │ │ │ └── z80
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── z80.js
│ │ │ └── theme
│ │ │ │ ├── 3024-day.css
│ │ │ │ ├── 3024-night.css
│ │ │ │ ├── ambiance-mobile.css
│ │ │ │ ├── ambiance.css
│ │ │ │ ├── base16-dark.css
│ │ │ │ ├── base16-light.css
│ │ │ │ ├── blackboard.css
│ │ │ │ ├── cobalt.css
│ │ │ │ ├── eclipse.css
│ │ │ │ ├── elegant.css
│ │ │ │ ├── erlang-dark.css
│ │ │ │ ├── lesser-dark.css
│ │ │ │ ├── mbo.css
│ │ │ │ ├── mdn-like.css
│ │ │ │ ├── midnight.css
│ │ │ │ ├── monokai.css
│ │ │ │ ├── neat.css
│ │ │ │ ├── neo.css
│ │ │ │ ├── night.css
│ │ │ │ ├── paraiso-dark.css
│ │ │ │ ├── paraiso-light.css
│ │ │ │ ├── pastel-on-dark.css
│ │ │ │ ├── rubyblue.css
│ │ │ │ ├── solarized.css
│ │ │ │ ├── the-matrix.css
│ │ │ │ ├── tomorrow-night-eighties.css
│ │ │ │ ├── twilight.css
│ │ │ │ ├── vibrant-ink.css
│ │ │ │ ├── xq-dark.css
│ │ │ │ └── xq-light.css
│ │ ├── d3
│ │ │ ├── d3.geo.projection.min.js
│ │ │ └── d3.v3.min.js
│ │ ├── jquery
│ │ │ ├── jquery-1.10.2.min.js
│ │ │ └── jquery-1.10.2.min.map
│ │ ├── knockoutjs
│ │ │ └── knockout-3.0.0.min.js
│ │ ├── marked
│ │ │ └── marked.min.js
│ │ ├── mousetrap
│ │ │ └── mousetrap.min.js
│ │ ├── underscore
│ │ │ └── underscore.min.js
│ │ ├── uuid
│ │ │ └── uuid.core.js
│ │ └── vega
│ │ │ └── vega.1.3.3.min.js
│ ├── test.clj
│ ├── view.html
│ └── worksheet.html
└── logback.xml
└── src
└── gorilla_repl
├── core.clj
├── files.clj
├── handle.clj
├── nrepl.clj
├── render_values_mw.clj
├── version.clj
└── websocket_relay.clj
/.build.yml:
--------------------------------------------------------------------------------
1 | image: debian/stretch
2 | packages:
3 | - leiningen
4 | repositories:
5 | buster: http://http.us.debian.org/debian testing main
6 | sources:
7 | - https://github.com/benfb/gorilla-repl.git
8 | secrets:
9 | - 7ebab768-e5e4-4c9d-ba57-ec41a72c5665
10 | tasks:
11 | - setup: |
12 | cd gorilla-repl
13 | lein test
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /classes
3 | /checkouts
4 | pom.xml
5 | pom.xml.asc
6 | *.jar
7 | *.class
8 | /.lein-*
9 | /.nrepl-port
10 | /.gorilla-port
11 | .idea/workspace.xml
12 | .idea/replstate.xml
13 | .idea
14 | *.iml
15 | .DS_Store
16 | ws/
17 |
--------------------------------------------------------------------------------
/LICENCE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014-, Jony Hudson
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6 | persons to whom the Software is furnished to do so, subject to the following conditions:
7 |
8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9 | Software.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Gorilla REPL
2 |
3 | Gorilla is a rich REPL for Clojure in the notebook style. If you're interested you should take a look at its
4 | [website](http://gorilla-repl.org).
5 |
6 | ## Contributing
7 |
8 | Contributions, in the form of comments, criticism, bug reports, or code are all very welcome :-) If you've got an idea for a big change drop me an email so we can coordinate work.
9 |
10 | **Notice: this, the original and canonical version of gorilla-repl, is quite stable and will remain as such. However, in the interest of collaborative expediency, it would be best if issues and pull requests were raised at one of the maintainers' fork [here](https://github.com/benfb/gorilla-repl).**
11 |
12 | ## Licence
13 |
14 | Gorilla is licensed to you under the MIT licence. See LICENCE.txt for details.
15 |
16 | Copyright © 2014- Jony Hudson and contributors
17 |
--------------------------------------------------------------------------------
/favicon/gorilla16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JonyEpsilon/gorilla-repl/47fe408ddf28dc5b87ae198336126b2ce1722674/favicon/gorilla16.png
--------------------------------------------------------------------------------
/favicon/gorilla16.pxi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JonyEpsilon/gorilla-repl/47fe408ddf28dc5b87ae198336126b2ce1722674/favicon/gorilla16.pxi
--------------------------------------------------------------------------------
/favicon/gorilla32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JonyEpsilon/gorilla-repl/47fe408ddf28dc5b87ae198336126b2ce1722674/favicon/gorilla32.png
--------------------------------------------------------------------------------
/favicon/gorilla32.pxi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JonyEpsilon/gorilla-repl/47fe408ddf28dc5b87ae198336126b2ce1722674/favicon/gorilla32.pxi
--------------------------------------------------------------------------------
/project.clj:
--------------------------------------------------------------------------------
1 | ;;;; This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
2 | ;;;;
3 | ;;;; gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
4 |
5 | (defproject org.clojars.benfb/gorilla-repl "0.5.0"
6 | :description "A rich REPL for Clojure in the notebook style."
7 | :url "https://github.com/benfb/gorilla-repl"
8 | :license {:name "MIT"}
9 | :dependencies ^:replace [[org.clojure/clojure "1.9.0"]
10 | [http-kit "2.3.0" :exclusions [ring/ring-core]]
11 | [ring/ring-json "0.4.0" :exclusions [org.clojure/clojure]]
12 | [cheshire "5.8.1"]
13 | [compojure "1.6.1" :exclusions [ring/ring-core ring/ring-json] ]
14 | [ch.qos.logback/logback-classic "1.2.3"]
15 | [gorilla-renderable "2.0.0"]
16 | [gorilla-plot "0.1.4" :exclusions [org.clojure/clojure]]
17 | [grimradical/clj-semver "0.2.0" :exclusions [org.clojure/clojure]]
18 | [cider/cider-nrepl "0.18.0" :exclusions [org.clojure/clojure]]
19 | [nrepl/nrepl "0.5.0-SNAPSHOT"]]
20 | :main ^:skip-aot gorilla-repl.core
21 | :target-path "target/%s"
22 | :jvm-opts ~(let [version (System/getProperty "java.version")
23 | [major _ _] (clojure.string/split version #"\.")]
24 | (if (>= (java.lang.Integer/parseInt major) 9)
25 | ["--add-modules" "java.xml.bind"]
26 | []))
27 | :release-tasks [["vcs" "assert-committed"]
28 | ["change" "version" "leiningen.release/bump-version" "release"]
29 | ["vcs" "commit"]
30 | ["vcs" "tag" "v" "--no-sign"]
31 | ["deploy"]
32 | ["change" "version" "leiningen.release/bump-version"]
33 | ["vcs" "commit"]
34 | ["vcs" "push"]]
35 | :deploy-repositories {"releases" {:url "https://repo.clojars.org" :username :env :password :env :sign-releases false}})
36 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/css/codemirror-hint.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | /* This is a modified version of CodeMirror/addon/hint/show-hint.css, which is published under the MIT licence. */
8 |
9 | .CodeMirror-hints {
10 | position: absolute;
11 | z-index: 10;
12 | overflow: hidden;
13 | list-style: none;
14 | margin: 0;
15 | padding: 2px;
16 | background: #cccccc;
17 | font-size: 100%;
18 | font-family: monospace;
19 | max-height: 20em;
20 | overflow-y: auto;
21 | }
22 |
23 | .CodeMirror-hint {
24 | margin: 0;
25 | padding: 0 4px;
26 | max-width: 19em;
27 | overflow: hidden;
28 | white-space: pre;
29 | color: #333333;
30 | cursor: pointer;
31 | }
32 |
33 | .CodeMirror-hint-active {
34 | background: #FF29D2;
35 | color: white;
36 | }
37 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/css/output.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | .clj-vector {color: #1C005A}
8 | .clj-raw {color: red}
9 | .clj-nil {color: grey}
10 | .clj-lazy-seq {color: lightgreen}
11 | .clj-list {color: green}
12 | .clj-map {color: purple}
13 | .clj-set {color: brown}
14 | .clj-symbol {color: steelblue}
15 | .clj-keyword {color: blue}
16 | .clj-var {color: deeppink}
17 | .clj-atom {color: darkorange}
18 | .clj-agent {color: darkorange}
19 | .clj-ref {color: darkorange}
20 | .clj-string {color: grey}
21 | .clj-char {color: dimgrey}
22 | .clj-long {color: blue}
23 | .clj-double {color: darkgreen}
24 | .clj-bigint {color: blue; font-weight: bold}
25 | .clj-bigdecimal {color: darkgreen; font-weight: bold}
26 | .clj-ratio {color: darkblue}
27 | .clj-class {color: indigo}
28 | .clj-record {color: #5dcd03}
29 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/css/viewer.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | pre.static-code {
8 | margin: 0.3em;
9 | }
10 |
11 | div.header {
12 | position: fixed;
13 | top: 0;
14 | left: 0;
15 | width: 100%;
16 | height: 16px;
17 | background-color: #eeeeee;
18 | border-bottom: solid #4682b4;
19 | border-width: 1px;
20 | padding: 0.3em;
21 | font-family: "Arvo", sans-serif;
22 | font-size: 12px;
23 | color: #FF29D2;
24 | z-index: 100;
25 | }
26 |
27 | div.header a {
28 | color: #FF29D2;
29 | }
30 |
31 | div.header-left {
32 | float: left;
33 | }
34 |
35 | div.header-right {
36 | float: right;
37 | padding-right: 0.6em;
38 | }
39 |
40 | div.status {
41 | top: 30%;
42 | }
43 |
44 | div.copyBox {
45 | font-family: 'Lora', serif;
46 | font-size: 15px;
47 | position: fixed;
48 | top: 60px;
49 | left: 50%;
50 | width: 600px;
51 | margin-left: -300px;
52 | padding: 20px;
53 | border-style: solid;
54 | border-color: #888888;
55 | border-width: 1px;
56 | background-color: #F1F1F1;
57 | z-index: 100;
58 | line-height: 130%;
59 | }
60 |
61 | div.copyBox li {
62 | padding-bottom: 0.3em;
63 | }
64 |
65 | div#contents {
66 | padding-top: 12px;
67 | }
68 |
69 | div.veiled {
70 | opacity: 0.3;
71 | }
72 |
73 | div.button {
74 | padding: 0.5em;
75 | background: #4682b4;
76 | color: #ffffff;
77 | border: solid 1px #888888;
78 | width: 100px;
79 | margin: 0 auto;
80 | text-align: center;
81 | font-family: "Arvo", sans-serif;
82 | font-weight: 700;
83 | margin-top: 2em;
84 | }
85 |
86 | div.button:hover {
87 | color: #cccccc;
88 | }
89 |
90 |
91 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JonyEpsilon/gorilla-repl/47fe408ddf28dc5b87ae198336126b2ce1722674/resources/gorilla-repl-client/favicon.ico
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js-viewer/bitbucket.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | var getFromBitbucket = function (user, repo, path, revision, callback) {
8 | $.get("https://bitbucket.org/api/1.0/repositories/" + user + "/" + repo + "/raw/" + revision + "/" + path, callback);
9 | };
10 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js-viewer/github.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | var getFromGithub = function (user, repo, path, callback) {
8 | $.get("https://api.github.com/repos/" + user + "/" + repo + "/contents/" + path).success(function (data) {
9 | callback(decodeGitHubBase64(data.content));
10 | });
11 | };
12 |
13 | var getFromGist = function (id, filename, callback) {
14 | $.get("https://api.github.com/gists/" + id).success(function (data) {
15 | var file;
16 | // default to the only file
17 | if (_.size(data.files) == 1) file = data.files[Object.keys(data.files)[0]];
18 | else file = data.files[filename];
19 | console.log(file);
20 | callback(file.content);
21 | });
22 | };
23 |
24 | var decodeGitHubBase64 = function (data) {
25 | function b64_to_utf8(str) {
26 | return decodeURIComponent(escape(window.atob(str)));
27 | }
28 | return b64_to_utf8(data.replace(/\n/g, ""));
29 | };
30 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js-viewer/segment-viewer.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | // Stripped down segment viewmodels for the viewer.
8 |
9 | // a code segment contains code, and shows the results of running that code.
10 | var codeSegment = function (contents, consoleText, output) {
11 | var self = {};
12 | self.renderTemplate = "code-segment-template";
13 | self.worksheet = worksheet;
14 | self.id = UUID.generate();
15 | self.type = "code";
16 |
17 |
18 | self.errorText = ko.observable("");
19 | if (consoleText) self.consoleText = ko.observable(consoleText);
20 | else self.consoleText = ko.observable("");
21 | if (output) self.output = ko.observable(output);
22 | else self.output = ko.observable("");
23 |
24 | if (contents) self.contents = ko.observable(contents);
25 | else self.contents = ko.observable("");
26 |
27 | return self;
28 | };
29 |
30 | // a free segment contains markdown
31 | var freeSegment = function (contents) {
32 | var self = {};
33 | self.renderTemplate = "free-segment-template";
34 | self.id = UUID.generate();
35 |
36 | self.type = "free";
37 |
38 | if (contents) self.contents = ko.observable(contents);
39 | else self.contents = ko.observable("");
40 |
41 | self.renderedContent = ko.computed(function () {
42 | return marked(self.contents());
43 | }).extend({throttle: 250});
44 |
45 | return self;
46 | };
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js-viewer/worksheet-viewer.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | // A stripped down worksheet viewmodel for the viewer.
8 |
9 | var worksheet = function () {
10 | var self = {};
11 |
12 | // the content of the worksheet is a list of segments.
13 | self.segments = ko.observableArray();
14 |
15 | return self;
16 | };
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js/codeDialog.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | // The viewmodel for the code dialog user interface component, used for presenting code to the user (last-chance, value
8 | // copy-and-paste).
9 |
10 | var codeDialog = function () {
11 |
12 | var self = {};
13 |
14 | self.shown = ko.observable(false);
15 | self.caption = ko.observable("");
16 | self.message = ko.observable("");
17 | self.okButtonText = ko.observable("");
18 | // this is used to control/read the focus state of the text input. The text input is the only part of the palette
19 | // that will take the focus, and is focused when the dialog appears.
20 | self.focused = ko.observable(false);
21 | // the text the user has put in the box
22 | self.contents = ko.observable("");
23 | // will be called when the dialog is hidden (either by clicking the button, clicking the overlay,
24 | // or hitting esc).
25 | self.hideCallback = null;
26 |
27 | // Show the dialog
28 | self.show = function (options) {
29 | self.caption(options.caption);
30 | self.contents(options.contents);
31 | self.message(options.message);
32 | self.okButtonText(options.okButtonText);
33 | self.hideCallback = options.hideCallback;
34 | self.shown(true);
35 | self.focused(true);
36 | };
37 |
38 | self.hide = function () {
39 | self.shown(false);
40 | self.hideCallback();
41 | };
42 |
43 | // The overlay is a viewport sized div that sits behind the dialog, but over everything else.
44 | self.handleOverlayClick = function () {
45 | self.hide();
46 | };
47 |
48 | self.handleOKClick = function () {
49 | self.hide();
50 | };
51 |
52 | // This is bound to keypresses on the text input.
53 | self.handleKeyPress = function (d, event) {
54 | // esc
55 | if (event.keyCode === 27) {
56 | self.hide();
57 | return false;
58 | }
59 | // Pass through keypresses to the default handler.
60 | return true;
61 | };
62 |
63 | return self;
64 | };
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js/completions.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | var clojureCompleter = function (cm, callback, options) {
8 | // The gist of this is lifted from the auto-completion modes included with CodeMirror.
9 | var cur = cm.getCursor();
10 | var token = cm.getTokenAt(cur);
11 | var word = token.string;
12 | var start = token.start;
13 | var end = token.end;
14 |
15 | // we send the whole editor contents as context, with __prefix__ inserted instead of the token.
16 | var doc = cm.getDoc().copy(false);
17 | doc.replaceRange("__prefix__", {line: cur.line, ch: start}, {line: cur.line, ch: end});
18 | var context = doc.getValue();
19 |
20 | // we need to know what namespace the user is currently working in, which we get from the evaluator module
21 | var ns = repl.currentNamespace;
22 |
23 | // TODO: this is a workaround for https://github.com/alexander-yakushev/compliment/issues/15
24 | if (word[0] != "/") {
25 | repl.getCompletions(word, ns, context, function (compl) {
26 | var completions = {
27 | list: compl,
28 | from: CodeMirror.Pos(cur.line, start),
29 | to: CodeMirror.Pos(cur.line, end)
30 | };
31 |
32 | // We show docs for the selected completion
33 | CodeMirror.on(completions, "select", function (s) {
34 | // TODO: this is a workaround for https://github.com/alexander-yakushev/compliment/issues/15
35 | if (s != "/") {
36 | repl.getCompletionDoc(s, ns, function (docs) {
37 | if (docs != null && docs != "")
38 | eventBus.trigger("app:show-doc", docs);
39 | else eventBus.trigger("app:hide-doc");
40 | });
41 | }
42 | });
43 |
44 | // When the autocomplete UI is dismissed, hide the docs
45 | CodeMirror.on(completions, "close", function () {
46 | eventBus.trigger("app:hide-doc");
47 | });
48 |
49 | // Show the UI
50 | callback(completions);
51 | });
52 | }
53 | };
54 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js/docViewer.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | var docViewer = function () {
8 |
9 | var self = {};
10 |
11 | self.shown = ko.observable(false);
12 | self.doc = ko.observable("");
13 | self.show = function () {
14 | // OK, this is really, really nasty. Position the doc viewer next to the CM autocomplete pop-up.
15 | var rect = $(".CodeMirror-hints")[0].getBoundingClientRect();
16 | var dv = $(".doc-viewer");
17 | dv.css({top: rect.top, left: rect.right});
18 | self.shown(true);
19 | };
20 |
21 | self.hide = function () {
22 | self.shown(false);
23 | };
24 |
25 | return self;
26 | };
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js/eventbus.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | // The event bus is nothing more than a jquery selection that can be used to register and trigger events.
8 |
9 | var eventBus = $({});
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js/mathJaxViewer.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | // This defines a very simple binding that displays its value, and on every update
8 | // asks MathJax to reprocess the output.
9 | ko.bindingHandlers.mathJaxViewer = {
10 | init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
11 | // make sure the element has a unique ID
12 | $(element).attr('id', 'mathjax-viewer-' + UUID.generate());
13 | },
14 | update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
15 | var value = ko.utils.unwrapObservable(valueAccessor()());
16 | $(element).html(value);
17 | // MathJax might not be available.
18 | if ("MathJax" in window) MathJax.Hub.Queue(["Typeset", MathJax.Hub, $(element).attr('id')]);
19 | }
20 | };
21 |
22 | // configure the MathJax library - we always guard for the case where MathJax was not loaded as it non-essential, and
23 | // not bundled with the Gorilla distribution.
24 | if ("MathJax" in window) {
25 | MathJax.Hub.Config({
26 | messageStyle: "none",
27 | showProcessingMessages: false,
28 | skipStartupTypeset: true,
29 | tex2jax: {
30 | inlineMath: [
31 | ['@@', '@@']
32 | ]
33 | }
34 | });
35 | MathJax.Hub.Configured();
36 | }
37 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js/outputViewer.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | // Takes the REPL output and views it. The real work is handed over to the renderer, the outputViewer handles parsing
8 | // the data, errors etc.
9 |
10 | ko.bindingHandlers.outputViewer = {
11 | init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
12 | },
13 | update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
14 |
15 | // get the value to display
16 | var value = ko.utils.unwrapObservable(valueAccessor()());
17 |
18 | // to handle any errors, we need to know the ID of the segment that this output belongs to
19 | var segID = allBindingsAccessor.get('segmentID');
20 | // the errorHandler will route error messages to the segment's error div
21 | var errorHandler = function (msg) {
22 | eventBus.trigger("output:output-error", {segmentID: segID, error: msg});
23 | };
24 |
25 | if (value !== "") {
26 | try {
27 | var parsedValue = JSON.parse(value);
28 | // The renderer does all of the real work
29 | render(parsedValue, element, errorHandler);
30 | } catch (e) {
31 | // as a fallback, we display the value directly if we can't parse it as json. This also at least
32 | // allows worksheets that pre-date the new renderer to load, even if they look ugly!
33 | $(element).text(value);
34 | }
35 | }
36 | else $(element).html("");
37 | }
38 | };
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js/saveDialog.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | // The viewmodel for the save dialog user interface component.
8 |
9 | var saveDialog = function (callback) {
10 |
11 | var self = {};
12 |
13 | self.shown = ko.observable(false);
14 | // this is used to control/read the focus state of the text input. The text input is the only part of the palette
15 | // that will take the focus, and is focused when the dialog appears.
16 | self.focused = ko.observable(false);
17 | // the text the user has put in the box
18 | self.filename = ko.observable(".clj");
19 | // the checkbox that determines to save with markup
20 | self.markup = ko.observable(true);
21 |
22 | // Show the dialog
23 | self.show = function ( existingFilename ) {
24 | existingFilename && (self.filename(existingFilename));
25 | self.markup();
26 | self.shown(true);
27 | self.focused(true);
28 | };
29 |
30 | self.hide = function () {
31 | self.shown(false);
32 | };
33 |
34 | // The overlay is a viewport sized div that sits behind the dialog, but over everything else.
35 | self.handleOverlayClick = function () {
36 | self.hide();
37 | };
38 |
39 | self.handleCancelClick = function () {
40 | self.hide();
41 | };
42 |
43 | self.handleOKClick = function () {
44 | self.hide();
45 | callback(self.filename(), self.markup());
46 | };
47 |
48 | // This is bound to keypresses on the text input.
49 | self.handleKeyPress = function (d, event) {
50 | // esc
51 | if (event.keyCode === 27) {
52 | self.hide();
53 | return false;
54 | }
55 | // enter
56 | if (event.keyCode === 13) {
57 | self.hide();
58 | callback(self.filename(), self.markup());
59 | return false;
60 | }
61 | // Pass through keypresses to the default handler.
62 | return true;
63 | };
64 |
65 | return self;
66 | };
67 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/js/worksheetParser.pegjs:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
3 | *
4 | * gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
5 | */
6 |
7 | // The parser takes a worksheet persisted as a marked up clojure file and returns a list of segments.
8 |
9 | worksheet = worksheetHeader seg:segmentWithBlankLine* {return seg;}
10 |
11 | lineEnd = "\n" / "\r\n"
12 |
13 | worksheetHeader = ";; gorilla-repl.fileformat = 1" lineEnd lineEnd
14 |
15 | segmentWithBlankLine = seg:segment lineEnd? {return seg;}
16 |
17 | segment = freeSegment / codeSegment
18 |
19 | freeSegment = freeSegmentOpenTag content:stringNoDelim? freeSegmentCloseTag
20 | {return freeSegment(unmakeClojureComment(content));}
21 |
22 | freeSegmentOpenTag = ";; **" lineEnd
23 |
24 | freeSegmentCloseTag = lineEnd ";; **" lineEnd
25 |
26 | codeSegment = codeSegmentOpenTag content:stringNoDelim? codeSegmentCloseTag cs:consoleSection? out:outputSection?
27 | {return codeSegment(content, unmakeClojureComment(cs), unmakeClojureComment(out));}
28 |
29 | codeSegmentOpenTag = ";; @@" lineEnd
30 |
31 | codeSegmentCloseTag = lineEnd ";; @@" lineEnd
32 |
33 | outputSection = outputOpenTag output:stringNoDelim outputCloseTag {return output;}
34 |
35 | outputOpenTag = ";; =>" lineEnd
36 |
37 | outputCloseTag = lineEnd ";; <=" lineEnd
38 |
39 | consoleSection = consoleOpenTag cs:stringNoDelim consoleCloseTag {return cs;}
40 |
41 | consoleOpenTag = ";; ->" lineEnd
42 |
43 | consoleCloseTag = lineEnd ";; <-" lineEnd
44 |
45 | stringNoDelim = cs:noDelimChar+ {return cs.join("");}
46 |
47 | delimiter = freeSegmentOpenTag / freeSegmentCloseTag /codeSegmentOpenTag / codeSegmentCloseTag / outputOpenTag /
48 | outputCloseTag / consoleOpenTag / consoleCloseTag
49 |
50 | noDelimChar = !delimiter c:. {return c;}
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/dialog/dialog.css:
--------------------------------------------------------------------------------
1 | .CodeMirror-dialog {
2 | position: absolute;
3 | left: 0; right: 0;
4 | background: white;
5 | z-index: 15;
6 | padding: .1em .8em;
7 | overflow: hidden;
8 | color: #333;
9 | }
10 |
11 | .CodeMirror-dialog-top {
12 | border-bottom: 1px solid #eee;
13 | top: 0;
14 | }
15 |
16 | .CodeMirror-dialog-bottom {
17 | border-top: 1px solid #eee;
18 | bottom: 0;
19 | }
20 |
21 | .CodeMirror-dialog input {
22 | border: none;
23 | outline: none;
24 | background: transparent;
25 | width: 20em;
26 | color: inherit;
27 | font-family: monospace;
28 | }
29 |
30 | .CodeMirror-dialog button {
31 | font-size: 70%;
32 | }
33 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/display/fullscreen.css:
--------------------------------------------------------------------------------
1 | .CodeMirror-fullscreen {
2 | position: fixed;
3 | top: 0; left: 0; right: 0; bottom: 0;
4 | height: auto;
5 | z-index: 9;
6 | }
7 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/display/fullscreen.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {
15 | if (old == CodeMirror.Init) old = false;
16 | if (!old == !val) return;
17 | if (val) setFullscreen(cm);
18 | else setNormal(cm);
19 | });
20 |
21 | function setFullscreen(cm) {
22 | var wrap = cm.getWrapperElement();
23 | cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
24 | width: wrap.style.width, height: wrap.style.height};
25 | wrap.style.width = "";
26 | wrap.style.height = "auto";
27 | wrap.className += " CodeMirror-fullscreen";
28 | document.documentElement.style.overflow = "hidden";
29 | cm.refresh();
30 | }
31 |
32 | function setNormal(cm) {
33 | var wrap = cm.getWrapperElement();
34 | wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
35 | document.documentElement.style.overflow = "";
36 | var info = cm.state.fullScreenRestore;
37 | wrap.style.width = info.width; wrap.style.height = info.height;
38 | window.scrollTo(info.scrollLeft, info.scrollTop);
39 | cm.refresh();
40 | }
41 | });
42 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/display/placeholder.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
13 | var prev = old && old != CodeMirror.Init;
14 | if (val && !prev) {
15 | cm.on("blur", onBlur);
16 | cm.on("change", onChange);
17 | onChange(cm);
18 | } else if (!val && prev) {
19 | cm.off("blur", onBlur);
20 | cm.off("change", onChange);
21 | clearPlaceholder(cm);
22 | var wrapper = cm.getWrapperElement();
23 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
24 | }
25 |
26 | if (val && !cm.hasFocus()) onBlur(cm);
27 | });
28 |
29 | function clearPlaceholder(cm) {
30 | if (cm.state.placeholder) {
31 | cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
32 | cm.state.placeholder = null;
33 | }
34 | }
35 | function setPlaceholder(cm) {
36 | clearPlaceholder(cm);
37 | var elt = cm.state.placeholder = document.createElement("pre");
38 | elt.style.cssText = "height: 0; overflow: visible";
39 | elt.className = "CodeMirror-placeholder";
40 | elt.appendChild(document.createTextNode(cm.getOption("placeholder")));
41 | cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
42 | }
43 |
44 | function onBlur(cm) {
45 | if (isEmpty(cm)) setPlaceholder(cm);
46 | }
47 | function onChange(cm) {
48 | var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
49 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
50 |
51 | if (empty) setPlaceholder(cm);
52 | else clearPlaceholder(cm);
53 | }
54 |
55 | function isEmpty(cm) {
56 | return (cm.lineCount() === 1) && (cm.getLine(0) === "");
57 | }
58 | });
59 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/display/rulers.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | CodeMirror.defineOption("rulers", false, function(cm, val, old) {
15 | if (old && old != CodeMirror.Init) {
16 | clearRulers(cm);
17 | cm.off("refresh", refreshRulers);
18 | }
19 | if (val && val.length) {
20 | setRulers(cm);
21 | cm.on("refresh", refreshRulers);
22 | }
23 | });
24 |
25 | function clearRulers(cm) {
26 | for (var i = cm.display.lineSpace.childNodes.length - 1; i >= 0; i--) {
27 | var node = cm.display.lineSpace.childNodes[i];
28 | if (/(^|\s)CodeMirror-ruler($|\s)/.test(node.className))
29 | node.parentNode.removeChild(node);
30 | }
31 | }
32 |
33 | function setRulers(cm) {
34 | var val = cm.getOption("rulers");
35 | var cw = cm.defaultCharWidth();
36 | var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left;
37 | var minH = cm.display.scroller.offsetHeight + 30;
38 | for (var i = 0; i < val.length; i++) {
39 | var elt = document.createElement("div");
40 | elt.className = "CodeMirror-ruler";
41 | var col, cls = null, conf = val[i];
42 | if (typeof conf == "number") {
43 | col = conf;
44 | } else {
45 | col = conf.column;
46 | if (conf.className) elt.className += " " + conf.className;
47 | if (conf.color) elt.style.borderColor = conf.color;
48 | if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle;
49 | if (conf.width) elt.style.borderLeftWidth = conf.width;
50 | cls = val[i].className;
51 | }
52 | elt.style.left = (left + col * cw) + "px";
53 | elt.style.top = "-50px";
54 | elt.style.bottom = "-20px";
55 | elt.style.minHeight = minH + "px";
56 | cm.display.lineSpace.insertBefore(elt, cm.display.cursorDiv);
57 | }
58 | }
59 |
60 | function refreshRulers(cm) {
61 | clearRulers(cm);
62 | setRulers(cm);
63 | }
64 | });
65 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/edit/continuelist.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | var listRE = /^(\s*)([*+-]|(\d+)\.)(\s+)/,
15 | unorderedBullets = "*+-";
16 |
17 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
18 | if (cm.getOption("disableInput")) return CodeMirror.Pass;
19 | var ranges = cm.listSelections(), replacements = [];
20 | for (var i = 0; i < ranges.length; i++) {
21 | var pos = ranges[i].head, match;
22 | var inList = cm.getStateAfter(pos.line).list !== false;
23 |
24 | if (!ranges[i].empty() || !inList || !(match = cm.getLine(pos.line).match(listRE))) {
25 | cm.execCommand("newlineAndIndent");
26 | return;
27 | }
28 | var indent = match[1], after = match[4];
29 | var bullet = unorderedBullets.indexOf(match[2]) >= 0
30 | ? match[2]
31 | : (parseInt(match[3], 10) + 1) + ".";
32 |
33 | replacements[i] = "\n" + indent + bullet + after;
34 | }
35 |
36 | cm.replaceSelections(replacements);
37 | };
38 | });
39 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/edit/matchtags.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror", "../fold/xml-fold"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
15 | if (old && old != CodeMirror.Init) {
16 | cm.off("cursorActivity", doMatchTags);
17 | cm.off("viewportChange", maybeUpdateMatch);
18 | clear(cm);
19 | }
20 | if (val) {
21 | cm.state.matchBothTags = typeof val == "object" && val.bothTags;
22 | cm.on("cursorActivity", doMatchTags);
23 | cm.on("viewportChange", maybeUpdateMatch);
24 | doMatchTags(cm);
25 | }
26 | });
27 |
28 | function clear(cm) {
29 | if (cm.state.tagHit) cm.state.tagHit.clear();
30 | if (cm.state.tagOther) cm.state.tagOther.clear();
31 | cm.state.tagHit = cm.state.tagOther = null;
32 | }
33 |
34 | function doMatchTags(cm) {
35 | cm.state.failedTagMatch = false;
36 | cm.operation(function() {
37 | clear(cm);
38 | if (cm.somethingSelected()) return;
39 | var cur = cm.getCursor(), range = cm.getViewport();
40 | range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
41 | var match = CodeMirror.findMatchingTag(cm, cur, range);
42 | if (!match) return;
43 | if (cm.state.matchBothTags) {
44 | var hit = match.at == "open" ? match.open : match.close;
45 | if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"});
46 | }
47 | var other = match.at == "close" ? match.open : match.close;
48 | if (other)
49 | cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
50 | else
51 | cm.state.failedTagMatch = true;
52 | });
53 | }
54 |
55 | function maybeUpdateMatch(cm) {
56 | if (cm.state.failedTagMatch) doMatchTags(cm);
57 | }
58 |
59 | CodeMirror.commands.toMatchingTag = function(cm) {
60 | var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
61 | if (found) {
62 | var other = found.at == "close" ? found.open : found.close;
63 | if (other) cm.extendSelection(other.to, other.from);
64 | }
65 | };
66 | });
67 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/edit/trailingspace.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
13 | if (prev == CodeMirror.Init) prev = false;
14 | if (prev && !val)
15 | cm.removeOverlay("trailingspace");
16 | else if (!prev && val)
17 | cm.addOverlay({
18 | token: function(stream) {
19 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
20 | if (i > stream.pos) { stream.pos = i; return null; }
21 | stream.pos = l;
22 | return "trailingspace";
23 | },
24 | name: "trailingspace"
25 | });
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/fold/comment-fold.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | CodeMirror.registerGlobalHelper("fold", "comment", function(mode) {
15 | return mode.blockCommentStart && mode.blockCommentEnd;
16 | }, function(cm, start) {
17 | var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd;
18 | if (!startToken || !endToken) return;
19 | var line = start.line, lineText = cm.getLine(line);
20 |
21 | var startCh;
22 | for (var at = start.ch, pass = 0;;) {
23 | var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1);
24 | if (found == -1) {
25 | if (pass == 1) return;
26 | pass = 1;
27 | at = lineText.length;
28 | continue;
29 | }
30 | if (pass == 1 && found < start.ch) return;
31 | if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) {
32 | startCh = found + startToken.length;
33 | break;
34 | }
35 | at = found - 1;
36 | }
37 |
38 | var depth = 1, lastLine = cm.lastLine(), end, endCh;
39 | outer: for (var i = line; i <= lastLine; ++i) {
40 | var text = cm.getLine(i), pos = i == line ? startCh : 0;
41 | for (;;) {
42 | var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
43 | if (nextOpen < 0) nextOpen = text.length;
44 | if (nextClose < 0) nextClose = text.length;
45 | pos = Math.min(nextOpen, nextClose);
46 | if (pos == text.length) break;
47 | if (pos == nextOpen) ++depth;
48 | else if (!--depth) { end = i; endCh = pos; break outer; }
49 | ++pos;
50 | }
51 | }
52 | if (end == null || line == end && endCh == startCh) return;
53 | return {from: CodeMirror.Pos(line, startCh),
54 | to: CodeMirror.Pos(end, endCh)};
55 | });
56 |
57 | });
58 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/fold/foldgutter.css:
--------------------------------------------------------------------------------
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 | cursor: pointer;
14 | }
15 | .CodeMirror-foldgutter-open:after {
16 | content: "\25BE";
17 | }
18 | .CodeMirror-foldgutter-folded:after {
19 | content: "\25B8";
20 | }
21 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/fold/indent-fold.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | CodeMirror.registerHelper("fold", "indent", function(cm, start) {
15 | var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
16 | if (!/\S/.test(firstLine)) return;
17 | var getIndent = function(line) {
18 | return CodeMirror.countColumn(line, null, tabSize);
19 | };
20 | var myIndent = getIndent(firstLine);
21 | var lastLineInFold = null;
22 | // Go through lines until we find a line that definitely doesn't belong in
23 | // the block we're folding, or to the end.
24 | for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) {
25 | var curLine = cm.getLine(i);
26 | var curIndent = getIndent(curLine);
27 | if (curIndent > myIndent) {
28 | // Lines with a greater indent are considered part of the block.
29 | lastLineInFold = i;
30 | } else if (!/\S/.test(curLine)) {
31 | // Empty lines might be breaks within the block we're trying to fold.
32 | } else {
33 | // A non-empty line at an indent equal to or less than ours marks the
34 | // start of another block.
35 | break;
36 | }
37 | }
38 | if (lastLineInFold) return {
39 | from: CodeMirror.Pos(start.line, firstLine.length),
40 | to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length)
41 | };
42 | });
43 |
44 | });
45 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/fold/markdown-fold.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | CodeMirror.registerHelper("fold", "markdown", function(cm, start) {
15 | var maxDepth = 100;
16 |
17 | function isHeader(lineNo) {
18 | var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0));
19 | return tokentype && /\bheader\b/.test(tokentype);
20 | }
21 |
22 | function headerLevel(lineNo, line, nextLine) {
23 | var match = line && line.match(/^#+/);
24 | if (match && isHeader(lineNo)) return match[0].length;
25 | match = nextLine && nextLine.match(/^[=\-]+\s*$/);
26 | if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2;
27 | return maxDepth;
28 | }
29 |
30 | var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1);
31 | var level = headerLevel(start.line, firstLine, nextLine);
32 | if (level === maxDepth) return undefined;
33 |
34 | var lastLineNo = cm.lastLine();
35 | var end = start.line, nextNextLine = cm.getLine(end + 2);
36 | while (end < lastLineNo) {
37 | if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break;
38 | ++end;
39 | nextLine = nextNextLine;
40 | nextNextLine = cm.getLine(end + 2);
41 | }
42 |
43 | return {
44 | from: CodeMirror.Pos(start.line, firstLine.length),
45 | to: CodeMirror.Pos(end, cm.getLine(end).length)
46 | };
47 | });
48 |
49 | });
50 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/hint/anyword-hint.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | var WORD = /[\w$]+/, RANGE = 500;
15 |
16 | CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
17 | var word = options && options.word || WORD;
18 | var range = options && options.range || RANGE;
19 | var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
20 | var start = cur.ch, end = start;
21 | while (end < curLine.length && word.test(curLine.charAt(end))) ++end;
22 | while (start && word.test(curLine.charAt(start - 1))) --start;
23 | var curWord = start != end && curLine.slice(start, end);
24 |
25 | var list = [], seen = {};
26 | var re = new RegExp(word.source, "g");
27 | for (var dir = -1; dir <= 1; dir += 2) {
28 | var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
29 | for (; line != endLine; line += dir) {
30 | var text = editor.getLine(line), m;
31 | while (m = re.exec(text)) {
32 | if (line == cur.line && m[0] === curWord) continue;
33 | if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) {
34 | seen[m[0]] = true;
35 | list.push(m[0]);
36 | }
37 | }
38 | }
39 | }
40 | return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};
41 | });
42 | });
43 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/hint/css-hint.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"), require("../../mode/css/css"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror", "../../mode/css/css"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | var pseudoClasses = {link: 1, visited: 1, active: 1, hover: 1, focus: 1,
15 | "first-letter": 1, "first-line": 1, "first-child": 1,
16 | before: 1, after: 1, lang: 1};
17 |
18 | CodeMirror.registerHelper("hint", "css", function(cm) {
19 | var cur = cm.getCursor(), token = cm.getTokenAt(cur);
20 | var inner = CodeMirror.innerMode(cm.getMode(), token.state);
21 | if (inner.mode.name != "css") return;
22 |
23 | var word = token.string, start = token.start, end = token.end;
24 | if (/[^\w$_-]/.test(word)) {
25 | word = ""; start = end = cur.ch;
26 | }
27 |
28 | var spec = CodeMirror.resolveMode("text/css");
29 |
30 | var result = [];
31 | function add(keywords) {
32 | for (var name in keywords)
33 | if (!word || name.lastIndexOf(word, 0) == 0)
34 | result.push(name);
35 | }
36 |
37 | var st = inner.state.state;
38 | if (st == "pseudo" || token.type == "variable-3") {
39 | add(pseudoClasses);
40 | } else if (st == "block" || st == "maybeprop") {
41 | add(spec.propertyKeywords);
42 | } else if (st == "prop" || st == "parens" || st == "at" || st == "params") {
43 | add(spec.valueKeywords);
44 | add(spec.colorKeywords);
45 | } else if (st == "media" || st == "media_parens") {
46 | add(spec.mediaTypes);
47 | add(spec.mediaFeatures);
48 | }
49 |
50 | if (result.length) return {
51 | list: result,
52 | from: CodeMirror.Pos(cur.line, start),
53 | to: CodeMirror.Pos(cur.line, end)
54 | };
55 | });
56 | });
57 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/hint/show-hint.css:
--------------------------------------------------------------------------------
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 | }
39 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/lint/coffeescript-lint.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js
5 |
6 | // declare global: coffeelint
7 |
8 | (function(mod) {
9 | if (typeof exports == "object" && typeof module == "object") // CommonJS
10 | mod(require("../../lib/codemirror"));
11 | else if (typeof define == "function" && define.amd) // AMD
12 | define(["../../lib/codemirror"], mod);
13 | else // Plain browser env
14 | mod(CodeMirror);
15 | })(function(CodeMirror) {
16 | "use strict";
17 |
18 | CodeMirror.registerHelper("lint", "coffeescript", function(text) {
19 | var found = [];
20 | var parseError = function(err) {
21 | var loc = err.lineNumber;
22 | found.push({from: CodeMirror.Pos(loc-1, 0),
23 | to: CodeMirror.Pos(loc, 0),
24 | severity: err.level,
25 | message: err.message});
26 | };
27 | try {
28 | var res = coffeelint.lint(text);
29 | for(var i = 0; i < res.length; i++) {
30 | parseError(res[i]);
31 | }
32 | } catch(e) {
33 | found.push({from: CodeMirror.Pos(e.location.first_line, 0),
34 | to: CodeMirror.Pos(e.location.last_line, e.location.last_column),
35 | severity: 'error',
36 | message: e.message});
37 | }
38 | return found;
39 | });
40 |
41 | });
42 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/lint/css-lint.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | // Depends on csslint.js from https://github.com/stubbornella/csslint
5 |
6 | // declare global: CSSLint
7 |
8 | (function(mod) {
9 | if (typeof exports == "object" && typeof module == "object") // CommonJS
10 | mod(require("../../lib/codemirror"));
11 | else if (typeof define == "function" && define.amd) // AMD
12 | define(["../../lib/codemirror"], mod);
13 | else // Plain browser env
14 | mod(CodeMirror);
15 | })(function(CodeMirror) {
16 | "use strict";
17 |
18 | CodeMirror.registerHelper("lint", "css", function(text) {
19 | var found = [];
20 | if (!window.CSSLint) return found;
21 | var results = CSSLint.verify(text), messages = results.messages, message = null;
22 | for ( var i = 0; i < messages.length; i++) {
23 | message = messages[i];
24 | var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col;
25 | found.push({
26 | from: CodeMirror.Pos(startLine, startCol),
27 | to: CodeMirror.Pos(endLine, endCol),
28 | message: message.message,
29 | severity : message.type
30 | });
31 | }
32 | return found;
33 | });
34 |
35 | });
36 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/lint/json-lint.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint
5 |
6 | // declare global: jsonlint
7 |
8 | (function(mod) {
9 | if (typeof exports == "object" && typeof module == "object") // CommonJS
10 | mod(require("../../lib/codemirror"));
11 | else if (typeof define == "function" && define.amd) // AMD
12 | define(["../../lib/codemirror"], mod);
13 | else // Plain browser env
14 | mod(CodeMirror);
15 | })(function(CodeMirror) {
16 | "use strict";
17 |
18 | CodeMirror.registerHelper("lint", "json", function(text) {
19 | var found = [];
20 | jsonlint.parseError = function(str, hash) {
21 | var loc = hash.loc;
22 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
23 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
24 | message: str});
25 | };
26 | try { jsonlint.parse(text); }
27 | catch(e) {}
28 | return found;
29 | });
30 |
31 | });
32 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/lint/yaml-lint.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | // Depends on js-yaml.js from https://github.com/nodeca/js-yaml
15 |
16 | // declare global: jsyaml
17 |
18 | CodeMirror.registerHelper("lint", "yaml", function(text) {
19 | var found = [];
20 | try { jsyaml.load(text); }
21 | catch(e) {
22 | var loc = e.mark;
23 | found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message });
24 | }
25 | return found;
26 | });
27 |
28 | });
29 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/mode/loadmode.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js";
13 |
14 | var loading = {};
15 | function splitCallback(cont, n) {
16 | var countDown = n;
17 | return function() { if (--countDown == 0) cont(); };
18 | }
19 | function ensureDeps(mode, cont) {
20 | var deps = CodeMirror.modes[mode].dependencies;
21 | if (!deps) return cont();
22 | var missing = [];
23 | for (var i = 0; i < deps.length; ++i) {
24 | if (!CodeMirror.modes.hasOwnProperty(deps[i]))
25 | missing.push(deps[i]);
26 | }
27 | if (!missing.length) return cont();
28 | var split = splitCallback(cont, missing.length);
29 | for (var i = 0; i < missing.length; ++i)
30 | CodeMirror.requireMode(missing[i], split);
31 | }
32 |
33 | CodeMirror.requireMode = function(mode, cont) {
34 | if (typeof mode != "string") mode = mode.name;
35 | if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont);
36 | if (loading.hasOwnProperty(mode)) return loading[mode].push(cont);
37 |
38 | var script = document.createElement("script");
39 | script.src = CodeMirror.modeURL.replace(/%N/g, mode);
40 | var others = document.getElementsByTagName("script")[0];
41 | others.parentNode.insertBefore(script, others);
42 | var list = loading[mode] = [cont];
43 | var count = 0, poll = setInterval(function() {
44 | if (++count > 100) return clearInterval(poll);
45 | if (CodeMirror.modes.hasOwnProperty(mode)) {
46 | clearInterval(poll);
47 | loading[mode] = null;
48 | ensureDeps(mode, function() {
49 | for (var i = 0; i < list.length; ++i) list[i]();
50 | });
51 | }
52 | }, 200);
53 | };
54 |
55 | CodeMirror.autoLoadMode = function(instance, mode) {
56 | if (!CodeMirror.modes.hasOwnProperty(mode))
57 | CodeMirror.requireMode(mode, function() {
58 | instance.setOption("mode", instance.getOption("mode"));
59 | });
60 | };
61 | });
62 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/mode/multiplex_test.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function() {
5 | CodeMirror.defineMode("markdown_with_stex", function(){
6 | var inner = CodeMirror.getMode({}, "stex");
7 | var outer = CodeMirror.getMode({}, "markdown");
8 |
9 | var innerOptions = {
10 | open: '$',
11 | close: '$',
12 | mode: inner,
13 | delimStyle: 'delim',
14 | innerStyle: 'inner'
15 | };
16 |
17 | return CodeMirror.multiplexingMode(outer, innerOptions);
18 | });
19 |
20 | var mode = CodeMirror.getMode({}, "markdown_with_stex");
21 |
22 | function MT(name) {
23 | test.mode(
24 | name,
25 | mode,
26 | Array.prototype.slice.call(arguments, 1),
27 | 'multiplexing');
28 | }
29 |
30 | MT(
31 | "stexInsideMarkdown",
32 | "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]");
33 | })();
34 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/runmode/colorize.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"), require("./runmode"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror", "./runmode"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/;
15 |
16 | function textContent(node, out) {
17 | if (node.nodeType == 3) return out.push(node.nodeValue);
18 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) {
19 | textContent(ch, out);
20 | if (isBlock.test(node.nodeType)) out.push("\n");
21 | }
22 | }
23 |
24 | CodeMirror.colorize = function(collection, defaultMode) {
25 | if (!collection) collection = document.body.getElementsByTagName("pre");
26 |
27 | for (var i = 0; i < collection.length; ++i) {
28 | var node = collection[i];
29 | var mode = node.getAttribute("data-lang") || defaultMode;
30 | if (!mode) continue;
31 |
32 | var text = [];
33 | textContent(node, text);
34 | node.innerHTML = "";
35 | CodeMirror.runMode(text.join(""), mode, node);
36 |
37 | node.className += " cm-s-default";
38 | }
39 | };
40 | });
41 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/scroll/scrollpastend.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) {
15 | if (old && old != CodeMirror.Init) {
16 | cm.off("change", onChange);
17 | cm.off("refresh", updateBottomMargin);
18 | cm.display.lineSpace.parentNode.style.paddingBottom = "";
19 | cm.state.scrollPastEndPadding = null;
20 | }
21 | if (val) {
22 | cm.on("change", onChange);
23 | cm.on("refresh", updateBottomMargin);
24 | updateBottomMargin(cm);
25 | }
26 | });
27 |
28 | function onChange(cm, change) {
29 | if (CodeMirror.changeEnd(change).line == cm.lastLine())
30 | updateBottomMargin(cm);
31 | }
32 |
33 | function updateBottomMargin(cm) {
34 | var padding = "";
35 | if (cm.lineCount() > 1) {
36 | var totalH = cm.display.scroller.clientHeight - 30,
37 | lastLineH = cm.getLineHandle(cm.lastLine()).height;
38 | padding = (totalH - lastLineH) + "px";
39 | }
40 | if (cm.state.scrollPastEndPadding != padding) {
41 | cm.state.scrollPastEndPadding = padding;
42 | cm.display.lineSpace.parentNode.style.paddingBottom = padding;
43 | cm.setSize();
44 | }
45 | }
46 | });
47 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/tern/tern.css:
--------------------------------------------------------------------------------
1 | .CodeMirror-Tern-completion {
2 | padding-left: 22px;
3 | position: relative;
4 | }
5 | .CodeMirror-Tern-completion:before {
6 | position: absolute;
7 | left: 2px;
8 | bottom: 2px;
9 | border-radius: 50%;
10 | font-size: 12px;
11 | font-weight: bold;
12 | height: 15px;
13 | width: 15px;
14 | line-height: 16px;
15 | text-align: center;
16 | color: white;
17 | -moz-box-sizing: border-box;
18 | box-sizing: border-box;
19 | }
20 | .CodeMirror-Tern-completion-unknown:before {
21 | content: "?";
22 | background: #4bb;
23 | }
24 | .CodeMirror-Tern-completion-object:before {
25 | content: "O";
26 | background: #77c;
27 | }
28 | .CodeMirror-Tern-completion-fn:before {
29 | content: "F";
30 | background: #7c7;
31 | }
32 | .CodeMirror-Tern-completion-array:before {
33 | content: "A";
34 | background: #c66;
35 | }
36 | .CodeMirror-Tern-completion-number:before {
37 | content: "1";
38 | background: #999;
39 | }
40 | .CodeMirror-Tern-completion-string:before {
41 | content: "S";
42 | background: #999;
43 | }
44 | .CodeMirror-Tern-completion-bool:before {
45 | content: "B";
46 | background: #999;
47 | }
48 |
49 | .CodeMirror-Tern-completion-guess {
50 | color: #999;
51 | }
52 |
53 | .CodeMirror-Tern-tooltip {
54 | border: 1px solid silver;
55 | border-radius: 3px;
56 | color: #444;
57 | padding: 2px 5px;
58 | font-size: 90%;
59 | font-family: monospace;
60 | background-color: white;
61 | white-space: pre-wrap;
62 |
63 | max-width: 40em;
64 | position: absolute;
65 | z-index: 10;
66 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
67 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
68 | box-shadow: 2px 3px 5px rgba(0,0,0,.2);
69 |
70 | transition: opacity 1s;
71 | -moz-transition: opacity 1s;
72 | -webkit-transition: opacity 1s;
73 | -o-transition: opacity 1s;
74 | -ms-transition: opacity 1s;
75 | }
76 |
77 | .CodeMirror-Tern-hint-doc {
78 | max-width: 25em;
79 | margin-top: -3px;
80 | }
81 |
82 | .CodeMirror-Tern-fname { color: black; }
83 | .CodeMirror-Tern-farg { color: #70a; }
84 | .CodeMirror-Tern-farg-current { text-decoration: underline; }
85 | .CodeMirror-Tern-type { color: #07c; }
86 | .CodeMirror-Tern-fhint-guess { opacity: .7; }
87 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/addon/tern/worker.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | // declare global: tern, server
5 |
6 | var server;
7 |
8 | this.onmessage = function(e) {
9 | var data = e.data;
10 | switch (data.type) {
11 | case "init": return startServer(data.defs, data.plugins, data.scripts);
12 | case "add": return server.addFile(data.name, data.text);
13 | case "del": return server.delFile(data.name);
14 | case "req": return server.request(data.body, function(err, reqData) {
15 | postMessage({id: data.id, body: reqData, err: err && String(err)});
16 | });
17 | case "getFile":
18 | var c = pending[data.id];
19 | delete pending[data.id];
20 | return c(data.err, data.text);
21 | default: throw new Error("Unknown message type: " + data.type);
22 | }
23 | };
24 |
25 | var nextId = 0, pending = {};
26 | function getFile(file, c) {
27 | postMessage({type: "getFile", name: file, id: ++nextId});
28 | pending[nextId] = c;
29 | }
30 |
31 | function startServer(defs, plugins, scripts) {
32 | if (scripts) importScripts.apply(null, scripts);
33 |
34 | server = new tern.Server({
35 | getFile: getFile,
36 | async: true,
37 | defs: defs,
38 | plugins: plugins
39 | });
40 | }
41 |
42 | var console = {
43 | log: function(v) { postMessage({type: "debug", message: v}); }
44 | };
45 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/apl/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
CodeMirror: APL mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 |
16 |
17 |
22 |
26 |
27 |
28 |
29 | APL mode
30 |
56 |
57 |
64 |
65 | Simple mode that tries to handle APL as well as it can.
66 | It attempts to label functions/operators based upon
67 | monadic/dyadic usage (but this is far from fully fleshed out).
68 | This means there are meaningful classnames so hover states can
69 | have popups etc.
70 |
71 | MIME types defined: text/apl
(APL code)
72 |
73 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: CSS mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | CSS mode
27 |
28 | /* Some example CSS */
29 |
30 | @import url("something.css");
31 |
32 | body {
33 | margin: 0;
34 | padding: 3em 6em;
35 | font-family: tahoma, arial, sans-serif;
36 | color: #000;
37 | }
38 |
39 | #navigation a {
40 | font-weight: bold;
41 | text-decoration: none !important;
42 | }
43 |
44 | h1 {
45 | font-size: 2.5em;
46 | }
47 |
48 | h2 {
49 | font-size: 1.7em;
50 | }
51 |
52 | h1:before, h2:before {
53 | content: "::";
54 | }
55 |
56 | code {
57 | font-family: courier, monospace;
58 | font-size: 80%;
59 | color: #418A8A;
60 | }
61 |
62 |
65 |
66 | MIME types defined: text/css
, text/x-scss
(demo ), text/x-less
(demo ).
67 |
68 | Parsing/Highlighting Tests: normal , verbose .
69 |
70 |
71 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/css/less_test.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function() {
5 | "use strict";
6 |
7 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less");
8 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); }
9 |
10 | MT("variable",
11 | "[variable-2 @base]: [atom #f04615];",
12 | "[qualifier .class] {",
13 | " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]",
14 | " [property color]: [variable saturate]([variable-2 @base], [number 5%]);",
15 | "}");
16 |
17 | MT("amp",
18 | "[qualifier .child], [qualifier .sibling] {",
19 | " [qualifier .parent] [atom &] {",
20 | " [property color]: [keyword black];",
21 | " }",
22 | " [atom &] + [atom &] {",
23 | " [property color]: [keyword red];",
24 | " }",
25 | "}");
26 |
27 | MT("mixin",
28 | "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",
29 | " [property color]: [variable darken]([variable-2 @color], [number 10%]);",
30 | "}",
31 | "[qualifier .mixin] ([variable light]; [variable-2 @color]) {",
32 | " [property color]: [variable lighten]([variable-2 @color], [number 10%]);",
33 | "}",
34 | "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",
35 | " [property display]: [atom block];",
36 | "}",
37 | "[variable-2 @switch]: [variable light];",
38 | "[qualifier .class] {",
39 | " [qualifier .mixin]([variable-2 @switch]; [atom #888]);",
40 | "}");
41 |
42 | MT("nest",
43 | "[qualifier .one] {",
44 | " [def @media] ([property width]: [number 400px]) {",
45 | " [property font-size]: [number 1.2em];",
46 | " [def @media] [attribute print] [keyword and] [property color] {",
47 | " [property color]: [keyword blue];",
48 | " }",
49 | " }",
50 | "}");
51 | })();
52 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/cypher/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Cypher Mode for CodeMirror
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
17 |
18 |
19 |
20 |
25 |
29 |
30 |
31 |
32 | Cypher Mode for CodeMirror
33 |
34 | // Cypher Mode for CodeMirror, using the neo theme
35 | MATCH (joe { name: 'Joe' })-[:knows*2..2]-(friend_of_friend)
36 | WHERE NOT (joe)-[:knows]-(friend_of_friend)
37 | RETURN friend_of_friend.name, COUNT(*)
38 | ORDER BY COUNT(*) DESC , friend_of_friend.name
39 |
40 |
41 | MIME types defined:
42 | application/x-cypher-query
43 |
44 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/diff/diff.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | CodeMirror.defineMode("diff", function() {
15 |
16 | var TOKEN_NAMES = {
17 | '+': 'positive',
18 | '-': 'negative',
19 | '@': 'meta'
20 | };
21 |
22 | return {
23 | token: function(stream) {
24 | var tw_pos = stream.string.search(/[\t ]+?$/);
25 |
26 | if (!stream.sol() || tw_pos === 0) {
27 | stream.skipToEnd();
28 | return ("error " + (
29 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
30 | }
31 |
32 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();
33 |
34 | if (tw_pos === -1) {
35 | stream.skipToEnd();
36 | } else {
37 | stream.pos = tw_pos;
38 | }
39 |
40 | return token_name;
41 | }
42 | };
43 | });
44 |
45 | CodeMirror.defineMIME("text/x-diff", "diff");
46 |
47 | });
48 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/django/django.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: http://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"),
7 | require("../../addon/mode/overlay"));
8 | else if (typeof define == "function" && define.amd) // AMD
9 | define(["../../lib/codemirror", "../htmlmixed/htmlmixed",
10 | "../../addon/mode/overlay"], mod);
11 | else // Plain browser env
12 | mod(CodeMirror);
13 | })(function(CodeMirror) {
14 | "use strict";
15 |
16 | CodeMirror.defineMode("django:inner", function() {
17 | var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false",
18 | "loop", "none", "self", "super", "if", "endif", "as", "not", "and",
19 | "else", "import", "with", "endwith", "without", "context", "ifequal", "endifequal",
20 | "ifnotequal", "endifnotequal", "extends", "include", "load", "length", "comment",
21 | "endcomment", "empty"];
22 | keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b");
23 |
24 | function tokenBase (stream, state) {
25 | stream.eatWhile(/[^\{]/);
26 | var ch = stream.next();
27 | if (ch == "{") {
28 | if (ch = stream.eat(/\{|%|#/)) {
29 | state.tokenize = inTag(ch);
30 | return "tag";
31 | }
32 | }
33 | }
34 | function inTag (close) {
35 | if (close == "{") {
36 | close = "}";
37 | }
38 | return function (stream, state) {
39 | var ch = stream.next();
40 | if ((ch == close) && stream.eat("}")) {
41 | state.tokenize = tokenBase;
42 | return "tag";
43 | }
44 | if (stream.match(keywords)) {
45 | return "keyword";
46 | }
47 | return close == "#" ? "comment" : "string";
48 | };
49 | }
50 | return {
51 | startState: function () {
52 | return {tokenize: tokenBase};
53 | },
54 | token: function (stream, state) {
55 | return state.tokenize(stream, state);
56 | }
57 | };
58 | });
59 |
60 | CodeMirror.defineMode("django", function(config) {
61 | var htmlBase = CodeMirror.getMode(config, "text/html");
62 | var djangoInner = CodeMirror.getMode(config, "django:inner");
63 | return CodeMirror.overlayMode(htmlBase, djangoInner);
64 | });
65 |
66 | CodeMirror.defineMIME("text/x-django", "django");
67 | });
68 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/django/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Django template mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
22 |
26 |
27 |
28 |
29 | Django template mode
30 |
31 |
32 |
33 |
34 | My Django web application
35 |
36 |
37 |
38 | {{ page.title }}
39 |
40 |
41 | {% for item in items %}
42 | {% item.name %}
43 | {% empty %}
44 | You have no items in your list.
45 | {% endfor %}
46 |
47 |
48 |
49 |
50 |
51 |
59 |
60 | Mode for HTML with embedded Django template markup.
61 |
62 | MIME types defined: text/x-django
63 |
64 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/ecl/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: ECL mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | ECL mode
27 |
28 | /*
29 | sample useless code to demonstrate ecl syntax highlighting
30 | this is a multiline comment!
31 | */
32 |
33 | // this is a singleline comment!
34 |
35 | import ut;
36 | r :=
37 | record
38 | string22 s1 := '123';
39 | integer4 i1 := 123;
40 | end;
41 | #option('tmp', true);
42 | d := dataset('tmp::qb', r, thor);
43 | output(d);
44 |
45 |
48 |
49 | Based on CodeMirror's clike mode. For more information see HPCC Systems web site.
50 | MIME types defined: text/x-ecl
.
51 |
52 |
53 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/erlang/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Erlang mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
25 |
26 |
27 |
28 | Erlang mode
29 |
30 | %% -*- mode: erlang; erlang-indent-level: 2 -*-
31 | %%% Created : 7 May 2012 by mats cronqvist
32 |
33 | %% @doc
34 | %% Demonstrates how to print a record.
35 | %% @end
36 |
37 | -module('ex').
38 | -author('mats cronqvist').
39 | -export([demo/0,
40 | rec_info/1]).
41 |
42 | -record(demo,{a="One",b="Two",c="Three",d="Four"}).
43 |
44 | rec_info(demo) -> record_info(fields,demo).
45 |
46 | demo() -> expand_recs(?MODULE,#demo{a="A",b="BB"}).
47 |
48 | expand_recs(M,List) when is_list(List) ->
49 | [expand_recs(M,L)||L<-List];
50 | expand_recs(M,Tup) when is_tuple(Tup) ->
51 | case tuple_size(Tup) of
52 | L when L < 1 -> Tup;
53 | L ->
54 | try
55 | Fields = M:rec_info(element(1,Tup)),
56 | L = length(Fields)+1,
57 | lists:zip(Fields,expand_recs(M,tl(tuple_to_list(Tup))))
58 | catch
59 | _:_ -> list_to_tuple(expand_recs(M,tuple_to_list(Tup)))
60 | end
61 | end;
62 | expand_recs(_,Term) ->
63 | Term.
64 |
65 |
66 |
74 |
75 | MIME types defined: text/x-erlang
.
76 |
77 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/gas/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Gas mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Gas mode
27 |
28 |
29 | .syntax unified
30 | .global main
31 |
32 | /*
33 | * A
34 | * multi-line
35 | * comment.
36 | */
37 |
38 | @ A single line comment.
39 |
40 | main:
41 | push {sp, lr}
42 | ldr r0, =message
43 | bl puts
44 | mov r0, #0
45 | pop {sp, pc}
46 |
47 | message:
48 | .asciz "Hello world! "
49 |
50 |
51 |
52 |
58 |
59 | Handles AT&T assembler syntax (more specifically this handles
60 | the GNU Assembler (gas) syntax.)
61 | It takes a single optional configuration parameter:
62 | architecture
, which can be one of "ARM"
,
63 | "ARMv6"
or "x86"
.
64 | Including the parameter adds syntax for the registers and special
65 | directives for the supplied architecture.
66 |
67 |
MIME types defined: text/x-gas
68 |
69 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/gfm/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: GFM mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
26 |
30 |
31 |
32 |
33 | GFM mode
34 |
35 | GitHub Flavored Markdown
36 | ========================
37 |
38 | Everything from markdown plus GFM features:
39 |
40 | ## URL autolinking
41 |
42 | Underscores_are_allowed_between_words.
43 |
44 | ## Fenced code blocks (and syntax highlighting)
45 |
46 | ```javascript
47 | for (var i = 0; i < items.length; i++) {
48 | console.log(items[i], i); // log them
49 | }
50 | ```
51 |
52 | ## Task Lists
53 |
54 | - [ ] Incomplete task list item
55 | - [x] **Completed** task list item
56 |
57 | ## A bit of GitHub spice
58 |
59 | * SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
60 | * User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
61 | * User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
62 | * \#Num: #1
63 | * User/#Num: mojombo#1
64 | * User/Project#Num: mojombo/god#1
65 |
66 | See http://github.github.com/github-flavored-markdown/.
67 |
68 |
69 |
70 |
77 |
78 | Optionally depends on other modes for properly highlighted code blocks.
79 |
80 | Parsing/Highlighting Tests: normal , verbose .
81 |
82 |
83 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/gherkin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Gherkin mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Gherkin mode
27 |
28 | Feature: Using Google
29 | Background:
30 | Something something
31 | Something else
32 | Scenario: Has a homepage
33 | When I navigate to the google home page
34 | Then the home page should contain the menu and the search form
35 | Scenario: Searching for a term
36 | When I navigate to the google home page
37 | When I search for Tofu
38 | Then the search results page is displayed
39 | Then the search results page contains 10 individual search results
40 | Then the search results contain a link to the wikipedia tofu page
41 |
42 |
45 |
46 | MIME types defined: text/x-feature
.
47 |
48 |
49 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/go/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Go mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
25 |
26 |
27 |
28 | Go mode
29 |
30 | // Prime Sieve in Go.
31 | // Taken from the Go specification.
32 | // Copyright © The Go Authors.
33 |
34 | package main
35 |
36 | import "fmt"
37 |
38 | // Send the sequence 2, 3, 4, ... to channel 'ch'.
39 | func generate(ch chan<- int) {
40 | for i := 2; ; i++ {
41 | ch <- i // Send 'i' to channel 'ch'
42 | }
43 | }
44 |
45 | // Copy the values from channel 'src' to channel 'dst',
46 | // removing those divisible by 'prime'.
47 | func filter(src <-chan int, dst chan<- int, prime int) {
48 | for i := range src { // Loop over values received from 'src'.
49 | if i%prime != 0 {
50 | dst <- i // Send 'i' to channel 'dst'.
51 | }
52 | }
53 | }
54 |
55 | // The prime sieve: Daisy-chain filter processes together.
56 | func sieve() {
57 | ch := make(chan int) // Create a new channel.
58 | go generate(ch) // Start generate() as a subprocess.
59 | for {
60 | prime := <-ch
61 | fmt.Print(prime, "\n")
62 | ch1 := make(chan int)
63 | go filter(ch, ch1, prime)
64 | ch = ch1
65 | }
66 | }
67 |
68 | func main() {
69 | sieve()
70 | }
71 |
72 |
73 |
83 |
84 | MIME type: text/x-go
85 |
86 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/groovy/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Groovy mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
20 |
24 |
25 |
26 |
27 | Groovy mode
28 |
29 | //Pattern for groovy script
30 | def p = ~/.*\.groovy/
31 | new File( 'd:\\scripts' ).eachFileMatch(p) {f ->
32 | // imports list
33 | def imports = []
34 | f.eachLine {
35 | // condition to detect an import instruction
36 | ln -> if ( ln =~ '^import .*' ) {
37 | imports << "${ln - 'import '}"
38 | }
39 | }
40 | // print thmen
41 | if ( ! imports.empty ) {
42 | println f
43 | imports.each{ println " $it" }
44 | }
45 | }
46 |
47 | /* Coin changer demo code from http://groovy.codehaus.org */
48 |
49 | enum UsCoin {
50 | quarter(25), dime(10), nickel(5), penny(1)
51 | UsCoin(v) { value = v }
52 | final value
53 | }
54 |
55 | enum OzzieCoin {
56 | fifty(50), twenty(20), ten(10), five(5)
57 | OzzieCoin(v) { value = v }
58 | final value
59 | }
60 |
61 | def plural(word, count) {
62 | if (count == 1) return word
63 | word[-1] == 'y' ? word[0..-2] + "ies" : word + "s"
64 | }
65 |
66 | def change(currency, amount) {
67 | currency.values().inject([]){ list, coin ->
68 | int count = amount / coin.value
69 | amount = amount % coin.value
70 | list += "$count ${plural(coin.toString(), count)}"
71 | }
72 | }
73 |
74 |
75 |
82 |
83 | MIME types defined: text/x-groovy
84 |
85 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/haml/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: HAML mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
23 |
27 |
28 |
29 |
30 | HAML mode
31 |
32 | !!!
33 | #content
34 | .left.column(title="title"){:href => "/hello", :test => "#{hello}_#{world}"}
35 |
36 | %h2 Welcome to our site!
37 | %p= puts "HAML MODE"
38 | .right.column
39 | = render :partial => "sidebar"
40 |
41 | .container
42 | .row
43 | .span8
44 | %h1.title= @page_title
45 | %p.title= @page_title
46 | %p
47 | /
48 | The same as HTML comment
49 | Hello multiline comment
50 |
51 | -# haml comment
52 | This wont be displayed
53 | nor will this
54 | Date/Time:
55 | - now = DateTime.now
56 | %strong= now
57 | - if now > DateTime.parse("December 31, 2006")
58 | = "Happy new " + "year!"
59 |
60 | %title
61 | = @title
62 | \= @title
63 | Title
64 |
65 | Title
66 |
67 |
68 |
74 |
75 | MIME types defined: text/x-haml
.
76 |
77 | Parsing/Highlighting Tests: normal , verbose .
78 |
79 |
80 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/haskell/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Haskell mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
25 |
26 |
27 |
28 | Haskell mode
29 |
30 | module UniquePerms (
31 | uniquePerms
32 | )
33 | where
34 |
35 | -- | Find all unique permutations of a list where there might be duplicates.
36 | uniquePerms :: (Eq a) => [a] -> [[a]]
37 | uniquePerms = permBag . makeBag
38 |
39 | -- | An unordered collection where duplicate values are allowed,
40 | -- but represented with a single value and a count.
41 | type Bag a = [(a, Int)]
42 |
43 | makeBag :: (Eq a) => [a] -> Bag a
44 | makeBag [] = []
45 | makeBag (a:as) = mix a $ makeBag as
46 | where
47 | mix a [] = [(a,1)]
48 | mix a (bn@(b,n):bs) | a == b = (b,n+1):bs
49 | | otherwise = bn : mix a bs
50 |
51 | permBag :: Bag a -> [[a]]
52 | permBag [] = [[]]
53 | permBag bs = concatMap (\(f,cs) -> map (f:) $ permBag cs) . oneOfEach $ bs
54 | where
55 | oneOfEach [] = []
56 | oneOfEach (an@(a,n):bs) =
57 | let bs' = if n == 1 then bs else (a,n-1):bs
58 | in (a,bs') : mapSnd (an:) (oneOfEach bs)
59 |
60 | apSnd f (a,b) = (a, f b)
61 | mapSnd = map . apSnd
62 |
63 |
64 |
71 |
72 | MIME types defined: text/x-haskell
.
73 |
74 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/htmlembedded/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Html Embedded Scripts mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
23 |
27 |
28 |
29 |
30 | Html Embedded Scripts mode
31 |
32 | <%
33 | function hello(who) {
34 | return "Hello " + who;
35 | }
36 | %>
37 | This is an example of EJS (embedded javascript)
38 | The program says <%= hello("world") %>.
39 |
42 |
43 |
44 |
52 |
53 | Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on
54 | JavaScript, CSS and XML. Other dependancies include those of the scriping language chosen.
55 |
56 | MIME types defined: application/x-aspx
(ASP.NET),
57 | application/x-ejs
(Embedded Javascript), application/x-jsp
(JavaServer Pages)
58 |
59 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/http/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: HTTP mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | HTTP mode
27 |
28 |
29 |
30 | POST /somewhere HTTP/1.1
31 | Host: example.com
32 | If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
33 | Content-Type: application/x-www-form-urlencoded;
34 | charset=utf-8
35 | User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11
36 |
37 | This is the request body!
38 |
39 |
40 |
43 |
44 | MIME types defined: message/http
.
45 |
46 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/javascript/json-ld.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: JSON-LD mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
22 |
26 |
27 |
28 |
29 | JSON-LD mode
30 |
31 |
32 |
33 | {
34 | "@context": {
35 | "name": "http://schema.org/name",
36 | "description": "http://schema.org/description",
37 | "image": {
38 | "@id": "http://schema.org/image",
39 | "@type": "@id"
40 | },
41 | "geo": "http://schema.org/geo",
42 | "latitude": {
43 | "@id": "http://schema.org/latitude",
44 | "@type": "xsd:float"
45 | },
46 | "longitude": {
47 | "@id": "http://schema.org/longitude",
48 | "@type": "xsd:float"
49 | },
50 | "xsd": "http://www.w3.org/2001/XMLSchema#"
51 | },
52 | "name": "The Empire State Building",
53 | "description": "The Empire State Building is a 102-story landmark in New York City.",
54 | "image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
55 | "geo": {
56 | "latitude": "40.75",
57 | "longitude": "73.98"
58 | }
59 | }
60 |
61 |
62 |
70 |
71 | This is a specialization of the JavaScript mode .
72 |
73 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/javascript/typescript.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: TypeScript mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | TypeScript mode
27 |
28 |
29 |
30 | class Greeter {
31 | greeting: string;
32 | constructor (message: string) {
33 | this.greeting = message;
34 | }
35 | greet() {
36 | return "Hello, " + this.greeting;
37 | }
38 | }
39 |
40 | var greeter = new Greeter("world");
41 |
42 | var button = document.createElement('button')
43 | button.innerText = "Say Hello"
44 | button.onclick = function() {
45 | alert(greeter.greet())
46 | }
47 |
48 | document.body.appendChild(button)
49 |
50 |
51 |
52 |
59 |
60 | This is a specialization of the JavaScript mode .
61 |
62 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/jinja2/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Jinja2 mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Jinja2 mode
27 |
28 | {# this is a comment #}
29 | {%- for item in li -%}
30 | <li>{{ item.label }}</li>
31 | {% endfor -%}
32 | {{ item.sand == true and item.keyword == false ? 1 : 0 }}
33 | {{ app.get(55, 1.2, true) }}
34 | {% if app.get('_route') == ('_home') %}home{% endif %}
35 | {% if app.session.flashbag.has('message') %}
36 | {% for message in app.session.flashbag.get('message') %}
37 | {{ message.content }}
38 | {% endfor %}
39 | {% endif %}
40 | {{ path('_home', {'section': app.request.get('section')}) }}
41 | {{ path('_home', {
42 | 'section': app.request.get('section'),
43 | 'boolean': true,
44 | 'number': 55.33
45 | })
46 | }}
47 | {% include ('test.incl.html.twig') %}
48 |
49 |
54 |
55 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/lua/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Lua mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
25 |
26 |
27 |
28 | Lua mode
29 |
30 | --[[
31 | example useless code to show lua syntax highlighting
32 | this is multiline comment
33 | ]]
34 |
35 | function blahblahblah(x)
36 |
37 | local table = {
38 | "asd" = 123,
39 | "x" = 0.34,
40 | }
41 | if x ~= 3 then
42 | print( x )
43 | elseif x == "string"
44 | my_custom_function( 0x34 )
45 | else
46 | unknown_function( "some string" )
47 | end
48 |
49 | --single line comment
50 |
51 | end
52 |
53 | function blablabla3()
54 |
55 | for k,v in ipairs( table ) do
56 | --abcde..
57 | y=[=[
58 | x=[[
59 | x is a multi line string
60 | ]]
61 | but its definition is iside a highest level string!
62 | ]=]
63 | print(" \"\" ")
64 |
65 | s = math.sin( x )
66 | end
67 |
68 | end
69 |
70 |
76 |
77 | Loosely based on Franciszek
78 | Wawrzak's CodeMirror
79 | 1 mode . One configuration parameter is
80 | supported, specials
, to which you can provide an
81 | array of strings to have those identifiers highlighted with
82 | the lua-special
style.
83 | MIME types defined: text/x-lua
.
84 |
85 |
86 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/ntriples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: NTriples mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
18 |
23 |
27 |
28 |
29 |
30 | NTriples mode
31 |
32 |
33 | .
34 | "literal 1" .
35 | _:bnode3 .
36 | _:bnode4 "literal 2"@lang .
37 | _:bnode5 "literal 3"^^ .
38 |
39 |
40 |
41 |
44 | MIME types defined: text/n-triples
.
45 |
46 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/octave/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Octave mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Octave mode
27 |
28 |
29 | %numbers
30 | [1234 1234i 1234j]
31 | [.234 .234j 2.23i]
32 | [23e2 12E1j 123D-4 0x234]
33 |
34 | %strings
35 | 'asda''a'
36 | "asda""a"
37 |
38 | %identifiers
39 | a + as123 - __asd__
40 |
41 | %operators
42 | -
43 | +
44 | =
45 | ==
46 | >
47 | <
48 | >=
49 | <=
50 | &
51 | ~
52 | ...
53 | break zeros default margin round ones rand
54 | ceil floor size clear zeros eye mean std cov
55 | error eval function
56 | abs acos atan asin cos cosh exp log prod sum
57 | log10 max min sign sin sinh sqrt tan reshape
58 | return
59 | case switch
60 | else elseif end if otherwise
61 | do for while
62 | try catch
63 | classdef properties events methods
64 | global persistent
65 |
66 | %one line comment
67 | %{ multi
68 | line commment %}
69 |
70 |
71 |
81 |
82 | MIME types defined: text/x-octave
.
83 |
84 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/pascal/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Pascal mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Pascal mode
27 |
28 |
29 |
30 | (* Example Pascal code *)
31 |
32 | while a <> b do writeln('Waiting');
33 |
34 | if a > b then
35 | writeln('Condition met')
36 | else
37 | writeln('Condition not met');
38 |
39 | for i := 1 to 10 do
40 | writeln('Iteration: ', i:1);
41 |
42 | repeat
43 | a := a + 1
44 | until a = 10;
45 |
46 | case i of
47 | 0: write('zero');
48 | 1: write('one');
49 | 2: write('two')
50 | end;
51 |
52 |
53 |
59 |
60 | MIME types defined: text/x-pascal
.
61 |
62 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/pegjs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CodeMirror: PEG.js Mode
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
23 |
27 |
28 |
29 |
30 | PEG.js Mode
31 |
32 | /*
33 | * Classic example grammar, which recognizes simple arithmetic expressions like
34 | * "2*(3+4)". The parser generated from this grammar then computes their value.
35 | */
36 |
37 | start
38 | = additive
39 |
40 | additive
41 | = left:multiplicative "+" right:additive { return left + right; }
42 | / multiplicative
43 |
44 | multiplicative
45 | = left:primary "*" right:multiplicative { return left * right; }
46 | / primary
47 |
48 | primary
49 | = integer
50 | / "(" additive:additive ")" { return additive; }
51 |
52 | integer "integer"
53 | = digits:[0-9]+ { return parseInt(digits.join(""), 10); }
54 |
55 | letter = [a-z]+
56 |
62 | The PEG.js Mode
63 | Created by Forbes Lindesay.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/perl/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Perl mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Perl mode
27 |
28 |
29 |
30 | #!/usr/bin/perl
31 |
32 | use Something qw(func1 func2);
33 |
34 | # strings
35 | my $s1 = qq'single line';
36 | our $s2 = q(multi-
37 | line);
38 |
39 | =item Something
40 | Example.
41 | =cut
42 |
43 | my $html=<<'HTML'
44 |
45 | hi!
46 |
47 | HTML
48 |
49 | print "first,".join(',', 'second', qq~third~);
50 |
51 | if($s1 =~ m[(?{$1}=$$.' predefined variables';
53 | $s2 =~ s/\-line//ox;
54 | $s1 =~ s[
55 | line ]
56 | [
57 | block
58 | ]ox;
59 | }
60 |
61 | 1; # numbers and comments
62 |
63 | __END__
64 | something...
65 |
66 |
67 |
68 |
73 |
74 | MIME types defined: text/x-perl
.
75 |
76 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/php/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: PHP mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
25 |
29 |
30 |
31 |
32 | PHP mode
33 |
34 | 1, 'b' => 2, 3 => 'c');
36 |
37 | echo "$a[a] ${a[3] /* } comment */} {$a[b]} \$a[a]";
38 |
39 | function hello($who) {
40 | return "Hello $who!";
41 | }
42 | ?>
43 | The program says = hello("World") ?>.
44 |
47 |
48 |
49 |
58 |
59 | Simple HTML/PHP mode based on
60 | the C-like mode. Depends on XML,
61 | JavaScript, CSS, HTMLMixed, and C-like modes.
62 |
63 | MIME types defined: application/x-httpd-php
(HTML with PHP code), text/x-php
(plain, non-wrapped PHP code).
64 |
65 |
--------------------------------------------------------------------------------
/resources/gorilla-repl-client/jslib/codemirror-4.5/mode/pig/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Pig Latin mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Pig Latin mode
27 |
28 | -- Apache Pig (Pig Latin Language) Demo
29 | /*
30 | This is a multiline comment.
31 | */
32 | a = LOAD "\path\to\input" USING PigStorage('\t') AS (x:long, y:chararray, z:bytearray);
33 | b = GROUP a BY (x,y,3+4);
34 | c = FOREACH b GENERATE flatten(group) as (x,y), SUM(group.$2) as z;
35 | STORE c INTO "\path\to\output";
36 |
37 | --
38 |
39 |
40 |
47 |
48 |
49 | Simple mode that handles Pig Latin language.
50 |
51 |
52 | MIME type defined: text/x-pig
53 | (PIG code)
54 |