administrate-field-simple_mde_markdown 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +72 -0
- data/.circleci/setup-rubygems.sh +3 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +196 -0
- data/LICENSE.txt +21 -0
- data/README.md +44 -0
- data/Rakefile +8 -0
- data/administrate-field-simple_mde_markdown.gemspec +31 -0
- data/app/assets/javascripts/administrate-field-simple_mde_markdown/application.js +6 -0
- data/app/assets/stylesheets/administrate-field-simple_mde_markdown/application.css +3 -0
- data/app/views/fields/simple_mde_markdown/_form.html.erb +6 -0
- data/app/views/fields/simple_mde_markdown/_index.html.erb +1 -0
- data/app/views/fields/simple_mde_markdown/_show.html.erb +1 -0
- data/lib/administrate/field/simple_mde_markdown.rb +31 -0
- data/node_modules/.bin/marked +1 -0
- data/node_modules/codemirror-spell-checker/.eslintrc +23 -0
- data/node_modules/codemirror-spell-checker/.npmignore +2 -0
- data/node_modules/codemirror-spell-checker/.travis.yml +18 -0
- data/node_modules/codemirror-spell-checker/CONTRIBUTING 2.md +10 -0
- data/node_modules/codemirror-spell-checker/CONTRIBUTING.md +10 -0
- data/node_modules/codemirror-spell-checker/LICENSE +22 -0
- data/node_modules/codemirror-spell-checker/README.md +50 -0
- data/node_modules/codemirror-spell-checker/bower.json +27 -0
- data/node_modules/codemirror-spell-checker/debug/.spell-checker 2.css.icloud +0 -0
- data/node_modules/codemirror-spell-checker/debug/spell-checker.css +9 -0
- data/node_modules/codemirror-spell-checker/debug/spell-checker.debug.js +2844 -0
- data/node_modules/codemirror-spell-checker/debug/spell-checker.js +2841 -0
- data/node_modules/codemirror-spell-checker/dist/.spell-checker.min 2.css.icloud +0 -0
- data/node_modules/codemirror-spell-checker/dist/en_US.aff +201 -0
- data/node_modules/codemirror-spell-checker/dist/en_US.dic +62120 -0
- data/node_modules/codemirror-spell-checker/dist/spell-checker.min 2.js +7 -0
- data/node_modules/codemirror-spell-checker/dist/spell-checker.min.css +7 -0
- data/node_modules/codemirror-spell-checker/dist/spell-checker.min.js +7 -0
- data/node_modules/codemirror-spell-checker/gulpfile.js +94 -0
- data/node_modules/codemirror-spell-checker/package.json +75 -0
- data/node_modules/codemirror-spell-checker/src/css/spell-checker.css +3 -0
- data/node_modules/codemirror-spell-checker/src/data/en_US.aff +201 -0
- data/node_modules/codemirror-spell-checker/src/data/en_US.dic +62120 -0
- data/node_modules/codemirror-spell-checker/src/js/spell-checker.js +119 -0
- data/node_modules/codemirror/.package 2.json.icloud +0 -0
- data/node_modules/codemirror/AUTHORS +773 -0
- data/node_modules/codemirror/CHANGELOG.md +1486 -0
- data/node_modules/codemirror/CONTRIBUTING.md +92 -0
- data/node_modules/codemirror/LICENSE +21 -0
- data/node_modules/codemirror/README.md +49 -0
- data/node_modules/codemirror/addon/comment/comment.js +209 -0
- data/node_modules/codemirror/addon/comment/continuecomment.js +78 -0
- data/node_modules/codemirror/addon/dialog/dialog.css +32 -0
- data/node_modules/codemirror/addon/dialog/dialog.js +161 -0
- data/node_modules/codemirror/addon/display/autorefresh.js +47 -0
- data/node_modules/codemirror/addon/display/fullscreen.css +6 -0
- data/node_modules/codemirror/addon/display/fullscreen.js +41 -0
- data/node_modules/codemirror/addon/display/panel.js +127 -0
- data/node_modules/codemirror/addon/display/placeholder.js +63 -0
- data/node_modules/codemirror/addon/display/rulers.js +51 -0
- data/node_modules/codemirror/addon/edit/closebrackets.js +187 -0
- data/node_modules/codemirror/addon/edit/closetag.js +175 -0
- data/node_modules/codemirror/addon/edit/continuelist.js +89 -0
- data/node_modules/codemirror/addon/edit/matchbrackets.js +145 -0
- data/node_modules/codemirror/addon/edit/matchtags.js +66 -0
- data/node_modules/codemirror/addon/edit/trailingspace.js +27 -0
- data/node_modules/codemirror/addon/fold/brace-fold.js +105 -0
- data/node_modules/codemirror/addon/fold/comment-fold.js +59 -0
- data/node_modules/codemirror/addon/fold/foldcode.js +152 -0
- data/node_modules/codemirror/addon/fold/foldgutter.css +20 -0
- data/node_modules/codemirror/addon/fold/foldgutter.js +146 -0
- data/node_modules/codemirror/addon/fold/indent-fold.js +48 -0
- data/node_modules/codemirror/addon/fold/markdown-fold.js +49 -0
- data/node_modules/codemirror/addon/fold/xml-fold.js +184 -0
- data/node_modules/codemirror/addon/hint/anyword-hint.js +41 -0
- data/node_modules/codemirror/addon/hint/css-hint.js +60 -0
- data/node_modules/codemirror/addon/hint/html-hint.js +348 -0
- data/node_modules/codemirror/addon/hint/javascript-hint.js +157 -0
- data/node_modules/codemirror/addon/hint/show-hint.css +36 -0
- data/node_modules/codemirror/addon/hint/show-hint.js +434 -0
- data/node_modules/codemirror/addon/hint/sql-hint.js +299 -0
- data/node_modules/codemirror/addon/hint/xml-hint.js +110 -0
- data/node_modules/codemirror/addon/lint/coffeescript-lint.js +47 -0
- data/node_modules/codemirror/addon/lint/css-lint.js +40 -0
- data/node_modules/codemirror/addon/lint/html-lint.js +53 -0
- data/node_modules/codemirror/addon/lint/javascript-lint.js +63 -0
- data/node_modules/codemirror/addon/lint/json-lint.js +40 -0
- data/node_modules/codemirror/addon/lint/lint.css +73 -0
- data/node_modules/codemirror/addon/lint/lint.js +252 -0
- data/node_modules/codemirror/addon/lint/yaml-lint.js +41 -0
- data/node_modules/codemirror/addon/merge/merge.css +119 -0
- data/node_modules/codemirror/addon/merge/merge.js +1002 -0
- data/node_modules/codemirror/addon/mode/loadmode.js +64 -0
- data/node_modules/codemirror/addon/mode/multiplex.js +131 -0
- data/node_modules/codemirror/addon/mode/multiplex_test.js +33 -0
- data/node_modules/codemirror/addon/mode/overlay.js +90 -0
- data/node_modules/codemirror/addon/mode/simple.js +216 -0
- data/node_modules/codemirror/addon/runmode/colorize.js +40 -0
- data/node_modules/codemirror/addon/runmode/runmode-standalone.js +158 -0
- data/node_modules/codemirror/addon/runmode/runmode.js +72 -0
- data/node_modules/codemirror/addon/runmode/runmode.node.js +197 -0
- data/node_modules/codemirror/addon/scroll/annotatescrollbar.js +122 -0
- data/node_modules/codemirror/addon/scroll/scrollpastend.js +48 -0
- data/node_modules/codemirror/addon/scroll/simplescrollbars.css +66 -0
- data/node_modules/codemirror/addon/scroll/simplescrollbars.js +152 -0
- data/node_modules/codemirror/addon/search/jump-to-line.js +50 -0
- data/node_modules/codemirror/addon/search/match-highlighter.js +165 -0
- data/node_modules/codemirror/addon/search/matchesonscrollbar.css +8 -0
- data/node_modules/codemirror/addon/search/matchesonscrollbar.js +97 -0
- data/node_modules/codemirror/addon/search/search.js +258 -0
- data/node_modules/codemirror/addon/search/searchcursor.js +293 -0
- data/node_modules/codemirror/addon/selection/active-line.js +72 -0
- data/node_modules/codemirror/addon/selection/mark-selection.js +119 -0
- data/node_modules/codemirror/addon/selection/selection-pointer.js +98 -0
- data/node_modules/codemirror/addon/tern/tern.css +87 -0
- data/node_modules/codemirror/addon/tern/tern.js +718 -0
- data/node_modules/codemirror/addon/tern/worker.js +44 -0
- data/node_modules/codemirror/addon/wrap/hardwrap.js +145 -0
- data/node_modules/codemirror/bin/source-highlight +48 -0
- data/node_modules/codemirror/keymap/emacs.js +417 -0
- data/node_modules/codemirror/keymap/sublime.js +691 -0
- data/node_modules/codemirror/keymap/vim.js +5467 -0
- data/node_modules/codemirror/lib/codemirror.css +346 -0
- data/node_modules/codemirror/lib/codemirror.js +9698 -0
- data/node_modules/codemirror/mode/apl/apl.js +174 -0
- data/node_modules/codemirror/mode/asciiarmor/asciiarmor.js +74 -0
- data/node_modules/codemirror/mode/asn.1/asn.1.js +204 -0
- data/node_modules/codemirror/mode/asterisk/asterisk.js +196 -0
- data/node_modules/codemirror/mode/brainfuck/brainfuck.js +85 -0
- data/node_modules/codemirror/mode/clike/clike.js +879 -0
- data/node_modules/codemirror/mode/clojure/clojure.js +292 -0
- data/node_modules/codemirror/mode/cmake/cmake.js +97 -0
- data/node_modules/codemirror/mode/cobol/cobol.js +255 -0
- data/node_modules/codemirror/mode/coffeescript/coffeescript.js +359 -0
- data/node_modules/codemirror/mode/commonlisp/commonlisp.js +124 -0
- data/node_modules/codemirror/mode/crystal/crystal.js +433 -0
- data/node_modules/codemirror/mode/css/css.js +832 -0
- data/node_modules/codemirror/mode/cypher/cypher.js +150 -0
- data/node_modules/codemirror/mode/d/d.js +223 -0
- data/node_modules/codemirror/mode/dart/dart.js +157 -0
- data/node_modules/codemirror/mode/diff/diff.js +47 -0
- data/node_modules/codemirror/mode/django/django.js +356 -0
- data/node_modules/codemirror/mode/dockerfile/dockerfile.js +211 -0
- data/node_modules/codemirror/mode/dtd/dtd.js +142 -0
- data/node_modules/codemirror/mode/dylan/dylan.js +352 -0
- data/node_modules/codemirror/mode/ebnf/ebnf.js +195 -0
- data/node_modules/codemirror/mode/ecl/ecl.js +206 -0
- data/node_modules/codemirror/mode/eiffel/eiffel.js +160 -0
- data/node_modules/codemirror/mode/elm/elm.js +205 -0
- data/node_modules/codemirror/mode/erlang/erlang.js +619 -0
- data/node_modules/codemirror/mode/factor/factor.js +85 -0
- data/node_modules/codemirror/mode/fcl/fcl.js +173 -0
- data/node_modules/codemirror/mode/forth/forth.js +180 -0
- data/node_modules/codemirror/mode/fortran/fortran.js +188 -0
- data/node_modules/codemirror/mode/gas/gas.js +345 -0
- data/node_modules/codemirror/mode/gfm/gfm.js +129 -0
- data/node_modules/codemirror/mode/gherkin/gherkin.js +178 -0
- data/node_modules/codemirror/mode/go/go.js +187 -0
- data/node_modules/codemirror/mode/groovy/groovy.js +230 -0
- data/node_modules/codemirror/mode/haml/haml.js +161 -0
- data/node_modules/codemirror/mode/handlebars/handlebars.js +66 -0
- data/node_modules/codemirror/mode/haskell-literate/haskell-literate.js +43 -0
- data/node_modules/codemirror/mode/haskell/haskell.js +268 -0
- data/node_modules/codemirror/mode/haxe/haxe.js +515 -0
- data/node_modules/codemirror/mode/htmlembedded/htmlembedded.js +37 -0
- data/node_modules/codemirror/mode/htmlmixed/htmlmixed.js +152 -0
- data/node_modules/codemirror/mode/http/http.js +113 -0
- data/node_modules/codemirror/mode/idl/idl.js +290 -0
- data/node_modules/codemirror/mode/javascript/javascript.js +899 -0
- data/node_modules/codemirror/mode/jinja2/jinja2.js +144 -0
- data/node_modules/codemirror/mode/jsx/jsx.js +148 -0
- data/node_modules/codemirror/mode/julia/julia.js +433 -0
- data/node_modules/codemirror/mode/livescript/livescript.js +280 -0
- data/node_modules/codemirror/mode/lua/lua.js +159 -0
- data/node_modules/codemirror/mode/markdown/markdown.js +884 -0
- data/node_modules/codemirror/mode/mathematica/mathematica.js +176 -0
- data/node_modules/codemirror/mode/mbox/mbox.js +129 -0
- data/node_modules/codemirror/mode/meta.js +217 -0
- data/node_modules/codemirror/mode/mirc/mirc.js +193 -0
- data/node_modules/codemirror/mode/mllike/mllike.js +359 -0
- data/node_modules/codemirror/mode/modelica/modelica.js +245 -0
- data/node_modules/codemirror/mode/mscgen/mscgen.js +175 -0
- data/node_modules/codemirror/mode/mumps/mumps.js +148 -0
- data/node_modules/codemirror/mode/nginx/nginx.js +178 -0
- data/node_modules/codemirror/mode/nsis/nsis.js +95 -0
- data/node_modules/codemirror/mode/ntriples/ntriples.js +195 -0
- data/node_modules/codemirror/mode/octave/octave.js +139 -0
- data/node_modules/codemirror/mode/oz/oz.js +252 -0
- data/node_modules/codemirror/mode/pascal/pascal.js +121 -0
- data/node_modules/codemirror/mode/pegjs/pegjs.js +114 -0
- data/node_modules/codemirror/mode/perl/perl.js +837 -0
- data/node_modules/codemirror/mode/php/php.js +234 -0
- data/node_modules/codemirror/mode/pig/pig.js +178 -0
- data/node_modules/codemirror/mode/powershell/powershell.js +398 -0
- data/node_modules/codemirror/mode/properties/properties 2.js +78 -0
- data/node_modules/codemirror/mode/properties/properties.js +78 -0
- data/node_modules/codemirror/mode/protobuf/protobuf.js +69 -0
- data/node_modules/codemirror/mode/pug/pug.js +591 -0
- data/node_modules/codemirror/mode/puppet/puppet.js +220 -0
- data/node_modules/codemirror/mode/python/python.js +409 -0
- data/node_modules/codemirror/mode/q/q.js +139 -0
- data/node_modules/codemirror/mode/r/r.js +190 -0
- data/node_modules/codemirror/mode/rpm/changes/index.html +66 -0
- data/node_modules/codemirror/mode/rpm/rpm.js +109 -0
- data/node_modules/codemirror/mode/rst/rst.js +557 -0
- data/node_modules/codemirror/mode/ruby/ruby.js +296 -0
- data/node_modules/codemirror/mode/rust/rust.js +72 -0
- data/node_modules/codemirror/mode/sas/sas.js +303 -0
- data/node_modules/codemirror/mode/sass/sass.js +454 -0
- data/node_modules/codemirror/mode/scheme/scheme.js +265 -0
- data/node_modules/codemirror/mode/shell/shell.js +152 -0
- data/node_modules/codemirror/mode/sieve/sieve.js +193 -0
- data/node_modules/codemirror/mode/slim/slim.js +575 -0
- data/node_modules/codemirror/mode/smalltalk/smalltalk.js +168 -0
- data/node_modules/codemirror/mode/smarty/smarty.js +225 -0
- data/node_modules/codemirror/mode/solr/solr.js +104 -0
- data/node_modules/codemirror/mode/soy/soy 2.js +359 -0
- data/node_modules/codemirror/mode/soy/soy.js +235 -0
- data/node_modules/codemirror/mode/sparql/sparql.js +180 -0
- data/node_modules/codemirror/mode/spreadsheet/spreadsheet.js +112 -0
- data/node_modules/codemirror/mode/sql/sql.js +499 -0
- data/node_modules/codemirror/mode/stex/stex.js +264 -0
- data/node_modules/codemirror/mode/stylus/stylus.js +771 -0
- data/node_modules/codemirror/mode/swift/swift.js +219 -0
- data/node_modules/codemirror/mode/tcl/tcl.js +139 -0
- data/node_modules/codemirror/mode/textile/textile.js +469 -0
- data/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.js +308 -0
- data/node_modules/codemirror/mode/tiki/tiki.css +26 -0
- data/node_modules/codemirror/mode/tiki/tiki.js +312 -0
- data/node_modules/codemirror/mode/toml/toml.js +88 -0
- data/node_modules/codemirror/mode/tornado/tornado.js +68 -0
- data/node_modules/codemirror/mode/troff/troff.js +84 -0
- data/node_modules/codemirror/mode/ttcn-cfg/ttcn-cfg.js +214 -0
- data/node_modules/codemirror/mode/ttcn/ttcn.js +283 -0
- data/node_modules/codemirror/mode/turtle/turtle.js +162 -0
- data/node_modules/codemirror/mode/twig/twig.js +141 -0
- data/node_modules/codemirror/mode/vb/vb.js +275 -0
- data/node_modules/codemirror/mode/vbscript/vbscript.js +350 -0
- data/node_modules/codemirror/mode/velocity/velocity.js +201 -0
- data/node_modules/codemirror/mode/verilog/verilog.js +675 -0
- data/node_modules/codemirror/mode/vhdl/vhdl.js +189 -0
- data/node_modules/codemirror/mode/vue/vue.js +77 -0
- data/node_modules/codemirror/mode/webidl/webidl.js +195 -0
- data/node_modules/codemirror/mode/xml/xml.js +402 -0
- data/node_modules/codemirror/mode/xquery/xquery.js +448 -0
- data/node_modules/codemirror/mode/yacas/yacas.js +204 -0
- data/node_modules/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +68 -0
- data/node_modules/codemirror/mode/yaml/yaml.js +120 -0
- data/node_modules/codemirror/mode/z80/z80.js +116 -0
- data/node_modules/codemirror/package.json +2395 -0
- data/node_modules/codemirror/rollup.config.js +20 -0
- data/node_modules/codemirror/src/codemirror.js +3 -0
- data/node_modules/codemirror/src/display/Display.js +106 -0
- data/node_modules/codemirror/src/display/focus.js +47 -0
- data/node_modules/codemirror/src/display/gutters.js +34 -0
- data/node_modules/codemirror/src/display/highlight_worker.js +55 -0
- data/node_modules/codemirror/src/display/line_numbers.js +48 -0
- data/node_modules/codemirror/src/display/mode_state.js +22 -0
- data/node_modules/codemirror/src/display/operations.js +205 -0
- data/node_modules/codemirror/src/display/scroll_events.js +115 -0
- data/node_modules/codemirror/src/display/scrollbars.js +193 -0
- data/node_modules/codemirror/src/display/scrolling.js +184 -0
- data/node_modules/codemirror/src/display/selection.js +158 -0
- data/node_modules/codemirror/src/display/update_display.js +260 -0
- data/node_modules/codemirror/src/display/update_line.js +188 -0
- data/node_modules/codemirror/src/display/update_lines.js +64 -0
- data/node_modules/codemirror/src/display/view_tracking.js +153 -0
- data/node_modules/codemirror/src/edit/CodeMirror.js +215 -0
- data/node_modules/codemirror/src/edit/commands.js +178 -0
- data/node_modules/codemirror/src/edit/deleteNearSelection.js +30 -0
- data/node_modules/codemirror/src/edit/drop_events.js +119 -0
- data/node_modules/codemirror/src/edit/fromTextArea.js +61 -0
- data/node_modules/codemirror/src/edit/global_events.js +42 -0
- data/node_modules/codemirror/src/edit/key_events.js +159 -0
- data/node_modules/codemirror/src/edit/legacy.js +62 -0
- data/node_modules/codemirror/src/edit/main.js +69 -0
- data/node_modules/codemirror/src/edit/methods.js +544 -0
- data/node_modules/codemirror/src/edit/mouse_events.js +407 -0
- data/node_modules/codemirror/src/edit/options.js +193 -0
- data/node_modules/codemirror/src/edit/utils.js +7 -0
- data/node_modules/codemirror/src/input/ContentEditableInput.js +527 -0
- data/node_modules/codemirror/src/input/TextareaInput.js +355 -0
- data/node_modules/codemirror/src/input/indent.js +71 -0
- data/node_modules/codemirror/src/input/input.js +135 -0
- data/node_modules/codemirror/src/input/keymap.js +148 -0
- data/node_modules/codemirror/src/input/keynames.js +17 -0
- data/node_modules/codemirror/src/input/movement.js +110 -0
- data/node_modules/codemirror/src/line/highlight.js +284 -0
- data/node_modules/codemirror/src/line/line_data.js +339 -0
- data/node_modules/codemirror/src/line/pos.js +40 -0
- data/node_modules/codemirror/src/line/saw_special_spans.js +10 -0
- data/node_modules/codemirror/src/line/spans.js +382 -0
- data/node_modules/codemirror/src/line/utils_line.js +85 -0
- data/node_modules/codemirror/src/measurement/position_measurement.js +699 -0
- data/node_modules/codemirror/src/measurement/widgets.js +26 -0
- data/node_modules/codemirror/src/model/Doc.js +432 -0
- data/node_modules/codemirror/src/model/change_measurement.js +61 -0
- data/node_modules/codemirror/src/model/changes.js +333 -0
- data/node_modules/codemirror/src/model/chunk.js +167 -0
- data/node_modules/codemirror/src/model/document_data.js +111 -0
- data/node_modules/codemirror/src/model/history.js +228 -0
- data/node_modules/codemirror/src/model/line_widget.js +78 -0
- data/node_modules/codemirror/src/model/mark_text.js +292 -0
- data/node_modules/codemirror/src/model/selection.js +84 -0
- data/node_modules/codemirror/src/model/selection_updates.js +208 -0
- data/node_modules/codemirror/src/modes.js +96 -0
- data/node_modules/codemirror/src/util/StringStream.js +90 -0
- data/node_modules/codemirror/src/util/bidi.js +214 -0
- data/node_modules/codemirror/src/util/browser.js +33 -0
- data/node_modules/codemirror/src/util/dom.js +97 -0
- data/node_modules/codemirror/src/util/event.js +103 -0
- data/node_modules/codemirror/src/util/feature_detection.js +84 -0
- data/node_modules/codemirror/src/util/misc.js +150 -0
- data/node_modules/codemirror/src/util/operation_group.js +72 -0
- data/node_modules/codemirror/theme/3024-day.css +41 -0
- data/node_modules/codemirror/theme/3024-night.css +39 -0
- data/node_modules/codemirror/theme/abcdef.css +32 -0
- data/node_modules/codemirror/theme/ambiance-mobile.css +5 -0
- data/node_modules/codemirror/theme/ambiance.css +74 -0
- data/node_modules/codemirror/theme/base16-dark.css +38 -0
- data/node_modules/codemirror/theme/base16-light.css +38 -0
- data/node_modules/codemirror/theme/bespin.css +34 -0
- data/node_modules/codemirror/theme/blackboard.css +32 -0
- data/node_modules/codemirror/theme/cobalt.css +25 -0
- data/node_modules/codemirror/theme/colorforth.css +33 -0
- data/node_modules/codemirror/theme/darcula.css +46 -0
- data/node_modules/codemirror/theme/dracula.css +40 -0
- data/node_modules/codemirror/theme/duotone-dark.css +35 -0
- data/node_modules/codemirror/theme/duotone-light.css +36 -0
- data/node_modules/codemirror/theme/eclipse.css +23 -0
- data/node_modules/codemirror/theme/elegant.css +13 -0
- data/node_modules/codemirror/theme/erlang-dark.css +34 -0
- data/node_modules/codemirror/theme/gruvbox-dark.css +37 -0
- data/node_modules/codemirror/theme/hopscotch.css +34 -0
- data/node_modules/codemirror/theme/icecoder.css +43 -0
- data/node_modules/codemirror/theme/idea.css +42 -0
- data/node_modules/codemirror/theme/isotope.css +34 -0
- data/node_modules/codemirror/theme/lesser-dark.css +47 -0
- data/node_modules/codemirror/theme/liquibyte.css +95 -0
- data/node_modules/codemirror/theme/lucario.css +37 -0
- data/node_modules/codemirror/theme/material.css +53 -0
- data/node_modules/codemirror/theme/mbo.css +37 -0
- data/node_modules/codemirror/theme/mdn-like.css +46 -0
- data/node_modules/codemirror/theme/midnight.css +43 -0
- data/node_modules/codemirror/theme/monokai.css +41 -0
- data/node_modules/codemirror/theme/neat.css +12 -0
- data/node_modules/codemirror/theme/neo.css +43 -0
- data/node_modules/codemirror/theme/night.css +27 -0
- data/node_modules/codemirror/theme/oceanic-next.css +44 -0
- data/node_modules/codemirror/theme/panda-syntax.css +85 -0
- data/node_modules/codemirror/theme/paraiso-dark.css +38 -0
- data/node_modules/codemirror/theme/paraiso-light.css +38 -0
- data/node_modules/codemirror/theme/pastel-on-dark.css +52 -0
- data/node_modules/codemirror/theme/railscasts.css +34 -0
- data/node_modules/codemirror/theme/rubyblue.css +25 -0
- data/node_modules/codemirror/theme/seti.css +44 -0
- data/node_modules/codemirror/theme/shadowfox.css +52 -0
- data/node_modules/codemirror/theme/solarized.css +168 -0
- data/node_modules/codemirror/theme/ssms.css +16 -0
- data/node_modules/codemirror/theme/the-matrix.css +30 -0
- data/node_modules/codemirror/theme/tomorrow-night-bright.css +35 -0
- data/node_modules/codemirror/theme/tomorrow-night-eighties.css +38 -0
- data/node_modules/codemirror/theme/ttcn.css +64 -0
- data/node_modules/codemirror/theme/twilight.css +32 -0
- data/node_modules/codemirror/theme/vibrant-ink.css +34 -0
- data/node_modules/codemirror/theme/xq-dark.css +53 -0
- data/node_modules/codemirror/theme/xq-light.css +43 -0
- data/node_modules/codemirror/theme/yeti.css +44 -0
- data/node_modules/codemirror/theme/zenburn.css +37 -0
- data/node_modules/marked/.editorconfig +16 -0
- data/node_modules/marked/.eslintignore +1 -0
- data/node_modules/marked/.eslintrc.json +28 -0
- data/node_modules/marked/.package 2.json.icloud +0 -0
- data/node_modules/marked/.travis.yml +47 -0
- data/node_modules/marked/Makefile +15 -0
- data/node_modules/marked/Makefile 2 +15 -0
- data/node_modules/marked/README 2.md +75 -0
- data/node_modules/marked/README.md +75 -0
- data/node_modules/marked/bin/marked +199 -0
- data/node_modules/marked/bower.json +23 -0
- data/node_modules/marked/component.json +10 -0
- data/node_modules/marked/index.js +1 -0
- data/node_modules/marked/jasmine.json +11 -0
- data/node_modules/marked/lib/marked 2.js +1604 -0
- data/node_modules/marked/lib/marked.js +1604 -0
- data/node_modules/marked/man/marked.1 +91 -0
- data/node_modules/marked/man/marked.1.txt +96 -0
- data/node_modules/marked/marked.min.js +6 -0
- data/node_modules/marked/package.json +95 -0
- data/node_modules/simplemde/.eslintrc +23 -0
- data/node_modules/simplemde/.npmignore +9 -0
- data/node_modules/simplemde/.travis.yml +18 -0
- data/node_modules/simplemde/CONTRIBUTING 2.md +10 -0
- data/node_modules/simplemde/CONTRIBUTING.md +10 -0
- data/node_modules/simplemde/LICENSE +22 -0
- data/node_modules/simplemde/README.md +331 -0
- data/node_modules/simplemde/bower.json +23 -0
- data/node_modules/simplemde/debug/.simplemde 2.css.icloud +0 -0
- data/node_modules/simplemde/debug/simplemde.css +676 -0
- data/node_modules/simplemde/debug/simplemde.debug.js +17023 -0
- data/node_modules/simplemde/debug/simplemde.js +17019 -0
- data/node_modules/simplemde/dist/simplemde.min.css +7 -0
- data/node_modules/simplemde/dist/simplemde.min.js +15 -0
- data/node_modules/simplemde/gulpfile.js +96 -0
- data/node_modules/simplemde/package.json +73 -0
- data/node_modules/simplemde/src/css/simplemde.css +328 -0
- data/node_modules/simplemde/src/js/codemirror/tablist 2.js +44 -0
- data/node_modules/simplemde/src/js/codemirror/tablist.js +44 -0
- data/node_modules/simplemde/src/js/simplemde.js +2028 -0
- data/node_modules/typo-js/README.md +45 -0
- data/node_modules/typo-js/dictionaries/en_US/.en_US 2.dic.icloud +0 -0
- data/node_modules/typo-js/dictionaries/en_US/README.md +7 -0
- data/node_modules/typo-js/dictionaries/en_US/en_US.aff +201 -0
- data/node_modules/typo-js/dictionaries/en_US/en_US.dic +62120 -0
- data/node_modules/typo-js/package.json +56 -0
- data/node_modules/typo-js/typo.js +931 -0
- data/package-lock.json +40 -0
- data/package.json +7 -0
- metadata +557 -0
@@ -0,0 +1,283 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: https://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("ttcn", function(config, parserConfig) {
|
15
|
+
var indentUnit = config.indentUnit,
|
16
|
+
keywords = parserConfig.keywords || {},
|
17
|
+
builtin = parserConfig.builtin || {},
|
18
|
+
timerOps = parserConfig.timerOps || {},
|
19
|
+
portOps = parserConfig.portOps || {},
|
20
|
+
configOps = parserConfig.configOps || {},
|
21
|
+
verdictOps = parserConfig.verdictOps || {},
|
22
|
+
sutOps = parserConfig.sutOps || {},
|
23
|
+
functionOps = parserConfig.functionOps || {},
|
24
|
+
|
25
|
+
verdictConsts = parserConfig.verdictConsts || {},
|
26
|
+
booleanConsts = parserConfig.booleanConsts || {},
|
27
|
+
otherConsts = parserConfig.otherConsts || {},
|
28
|
+
|
29
|
+
types = parserConfig.types || {},
|
30
|
+
visibilityModifiers = parserConfig.visibilityModifiers || {},
|
31
|
+
templateMatch = parserConfig.templateMatch || {},
|
32
|
+
multiLineStrings = parserConfig.multiLineStrings,
|
33
|
+
indentStatements = parserConfig.indentStatements !== false;
|
34
|
+
var isOperatorChar = /[+\-*&@=<>!\/]/;
|
35
|
+
var curPunc;
|
36
|
+
|
37
|
+
function tokenBase(stream, state) {
|
38
|
+
var ch = stream.next();
|
39
|
+
|
40
|
+
if (ch == '"' || ch == "'") {
|
41
|
+
state.tokenize = tokenString(ch);
|
42
|
+
return state.tokenize(stream, state);
|
43
|
+
}
|
44
|
+
if (/[\[\]{}\(\),;\\:\?\.]/.test(ch)) {
|
45
|
+
curPunc = ch;
|
46
|
+
return "punctuation";
|
47
|
+
}
|
48
|
+
if (ch == "#"){
|
49
|
+
stream.skipToEnd();
|
50
|
+
return "atom preprocessor";
|
51
|
+
}
|
52
|
+
if (ch == "%"){
|
53
|
+
stream.eatWhile(/\b/);
|
54
|
+
return "atom ttcn3Macros";
|
55
|
+
}
|
56
|
+
if (/\d/.test(ch)) {
|
57
|
+
stream.eatWhile(/[\w\.]/);
|
58
|
+
return "number";
|
59
|
+
}
|
60
|
+
if (ch == "/") {
|
61
|
+
if (stream.eat("*")) {
|
62
|
+
state.tokenize = tokenComment;
|
63
|
+
return tokenComment(stream, state);
|
64
|
+
}
|
65
|
+
if (stream.eat("/")) {
|
66
|
+
stream.skipToEnd();
|
67
|
+
return "comment";
|
68
|
+
}
|
69
|
+
}
|
70
|
+
if (isOperatorChar.test(ch)) {
|
71
|
+
if(ch == "@"){
|
72
|
+
if(stream.match("try") || stream.match("catch")
|
73
|
+
|| stream.match("lazy")){
|
74
|
+
return "keyword";
|
75
|
+
}
|
76
|
+
}
|
77
|
+
stream.eatWhile(isOperatorChar);
|
78
|
+
return "operator";
|
79
|
+
}
|
80
|
+
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
81
|
+
var cur = stream.current();
|
82
|
+
|
83
|
+
if (keywords.propertyIsEnumerable(cur)) return "keyword";
|
84
|
+
if (builtin.propertyIsEnumerable(cur)) return "builtin";
|
85
|
+
|
86
|
+
if (timerOps.propertyIsEnumerable(cur)) return "def timerOps";
|
87
|
+
if (configOps.propertyIsEnumerable(cur)) return "def configOps";
|
88
|
+
if (verdictOps.propertyIsEnumerable(cur)) return "def verdictOps";
|
89
|
+
if (portOps.propertyIsEnumerable(cur)) return "def portOps";
|
90
|
+
if (sutOps.propertyIsEnumerable(cur)) return "def sutOps";
|
91
|
+
if (functionOps.propertyIsEnumerable(cur)) return "def functionOps";
|
92
|
+
|
93
|
+
if (verdictConsts.propertyIsEnumerable(cur)) return "string verdictConsts";
|
94
|
+
if (booleanConsts.propertyIsEnumerable(cur)) return "string booleanConsts";
|
95
|
+
if (otherConsts.propertyIsEnumerable(cur)) return "string otherConsts";
|
96
|
+
|
97
|
+
if (types.propertyIsEnumerable(cur)) return "builtin types";
|
98
|
+
if (visibilityModifiers.propertyIsEnumerable(cur))
|
99
|
+
return "builtin visibilityModifiers";
|
100
|
+
if (templateMatch.propertyIsEnumerable(cur)) return "atom templateMatch";
|
101
|
+
|
102
|
+
return "variable";
|
103
|
+
}
|
104
|
+
|
105
|
+
function tokenString(quote) {
|
106
|
+
return function(stream, state) {
|
107
|
+
var escaped = false, next, end = false;
|
108
|
+
while ((next = stream.next()) != null) {
|
109
|
+
if (next == quote && !escaped){
|
110
|
+
var afterQuote = stream.peek();
|
111
|
+
//look if the character after the quote is like the B in '10100010'B
|
112
|
+
if (afterQuote){
|
113
|
+
afterQuote = afterQuote.toLowerCase();
|
114
|
+
if(afterQuote == "b" || afterQuote == "h" || afterQuote == "o")
|
115
|
+
stream.next();
|
116
|
+
}
|
117
|
+
end = true; break;
|
118
|
+
}
|
119
|
+
escaped = !escaped && next == "\\";
|
120
|
+
}
|
121
|
+
if (end || !(escaped || multiLineStrings))
|
122
|
+
state.tokenize = null;
|
123
|
+
return "string";
|
124
|
+
};
|
125
|
+
}
|
126
|
+
|
127
|
+
function tokenComment(stream, state) {
|
128
|
+
var maybeEnd = false, ch;
|
129
|
+
while (ch = stream.next()) {
|
130
|
+
if (ch == "/" && maybeEnd) {
|
131
|
+
state.tokenize = null;
|
132
|
+
break;
|
133
|
+
}
|
134
|
+
maybeEnd = (ch == "*");
|
135
|
+
}
|
136
|
+
return "comment";
|
137
|
+
}
|
138
|
+
|
139
|
+
function Context(indented, column, type, align, prev) {
|
140
|
+
this.indented = indented;
|
141
|
+
this.column = column;
|
142
|
+
this.type = type;
|
143
|
+
this.align = align;
|
144
|
+
this.prev = prev;
|
145
|
+
}
|
146
|
+
|
147
|
+
function pushContext(state, col, type) {
|
148
|
+
var indent = state.indented;
|
149
|
+
if (state.context && state.context.type == "statement")
|
150
|
+
indent = state.context.indented;
|
151
|
+
return state.context = new Context(indent, col, type, null, state.context);
|
152
|
+
}
|
153
|
+
|
154
|
+
function popContext(state) {
|
155
|
+
var t = state.context.type;
|
156
|
+
if (t == ")" || t == "]" || t == "}")
|
157
|
+
state.indented = state.context.indented;
|
158
|
+
return state.context = state.context.prev;
|
159
|
+
}
|
160
|
+
|
161
|
+
//Interface
|
162
|
+
return {
|
163
|
+
startState: function(basecolumn) {
|
164
|
+
return {
|
165
|
+
tokenize: null,
|
166
|
+
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
167
|
+
indented: 0,
|
168
|
+
startOfLine: true
|
169
|
+
};
|
170
|
+
},
|
171
|
+
|
172
|
+
token: function(stream, state) {
|
173
|
+
var ctx = state.context;
|
174
|
+
if (stream.sol()) {
|
175
|
+
if (ctx.align == null) ctx.align = false;
|
176
|
+
state.indented = stream.indentation();
|
177
|
+
state.startOfLine = true;
|
178
|
+
}
|
179
|
+
if (stream.eatSpace()) return null;
|
180
|
+
curPunc = null;
|
181
|
+
var style = (state.tokenize || tokenBase)(stream, state);
|
182
|
+
if (style == "comment") return style;
|
183
|
+
if (ctx.align == null) ctx.align = true;
|
184
|
+
|
185
|
+
if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
|
186
|
+
&& ctx.type == "statement"){
|
187
|
+
popContext(state);
|
188
|
+
}
|
189
|
+
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
190
|
+
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
191
|
+
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
192
|
+
else if (curPunc == "}") {
|
193
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
194
|
+
if (ctx.type == "}") ctx = popContext(state);
|
195
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
196
|
+
}
|
197
|
+
else if (curPunc == ctx.type) popContext(state);
|
198
|
+
else if (indentStatements &&
|
199
|
+
(((ctx.type == "}" || ctx.type == "top") && curPunc != ';') ||
|
200
|
+
(ctx.type == "statement" && curPunc == "newstatement")))
|
201
|
+
pushContext(state, stream.column(), "statement");
|
202
|
+
|
203
|
+
state.startOfLine = false;
|
204
|
+
|
205
|
+
return style;
|
206
|
+
},
|
207
|
+
|
208
|
+
electricChars: "{}",
|
209
|
+
blockCommentStart: "/*",
|
210
|
+
blockCommentEnd: "*/",
|
211
|
+
lineComment: "//",
|
212
|
+
fold: "brace"
|
213
|
+
};
|
214
|
+
});
|
215
|
+
|
216
|
+
function words(str) {
|
217
|
+
var obj = {}, words = str.split(" ");
|
218
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
219
|
+
return obj;
|
220
|
+
}
|
221
|
+
|
222
|
+
function def(mimes, mode) {
|
223
|
+
if (typeof mimes == "string") mimes = [mimes];
|
224
|
+
var words = [];
|
225
|
+
function add(obj) {
|
226
|
+
if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
|
227
|
+
words.push(prop);
|
228
|
+
}
|
229
|
+
|
230
|
+
add(mode.keywords);
|
231
|
+
add(mode.builtin);
|
232
|
+
add(mode.timerOps);
|
233
|
+
add(mode.portOps);
|
234
|
+
|
235
|
+
if (words.length) {
|
236
|
+
mode.helperType = mimes[0];
|
237
|
+
CodeMirror.registerHelper("hintWords", mimes[0], words);
|
238
|
+
}
|
239
|
+
|
240
|
+
for (var i = 0; i < mimes.length; ++i)
|
241
|
+
CodeMirror.defineMIME(mimes[i], mode);
|
242
|
+
}
|
243
|
+
|
244
|
+
def(["text/x-ttcn", "text/x-ttcn3", "text/x-ttcnpp"], {
|
245
|
+
name: "ttcn",
|
246
|
+
keywords: words("activate address alive all alt altstep and and4b any" +
|
247
|
+
" break case component const continue control deactivate" +
|
248
|
+
" display do else encode enumerated except exception" +
|
249
|
+
" execute extends extension external for from function" +
|
250
|
+
" goto group if import in infinity inout interleave" +
|
251
|
+
" label language length log match message mixed mod" +
|
252
|
+
" modifies module modulepar mtc noblock not not4b nowait" +
|
253
|
+
" of on optional or or4b out override param pattern port" +
|
254
|
+
" procedure record recursive rem repeat return runs select" +
|
255
|
+
" self sender set signature system template testcase to" +
|
256
|
+
" type union value valueof var variant while with xor xor4b"),
|
257
|
+
builtin: words("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue" +
|
258
|
+
" decomp decvalue float2int float2str hex2bit hex2int" +
|
259
|
+
" hex2oct hex2str int2bit int2char int2float int2hex" +
|
260
|
+
" int2oct int2str int2unichar isbound ischosen ispresent" +
|
261
|
+
" isvalue lengthof log2str oct2bit oct2char oct2hex oct2int" +
|
262
|
+
" oct2str regexp replace rnd sizeof str2bit str2float" +
|
263
|
+
" str2hex str2int str2oct substr unichar2int unichar2char" +
|
264
|
+
" enum2int"),
|
265
|
+
types: words("anytype bitstring boolean char charstring default float" +
|
266
|
+
" hexstring integer objid octetstring universal verdicttype timer"),
|
267
|
+
timerOps: words("read running start stop timeout"),
|
268
|
+
portOps: words("call catch check clear getcall getreply halt raise receive" +
|
269
|
+
" reply send trigger"),
|
270
|
+
configOps: words("create connect disconnect done kill killed map unmap"),
|
271
|
+
verdictOps: words("getverdict setverdict"),
|
272
|
+
sutOps: words("action"),
|
273
|
+
functionOps: words("apply derefers refers"),
|
274
|
+
|
275
|
+
verdictConsts: words("error fail inconc none pass"),
|
276
|
+
booleanConsts: words("true false"),
|
277
|
+
otherConsts: words("null NULL omit"),
|
278
|
+
|
279
|
+
visibilityModifiers: words("private public friend"),
|
280
|
+
templateMatch: words("complement ifpresent subset superset permutation"),
|
281
|
+
multiLineStrings: true
|
282
|
+
});
|
283
|
+
});
|
@@ -0,0 +1,162 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: https://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("turtle", function(config) {
|
15
|
+
var indentUnit = config.indentUnit;
|
16
|
+
var curPunc;
|
17
|
+
|
18
|
+
function wordRegexp(words) {
|
19
|
+
return new RegExp("^(?:" + words.join("|") + ")$", "i");
|
20
|
+
}
|
21
|
+
var ops = wordRegexp([]);
|
22
|
+
var keywords = wordRegexp(["@prefix", "@base", "a"]);
|
23
|
+
var operatorChars = /[*+\-<>=&|]/;
|
24
|
+
|
25
|
+
function tokenBase(stream, state) {
|
26
|
+
var ch = stream.next();
|
27
|
+
curPunc = null;
|
28
|
+
if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) {
|
29
|
+
stream.match(/^[^\s\u00a0>]*>?/);
|
30
|
+
return "atom";
|
31
|
+
}
|
32
|
+
else if (ch == "\"" || ch == "'") {
|
33
|
+
state.tokenize = tokenLiteral(ch);
|
34
|
+
return state.tokenize(stream, state);
|
35
|
+
}
|
36
|
+
else if (/[{}\(\),\.;\[\]]/.test(ch)) {
|
37
|
+
curPunc = ch;
|
38
|
+
return null;
|
39
|
+
}
|
40
|
+
else if (ch == "#") {
|
41
|
+
stream.skipToEnd();
|
42
|
+
return "comment";
|
43
|
+
}
|
44
|
+
else if (operatorChars.test(ch)) {
|
45
|
+
stream.eatWhile(operatorChars);
|
46
|
+
return null;
|
47
|
+
}
|
48
|
+
else if (ch == ":") {
|
49
|
+
return "operator";
|
50
|
+
} else {
|
51
|
+
stream.eatWhile(/[_\w\d]/);
|
52
|
+
if(stream.peek() == ":") {
|
53
|
+
return "variable-3";
|
54
|
+
} else {
|
55
|
+
var word = stream.current();
|
56
|
+
|
57
|
+
if(keywords.test(word)) {
|
58
|
+
return "meta";
|
59
|
+
}
|
60
|
+
|
61
|
+
if(ch >= "A" && ch <= "Z") {
|
62
|
+
return "comment";
|
63
|
+
} else {
|
64
|
+
return "keyword";
|
65
|
+
}
|
66
|
+
}
|
67
|
+
var word = stream.current();
|
68
|
+
if (ops.test(word))
|
69
|
+
return null;
|
70
|
+
else if (keywords.test(word))
|
71
|
+
return "meta";
|
72
|
+
else
|
73
|
+
return "variable";
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
function tokenLiteral(quote) {
|
78
|
+
return function(stream, state) {
|
79
|
+
var escaped = false, ch;
|
80
|
+
while ((ch = stream.next()) != null) {
|
81
|
+
if (ch == quote && !escaped) {
|
82
|
+
state.tokenize = tokenBase;
|
83
|
+
break;
|
84
|
+
}
|
85
|
+
escaped = !escaped && ch == "\\";
|
86
|
+
}
|
87
|
+
return "string";
|
88
|
+
};
|
89
|
+
}
|
90
|
+
|
91
|
+
function pushContext(state, type, col) {
|
92
|
+
state.context = {prev: state.context, indent: state.indent, col: col, type: type};
|
93
|
+
}
|
94
|
+
function popContext(state) {
|
95
|
+
state.indent = state.context.indent;
|
96
|
+
state.context = state.context.prev;
|
97
|
+
}
|
98
|
+
|
99
|
+
return {
|
100
|
+
startState: function() {
|
101
|
+
return {tokenize: tokenBase,
|
102
|
+
context: null,
|
103
|
+
indent: 0,
|
104
|
+
col: 0};
|
105
|
+
},
|
106
|
+
|
107
|
+
token: function(stream, state) {
|
108
|
+
if (stream.sol()) {
|
109
|
+
if (state.context && state.context.align == null) state.context.align = false;
|
110
|
+
state.indent = stream.indentation();
|
111
|
+
}
|
112
|
+
if (stream.eatSpace()) return null;
|
113
|
+
var style = state.tokenize(stream, state);
|
114
|
+
|
115
|
+
if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") {
|
116
|
+
state.context.align = true;
|
117
|
+
}
|
118
|
+
|
119
|
+
if (curPunc == "(") pushContext(state, ")", stream.column());
|
120
|
+
else if (curPunc == "[") pushContext(state, "]", stream.column());
|
121
|
+
else if (curPunc == "{") pushContext(state, "}", stream.column());
|
122
|
+
else if (/[\]\}\)]/.test(curPunc)) {
|
123
|
+
while (state.context && state.context.type == "pattern") popContext(state);
|
124
|
+
if (state.context && curPunc == state.context.type) popContext(state);
|
125
|
+
}
|
126
|
+
else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state);
|
127
|
+
else if (/atom|string|variable/.test(style) && state.context) {
|
128
|
+
if (/[\}\]]/.test(state.context.type))
|
129
|
+
pushContext(state, "pattern", stream.column());
|
130
|
+
else if (state.context.type == "pattern" && !state.context.align) {
|
131
|
+
state.context.align = true;
|
132
|
+
state.context.col = stream.column();
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
return style;
|
137
|
+
},
|
138
|
+
|
139
|
+
indent: function(state, textAfter) {
|
140
|
+
var firstChar = textAfter && textAfter.charAt(0);
|
141
|
+
var context = state.context;
|
142
|
+
if (/[\]\}]/.test(firstChar))
|
143
|
+
while (context && context.type == "pattern") context = context.prev;
|
144
|
+
|
145
|
+
var closing = context && firstChar == context.type;
|
146
|
+
if (!context)
|
147
|
+
return 0;
|
148
|
+
else if (context.type == "pattern")
|
149
|
+
return context.col;
|
150
|
+
else if (context.align)
|
151
|
+
return context.col + (closing ? 0 : 1);
|
152
|
+
else
|
153
|
+
return context.indent + (closing ? 0 : indentUnit);
|
154
|
+
},
|
155
|
+
|
156
|
+
lineComment: "#"
|
157
|
+
};
|
158
|
+
});
|
159
|
+
|
160
|
+
CodeMirror.defineMIME("text/turtle", "turtle");
|
161
|
+
|
162
|
+
});
|
@@ -0,0 +1,141 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"), require("../../addon/mode/multiplex"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror", "../../addon/mode/multiplex"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.defineMode("twig:inner", function() {
|
15
|
+
var keywords = ["and", "as", "autoescape", "endautoescape", "block", "do", "endblock", "else", "elseif", "extends", "for", "endfor", "embed", "endembed", "filter", "endfilter", "flush", "from", "if", "endif", "in", "is", "include", "import", "not", "or", "set", "spaceless", "endspaceless", "with", "endwith", "trans", "endtrans", "blocktrans", "endblocktrans", "macro", "endmacro", "use", "verbatim", "endverbatim"],
|
16
|
+
operator = /^[+\-*&%=<>!?|~^]/,
|
17
|
+
sign = /^[:\[\(\{]/,
|
18
|
+
atom = ["true", "false", "null", "empty", "defined", "divisibleby", "divisible by", "even", "odd", "iterable", "sameas", "same as"],
|
19
|
+
number = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
|
20
|
+
|
21
|
+
keywords = new RegExp("((" + keywords.join(")|(") + "))\\b");
|
22
|
+
atom = new RegExp("((" + atom.join(")|(") + "))\\b");
|
23
|
+
|
24
|
+
function tokenBase (stream, state) {
|
25
|
+
var ch = stream.peek();
|
26
|
+
|
27
|
+
//Comment
|
28
|
+
if (state.incomment) {
|
29
|
+
if (!stream.skipTo("#}")) {
|
30
|
+
stream.skipToEnd();
|
31
|
+
} else {
|
32
|
+
stream.eatWhile(/\#|}/);
|
33
|
+
state.incomment = false;
|
34
|
+
}
|
35
|
+
return "comment";
|
36
|
+
//Tag
|
37
|
+
} else if (state.intag) {
|
38
|
+
//After operator
|
39
|
+
if (state.operator) {
|
40
|
+
state.operator = false;
|
41
|
+
if (stream.match(atom)) {
|
42
|
+
return "atom";
|
43
|
+
}
|
44
|
+
if (stream.match(number)) {
|
45
|
+
return "number";
|
46
|
+
}
|
47
|
+
}
|
48
|
+
//After sign
|
49
|
+
if (state.sign) {
|
50
|
+
state.sign = false;
|
51
|
+
if (stream.match(atom)) {
|
52
|
+
return "atom";
|
53
|
+
}
|
54
|
+
if (stream.match(number)) {
|
55
|
+
return "number";
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
if (state.instring) {
|
60
|
+
if (ch == state.instring) {
|
61
|
+
state.instring = false;
|
62
|
+
}
|
63
|
+
stream.next();
|
64
|
+
return "string";
|
65
|
+
} else if (ch == "'" || ch == '"') {
|
66
|
+
state.instring = ch;
|
67
|
+
stream.next();
|
68
|
+
return "string";
|
69
|
+
} else if (stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) {
|
70
|
+
state.intag = false;
|
71
|
+
return "tag";
|
72
|
+
} else if (stream.match(operator)) {
|
73
|
+
state.operator = true;
|
74
|
+
return "operator";
|
75
|
+
} else if (stream.match(sign)) {
|
76
|
+
state.sign = true;
|
77
|
+
} else {
|
78
|
+
if (stream.eat(" ") || stream.sol()) {
|
79
|
+
if (stream.match(keywords)) {
|
80
|
+
return "keyword";
|
81
|
+
}
|
82
|
+
if (stream.match(atom)) {
|
83
|
+
return "atom";
|
84
|
+
}
|
85
|
+
if (stream.match(number)) {
|
86
|
+
return "number";
|
87
|
+
}
|
88
|
+
if (stream.sol()) {
|
89
|
+
stream.next();
|
90
|
+
}
|
91
|
+
} else {
|
92
|
+
stream.next();
|
93
|
+
}
|
94
|
+
|
95
|
+
}
|
96
|
+
return "variable";
|
97
|
+
} else if (stream.eat("{")) {
|
98
|
+
if (stream.eat("#")) {
|
99
|
+
state.incomment = true;
|
100
|
+
if (!stream.skipTo("#}")) {
|
101
|
+
stream.skipToEnd();
|
102
|
+
} else {
|
103
|
+
stream.eatWhile(/\#|}/);
|
104
|
+
state.incomment = false;
|
105
|
+
}
|
106
|
+
return "comment";
|
107
|
+
//Open tag
|
108
|
+
} else if (ch = stream.eat(/\{|%/)) {
|
109
|
+
//Cache close tag
|
110
|
+
state.intag = ch;
|
111
|
+
if (ch == "{") {
|
112
|
+
state.intag = "}";
|
113
|
+
}
|
114
|
+
stream.eat("-");
|
115
|
+
return "tag";
|
116
|
+
}
|
117
|
+
}
|
118
|
+
stream.next();
|
119
|
+
};
|
120
|
+
|
121
|
+
return {
|
122
|
+
startState: function () {
|
123
|
+
return {};
|
124
|
+
},
|
125
|
+
token: function (stream, state) {
|
126
|
+
return tokenBase(stream, state);
|
127
|
+
}
|
128
|
+
};
|
129
|
+
});
|
130
|
+
|
131
|
+
CodeMirror.defineMode("twig", function(config, parserConfig) {
|
132
|
+
var twigInner = CodeMirror.getMode(config, "twig:inner");
|
133
|
+
if (!parserConfig || !parserConfig.base) return twigInner;
|
134
|
+
return CodeMirror.multiplexingMode(
|
135
|
+
CodeMirror.getMode(config, parserConfig.base), {
|
136
|
+
open: /\{[{#%]/, close: /[}#%]\}/, mode: twigInner, parseDelimiters: true
|
137
|
+
}
|
138
|
+
);
|
139
|
+
});
|
140
|
+
CodeMirror.defineMIME("text/x-twig", "twig");
|
141
|
+
});
|