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,30 @@
|
|
1
|
+
import { runInOp } from "../display/operations.js"
|
2
|
+
import { ensureCursorVisible } from "../display/scrolling.js"
|
3
|
+
import { cmp } from "../line/pos.js"
|
4
|
+
import { replaceRange } from "../model/changes.js"
|
5
|
+
import { lst } from "../util/misc.js"
|
6
|
+
|
7
|
+
// Helper for deleting text near the selection(s), used to implement
|
8
|
+
// backspace, delete, and similar functionality.
|
9
|
+
export function deleteNearSelection(cm, compute) {
|
10
|
+
let ranges = cm.doc.sel.ranges, kill = []
|
11
|
+
// Build up a set of ranges to kill first, merging overlapping
|
12
|
+
// ranges.
|
13
|
+
for (let i = 0; i < ranges.length; i++) {
|
14
|
+
let toKill = compute(ranges[i])
|
15
|
+
while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {
|
16
|
+
let replaced = kill.pop()
|
17
|
+
if (cmp(replaced.from, toKill.from) < 0) {
|
18
|
+
toKill.from = replaced.from
|
19
|
+
break
|
20
|
+
}
|
21
|
+
}
|
22
|
+
kill.push(toKill)
|
23
|
+
}
|
24
|
+
// Next, remove those actual ranges.
|
25
|
+
runInOp(cm, () => {
|
26
|
+
for (let i = kill.length - 1; i >= 0; i--)
|
27
|
+
replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete")
|
28
|
+
ensureCursorVisible(cm)
|
29
|
+
})
|
30
|
+
}
|
@@ -0,0 +1,119 @@
|
|
1
|
+
import { drawSelectionCursor } from "../display/selection.js"
|
2
|
+
import { operation } from "../display/operations.js"
|
3
|
+
import { clipPos } from "../line/pos.js"
|
4
|
+
import { posFromMouse } from "../measurement/position_measurement.js"
|
5
|
+
import { eventInWidget } from "../measurement/widgets.js"
|
6
|
+
import { makeChange, replaceRange } from "../model/changes.js"
|
7
|
+
import { changeEnd } from "../model/change_measurement.js"
|
8
|
+
import { simpleSelection } from "../model/selection.js"
|
9
|
+
import { setSelectionNoUndo, setSelectionReplaceHistory } from "../model/selection_updates.js"
|
10
|
+
import { ie, presto, safari } from "../util/browser.js"
|
11
|
+
import { elt, removeChildrenAndAdd } from "../util/dom.js"
|
12
|
+
import { e_preventDefault, e_stop, signalDOMEvent } from "../util/event.js"
|
13
|
+
import { indexOf } from "../util/misc.js"
|
14
|
+
|
15
|
+
// Kludge to work around strange IE behavior where it'll sometimes
|
16
|
+
// re-fire a series of drag-related events right after the drop (#1551)
|
17
|
+
let lastDrop = 0
|
18
|
+
|
19
|
+
export function onDrop(e) {
|
20
|
+
let cm = this
|
21
|
+
clearDragCursor(cm)
|
22
|
+
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
|
23
|
+
return
|
24
|
+
e_preventDefault(e)
|
25
|
+
if (ie) lastDrop = +new Date
|
26
|
+
let pos = posFromMouse(cm, e, true), files = e.dataTransfer.files
|
27
|
+
if (!pos || cm.isReadOnly()) return
|
28
|
+
// Might be a file drop, in which case we simply extract the text
|
29
|
+
// and insert it.
|
30
|
+
if (files && files.length && window.FileReader && window.File) {
|
31
|
+
let n = files.length, text = Array(n), read = 0
|
32
|
+
let loadFile = (file, i) => {
|
33
|
+
if (cm.options.allowDropFileTypes &&
|
34
|
+
indexOf(cm.options.allowDropFileTypes, file.type) == -1)
|
35
|
+
return
|
36
|
+
|
37
|
+
let reader = new FileReader
|
38
|
+
reader.onload = operation(cm, () => {
|
39
|
+
let content = reader.result
|
40
|
+
if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) content = ""
|
41
|
+
text[i] = content
|
42
|
+
if (++read == n) {
|
43
|
+
pos = clipPos(cm.doc, pos)
|
44
|
+
let change = {from: pos, to: pos,
|
45
|
+
text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
|
46
|
+
origin: "paste"}
|
47
|
+
makeChange(cm.doc, change)
|
48
|
+
setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)))
|
49
|
+
}
|
50
|
+
})
|
51
|
+
reader.readAsText(file)
|
52
|
+
}
|
53
|
+
for (let i = 0; i < n; ++i) loadFile(files[i], i)
|
54
|
+
} else { // Normal drop
|
55
|
+
// Don't do a replace if the drop happened inside of the selected text.
|
56
|
+
if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {
|
57
|
+
cm.state.draggingText(e)
|
58
|
+
// Ensure the editor is re-focused
|
59
|
+
setTimeout(() => cm.display.input.focus(), 20)
|
60
|
+
return
|
61
|
+
}
|
62
|
+
try {
|
63
|
+
let text = e.dataTransfer.getData("Text")
|
64
|
+
if (text) {
|
65
|
+
let selected
|
66
|
+
if (cm.state.draggingText && !cm.state.draggingText.copy)
|
67
|
+
selected = cm.listSelections()
|
68
|
+
setSelectionNoUndo(cm.doc, simpleSelection(pos, pos))
|
69
|
+
if (selected) for (let i = 0; i < selected.length; ++i)
|
70
|
+
replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag")
|
71
|
+
cm.replaceSelection(text, "around", "paste")
|
72
|
+
cm.display.input.focus()
|
73
|
+
}
|
74
|
+
}
|
75
|
+
catch(e){}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
export function onDragStart(cm, e) {
|
80
|
+
if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }
|
81
|
+
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return
|
82
|
+
|
83
|
+
e.dataTransfer.setData("Text", cm.getSelection())
|
84
|
+
e.dataTransfer.effectAllowed = "copyMove"
|
85
|
+
|
86
|
+
// Use dummy image instead of default browsers image.
|
87
|
+
// Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
|
88
|
+
if (e.dataTransfer.setDragImage && !safari) {
|
89
|
+
let img = elt("img", null, null, "position: fixed; left: 0; top: 0;")
|
90
|
+
img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
91
|
+
if (presto) {
|
92
|
+
img.width = img.height = 1
|
93
|
+
cm.display.wrapper.appendChild(img)
|
94
|
+
// Force a relayout, or Opera won't use our image for some obscure reason
|
95
|
+
img._top = img.offsetTop
|
96
|
+
}
|
97
|
+
e.dataTransfer.setDragImage(img, 0, 0)
|
98
|
+
if (presto) img.parentNode.removeChild(img)
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
export function onDragOver(cm, e) {
|
103
|
+
let pos = posFromMouse(cm, e)
|
104
|
+
if (!pos) return
|
105
|
+
let frag = document.createDocumentFragment()
|
106
|
+
drawSelectionCursor(cm, pos, frag)
|
107
|
+
if (!cm.display.dragCursor) {
|
108
|
+
cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors")
|
109
|
+
cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv)
|
110
|
+
}
|
111
|
+
removeChildrenAndAdd(cm.display.dragCursor, frag)
|
112
|
+
}
|
113
|
+
|
114
|
+
export function clearDragCursor(cm) {
|
115
|
+
if (cm.display.dragCursor) {
|
116
|
+
cm.display.lineSpace.removeChild(cm.display.dragCursor)
|
117
|
+
cm.display.dragCursor = null
|
118
|
+
}
|
119
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { CodeMirror } from "./CodeMirror.js"
|
2
|
+
import { activeElt } from "../util/dom.js"
|
3
|
+
import { off, on } from "../util/event.js"
|
4
|
+
import { copyObj } from "../util/misc.js"
|
5
|
+
|
6
|
+
export function fromTextArea(textarea, options) {
|
7
|
+
options = options ? copyObj(options) : {}
|
8
|
+
options.value = textarea.value
|
9
|
+
if (!options.tabindex && textarea.tabIndex)
|
10
|
+
options.tabindex = textarea.tabIndex
|
11
|
+
if (!options.placeholder && textarea.placeholder)
|
12
|
+
options.placeholder = textarea.placeholder
|
13
|
+
// Set autofocus to true if this textarea is focused, or if it has
|
14
|
+
// autofocus and no other element is focused.
|
15
|
+
if (options.autofocus == null) {
|
16
|
+
let hasFocus = activeElt()
|
17
|
+
options.autofocus = hasFocus == textarea ||
|
18
|
+
textarea.getAttribute("autofocus") != null && hasFocus == document.body
|
19
|
+
}
|
20
|
+
|
21
|
+
function save() {textarea.value = cm.getValue()}
|
22
|
+
|
23
|
+
let realSubmit
|
24
|
+
if (textarea.form) {
|
25
|
+
on(textarea.form, "submit", save)
|
26
|
+
// Deplorable hack to make the submit method do the right thing.
|
27
|
+
if (!options.leaveSubmitMethodAlone) {
|
28
|
+
let form = textarea.form
|
29
|
+
realSubmit = form.submit
|
30
|
+
try {
|
31
|
+
let wrappedSubmit = form.submit = () => {
|
32
|
+
save()
|
33
|
+
form.submit = realSubmit
|
34
|
+
form.submit()
|
35
|
+
form.submit = wrappedSubmit
|
36
|
+
}
|
37
|
+
} catch(e) {}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
options.finishInit = cm => {
|
42
|
+
cm.save = save
|
43
|
+
cm.getTextArea = () => textarea
|
44
|
+
cm.toTextArea = () => {
|
45
|
+
cm.toTextArea = isNaN // Prevent this from being ran twice
|
46
|
+
save()
|
47
|
+
textarea.parentNode.removeChild(cm.getWrapperElement())
|
48
|
+
textarea.style.display = ""
|
49
|
+
if (textarea.form) {
|
50
|
+
off(textarea.form, "submit", save)
|
51
|
+
if (typeof textarea.form.submit == "function")
|
52
|
+
textarea.form.submit = realSubmit
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
textarea.style.display = "none"
|
58
|
+
let cm = CodeMirror(node => textarea.parentNode.insertBefore(node, textarea.nextSibling),
|
59
|
+
options)
|
60
|
+
return cm
|
61
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { onBlur } from "../display/focus.js"
|
2
|
+
import { on } from "../util/event.js"
|
3
|
+
|
4
|
+
// These must be handled carefully, because naively registering a
|
5
|
+
// handler for each editor will cause the editors to never be
|
6
|
+
// garbage collected.
|
7
|
+
|
8
|
+
function forEachCodeMirror(f) {
|
9
|
+
if (!document.getElementsByClassName) return
|
10
|
+
let byClass = document.getElementsByClassName("CodeMirror")
|
11
|
+
for (let i = 0; i < byClass.length; i++) {
|
12
|
+
let cm = byClass[i].CodeMirror
|
13
|
+
if (cm) f(cm)
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
let globalsRegistered = false
|
18
|
+
export function ensureGlobalHandlers() {
|
19
|
+
if (globalsRegistered) return
|
20
|
+
registerGlobalHandlers()
|
21
|
+
globalsRegistered = true
|
22
|
+
}
|
23
|
+
function registerGlobalHandlers() {
|
24
|
+
// When the window resizes, we need to refresh active editors.
|
25
|
+
let resizeTimer
|
26
|
+
on(window, "resize", () => {
|
27
|
+
if (resizeTimer == null) resizeTimer = setTimeout(() => {
|
28
|
+
resizeTimer = null
|
29
|
+
forEachCodeMirror(onResize)
|
30
|
+
}, 100)
|
31
|
+
})
|
32
|
+
// When the window loses focus, we want to show the editor as blurred
|
33
|
+
on(window, "blur", () => forEachCodeMirror(onBlur))
|
34
|
+
}
|
35
|
+
// Called when the window resizes
|
36
|
+
function onResize(cm) {
|
37
|
+
let d = cm.display
|
38
|
+
// Might be a text scaling operation, clear size caches.
|
39
|
+
d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
|
40
|
+
d.scrollbarsClipped = false
|
41
|
+
cm.setSize()
|
42
|
+
}
|
@@ -0,0 +1,159 @@
|
|
1
|
+
import { signalLater } from "../util/operation_group.js"
|
2
|
+
import { restartBlink } from "../display/selection.js"
|
3
|
+
import { isModifierKey, keyName, lookupKey } from "../input/keymap.js"
|
4
|
+
import { eventInWidget } from "../measurement/widgets.js"
|
5
|
+
import { ie, ie_version, mac, presto } from "../util/browser.js"
|
6
|
+
import { activeElt, addClass, rmClass } from "../util/dom.js"
|
7
|
+
import { e_preventDefault, off, on, signalDOMEvent } from "../util/event.js"
|
8
|
+
import { hasCopyEvent } from "../util/feature_detection.js"
|
9
|
+
import { Delayed, Pass } from "../util/misc.js"
|
10
|
+
|
11
|
+
import { commands } from "./commands.js"
|
12
|
+
|
13
|
+
// Run a handler that was bound to a key.
|
14
|
+
function doHandleBinding(cm, bound, dropShift) {
|
15
|
+
if (typeof bound == "string") {
|
16
|
+
bound = commands[bound]
|
17
|
+
if (!bound) return false
|
18
|
+
}
|
19
|
+
// Ensure previous input has been read, so that the handler sees a
|
20
|
+
// consistent view of the document
|
21
|
+
cm.display.input.ensurePolled()
|
22
|
+
let prevShift = cm.display.shift, done = false
|
23
|
+
try {
|
24
|
+
if (cm.isReadOnly()) cm.state.suppressEdits = true
|
25
|
+
if (dropShift) cm.display.shift = false
|
26
|
+
done = bound(cm) != Pass
|
27
|
+
} finally {
|
28
|
+
cm.display.shift = prevShift
|
29
|
+
cm.state.suppressEdits = false
|
30
|
+
}
|
31
|
+
return done
|
32
|
+
}
|
33
|
+
|
34
|
+
function lookupKeyForEditor(cm, name, handle) {
|
35
|
+
for (let i = 0; i < cm.state.keyMaps.length; i++) {
|
36
|
+
let result = lookupKey(name, cm.state.keyMaps[i], handle, cm)
|
37
|
+
if (result) return result
|
38
|
+
}
|
39
|
+
return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))
|
40
|
+
|| lookupKey(name, cm.options.keyMap, handle, cm)
|
41
|
+
}
|
42
|
+
|
43
|
+
// Note that, despite the name, this function is also used to check
|
44
|
+
// for bound mouse clicks.
|
45
|
+
|
46
|
+
let stopSeq = new Delayed
|
47
|
+
|
48
|
+
export function dispatchKey(cm, name, e, handle) {
|
49
|
+
let seq = cm.state.keySeq
|
50
|
+
if (seq) {
|
51
|
+
if (isModifierKey(name)) return "handled"
|
52
|
+
if (/\'$/.test(name))
|
53
|
+
cm.state.keySeq = null
|
54
|
+
else
|
55
|
+
stopSeq.set(50, () => {
|
56
|
+
if (cm.state.keySeq == seq) {
|
57
|
+
cm.state.keySeq = null
|
58
|
+
cm.display.input.reset()
|
59
|
+
}
|
60
|
+
})
|
61
|
+
if (dispatchKeyInner(cm, seq + " " + name, e, handle)) return true
|
62
|
+
}
|
63
|
+
return dispatchKeyInner(cm, name, e, handle)
|
64
|
+
}
|
65
|
+
|
66
|
+
function dispatchKeyInner(cm, name, e, handle) {
|
67
|
+
let result = lookupKeyForEditor(cm, name, handle)
|
68
|
+
|
69
|
+
if (result == "multi")
|
70
|
+
cm.state.keySeq = name
|
71
|
+
if (result == "handled")
|
72
|
+
signalLater(cm, "keyHandled", cm, name, e)
|
73
|
+
|
74
|
+
if (result == "handled" || result == "multi") {
|
75
|
+
e_preventDefault(e)
|
76
|
+
restartBlink(cm)
|
77
|
+
}
|
78
|
+
|
79
|
+
return !!result
|
80
|
+
}
|
81
|
+
|
82
|
+
// Handle a key from the keydown event.
|
83
|
+
function handleKeyBinding(cm, e) {
|
84
|
+
let name = keyName(e, true)
|
85
|
+
if (!name) return false
|
86
|
+
|
87
|
+
if (e.shiftKey && !cm.state.keySeq) {
|
88
|
+
// First try to resolve full name (including 'Shift-'). Failing
|
89
|
+
// that, see if there is a cursor-motion command (starting with
|
90
|
+
// 'go') bound to the keyname without 'Shift-'.
|
91
|
+
return dispatchKey(cm, "Shift-" + name, e, b => doHandleBinding(cm, b, true))
|
92
|
+
|| dispatchKey(cm, name, e, b => {
|
93
|
+
if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
|
94
|
+
return doHandleBinding(cm, b)
|
95
|
+
})
|
96
|
+
} else {
|
97
|
+
return dispatchKey(cm, name, e, b => doHandleBinding(cm, b))
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
// Handle a key from the keypress event
|
102
|
+
function handleCharBinding(cm, e, ch) {
|
103
|
+
return dispatchKey(cm, "'" + ch + "'", e, b => doHandleBinding(cm, b, true))
|
104
|
+
}
|
105
|
+
|
106
|
+
let lastStoppedKey = null
|
107
|
+
export function onKeyDown(e) {
|
108
|
+
let cm = this
|
109
|
+
cm.curOp.focus = activeElt()
|
110
|
+
if (signalDOMEvent(cm, e)) return
|
111
|
+
// IE does strange things with escape.
|
112
|
+
if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false
|
113
|
+
let code = e.keyCode
|
114
|
+
cm.display.shift = code == 16 || e.shiftKey
|
115
|
+
let handled = handleKeyBinding(cm, e)
|
116
|
+
if (presto) {
|
117
|
+
lastStoppedKey = handled ? code : null
|
118
|
+
// Opera has no cut event... we try to at least catch the key combo
|
119
|
+
if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
|
120
|
+
cm.replaceSelection("", null, "cut")
|
121
|
+
}
|
122
|
+
|
123
|
+
// Turn mouse into crosshair when Alt is held on Mac.
|
124
|
+
if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
|
125
|
+
showCrossHair(cm)
|
126
|
+
}
|
127
|
+
|
128
|
+
function showCrossHair(cm) {
|
129
|
+
let lineDiv = cm.display.lineDiv
|
130
|
+
addClass(lineDiv, "CodeMirror-crosshair")
|
131
|
+
|
132
|
+
function up(e) {
|
133
|
+
if (e.keyCode == 18 || !e.altKey) {
|
134
|
+
rmClass(lineDiv, "CodeMirror-crosshair")
|
135
|
+
off(document, "keyup", up)
|
136
|
+
off(document, "mouseover", up)
|
137
|
+
}
|
138
|
+
}
|
139
|
+
on(document, "keyup", up)
|
140
|
+
on(document, "mouseover", up)
|
141
|
+
}
|
142
|
+
|
143
|
+
export function onKeyUp(e) {
|
144
|
+
if (e.keyCode == 16) this.doc.sel.shift = false
|
145
|
+
signalDOMEvent(this, e)
|
146
|
+
}
|
147
|
+
|
148
|
+
export function onKeyPress(e) {
|
149
|
+
let cm = this
|
150
|
+
if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return
|
151
|
+
let keyCode = e.keyCode, charCode = e.charCode
|
152
|
+
if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
|
153
|
+
if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) return
|
154
|
+
let ch = String.fromCharCode(charCode == null ? keyCode : charCode)
|
155
|
+
// Some browsers fire keypress events for backspace
|
156
|
+
if (ch == "\x08") return
|
157
|
+
if (handleCharBinding(cm, e, ch)) return
|
158
|
+
cm.display.input.onKeyPress(e)
|
159
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import { scrollbarModel } from "../display/scrollbars.js"
|
2
|
+
import { wheelEventPixels } from "../display/scroll_events.js"
|
3
|
+
import { keyMap, keyName, isModifierKey, lookupKey, normalizeKeyMap } from "../input/keymap.js"
|
4
|
+
import { keyNames } from "../input/keynames.js"
|
5
|
+
import { Line } from "../line/line_data.js"
|
6
|
+
import { cmp, Pos } from "../line/pos.js"
|
7
|
+
import { changeEnd } from "../model/change_measurement.js"
|
8
|
+
import Doc from "../model/Doc.js"
|
9
|
+
import { LineWidget } from "../model/line_widget.js"
|
10
|
+
import { SharedTextMarker, TextMarker } from "../model/mark_text.js"
|
11
|
+
import { copyState, extendMode, getMode, innerMode, mimeModes, modeExtensions, modes, resolveMode, startState } from "../modes.js"
|
12
|
+
import { addClass, contains, rmClass } from "../util/dom.js"
|
13
|
+
import { e_preventDefault, e_stop, e_stopPropagation, off, on, signal } from "../util/event.js"
|
14
|
+
import { splitLinesAuto } from "../util/feature_detection.js"
|
15
|
+
import { countColumn, findColumn, isWordCharBasic, Pass } from "../util/misc.js"
|
16
|
+
import StringStream from "../util/StringStream.js"
|
17
|
+
|
18
|
+
import { commands } from "./commands.js"
|
19
|
+
|
20
|
+
export function addLegacyProps(CodeMirror) {
|
21
|
+
CodeMirror.off = off
|
22
|
+
CodeMirror.on = on
|
23
|
+
CodeMirror.wheelEventPixels = wheelEventPixels
|
24
|
+
CodeMirror.Doc = Doc
|
25
|
+
CodeMirror.splitLines = splitLinesAuto
|
26
|
+
CodeMirror.countColumn = countColumn
|
27
|
+
CodeMirror.findColumn = findColumn
|
28
|
+
CodeMirror.isWordChar = isWordCharBasic
|
29
|
+
CodeMirror.Pass = Pass
|
30
|
+
CodeMirror.signal = signal
|
31
|
+
CodeMirror.Line = Line
|
32
|
+
CodeMirror.changeEnd = changeEnd
|
33
|
+
CodeMirror.scrollbarModel = scrollbarModel
|
34
|
+
CodeMirror.Pos = Pos
|
35
|
+
CodeMirror.cmpPos = cmp
|
36
|
+
CodeMirror.modes = modes
|
37
|
+
CodeMirror.mimeModes = mimeModes
|
38
|
+
CodeMirror.resolveMode = resolveMode
|
39
|
+
CodeMirror.getMode = getMode
|
40
|
+
CodeMirror.modeExtensions = modeExtensions
|
41
|
+
CodeMirror.extendMode = extendMode
|
42
|
+
CodeMirror.copyState = copyState
|
43
|
+
CodeMirror.startState = startState
|
44
|
+
CodeMirror.innerMode = innerMode
|
45
|
+
CodeMirror.commands = commands
|
46
|
+
CodeMirror.keyMap = keyMap
|
47
|
+
CodeMirror.keyName = keyName
|
48
|
+
CodeMirror.isModifierKey = isModifierKey
|
49
|
+
CodeMirror.lookupKey = lookupKey
|
50
|
+
CodeMirror.normalizeKeyMap = normalizeKeyMap
|
51
|
+
CodeMirror.StringStream = StringStream
|
52
|
+
CodeMirror.SharedTextMarker = SharedTextMarker
|
53
|
+
CodeMirror.TextMarker = TextMarker
|
54
|
+
CodeMirror.LineWidget = LineWidget
|
55
|
+
CodeMirror.e_preventDefault = e_preventDefault
|
56
|
+
CodeMirror.e_stopPropagation = e_stopPropagation
|
57
|
+
CodeMirror.e_stop = e_stop
|
58
|
+
CodeMirror.addClass = addClass
|
59
|
+
CodeMirror.contains = contains
|
60
|
+
CodeMirror.rmClass = rmClass
|
61
|
+
CodeMirror.keyNames = keyNames
|
62
|
+
}
|