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,145 @@
|
|
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
|
+
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
13
|
+
(document.documentMode == null || document.documentMode < 8);
|
14
|
+
|
15
|
+
var Pos = CodeMirror.Pos;
|
16
|
+
|
17
|
+
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
18
|
+
|
19
|
+
function findMatchingBracket(cm, where, config) {
|
20
|
+
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
21
|
+
var afterCursor = config && config.afterCursor
|
22
|
+
if (afterCursor == null)
|
23
|
+
afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
|
24
|
+
|
25
|
+
// A cursor is defined as between two characters, but in in vim command mode
|
26
|
+
// (i.e. not insert mode), the cursor is visually represented as a
|
27
|
+
// highlighted box on top of the 2nd character. Otherwise, we allow matches
|
28
|
+
// from before or after the cursor.
|
29
|
+
var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) ||
|
30
|
+
matching[line.text.charAt(++pos)];
|
31
|
+
if (!match) return null;
|
32
|
+
var dir = match.charAt(1) == ">" ? 1 : -1;
|
33
|
+
if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
|
34
|
+
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
|
35
|
+
|
36
|
+
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
|
37
|
+
if (found == null) return null;
|
38
|
+
return {from: Pos(where.line, pos), to: found && found.pos,
|
39
|
+
match: found && found.ch == match.charAt(0), forward: dir > 0};
|
40
|
+
}
|
41
|
+
|
42
|
+
// bracketRegex is used to specify which type of bracket to scan
|
43
|
+
// should be a regexp, e.g. /[[\]]/
|
44
|
+
//
|
45
|
+
// Note: If "where" is on an open bracket, then this bracket is ignored.
|
46
|
+
//
|
47
|
+
// Returns false when no bracket was found, null when it reached
|
48
|
+
// maxScanLines and gave up
|
49
|
+
function scanForBracket(cm, where, dir, style, config) {
|
50
|
+
var maxScanLen = (config && config.maxScanLineLength) || 10000;
|
51
|
+
var maxScanLines = (config && config.maxScanLines) || 1000;
|
52
|
+
|
53
|
+
var stack = [];
|
54
|
+
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
|
55
|
+
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
56
|
+
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
57
|
+
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
58
|
+
var line = cm.getLine(lineNo);
|
59
|
+
if (!line) continue;
|
60
|
+
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
|
61
|
+
if (line.length > maxScanLen) continue;
|
62
|
+
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
|
63
|
+
for (; pos != end; pos += dir) {
|
64
|
+
var ch = line.charAt(pos);
|
65
|
+
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
66
|
+
var match = matching[ch];
|
67
|
+
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
68
|
+
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
69
|
+
else stack.pop();
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
|
74
|
+
}
|
75
|
+
|
76
|
+
function matchBrackets(cm, autoclear, config) {
|
77
|
+
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
78
|
+
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
79
|
+
var marks = [], ranges = cm.listSelections();
|
80
|
+
for (var i = 0; i < ranges.length; i++) {
|
81
|
+
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
|
82
|
+
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
|
83
|
+
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
84
|
+
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
|
85
|
+
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
|
86
|
+
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
if (marks.length) {
|
91
|
+
// Kludge to work around the IE bug from issue #1193, where text
|
92
|
+
// input stops going to the textare whever this fires.
|
93
|
+
if (ie_lt8 && cm.state.focused) cm.focus();
|
94
|
+
|
95
|
+
var clear = function() {
|
96
|
+
cm.operation(function() {
|
97
|
+
for (var i = 0; i < marks.length; i++) marks[i].clear();
|
98
|
+
});
|
99
|
+
};
|
100
|
+
if (autoclear) setTimeout(clear, 800);
|
101
|
+
else return clear;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
function doMatchBrackets(cm) {
|
106
|
+
cm.operation(function() {
|
107
|
+
if (cm.state.matchBrackets.currentlyHighlighted) {
|
108
|
+
cm.state.matchBrackets.currentlyHighlighted();
|
109
|
+
cm.state.matchBrackets.currentlyHighlighted = null;
|
110
|
+
}
|
111
|
+
cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
112
|
+
});
|
113
|
+
}
|
114
|
+
|
115
|
+
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
116
|
+
if (old && old != CodeMirror.Init) {
|
117
|
+
cm.off("cursorActivity", doMatchBrackets);
|
118
|
+
if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
|
119
|
+
cm.state.matchBrackets.currentlyHighlighted();
|
120
|
+
cm.state.matchBrackets.currentlyHighlighted = null;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
if (val) {
|
124
|
+
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
125
|
+
cm.on("cursorActivity", doMatchBrackets);
|
126
|
+
}
|
127
|
+
});
|
128
|
+
|
129
|
+
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
130
|
+
CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){
|
131
|
+
// Backwards-compatibility kludge
|
132
|
+
if (oldConfig || typeof config == "boolean") {
|
133
|
+
if (!oldConfig) {
|
134
|
+
config = config ? {strict: true} : null
|
135
|
+
} else {
|
136
|
+
oldConfig.strict = config
|
137
|
+
config = oldConfig
|
138
|
+
}
|
139
|
+
}
|
140
|
+
return findMatchingBracket(this, pos, config)
|
141
|
+
});
|
142
|
+
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
|
143
|
+
return scanForBracket(this, pos, dir, style, config);
|
144
|
+
});
|
145
|
+
});
|
@@ -0,0 +1,66 @@
|
|
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("../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
|
+
});
|
@@ -0,0 +1,27 @@
|
|
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
|
+
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
|
+
});
|
@@ -0,0 +1,105 @@
|
|
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.registerHelper("fold", "brace", function(cm, start) {
|
15
|
+
var line = start.line, lineText = cm.getLine(line);
|
16
|
+
var tokenType;
|
17
|
+
|
18
|
+
function findOpening(openCh) {
|
19
|
+
for (var at = start.ch, pass = 0;;) {
|
20
|
+
var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1);
|
21
|
+
if (found == -1) {
|
22
|
+
if (pass == 1) break;
|
23
|
+
pass = 1;
|
24
|
+
at = lineText.length;
|
25
|
+
continue;
|
26
|
+
}
|
27
|
+
if (pass == 1 && found < start.ch) break;
|
28
|
+
tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
|
29
|
+
if (!/^(comment|string)/.test(tokenType)) return found + 1;
|
30
|
+
at = found - 1;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
var startToken = "{", endToken = "}", startCh = findOpening("{");
|
35
|
+
if (startCh == null) {
|
36
|
+
startToken = "[", endToken = "]";
|
37
|
+
startCh = findOpening("[");
|
38
|
+
}
|
39
|
+
|
40
|
+
if (startCh == null) return;
|
41
|
+
var count = 1, lastLine = cm.lastLine(), end, endCh;
|
42
|
+
outer: for (var i = line; i <= lastLine; ++i) {
|
43
|
+
var text = cm.getLine(i), pos = i == line ? startCh : 0;
|
44
|
+
for (;;) {
|
45
|
+
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
|
46
|
+
if (nextOpen < 0) nextOpen = text.length;
|
47
|
+
if (nextClose < 0) nextClose = text.length;
|
48
|
+
pos = Math.min(nextOpen, nextClose);
|
49
|
+
if (pos == text.length) break;
|
50
|
+
if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) {
|
51
|
+
if (pos == nextOpen) ++count;
|
52
|
+
else if (!--count) { end = i; endCh = pos; break outer; }
|
53
|
+
}
|
54
|
+
++pos;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
if (end == null || line == end) return;
|
58
|
+
return {from: CodeMirror.Pos(line, startCh),
|
59
|
+
to: CodeMirror.Pos(end, endCh)};
|
60
|
+
});
|
61
|
+
|
62
|
+
CodeMirror.registerHelper("fold", "import", function(cm, start) {
|
63
|
+
function hasImport(line) {
|
64
|
+
if (line < cm.firstLine() || line > cm.lastLine()) return null;
|
65
|
+
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
|
66
|
+
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
|
67
|
+
if (start.type != "keyword" || start.string != "import") return null;
|
68
|
+
// Now find closing semicolon, return its position
|
69
|
+
for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) {
|
70
|
+
var text = cm.getLine(i), semi = text.indexOf(";");
|
71
|
+
if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)};
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
var startLine = start.line, has = hasImport(startLine), prev;
|
76
|
+
if (!has || hasImport(startLine - 1) || ((prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1))
|
77
|
+
return null;
|
78
|
+
for (var end = has.end;;) {
|
79
|
+
var next = hasImport(end.line + 1);
|
80
|
+
if (next == null) break;
|
81
|
+
end = next.end;
|
82
|
+
}
|
83
|
+
return {from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), to: end};
|
84
|
+
});
|
85
|
+
|
86
|
+
CodeMirror.registerHelper("fold", "include", function(cm, start) {
|
87
|
+
function hasInclude(line) {
|
88
|
+
if (line < cm.firstLine() || line > cm.lastLine()) return null;
|
89
|
+
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
|
90
|
+
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
|
91
|
+
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
|
92
|
+
}
|
93
|
+
|
94
|
+
var startLine = start.line, has = hasInclude(startLine);
|
95
|
+
if (has == null || hasInclude(startLine - 1) != null) return null;
|
96
|
+
for (var end = startLine;;) {
|
97
|
+
var next = hasInclude(end + 1);
|
98
|
+
if (next == null) break;
|
99
|
+
++end;
|
100
|
+
}
|
101
|
+
return {from: CodeMirror.Pos(startLine, has + 1),
|
102
|
+
to: cm.clipPos(CodeMirror.Pos(end))};
|
103
|
+
});
|
104
|
+
|
105
|
+
});
|
@@ -0,0 +1,59 @@
|
|
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.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
|
+
(found == 0 || lineText.slice(found - endToken.length, found) == endToken ||
|
33
|
+
!/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) {
|
34
|
+
startCh = found + startToken.length;
|
35
|
+
break;
|
36
|
+
}
|
37
|
+
at = found - 1;
|
38
|
+
}
|
39
|
+
|
40
|
+
var depth = 1, lastLine = cm.lastLine(), end, endCh;
|
41
|
+
outer: for (var i = line; i <= lastLine; ++i) {
|
42
|
+
var text = cm.getLine(i), pos = i == line ? startCh : 0;
|
43
|
+
for (;;) {
|
44
|
+
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
|
45
|
+
if (nextOpen < 0) nextOpen = text.length;
|
46
|
+
if (nextClose < 0) nextClose = text.length;
|
47
|
+
pos = Math.min(nextOpen, nextClose);
|
48
|
+
if (pos == text.length) break;
|
49
|
+
if (pos == nextOpen) ++depth;
|
50
|
+
else if (!--depth) { end = i; endCh = pos; break outer; }
|
51
|
+
++pos;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
if (end == null || line == end && endCh == startCh) return;
|
55
|
+
return {from: CodeMirror.Pos(line, startCh),
|
56
|
+
to: CodeMirror.Pos(end, endCh)};
|
57
|
+
});
|
58
|
+
|
59
|
+
});
|
@@ -0,0 +1,152 @@
|
|
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
|
+
function doFold(cm, pos, options, force) {
|
15
|
+
if (options && options.call) {
|
16
|
+
var finder = options;
|
17
|
+
options = null;
|
18
|
+
} else {
|
19
|
+
var finder = getOption(cm, options, "rangeFinder");
|
20
|
+
}
|
21
|
+
if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
|
22
|
+
var minSize = getOption(cm, options, "minFoldSize");
|
23
|
+
|
24
|
+
function getRange(allowFolded) {
|
25
|
+
var range = finder(cm, pos);
|
26
|
+
if (!range || range.to.line - range.from.line < minSize) return null;
|
27
|
+
var marks = cm.findMarksAt(range.from);
|
28
|
+
for (var i = 0; i < marks.length; ++i) {
|
29
|
+
if (marks[i].__isFold && force !== "fold") {
|
30
|
+
if (!allowFolded) return null;
|
31
|
+
range.cleared = true;
|
32
|
+
marks[i].clear();
|
33
|
+
}
|
34
|
+
}
|
35
|
+
return range;
|
36
|
+
}
|
37
|
+
|
38
|
+
var range = getRange(true);
|
39
|
+
if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) {
|
40
|
+
pos = CodeMirror.Pos(pos.line - 1, 0);
|
41
|
+
range = getRange(false);
|
42
|
+
}
|
43
|
+
if (!range || range.cleared || force === "unfold") return;
|
44
|
+
|
45
|
+
var myWidget = makeWidget(cm, options);
|
46
|
+
CodeMirror.on(myWidget, "mousedown", function(e) {
|
47
|
+
myRange.clear();
|
48
|
+
CodeMirror.e_preventDefault(e);
|
49
|
+
});
|
50
|
+
var myRange = cm.markText(range.from, range.to, {
|
51
|
+
replacedWith: myWidget,
|
52
|
+
clearOnEnter: getOption(cm, options, "clearOnEnter"),
|
53
|
+
__isFold: true
|
54
|
+
});
|
55
|
+
myRange.on("clear", function(from, to) {
|
56
|
+
CodeMirror.signal(cm, "unfold", cm, from, to);
|
57
|
+
});
|
58
|
+
CodeMirror.signal(cm, "fold", cm, range.from, range.to);
|
59
|
+
}
|
60
|
+
|
61
|
+
function makeWidget(cm, options) {
|
62
|
+
var widget = getOption(cm, options, "widget");
|
63
|
+
if (typeof widget == "string") {
|
64
|
+
var text = document.createTextNode(widget);
|
65
|
+
widget = document.createElement("span");
|
66
|
+
widget.appendChild(text);
|
67
|
+
widget.className = "CodeMirror-foldmarker";
|
68
|
+
} else if (widget) {
|
69
|
+
widget = widget.cloneNode(true)
|
70
|
+
}
|
71
|
+
return widget;
|
72
|
+
}
|
73
|
+
|
74
|
+
// Clumsy backwards-compatible interface
|
75
|
+
CodeMirror.newFoldFunction = function(rangeFinder, widget) {
|
76
|
+
return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };
|
77
|
+
};
|
78
|
+
|
79
|
+
// New-style interface
|
80
|
+
CodeMirror.defineExtension("foldCode", function(pos, options, force) {
|
81
|
+
doFold(this, pos, options, force);
|
82
|
+
});
|
83
|
+
|
84
|
+
CodeMirror.defineExtension("isFolded", function(pos) {
|
85
|
+
var marks = this.findMarksAt(pos);
|
86
|
+
for (var i = 0; i < marks.length; ++i)
|
87
|
+
if (marks[i].__isFold) return true;
|
88
|
+
});
|
89
|
+
|
90
|
+
CodeMirror.commands.toggleFold = function(cm) {
|
91
|
+
cm.foldCode(cm.getCursor());
|
92
|
+
};
|
93
|
+
CodeMirror.commands.fold = function(cm) {
|
94
|
+
cm.foldCode(cm.getCursor(), null, "fold");
|
95
|
+
};
|
96
|
+
CodeMirror.commands.unfold = function(cm) {
|
97
|
+
cm.foldCode(cm.getCursor(), null, "unfold");
|
98
|
+
};
|
99
|
+
CodeMirror.commands.foldAll = function(cm) {
|
100
|
+
cm.operation(function() {
|
101
|
+
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
|
102
|
+
cm.foldCode(CodeMirror.Pos(i, 0), null, "fold");
|
103
|
+
});
|
104
|
+
};
|
105
|
+
CodeMirror.commands.unfoldAll = function(cm) {
|
106
|
+
cm.operation(function() {
|
107
|
+
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
|
108
|
+
cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold");
|
109
|
+
});
|
110
|
+
};
|
111
|
+
|
112
|
+
CodeMirror.registerHelper("fold", "combine", function() {
|
113
|
+
var funcs = Array.prototype.slice.call(arguments, 0);
|
114
|
+
return function(cm, start) {
|
115
|
+
for (var i = 0; i < funcs.length; ++i) {
|
116
|
+
var found = funcs[i](cm, start);
|
117
|
+
if (found) return found;
|
118
|
+
}
|
119
|
+
};
|
120
|
+
});
|
121
|
+
|
122
|
+
CodeMirror.registerHelper("fold", "auto", function(cm, start) {
|
123
|
+
var helpers = cm.getHelpers(start, "fold");
|
124
|
+
for (var i = 0; i < helpers.length; i++) {
|
125
|
+
var cur = helpers[i](cm, start);
|
126
|
+
if (cur) return cur;
|
127
|
+
}
|
128
|
+
});
|
129
|
+
|
130
|
+
var defaultOptions = {
|
131
|
+
rangeFinder: CodeMirror.fold.auto,
|
132
|
+
widget: "\u2194",
|
133
|
+
minFoldSize: 0,
|
134
|
+
scanUp: false,
|
135
|
+
clearOnEnter: true
|
136
|
+
};
|
137
|
+
|
138
|
+
CodeMirror.defineOption("foldOptions", null);
|
139
|
+
|
140
|
+
function getOption(cm, options, name) {
|
141
|
+
if (options && options[name] !== undefined)
|
142
|
+
return options[name];
|
143
|
+
var editorOptions = cm.options.foldOptions;
|
144
|
+
if (editorOptions && editorOptions[name] !== undefined)
|
145
|
+
return editorOptions[name];
|
146
|
+
return defaultOptions[name];
|
147
|
+
}
|
148
|
+
|
149
|
+
CodeMirror.defineExtension("foldOption", function(options, name) {
|
150
|
+
return getOption(this, options, name);
|
151
|
+
});
|
152
|
+
});
|