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,32 @@
|
|
1
|
+
.CodeMirror-dialog {
|
2
|
+
position: absolute;
|
3
|
+
left: 0; right: 0;
|
4
|
+
background: inherit;
|
5
|
+
z-index: 15;
|
6
|
+
padding: .1em .8em;
|
7
|
+
overflow: hidden;
|
8
|
+
color: inherit;
|
9
|
+
}
|
10
|
+
|
11
|
+
.CodeMirror-dialog-top {
|
12
|
+
border-bottom: 1px solid #eee;
|
13
|
+
top: 0;
|
14
|
+
}
|
15
|
+
|
16
|
+
.CodeMirror-dialog-bottom {
|
17
|
+
border-top: 1px solid #eee;
|
18
|
+
bottom: 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.CodeMirror-dialog input {
|
22
|
+
border: none;
|
23
|
+
outline: none;
|
24
|
+
background: transparent;
|
25
|
+
width: 20em;
|
26
|
+
color: inherit;
|
27
|
+
font-family: monospace;
|
28
|
+
}
|
29
|
+
|
30
|
+
.CodeMirror-dialog button {
|
31
|
+
font-size: 70%;
|
32
|
+
}
|
@@ -0,0 +1,161 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
// Open simple dialogs on top of an editor. Relies on dialog.css.
|
5
|
+
|
6
|
+
(function(mod) {
|
7
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
8
|
+
mod(require("../../lib/codemirror"));
|
9
|
+
else if (typeof define == "function" && define.amd) // AMD
|
10
|
+
define(["../../lib/codemirror"], mod);
|
11
|
+
else // Plain browser env
|
12
|
+
mod(CodeMirror);
|
13
|
+
})(function(CodeMirror) {
|
14
|
+
function dialogDiv(cm, template, bottom) {
|
15
|
+
var wrap = cm.getWrapperElement();
|
16
|
+
var dialog;
|
17
|
+
dialog = wrap.appendChild(document.createElement("div"));
|
18
|
+
if (bottom)
|
19
|
+
dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
|
20
|
+
else
|
21
|
+
dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
|
22
|
+
|
23
|
+
if (typeof template == "string") {
|
24
|
+
dialog.innerHTML = template;
|
25
|
+
} else { // Assuming it's a detached DOM element.
|
26
|
+
dialog.appendChild(template);
|
27
|
+
}
|
28
|
+
CodeMirror.addClass(wrap, 'dialog-opened');
|
29
|
+
return dialog;
|
30
|
+
}
|
31
|
+
|
32
|
+
function closeNotification(cm, newVal) {
|
33
|
+
if (cm.state.currentNotificationClose)
|
34
|
+
cm.state.currentNotificationClose();
|
35
|
+
cm.state.currentNotificationClose = newVal;
|
36
|
+
}
|
37
|
+
|
38
|
+
CodeMirror.defineExtension("openDialog", function(template, callback, options) {
|
39
|
+
if (!options) options = {};
|
40
|
+
|
41
|
+
closeNotification(this, null);
|
42
|
+
|
43
|
+
var dialog = dialogDiv(this, template, options.bottom);
|
44
|
+
var closed = false, me = this;
|
45
|
+
function close(newVal) {
|
46
|
+
if (typeof newVal == 'string') {
|
47
|
+
inp.value = newVal;
|
48
|
+
} else {
|
49
|
+
if (closed) return;
|
50
|
+
closed = true;
|
51
|
+
CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');
|
52
|
+
dialog.parentNode.removeChild(dialog);
|
53
|
+
me.focus();
|
54
|
+
|
55
|
+
if (options.onClose) options.onClose(dialog);
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
var inp = dialog.getElementsByTagName("input")[0], button;
|
60
|
+
if (inp) {
|
61
|
+
inp.focus();
|
62
|
+
|
63
|
+
if (options.value) {
|
64
|
+
inp.value = options.value;
|
65
|
+
if (options.selectValueOnOpen !== false) {
|
66
|
+
inp.select();
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
if (options.onInput)
|
71
|
+
CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
|
72
|
+
if (options.onKeyUp)
|
73
|
+
CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
|
74
|
+
|
75
|
+
CodeMirror.on(inp, "keydown", function(e) {
|
76
|
+
if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
|
77
|
+
if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
|
78
|
+
inp.blur();
|
79
|
+
CodeMirror.e_stop(e);
|
80
|
+
close();
|
81
|
+
}
|
82
|
+
if (e.keyCode == 13) callback(inp.value, e);
|
83
|
+
});
|
84
|
+
|
85
|
+
if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
|
86
|
+
} else if (button = dialog.getElementsByTagName("button")[0]) {
|
87
|
+
CodeMirror.on(button, "click", function() {
|
88
|
+
close();
|
89
|
+
me.focus();
|
90
|
+
});
|
91
|
+
|
92
|
+
if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close);
|
93
|
+
|
94
|
+
button.focus();
|
95
|
+
}
|
96
|
+
return close;
|
97
|
+
});
|
98
|
+
|
99
|
+
CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
|
100
|
+
closeNotification(this, null);
|
101
|
+
var dialog = dialogDiv(this, template, options && options.bottom);
|
102
|
+
var buttons = dialog.getElementsByTagName("button");
|
103
|
+
var closed = false, me = this, blurring = 1;
|
104
|
+
function close() {
|
105
|
+
if (closed) return;
|
106
|
+
closed = true;
|
107
|
+
CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');
|
108
|
+
dialog.parentNode.removeChild(dialog);
|
109
|
+
me.focus();
|
110
|
+
}
|
111
|
+
buttons[0].focus();
|
112
|
+
for (var i = 0; i < buttons.length; ++i) {
|
113
|
+
var b = buttons[i];
|
114
|
+
(function(callback) {
|
115
|
+
CodeMirror.on(b, "click", function(e) {
|
116
|
+
CodeMirror.e_preventDefault(e);
|
117
|
+
close();
|
118
|
+
if (callback) callback(me);
|
119
|
+
});
|
120
|
+
})(callbacks[i]);
|
121
|
+
CodeMirror.on(b, "blur", function() {
|
122
|
+
--blurring;
|
123
|
+
setTimeout(function() { if (blurring <= 0) close(); }, 200);
|
124
|
+
});
|
125
|
+
CodeMirror.on(b, "focus", function() { ++blurring; });
|
126
|
+
}
|
127
|
+
});
|
128
|
+
|
129
|
+
/*
|
130
|
+
* openNotification
|
131
|
+
* Opens a notification, that can be closed with an optional timer
|
132
|
+
* (default 5000ms timer) and always closes on click.
|
133
|
+
*
|
134
|
+
* If a notification is opened while another is opened, it will close the
|
135
|
+
* currently opened one and open the new one immediately.
|
136
|
+
*/
|
137
|
+
CodeMirror.defineExtension("openNotification", function(template, options) {
|
138
|
+
closeNotification(this, close);
|
139
|
+
var dialog = dialogDiv(this, template, options && options.bottom);
|
140
|
+
var closed = false, doneTimer;
|
141
|
+
var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
|
142
|
+
|
143
|
+
function close() {
|
144
|
+
if (closed) return;
|
145
|
+
closed = true;
|
146
|
+
clearTimeout(doneTimer);
|
147
|
+
CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');
|
148
|
+
dialog.parentNode.removeChild(dialog);
|
149
|
+
}
|
150
|
+
|
151
|
+
CodeMirror.on(dialog, 'click', function(e) {
|
152
|
+
CodeMirror.e_preventDefault(e);
|
153
|
+
close();
|
154
|
+
});
|
155
|
+
|
156
|
+
if (duration)
|
157
|
+
doneTimer = setTimeout(close, duration);
|
158
|
+
|
159
|
+
return close;
|
160
|
+
});
|
161
|
+
});
|
@@ -0,0 +1,47 @@
|
|
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.defineOption("autoRefresh", false, function(cm, val) {
|
15
|
+
if (cm.state.autoRefresh) {
|
16
|
+
stopListening(cm, cm.state.autoRefresh)
|
17
|
+
cm.state.autoRefresh = null
|
18
|
+
}
|
19
|
+
if (val && cm.display.wrapper.offsetHeight == 0)
|
20
|
+
startListening(cm, cm.state.autoRefresh = {delay: val.delay || 250})
|
21
|
+
})
|
22
|
+
|
23
|
+
function startListening(cm, state) {
|
24
|
+
function check() {
|
25
|
+
if (cm.display.wrapper.offsetHeight) {
|
26
|
+
stopListening(cm, state)
|
27
|
+
if (cm.display.lastWrapHeight != cm.display.wrapper.clientHeight)
|
28
|
+
cm.refresh()
|
29
|
+
} else {
|
30
|
+
state.timeout = setTimeout(check, state.delay)
|
31
|
+
}
|
32
|
+
}
|
33
|
+
state.timeout = setTimeout(check, state.delay)
|
34
|
+
state.hurry = function() {
|
35
|
+
clearTimeout(state.timeout)
|
36
|
+
state.timeout = setTimeout(check, 50)
|
37
|
+
}
|
38
|
+
CodeMirror.on(window, "mouseup", state.hurry)
|
39
|
+
CodeMirror.on(window, "keyup", state.hurry)
|
40
|
+
}
|
41
|
+
|
42
|
+
function stopListening(_cm, state) {
|
43
|
+
clearTimeout(state.timeout)
|
44
|
+
CodeMirror.off(window, "mouseup", state.hurry)
|
45
|
+
CodeMirror.off(window, "keyup", state.hurry)
|
46
|
+
}
|
47
|
+
});
|
@@ -0,0 +1,41 @@
|
|
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.defineOption("fullScreen", false, function(cm, val, old) {
|
15
|
+
if (old == CodeMirror.Init) old = false;
|
16
|
+
if (!old == !val) return;
|
17
|
+
if (val) setFullscreen(cm);
|
18
|
+
else setNormal(cm);
|
19
|
+
});
|
20
|
+
|
21
|
+
function setFullscreen(cm) {
|
22
|
+
var wrap = cm.getWrapperElement();
|
23
|
+
cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
|
24
|
+
width: wrap.style.width, height: wrap.style.height};
|
25
|
+
wrap.style.width = "";
|
26
|
+
wrap.style.height = "auto";
|
27
|
+
wrap.className += " CodeMirror-fullscreen";
|
28
|
+
document.documentElement.style.overflow = "hidden";
|
29
|
+
cm.refresh();
|
30
|
+
}
|
31
|
+
|
32
|
+
function setNormal(cm) {
|
33
|
+
var wrap = cm.getWrapperElement();
|
34
|
+
wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
|
35
|
+
document.documentElement.style.overflow = "";
|
36
|
+
var info = cm.state.fullScreenRestore;
|
37
|
+
wrap.style.width = info.width; wrap.style.height = info.height;
|
38
|
+
window.scrollTo(info.scrollLeft, info.scrollTop);
|
39
|
+
cm.refresh();
|
40
|
+
}
|
41
|
+
});
|
@@ -0,0 +1,127 @@
|
|
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.defineExtension("addPanel", function(node, options) {
|
13
|
+
options = options || {};
|
14
|
+
|
15
|
+
if (!this.state.panels) initPanels(this);
|
16
|
+
|
17
|
+
var info = this.state.panels;
|
18
|
+
var wrapper = info.wrapper;
|
19
|
+
var cmWrapper = this.getWrapperElement();
|
20
|
+
var replace = options.replace instanceof Panel && !options.replace.cleared;
|
21
|
+
|
22
|
+
if (options.after instanceof Panel && !options.after.cleared) {
|
23
|
+
wrapper.insertBefore(node, options.before.node.nextSibling);
|
24
|
+
} else if (options.before instanceof Panel && !options.before.cleared) {
|
25
|
+
wrapper.insertBefore(node, options.before.node);
|
26
|
+
} else if (replace) {
|
27
|
+
wrapper.insertBefore(node, options.replace.node);
|
28
|
+
info.panels++;
|
29
|
+
options.replace.clear();
|
30
|
+
} else if (options.position == "bottom") {
|
31
|
+
wrapper.appendChild(node);
|
32
|
+
} else if (options.position == "before-bottom") {
|
33
|
+
wrapper.insertBefore(node, cmWrapper.nextSibling);
|
34
|
+
} else if (options.position == "after-top") {
|
35
|
+
wrapper.insertBefore(node, cmWrapper);
|
36
|
+
} else {
|
37
|
+
wrapper.insertBefore(node, wrapper.firstChild);
|
38
|
+
}
|
39
|
+
|
40
|
+
var height = (options && options.height) || node.offsetHeight;
|
41
|
+
this._setSize(null, info.heightLeft -= height);
|
42
|
+
if (!replace) {
|
43
|
+
info.panels++;
|
44
|
+
}
|
45
|
+
if (options.stable && isAtTop(this, node))
|
46
|
+
this.scrollTo(null, this.getScrollInfo().top + height)
|
47
|
+
|
48
|
+
return new Panel(this, node, options, height);
|
49
|
+
});
|
50
|
+
|
51
|
+
function Panel(cm, node, options, height) {
|
52
|
+
this.cm = cm;
|
53
|
+
this.node = node;
|
54
|
+
this.options = options;
|
55
|
+
this.height = height;
|
56
|
+
this.cleared = false;
|
57
|
+
}
|
58
|
+
|
59
|
+
Panel.prototype.clear = function() {
|
60
|
+
if (this.cleared) return;
|
61
|
+
this.cleared = true;
|
62
|
+
var info = this.cm.state.panels;
|
63
|
+
this.cm._setSize(null, info.heightLeft += this.height);
|
64
|
+
if (this.options.stable && isAtTop(this.cm, this.node))
|
65
|
+
this.cm.scrollTo(null, this.cm.getScrollInfo().top - this.height)
|
66
|
+
info.wrapper.removeChild(this.node);
|
67
|
+
if (--info.panels == 0) removePanels(this.cm);
|
68
|
+
};
|
69
|
+
|
70
|
+
Panel.prototype.changed = function(height) {
|
71
|
+
var newHeight = height == null ? this.node.offsetHeight : height;
|
72
|
+
var info = this.cm.state.panels;
|
73
|
+
this.cm._setSize(null, info.heightLeft -= (newHeight - this.height));
|
74
|
+
this.height = newHeight;
|
75
|
+
};
|
76
|
+
|
77
|
+
function initPanels(cm) {
|
78
|
+
var wrap = cm.getWrapperElement();
|
79
|
+
var style = window.getComputedStyle ? window.getComputedStyle(wrap) : wrap.currentStyle;
|
80
|
+
var height = parseInt(style.height);
|
81
|
+
var info = cm.state.panels = {
|
82
|
+
setHeight: wrap.style.height,
|
83
|
+
heightLeft: height,
|
84
|
+
panels: 0,
|
85
|
+
wrapper: document.createElement("div")
|
86
|
+
};
|
87
|
+
wrap.parentNode.insertBefore(info.wrapper, wrap);
|
88
|
+
var hasFocus = cm.hasFocus();
|
89
|
+
info.wrapper.appendChild(wrap);
|
90
|
+
if (hasFocus) cm.focus();
|
91
|
+
|
92
|
+
cm._setSize = cm.setSize;
|
93
|
+
if (height != null) cm.setSize = function(width, newHeight) {
|
94
|
+
if (newHeight == null) return this._setSize(width, newHeight);
|
95
|
+
info.setHeight = newHeight;
|
96
|
+
if (typeof newHeight != "number") {
|
97
|
+
var px = /^(\d+\.?\d*)px$/.exec(newHeight);
|
98
|
+
if (px) {
|
99
|
+
newHeight = Number(px[1]);
|
100
|
+
} else {
|
101
|
+
info.wrapper.style.height = newHeight;
|
102
|
+
newHeight = info.wrapper.offsetHeight;
|
103
|
+
info.wrapper.style.height = "";
|
104
|
+
}
|
105
|
+
}
|
106
|
+
cm._setSize(width, info.heightLeft += (newHeight - height));
|
107
|
+
height = newHeight;
|
108
|
+
};
|
109
|
+
}
|
110
|
+
|
111
|
+
function removePanels(cm) {
|
112
|
+
var info = cm.state.panels;
|
113
|
+
cm.state.panels = null;
|
114
|
+
|
115
|
+
var wrap = cm.getWrapperElement();
|
116
|
+
info.wrapper.parentNode.replaceChild(wrap, info.wrapper);
|
117
|
+
wrap.style.height = info.setHeight;
|
118
|
+
cm.setSize = cm._setSize;
|
119
|
+
cm.setSize();
|
120
|
+
}
|
121
|
+
|
122
|
+
function isAtTop(cm, dom) {
|
123
|
+
for (var sibling = dom.nextSibling; sibling; sibling = sibling.nextSibling)
|
124
|
+
if (sibling == cm.getWrapperElement()) return true
|
125
|
+
return false
|
126
|
+
}
|
127
|
+
});
|
@@ -0,0 +1,63 @@
|
|
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("placeholder", "", function(cm, val, old) {
|
13
|
+
var prev = old && old != CodeMirror.Init;
|
14
|
+
if (val && !prev) {
|
15
|
+
cm.on("blur", onBlur);
|
16
|
+
cm.on("change", onChange);
|
17
|
+
cm.on("swapDoc", onChange);
|
18
|
+
onChange(cm);
|
19
|
+
} else if (!val && prev) {
|
20
|
+
cm.off("blur", onBlur);
|
21
|
+
cm.off("change", onChange);
|
22
|
+
cm.off("swapDoc", onChange);
|
23
|
+
clearPlaceholder(cm);
|
24
|
+
var wrapper = cm.getWrapperElement();
|
25
|
+
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
|
26
|
+
}
|
27
|
+
|
28
|
+
if (val && !cm.hasFocus()) onBlur(cm);
|
29
|
+
});
|
30
|
+
|
31
|
+
function clearPlaceholder(cm) {
|
32
|
+
if (cm.state.placeholder) {
|
33
|
+
cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
|
34
|
+
cm.state.placeholder = null;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
function setPlaceholder(cm) {
|
38
|
+
clearPlaceholder(cm);
|
39
|
+
var elt = cm.state.placeholder = document.createElement("pre");
|
40
|
+
elt.style.cssText = "height: 0; overflow: visible";
|
41
|
+
elt.style.direction = cm.getOption("direction");
|
42
|
+
elt.className = "CodeMirror-placeholder";
|
43
|
+
var placeHolder = cm.getOption("placeholder")
|
44
|
+
if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder)
|
45
|
+
elt.appendChild(placeHolder)
|
46
|
+
cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
|
47
|
+
}
|
48
|
+
|
49
|
+
function onBlur(cm) {
|
50
|
+
if (isEmpty(cm)) setPlaceholder(cm);
|
51
|
+
}
|
52
|
+
function onChange(cm) {
|
53
|
+
var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
|
54
|
+
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
|
55
|
+
|
56
|
+
if (empty) setPlaceholder(cm);
|
57
|
+
else clearPlaceholder(cm);
|
58
|
+
}
|
59
|
+
|
60
|
+
function isEmpty(cm) {
|
61
|
+
return (cm.lineCount() === 1) && (cm.getLine(0) === "");
|
62
|
+
}
|
63
|
+
});
|