qword 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +2333 -0
- package/LICENSE +22 -0
- package/README.md +170 -0
- package/assets/font/DroidSansMono.eot +0 -0
- package/assets/font/DroidSansMono.woff +0 -0
- package/assets/font/DroidSansMono.woff2 +0 -0
- package/assets/index.html +24 -0
- package/assets/style.css +34 -0
- package/bin/dword.js +109 -0
- package/client/_clipboard.js +53 -0
- package/client/_init-socket.js +77 -0
- package/client/_on-save.js +38 -0
- package/client/codemirror/show-trailing.js +54 -0
- package/client/codemirror/use-soft-tabs.js +38 -0
- package/client/dword.js +717 -0
- package/client/loadremote.js +93 -0
- package/client/save.js +53 -0
- package/client/set-key-map.js +3 -0
- package/client/show-message.js +30 -0
- package/client/story.js +55 -0
- package/codemirror/codemirror.js +3 -0
- package/css/dword.css +20 -0
- package/dist/2b22a33a0a80bb926bbc.png +1 -0
- package/dist/8e9019bd86255ac9a618.png +1 -0
- package/dist/codemirror.js +2 -0
- package/dist/codemirror.js.map +1 -0
- package/dist/dword.js +2 -0
- package/dist/dword.js.map +1 -0
- package/dist-dev/2b22a33a0a80bb926bbc.png +1 -0
- package/dist-dev/8e9019bd86255ac9a618.png +1 -0
- package/dist-dev/codemirror.js +104 -0
- package/dist-dev/dword.js +960 -0
- package/img/dword.png +0 -0
- package/json/bin.json +4 -0
- package/json/edit.json +17 -0
- package/json/ext.json +12 -0
- package/json/modules.json +22 -0
- package/modules/cm-searchbox/ChangeLog +60 -0
- package/modules/cm-searchbox/LICENSE +21 -0
- package/modules/cm-searchbox/README.md +27 -0
- package/modules/cm-searchbox/img/searchbox.png +0 -0
- package/modules/cm-searchbox/lib/searchbox.js +679 -0
- package/modules/cm-searchbox/package.json +27 -0
- package/modules/cm-show-invisibles/ChangeLog +108 -0
- package/modules/cm-show-invisibles/LICENSE +21 -0
- package/modules/cm-show-invisibles/README.md +25 -0
- package/modules/cm-show-invisibles/lib/show-invisibles.js +131 -0
- package/modules/cm-show-invisibles/package.json +34 -0
- package/modules/codemirror/AUTHORS +992 -0
- package/modules/codemirror/CHANGELOG.md +2290 -0
- package/modules/codemirror/CONTRIBUTING.md +97 -0
- package/modules/codemirror/LICENSE +21 -0
- package/modules/codemirror/README.md +48 -0
- package/modules/codemirror/addon/comment/comment.js +211 -0
- package/modules/codemirror/addon/comment/continuecomment.js +114 -0
- package/modules/codemirror/addon/dialog/dialog.css +32 -0
- package/modules/codemirror/addon/dialog/dialog.js +163 -0
- package/modules/codemirror/addon/display/autorefresh.js +47 -0
- package/modules/codemirror/addon/display/fullscreen.css +6 -0
- package/modules/codemirror/addon/display/fullscreen.js +41 -0
- package/modules/codemirror/addon/display/panel.js +133 -0
- package/modules/codemirror/addon/display/placeholder.js +78 -0
- package/modules/codemirror/addon/display/rulers.js +51 -0
- package/modules/codemirror/addon/edit/closebrackets.js +201 -0
- package/modules/codemirror/addon/edit/closetag.js +185 -0
- package/modules/codemirror/addon/edit/continuelist.js +101 -0
- package/modules/codemirror/addon/edit/matchbrackets.js +160 -0
- package/modules/codemirror/addon/edit/matchtags.js +66 -0
- package/modules/codemirror/addon/edit/trailingspace.js +27 -0
- package/modules/codemirror/addon/fold/brace-fold.js +119 -0
- package/modules/codemirror/addon/fold/comment-fold.js +59 -0
- package/modules/codemirror/addon/fold/foldcode.js +159 -0
- package/modules/codemirror/addon/fold/foldgutter.css +20 -0
- package/modules/codemirror/addon/fold/foldgutter.js +169 -0
- package/modules/codemirror/addon/fold/indent-fold.js +48 -0
- package/modules/codemirror/addon/fold/markdown-fold.js +49 -0
- package/modules/codemirror/addon/fold/xml-fold.js +184 -0
- package/modules/codemirror/addon/hint/anyword-hint.js +41 -0
- package/modules/codemirror/addon/hint/css-hint.js +66 -0
- package/modules/codemirror/addon/hint/html-hint.js +351 -0
- package/modules/codemirror/addon/hint/javascript-hint.js +162 -0
- package/modules/codemirror/addon/hint/show-hint.css +37 -0
- package/modules/codemirror/addon/hint/show-hint.js +523 -0
- package/modules/codemirror/addon/hint/sql-hint.js +304 -0
- package/modules/codemirror/addon/hint/xml-hint.js +132 -0
- package/modules/codemirror/addon/lint/coffeescript-lint.js +47 -0
- package/modules/codemirror/addon/lint/css-lint.js +40 -0
- package/modules/codemirror/addon/lint/html-lint.js +59 -0
- package/modules/codemirror/addon/lint/javascript-lint.js +65 -0
- package/modules/codemirror/addon/lint/json-lint.js +40 -0
- package/modules/codemirror/addon/lint/lint.css +79 -0
- package/modules/codemirror/addon/lint/lint.js +288 -0
- package/modules/codemirror/addon/lint/yaml-lint.js +41 -0
- package/modules/codemirror/addon/merge/merge.css +119 -0
- package/modules/codemirror/addon/merge/merge.js +1018 -0
- package/modules/codemirror/addon/mode/loadmode.js +66 -0
- package/modules/codemirror/addon/mode/multiplex.js +136 -0
- package/modules/codemirror/addon/mode/multiplex_test.js +49 -0
- package/modules/codemirror/addon/mode/overlay.js +90 -0
- package/modules/codemirror/addon/mode/simple.js +216 -0
- package/modules/codemirror/addon/runmode/colorize.js +40 -0
- package/modules/codemirror/addon/runmode/runmode-standalone.js +334 -0
- package/modules/codemirror/addon/runmode/runmode.js +76 -0
- package/modules/codemirror/addon/runmode/runmode.node.js +329 -0
- package/modules/codemirror/addon/scroll/annotatescrollbar.js +128 -0
- package/modules/codemirror/addon/scroll/scrollpastend.js +48 -0
- package/modules/codemirror/addon/scroll/simplescrollbars.css +66 -0
- package/modules/codemirror/addon/scroll/simplescrollbars.js +152 -0
- package/modules/codemirror/addon/search/jump-to-line.js +53 -0
- package/modules/codemirror/addon/search/match-highlighter.js +167 -0
- package/modules/codemirror/addon/search/matchesonscrollbar.css +8 -0
- package/modules/codemirror/addon/search/matchesonscrollbar.js +97 -0
- package/modules/codemirror/addon/search/search.js +295 -0
- package/modules/codemirror/addon/search/searchcursor.js +305 -0
- package/modules/codemirror/addon/selection/active-line.js +72 -0
- package/modules/codemirror/addon/selection/mark-selection.js +119 -0
- package/modules/codemirror/addon/selection/selection-pointer.js +98 -0
- package/modules/codemirror/addon/tern/tern.css +87 -0
- package/modules/codemirror/addon/tern/tern.js +756 -0
- package/modules/codemirror/addon/tern/worker.js +44 -0
- package/modules/codemirror/addon/wrap/hardwrap.js +160 -0
- package/modules/codemirror/bin/source-highlight +48 -0
- package/modules/codemirror/changes +3 -0
- package/modules/codemirror/changes.md +42 -0
- package/modules/codemirror/changes.txt +8 -0
- package/modules/codemirror/diff +781 -0
- package/modules/codemirror/dist/index.cjs +102 -0
- package/modules/codemirror/dist/index.d.cts +52 -0
- package/modules/codemirror/dist/index.d.ts +52 -0
- package/modules/codemirror/dist/index.js +96 -0
- package/modules/codemirror/keymap/emacs.js +545 -0
- package/modules/codemirror/keymap/sublime.js +720 -0
- package/modules/codemirror/keymap/vim.js +5978 -0
- package/modules/codemirror/lib/codemirror.css +344 -0
- package/modules/codemirror/lib/codemirror.js +9884 -0
- package/modules/codemirror/mode/apl/apl.js +174 -0
- package/modules/codemirror/mode/asciiarmor/asciiarmor.js +74 -0
- package/modules/codemirror/mode/asn.1/asn.1.js +204 -0
- package/modules/codemirror/mode/asterisk/asterisk.js +220 -0
- package/modules/codemirror/mode/brainfuck/brainfuck.js +85 -0
- package/modules/codemirror/mode/clike/clike.js +942 -0
- package/modules/codemirror/mode/clojure/clojure.js +293 -0
- package/modules/codemirror/mode/cmake/cmake.js +97 -0
- package/modules/codemirror/mode/cobol/cobol.js +255 -0
- package/modules/codemirror/mode/coffeescript/coffeescript.js +359 -0
- package/modules/codemirror/mode/commonlisp/commonlisp.js +125 -0
- package/modules/codemirror/mode/crystal/crystal.js +433 -0
- package/modules/codemirror/mode/css/css.js +862 -0
- package/modules/codemirror/mode/cypher/cypher.js +152 -0
- package/modules/codemirror/mode/d/d.js +223 -0
- package/modules/codemirror/mode/dart/dart.js +168 -0
- package/modules/codemirror/mode/diff/diff.js +47 -0
- package/modules/codemirror/mode/django/django.js +356 -0
- package/modules/codemirror/mode/dockerfile/dockerfile.js +211 -0
- package/modules/codemirror/mode/dtd/dtd.js +142 -0
- package/modules/codemirror/mode/dylan/dylan.js +352 -0
- package/modules/codemirror/mode/ebnf/ebnf.js +195 -0
- package/modules/codemirror/mode/ecl/ecl.js +206 -0
- package/modules/codemirror/mode/eiffel/eiffel.js +160 -0
- package/modules/codemirror/mode/elm/elm.js +245 -0
- package/modules/codemirror/mode/erlang/erlang.js +619 -0
- package/modules/codemirror/mode/factor/factor.js +85 -0
- package/modules/codemirror/mode/fcl/fcl.js +173 -0
- package/modules/codemirror/mode/forth/forth.js +180 -0
- package/modules/codemirror/mode/fortran/fortran.js +188 -0
- package/modules/codemirror/mode/gas/gas.js +355 -0
- package/modules/codemirror/mode/gfm/gfm.js +129 -0
- package/modules/codemirror/mode/gherkin/gherkin.js +194 -0
- package/modules/codemirror/mode/go/go.js +187 -0
- package/modules/codemirror/mode/groovy/groovy.js +245 -0
- package/modules/codemirror/mode/haml/haml.js +161 -0
- package/modules/codemirror/mode/handlebars/handlebars.js +70 -0
- package/modules/codemirror/mode/haskell/haskell.js +268 -0
- package/modules/codemirror/mode/haskell-literate/haskell-literate.js +43 -0
- package/modules/codemirror/mode/haxe/haxe.js +515 -0
- package/modules/codemirror/mode/htmlembedded/htmlembedded.js +37 -0
- package/modules/codemirror/mode/htmlmixed/htmlmixed.js +153 -0
- package/modules/codemirror/mode/http/http.js +113 -0
- package/modules/codemirror/mode/idl/idl.js +290 -0
- package/modules/codemirror/mode/javascript/javascript.js +960 -0
- package/modules/codemirror/mode/jinja2/jinja2.js +193 -0
- package/modules/codemirror/mode/jsx/jsx.js +149 -0
- package/modules/codemirror/mode/julia/julia.js +390 -0
- package/modules/codemirror/mode/livescript/livescript.js +280 -0
- package/modules/codemirror/mode/lua/lua.js +160 -0
- package/modules/codemirror/mode/markdown/markdown.js +886 -0
- package/modules/codemirror/mode/mathematica/mathematica.js +176 -0
- package/modules/codemirror/mode/mbox/mbox.js +129 -0
- package/modules/codemirror/mode/meta.js +221 -0
- package/modules/codemirror/mode/mirc/mirc.js +193 -0
- package/modules/codemirror/mode/mllike/mllike.js +359 -0
- package/modules/codemirror/mode/modelica/modelica.js +245 -0
- package/modules/codemirror/mode/mscgen/mscgen.js +175 -0
- package/modules/codemirror/mode/mumps/mumps.js +148 -0
- package/modules/codemirror/mode/nginx/nginx.js +178 -0
- package/modules/codemirror/mode/nsis/nsis.js +95 -0
- package/modules/codemirror/mode/ntriples/ntriples.js +195 -0
- package/modules/codemirror/mode/octave/octave.js +139 -0
- package/modules/codemirror/mode/oz/oz.js +252 -0
- package/modules/codemirror/mode/pascal/pascal.js +136 -0
- package/modules/codemirror/mode/pegjs/pegjs.js +111 -0
- package/modules/codemirror/mode/perl/perl.js +836 -0
- package/modules/codemirror/mode/php/php.js +234 -0
- package/modules/codemirror/mode/pig/pig.js +178 -0
- package/modules/codemirror/mode/powershell/powershell.js +398 -0
- package/modules/codemirror/mode/properties/properties.js +78 -0
- package/modules/codemirror/mode/protobuf/protobuf.js +72 -0
- package/modules/codemirror/mode/pug/pug.js +591 -0
- package/modules/codemirror/mode/puppet/puppet.js +220 -0
- package/modules/codemirror/mode/python/python.js +402 -0
- package/modules/codemirror/mode/q/q.js +139 -0
- package/modules/codemirror/mode/r/r.js +190 -0
- package/modules/codemirror/mode/rpm/changes/index.html +66 -0
- package/modules/codemirror/mode/rpm/rpm.js +109 -0
- package/modules/codemirror/mode/rst/rst.js +557 -0
- package/modules/codemirror/mode/ruby/ruby.js +303 -0
- package/modules/codemirror/mode/rust/rust.js +72 -0
- package/modules/codemirror/mode/sas/sas.js +303 -0
- package/modules/codemirror/mode/sass/sass.js +459 -0
- package/modules/codemirror/mode/scheme/scheme.js +284 -0
- package/modules/codemirror/mode/shell/shell.js +168 -0
- package/modules/codemirror/mode/sieve/sieve.js +193 -0
- package/modules/codemirror/mode/slim/slim.js +575 -0
- package/modules/codemirror/mode/smalltalk/smalltalk.js +168 -0
- package/modules/codemirror/mode/smarty/smarty.js +225 -0
- package/modules/codemirror/mode/solr/solr.js +104 -0
- package/modules/codemirror/mode/soy/soy.js +665 -0
- package/modules/codemirror/mode/sparql/sparql.js +184 -0
- package/modules/codemirror/mode/spreadsheet/spreadsheet.js +112 -0
- package/modules/codemirror/mode/sql/sql.js +529 -0
- package/modules/codemirror/mode/stex/stex.js +264 -0
- package/modules/codemirror/mode/stylus/stylus.js +775 -0
- package/modules/codemirror/mode/swift/swift.js +221 -0
- package/modules/codemirror/mode/tcl/tcl.js +140 -0
- package/modules/codemirror/mode/textile/textile.js +469 -0
- package/modules/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- package/modules/codemirror/mode/tiddlywiki/tiddlywiki.js +308 -0
- package/modules/codemirror/mode/tiki/tiki.css +26 -0
- package/modules/codemirror/mode/tiki/tiki.js +312 -0
- package/modules/codemirror/mode/toml/toml.js +88 -0
- package/modules/codemirror/mode/tornado/tornado.js +68 -0
- package/modules/codemirror/mode/troff/troff.js +84 -0
- package/modules/codemirror/mode/ttcn/ttcn.js +283 -0
- package/modules/codemirror/mode/ttcn-cfg/ttcn-cfg.js +214 -0
- package/modules/codemirror/mode/turtle/turtle.js +162 -0
- package/modules/codemirror/mode/twig/twig.js +141 -0
- package/modules/codemirror/mode/vb/vb.js +275 -0
- package/modules/codemirror/mode/vbscript/vbscript.js +350 -0
- package/modules/codemirror/mode/velocity/velocity.js +202 -0
- package/modules/codemirror/mode/verilog/verilog.js +781 -0
- package/modules/codemirror/mode/vhdl/vhdl.js +189 -0
- package/modules/codemirror/mode/vue/vue.js +77 -0
- package/modules/codemirror/mode/wast/wast.js +132 -0
- package/modules/codemirror/mode/webidl/webidl.js +195 -0
- package/modules/codemirror/mode/xml/xml.js +417 -0
- package/modules/codemirror/mode/xquery/xquery.js +448 -0
- package/modules/codemirror/mode/yacas/yacas.js +204 -0
- package/modules/codemirror/mode/yaml/yaml.js +120 -0
- package/modules/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +72 -0
- package/modules/codemirror/mode/z80/z80.js +116 -0
- package/modules/codemirror/package.json +52 -0
- package/modules/codemirror/src/addon/runmode/codemirror-standalone.js +24 -0
- package/modules/codemirror/src/addon/runmode/codemirror.node.js +21 -0
- package/modules/codemirror/src/addon/runmode/runmode-standalone.js +2 -0
- package/modules/codemirror/src/addon/runmode/runmode.node.js +2 -0
- package/modules/codemirror/src/codemirror.js +3 -0
- package/modules/codemirror/src/display/Display.js +116 -0
- package/modules/codemirror/src/display/focus.js +50 -0
- package/modules/codemirror/src/display/gutters.js +44 -0
- package/modules/codemirror/src/display/highlight_worker.js +55 -0
- package/modules/codemirror/src/display/line_numbers.js +48 -0
- package/modules/codemirror/src/display/mode_state.js +22 -0
- package/modules/codemirror/src/display/operations.js +206 -0
- package/modules/codemirror/src/display/scroll_events.js +132 -0
- package/modules/codemirror/src/display/scrollbars.js +194 -0
- package/modules/codemirror/src/display/scrolling.js +186 -0
- package/modules/codemirror/src/display/selection.js +173 -0
- package/modules/codemirror/src/display/update_display.js +267 -0
- package/modules/codemirror/src/display/update_line.js +189 -0
- package/modules/codemirror/src/display/update_lines.js +82 -0
- package/modules/codemirror/src/display/view_tracking.js +153 -0
- package/modules/codemirror/src/edit/CodeMirror.js +217 -0
- package/modules/codemirror/src/edit/commands.js +178 -0
- package/modules/codemirror/src/edit/deleteNearSelection.js +30 -0
- package/modules/codemirror/src/edit/drop_events.js +130 -0
- package/modules/codemirror/src/edit/fromTextArea.js +61 -0
- package/modules/codemirror/src/edit/global_events.js +45 -0
- package/modules/codemirror/src/edit/key_events.js +163 -0
- package/modules/codemirror/src/edit/legacy.js +62 -0
- package/modules/codemirror/src/edit/main.js +69 -0
- package/modules/codemirror/src/edit/methods.js +555 -0
- package/modules/codemirror/src/edit/mouse_events.js +417 -0
- package/modules/codemirror/src/edit/options.js +194 -0
- package/modules/codemirror/src/edit/utils.js +7 -0
- package/modules/codemirror/src/input/#ContentEditableInput.js# +475 -0
- package/modules/codemirror/src/input/ContentEditableInput.js +546 -0
- package/modules/codemirror/src/input/TextareaInput.js +380 -0
- package/modules/codemirror/src/input/indent.js +71 -0
- package/modules/codemirror/src/input/input.js +134 -0
- package/modules/codemirror/src/input/keymap.js +147 -0
- package/modules/codemirror/src/input/keynames.js +17 -0
- package/modules/codemirror/src/input/movement.js +111 -0
- package/modules/codemirror/src/line/highlight.js +284 -0
- package/modules/codemirror/src/line/line_data.js +349 -0
- package/modules/codemirror/src/line/pos.js +40 -0
- package/modules/codemirror/src/line/saw_special_spans.js +10 -0
- package/modules/codemirror/src/line/spans.js +390 -0
- package/modules/codemirror/src/line/utils_line.js +85 -0
- package/modules/codemirror/src/measurement/position_measurement.js +702 -0
- package/modules/codemirror/src/measurement/widgets.js +26 -0
- package/modules/codemirror/src/model/Doc.js +436 -0
- package/modules/codemirror/src/model/change_measurement.js +61 -0
- package/modules/codemirror/src/model/changes.js +339 -0
- package/modules/codemirror/src/model/chunk.js +167 -0
- package/modules/codemirror/src/model/document_data.js +112 -0
- package/modules/codemirror/src/model/history.js +228 -0
- package/modules/codemirror/src/model/line_widget.js +78 -0
- package/modules/codemirror/src/model/mark_text.js +293 -0
- package/modules/codemirror/src/model/selection.js +84 -0
- package/modules/codemirror/src/model/selection_updates.js +216 -0
- package/modules/codemirror/src/modes.js +96 -0
- package/modules/codemirror/src/util/StringStream.js +90 -0
- package/modules/codemirror/src/util/bidi.js +215 -0
- package/modules/codemirror/src/util/browser.js +34 -0
- package/modules/codemirror/src/util/dom.js +111 -0
- package/modules/codemirror/src/util/event.js +103 -0
- package/modules/codemirror/src/util/feature_detection.js +84 -0
- package/modules/codemirror/src/util/misc.js +168 -0
- package/modules/codemirror/src/util/operation_group.js +72 -0
- package/modules/codemirror/theme/3024-day.css +41 -0
- package/modules/codemirror/theme/3024-night.css +39 -0
- package/modules/codemirror/theme/abbott.css +268 -0
- package/modules/codemirror/theme/abcdef.css +32 -0
- package/modules/codemirror/theme/ambiance-mobile.css +5 -0
- package/modules/codemirror/theme/ambiance.css +74 -0
- package/modules/codemirror/theme/ayu-dark.css +44 -0
- package/modules/codemirror/theme/ayu-mirage.css +45 -0
- package/modules/codemirror/theme/base16-dark.css +40 -0
- package/modules/codemirror/theme/base16-light.css +38 -0
- package/modules/codemirror/theme/bespin.css +34 -0
- package/modules/codemirror/theme/blackboard.css +32 -0
- package/modules/codemirror/theme/cobalt.css +25 -0
- package/modules/codemirror/theme/colorforth.css +33 -0
- package/modules/codemirror/theme/darcula.css +53 -0
- package/modules/codemirror/theme/dracula.css +40 -0
- package/modules/codemirror/theme/duotone-dark.css +35 -0
- package/modules/codemirror/theme/duotone-light.css +36 -0
- package/modules/codemirror/theme/eclipse.css +23 -0
- package/modules/codemirror/theme/elegant.css +13 -0
- package/modules/codemirror/theme/erlang-dark.css +34 -0
- package/modules/codemirror/theme/gruvbox-dark.css +39 -0
- package/modules/codemirror/theme/hopscotch.css +34 -0
- package/modules/codemirror/theme/icecoder.css +43 -0
- package/modules/codemirror/theme/idea.css +42 -0
- package/modules/codemirror/theme/isotope.css +34 -0
- package/modules/codemirror/theme/juejin.css +30 -0
- package/modules/codemirror/theme/lesser-dark.css +47 -0
- package/modules/codemirror/theme/liquibyte.css +95 -0
- package/modules/codemirror/theme/lucario.css +37 -0
- package/modules/codemirror/theme/material-darker.css +135 -0
- package/modules/codemirror/theme/material-ocean.css +141 -0
- package/modules/codemirror/theme/material-palenight.css +141 -0
- package/modules/codemirror/theme/material.css +141 -0
- package/modules/codemirror/theme/mbo.css +37 -0
- package/modules/codemirror/theme/mdn-like.css +46 -0
- package/modules/codemirror/theme/midnight.css +39 -0
- package/modules/codemirror/theme/monokai.css +41 -0
- package/modules/codemirror/theme/moxer.css +143 -0
- package/modules/codemirror/theme/neat.css +12 -0
- package/modules/codemirror/theme/neo.css +43 -0
- package/modules/codemirror/theme/night.css +27 -0
- package/modules/codemirror/theme/nord.css +42 -0
- package/modules/codemirror/theme/oceanic-next.css +46 -0
- package/modules/codemirror/theme/panda-syntax.css +85 -0
- package/modules/codemirror/theme/paraiso-dark.css +38 -0
- package/modules/codemirror/theme/paraiso-light.css +38 -0
- package/modules/codemirror/theme/pastel-on-dark.css +52 -0
- package/modules/codemirror/theme/railscasts.css +34 -0
- package/modules/codemirror/theme/rubyblue.css +25 -0
- package/modules/codemirror/theme/seti.css +44 -0
- package/modules/codemirror/theme/shadowfox.css +52 -0
- package/modules/codemirror/theme/solarized.css +165 -0
- package/modules/codemirror/theme/ssms.css +16 -0
- package/modules/codemirror/theme/the-matrix.css +30 -0
- package/modules/codemirror/theme/tomorrow-night-bright.css +35 -0
- package/modules/codemirror/theme/tomorrow-night-eighties.css +38 -0
- package/modules/codemirror/theme/ttcn.css +64 -0
- package/modules/codemirror/theme/twilight.css +32 -0
- package/modules/codemirror/theme/vibrant-ink.css +34 -0
- package/modules/codemirror/theme/xq-dark.css +53 -0
- package/modules/codemirror/theme/xq-light.css +43 -0
- package/modules/codemirror/theme/yeti.css +44 -0
- package/modules/codemirror/theme/yonce.css +59 -0
- package/modules/codemirror/theme/zenburn.css +37 -0
- package/modules/codemirror-emmet/README.md +56 -0
- package/modules/codemirror-emmet/dist/emmet.js +48661 -0
- package/modules/codemirror-emmet/dist/emmet.min.js +8 -0
- package/modules/codemirror-emmet/dist/emmetPlugin.js +840 -0
- package/modules/codemirror-emmet/dist/emmetPlugin.min.js +1 -0
- package/modules/codemirror-emmet/dist/index.html +46 -0
- package/modules/codemirror-emmet/editor.js +204 -0
- package/modules/codemirror-emmet/gulpfile.js +54 -0
- package/modules/codemirror-emmet/index.html +68 -0
- package/modules/codemirror-emmet/package.json +36 -0
- package/modules/codemirror-emmet/plugin.js +201 -0
- package/modules/codemirror-emmet/shim.js +19 -0
- package/modules/codemirror-emmet/vendor/almond.js +410 -0
- package/modules/codemirror-emmet/vendor/codemirror/v4/codemirror.css +270 -0
- package/modules/codemirror-emmet/vendor/codemirror/v4/codemirror.js +7339 -0
- package/modules/codemirror-emmet/vendor/codemirror/v4/css.js +701 -0
- package/modules/codemirror-emmet/vendor/codemirror/v4/htmlmixed.js +117 -0
- package/modules/codemirror-emmet/vendor/codemirror/v4/xml.js +349 -0
- package/modules/jshint/README.md +114 -0
- package/modules/jshint/dist/jshint-rhino.js +32143 -0
- package/modules/jshint/dist/jshint.js +32141 -0
- package/modules/jshint/package.json +77 -0
- package/modules/loadremote/ChangeLog +23 -0
- package/modules/loadremote/LICENSE +21 -0
- package/modules/loadremote/README.md +53 -0
- package/modules/loadremote/lib/loadremote.js +147 -0
- package/modules/loadremote/package.json +26 -0
- package/package.json +107 -0
- package/server/edit.js +54 -0
- package/server/index.js +193 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){"function"==typeof define&&define.amd?define(e):t.emmetPlugin=e()}(this,function(){var t,e,n;return function(i){function r(t,e){return C.call(t,e)}function o(t,e){var n,i,r,o,s,c,a,u,l,f,m=e&&e.split("/"),d=x.map,p=d&&d["*"]||{};if(t&&"."===t.charAt(0))if(e){for(m=m.slice(0,m.length-1),t=m.concat(t.split("/")),u=0;u<t.length;u+=1)if(f=t[u],"."===f)t.splice(u,1),u-=1;else if(".."===f){if(1===u&&(".."===t[2]||".."===t[0]))break;u>0&&(t.splice(u-1,2),u-=2)}t=t.join("/")}else 0===t.indexOf("./")&&(t=t.substring(2));if((m||p)&&d){for(n=t.split("/"),u=n.length;u>0;u-=1){if(i=n.slice(0,u).join("/"),m)for(l=m.length;l>0;l-=1)if(r=d[m.slice(0,l).join("/")],r&&(r=r[i])){o=r,s=u;break}if(o)break;!c&&p&&p[i]&&(c=p[i],a=u)}!o&&c&&(o=c,s=a),o&&(n.splice(0,s,o),t=n.join("/"))}return t}function s(t,e){return function(){return d.apply(i,v.call(arguments,0).concat([t,e]))}}function c(t){return function(e){return o(e,t)}}function a(t){return function(e){g[t]=e}}function u(t){if(r(_,t)){var e=_[t];delete _[t],b[t]=!0,m.apply(i,e)}if(!r(g,t)&&!r(b,t))throw new Error("No "+t);return g[t]}function l(t){var e,n=t?t.indexOf("!"):-1;return n>-1&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),[e,t]}function f(t){return function(){return x&&x.config&&x.config[t]||{}}}var m,d,p,h,g={},_={},x={},b={},C=Object.prototype.hasOwnProperty,v=[].slice;p=function(t,e){var n,i=l(t),r=i[0];return t=i[1],r&&(r=o(r,e),n=u(r)),r?t=n&&n.normalize?n.normalize(t,c(e)):o(t,e):(t=o(t,e),i=l(t),r=i[0],t=i[1],r&&(n=u(r))),{f:r?r+"!"+t:t,n:t,pr:r,p:n}},h={require:function(t){return s(t)},exports:function(t){var e=g[t];return"undefined"!=typeof e?e:g[t]={}},module:function(t){return{id:t,uri:"",exports:g[t],config:f(t)}}},m=function(t,e,n,o){var c,l,f,m,d,x,C=[];if(o=o||t,"function"==typeof n){for(e=!e.length&&n.length?["require","exports","module"]:e,d=0;d<e.length;d+=1)if(m=p(e[d],o),l=m.f,"require"===l)C[d]=h.require(t);else if("exports"===l)C[d]=h.exports(t),x=!0;else if("module"===l)c=C[d]=h.module(t);else if(r(g,l)||r(_,l)||r(b,l))C[d]=u(l);else{if(!m.p)throw new Error(t+" missing "+l);m.p.load(m.n,s(o,!0),a(l),{}),C[d]=g[l]}f=n.apply(g[t],C),t&&(c&&c.exports!==i&&c.exports!==g[t]?g[t]=c.exports:f===i&&x||(g[t]=f))}else t&&(g[t]=n)},t=e=d=function(t,e,n,r,o){return"string"==typeof t?h[t]?h[t](e):u(p(t,e).f):(t.splice||(x=t,e.splice?(t=e,e=n,n=null):t=i),e=e||function(){},"function"==typeof n&&(n=r,r=o),r?m(i,t,e,n):setTimeout(function(){m(i,t,e,n)},4),d)},d.config=function(t){return x=t,x.deps&&d(x.deps,x.callback),d},t._defined=g,n=function(t,e,n){e.splice||(n=e,e=[]),r(g,t)||r(_,t)||(_[t]=[t,e,n])},n.amd={jQuery:!0}}(),n("vendor/almond",function(){}),n("emmet/emmet",function(){return emmet}),n("emmet/utils/common",function(){return emmet.require("utils/common")}),n("emmet/utils/action",function(){return emmet.require("utils/action")}),n("emmet/assets/resources",function(){return emmet.require("assets/resources")}),n("emmet/assets/tabStops",function(){return emmet.require("assets/tabStops")}),n("shim",function(){}),n("editor",["emmet/utils/common","emmet/utils/action","emmet/assets/resources","emmet/assets/tabStops"],function(t,e,n,i){function r(t,e){return arguments.length>2&&"object"!=typeof e&&(e={line:arguments[1],ch:arguments[2]}),t.indexFromPos(e)}function o(t,e){return t.posFromIndex(e)}return{context:null,selectionIndex:0,modeMap:{"text/html":"html","application/xml":"xml","text/xsl":"xsl","text/css":"css","text/x-less":"less","text/x-scss":"scss","text/x-sass":"sass"},setupContext:function(e,i){this.context=e,this.selectionIndex=i||0;var r=" ";e.getOption("indentWithTabs")||(r=t.repeatString(" ",e.getOption("indentUnit"))),n.setVariable("indentation",r)},selectionList:function(){var t=this.context;return t.listSelections().map(function(e){var n=r(t,e.anchor),i=r(t,e.head);return{start:Math.min(n,i),end:Math.max(n,i)}})},getCaretPos:function(){return this.getSelectionRange().start},setCaretPos:function(t){this.createSelection(t)},getSelectionRange:function(){return this.selectionList()[this.selectionIndex]},createSelection:function(t,e){"undefined"==typeof e&&(e=t);var n=this.selectionList(),i=this.context;n[this.selectionIndex]={start:t,end:e},this.context.setSelections(n.map(function(t){return{head:o(i,t.start),anchor:o(i,t.end)}}))},getSelection:function(){var t=this.getSelectionRange();return t.start=o(this.context,t.start),t.end=o(this.context,t.end),this.context.getRange(t.start,t.end)},getCurrentLineRange:function(){var t=o(this.context,this.getCaretPos());return{start:r(this.context,t.line,0),end:r(this.context,t.line,this.context.getLine(t.line).length)}},getCurrentLine:function(){var t=o(this.context,this.getCaretPos());return this.context.getLine(t.line)||""},replaceContent:function(e,n,r,s){"undefined"==typeof r&&(r="undefined"==typeof n?this.getContent().length:n),"undefined"==typeof n&&(n=0),s||(e=t.padString(e,t.getLinePaddingFromPosition(this.getContent(),n)));var c=i.extract(e,{escape:function(t){return t}});e=c.text;var a=c.tabstops[0]||{start:e.length,end:e.length};a.start+=n,a.end+=n,this.context.replaceRange(e,o(this.context,n),o(this.context,r)),this.createSelection(a.start,a.end)},getContent:function(){return this.context.getValue()},getSyntax:function(){var t=this.context.getOption("mode");return this.modeMap[t]||e.detectSyntax(this,t)},getProfileName:function(){return this.context.getOption("profile")?this.context.getOption("profile"):e.detectProfile(this)},prompt:function(t){return prompt(t)},getFilePath:function(){return location.href},isValidSyntax:function(){return n.hasSyntax(this.getSyntax())}}}),n("plugin",["./editor","emmet/emmet"],function(t,e){function n(){if(CodeMirror.version>="3.1")return CodeMirror.Pass;throw CodeMirror.Pass}function i(e){return function(n){t.setupContext(n);var i;return n.operation(function(){i=o(e,n)}),i}}function r(e){return function(n){t.setupContext(n);var i=t.selectionList(),r=null;return n.operation(function(){for(var s=0,c=i.length;c>s&&(t.selectionIndex=s,r=o(e,n),r!==CodeMirror.Pass);s++);}),r}}function o(i,r){if("expand_abbreviation_with_tab"==i&&(r.somethingSelected()||!t.isValidSyntax()))return n();var o=!1;try{if(o=e.run(i,t),!o&&"insert_formatted_line_break_only"==i)return n()}catch(s){}return o}function s(t){return a?t:t.replace("Cmd","Ctrl")}function c(t,e){t=s(t),CodeMirror.keyMap["default"][t]="emmet."+e}var a=/Mac/.test(navigator.platform),u={"Cmd-E":"expand_abbreviation",Tab:"expand_abbreviation_with_tab","Cmd-D":"balance_outward","Shift-Cmd-D":"balance_inward","Cmd-M":"matching_pair","Shift-Cmd-A":"wrap_with_abbreviation","Ctrl-Alt-Right":"next_edit_point","Ctrl-Alt-Left":"prev_edit_point","Cmd-L":"select_line","Cmd-Shift-M":"merge_lines","Cmd-/":"toggle_comment","Cmd-J":"split_join_tag","Cmd-K":"remove_tag","Shift-Cmd-Y":"evaluate_math_expression","Ctrl-Up":"increment_number_by_1","Ctrl-Down":"decrement_number_by_1","Ctrl-Alt-Up":"increment_number_by_01","Ctrl-Alt-Down":"decrement_number_by_01","Shift-Ctrl-Up":"increment_number_by_10","Shift-Ctrl-Down":"decrement_number_by_10","Shift-Cmd-.":"select_next_item","Shift-Cmd-,":"select_previous_item","Cmd-B":"reflect_css_value",Enter:"insert_formatted_line_break_only"},l=["prev_edit_point","next_edit_point","merge_lines","reflect_css_value","select_next_item","select_previous_item","wrap_with_abbreviation","update_tag","insert_formatted_line_break_only"];return CodeMirror.defineOption?CodeMirror.defineOption("profile","html"):CodeMirror.defaults.profile="html",Object.keys(u).forEach(function(t){var e=u[t],n="emmet."+e;CodeMirror.commands[n]||(CodeMirror.commands[n]=~l.indexOf(e)?i(e):r(e)),c(t,e)}),{emmet:e,editor:t,setKeymap:function(t){Object.keys(t).forEach(function(e){c(e,t[e])})},clearKeymap:function(){var t=CodeMirror.keyMap["default"],e=/^emmet\./;Object.keys(t).forEach(function(n){e.test(t[n])&&delete t[n]})},addKeybinding:c,removeKeybinding:function(t){t=s(t);var e=CodeMirror.keyMap["default"];t in e?delete e[t]:(t="emmet."+t,Object.keys(e).forEach(function(n){e[n]===t&&delete e[n]}))}}}),e("plugin")});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Emmet for CodeMirror 4</title>
|
|
5
|
+
<link rel="stylesheet" href="../vendor/codemirror/v4/codemirror.css" />
|
|
6
|
+
<script src="../vendor/codemirror/v4/codemirror.js"></script>
|
|
7
|
+
<script src="../vendor/codemirror/v4/xml.js"></script>
|
|
8
|
+
<script src="../vendor/codemirror/v4/css.js"></script>
|
|
9
|
+
<script src="../vendor/codemirror/v4/htmlmixed.js"></script>
|
|
10
|
+
<script src="./emmet.min.js"></script>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
.CodeMirror {
|
|
14
|
+
border: 1px solid black;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cm-delimit {
|
|
18
|
+
color: #fa4;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
<h1>Emmet for CodeMirror 4</h1>
|
|
24
|
+
|
|
25
|
+
<form><textarea id="code" name="code">
|
|
26
|
+
<html style="color: green">
|
|
27
|
+
<!-- this is a comment -->
|
|
28
|
+
<head>
|
|
29
|
+
<title>HTML Example</title>
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
The indentation tries to be <em>somewhat &quot;do what
|
|
33
|
+
I mean&quot;</em>... but might not match your style.
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
36
|
+
</textarea></form>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
CodeMirror.fromTextArea(document.getElementById("code"), {
|
|
40
|
+
mode : "text/html",
|
|
41
|
+
lineNumbers : true,
|
|
42
|
+
profile: 'xhtml' /* define Emmet output profile */
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emmet Editor interface implementation for CodeMirror.
|
|
3
|
+
* Interface is optimized for multiple cursor usage: authors
|
|
4
|
+
* should run acttion multiple times and update `selectionIndex`
|
|
5
|
+
* property on each iteration.
|
|
6
|
+
*/
|
|
7
|
+
define(['emmet/utils/common', 'emmet/utils/action', 'emmet/assets/resources', 'emmet/assets/tabStops'], function(utils, actionUtils, res, tabStops) {
|
|
8
|
+
/**
|
|
9
|
+
* Converts CM’s inner representation of character
|
|
10
|
+
* position (line, ch) to character index in text
|
|
11
|
+
* @param {CodeMirror} cm CodeMirror instance
|
|
12
|
+
* @param {Object} pos Position object
|
|
13
|
+
* @return {Number}
|
|
14
|
+
*/
|
|
15
|
+
function posToIndex(cm, pos) {
|
|
16
|
+
if (arguments.length > 2 && typeof pos !== 'object') {
|
|
17
|
+
pos = {line: arguments[1], ch: arguments[2]}
|
|
18
|
+
}
|
|
19
|
+
return cm.indexFromPos(pos);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Converts charater index in text to CM’s internal object representation
|
|
24
|
+
* @param {CodeMirror} cm CodeMirror instance
|
|
25
|
+
* @param {Number} ix Character index in CM document
|
|
26
|
+
* @return {Object}
|
|
27
|
+
*/
|
|
28
|
+
function indexToPos(cm, ix) {
|
|
29
|
+
return cm.posFromIndex(ix);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
context: null,
|
|
34
|
+
selectionIndex: 0,
|
|
35
|
+
modeMap: {
|
|
36
|
+
'text/html': 'html',
|
|
37
|
+
'application/xml': 'xml',
|
|
38
|
+
'text/xsl': 'xsl',
|
|
39
|
+
'text/css': 'css',
|
|
40
|
+
'text/x-less': 'less',
|
|
41
|
+
'text/x-scss': 'scss',
|
|
42
|
+
'text/x-sass': 'sass'
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
setupContext: function(ctx, selIndex) {
|
|
46
|
+
this.context = ctx;
|
|
47
|
+
this.selectionIndex = selIndex || 0;
|
|
48
|
+
var indentation = '\t';
|
|
49
|
+
if (!ctx.getOption('indentWithTabs')) {
|
|
50
|
+
indentation = utils.repeatString(' ', ctx.getOption('indentUnit'));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
res.setVariable('indentation', indentation);
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Returns list of selections for current CodeMirror instance.
|
|
58
|
+
* @return {Array}
|
|
59
|
+
*/
|
|
60
|
+
selectionList: function() {
|
|
61
|
+
var cm = this.context;
|
|
62
|
+
return cm.listSelections().map(function(sel) {
|
|
63
|
+
var anchor = posToIndex(cm, sel.anchor);
|
|
64
|
+
var head = posToIndex(cm, sel.head);
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
start: Math.min(anchor, head),
|
|
68
|
+
end: Math.max(anchor, head)
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
getCaretPos: function() {
|
|
74
|
+
return this.getSelectionRange().start;
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
setCaretPos: function(pos) {
|
|
78
|
+
this.createSelection(pos);
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Returns current selection range (for current selection index)
|
|
83
|
+
* @return {Object}
|
|
84
|
+
*/
|
|
85
|
+
getSelectionRange: function() {
|
|
86
|
+
return this.selectionList()[this.selectionIndex];
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
createSelection: function(start, end) {
|
|
90
|
+
if (typeof end == 'undefined') {
|
|
91
|
+
end = start;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
var sels = this.selectionList();
|
|
95
|
+
var cm = this.context;
|
|
96
|
+
sels[this.selectionIndex] = {start: start, end: end};
|
|
97
|
+
this.context.setSelections(sels.map(function(sel) {
|
|
98
|
+
return {
|
|
99
|
+
head: indexToPos(cm, sel.start),
|
|
100
|
+
anchor: indexToPos(cm, sel.end)
|
|
101
|
+
};
|
|
102
|
+
}));
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Returns current selection
|
|
107
|
+
* @return {String}
|
|
108
|
+
*/
|
|
109
|
+
getSelection: function() {
|
|
110
|
+
var sel = this.getSelectionRange();
|
|
111
|
+
sel.start = indexToPos(this.context, sel.start);
|
|
112
|
+
sel.end = indexToPos(this.context, sel.end);
|
|
113
|
+
return this.context.getRange(sel.start, sel.end);
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
getCurrentLineRange: function() {
|
|
117
|
+
var caret = indexToPos(this.context, this.getCaretPos());
|
|
118
|
+
return {
|
|
119
|
+
start: posToIndex(this.context, caret.line, 0),
|
|
120
|
+
end: posToIndex(this.context, caret.line, this.context.getLine(caret.line).length)
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
getCurrentLine: function() {
|
|
125
|
+
var caret = indexToPos(this.context, this.getCaretPos());
|
|
126
|
+
return this.context.getLine(caret.line) || '';
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
replaceContent: function(value, start, end, noIndent) {
|
|
130
|
+
if (typeof end == 'undefined') {
|
|
131
|
+
end = (typeof start == 'undefined') ? this.getContent().length : start;
|
|
132
|
+
}
|
|
133
|
+
if (typeof start == 'undefined') {
|
|
134
|
+
start = 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// indent new value
|
|
138
|
+
if (!noIndent) {
|
|
139
|
+
value = utils.padString(value, utils.getLinePaddingFromPosition(this.getContent(), start));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// find new caret position
|
|
143
|
+
var tabstopData = tabStops.extract(value, {
|
|
144
|
+
escape: function(ch) {
|
|
145
|
+
return ch;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
value = tabstopData.text;
|
|
149
|
+
|
|
150
|
+
var firstTabStop = tabstopData.tabstops[0] || {start: value.length, end: value.length};
|
|
151
|
+
firstTabStop.start += start;
|
|
152
|
+
firstTabStop.end += start;
|
|
153
|
+
|
|
154
|
+
this.context.replaceRange(value, indexToPos(this.context, start), indexToPos(this.context, end));
|
|
155
|
+
this.createSelection(firstTabStop.start, firstTabStop.end);
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
getContent: function() {
|
|
159
|
+
return this.context.getValue();
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
getSyntax: function() {
|
|
163
|
+
var syntax = this.context.getOption('mode');
|
|
164
|
+
return this.modeMap[syntax] || actionUtils.detectSyntax(this, syntax);
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Returns current output profile name (@see emmet#setupProfile)
|
|
169
|
+
* @return {String}
|
|
170
|
+
*/
|
|
171
|
+
getProfileName: function() {
|
|
172
|
+
if (this.context.getOption('profile')) {
|
|
173
|
+
return this.context.getOption('profile');
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return actionUtils.detectProfile(this);
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Ask user to enter something
|
|
181
|
+
* @param {String} title Dialog title
|
|
182
|
+
* @return {String} Entered data
|
|
183
|
+
*/
|
|
184
|
+
prompt: function(title) {
|
|
185
|
+
return prompt(title);
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Returns current editor's file path
|
|
190
|
+
* @return {String}
|
|
191
|
+
*/
|
|
192
|
+
getFilePath: function() {
|
|
193
|
+
return location.href;
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Check if current editor syntax is valid, e.g. is supported by Emmet
|
|
198
|
+
* @return {Boolean}
|
|
199
|
+
*/
|
|
200
|
+
isValidSyntax: function() {
|
|
201
|
+
return res.hasSyntax(this.getSyntax());
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var fs = require('fs');
|
|
2
|
+
var gulp = require('gulp');
|
|
3
|
+
var requirejs = require('gulp-requirejs');
|
|
4
|
+
var uglify = require('gulp-uglify');
|
|
5
|
+
var rename = require('gulp-rename');
|
|
6
|
+
|
|
7
|
+
gulp.task('default', function() {
|
|
8
|
+
// load JSON data
|
|
9
|
+
var snippets = fs.readFileSync('./node_modules/emmet/lib/snippets.json', {encoding: 'utf8'});
|
|
10
|
+
var caniuse = fs.readFileSync('./node_modules/emmet/lib/caniuse.json', {encoding: 'utf8'});
|
|
11
|
+
|
|
12
|
+
var loadData = 'var emmet = require("emmet/emmet");emmet.loadUserData({' +
|
|
13
|
+
'snippets: ' + snippets + ',' +
|
|
14
|
+
'caniuse: ' + caniuse +
|
|
15
|
+
'});';
|
|
16
|
+
|
|
17
|
+
return requirejs({
|
|
18
|
+
baseUrl: './',
|
|
19
|
+
name: 'vendor/almond',
|
|
20
|
+
include: ['./plugin'],
|
|
21
|
+
out: 'emmet.js',
|
|
22
|
+
paths: {
|
|
23
|
+
emmet: 'node_modules/emmet/lib',
|
|
24
|
+
lodash: 'node_modules/emmet/node_modules/lodash/lodash'
|
|
25
|
+
},
|
|
26
|
+
wrap: {
|
|
27
|
+
start: '(function (root, factory) {if (typeof define === "function" && define.amd) {define(factory);} else {root.emmetPlugin = factory();}}(this, function () {',
|
|
28
|
+
end: ';' + loadData +
|
|
29
|
+
'var plugin = require(\'plugin\');plugin.require = require;plugin.define = define;' +
|
|
30
|
+
'return plugin;}));'
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
.pipe(gulp.dest('./dist'))
|
|
34
|
+
.pipe(rename('emmet.min.js'))
|
|
35
|
+
.pipe(uglify())
|
|
36
|
+
.pipe(gulp.dest('./dist'));
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
gulp.task('plugin', function() {
|
|
40
|
+
return requirejs({
|
|
41
|
+
baseUrl: './',
|
|
42
|
+
name: 'vendor/almond',
|
|
43
|
+
include: ['./shim', './plugin'],
|
|
44
|
+
out: 'emmetPlugin.js',
|
|
45
|
+
wrap: {
|
|
46
|
+
start: '(function (root, factory) {if (typeof define === "function" && define.amd) {define(factory);} else {root.emmetPlugin = factory();}}(this, function () {',
|
|
47
|
+
end: ';return require(\'plugin\');}));'
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
.pipe(gulp.dest('./dist'))
|
|
51
|
+
.pipe(rename('emmetPlugin.min.js'))
|
|
52
|
+
.pipe(uglify())
|
|
53
|
+
.pipe(gulp.dest('./dist'));
|
|
54
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Emmet for CodeMirror 4</title>
|
|
5
|
+
<link rel="stylesheet" href="./vendor/codemirror/v4/codemirror.css" />
|
|
6
|
+
<script src="./vendor/codemirror/v4/codemirror.js"></script>
|
|
7
|
+
<script src="./vendor/codemirror/v4/xml.js"></script>
|
|
8
|
+
<script src="./vendor/codemirror/v4/css.js"></script>
|
|
9
|
+
<script src="./vendor/codemirror/v4/htmlmixed.js"></script>
|
|
10
|
+
<script src="./node_modules/requirejs/require.js"></script>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
.CodeMirror {
|
|
14
|
+
border: 1px solid black;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cm-delimit {
|
|
18
|
+
color: #fa4;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
<h1>Emmet for CodeMirror 4</h1>
|
|
24
|
+
|
|
25
|
+
<form><textarea id="code" name="code">
|
|
26
|
+
<html style="color: green">
|
|
27
|
+
<!-- this is a comment -->
|
|
28
|
+
<head>
|
|
29
|
+
<title>HTML Example</title>
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
The indentation tries to be <em>somewhat &quot;do what
|
|
33
|
+
I mean&quot;</em>... but might not match your style.
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
36
|
+
</textarea></form>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
CodeMirror.fromTextArea(document.getElementById("code"), {
|
|
40
|
+
mode : "text/html",
|
|
41
|
+
lineNumbers : true,
|
|
42
|
+
profile: 'xhtml' /* define Emmet output profile */
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
requirejs.config({
|
|
46
|
+
baseUrl: './',
|
|
47
|
+
paths: {
|
|
48
|
+
emmet: 'node_modules/emmet/lib',
|
|
49
|
+
lodash: 'node_modules/emmet/node_modules/lodash/lodash'
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
requirejs(['./plugin', 'emmet/emmet'], function(plugin, emmet) {
|
|
54
|
+
var loadJSON = function(url) {
|
|
55
|
+
var xhr = new XMLHttpRequest();
|
|
56
|
+
xhr.open('GET', url, false);
|
|
57
|
+
xhr.send(null);
|
|
58
|
+
return JSON.parse(xhr.responseText);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
emmet.loadUserData({
|
|
62
|
+
snippets: loadJSON('node_modules/emmet/lib/snippets.json'),
|
|
63
|
+
caniuse: loadJSON('node_modules/emmet/lib/caniuse.json')
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
67
|
+
</body>
|
|
68
|
+
</html>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "emmet-codemirror",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Emmet plugin for CodeMirror",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git://github.com/emmetio/codemirror.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"emmet",
|
|
14
|
+
"codemirror",
|
|
15
|
+
"html",
|
|
16
|
+
"css",
|
|
17
|
+
"coding",
|
|
18
|
+
"speed"
|
|
19
|
+
],
|
|
20
|
+
"author": "Sergey Chikuyonok",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/emmetio/codemirror/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/emmetio/codemirror",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"emmet": "^1.1.2"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"gulp": "^3.6.0",
|
|
31
|
+
"requirejs": "^2.1.11",
|
|
32
|
+
"gulp-uglify": "^0.2.1",
|
|
33
|
+
"gulp-requirejs": "^0.1.3",
|
|
34
|
+
"gulp-rename": "^1.2.0"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emmet plugin for CodeMirror
|
|
3
|
+
*/
|
|
4
|
+
define(['./editor', 'emmet/emmet'], function(editor, emmet) {
|
|
5
|
+
var mac = /Mac/.test(navigator.platform);
|
|
6
|
+
var defaultKeymap = {
|
|
7
|
+
'Cmd-E': 'expand_abbreviation',
|
|
8
|
+
'Tab': 'expand_abbreviation_with_tab',
|
|
9
|
+
'Cmd-D': 'balance_outward',
|
|
10
|
+
'Shift-Cmd-D': 'balance_inward',
|
|
11
|
+
'Cmd-M': 'matching_pair',
|
|
12
|
+
'Shift-Cmd-A': 'wrap_with_abbreviation',
|
|
13
|
+
'Ctrl-Alt-Right': 'next_edit_point',
|
|
14
|
+
'Ctrl-Alt-Left': 'prev_edit_point',
|
|
15
|
+
'Cmd-L': 'select_line',
|
|
16
|
+
'Cmd-Shift-M': 'merge_lines',
|
|
17
|
+
'Cmd-/': 'toggle_comment',
|
|
18
|
+
'Cmd-J': 'split_join_tag',
|
|
19
|
+
'Cmd-K': 'remove_tag',
|
|
20
|
+
'Shift-Cmd-Y': 'evaluate_math_expression',
|
|
21
|
+
|
|
22
|
+
'Ctrl-Up': 'increment_number_by_1',
|
|
23
|
+
'Ctrl-Down': 'decrement_number_by_1',
|
|
24
|
+
'Ctrl-Alt-Up': 'increment_number_by_01',
|
|
25
|
+
'Ctrl-Alt-Down': 'decrement_number_by_01',
|
|
26
|
+
'Shift-Ctrl-Up': 'increment_number_by_10',
|
|
27
|
+
'Shift-Ctrl-Down': 'decrement_number_by_10',
|
|
28
|
+
|
|
29
|
+
'Shift-Cmd-.': 'select_next_item',
|
|
30
|
+
'Shift-Cmd-,': 'select_previous_item',
|
|
31
|
+
'Cmd-B': 'reflect_css_value',
|
|
32
|
+
|
|
33
|
+
'Enter': 'insert_formatted_line_break_only'
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// actions that should be performed in single selection mode
|
|
37
|
+
var singleSelectionActions = [
|
|
38
|
+
'prev_edit_point', 'next_edit_point', 'merge_lines',
|
|
39
|
+
'reflect_css_value', 'select_next_item', 'select_previous_item',
|
|
40
|
+
'wrap_with_abbreviation', 'update_tag', 'insert_formatted_line_break_only'
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
// add “profile” property to CodeMirror defaults so in won’t be lost
|
|
44
|
+
// then CM instance is instantiated with “profile” property
|
|
45
|
+
if (CodeMirror.defineOption) {
|
|
46
|
+
CodeMirror.defineOption('profile', 'html');
|
|
47
|
+
} else {
|
|
48
|
+
CodeMirror.defaults.profile = 'html';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function noop() {
|
|
52
|
+
if (CodeMirror.version >= '3.1') {
|
|
53
|
+
return CodeMirror.Pass;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
throw CodeMirror.Pass;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Emmet action decorator: creates a command function
|
|
61
|
+
* for CodeMirror and executes Emmet action as single
|
|
62
|
+
* undo command
|
|
63
|
+
* @param {String} name Action name
|
|
64
|
+
* @return {Function}
|
|
65
|
+
*/
|
|
66
|
+
function actionDecorator(name) {
|
|
67
|
+
return function(cm) {
|
|
68
|
+
editor.setupContext(cm);
|
|
69
|
+
var result;
|
|
70
|
+
cm.operation(function() {
|
|
71
|
+
result = runAction(name, cm);
|
|
72
|
+
});
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Same as `actionDecorator()` but executes action
|
|
79
|
+
* with multiple selections
|
|
80
|
+
* @param {String} name Action name
|
|
81
|
+
* @return {Function}
|
|
82
|
+
*/
|
|
83
|
+
function multiSelectionActionDecorator(name) {
|
|
84
|
+
return function(cm) {
|
|
85
|
+
editor.setupContext(cm);
|
|
86
|
+
var selections = editor.selectionList();
|
|
87
|
+
var result = null;
|
|
88
|
+
cm.operation(function() {
|
|
89
|
+
for (var i = 0, il = selections.length; i < il; i++) {
|
|
90
|
+
editor.selectionIndex = i;
|
|
91
|
+
result = runAction(name, cm);
|
|
92
|
+
if (result === CodeMirror.Pass) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return result;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Runs Emmet action
|
|
103
|
+
* @param {String} name Action name
|
|
104
|
+
* @param {CodeMirror} cm CodeMirror instance
|
|
105
|
+
* @return {Boolean} Returns `true` if action is performed
|
|
106
|
+
* successfully
|
|
107
|
+
*/
|
|
108
|
+
function runAction(name, cm) {
|
|
109
|
+
if (name == 'expand_abbreviation_with_tab' && (cm.somethingSelected() || !editor.isValidSyntax())) {
|
|
110
|
+
// pass through Tab key handler if there's a selection
|
|
111
|
+
return noop();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
var result = false;
|
|
115
|
+
try {
|
|
116
|
+
result = emmet.run(name, editor);
|
|
117
|
+
if (!result && name == 'insert_formatted_line_break_only') {
|
|
118
|
+
return noop();
|
|
119
|
+
}
|
|
120
|
+
} catch (e) {}
|
|
121
|
+
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function systemKeybinding(key) {
|
|
126
|
+
return !mac ? key.replace('Cmd', 'Ctrl') : key;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Adds given `key` as keybinding for Emmet `action`
|
|
131
|
+
* @param {String} key Keyboard shortcut
|
|
132
|
+
* @param {String} action Emmet action name
|
|
133
|
+
*/
|
|
134
|
+
function addKeybinding(key, action) {
|
|
135
|
+
key = systemKeybinding(key);
|
|
136
|
+
CodeMirror.keyMap['default'][key] = 'emmet.' + action;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// add actions and default keybindings
|
|
140
|
+
Object.keys(defaultKeymap).forEach(function(key) {
|
|
141
|
+
var action = defaultKeymap[key];
|
|
142
|
+
var cmCommand = 'emmet.' + action;
|
|
143
|
+
if (!CodeMirror.commands[cmCommand]) {
|
|
144
|
+
CodeMirror.commands[cmCommand] = ~singleSelectionActions.indexOf(action)
|
|
145
|
+
? actionDecorator(action)
|
|
146
|
+
: multiSelectionActionDecorator(action);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
addKeybinding(key, action);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
emmet: emmet,
|
|
154
|
+
editor: editor,
|
|
155
|
+
/**
|
|
156
|
+
* Adds new keybindings for Emmet action. The expected format
|
|
157
|
+
* of `keymap` object is the same as default `keymap`.
|
|
158
|
+
* @param {Object} keymap
|
|
159
|
+
*/
|
|
160
|
+
setKeymap: function(keymap) {
|
|
161
|
+
Object.keys(keymap).forEach(function(key) {
|
|
162
|
+
addKeybinding(key, keymap[key]);
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Clears all Emmet keybindings
|
|
168
|
+
*/
|
|
169
|
+
clearKeymap: function() {
|
|
170
|
+
var cmMap = CodeMirror.keyMap['default'];
|
|
171
|
+
var reEmmetAction = /^emmet\./;
|
|
172
|
+
Object.keys(cmMap).forEach(function(p) {
|
|
173
|
+
if (reEmmetAction.test(cmMap[p])) {
|
|
174
|
+
delete cmMap[p];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
addKeybinding: addKeybinding,
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Removes given keybinding or any keybinging bound to
|
|
183
|
+
* given action name
|
|
184
|
+
* @param {String} name Either keybinding or Emmet action name
|
|
185
|
+
*/
|
|
186
|
+
removeKeybinding: function(name) {
|
|
187
|
+
name = systemKeybinding(name);
|
|
188
|
+
var cmMap = CodeMirror.keyMap['default'];
|
|
189
|
+
if (name in cmMap) {
|
|
190
|
+
delete cmMap[name];
|
|
191
|
+
} else {
|
|
192
|
+
name = 'emmet.' + name;
|
|
193
|
+
Object.keys(cmMap).forEach(function(p) {
|
|
194
|
+
if (cmMap[p] === name) {
|
|
195
|
+
delete cmMap[p];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
define('emmet/emmet', function() {
|
|
2
|
+
return emmet;
|
|
3
|
+
});
|
|
4
|
+
|
|
5
|
+
define('emmet/utils/common', function() {
|
|
6
|
+
return emmet.require('utils/common');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
define('emmet/utils/action', function() {
|
|
10
|
+
return emmet.require('utils/action');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
define('emmet/assets/resources', function() {
|
|
14
|
+
return emmet.require('assets/resources');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
define('emmet/assets/tabStops', function() {
|
|
18
|
+
return emmet.require('assets/tabStops');
|
|
19
|
+
});
|