[TASK] Use codemirror-minified package 06/53806/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 25 Aug 2017 08:57:33 +0000 (10:57 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Fri, 25 Aug 2017 13:32:24 +0000 (15:32 +0200)
CodeMirror is offered as a minified version. As there is no benefit of
using a "full-blown" version, switch to minified version instead.

Resolves: #82204
Releases: master
Change-Id: I8e15e1ea8266951430ebeb86445b3cd2db524caf
Reviewed-on: https://review.typo3.org/53806
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
251 files changed:
Build/Gruntfile.js
Build/package-lock.json
Build/package.json
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/LICENSE
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/README.md
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/comment/comment.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/comment/continuecomment.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/dialog/dialog.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/dialog/dialog.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/autorefresh.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/fullscreen.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/fullscreen.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/panel.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/placeholder.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/rulers.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/closebrackets.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/closetag.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/continuelist.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/matchbrackets.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/matchtags.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/trailingspace.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/fold/brace-fold.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/fold/comment-fold.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/fold/foldcode.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/fold/foldgutter.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/fold/foldgutter.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/fold/indent-fold.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/fold/markdown-fold.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/fold/xml-fold.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/anyword-hint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/css-hint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/html-hint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/javascript-hint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/show-hint.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/show-hint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/sql-hint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/xml-hint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/coffeescript-lint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/css-lint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/html-lint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/javascript-lint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/json-lint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/yaml-lint.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/merge/merge.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/merge/merge.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/mode/loadmode.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/mode/multiplex.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/mode/multiplex_test.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/mode/overlay.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/mode/simple.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/colorize.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode-standalone.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.node.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/scroll/annotatescrollbar.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/scroll/scrollpastend.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/scroll/simplescrollbars.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/scroll/simplescrollbars.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/jump-to-line.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/match-highlighter.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/matchesonscrollbar.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/matchesonscrollbar.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/search.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/searchcursor.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/selection/active-line.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/selection/mark-selection.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/selection/selection-pointer.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/tern/tern.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/tern/tern.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/tern/worker.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/wrap/hardwrap.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/bower.json [new file with mode: 0644]
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/emacs.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/sublime.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/vim.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/apl/apl.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/asciiarmor/asciiarmor.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/asn.1/asn.1.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/asterisk/asterisk.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/brainfuck/brainfuck.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/clike/clike.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/clojure/clojure.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/cmake/cmake.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/cobol/cobol.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/coffeescript/coffeescript.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/commonlisp/commonlisp.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/crystal/crystal.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/css/css.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/cypher/cypher.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/d/d.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/dart/dart.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/diff/diff.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/django/django.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/dockerfile/dockerfile.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/dtd/dtd.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/dylan/dylan.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ebnf/ebnf.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ecl/ecl.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/eiffel/eiffel.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/elm/elm.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/erlang/erlang.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/factor/factor.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/fcl/fcl.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/forth/forth.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/fortran/fortran.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/gas/gas.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/gfm/gfm.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/gherkin/gherkin.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/go/go.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/groovy/groovy.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/haml/haml.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/handlebars/handlebars.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/haskell-literate/haskell-literate.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/haskell/haskell.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/haxe/haxe.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/htmlembedded/htmlembedded.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/htmlmixed/htmlmixed.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/http/http.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/idl/idl.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/javascript/javascript.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/jinja2/jinja2.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/jsx/jsx.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/julia/julia.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/livescript/livescript.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/lua/lua.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/markdown/markdown.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/mathematica/mathematica.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/mbox/mbox.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/meta.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/mirc/mirc.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/mllike/mllike.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/modelica/modelica.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/mscgen/mscgen.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/mumps/mumps.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/nginx/nginx.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/nsis/nsis.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ntriples/ntriples.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/octave/octave.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/oz/oz.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/pascal/pascal.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/pegjs/pegjs.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/perl/perl.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/php/php.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/pig/pig.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/powershell/powershell.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/properties/properties.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/protobuf/protobuf.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/pug/pug.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/puppet/puppet.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/python/python.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/q/q.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/r/r.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/rpm/rpm.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/rst/rst.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ruby/ruby.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/rust/rust.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sas/sas.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sass/sass.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/scheme/scheme.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/shell/shell.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sieve/sieve.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/slim/slim.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/smalltalk/smalltalk.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/smarty/smarty.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/solr/solr.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/soy/soy.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sparql/sparql.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/spreadsheet/spreadsheet.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sql/sql.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/stex/stex.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/stylus/stylus.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/swift/swift.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tcl/tcl.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/textile/textile.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tiddlywiki/tiddlywiki.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tiddlywiki/tiddlywiki.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tiki/tiki.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tiki/tiki.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/toml/toml.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tornado/tornado.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/troff/troff.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ttcn-cfg/ttcn-cfg.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ttcn/ttcn.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/turtle/turtle.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/twig/twig.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/vb/vb.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/vbscript/vbscript.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/velocity/velocity.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/verilog/verilog.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/vhdl/vhdl.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/vue/vue.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/webidl/webidl.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/xml/xml.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/xquery/xquery.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/yacas/yacas.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/yaml-frontmatter/yaml-frontmatter.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/yaml/yaml.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/z80/z80.js
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/package.json
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/3024-day.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/3024-night.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/abcdef.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/ambiance-mobile.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/ambiance.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/base16-dark.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/base16-light.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/bespin.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/blackboard.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/cobalt.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/colorforth.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/dracula.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/duotone-dark.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/duotone-light.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/eclipse.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/elegant.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/erlang-dark.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/hopscotch.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/icecoder.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/isotope.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/lesser-dark.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/liquibyte.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/material.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/mbo.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/mdn-like.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/midnight.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/monokai.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/neat.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/neo.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/night.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/panda-syntax.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/paraiso-dark.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/paraiso-light.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/pastel-on-dark.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/railscasts.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/rubyblue.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/seti.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/solarized.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/the-matrix.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/tomorrow-night-bright.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/tomorrow-night-eighties.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/ttcn.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/twilight.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/vibrant-ink.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/xq-dark.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/xq-light.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/yeti.css
typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/zenburn.css

index 2221056..a7e8fb4 100644 (file)
@@ -408,7 +408,7 @@ module.exports = function (grunt) {
                                        destPrefix: "<%= paths.t3editor %>Public/JavaScript/Contrib"
                                },
                                files: {
-                                       'cm/': 'codemirror/'
+                                       'cm/': 'codemirror-minified/'
                                }
                        },
                        all: {
index 44c860e..4d1e14d 100644 (file)
       "integrity": "sha1-YeH7qUYi+/pc/TbWO7bUKd9+tsY=",
       "dev": true
     },
-    "JSONStream": {
-      "version": "0.8.4",
-      "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz",
-      "integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=",
-      "dev": true,
-      "requires": {
-        "jsonparse": "0.0.5",
-        "through": "2.3.8"
-      }
-    },
     "abbrev": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz",
       "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
       "dev": true
     },
-    "codemirror": {
+    "codemirror-minified": {
       "version": "5.28.0",
-      "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.28.0.tgz",
-      "integrity": "sha512-E/Z6050shti9v9ivl0dUClVRM4xaH204jsJmEpNYC6KDTlQwAz+5DdhLzn0tjaL/Mp1P0J1uhZokcSP2RFSwlA==",
+      "resolved": "https://registry.npmjs.org/codemirror-minified/-/codemirror-minified-5.28.0.tgz",
+      "integrity": "sha1-cWiy5Tfr/bJzySIdWNqNN/OKM6E=",
       "dev": true
     },
     "coffee-script": {
         "glob": {
           "version": "7.1.2",
           "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
-          "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+          "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=",
           "dev": true,
           "requires": {
             "fs.realpath": "1.0.0",
       "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=",
       "dev": true
     },
+    "JSONStream": {
+      "version": "0.8.4",
+      "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz",
+      "integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=",
+      "dev": true,
+      "requires": {
+        "jsonparse": "0.0.5",
+        "through": "2.3.8"
+      }
+    },
     "jsprim": {
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz",
                 }
               }
             },
+            "string_decoder": {
+              "version": "0.10.31",
+              "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+              "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
+              "dev": true
+            },
             "string-width": {
               "version": "1.0.2",
               "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
                 "strip-ansi": "3.0.1"
               }
             },
-            "string_decoder": {
-              "version": "0.10.31",
-              "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
-              "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
-              "dev": true
-            },
             "stringstream": {
               "version": "0.0.5",
               "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
     "minimatch": {
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
-      "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+      "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=",
       "dev": true,
       "requires": {
         "brace-expansion": "1.1.7"
         "through": "2.3.8"
       }
     },
+    "string_decoder": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz",
+      "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=",
+      "dev": true,
+      "requires": {
+        "safe-buffer": "5.1.1"
+      }
+    },
     "string-width": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
         "strip-ansi": "3.0.1"
       }
     },
-    "string_decoder": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz",
-      "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=",
-      "dev": true,
-      "requires": {
-        "safe-buffer": "5.1.1"
-      }
-    },
     "stringstream": {
       "version": "0.0.5",
       "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
index 9cb95a1..37f0065 100644 (file)
@@ -24,7 +24,7 @@
     "bootstrap-slider": "^9.8.0",
     "chosen-js": "^1.7.0",
     "ckeditor": "^4.7.1",
-    "codemirror": "^5.28.0",
+    "codemirror-minified": "^5.28.0",
     "cropper": "^2.3.4",
     "d3": "^4.10.0",
     "datatables": "^1.10.13",
index ff7db4b..89f2362 100644 (file)
@@ -1,6 +1,7 @@
-MIT License
+The MIT License (MIT)
 
-Copyright (C) 2017 by Marijn Haverbeke <marijnh@gmail.com> and others
+Copyright (c) 2016 Marijn Haverbeke <marijnh@gmail.com> and others
+Copyright (c) 2016 Michael Zhou <zhoumotongxue008@gmail.com>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:
 
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
index 3328e3b..6f61ded 100644 (file)
@@ -1,34 +1,23 @@
-# CodeMirror
-[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror)
-[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)
-[![Join the chat at https://gitter.im/codemirror/CodeMirror](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/codemirror/CodeMirror)  
-[Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?again)](https://marijnhaverbeke.nl/fund/)
+# CodeMirror-minified
+[![Build Status](https://travis-ci.org/Dominator008/CodeMirror-minified.svg?branch=master)](https://travis-ci.org/Dominator008/CodeMirror-minified) [![npm version](https://badge.fury.io/js/codemirror-minified.svg)](https://badge.fury.io/js/codemirror-minified)
 
-CodeMirror is a versatile text editor implemented in JavaScript for
-the browser. It is specialized for editing code, and comes with over
-100 language modes and various addons that implement more advanced
-editing functionality.
+## About
+This is a minified [CodeMirror](https://codemirror.net) distribution. All JavaScript files have been minified with [Google Closure Compiler](https://github.com/google/closure-compiler) using `SIMPLE_OPTIMIZATIONS`, and all CSS files have been minified with [clean-css](https://github.com/jakubpawlowicz/clean-css). This projects has CodeMirror's main repository as a Git submodule and is released once per CodeMirror release using the same version number.
 
-A rich programming API and a CSS theming system are available for
-customizing CodeMirror to fit your application, and extending it with
-new functionality.
+This distribution contains only the `addon`, `keymap`, `lib`, `mode` and `theme` directories. Within them, only non-test JavaScript and CSS files are included. See the ["files"](https://github.com/Dominator008/CodeMirror-minified/blob/master/package.json#L10-L22) section in `package.json` for the list of things included.
 
-You can find more information (and the
-[manual](http://codemirror.net/doc/manual.html)) on the [project
-page](http://codemirror.net). For questions and discussion, use the
-[discussion forum](https://discuss.codemirror.net/).
+## Instructions
+Just use this as if you were using the original CodeMirror library. All minified files retain their original name and location relative to CodeMirror's project root directory.
 
-See
-[CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md)
-for contributing guidelines.
+An NPM package is available at https://www.npmjs.com/package/codemirror-minified. Install with:
+```sh
+npm install codemirror-minified
+```
 
-The CodeMirror community aims to be welcoming to everybody. We use the
-[Contributor Covenant
-(1.1)](http://contributor-covenant.org/version/1/1/0/) as our code of
-conduct.
-
-### Quickstart
-
-To build the project, make sure you have Node.js installed (at least version 6)
-and then `npm install`. To run, just open `index.html` in your
-browser (you don't need to run a webserver). Run the tests with `npm test`.
+## Building it Yourself
+We use Gulp:
+```sh
+git submodule update --init
+npm install
+gulp
+```
index 568e639..5b1bd7b 100644 (file)
@@ -1,213 +1,8 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var noOptions = {};
-  var nonWS = /[^\s\u00a0]/;
-  var Pos = CodeMirror.Pos;
-
-  function firstNonWS(str) {
-    var found = str.search(nonWS);
-    return found == -1 ? 0 : found;
-  }
-
-  CodeMirror.commands.toggleComment = function(cm) {
-    cm.toggleComment();
-  };
-
-  CodeMirror.defineExtension("toggleComment", function(options) {
-    if (!options) options = noOptions;
-    var cm = this;
-    var minLine = Infinity, ranges = this.listSelections(), mode = null;
-    for (var i = ranges.length - 1; i >= 0; i--) {
-      var from = ranges[i].from(), to = ranges[i].to();
-      if (from.line >= minLine) continue;
-      if (to.line >= minLine) to = Pos(minLine, 0);
-      minLine = from.line;
-      if (mode == null) {
-        if (cm.uncomment(from, to, options)) mode = "un";
-        else { cm.lineComment(from, to, options); mode = "line"; }
-      } else if (mode == "un") {
-        cm.uncomment(from, to, options);
-      } else {
-        cm.lineComment(from, to, options);
-      }
-    }
-  });
-
-  // Rough heuristic to try and detect lines that are part of multi-line string
-  function probablyInsideString(cm, pos, line) {
-    return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"\`]/.test(line)
-  }
-
-  function getMode(cm, pos) {
-    var mode = cm.getMode()
-    return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos)
-  }
-
-  CodeMirror.defineExtension("lineComment", function(from, to, options) {
-    if (!options) options = noOptions;
-    var self = this, mode = getMode(self, from);
-    var firstLine = self.getLine(from.line);
-    if (firstLine == null || probablyInsideString(self, from, firstLine)) return;
-
-    var commentString = options.lineComment || mode.lineComment;
-    if (!commentString) {
-      if (options.blockCommentStart || mode.blockCommentStart) {
-        options.fullLines = true;
-        self.blockComment(from, to, options);
-      }
-      return;
-    }
-
-    var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
-    var pad = options.padding == null ? " " : options.padding;
-    var blankLines = options.commentBlankLines || from.line == to.line;
-
-    self.operation(function() {
-      if (options.indent) {
-        var baseString = null;
-        for (var i = from.line; i < end; ++i) {
-          var line = self.getLine(i);
-          var whitespace = line.slice(0, firstNonWS(line));
-          if (baseString == null || baseString.length > whitespace.length) {
-            baseString = whitespace;
-          }
-        }
-        for (var i = from.line; i < end; ++i) {
-          var line = self.getLine(i), cut = baseString.length;
-          if (!blankLines && !nonWS.test(line)) continue;
-          if (line.slice(0, cut) != baseString) cut = firstNonWS(line);
-          self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));
-        }
-      } else {
-        for (var i = from.line; i < end; ++i) {
-          if (blankLines || nonWS.test(self.getLine(i)))
-            self.replaceRange(commentString + pad, Pos(i, 0));
-        }
-      }
-    });
-  });
-
-  CodeMirror.defineExtension("blockComment", function(from, to, options) {
-    if (!options) options = noOptions;
-    var self = this, mode = getMode(self, from);
-    var startString = options.blockCommentStart || mode.blockCommentStart;
-    var endString = options.blockCommentEnd || mode.blockCommentEnd;
-    if (!startString || !endString) {
-      if ((options.lineComment || mode.lineComment) && options.fullLines != false)
-        self.lineComment(from, to, options);
-      return;
-    }
-    if (/\bcomment\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return
-
-    var end = Math.min(to.line, self.lastLine());
-    if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;
-
-    var pad = options.padding == null ? " " : options.padding;
-    if (from.line > end) return;
-
-    self.operation(function() {
-      if (options.fullLines != false) {
-        var lastLineHasText = nonWS.test(self.getLine(end));
-        self.replaceRange(pad + endString, Pos(end));
-        self.replaceRange(startString + pad, Pos(from.line, 0));
-        var lead = options.blockCommentLead || mode.blockCommentLead;
-        if (lead != null) for (var i = from.line + 1; i <= end; ++i)
-          if (i != end || lastLineHasText)
-            self.replaceRange(lead + pad, Pos(i, 0));
-      } else {
-        self.replaceRange(endString, to);
-        self.replaceRange(startString, from);
-      }
-    });
-  });
-
-  CodeMirror.defineExtension("uncomment", function(from, to, options) {
-    if (!options) options = noOptions;
-    var self = this, mode = getMode(self, from);
-    var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);
-
-    // Try finding line comments
-    var lineString = options.lineComment || mode.lineComment, lines = [];
-    var pad = options.padding == null ? " " : options.padding, didSomething;
-    lineComment: {
-      if (!lineString) break lineComment;
-      for (var i = start; i <= end; ++i) {
-        var line = self.getLine(i);
-        var found = line.indexOf(lineString);
-        if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;
-        if (found == -1 && nonWS.test(line)) break lineComment;
-        if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
-        lines.push(line);
-      }
-      self.operation(function() {
-        for (var i = start; i <= end; ++i) {
-          var line = lines[i - start];
-          var pos = line.indexOf(lineString), endPos = pos + lineString.length;
-          if (pos < 0) continue;
-          if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;
-          didSomething = true;
-          self.replaceRange("", Pos(i, pos), Pos(i, endPos));
-        }
-      });
-      if (didSomething) return true;
-    }
-
-    // Try block comments
-    var startString = options.blockCommentStart || mode.blockCommentStart;
-    var endString = options.blockCommentEnd || mode.blockCommentEnd;
-    if (!startString || !endString) return false;
-    var lead = options.blockCommentLead || mode.blockCommentLead;
-    var startLine = self.getLine(start), open = startLine.indexOf(startString)
-    if (open == -1) return false
-    var endLine = end == start ? startLine : self.getLine(end)
-    var close = endLine.indexOf(endString, end == start ? open + startString.length : 0);
-    if (close == -1 && start != end) {
-      endLine = self.getLine(--end);
-      close = endLine.indexOf(endString);
-    }
-    var insideStart = Pos(start, open + 1), insideEnd = Pos(end, close + 1)
-    if (close == -1 ||
-        !/comment/.test(self.getTokenTypeAt(insideStart)) ||
-        !/comment/.test(self.getTokenTypeAt(insideEnd)) ||
-        self.getRange(insideStart, insideEnd, "\n").indexOf(endString) > -1)
-      return false;
-
-    // Avoid killing block comments completely outside the selection.
-    // Positions of the last startString before the start of the selection, and the first endString after it.
-    var lastStart = startLine.lastIndexOf(startString, from.ch);
-    var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length);
-    if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false;
-    // Positions of the first endString after the end of the selection, and the last startString before it.
-    firstEnd = endLine.indexOf(endString, to.ch);
-    var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch);
-    lastStart = (firstEnd == -1 || almostLastStart == -1) ? -1 : to.ch + almostLastStart;
-    if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false;
-
-    self.operation(function() {
-      self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),
-                        Pos(end, close + endString.length));
-      var openEnd = open + startString.length;
-      if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;
-      self.replaceRange("", Pos(start, open), Pos(start, openEnd));
-      if (lead) for (var i = start + 1; i <= end; ++i) {
-        var line = self.getLine(i), found = line.indexOf(lead);
-        if (found == -1 || nonWS.test(line.slice(0, found))) continue;
-        var foundEnd = found + lead.length;
-        if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;
-        self.replaceRange("", Pos(i, found), Pos(i, foundEnd));
-      }
-    });
-    return true;
-  });
-});
+'use strict';(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function w(b){b=b.search(q);return-1==b?0:b}function E(b,d,a){return/\bstring\b/.test(b.getTokenTypeAt(k(d.line,0)))&&!/^[\'\"\`]/.test(a)}function C(b,d){var a=b.getMode();return!1!==a.useInnerComments&&a.innerMode?b.getModeAt(d):a}var A={},q=/[^\s\u00a0]/,k=h.Pos;h.commands.toggleComment=
+function(b){b.toggleComment()};h.defineExtension("toggleComment",function(b){b||(b=A);for(var d=Infinity,a=this.listSelections(),e=null,c=a.length-1;0<=c;c--){var f=a[c].from(),g=a[c].to();f.line>=d||(g.line>=d&&(g=k(d,0)),d=f.line,null==e?this.uncomment(f,g,b)?e="un":(this.lineComment(f,g,b),e="line"):"un"==e?this.uncomment(f,g,b):this.lineComment(f,g,b))}});h.defineExtension("lineComment",function(b,d,a){a||(a=A);var e=this,c=C(e,b),f=e.getLine(b.line);if(null!=f&&!E(e,b,f)){var g=a.lineComment||
+c.lineComment;if(g){var m=Math.min(0!=d.ch||d.line==b.line?d.line+1:d.line,e.lastLine()+1),h=null==a.padding?" ":a.padding,l=a.commentBlankLines||b.line==d.line;e.operation(function(){if(a.indent){for(var d=null,c=b.line;c<m;++c){var f=e.getLine(c);f=f.slice(0,w(f));if(null==d||d.length>f.length)d=f}for(c=b.line;c<m;++c){f=e.getLine(c);var n=d.length;if(l||q.test(f))f.slice(0,n)!=d&&(n=w(f)),e.replaceRange(d+g+h,k(c,0),k(c,n))}}else for(c=b.line;c<m;++c)(l||q.test(e.getLine(c)))&&e.replaceRange(g+
+h,k(c,0))})}else if(a.blockCommentStart||c.blockCommentStart)a.fullLines=!0,e.blockComment(b,d,a)}});h.defineExtension("blockComment",function(b,d,a){a||(a=A);var e=this,c=C(e,b),f=a.blockCommentStart||c.blockCommentStart,g=a.blockCommentEnd||c.blockCommentEnd;if(!f||!g)(a.lineComment||c.lineComment)&&0!=a.fullLines&&e.lineComment(b,d,a);else if(!/\bcomment\b/.test(e.getTokenTypeAt(k(b.line,0)))){var m=Math.min(d.line,e.lastLine());m!=b.line&&0==d.ch&&q.test(e.getLine(m))&&--m;var h=null==a.padding?
+" ":a.padding;b.line>m||e.operation(function(){if(0!=a.fullLines){var l=q.test(e.getLine(m));e.replaceRange(h+g,k(m));e.replaceRange(f+h,k(b.line,0));var x=a.blockCommentLead||c.blockCommentLead;if(null!=x)for(var p=b.line+1;p<=m;++p)(p!=m||l)&&e.replaceRange(x+h,k(p,0))}else e.replaceRange(g,d),e.replaceRange(f,b)})}});h.defineExtension("uncomment",function(b,d,a){a||(a=A);var e=this,c=C(e,b),f=Math.min(0!=d.ch||d.line==b.line?d.line:d.line-1,e.lastLine()),g=Math.min(b.line,f),h=a.lineComment||c.lineComment,
+w=[],l=null==a.padding?" ":a.padding,x;a:if(h){for(var p=g;p<=f;++p){var B=e.getLine(p),n=B.indexOf(h);-1<n&&!/comment/.test(e.getTokenTypeAt(k(p,n+1)))&&(n=-1);if(-1==n&&q.test(B))break a;if(-1<n&&q.test(B.slice(0,n)))break a;w.push(B)}e.operation(function(){for(var a=g;a<=f;++a){var b=w[a-g],c=b.indexOf(h),d=c+h.length;0>c||(b.slice(d,d+l.length)==l&&(d+=l.length),x=!0,e.replaceRange("",k(a,c),k(a,d)))}});if(x)return!0}var u=a.blockCommentStart||c.blockCommentStart,r=a.blockCommentEnd||c.blockCommentEnd;
+if(!u||!r)return!1;var D=a.blockCommentLead||c.blockCommentLead,y=e.getLine(g),z=y.indexOf(u);if(-1==z)return!1;var v=f==g?y:e.getLine(f),t=v.indexOf(r,f==g?z+u.length:0);-1==t&&g!=f&&(v=e.getLine(--f),t=v.indexOf(r));a=k(g,z+1);c=k(f,t+1);if(-1==t||!/comment/.test(e.getTokenTypeAt(a))||!/comment/.test(e.getTokenTypeAt(c))||-1<e.getRange(a,c,"\n").indexOf(r))return!1;c=y.lastIndexOf(u,b.ch);a=-1==c?-1:y.slice(0,b.ch).indexOf(r,c+u.length);if(-1!=c&&-1!=a&&a+r.length!=b.ch)return!1;a=v.indexOf(r,d.ch);
+b=v.slice(d.ch).lastIndexOf(u,a-d.ch);c=-1==a||-1==b?-1:d.ch+b;if(-1!=a&&-1!=c&&c!=d.ch)return!1;e.operation(function(){e.replaceRange("",k(f,t-(l&&v.slice(t-l.length,t)==l?l.length:0)),k(f,t+r.length));var a=z+u.length;l&&y.slice(a,a+l.length)==l&&(a+=l.length);e.replaceRange("",k(g,z),k(g,a));if(D)for(a=g+1;a<=f;++a){var b=e.getLine(a),c=b.indexOf(D);if(-1!=c&&!q.test(b.slice(0,c))){var d=c+D.length;l&&b.slice(d,d+l.length)==l&&(d+=l.length);e.replaceRange("",k(a,c),k(a,d))}}});return!0})});
index b11d51e..7ac5577 100644 (file)
@@ -1,85 +1,4 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  var modes = ["clike", "css", "javascript"];
-
-  for (var i = 0; i < modes.length; ++i)
-    CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "});
-
-  function continueComment(cm) {
-    if (cm.getOption("disableInput")) return CodeMirror.Pass;
-    var ranges = cm.listSelections(), mode, inserts = [];
-    for (var i = 0; i < ranges.length; i++) {
-      var pos = ranges[i].head, token = cm.getTokenAt(pos);
-      if (token.type != "comment") return CodeMirror.Pass;
-      var modeHere = CodeMirror.innerMode(cm.getMode(), token.state).mode;
-      if (!mode) mode = modeHere;
-      else if (mode != modeHere) return CodeMirror.Pass;
-
-      var insert = null;
-      if (mode.blockCommentStart && mode.blockCommentContinue) {
-        var end = token.string.indexOf(mode.blockCommentEnd);
-        var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found;
-        if (end != -1 && end == token.string.length - mode.blockCommentEnd.length && pos.ch >= end) {
-          // Comment ended, don't continue it
-        } else if (token.string.indexOf(mode.blockCommentStart) == 0) {
-          insert = full.slice(0, token.start);
-          if (!/^\s*$/.test(insert)) {
-            insert = "";
-            for (var j = 0; j < token.start; ++j) insert += " ";
-          }
-        } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
-                   found + mode.blockCommentContinue.length > token.start &&
-                   /^\s*$/.test(full.slice(0, found))) {
-          insert = full.slice(0, found);
-        }
-        if (insert != null) insert += mode.blockCommentContinue;
-      }
-      if (insert == null && mode.lineComment && continueLineCommentEnabled(cm)) {
-        var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment);
-        if (found > -1) {
-          insert = line.slice(0, found);
-          if (/\S/.test(insert)) insert = null;
-          else insert += mode.lineComment + line.slice(found + mode.lineComment.length).match(/^\s*/)[0];
-        }
-      }
-      if (insert == null) return CodeMirror.Pass;
-      inserts[i] = "\n" + insert;
-    }
-
-    cm.operation(function() {
-      for (var i = ranges.length - 1; i >= 0; i--)
-        cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), "+insert");
-    });
-  }
-
-  function continueLineCommentEnabled(cm) {
-    var opt = cm.getOption("continueComments");
-    if (opt && typeof opt == "object")
-      return opt.continueLineComment !== false;
-    return true;
-  }
-
-  CodeMirror.defineOption("continueComments", null, function(cm, val, prev) {
-    if (prev && prev != CodeMirror.Init)
-      cm.removeKeyMap("continueComment");
-    if (val) {
-      var key = "Enter";
-      if (typeof val == "string")
-        key = val;
-      else if (typeof val == "object" && val.key)
-        key = val.key;
-      var map = {name: "continueComment"};
-      map[key] = continueComment;
-      cm.addKeyMap(map);
-    }
-  });
-});
+'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function q(b){var a;if(b.getOption("disableInput"))return e.Pass;for(var f=b.listSelections(),d,l=[],m=0;m<f.length;m++){var g=f[m].head,h=b.getTokenAt(g);if("comment"!=h.type)return e.Pass;var c=e.innerMode(b.getMode(),h.state).mode;if(!d)d=c;else if(d!=c)return e.Pass;c=null;if(d.blockCommentStart&&
+d.blockCommentContinue){var k=h.string.indexOf(d.blockCommentEnd),n=b.getRange(e.Pos(g.line,0),e.Pos(g.line,h.end));if(!(-1!=k&&k==h.string.length-d.blockCommentEnd.length&&g.ch>=k))if(0==h.string.indexOf(d.blockCommentStart)){if(c=n.slice(0,h.start),!/^\s*$/.test(c))for(c="",k=0;k<h.start;++k)c+=" "}else-1!=(a=n.indexOf(d.blockCommentContinue))&&a+d.blockCommentContinue.length>h.start&&/^\s*$/.test(n.slice(0,a))&&(c=n.slice(0,a));null!=c&&(c+=d.blockCommentContinue)}null==c&&d.lineComment&&r(b)&&
+(g=b.getLine(g.line),a=g.indexOf(d.lineComment),-1<a&&(c=g.slice(0,a),c=/\S/.test(c)?null:c+(d.lineComment+g.slice(a+d.lineComment.length).match(/^\s*/)[0])));if(null==c)return e.Pass;l[m]="\n"+c}b.operation(function(){for(var a=f.length-1;0<=a;a--)b.replaceRange(l[a],f[a].from(),f[a].to(),"+insert")})}function r(b){return(b=b.getOption("continueComments"))&&"object"==typeof b?!1!==b.continueLineComment:!0}for(var p=["clike","css","javascript"],l=0;l<p.length;++l)e.extendMode(p[l],{blockCommentContinue:" * "});
+e.defineOption("continueComments",null,function(b,a,f){f&&f!=e.Init&&b.removeKeyMap("continueComment");a&&(f="Enter","string"==typeof a?f=a:"object"==typeof a&&a.key&&(f=a.key),a={name:"continueComment"},a[f]=q,b.addKeyMap(a))})});
index 677c078..9f33bea 100644 (file)
@@ -1,32 +1 @@
-.CodeMirror-dialog {
-  position: absolute;
-  left: 0; right: 0;
-  background: inherit;
-  z-index: 15;
-  padding: .1em .8em;
-  overflow: hidden;
-  color: inherit;
-}
-
-.CodeMirror-dialog-top {
-  border-bottom: 1px solid #eee;
-  top: 0;
-}
-
-.CodeMirror-dialog-bottom {
-  border-top: 1px solid #eee;
-  bottom: 0;
-}
-
-.CodeMirror-dialog input {
-  border: none;
-  outline: none;
-  background: transparent;
-  width: 20em;
-  color: inherit;
-  font-family: monospace;
-}
-
-.CodeMirror-dialog button {
-  font-size: 70%;
-}
+.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:0;background:0 0;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}
\ No newline at end of file
index f10bb5b..1c01cbd 100644 (file)
@@ -1,157 +1,5 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Open simple dialogs on top of an editor. Relies on dialog.css.
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  function dialogDiv(cm, template, bottom) {
-    var wrap = cm.getWrapperElement();
-    var dialog;
-    dialog = wrap.appendChild(document.createElement("div"));
-    if (bottom)
-      dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
-    else
-      dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
-
-    if (typeof template == "string") {
-      dialog.innerHTML = template;
-    } else { // Assuming it's a detached DOM element.
-      dialog.appendChild(template);
-    }
-    return dialog;
-  }
-
-  function closeNotification(cm, newVal) {
-    if (cm.state.currentNotificationClose)
-      cm.state.currentNotificationClose();
-    cm.state.currentNotificationClose = newVal;
-  }
-
-  CodeMirror.defineExtension("openDialog", function(template, callback, options) {
-    if (!options) options = {};
-
-    closeNotification(this, null);
-
-    var dialog = dialogDiv(this, template, options.bottom);
-    var closed = false, me = this;
-    function close(newVal) {
-      if (typeof newVal == 'string') {
-        inp.value = newVal;
-      } else {
-        if (closed) return;
-        closed = true;
-        dialog.parentNode.removeChild(dialog);
-        me.focus();
-
-        if (options.onClose) options.onClose(dialog);
-      }
-    }
-
-    var inp = dialog.getElementsByTagName("input")[0], button;
-    if (inp) {
-      inp.focus();
-
-      if (options.value) {
-        inp.value = options.value;
-        if (options.selectValueOnOpen !== false) {
-          inp.select();
-        }
-      }
-
-      if (options.onInput)
-        CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
-      if (options.onKeyUp)
-        CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
-
-      CodeMirror.on(inp, "keydown", function(e) {
-        if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
-        if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
-          inp.blur();
-          CodeMirror.e_stop(e);
-          close();
-        }
-        if (e.keyCode == 13) callback(inp.value, e);
-      });
-
-      if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
-    } else if (button = dialog.getElementsByTagName("button")[0]) {
-      CodeMirror.on(button, "click", function() {
-        close();
-        me.focus();
-      });
-
-      if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close);
-
-      button.focus();
-    }
-    return close;
-  });
-
-  CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
-    closeNotification(this, null);
-    var dialog = dialogDiv(this, template, options && options.bottom);
-    var buttons = dialog.getElementsByTagName("button");
-    var closed = false, me = this, blurring = 1;
-    function close() {
-      if (closed) return;
-      closed = true;
-      dialog.parentNode.removeChild(dialog);
-      me.focus();
-    }
-    buttons[0].focus();
-    for (var i = 0; i < buttons.length; ++i) {
-      var b = buttons[i];
-      (function(callback) {
-        CodeMirror.on(b, "click", function(e) {
-          CodeMirror.e_preventDefault(e);
-          close();
-          if (callback) callback(me);
-        });
-      })(callbacks[i]);
-      CodeMirror.on(b, "blur", function() {
-        --blurring;
-        setTimeout(function() { if (blurring <= 0) close(); }, 200);
-      });
-      CodeMirror.on(b, "focus", function() { ++blurring; });
-    }
-  });
-
-  /*
-   * openNotification
-   * Opens a notification, that can be closed with an optional timer
-   * (default 5000ms timer) and always closes on click.
-   *
-   * If a notification is opened while another is opened, it will close the
-   * currently opened one and open the new one immediately.
-   */
-  CodeMirror.defineExtension("openNotification", function(template, options) {
-    closeNotification(this, close);
-    var dialog = dialogDiv(this, template, options && options.bottom);
-    var closed = false, doneTimer;
-    var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
-
-    function close() {
-      if (closed) return;
-      closed = true;
-      clearTimeout(doneTimer);
-      dialog.parentNode.removeChild(dialog);
-    }
-
-    CodeMirror.on(dialog, 'click', function(e) {
-      CodeMirror.e_preventDefault(e);
-      close();
-    });
-
-    if (duration)
-      doneTimer = setTimeout(close, duration);
-
-    return close;
-  });
-});
+'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function l(a,c,b){a=a.getWrapperElement().appendChild(document.createElement("div"));a.className=b?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top";"string"==typeof c?a.innerHTML=c:a.appendChild(c);return a}function m(a,c){a.state.currentNotificationClose&&
+a.state.currentNotificationClose();a.state.currentNotificationClose=c}c.defineExtension("openDialog",function(a,g,b){function e(a){if("string"==typeof a)d.value=a;else if(!h&&(h=!0,f.parentNode.removeChild(f),k.focus(),b.onClose))b.onClose(f)}b||(b={});m(this,null);var f=l(this,a,b.bottom),h=!1,k=this,d=f.getElementsByTagName("input")[0];if(d){d.focus();b.value&&(d.value=b.value,!1!==b.selectValueOnOpen&&d.select());if(b.onInput)c.on(d,"input",function(a){b.onInput(a,d.value,e)});if(b.onKeyUp)c.on(d,
+"keyup",function(a){b.onKeyUp(a,d.value,e)});c.on(d,"keydown",function(a){if(!(b&&b.onKeyDown&&b.onKeyDown(a,d.value,e))){if(27==a.keyCode||!1!==b.closeOnEnter&&13==a.keyCode)d.blur(),c.e_stop(a),e();13==a.keyCode&&g(d.value,a)}});if(!1!==b.closeOnBlur)c.on(d,"blur",e)}else if(a=f.getElementsByTagName("button")[0]){c.on(a,"click",function(){e();k.focus()});if(!1!==b.closeOnBlur)c.on(a,"blur",e);a.focus()}return e});c.defineExtension("openConfirm",function(a,g,b){function e(){h||(h=!0,f.parentNode.removeChild(f),
+k.focus())}m(this,null);var f=l(this,a,b&&b.bottom);a=f.getElementsByTagName("button");var h=!1,k=this,d=1;a[0].focus();for(b=0;b<a.length;++b){var n=a[b];(function(a){c.on(n,"click",function(b){c.e_preventDefault(b);e();a&&a(k)})})(g[b]);c.on(n,"blur",function(){--d;setTimeout(function(){0>=d&&e()},200)});c.on(n,"focus",function(){++d})}});c.defineExtension("openNotification",function(a,g){function b(){f||(f=!0,clearTimeout(h),e.parentNode.removeChild(e))}m(this,b);var e=l(this,a,g&&g.bottom),f=
+!1,h;a=g&&"undefined"!==typeof g.duration?g.duration:5E3;c.on(e,"click",function(a){c.e_preventDefault(a);b()});a&&(h=setTimeout(b,a));return b})});
index 1e0e850..a65ade5 100644 (file)
@@ -1,47 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"))
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod)
-  else // Plain browser env
-    mod(CodeMirror)
-})(function(CodeMirror) {
-  "use strict"
-
-  CodeMirror.defineOption("autoRefresh", false, function(cm, val) {
-    if (cm.state.autoRefresh) {
-      stopListening(cm, cm.state.autoRefresh)
-      cm.state.autoRefresh = null
-    }
-    if (val && cm.display.wrapper.offsetHeight == 0)
-      startListening(cm, cm.state.autoRefresh = {delay: val.delay || 250})
-  })
-
-  function startListening(cm, state) {
-    function check() {
-      if (cm.display.wrapper.offsetHeight) {
-        stopListening(cm, state)
-        if (cm.display.lastWrapHeight != cm.display.wrapper.clientHeight)
-          cm.refresh()
-      } else {
-        state.timeout = setTimeout(check, state.delay)
-      }
-    }
-    state.timeout = setTimeout(check, state.delay)
-    state.hurry = function() {
-      clearTimeout(state.timeout)
-      state.timeout = setTimeout(check, 50)
-    }
-    CodeMirror.on(window, "mouseup", state.hurry)
-    CodeMirror.on(window, "keyup", state.hurry)
-  }
-
-  function stopListening(_cm, state) {
-    clearTimeout(state.timeout)
-    CodeMirror.off(window, "mouseup", state.hurry)
-    CodeMirror.off(window, "keyup", state.hurry)
-  }
-});
+'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function f(b,a){function d(){b.display.wrapper.offsetHeight?(e(b,a),b.display.lastWrapHeight!=b.display.wrapper.clientHeight&&b.refresh()):a.timeout=setTimeout(d,a.delay)}a.timeout=setTimeout(d,a.delay);a.hurry=function(){clearTimeout(a.timeout);a.timeout=setTimeout(d,50)};c.on(window,"mouseup",
+a.hurry);c.on(window,"keyup",a.hurry)}function e(b,a){clearTimeout(a.timeout);c.off(window,"mouseup",a.hurry);c.off(window,"keyup",a.hurry)}c.defineOption("autoRefresh",!1,function(b,a){b.state.autoRefresh&&(e(b,b.state.autoRefresh),b.state.autoRefresh=null);a&&0==b.display.wrapper.offsetHeight&&f(b,b.state.autoRefresh={delay:a.delay||250})})});
index 437acd8..a414b02 100644 (file)
@@ -1,6 +1 @@
-.CodeMirror-fullscreen {
-  position: fixed;
-  top: 0; left: 0; right: 0; bottom: 0;
-  height: auto;
-  z-index: 9;
-}
+.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9}
\ No newline at end of file
index cd3673b..a69e808 100644 (file)
@@ -1,41 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {
-    if (old == CodeMirror.Init) old = false;
-    if (!old == !val) return;
-    if (val) setFullscreen(cm);
-    else setNormal(cm);
-  });
-
-  function setFullscreen(cm) {
-    var wrap = cm.getWrapperElement();
-    cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
-                                  width: wrap.style.width, height: wrap.style.height};
-    wrap.style.width = "";
-    wrap.style.height = "auto";
-    wrap.className += " CodeMirror-fullscreen";
-    document.documentElement.style.overflow = "hidden";
-    cm.refresh();
-  }
-
-  function setNormal(cm) {
-    var wrap = cm.getWrapperElement();
-    wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
-    document.documentElement.style.overflow = "";
-    var info = cm.state.fullScreenRestore;
-    wrap.style.width = info.width; wrap.style.height = info.height;
-    window.scrollTo(info.scrollLeft, info.scrollTop);
-    cm.refresh();
-  }
-});
+'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){c.defineOption("fullScreen",!1,function(d,a,b){b==c.Init&&(b=!1);!b!=!a&&(a?(a=d.getWrapperElement(),d.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:a.style.width,height:a.style.height},a.style.width="",a.style.height="auto",a.className+=" CodeMirror-fullscreen",
+document.documentElement.style.overflow="hidden"):(a=d.getWrapperElement(),a.className=a.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="",b=d.state.fullScreenRestore,a.style.width=b.width,a.style.height=b.height,window.scrollTo(b.scrollLeft,b.scrollTop)),d.refresh())})});
index f88d152..6c61932 100644 (file)
@@ -1,123 +1,5 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  CodeMirror.defineExtension("addPanel", function(node, options) {
-    options = options || {};
-
-    if (!this.state.panels) initPanels(this);
-
-    var info = this.state.panels;
-    var wrapper = info.wrapper;
-    var cmWrapper = this.getWrapperElement();
-
-    if (options.after instanceof Panel && !options.after.cleared) {
-      wrapper.insertBefore(node, options.before.node.nextSibling);
-    } else if (options.before instanceof Panel && !options.before.cleared) {
-      wrapper.insertBefore(node, options.before.node);
-    } else if (options.replace instanceof Panel && !options.replace.cleared) {
-      wrapper.insertBefore(node, options.replace.node);
-      options.replace.clear();
-    } else if (options.position == "bottom") {
-      wrapper.appendChild(node);
-    } else if (options.position == "before-bottom") {
-      wrapper.insertBefore(node, cmWrapper.nextSibling);
-    } else if (options.position == "after-top") {
-      wrapper.insertBefore(node, cmWrapper);
-    } else {
-      wrapper.insertBefore(node, wrapper.firstChild);
-    }
-
-    var height = (options && options.height) || node.offsetHeight;
-    this._setSize(null, info.heightLeft -= height);
-    info.panels++;
-    if (options.stable && isAtTop(this, node))
-      this.scrollTo(null, this.getScrollInfo().top + height)
-
-    return new Panel(this, node, options, height);
-  });
-
-  function Panel(cm, node, options, height) {
-    this.cm = cm;
-    this.node = node;
-    this.options = options;
-    this.height = height;
-    this.cleared = false;
-  }
-
-  Panel.prototype.clear = function() {
-    if (this.cleared) return;
-    this.cleared = true;
-    var info = this.cm.state.panels;
-    this.cm._setSize(null, info.heightLeft += this.height);
-    if (this.options.stable && isAtTop(this.cm, this.node))
-      this.cm.scrollTo(null, this.cm.getScrollInfo().top - this.height)
-    info.wrapper.removeChild(this.node);
-    if (--info.panels == 0) removePanels(this.cm);
-  };
-
-  Panel.prototype.changed = function(height) {
-    var newHeight = height == null ? this.node.offsetHeight : height;
-    var info = this.cm.state.panels;
-    this.cm._setSize(null, info.heightLeft -= (newHeight - this.height));
-    this.height = newHeight;
-  };
-
-  function initPanels(cm) {
-    var wrap = cm.getWrapperElement();
-    var style = window.getComputedStyle ? window.getComputedStyle(wrap) : wrap.currentStyle;
-    var height = parseInt(style.height);
-    var info = cm.state.panels = {
-      setHeight: wrap.style.height,
-      heightLeft: height,
-      panels: 0,
-      wrapper: document.createElement("div")
-    };
-    wrap.parentNode.insertBefore(info.wrapper, wrap);
-    var hasFocus = cm.hasFocus();
-    info.wrapper.appendChild(wrap);
-    if (hasFocus) cm.focus();
-
-    cm._setSize = cm.setSize;
-    if (height != null) cm.setSize = function(width, newHeight) {
-      if (newHeight == null) return this._setSize(width, newHeight);
-      info.setHeight = newHeight;
-      if (typeof newHeight != "number") {
-        var px = /^(\d+\.?\d*)px$/.exec(newHeight);
-        if (px) {
-          newHeight = Number(px[1]);
-        } else {
-          info.wrapper.style.height = newHeight;
-          newHeight = info.wrapper.offsetHeight;
-          info.wrapper.style.height = "";
-        }
-      }
-      cm._setSize(width, info.heightLeft += (newHeight - height));
-      height = newHeight;
-    };
-  }
-
-  function removePanels(cm) {
-    var info = cm.state.panels;
-    cm.state.panels = null;
-
-    var wrap = cm.getWrapperElement();
-    info.wrapper.parentNode.replaceChild(wrap, info.wrapper);
-    wrap.style.height = info.setHeight;
-    cm.setSize = cm._setSize;
-    cm.setSize();
-  }
-
-  function isAtTop(cm, dom) {
-    for (var sibling = dom.nextSibling; sibling; sibling = sibling.nextSibling)
-      if (sibling == cm.getWrapperElement()) return true
-    return false
-  }
-});
+'use strict';(function(g){"object"==typeof exports&&"object"==typeof module?g(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],g):g(CodeMirror)})(function(g){function f(b,a,c,d){this.cm=b;this.node=a;this.options=c;this.height=d;this.cleared=!1}function k(b){var a=b.getWrapperElement(),c=window.getComputedStyle?window.getComputedStyle(a):a.currentStyle,d=parseInt(c.height),e=b.state.panels={setHeight:a.style.height,heightLeft:d,panels:0,wrapper:document.createElement("div")};
+a.parentNode.insertBefore(e.wrapper,a);c=b.hasFocus();e.wrapper.appendChild(a);c&&b.focus();b._setSize=b.setSize;null!=d&&(b.setSize=function(a,c){if(null==c)return this._setSize(a,c);e.setHeight=c;if("number"!=typeof c){var f=/^(\d+\.?\d*)px$/.exec(c);f?c=Number(f[1]):(e.wrapper.style.height=c,c=e.wrapper.offsetHeight,e.wrapper.style.height="")}b._setSize(a,e.heightLeft+=c-d);d=c})}function h(b,a){for(a=a.nextSibling;a;a=a.nextSibling)if(a==b.getWrapperElement())return!0;return!1}g.defineExtension("addPanel",
+function(b,a){a=a||{};this.state.panels||k(this);var c=this.state.panels,d=c.wrapper,e=this.getWrapperElement();a.after instanceof f&&!a.after.cleared?d.insertBefore(b,a.before.node.nextSibling):a.before instanceof f&&!a.before.cleared?d.insertBefore(b,a.before.node):a.replace instanceof f&&!a.replace.cleared?(d.insertBefore(b,a.replace.node),a.replace.clear()):"bottom"==a.position?d.appendChild(b):"before-bottom"==a.position?d.insertBefore(b,e.nextSibling):"after-top"==a.position?d.insertBefore(b,
+e):d.insertBefore(b,d.firstChild);d=a&&a.height||b.offsetHeight;this._setSize(null,c.heightLeft-=d);c.panels++;a.stable&&h(this,b)&&this.scrollTo(null,this.getScrollInfo().top+d);return new f(this,b,a,d)});f.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var b=this.cm.state.panels;this.cm._setSize(null,b.heightLeft+=this.height);this.options.stable&&h(this.cm,this.node)&&this.cm.scrollTo(null,this.cm.getScrollInfo().top-this.height);b.wrapper.removeChild(this.node);if(0==--b.panels){var b=
+this.cm,a=b.state.panels;b.state.panels=null;var c=b.getWrapperElement();a.wrapper.parentNode.replaceChild(c,a.wrapper);c.style.height=a.setHeight;b.setSize=b._setSize;b.setSize()}}};f.prototype.changed=function(b){b=null==b?this.node.offsetHeight:b;this.cm._setSize(null,this.cm.state.panels.heightLeft-=b-this.height);this.height=b}});
index 2f8b1f8..07c2090 100644 (file)
@@ -1,62 +1,3 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
-    var prev = old && old != CodeMirror.Init;
-    if (val && !prev) {
-      cm.on("blur", onBlur);
-      cm.on("change", onChange);
-      cm.on("swapDoc", onChange);
-      onChange(cm);
-    } else if (!val && prev) {
-      cm.off("blur", onBlur);
-      cm.off("change", onChange);
-      cm.off("swapDoc", onChange);
-      clearPlaceholder(cm);
-      var wrapper = cm.getWrapperElement();
-      wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
-    }
-
-    if (val && !cm.hasFocus()) onBlur(cm);
-  });
-
-  function clearPlaceholder(cm) {
-    if (cm.state.placeholder) {
-      cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
-      cm.state.placeholder = null;
-    }
-  }
-  function setPlaceholder(cm) {
-    clearPlaceholder(cm);
-    var elt = cm.state.placeholder = document.createElement("pre");
-    elt.style.cssText = "height: 0; overflow: visible";
-    elt.className = "CodeMirror-placeholder";
-    var placeHolder = cm.getOption("placeholder")
-    if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder)
-    elt.appendChild(placeHolder)
-    cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
-  }
-
-  function onBlur(cm) {
-    if (isEmpty(cm)) setPlaceholder(cm);
-  }
-  function onChange(cm) {
-    var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
-    wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
-
-    if (empty) setPlaceholder(cm);
-    else clearPlaceholder(cm);
-  }
-
-  function isEmpty(cm) {
-    return (cm.lineCount() === 1) && (cm.getLine(0) === "");
-  }
-});
+'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){function f(a){a.state.placeholder&&(a.state.placeholder.parentNode.removeChild(a.state.placeholder),a.state.placeholder=null)}function h(a){f(a);var c=a.state.placeholder=document.createElement("pre");c.style.cssText="height: 0; overflow: visible";c.className="CodeMirror-placeholder";var b=
+a.getOption("placeholder");"string"==typeof b&&(b=document.createTextNode(b));c.appendChild(b);a.display.lineSpace.insertBefore(c,a.display.lineSpace.firstChild)}function g(a){k(a)&&h(a)}function e(a){var c=a.getWrapperElement(),b=k(a);c.className=c.className.replace(" CodeMirror-empty","")+(b?" CodeMirror-empty":"");b?h(a):f(a)}function k(a){return 1===a.lineCount()&&""===a.getLine(0)}d.defineOption("placeholder","",function(a,c,b){b=b&&b!=d.Init;c&&!b?(a.on("blur",g),a.on("change",e),a.on("swapDoc",
+e),e(a)):!c&&b&&(a.off("blur",g),a.off("change",e),a.off("swapDoc",e),f(a),b=a.getWrapperElement(),b.className=b.className.replace(" CodeMirror-empty",""));c&&!a.hasFocus()&&g(a)})});
index 151cc82..9eddd08 100644 (file)
@@ -1,51 +1,3 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  CodeMirror.defineOption("rulers", false, function(cm, val) {
-    if (cm.state.rulerDiv) {
-      cm.state.rulerDiv.parentElement.removeChild(cm.state.rulerDiv)
-      cm.state.rulerDiv = null
-      cm.off("refresh", drawRulers)
-    }
-    if (val && val.length) {
-      cm.state.rulerDiv = cm.display.lineSpace.parentElement.insertBefore(document.createElement("div"), cm.display.lineSpace)
-      cm.state.rulerDiv.className = "CodeMirror-rulers"
-      drawRulers(cm)
-      cm.on("refresh", drawRulers)
-    }
-  });
-
-  function drawRulers(cm) {
-    cm.state.rulerDiv.textContent = ""
-    var val = cm.getOption("rulers");
-    var cw = cm.defaultCharWidth();
-    var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left;
-    cm.state.rulerDiv.style.minHeight = (cm.display.scroller.offsetHeight + 30) + "px";
-    for (var i = 0; i < val.length; i++) {
-      var elt = document.createElement("div");
-      elt.className = "CodeMirror-ruler";
-      var col, conf = val[i];
-      if (typeof conf == "number") {
-        col = conf;
-      } else {
-        col = conf.column;
-        if (conf.className) elt.className += " " + conf.className;
-        if (conf.color) elt.style.borderColor = conf.color;
-        if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle;
-        if (conf.width) elt.style.borderLeftWidth = conf.width;
-      }
-      elt.style.left = (left + col * cw) + "px";
-      cm.state.rulerDiv.appendChild(elt)
-    }
-  }
-});
+'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function e(a){a.state.rulerDiv.textContent="";var g=a.getOption("rulers"),e=a.defaultCharWidth(),k=a.charCoords(c.Pos(a.firstLine(),0),"div").left;a.state.rulerDiv.style.minHeight=a.display.scroller.offsetHeight+30+"px";for(var f=0;f<g.length;f++){var d=document.createElement("div");d.className=
+"CodeMirror-ruler";var b=g[f];if("number"==typeof b)var h=b;else h=b.column,b.className&&(d.className+=" "+b.className),b.color&&(d.style.borderColor=b.color),b.lineStyle&&(d.style.borderLeftStyle=b.lineStyle),b.width&&(d.style.borderLeftWidth=b.width);d.style.left=k+h*e+"px";a.state.rulerDiv.appendChild(d)}}c.defineOption("rulers",!1,function(a,c){a.state.rulerDiv&&(a.state.rulerDiv.parentElement.removeChild(a.state.rulerDiv),a.state.rulerDiv=null,a.off("refresh",e));c&&c.length&&(a.state.rulerDiv=
+a.display.lineSpace.parentElement.insertBefore(document.createElement("div"),a.display.lineSpace),a.state.rulerDiv.className="CodeMirror-rulers",e(a),a.on("refresh",e))})});
index 01fdd96..ab24c8b 100644 (file)
@@ -1,202 +1,7 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  var defaults = {
-    pairs: "()[]{}''\"\"",
-    triples: "",
-    explode: "[]{}"
-  };
-
-  var Pos = CodeMirror.Pos;
-
-  CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
-    if (old && old != CodeMirror.Init) {
-      cm.removeKeyMap(keyMap);
-      cm.state.closeBrackets = null;
-    }
-    if (val) {
-      cm.state.closeBrackets = val;
-      cm.addKeyMap(keyMap);
-    }
-  });
-
-  function getOption(conf, name) {
-    if (name == "pairs" && typeof conf == "string") return conf;
-    if (typeof conf == "object" && conf[name] != null) return conf[name];
-    return defaults[name];
-  }
-
-  var bind = defaults.pairs + "`";
-  var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
-  for (var i = 0; i < bind.length; i++)
-    keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i));
-
-  function handler(ch) {
-    return function(cm) { return handleChar(cm, ch); };
-  }
-
-  function getConfig(cm) {
-    var deflt = cm.state.closeBrackets;
-    if (!deflt || deflt.override) return deflt;
-    var mode = cm.getModeAt(cm.getCursor());
-    return mode.closeBrackets || deflt;
-  }
-
-  function handleBackspace(cm) {
-    var conf = getConfig(cm);
-    if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
-
-    var pairs = getOption(conf, "pairs");
-    var ranges = cm.listSelections();
-    for (var i = 0; i < ranges.length; i++) {
-      if (!ranges[i].empty()) return CodeMirror.Pass;
-      var around = charsAround(cm, ranges[i].head);
-      if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
-    }
-    for (var i = ranges.length - 1; i >= 0; i--) {
-      var cur = ranges[i].head;
-      cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete");
-    }
-  }
-
-  function handleEnter(cm) {
-    var conf = getConfig(cm);
-    var explode = conf && getOption(conf, "explode");
-    if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;
-
-    var ranges = cm.listSelections();
-    for (var i = 0; i < ranges.length; i++) {
-      if (!ranges[i].empty()) return CodeMirror.Pass;
-      var around = charsAround(cm, ranges[i].head);
-      if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
-    }
-    cm.operation(function() {
-      cm.replaceSelection("\n\n", null);
-      cm.execCommand("goCharLeft");
-      ranges = cm.listSelections();
-      for (var i = 0; i < ranges.length; i++) {
-        var line = ranges[i].head.line;
-        cm.indentLine(line, null, true);
-        cm.indentLine(line + 1, null, true);
-      }
-    });
-  }
-
-  function contractSelection(sel) {
-    var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;
-    return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),
-            head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};
-  }
-
-  function handleChar(cm, ch) {
-    var conf = getConfig(cm);
-    if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
-
-    var pairs = getOption(conf, "pairs");
-    var pos = pairs.indexOf(ch);
-    if (pos == -1) return CodeMirror.Pass;
-    var triples = getOption(conf, "triples");
-
-    var identical = pairs.charAt(pos + 1) == ch;
-    var ranges = cm.listSelections();
-    var opening = pos % 2 == 0;
-
-    var type;
-    for (var i = 0; i < ranges.length; i++) {
-      var range = ranges[i], cur = range.head, curType;
-      var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
-      if (opening && !range.empty()) {
-        curType = "surround";
-      } else if ((identical || !opening) && next == ch) {
-        if (identical && stringStartsAfter(cm, cur))
-          curType = "both";
-        else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
-          curType = "skipThree";
-        else
-          curType = "skip";
-      } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
-                 cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&
-                 (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
-        curType = "addFour";
-      } else if (identical) {
-        if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both";
-        else return CodeMirror.Pass;
-      } else if (opening && (cm.getLine(cur.line).length == cur.ch ||
-                             isClosingBracket(next, pairs) ||
-                             /\s/.test(next))) {
-        curType = "both";
-      } else {
-        return CodeMirror.Pass;
-      }
-      if (!type) type = curType;
-      else if (type != curType) return CodeMirror.Pass;
-    }
-
-    var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
-    var right = pos % 2 ? ch : pairs.charAt(pos + 1);
-    cm.operation(function() {
-      if (type == "skip") {
-        cm.execCommand("goCharRight");
-      } else if (type == "skipThree") {
-        for (var i = 0; i < 3; i++)
-          cm.execCommand("goCharRight");
-      } else if (type == "surround") {
-        var sels = cm.getSelections();
-        for (var i = 0; i < sels.length; i++)
-          sels[i] = left + sels[i] + right;
-        cm.replaceSelections(sels, "around");
-        sels = cm.listSelections().slice();
-        for (var i = 0; i < sels.length; i++)
-          sels[i] = contractSelection(sels[i]);
-        cm.setSelections(sels);
-      } else if (type == "both") {
-        cm.replaceSelection(left + right, null);
-        cm.triggerElectric(left + right);
-        cm.execCommand("goCharLeft");
-      } else if (type == "addFour") {
-        cm.replaceSelection(left + left + left + left, "before");
-        cm.execCommand("goCharRight");
-      }
-    });
-  }
-
-  function isClosingBracket(ch, pairs) {
-    var pos = pairs.lastIndexOf(ch);
-    return pos > -1 && pos % 2 == 1;
-  }
-
-  function charsAround(cm, pos) {
-    var str = cm.getRange(Pos(pos.line, pos.ch - 1),
-                          Pos(pos.line, pos.ch + 1));
-    return str.length == 2 ? str : null;
-  }
-
-  // Project the token type that will exists after the given char is
-  // typed, and use it to determine whether it would cause the start
-  // of a string token.
-  function enteringString(cm, pos, ch) {
-    var line = cm.getLine(pos.line);
-    var token = cm.getTokenAt(pos);
-    if (/\bstring2?\b/.test(token.type) || stringStartsAfter(cm, pos)) return false;
-    var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
-    stream.pos = stream.start = token.start;
-    for (;;) {
-      var type1 = cm.getMode().token(stream, token.state);
-      if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1);
-      stream.start = stream.pos;
-    }
-  }
-
-  function stringStartsAfter(cm, pos) {
-    var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))
-    return /\bstring/.test(token.type) && token.start == pos.ch
-  }
-});
+'use strict';(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){function r(b,a){return"pairs"==a&&"string"==typeof b?b:"object"==typeof b&&null!=b[a]?b[a]:w[a]}function A(b){return function(a){return B(a,b)}}function v(b){var a=b.state.closeBrackets;return!a||a.override?a:b.getModeAt(b.getCursor()).closeBrackets||a}function B(b,a){var c=v(b);if(!c||b.getOption("disableInput"))return f.Pass;
+var d=r(c,"pairs"),e=d.indexOf(a);if(-1==e)return f.Pass;for(var c=r(c,"triples"),t=d.charAt(e+1)==a,x=b.listSelections(),m=0==e%2,l,p=0;p<x.length;p++){var h=x[p],g=h.head,u=b.getRange(g,k(g.line,g.ch+1));if(m&&!h.empty())h="surround";else if(!t&&m||u!=a)if(t&&1<g.ch&&0<=c.indexOf(a)&&b.getRange(k(g.line,g.ch-2),g)==a+a&&(2>=g.ch||b.getRange(k(g.line,g.ch-3),k(g.line,g.ch-2))!=a))h="addFour";else if(t)if(!f.isWordChar(u)&&C(b,g,a))h="both";else return f.Pass;else if(m&&(b.getLine(g.line).length==
+g.ch||D(u,d)||/\s/.test(u)))h="both";else return f.Pass;else h=t&&y(b,g)?"both":0<=c.indexOf(a)&&b.getRange(g,k(g.line,g.ch+3))==a+a+a?"skipThree":"skip";if(!l)l=h;else if(l!=h)return f.Pass}var n=e%2?d.charAt(e-1):a,q=e%2?a:d.charAt(e+1);b.operation(function(){if("skip"==l)b.execCommand("goCharRight");else if("skipThree"==l)for(var a=0;3>a;a++)b.execCommand("goCharRight");else if("surround"==l){for(var c=b.getSelections(),a=0;a<c.length;a++)c[a]=n+c[a]+q;b.replaceSelections(c,"around");c=b.listSelections().slice();
+for(a=0;a<c.length;a++){var d=c,g=a;var e=c[a];var h=0<f.cmpPos(e.anchor,e.head);e={anchor:new k(e.anchor.line,e.anchor.ch+(h?-1:1)),head:new k(e.head.line,e.head.ch+(h?1:-1))};d[g]=e}b.setSelections(c)}else"both"==l?(b.replaceSelection(n+q,null),b.triggerElectric(n+q),b.execCommand("goCharLeft")):"addFour"==l&&(b.replaceSelection(n+n+n+n,"before"),b.execCommand("goCharRight"))})}function D(b,a){b=a.lastIndexOf(b);return-1<b&&1==b%2}function z(b,a){b=b.getRange(k(a.line,a.ch-1),k(a.line,a.ch+1));
+return 2==b.length?b:null}function C(b,a,c){var d=b.getLine(a.line),e=b.getTokenAt(a);if(/\bstring2?\b/.test(e.type)||y(b,a))return!1;c=new f.StringStream(d.slice(0,a.ch)+c+d.slice(a.ch),4);for(c.pos=c.start=e.start;;){d=b.getMode().token(c,e.state);if(c.pos>=a.ch+1)return/\bstring2?\b/.test(d);c.start=c.pos}}function y(b,a){b=b.getTokenAt(k(a.line,a.ch+1));return/\bstring/.test(b.type)&&b.start==a.ch}var w={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},k=f.Pos;f.defineOption("autoCloseBrackets",
+!1,function(b,a,c){c&&c!=f.Init&&(b.removeKeyMap(p),b.state.closeBrackets=null);a&&(b.state.closeBrackets=a,b.addKeyMap(p))});for(var q=w.pairs+"`",p={Backspace:function(b){var a=v(b);if(!a||b.getOption("disableInput"))return f.Pass;for(var c=r(a,"pairs"),a=b.listSelections(),d=0;d<a.length;d++){if(!a[d].empty())return f.Pass;var e=z(b,a[d].head);if(!e||0!=c.indexOf(e)%2)return f.Pass}for(d=a.length-1;0<=d;d--)c=a[d].head,b.replaceRange("",k(c.line,c.ch-1),k(c.line,c.ch+1),"+delete")},Enter:function(b){var a=
+v(b),a=a&&r(a,"explode");if(!a||b.getOption("disableInput"))return f.Pass;for(var c=b.listSelections(),d=0;d<c.length;d++){if(!c[d].empty())return f.Pass;var e=z(b,c[d].head);if(!e||0!=a.indexOf(e)%2)return f.Pass}b.operation(function(){b.replaceSelection("\n\n",null);b.execCommand("goCharLeft");c=b.listSelections();for(var a=0;a<c.length;a++){var d=c[a].head.line;b.indentLine(d,null,!0);b.indentLine(d+1,null,!0)}})}},m=0;m<q.length;m++)p["'"+q.charAt(m)+"'"]=A(q.charAt(m))});
index a518da3..9409e68 100644 (file)
@@ -1,169 +1,7 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-/**
- * Tag-closer extension for CodeMirror.
- *
- * This extension adds an "autoCloseTags" option that can be set to
- * either true to get the default behavior, or an object to further
- * configure its behavior.
- *
- * These are supported options:
- *
- * `whenClosing` (default true)
- *   Whether to autoclose when the '/' of a closing tag is typed.
- * `whenOpening` (default true)
- *   Whether to autoclose the tag when the final '>' of an opening
- *   tag is typed.
- * `dontCloseTags` (default is empty tags for HTML, none for XML)
- *   An array of tag names that should not be autoclosed.
- * `indentTags` (default is block tags for HTML, none for XML)
- *   An array of tag names that should, when opened, cause a
- *   blank line to be added inside the tag, and the blank line and
- *   closing line to be indented.
- *
- * See demos/closetag.html for a usage example.
- */
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror", "../fold/xml-fold"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
-    if (old != CodeMirror.Init && old)
-      cm.removeKeyMap("autoCloseTags");
-    if (!val) return;
-    var map = {name: "autoCloseTags"};
-    if (typeof val != "object" || val.whenClosing)
-      map["'/'"] = function(cm) { return autoCloseSlash(cm); };
-    if (typeof val != "object" || val.whenOpening)
-      map["'>'"] = function(cm) { return autoCloseGT(cm); };
-    cm.addKeyMap(map);
-  });
-
-  var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
-                       "source", "track", "wbr"];
-  var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
-                    "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
-
-  function autoCloseGT(cm) {
-    if (cm.getOption("disableInput")) return CodeMirror.Pass;
-    var ranges = cm.listSelections(), replacements = [];
-    for (var i = 0; i < ranges.length; i++) {
-      if (!ranges[i].empty()) return CodeMirror.Pass;
-      var pos = ranges[i].head, tok = cm.getTokenAt(pos);
-      var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
-      if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
-
-      var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
-      var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
-      var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
-
-      var tagName = state.tagName;
-      if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
-      var lowerTagName = tagName.toLowerCase();
-      // Don't process the '>' at the end of an end-tag or self-closing tag
-      if (!tagName ||
-          tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
-          tok.type == "tag" && state.type == "closeTag" ||
-          tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
-          dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
-          closingTagExists(cm, tagName, pos, state, true))
-        return CodeMirror.Pass;
-
-      var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
-      replacements[i] = {indent: indent,
-                         text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
-                         newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
-    }
-
-    for (var i = ranges.length - 1; i >= 0; i--) {
-      var info = replacements[i];
-      cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
-      var sel = cm.listSelections().slice(0);
-      sel[i] = {head: info.newPos, anchor: info.newPos};
-      cm.setSelections(sel);
-      if (info.indent) {
-        cm.indentLine(info.newPos.line, null, true);
-        cm.indentLine(info.newPos.line + 1, null, true);
-      }
-    }
-  }
-
-  function autoCloseCurrent(cm, typingSlash) {
-    var ranges = cm.listSelections(), replacements = [];
-    var head = typingSlash ? "/" : "</";
-    for (var i = 0; i < ranges.length; i++) {
-      if (!ranges[i].empty()) return CodeMirror.Pass;
-      var pos = ranges[i].head, tok = cm.getTokenAt(pos);
-      var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
-      if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
-                          tok.start != pos.ch - 1))
-        return CodeMirror.Pass;
-      // Kludge to get around the fact that we are not in XML mode
-      // when completing in JS/CSS snippet in htmlmixed mode. Does not
-      // work for other XML embedded languages (there is no general
-      // way to go from a mixed mode to its current XML state).
-      var replacement;
-      if (inner.mode.name != "xml") {
-        if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
-          replacement = head + "script";
-        else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
-          replacement = head + "style";
-        else
-          return CodeMirror.Pass;
-      } else {
-        if (!state.context || !state.context.tagName ||
-            closingTagExists(cm, state.context.tagName, pos, state))
-          return CodeMirror.Pass;
-        replacement = head + state.context.tagName;
-      }
-      if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
-      replacements[i] = replacement;
-    }
-    cm.replaceSelections(replacements);
-    ranges = cm.listSelections();
-    for (var i = 0; i < ranges.length; i++)
-      if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
-        cm.indentLine(ranges[i].head.line);
-  }
-
-  function autoCloseSlash(cm) {
-    if (cm.getOption("disableInput")) return CodeMirror.Pass;
-    return autoCloseCurrent(cm, true);
-  }
-
-  CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
-
-  function indexOf(collection, elt) {
-    if (collection.indexOf) return collection.indexOf(elt);
-    for (var i = 0, e = collection.length; i < e; ++i)
-      if (collection[i] == elt) return i;
-    return -1;
-  }
-
-  // If xml-fold is loaded, we use its functionality to try and verify
-  // whether a given tag is actually unclosed.
-  function closingTagExists(cm, tagName, pos, state, newTag) {
-    if (!CodeMirror.scanForClosingTag) return false;
-    var end = Math.min(cm.lastLine() + 1, pos.line + 500);
-    var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
-    if (!nextClose || nextClose.tag != tagName) return false;
-    var cx = state.context;
-    // If the immediate wrapping context contains onCx instances of
-    // the same tag, a closing tag only exists if there are at least
-    // that many closing tags of that type following.
-    for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx;
-    pos = nextClose.to;
-    for (var i = 1; i < onCx; i++) {
-      var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
-      if (!next || next.tag != tagName) return false;
-      pos = next.to;
-    }
-    return true;
-  }
-});
+'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)})(function(e){function r(b){if(b.getOption("disableInput"))return e.Pass;for(var h=b.listSelections(),a=[],d=0;d<h.length;d++){if(!h[d].empty())return e.Pass;var f=h[d].head,c=b.getTokenAt(f),k=e.innerMode(b.getMode(),c.state),m=k.state;if("xml"!=k.mode.name||
+!m.tagName)return e.Pass;var g=b.getOption("autoCloseTags"),l="html"==k.mode.configuration,k="object"==typeof g&&g.dontCloseTags||l&&t,l="object"==typeof g&&g.indentTags||l&&u,g=m.tagName;c.end>f.ch&&(g=g.slice(0,g.length-c.end+f.ch));var n=g.toLowerCase();if(!g||"string"==c.type&&(c.end!=f.ch||!/[\"\']/.test(c.string.charAt(c.string.length-1))||1==c.string.length)||"tag"==c.type&&"closeTag"==m.type||c.string.indexOf("/")==c.string.length-1||k&&-1<p(k,n)||q(b,g,f,m,!0))return e.Pass;c=l&&-1<p(l,n);
+a[d]={indent:c,text:">"+(c?"\n\n":"")+"</"+g+">",newPos:c?e.Pos(f.line+1,0):e.Pos(f.line,f.ch+1)}}for(d=h.length-1;0<=d;d--)f=a[d],b.replaceRange(f.text,h[d].head,h[d].anchor,"+insert"),c=b.listSelections().slice(0),c[d]={head:f.newPos,anchor:f.newPos},b.setSelections(c),f.indent&&(b.indentLine(f.newPos.line,null,!0),b.indentLine(f.newPos.line+1,null,!0))}function n(b,h){for(var a=b.listSelections(),d=[],f=h?"/":"</",c=0;c<a.length;c++){if(!a[c].empty())return e.Pass;var k=a[c].head,m=b.getTokenAt(k),
+g=e.innerMode(b.getMode(),m.state),l=g.state;if(h&&("string"==m.type||"<"!=m.string.charAt(0)||m.start!=k.ch-1))return e.Pass;if("xml"!=g.mode.name)if("htmlmixed"==b.getMode().name&&"javascript"==g.mode.name)g=f+"script";else if("htmlmixed"==b.getMode().name&&"css"==g.mode.name)g=f+"style";else return e.Pass;else{if(!l.context||!l.context.tagName||q(b,l.context.tagName,k,l))return e.Pass;g=f+l.context.tagName}">"!=b.getLine(k.line).charAt(m.end)&&(g+=">");d[c]=g}b.replaceSelections(d);a=b.listSelections();
+for(c=0;c<a.length;c++)(c==a.length-1||a[c].head.line<a[c+1].head.line)&&b.indentLine(a[c].head.line)}function p(b,e){if(b.indexOf)return b.indexOf(e);for(var a=0,d=b.length;a<d;++a)if(b[a]==e)return a;return-1}function q(b,h,a,d,f){if(!e.scanForClosingTag)return!1;var c=Math.min(b.lastLine()+1,a.line+500);a=e.scanForClosingTag(b,a,null,c);if(!a||a.tag!=h)return!1;d=d.context;for(f=f?1:0;d&&d.tagName==h;d=d.prev)++f;a=a.to;for(d=1;d<f;d++){a=e.scanForClosingTag(b,a,null,c);if(!a||a.tag!=h)return!1;
+a=a.to}return!0}e.defineOption("autoCloseTags",!1,function(b,h,a){a!=e.Init&&a&&b.removeKeyMap("autoCloseTags");if(h){a={name:"autoCloseTags"};if("object"!=typeof h||h.whenClosing)a["'/'"]=function(a){a=a.getOption("disableInput")?e.Pass:n(a,!0);return a};if("object"!=typeof h||h.whenOpening)a["'>'"]=function(a){return r(a)};b.addKeyMap(a)}});var t="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),u="applet blockquote body button div dl fieldset form frameset h1 h2 h3 h4 h5 h6 head html iframe layer legend object ol p select table ul".split(" ");
+e.commands.closeTag=function(b){return n(b)}});
index f13e521..42d1d79 100644 (file)
@@ -1,51 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,
-      emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,
-      unorderedListRE = /[*+-]\s/;
-
-  CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
-    if (cm.getOption("disableInput")) return CodeMirror.Pass;
-    var ranges = cm.listSelections(), replacements = [];
-    for (var i = 0; i < ranges.length; i++) {
-      var pos = ranges[i].head;
-      var eolState = cm.getStateAfter(pos.line);
-      var inList = eolState.list !== false;
-      var inQuote = eolState.quote !== 0;
-
-      var line = cm.getLine(pos.line), match = listRE.exec(line);
-      if (!ranges[i].empty() || (!inList && !inQuote) || !match) {
-        cm.execCommand("newlineAndIndent");
-        return;
-      }
-      if (emptyListRE.test(line)) {
-        if (!/>\s*$/.test(line)) cm.replaceRange("", {
-          line: pos.line, ch: 0
-        }, {
-          line: pos.line, ch: pos.ch + 1
-        });
-        replacements[i] = "\n";
-      } else {
-        var indent = match[1], after = match[5];
-        var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
-          ? match[2].replace("x", " ")
-          : (parseInt(match[3], 10) + 1) + match[4];
-
-        replacements[i] = "\n" + indent + bullet + after;
-      }
-    }
-
-    cm.replaceSelections(replacements);
-  };
-});
+'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){var l=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,m=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,n=/[*+-]\s/;d.commands.newlineAndIndentContinueMarkdownList=function(b){if(b.getOption("disableInput"))return d.Pass;for(var f=b.listSelections(),g=[],e=0;e<f.length;e++){var c=
+f[e].head,a=b.getStateAfter(c.line),h=!1!==a.list,p=0!==a.quote,k=b.getLine(c.line),a=l.exec(k);if(!f[e].empty()||!h&&!p||!a){b.execCommand("newlineAndIndent");return}m.test(k)?(/>\s*$/.test(k)||b.replaceRange("",{line:c.line,ch:0},{line:c.line,ch:c.ch+1}),g[e]="\n"):(c=a[1],h=a[5],a=n.test(a[2])||0<=a[2].indexOf(">")?a[2].replace("x"," "):parseInt(a[3],10)+1+a[4],g[e]="\n"+c+a+h)}b.replaceSelections(g)}});
index 4d7a230..9ab0cc4 100644 (file)
@@ -1,140 +1,6 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
-    (document.documentMode == null || document.documentMode < 8);
-
-  var Pos = CodeMirror.Pos;
-
-  var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
-
-  function findMatchingBracket(cm, where, config) {
-    var line = cm.getLineHandle(where.line), pos = where.ch - 1;
-    var afterCursor = config && config.afterCursor
-    if (afterCursor == null)
-      afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
-
-    // A cursor is defined as between two characters, but in in vim command mode
-    // (i.e. not insert mode), the cursor is visually represented as a
-    // highlighted box on top of the 2nd character. Otherwise, we allow matches
-    // from before or after the cursor.
-    var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) ||
-        matching[line.text.charAt(++pos)];
-    if (!match) return null;
-    var dir = match.charAt(1) == ">" ? 1 : -1;
-    if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
-    var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
-
-    var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
-    if (found == null) return null;
-    return {from: Pos(where.line, pos), to: found && found.pos,
-            match: found && found.ch == match.charAt(0), forward: dir > 0};
-  }
-
-  // bracketRegex is used to specify which type of bracket to scan
-  // should be a regexp, e.g. /[[\]]/
-  //
-  // Note: If "where" is on an open bracket, then this bracket is ignored.
-  //
-  // Returns false when no bracket was found, null when it reached
-  // maxScanLines and gave up
-  function scanForBracket(cm, where, dir, style, config) {
-    var maxScanLen = (config && config.maxScanLineLength) || 10000;
-    var maxScanLines = (config && config.maxScanLines) || 1000;
-
-    var stack = [];
-    var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
-    var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
-                          : Math.max(cm.firstLine() - 1, where.line - maxScanLines);
-    for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
-      var line = cm.getLine(lineNo);
-      if (!line) continue;
-      var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
-      if (line.length > maxScanLen) continue;
-      if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
-      for (; pos != end; pos += dir) {
-        var ch = line.charAt(pos);
-        if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
-          var match = matching[ch];
-          if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
-          else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
-          else stack.pop();
-        }
-      }
-    }
-    return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
-  }
-
-  function matchBrackets(cm, autoclear, config) {
-    // Disable brace matching in long lines, since it'll cause hugely slow updates
-    var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
-    var marks = [], ranges = cm.listSelections();
-    for (var i = 0; i < ranges.length; i++) {
-      var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
-      if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
-        var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
-        marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
-        if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
-          marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
-      }
-    }
-
-    if (marks.length) {
-      // Kludge to work around the IE bug from issue #1193, where text
-      // input stops going to the textare whever this fires.
-      if (ie_lt8 && cm.state.focused) cm.focus();
-
-      var clear = function() {
-        cm.operation(function() {
-          for (var i = 0; i < marks.length; i++) marks[i].clear();
-        });
-      };
-      if (autoclear) setTimeout(clear, 800);
-      else return clear;
-    }
-  }
-
-  var currentlyHighlighted = null;
-  function doMatchBrackets(cm) {
-    cm.operation(function() {
-      if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
-      currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
-    });
-  }
-
-  CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
-    if (old && old != CodeMirror.Init) {
-      cm.off("cursorActivity", doMatchBrackets);
-      if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
-    }
-    if (val) {
-      cm.state.matchBrackets = typeof val == "object" ? val : {};
-      cm.on("cursorActivity", doMatchBrackets);
-    }
-  });
-
-  CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
-  CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){
-    // Backwards-compatibility kludge
-    if (oldConfig || typeof config == "boolean") {
-      if (!oldConfig) {
-        config = config ? {strict: true} : null
-      } else {
-        oldConfig.strict = config
-        config = oldConfig
-      }
-    }
-    return findMatchingBracket(this, pos, config)
-  });
-  CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
-    return scanForBracket(this, pos, dir, style, config);
-  });
-});
+'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){function q(a,c,b){var l=a.getLineHandle(c.line),e=c.ch-1,k=b&&b.afterCursor;null==k&&(k=/(^| )cm-fat-cursor($| )/.test(a.getWrapperElement().className));l=!k&&0<=e&&n[l.text.charAt(e)]||n[l.text.charAt(++e)];if(!l)return null;k=">"==l.charAt(1)?1:-1;if(b&&b.strict&&0<k!=(e==c.ch))return null;
+var h=a.getTokenTypeAt(m(c.line,e+1));a=t(a,m(c.line,e+(0<k?1:0)),k,h||null,b);return null==a?null:{from:m(c.line,e),to:a&&a.pos,match:a&&a.ch==l.charAt(0),forward:0<k}}function t(a,c,b,l,e){var k=e&&e.maxScanLineLength||1E4,h=e&&e.maxScanLines||1E3,g=[];e=e&&e.bracketRegex?e.bracketRegex:/[(){}[\]]/;for(var h=0<b?Math.min(c.line+h,a.lastLine()+1):Math.max(a.firstLine()-1,c.line-h),d=c.line;d!=h;d+=b){var p=a.getLine(d);if(p){var f=0<b?0:p.length-1,q=0<b?p.length:-1;if(!(p.length>k))for(d==c.line&&
+(f=c.ch-(0>b?1:0));f!=q;f+=b){var r=p.charAt(f);if(e.test(r)&&(void 0===l||a.getTokenTypeAt(m(d,f+1))==l))if(">"==n[r].charAt(1)==0<b)g.push(r);else if(g.length)g.pop();else return{pos:m(d,f),ch:r}}}}return d-b==(0<b?a.lastLine():a.firstLine())?!1:null}function u(a,c,b){for(var d=a.state.matchBrackets.maxHighlightLineLength||1E3,e=[],f=a.listSelections(),h=0;h<f.length;h++){var g=f[h].empty()&&q(a,f[h].head,b);if(g&&a.getLine(g.from.line).length<=d){var n=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";
+e.push(a.markText(g.from,m(g.from.line,g.from.ch+1),{className:n}));g.to&&a.getLine(g.to.line).length<=d&&e.push(a.markText(g.to,m(g.to.line,g.to.ch+1),{className:n}))}}if(e.length)if(w&&a.state.focused&&a.focus(),b=function(){a.operation(function(){for(var a=0;a<e.length;a++)e[a].clear()})},c)setTimeout(b,800);else return b}function v(a){a.operation(function(){f&&(f(),f=null);f=u(a,!1,a.state.matchBrackets)})}var w=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||8>document.documentMode),
+m=d.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;d.defineOption("matchBrackets",!1,function(a,c,b){b&&b!=d.Init&&(a.off("cursorActivity",v),f&&(f(),f=null));c&&(a.state.matchBrackets="object"==typeof c?c:{},a.on("cursorActivity",v))});d.defineExtension("matchBrackets",function(){u(this,!0)});d.defineExtension("findMatchingBracket",function(a,c,b){if(b||"boolean"==typeof c)b?(b.strict=c,c=b):c=c?{strict:!0}:null;return q(this,a,c)});d.defineExtension("scanForBracket",function(a,
+c,b,d){return t(this,a,c,b,d)})});
index fb1911a..3387092 100644 (file)
@@ -1,66 +1,3 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror", "../fold/xml-fold"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
-    if (old && old != CodeMirror.Init) {
-      cm.off("cursorActivity", doMatchTags);
-      cm.off("viewportChange", maybeUpdateMatch);
-      clear(cm);
-    }
-    if (val) {
-      cm.state.matchBothTags = typeof val == "object" && val.bothTags;
-      cm.on("cursorActivity", doMatchTags);
-      cm.on("viewportChange", maybeUpdateMatch);
-      doMatchTags(cm);
-    }
-  });
-
-  function clear(cm) {
-    if (cm.state.tagHit) cm.state.tagHit.clear();
-    if (cm.state.tagOther) cm.state.tagOther.clear();
-    cm.state.tagHit = cm.state.tagOther = null;
-  }
-
-  function doMatchTags(cm) {
-    cm.state.failedTagMatch = false;
-    cm.operation(function() {
-      clear(cm);
-      if (cm.somethingSelected()) return;
-      var cur = cm.getCursor(), range = cm.getViewport();
-      range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
-      var match = CodeMirror.findMatchingTag(cm, cur, range);
-      if (!match) return;
-      if (cm.state.matchBothTags) {
-        var hit = match.at == "open" ? match.open : match.close;
-        if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"});
-      }
-      var other = match.at == "close" ? match.open : match.close;
-      if (other)
-        cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
-      else
-        cm.state.failedTagMatch = true;
-    });
-  }
-
-  function maybeUpdateMatch(cm) {
-    if (cm.state.failedTagMatch) doMatchTags(cm);
-  }
-
-  CodeMirror.commands.toMatchingTag = function(cm) {
-    var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
-    if (found) {
-      var other = found.at == "close" ? found.open : found.close;
-      if (other) cm.extendSelection(other.to, other.from);
-    }
-  };
-});
+'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],d):d(CodeMirror)})(function(d){function f(a){a.state.tagHit&&a.state.tagHit.clear();a.state.tagOther&&a.state.tagOther.clear();a.state.tagHit=a.state.tagOther=null}function e(a){a.state.failedTagMatch=!1;a.operation(function(){f(a);if(!a.somethingSelected()){var b=a.getCursor(),
+c=a.getViewport();c.from=Math.min(c.from,b.line);c.to=Math.max(b.line+1,c.to);if(b=d.findMatchingTag(a,b,c))a.state.matchBothTags&&(c="open"==b.at?b.open:b.close)&&(a.state.tagHit=a.markText(c.from,c.to,{className:"CodeMirror-matchingtag"})),(b="close"==b.at?b.open:b.close)?a.state.tagOther=a.markText(b.from,b.to,{className:"CodeMirror-matchingtag"}):a.state.failedTagMatch=!0}})}function g(a){a.state.failedTagMatch&&e(a)}d.defineOption("matchTags",!1,function(a,b,c){c&&c!=d.Init&&(a.off("cursorActivity",
+e),a.off("viewportChange",g),f(a));b&&(a.state.matchBothTags="object"==typeof b&&b.bothTags,a.on("cursorActivity",e),a.on("viewportChange",g),e(a))});d.commands.toMatchingTag=function(a){var b=d.findMatchingTag(a,a.getCursor());b&&(b="close"==b.at?b.open:b.close)&&a.extendSelection(b.to,b.from)}});
index fa7b56b..d77ac72 100644 (file)
@@ -1,27 +1 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
-    if (prev == CodeMirror.Init) prev = false;
-    if (prev && !val)
-      cm.removeOverlay("trailingspace");
-    else if (!prev && val)
-      cm.addOverlay({
-        token: function(stream) {
-          for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
-          if (i > stream.pos) { stream.pos = i; return null; }
-          stream.pos = l;
-          return "trailingspace";
-        },
-        name: "trailingspace"
-      });
-  });
-});
+'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.defineOption("showTrailingSpace",!1,function(d,e,b){b==a.Init&&(b=!1);b&&!e?d.removeOverlay("trailingspace"):!b&&e&&d.addOverlay({token:function(a){for(var b=a.string.length,c=b;c&&/\s/.test(a.string.charAt(c-1));--c);if(c>a.pos)return a.pos=c,null;a.pos=b;return"trailingspace"},name:"trailingspace"})})});
index 13c0f0c..3e25787 100644 (file)
@@ -1,105 +1,4 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.registerHelper("fold", "brace", function(cm, start) {
-  var line = start.line, lineText = cm.getLine(line);
-  var tokenType;
-
-  function findOpening(openCh) {
-    for (var at = start.ch, pass = 0;;) {
-      var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1);
-      if (found == -1) {
-        if (pass == 1) break;
-        pass = 1;
-        at = lineText.length;
-        continue;
-      }
-      if (pass == 1 && found < start.ch) break;
-      tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
-      if (!/^(comment|string)/.test(tokenType)) return found + 1;
-      at = found - 1;
-    }
-  }
-
-  var startToken = "{", endToken = "}", startCh = findOpening("{");
-  if (startCh == null) {
-    startToken = "[", endToken = "]";
-    startCh = findOpening("[");
-  }
-
-  if (startCh == null) return;
-  var count = 1, lastLine = cm.lastLine(), end, endCh;
-  outer: for (var i = line; i <= lastLine; ++i) {
-    var text = cm.getLine(i), pos = i == line ? startCh : 0;
-    for (;;) {
-      var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
-      if (nextOpen < 0) nextOpen = text.length;
-      if (nextClose < 0) nextClose = text.length;
-      pos = Math.min(nextOpen, nextClose);
-      if (pos == text.length) break;
-      if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) {
-        if (pos == nextOpen) ++count;
-        else if (!--count) { end = i; endCh = pos; break outer; }
-      }
-      ++pos;
-    }
-  }
-  if (end == null || line == end && endCh == startCh) return;
-  return {from: CodeMirror.Pos(line, startCh),
-          to: CodeMirror.Pos(end, endCh)};
-});
-
-CodeMirror.registerHelper("fold", "import", function(cm, start) {
-  function hasImport(line) {
-    if (line < cm.firstLine() || line > cm.lastLine()) return null;
-    var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
-    if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
-    if (start.type != "keyword" || start.string != "import") return null;
-    // Now find closing semicolon, return its position
-    for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) {
-      var text = cm.getLine(i), semi = text.indexOf(";");
-      if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)};
-    }
-  }
-
-  var startLine = start.line, has = hasImport(startLine), prev;
-  if (!has || hasImport(startLine - 1) || ((prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1))
-    return null;
-  for (var end = has.end;;) {
-    var next = hasImport(end.line + 1);
-    if (next == null) break;
-    end = next.end;
-  }
-  return {from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), to: end};
-});
-
-CodeMirror.registerHelper("fold", "include", function(cm, start) {
-  function hasInclude(line) {
-    if (line < cm.firstLine() || line > cm.lastLine()) return null;
-    var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
-    if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
-    if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
-  }
-
-  var startLine = start.line, has = hasInclude(startLine);
-  if (has == null || hasInclude(startLine - 1) != null) return null;
-  for (var end = startLine;;) {
-    var next = hasInclude(end + 1);
-    if (next == null) break;
-    ++end;
-  }
-  return {from: CodeMirror.Pos(startLine, has + 1),
-          to: cm.clipPos(CodeMirror.Pos(end))};
-});
-
-});
+'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){d.registerHelper("fold","brace",function(e,a){function b(h){for(var c=a.ch,b=0;;)if(c=0>=c?-1:f.lastIndexOf(h,c-1),-1==c){if(1==b)break;b=1;c=f.length}else{if(1==b&&c<a.ch)break;k=e.getTokenTypeAt(d.Pos(g,c+1));if(!/^(comment|string)/.test(k))return c+1;--c}}var g=a.line,f=e.getLine(g),k,
+h="{",r="}",l=b("{");null==l&&(h="[",r="]",l=b("["));if(null!=l){var t=1,v=e.lastLine(),m=g;a:for(;m<=v;++m)for(var n=e.getLine(m),c=m==g?l:0;;){var p=n.indexOf(h,c),c=n.indexOf(r,c);0>p&&(p=n.length);0>c&&(c=n.length);c=Math.min(p,c);if(c==n.length)break;if(e.getTokenTypeAt(d.Pos(m,c+1))==k)if(c==p)++t;else if(!--t){var q=m;var u=c;break a}++c}if(null!=q&&(g!=q||u!=l))return{from:d.Pos(g,l),to:d.Pos(q,u)}}});d.registerHelper("fold","import",function(e,a){function b(h){if(h<e.firstLine()||h>e.lastLine())return null;
+var a=e.getTokenAt(d.Pos(h,1));/\S/.test(a.string)||(a=e.getTokenAt(d.Pos(h,a.end+1)));if("keyword"!=a.type||"import"!=a.string)return null;var b=h;for(h=Math.min(e.lastLine(),h+10);b<=h;++b){var f=e.getLine(b).indexOf(";");if(-1!=f)return{startCh:a.end,end:d.Pos(b,f)}}}a=a.line;var g=b(a),f;if(!g||b(a-1)||(f=b(a-2))&&f.end.line==a-1)return null;for(f=g.end;;){var k=b(f.line+1);if(null==k)break;f=k.end}return{from:e.clipPos(d.Pos(a,g.startCh+1)),to:f}});d.registerHelper("fold","include",function(e,
+a){function b(a){if(a<e.firstLine()||a>e.lastLine())return null;var b=e.getTokenAt(d.Pos(a,1));/\S/.test(b.string)||(b=e.getTokenAt(d.Pos(a,b.end+1)));if("meta"==b.type&&"#include"==b.string.slice(0,8))return b.start+8}a=a.line;var g=b(a);if(null==g||null!=b(a-1))return null;for(var f=a;null!=b(f+1);)++f;return{from:d.Pos(a,g+1),to:e.clipPos(d.Pos(f))}})});
index e8d800e..ed01f30 100644 (file)
@@ -1,59 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.registerGlobalHelper("fold", "comment", function(mode) {
-  return mode.blockCommentStart && mode.blockCommentEnd;
-}, function(cm, start) {
-  var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd;
-  if (!startToken || !endToken) return;
-  var line = start.line, lineText = cm.getLine(line);
-
-  var startCh;
-  for (var at = start.ch, pass = 0;;) {
-    var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1);
-    if (found == -1) {
-      if (pass == 1) return;
-      pass = 1;
-      at = lineText.length;
-      continue;
-    }
-    if (pass == 1 && found < start.ch) return;
-    if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) &&
-        (found == 0 || lineText.slice(found - endToken.length, found) == endToken ||
-         !/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) {
-      startCh = found + startToken.length;
-      break;
-    }
-    at = found - 1;
-  }
-
-  var depth = 1, lastLine = cm.lastLine(), end, endCh;
-  outer: for (var i = line; i <= lastLine; ++i) {
-    var text = cm.getLine(i), pos = i == line ? startCh : 0;
-    for (;;) {
-      var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
-      if (nextOpen < 0) nextOpen = text.length;
-      if (nextClose < 0) nextClose = text.length;
-      pos = Math.min(nextOpen, nextClose);
-      if (pos == text.length) break;
-      if (pos == nextOpen) ++depth;
-      else if (!--depth) { end = i; endCh = pos; break outer; }
-      ++pos;
-    }
-  }
-  if (end == null || line == end && endCh == startCh) return;
-  return {from: CodeMirror.Pos(line, startCh),
-          to: CodeMirror.Pos(end, endCh)};
-});
-
-});
+'use strict';(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],b):b(CodeMirror)})(function(b){b.registerGlobalHelper("fold","comment",function(b){return b.blockCommentStart&&b.blockCommentEnd},function(g,d){var e=g.getModeAt(d),m=e.blockCommentStart,e=e.blockCommentEnd;if(m&&e){for(var f=d.line,h=g.getLine(f),a=d.ch,k=0;;)if(a=0>=a?-1:h.lastIndexOf(m,a-1),-1==a){if(1==k)return;k=1;
+a=h.length}else{if(1==k&&a<d.ch)return;if(/comment/.test(g.getTokenTypeAt(b.Pos(f,a+1)))&&(0==a||h.slice(a-e.length,a)==e||!/comment/.test(g.getTokenTypeAt(b.Pos(f,a))))){d=a+m.length;break}--a}var h=1,k=g.lastLine(),a=f;a:for(;a<=k;++a)for(var l=g.getLine(a),c=a==f?d:0;;){var n=l.indexOf(m,c),c=l.indexOf(e,c);0>n&&(n=l.length);0>c&&(c=l.length);c=Math.min(n,c);if(c==l.length)break;if(c==n)++h;else if(!--h){var p=a;var q=c;break a}++c}if(null!=p&&(f!=p||q!=d))return{from:b.Pos(f,d),to:b.Pos(p,q)}}})});
index 826766b..0334e94 100644 (file)
@@ -1,152 +1,5 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  function doFold(cm, pos, options, force) {
-    if (options && options.call) {
-      var finder = options;
-      options = null;
-    } else {
-      var finder = getOption(cm, options, "rangeFinder");
-    }
-    if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
-    var minSize = getOption(cm, options, "minFoldSize");
-
-    function getRange(allowFolded) {
-      var range = finder(cm, pos);
-      if (!range || range.to.line - range.from.line < minSize) return null;
-      var marks = cm.findMarksAt(range.from);
-      for (var i = 0; i < marks.length; ++i) {
-        if (marks[i].__isFold && force !== "fold") {
-          if (!allowFolded) return null;
-          range.cleared = true;
-          marks[i].clear();
-        }
-      }
-      return range;
-    }
-
-    var range = getRange(true);
-    if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) {
-      pos = CodeMirror.Pos(pos.line - 1, 0);
-      range = getRange(false);
-    }
-    if (!range || range.cleared || force === "unfold") return;
-
-    var myWidget = makeWidget(cm, options);
-    CodeMirror.on(myWidget, "mousedown", function(e) {
-      myRange.clear();
-      CodeMirror.e_preventDefault(e);
-    });
-    var myRange = cm.markText(range.from, range.to, {
-      replacedWith: myWidget,
-      clearOnEnter: getOption(cm, options, "clearOnEnter"),
-      __isFold: true
-    });
-    myRange.on("clear", function(from, to) {
-      CodeMirror.signal(cm, "unfold", cm, from, to);
-    });
-    CodeMirror.signal(cm, "fold", cm, range.from, range.to);
-  }
-
-  function makeWidget(cm, options) {
-    var widget = getOption(cm, options, "widget");
-    if (typeof widget == "string") {
-      var text = document.createTextNode(widget);
-      widget = document.createElement("span");
-      widget.appendChild(text);
-      widget.className = "CodeMirror-foldmarker";
-    } else if (widget) {
-      widget = widget.cloneNode(true)
-    }
-    return widget;
-  }
-
-  // Clumsy backwards-compatible interface
-  CodeMirror.newFoldFunction = function(rangeFinder, widget) {
-    return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };
-  };
-
-  // New-style interface
-  CodeMirror.defineExtension("foldCode", function(pos, options, force) {
-    doFold(this, pos, options, force);
-  });
-
-  CodeMirror.defineExtension("isFolded", function(pos) {
-    var marks = this.findMarksAt(pos);
-    for (var i = 0; i < marks.length; ++i)
-      if (marks[i].__isFold) return true;
-  });
-
-  CodeMirror.commands.toggleFold = function(cm) {
-    cm.foldCode(cm.getCursor());
-  };
-  CodeMirror.commands.fold = function(cm) {
-    cm.foldCode(cm.getCursor(), null, "fold");
-  };
-  CodeMirror.commands.unfold = function(cm) {
-    cm.foldCode(cm.getCursor(), null, "unfold");
-  };
-  CodeMirror.commands.foldAll = function(cm) {
-    cm.operation(function() {
-      for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
-        cm.foldCode(CodeMirror.Pos(i, 0), null, "fold");
-    });
-  };
-  CodeMirror.commands.unfoldAll = function(cm) {
-    cm.operation(function() {
-      for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
-        cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold");
-    });
-  };
-
-  CodeMirror.registerHelper("fold", "combine", function() {
-    var funcs = Array.prototype.slice.call(arguments, 0);
-    return function(cm, start) {
-      for (var i = 0; i < funcs.length; ++i) {
-        var found = funcs[i](cm, start);
-        if (found) return found;
-      }
-    };
-  });
-
-  CodeMirror.registerHelper("fold", "auto", function(cm, start) {
-    var helpers = cm.getHelpers(start, "fold");
-    for (var i = 0; i < helpers.length; i++) {
-      var cur = helpers[i](cm, start);
-      if (cur) return cur;
-    }
-  });
-
-  var defaultOptions = {
-    rangeFinder: CodeMirror.fold.auto,
-    widget: "\u2194",
-    minFoldSize: 0,
-    scanUp: false,
-    clearOnEnter: true
-  };
-
-  CodeMirror.defineOption("foldOptions", null);
-
-  function getOption(cm, options, name) {
-    if (options && options[name] !== undefined)
-      return options[name];
-    var editorOptions = cm.options.foldOptions;
-    if (editorOptions && editorOptions[name] !== undefined)
-      return editorOptions[name];
-    return defaultOptions[name];
-  }
-
-  CodeMirror.defineExtension("foldOption", function(options, name) {
-    return getOption(this, options, name);
-  });
-});
+'use strict';(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],b):b(CodeMirror)})(function(b){function k(a,c,d,g){function f(d){var b=k(a,c);if(!b||b.to.line-b.from.line<l)return null;for(var f=a.findMarksAt(b.from),e=0;e<f.length;++e)if(f[e].__isFold&&"fold"!==g){if(!d)return null;b.cleared=!0;f[e].clear()}return b}if(d&&d.call){var k=d;d=null}else k=h(a,d,"rangeFinder");"number"==
+typeof c&&(c=b.Pos(c,0));var l=h(a,d,"minFoldSize"),e=f(!0);if(h(a,d,"scanUp"))for(;!e&&c.line>a.firstLine();)c=b.Pos(c.line-1,0),e=f(!1);if(e&&!e.cleared&&"unfold"!==g){var m=p(a,d);b.on(m,"mousedown",function(a){n.clear();b.e_preventDefault(a)});var n=a.markText(e.from,e.to,{replacedWith:m,clearOnEnter:h(a,d,"clearOnEnter"),__isFold:!0});n.on("clear",function(c,d){b.signal(a,"unfold",a,c,d)});b.signal(a,"fold",a,e.from,e.to)}}function p(a,c){a=h(a,c,"widget");"string"==typeof a?(c=document.createTextNode(a),
+a=document.createElement("span"),a.appendChild(c),a.className="CodeMirror-foldmarker"):a&&(a=a.cloneNode(!0));return a}function h(a,c,b){return c&&void 0!==c[b]?c[b]:(a=a.options.foldOptions)&&void 0!==a[b]?a[b]:l[b]}b.newFoldFunction=function(a,c){return function(b,g){k(b,g,{rangeFinder:a,widget:c})}};b.defineExtension("foldCode",function(a,b,d){k(this,a,b,d)});b.defineExtension("isFolded",function(a){a=this.findMarksAt(a);for(var b=0;b<a.length;++b)if(a[b].__isFold)return!0});b.commands.toggleFold=
+function(a){a.foldCode(a.getCursor())};b.commands.fold=function(a){a.foldCode(a.getCursor(),null,"fold")};b.commands.unfold=function(a){a.foldCode(a.getCursor(),null,"unfold")};b.commands.foldAll=function(a){a.operation(function(){for(var c=a.firstLine(),d=a.lastLine();c<=d;c++)a.foldCode(b.Pos(c,0),null,"fold")})};b.commands.unfoldAll=function(a){a.operation(function(){for(var c=a.firstLine(),d=a.lastLine();c<=d;c++)a.foldCode(b.Pos(c,0),null,"unfold")})};b.registerHelper("fold","combine",function(){var a=
+Array.prototype.slice.call(arguments,0);return function(b,d){for(var c=0;c<a.length;++c){var f=a[c](b,d);if(f)return f}}});b.registerHelper("fold","auto",function(a,b){for(var c=a.getHelpers(b,"fold"),g=0;g<c.length;g++){var f=c[g](a,b);if(f)return f}});var l={rangeFinder:b.fold.auto,widget:"\u2194",minFoldSize:0,scanUp:!1,clearOnEnter:!0};b.defineOption("foldOptions",null);b.defineExtension("foldOption",function(a,b){return h(this,a,b)})});
index ad19ae2..7ee0f2a 100644 (file)
@@ -1,20 +1 @@
-.CodeMirror-foldmarker {
-  color: blue;
-  text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
-  font-family: arial;
-  line-height: .3;
-  cursor: pointer;
-}
-.CodeMirror-foldgutter {
-  width: .7em;
-}
-.CodeMirror-foldgutter-open,
-.CodeMirror-foldgutter-folded {
-  cursor: pointer;
-}
-.CodeMirror-foldgutter-open:after {
-  content: "\25BE";
-}
-.CodeMirror-foldgutter-folded:after {
-  content: "\25B8";
-}
+.CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}
\ No newline at end of file
index 9d32326..787e2c3 100644 (file)
@@ -1,146 +1,8 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"), require("./foldcode"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror", "./foldcode"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  CodeMirror.defineOption("foldGutter", false, function(cm, val, old) {
-    if (old && old != CodeMirror.Init) {
-      cm.clearGutter(cm.state.foldGutter.options.gutter);
-      cm.state.foldGutter = null;
-      cm.off("gutterClick", onGutterClick);
-      cm.off("change", onChange);
-      cm.off("viewportChange", onViewportChange);
-      cm.off("fold", onFold);
-      cm.off("unfold", onFold);
-      cm.off("swapDoc", onChange);
-    }
-    if (val) {
-      cm.state.foldGutter = new State(parseOptions(val));
-      updateInViewport(cm);
-      cm.on("gutterClick", onGutterClick);
-      cm.on("change", onChange);
-      cm.on("viewportChange", onViewportChange);
-      cm.on("fold", onFold);
-      cm.on("unfold", onFold);
-      cm.on("swapDoc", onChange);
-    }
-  });
-
-  var Pos = CodeMirror.Pos;
-
-  function State(options) {
-    this.options = options;
-    this.from = this.to = 0;
-  }
-
-  function parseOptions(opts) {
-    if (opts === true) opts = {};
-    if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter";
-    if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open";
-    if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded";
-    return opts;
-  }
-
-  function isFolded(cm, line) {
-    var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0));
-    for (var i = 0; i < marks.length; ++i)
-      if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i];
-  }
-
-  function marker(spec) {
-    if (typeof spec == "string") {
-      var elt = document.createElement("div");
-      elt.className = spec + " CodeMirror-guttermarker-subtle";
-      return elt;
-    } else {
-      return spec.cloneNode(true);
-    }
-  }
-
-  function updateFoldInfo(cm, from, to) {
-    var opts = cm.state.foldGutter.options, cur = from;
-    var minSize = cm.foldOption(opts, "minFoldSize");
-    var func = cm.foldOption(opts, "rangeFinder");
-    cm.eachLine(from, to, function(line) {
-      var mark = null;
-      if (isFolded(cm, cur)) {
-        mark = marker(opts.indicatorFolded);
-      } else {
-        var pos = Pos(cur, 0);
-        var range = func && func(cm, pos);
-        if (range && range.to.line - range.from.line >= minSize)
-          mark = marker(opts.indicatorOpen);
-      }
-      cm.setGutterMarker(line, opts.gutter, mark);
-      ++cur;
-    });
-  }
-
-  function updateInViewport(cm) {
-    var vp = cm.getViewport(), state = cm.state.foldGutter;
-    if (!state) return;
-    cm.operation(function() {
-      updateFoldInfo(cm, vp.from, vp.to);
-    });
-    state.from = vp.from; state.to = vp.to;
-  }
-
-  function onGutterClick(cm, line, gutter) {
-    var state = cm.state.foldGutter;
-    if (!state) return;
-    var opts = state.options;
-    if (gutter != opts.gutter) return;
-    var folded = isFolded(cm, line);
-    if (folded) folded.clear();
-    else cm.foldCode(Pos(line, 0), opts.rangeFinder);
-  }
-
-  function onChange(cm) {
-    var state = cm.state.foldGutter;
-    if (!state) return;
-    var opts = state.options;
-    state.from = state.to = 0;
-    clearTimeout(state.changeUpdate);
-    state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600);
-  }
-
-  function onViewportChange(cm) {
-    var state = cm.state.foldGutter;
-    if (!state) return;
-    var opts = state.options;
-    clearTimeout(state.changeUpdate);
-    state.changeUpdate = setTimeout(function() {
-      var vp = cm.getViewport();
-      if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
-        updateInViewport(cm);
-      } else {
-        cm.operation(function() {
-          if (vp.from < state.from) {
-            updateFoldInfo(cm, vp.from, state.from);
-            state.from = vp.from;
-          }
-          if (vp.to > state.to) {
-            updateFoldInfo(cm, state.to, vp.to);
-            state.to = vp.to;
-          }
-        });
-      }
-    }, opts.updateViewportTimeSpan || 400);
-  }
-
-  function onFold(cm, from) {
-    var state = cm.state.foldGutter;
-    if (!state) return;
-    var line = from.line;
-    if (line >= state.from && line < state.to)
-      updateFoldInfo(cm, line, line + 1);
-  }
-});
+'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,f,d){a instanceof String&&(a=String(a));for(var g=a.length,e=0;e<g;e++){var k=a[e];if(f.call(d,k,e,a))return{i:e,v:k}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,f,d){a!=Array.prototype&&a!=Object.prototype&&(a[f]=d.value)};
+$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,f,d,g){if(f){d=$jscomp.global;a=a.split(".");for(g=0;g<a.length-1;g++){var e=a[g];e in d||(d[e]={});d=d[e]}a=a[a.length-1];g=d[a];f=f(g);f!=g&&null!=f&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:f})}};
+$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,d){return $jscomp.findInternal(this,a,d).v}},"es6-impl","es3");
+(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],a):a(CodeMirror)})(function(a){function f(b){this.options=b;this.from=this.to=0}function d(b,c){b=b.findMarks(m(c,0),m(c+1,0));for(var a=0;a<b.length;++a)if(b[a].__isFold&&b[a].find().from.line==c)return b[a]}function g(b){if("string"==typeof b){var c=document.createElement("div");c.className=b+" CodeMirror-guttermarker-subtle";
+return c}return b.cloneNode(!0)}function e(b,c,a){var l=b.state.foldGutter.options,e=c,f=b.foldOption(l,"minFoldSize"),k=b.foldOption(l,"rangeFinder");b.eachLine(c,a,function(c){var a=null;if(d(b,e))a=g(l.indicatorFolded);else{var h=m(e,0);(h=k&&k(b,h))&&h.to.line-h.from.line>=f&&(a=g(l.indicatorOpen))}b.setGutterMarker(c,l.gutter,a);++e})}function k(b){var c=b.getViewport(),a=b.state.foldGutter;a&&(b.operation(function(){e(b,c.from,c.to)}),a.from=c.from,a.to=c.to)}function q(b,c,a){var h=b.state.foldGutter;
+h&&(h=h.options,a==h.gutter&&((a=d(b,c))?a.clear():b.foldCode(m(c,0),h.rangeFinder)))}function n(b){var c=b.state.foldGutter;if(c){var a=c.options;c.from=c.to=0;clearTimeout(c.changeUpdate);c.changeUpdate=setTimeout(function(){k(b)},a.foldOnChangeTimeSpan||600)}}function r(b){var a=b.state.foldGutter;if(a){var d=a.options;clearTimeout(a.changeUpdate);a.changeUpdate=setTimeout(function(){var c=b.getViewport();a.from==a.to||20<c.from-a.to||20<a.from-c.to?k(b):b.operation(function(){c.from<a.from&&(e(b,
+c.from,a.from),a.from=c.from);c.to>a.to&&(e(b,a.to,c.to),a.to=c.to)})},d.updateViewportTimeSpan||400)}}function p(a,c){var b=a.state.foldGutter;b&&(c=c.line,c>=b.from&&c<b.to&&e(a,c,c+1))}a.defineOption("foldGutter",!1,function(b,c,d){d&&d!=a.Init&&(b.clearGutter(b.state.foldGutter.options.gutter),b.state.foldGutter=null,b.off("gutterClick",q),b.off("change",n),b.off("viewportChange",r),b.off("fold",p),b.off("unfold",p),b.off("swapDoc",n));c&&(d=b.state,!0===c&&(c={}),null==c.gutter&&(c.gutter="CodeMirror-foldgutter"),
+null==c.indicatorOpen&&(c.indicatorOpen="CodeMirror-foldgutter-open"),null==c.indicatorFolded&&(c.indicatorFolded="CodeMirror-foldgutter-folded"),d.foldGutter=new f(c),k(b),b.on("gutterClick",q),b.on("change",n),b.on("viewportChange",r),b.on("fold",p),b.on("unfold",p),b.on("swapDoc",n))});var m=a.Pos});
index f93edec..f5237be 100644 (file)
@@ -1,48 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-function lineIndent(cm, lineNo) {
-  var text = cm.getLine(lineNo)
-  var spaceTo = text.search(/\S/)
-  if (spaceTo == -1 || /\bcomment\b/.test(cm.getTokenTypeAt(CodeMirror.Pos(lineNo, spaceTo + 1))))
-    return -1
-  return CodeMirror.countColumn(text, null, cm.getOption("tabSize"))
-}
-
-CodeMirror.registerHelper("fold", "indent", function(cm, start) {
-  var myIndent = lineIndent(cm, start.line)
-  if (myIndent < 0) return
-  var lastLineInFold = null
-
-  // Go through lines until we find a line that definitely doesn't belong in
-  // the block we're folding, or to the end.
-  for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) {
-    var indent = lineIndent(cm, i)
-    if (indent == -1) {
-    } else if (indent > myIndent) {
-      // Lines with a greater indent are considered part of the block.
-      lastLineInFold = i;
-    } else {
-      // If this line has non-space, non-comment content, and is
-      // indented less or equal to the start line, it is the start of
-      // another block.
-      break;
-    }
-  }
-  if (lastLineInFold) return {
-    from: CodeMirror.Pos(start.line, cm.getLine(start.line).length),
-    to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length)
-  };
-});
-
-});
+'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){function g(b,c){var e=b.getLine(c),d=e.search(/\S/);return-1==d||/\bcomment\b/.test(b.getTokenTypeAt(a.Pos(c,d+1)))?-1:a.countColumn(e,null,b.getOption("tabSize"))}a.registerHelper("fold","indent",function(b,c){var e=g(b,c.line);if(!(0>e)){for(var d=null,f=c.line+1,k=b.lastLine();f<=k;++f){var h=
+g(b,f);if(-1!=h)if(h>e)d=f;else break}if(d)return{from:a.Pos(c.line,b.getLine(c.line).length),to:a.Pos(d,b.getLine(d).length)}}})});
index ce84c94..5e7b712 100644 (file)
@@ -1,49 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.registerHelper("fold", "markdown", function(cm, start) {
-  var maxDepth = 100;
-
-  function isHeader(lineNo) {
-    var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0));
-    return tokentype && /\bheader\b/.test(tokentype);
-  }
-
-  function headerLevel(lineNo, line, nextLine) {
-    var match = line && line.match(/^#+/);
-    if (match && isHeader(lineNo)) return match[0].length;
-    match = nextLine && nextLine.match(/^[=\-]+\s*$/);
-    if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2;
-    return maxDepth;
-  }
-
-  var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1);
-  var level = headerLevel(start.line, firstLine, nextLine);
-  if (level === maxDepth) return undefined;
-
-  var lastLineNo = cm.lastLine();
-  var end = start.line, nextNextLine = cm.getLine(end + 2);
-  while (end < lastLineNo) {
-    if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break;
-    ++end;
-    nextLine = nextNextLine;
-    nextNextLine = cm.getLine(end + 2);
-  }
-
-  return {
-    from: CodeMirror.Pos(start.line, firstLine.length),
-    to: CodeMirror.Pos(end, cm.getLine(end).length)
-  };
-});
-
-});
+'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.registerHelper("fold","markdown",function(c,d){function g(b){return(b=c.getTokenTypeAt(a.Pos(b,0)))&&/\bheader\b/.test(b)}function h(b,a,c){return(a=a&&a.match(/^#+/))&&g(b)?a[0].length:(a=c&&c.match(/^[=\-]+\s*$/))&&g(b+1)?"="==c[0]?1:2:100}var k=c.getLine(d.line),e=c.getLine(d.line+1),
+l=h(d.line,k,e);if(100!==l){for(var m=c.lastLine(),b=d.line,f=c.getLine(b+2);b<m&&!(h(b+1,e,f)<=l);)++b,e=f,f=c.getLine(b+2);return{from:a.Pos(d.line,k.length),to:a.Pos(b,c.getLine(b).length)}}})});
index 08e2149..57153f6 100644 (file)
@@ -1,182 +1,7 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var Pos = CodeMirror.Pos;
-  function cmp(a, b) { return a.line - b.line || a.ch - b.ch; }
-
-  var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
-  var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
-  var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g");
-
-  function Iter(cm, line, ch, range) {
-    this.line = line; this.ch = ch;
-    this.cm = cm; this.text = cm.getLine(line);
-    this.min = range ? Math.max(range.from, cm.firstLine()) : cm.firstLine();
-    this.max = range ? Math.min(range.to - 1, cm.lastLine()) : cm.lastLine();
-  }
-
-  function tagAt(iter, ch) {
-    var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch));
-    return type && /\btag\b/.test(type);
-  }
-
-  function nextLine(iter) {
-    if (iter.line >= iter.max) return;
-    iter.ch = 0;
-    iter.text = iter.cm.getLine(++iter.line);
-    return true;
-  }
-  function prevLine(iter) {
-    if (iter.line <= iter.min) return;
-    iter.text = iter.cm.getLine(--iter.line);
-    iter.ch = iter.text.length;
-    return true;
-  }
-
-  function toTagEnd(iter) {
-    for (;;) {
-      var gt = iter.text.indexOf(">", iter.ch);
-      if (gt == -1) { if (nextLine(iter)) continue; else return; }
-      if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; }
-      var lastSlash = iter.text.lastIndexOf("/", gt);
-      var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
-      iter.ch = gt + 1;
-      return selfClose ? "selfClose" : "regular";
-    }
-  }
-  function toTagStart(iter) {
-    for (;;) {
-      var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1;
-      if (lt == -1) { if (prevLine(iter)) continue; else return; }
-      if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; }
-      xmlTagStart.lastIndex = lt;
-      iter.ch = lt;
-      var match = xmlTagStart.exec(iter.text);
-      if (match && match.index == lt) return match;
-    }
-  }
-
-  function toNextTag(iter) {
-    for (;;) {
-      xmlTagStart.lastIndex = iter.ch;
-      var found = xmlTagStart.exec(iter.text);
-      if (!found) { if (nextLine(iter)) continue; else return; }
-      if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; }
-      iter.ch = found.index + found[0].length;
-      return found;
-    }
-  }
-  function toPrevTag(iter) {
-    for (;;) {
-      var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1;
-      if (gt == -1) { if (prevLine(iter)) continue; else return; }
-      if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; }
-      var lastSlash = iter.text.lastIndexOf("/", gt);
-      var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
-      iter.ch = gt + 1;
-      return selfClose ? "selfClose" : "regular";
-    }
-  }
-
-  function findMatchingClose(iter, tag) {
-    var stack = [];
-    for (;;) {
-      var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0);
-      if (!next || !(end = toTagEnd(iter))) return;
-      if (end == "selfClose") continue;
-      if (next[1]) { // closing tag
-        for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) {
-          stack.length = i;
-          break;
-        }
-        if (i < 0 && (!tag || tag == next[2])) return {
-          tag: next[2],
-          from: Pos(startLine, startCh),
-          to: Pos(iter.line, iter.ch)
-        };
-      } else { // opening tag
-        stack.push(next[2]);
-      }
-    }
-  }
-  function findMatchingOpen(iter, tag) {
-    var stack = [];
-    for (;;) {
-      var prev = toPrevTag(iter);
-      if (!prev) return;
-      if (prev == "selfClose") { toTagStart(iter); continue; }
-      var endLine = iter.line, endCh = iter.ch;
-      var start = toTagStart(iter);
-      if (!start) return;
-      if (start[1]) { // closing tag
-        stack.push(start[2]);
-      } else { // opening tag
-        for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) {
-          stack.length = i;
-          break;
-        }
-        if (i < 0 && (!tag || tag == start[2])) return {
-          tag: start[2],
-          from: Pos(iter.line, iter.ch),
-          to: Pos(endLine, endCh)
-        };
-      }
-    }
-  }
-
-  CodeMirror.registerHelper("fold", "xml", function(cm, start) {
-    var iter = new Iter(cm, start.line, 0);
-    for (;;) {
-      var openTag = toNextTag(iter), end;
-      if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return;
-      if (!openTag[1] && end != "selfClose") {
-        var startPos = Pos(iter.line, iter.ch);
-        var endPos = findMatchingClose(iter, openTag[2]);
-        return endPos && {from: startPos, to: endPos.from};
-      }
-    }
-  });
-  CodeMirror.findMatchingTag = function(cm, pos, range) {
-    var iter = new Iter(cm, pos.line, pos.ch, range);
-    if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return;
-    var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch);
-    var start = end && toTagStart(iter);
-    if (!end || !start || cmp(iter, pos) > 0) return;
-    var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]};
-    if (end == "selfClose") return {open: here, close: null, at: "open"};
-
-    if (start[1]) { // closing tag
-      return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"};
-    } else { // opening tag
-      iter = new Iter(cm, to.line, to.ch, range);
-      return {open: here, close: findMatchingClose(iter, start[2]), at: "open"};
-    }
-  };
-
-  CodeMirror.findEnclosingTag = function(cm, pos, range, tag) {
-    var iter = new Iter(cm, pos.line, pos.ch, range);
-    for (;;) {
-      var open = findMatchingOpen(iter, tag);
-      if (!open) break;
-      var forward = new Iter(cm, pos.line, pos.ch, range);
-      var close = findMatchingClose(forward, open.tag);
-      if (close) return {open: open, close: close};
-    }
-  };
-
-  // Used by addon/edit/closetag.js
-  CodeMirror.scanForClosingTag = function(cm, pos, name, end) {
-    var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null);
-    return findMatchingClose(iter, name);
-  };
-});
+'use strict';(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function l(a,b,d,c){this.line=b;this.ch=d;this.cm=a;this.text=a.getLine(b);this.min=c?Math.max(c.from,a.firstLine()):a.firstLine();this.max=c?Math.min(c.to-1,a.lastLine()):a.lastLine()}function m(a,b){return(a=a.cm.getTokenTypeAt(k(a.line,b)))&&/\btag\b/.test(a)}function t(a){if(!(a.line>=
+a.max))return a.ch=0,a.text=a.cm.getLine(++a.line),!0}function u(a){if(!(a.line<=a.min))return a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0}function q(a){for(;;){var b=a.text.indexOf(">",a.ch);if(-1==b)if(t(a))continue;else break;if(m(a,b+1)){var d=a.text.lastIndexOf("/",b),d=-1<d&&!/\S/.test(a.text.slice(d+1,b));a.ch=b+1;return d?"selfClose":"regular"}a.ch=b+1}}function r(a){for(;;){var b=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(-1==b)if(u(a))continue;else break;if(m(a,b+1)){n.lastIndex=
+b;a.ch=b;var d=n.exec(a.text);if(d&&d.index==b)return d}else a.ch=b}}function v(a){for(;;){n.lastIndex=a.ch;var b=n.exec(a.text);if(!b)if(t(a))continue;else break;if(m(a,b.index+1))return a.ch=b.index+b[0].length,b;a.ch=b.index+1}}function p(a,b){for(var d=[];;){var c=v(a),f,e=a.line,g=a.ch-(c?c[0].length:0);if(!c||!(f=q(a)))break;if("selfClose"!=f)if(c[1]){for(var h=d.length-1;0<=h;--h)if(d[h]==c[2]){d.length=h;break}if(0>h&&(!b||b==c[2]))return{tag:c[2],from:k(e,g),to:k(a.line,a.ch)}}else d.push(c[2])}}
+function w(a,b){for(var d=[];;){var c;a:for(c=a;;){var f=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(-1==f)if(u(c))continue;else{c=void 0;break a}if(m(c,f+1)){var e=c.text.lastIndexOf("/",f),e=-1<e&&!/\S/.test(c.text.slice(e+1,f));c.ch=f+1;c=e?"selfClose":"regular";break a}else c.ch=f}if(!c)break;if("selfClose"==c)r(a);else{c=a.line;f=a.ch;e=r(a);if(!e)break;if(e[1])d.push(e[2]);else{for(var g=d.length-1;0<=g;--g)if(d[g]==e[2]){d.length=g;break}if(0>g&&(!b||b==e[2]))return{tag:e[2],from:k(a.line,a.ch),
+to:k(c,f)}}}}}var k=h.Pos,n=/<(\/?)([A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD-:.0-9\u00B7\u0300-\u036F\u203F-\u2040]*)/g;h.registerHelper("fold","xml",function(a,b){for(a=new l(a,b.line,0);;){var d=v(a),c;if(!d||a.line!=b.line||!(c=q(a)))break;
+if(!d[1]&&"selfClose"!=c)return b=k(a.line,a.ch),(a=p(a,d[2]))&&{from:b,to:a.from}}});h.findMatchingTag=function(a,b,d){var c=new l(a,b.line,b.ch,d);if(-1!=c.text.indexOf(">")||-1!=c.text.indexOf("<")){var f=q(c),e=f&&k(c.line,c.ch),g=f&&r(c);if(f&&g&&!(0<(c.line-b.line||c.ch-b.ch))){b={from:k(c.line,c.ch),to:e,tag:g[2]};if("selfClose"==f)return{open:b,close:null,at:"open"};if(g[1])return{open:w(c,g[2]),close:b,at:"close"};c=new l(a,e.line,e.ch,d);return{open:b,close:p(c,g[2]),at:"open"}}}};h.findEnclosingTag=
+function(a,b,d,c){for(var f=new l(a,b.line,b.ch,d);;){var e=w(f,c);if(!e)break;var g=new l(a,b.line,b.ch,d);if(g=p(g,e.tag))return{open:e,close:g}}};h.scanForClosingTag=function(a,b,d,c){a=new l(a,b.line,b.ch,c?{from:0,to:c}:null);return p(a,d)}});
index dae78e2..90615ed 100644 (file)
@@ -1,41 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var WORD = /[\w$]+/, RANGE = 500;
-
-  CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
-    var word = options && options.word || WORD;
-    var range = options && options.range || RANGE;
-    var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
-    var end = cur.ch, start = end;
-    while (start && word.test(curLine.charAt(start - 1))) --start;
-    var curWord = start != end && curLine.slice(start, end);
-
-    var list = options && options.list || [], seen = {};
-    var re = new RegExp(word.source, "g");
-    for (var dir = -1; dir <= 1; dir += 2) {
-      var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
-      for (; line != endLine; line += dir) {
-        var text = editor.getLine(line), m;
-        while (m = re.exec(text)) {
-          if (line == cur.line && m[0] === curWord) continue;
-          if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) {
-            seen[m[0]] = true;
-            list.push(m[0]);
-          }
-        }
-      }
-    }
-    return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};
-  });
-});
+'use strict';(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],b):b(CodeMirror)})(function(b){var p=/[\w$]+/;b.registerHelper("hint","anyword",function(g,a){for(var l=a&&a.word||p,q=a&&a.range||500,c=g.getCursor(),d=g.getLine(c.line),m=c.ch,e=m;e&&l.test(d.charAt(e-1));)--e;d=e!=m&&d.slice(e,m);a=a&&a.list||[];for(var n={},l=new RegExp(l.source,"g"),h=-1;1>=h;h+=2)for(var k=c.line,
+r=Math.min(Math.max(k+h*q,g.firstLine()),g.lastLine())+h;k!=r;k+=h)for(var t=g.getLine(k),f;f=l.exec(t);)k==c.line&&f[0]===d||d&&0!=f[0].lastIndexOf(d,0)||Object.prototype.hasOwnProperty.call(n,f[0])||(n[f[0]]=!0,a.push(f[0]));return{list:a,from:b.Pos(c.line,e),to:b.Pos(c.line,m)}})});
index 2264272..1a65c99 100644 (file)
@@ -1,60 +1,3 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"), require("../../mode/css/css"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror", "../../mode/css/css"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var pseudoClasses = {link: 1, visited: 1, active: 1, hover: 1, focus: 1,
-                       "first-letter": 1, "first-line": 1, "first-child": 1,
-                       before: 1, after: 1, lang: 1};
-
-  CodeMirror.registerHelper("hint", "css", function(cm) {
-    var cur = cm.getCursor(), token = cm.getTokenAt(cur);
-    var inner = CodeMirror.innerMode(cm.getMode(), token.state);
-    if (inner.mode.name != "css") return;
-
-    if (token.type == "keyword" && "!important".indexOf(token.string) == 0)
-      return {list: ["!important"], from: CodeMirror.Pos(cur.line, token.start),
-              to: CodeMirror.Pos(cur.line, token.end)};
-
-    var start = token.start, end = cur.ch, word = token.string.slice(0, end - start);
-    if (/[^\w$_-]/.test(word)) {
-      word = ""; start = end = cur.ch;
-    }
-
-    var spec = CodeMirror.resolveMode("text/css");
-
-    var result = [];
-    function add(keywords) {
-      for (var name in keywords)
-        if (!word || name.lastIndexOf(word, 0) == 0)
-          result.push(name);
-    }
-
-    var st = inner.state.state;
-    if (st == "pseudo" || token.type == "variable-3") {
-      add(pseudoClasses);
-    } else if (st == "block" || st == "maybeprop") {
-      add(spec.propertyKeywords);
-    } else if (st == "prop" || st == "parens" || st == "at" || st == "params") {
-      add(spec.valueKeywords);
-      add(spec.colorKeywords);
-    } else if (st == "media" || st == "media_parens") {
-      add(spec.mediaTypes);
-      add(spec.mediaFeatures);
-    }
-
-    if (result.length) return {
-      list: result,
-      from: CodeMirror.Pos(cur.line, start),
-      to: CodeMirror.Pos(cur.line, end)
-    };
-  });
-});
+'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],a):a(CodeMirror)})(function(a){var m={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};a.registerHelper("hint","css",function(d){function f(b){for(var a in b)h&&0!=a.lastIndexOf(h,0)||k.push(a)}var e=d.getCursor(),
+c=d.getTokenAt(e),b=a.innerMode(d.getMode(),c.state);if("css"==b.mode.name){if("keyword"==c.type&&0=="!important".indexOf(c.string))return{list:["!important"],from:a.Pos(e.line,c.start),to:a.Pos(e.line,c.end)};d=c.start;var l=e.ch,h=c.string.slice(0,l-d);/[^\w$_-]/.test(h)&&(h="",d=l=e.ch);var g=a.resolveMode("text/css"),k=[],b=b.state.state;if("pseudo"==b||"variable-3"==c.type)f(m);else if("block"==b||"maybeprop"==b)f(g.propertyKeywords);else if("prop"==b||"parens"==b||"at"==b||"params"==b)f(g.valueKeywords),
+f(g.colorKeywords);else if("media"==b||"media_parens"==b)f(g.mediaTypes),f(g.mediaFeatures);if(k.length)return{list:k,from:a.Pos(e.line,d),to:a.Pos(e.line,l)}}})});
index c6769bc..a13cf7f 100644 (file)
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"), require("./xml-hint"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror", "./xml-hint"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var langs = "ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" ");
-  var targets = ["_blank", "_self", "_top", "_parent"];
-  var charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
-  var methods = ["get", "post", "put", "delete"];
-  var encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
-  var media = ["all", "screen", "print", "embossed", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "speech",
-               "3d-glasses", "resolution [>][<][=] [X]", "device-aspect-ratio: X/Y", "orientation:portrait",
-               "orientation:landscape", "device-height: [X]", "device-width: [X]"];
-  var s = { attrs: {} }; // Simple tag, reused for a whole lot of tags
-
-  var data = {
-    a: {
-      attrs: {
-        href: null, ping: null, type: null,
-        media: media,
-        target: targets,
-        hreflang: langs
-      }
-    },
-    abbr: s,
-    acronym: s,
-    address: s,
-    applet: s,
-    area: {
-      attrs: {
-        alt: null, coords: null, href: null, target: null, ping: null,
-        media: media, hreflang: langs, type: null,
-        shape: ["default", "rect", "circle", "poly"]
-      }
-    },
-    article: s,
-    aside: s,
-    audio: {
-      attrs: {
-        src: null, mediagroup: null,
-        crossorigin: ["anonymous", "use-credentials"],
-        preload: ["none", "metadata", "auto"],
-        autoplay: ["", "autoplay"],
-        loop: ["", "loop"],
-        controls: ["", "controls"]
-      }
-    },
-    b: s,
-    base: { attrs: { href: null, target: targets } },
-    basefont: s,
-    bdi: s,
-    bdo: s,
-    big: s,
-    blockquote: { attrs: { cite: null } },
-    body: s,
-    br: s,
-    button: {
-      attrs: {
-        form: null, formaction: null, name: null, value: null,
-        autofocus: ["", "autofocus"],
-        disabled: ["", "autofocus"],
-        formenctype: encs,
-        formmethod: methods,
-        formnovalidate: ["", "novalidate"],
-        formtarget: targets,
-        type: ["submit", "reset", "button"]
-      }
-    },
-    canvas: { attrs: { width: null, height: null } },
-    caption: s,
-    center: s,
-    cite: s,
-    code: s,
-    col: { attrs: { span: null } },
-    colgroup: { attrs: { span: null } },
-    command: {
-      attrs: {
-        type: ["command", "checkbox", "radio"],
-        label: null, icon: null, radiogroup: null, command: null, title: null,
-        disabled: ["", "disabled"],
-        checked: ["", "checked"]
-      }
-    },
-    data: { attrs: { value: null } },
-    datagrid: { attrs: { disabled: ["", "disabled"], multiple: ["", "multiple"] } },
-    datalist: { attrs: { data: null } },
-    dd: s,
-    del: { attrs: { cite: null, datetime: null } },
-    details: { attrs: { open: ["", "open"] } },
-    dfn: s,
-    dir: s,
-    div: s,
-    dl: s,
-    dt: s,
-    em: s,
-    embed: { attrs: { src: null, type: null, width: null, height: null } },
-    eventsource: { attrs: { src: null } },
-    fieldset: { attrs: { disabled: ["", "disabled"], form: null, name: null } },
-    figcaption: s,
-    figure: s,
-    font: s,
-    footer: s,
-    form: {
-      attrs: {
-        action: null, name: null,
-        "accept-charset": charsets,
-        autocomplete: ["on", "off"],
-        enctype: encs,
-        method: methods,
-        novalidate: ["", "novalidate"],
-        target: targets
-      }
-    },
-    frame: s,
-    frameset: s,
-    h1: s, h2: s, h3: s, h4: s, h5: s, h6: s,
-    head: {
-      attrs: {},
-      children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
-    },
-    header: s,
-    hgroup: s,
-    hr: s,
-    html: {
-      attrs: { manifest: null },
-      children: ["head", "body"]
-    },
-    i: s,
-    iframe: {
-      attrs: {
-        src: null, srcdoc: null, name: null, width: null, height: null,
-        sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
-        seamless: ["", "seamless"]
-      }
-    },
-    img: {
-      attrs: {
-        alt: null, src: null, ismap: null, usemap: null, width: null, height: null,
-        crossorigin: ["anonymous", "use-credentials"]
-      }
-    },
-    input: {
-      attrs: {
-        alt: null, dirname: null, form: null, formaction: null,
-        height: null, list: null, max: null, maxlength: null, min: null,
-        name: null, pattern: null, placeholder: null, size: null, src: null,
-        step: null, value: null, width: null,
-        accept: ["audio/*", "video/*", "image/*"],
-        autocomplete: ["on", "off"],
-        autofocus: ["", "autofocus"],
-        checked: ["", "checked"],
-        disabled: ["", "disabled"],
-        formenctype: encs,
-        formmethod: methods,
-        formnovalidate: ["", "novalidate"],
-        formtarget: targets,
-        multiple: ["", "multiple"],
-        readonly: ["", "readonly"],
-        required: ["", "required"],
-        type: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month",
-               "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio",
-               "file", "submit", "image", "reset", "button"]
-      }
-    },
-    ins: { attrs: { cite: null, datetime: null } },
-    kbd: s,
-    keygen: {
-      attrs: {
-        challenge: null, form: null, name: null,
-        autofocus: ["", "autofocus"],
-        disabled: ["", "disabled"],
-        keytype: ["RSA"]
-      }
-    },
-    label: { attrs: { "for": null, form: null } },
-    legend: s,
-    li: { attrs: { value: null } },
-    link: {
-      attrs: {
-        href: null, type: null,
-        hreflang: langs,
-        media: media,
-        sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
-      }
-    },
-    map: { attrs: { name: null } },
-    mark: s,
-    menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
-    meta: {
-      attrs: {
-        content: null,
-        charset: charsets,
-        name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
-        "http-equiv": ["content-language", "content-type", "default-style", "refresh"]
-      }
-    },
-    meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
-    nav: s,
-    noframes: s,
-    noscript: s,
-    object: {
-      attrs: {
-        data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,
-        typemustmatch: ["", "typemustmatch"]
-      }
-    },
-    ol: { attrs: { reversed: ["", "reversed"], start: null, type: ["1", "a", "A", "i", "I"] } },
-    optgroup: { attrs: { disabled: ["", "disabled"], label: null } },
-    option: { attrs: { disabled: ["", "disabled"], label: null, selected: ["", "selected"], value: null } },
-    output: { attrs: { "for": null, form: null, name: null } },
-    p: s,
-    param: { attrs: { name: null, value: null } },
-    pre: s,
-    progress: { attrs: { value: null, max: null } },
-    q: { attrs: { cite: null } },
-    rp: s,
-    rt: s,
-    ruby: s,
-    s: s,
-    samp: s,
-    script: {
-      attrs: {
-        type: ["text/javascript"],
-        src: null,
-        async: ["", "async"],
-        defer: ["", "defer"],
-        charset: charsets
-      }
-    },
-    section: s,
-    select: {
-      attrs: {
-        form: null, name: null, size: null,
-        autofocus: ["", "autofocus"],
-        disabled: ["", "disabled"],
-        multiple: ["", "multiple"]
-      }
-    },
-    small: s,
-    source: { attrs: { src: null, type: null, media: null } },
-    span: s,
-    strike: s,
-    strong: s,
-    style: {
-      attrs: {
-        type: ["text/css"],
-        media: media,
-        scoped: null
-      }
-    },
-    sub: s,
-    summary: s,
-    sup: s,
-    table: s,
-    tbody: s,
-    td: { attrs: { colspan: null, rowspan: null, headers: null } },
-    textarea: {
-      attrs: {
-        dirname: null, form: null, maxlength: null, name: null, placeholder: null,
-        rows: null, cols: null,
-        autofocus: ["", "autofocus"],
-        disabled: ["", "disabled"],
-        readonly: ["", "readonly"],
-        required: ["", "required"],
-        wrap: ["soft", "hard"]
-      }
-    },
-    tfoot: s,
-    th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
-    thead: s,
-    time: { attrs: { datetime: null } },
-    title: s,
-    tr: s,
-    track: {
-      attrs: {
-        src: null, label: null, "default": null,
-        kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
-        srclang: langs
-      }
-    },
-    tt: s,
-    u: s,
-    ul: s,
-    "var": s,
-    video: {
-      attrs: {
-        src: null, poster: null, width: null, height: null,
-        crossorigin: ["anonymous", "use-credentials"],
-        preload: ["auto", "metadata", "none"],
-        autoplay: ["", "autoplay"],
-        mediagroup: ["movie"],
-        muted: ["", "muted"],
-        controls: ["", "controls"]
-      }
-    },
-    wbr: s
-  };
-
-  var globalAttrs = {
-    accesskey: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
-    "class": null,
-    contenteditable: ["true", "false"],
-    contextmenu: null,
-    dir: ["ltr", "rtl", "auto"],
-    draggable: ["true", "false", "auto"],
-    dropzone: ["copy", "move", "link", "string:", "file:"],
-    hidden: ["hidden"],
-    id: null,
-    inert: ["inert"],
-    itemid: null,
-    itemprop: null,
-    itemref: null,
-    itemscope: ["itemscope"],
-    itemtype: null,
-    lang: ["en", "es"],
-    spellcheck: ["true", "false"],
-    style: null,
-    tabindex: ["1", "2", "3", "4", "5", "6", "7", "8", "9"],
-    title: null,
-    translate: ["yes", "no"],
-    onclick: null,
-    rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"]
-  };
-  function populate(obj) {
-    for (var attr in globalAttrs) if (globalAttrs.hasOwnProperty(attr))
-      obj.attrs[attr] = globalAttrs[attr];
-  }
-
-  populate(s);
-  for (var tag in data) if (data.hasOwnProperty(tag) && data[tag] != s)
-    populate(data[tag]);
-
-  CodeMirror.htmlSchema = data;
-  function htmlHint(cm, options) {
-    var local = {schemaInfo: data};
-    if (options) for (var opt in options) local[opt] = options[opt];
-    return CodeMirror.hint.xml(cm, local);
-  }
-  CodeMirror.registerHelper("hint", "html", htmlHint);
-});
+'use strict';(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror"),require("./xml-hint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./xml-hint"],b):b(CodeMirror)})(function(b){function n(a){for(var b in g)g.hasOwnProperty(b)&&(a.attrs[b]=g[b])}var d="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),
+c=["_blank","_self","_top","_parent"],h=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],l=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],e="all;screen;print;embossed;braille;handheld;print;projection;screen;tty;tv;speech;3d-glasses;resolution [>][<][=] [X];device-aspect-ratio: X/Y;orientation:portrait;orientation:landscape;device-height: [X];device-width: [X]".split(";"),a={attrs:{}},f={a:{attrs:{href:null,ping:null,type:null,media:e,target:c,
+hreflang:d}},abbr:a,acronym:a,address:a,applet:a,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:e,hreflang:d,type:null,shape:["default","rect","circle","poly"]}},article:a,aside:a,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:a,base:{attrs:{href:null,target:c}},basefont:a,bdi:a,bdo:a,big:a,blockquote:{attrs:{cite:null}},body:a,br:a,
+button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:l,formmethod:k,formnovalidate:["","novalidate"],formtarget:c,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:a,center:a,cite:a,code:a,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},
+data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:a,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:a,dir:a,div:a,dl:a,dt:a,em:a,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:a,figure:a,font:a,footer:a,form:{attrs:{action:null,name:null,"accept-charset":h,autocomplete:["on","off"],
+enctype:l,method:k,novalidate:["","novalidate"],target:c}},frame:a,frameset:a,h1:a,h2:a,h3:a,h4:a,h5:a,h6:a,head:{attrs:{},children:"title base link style meta script noscript command".split(" ")},header:a,hgroup:a,hr:a,html:{attrs:{manifest:null},children:["head","body"]},i:a,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,
+width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:l,formmethod:k,formnovalidate:["","novalidate"],formtarget:c,multiple:["",
+"multiple"],readonly:["","readonly"],required:["","required"],type:"hidden text search tel url email password datetime date month week time datetime-local number range color checkbox radio file submit image reset button".split(" ")}},ins:{attrs:{cite:null,datetime:null}},kbd:a,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{"for":null,form:null}},legend:a,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,
+hreflang:d,media:e,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:a,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:h,name:"viewport application-name author description generator keywords".split(" "),"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:a,noframes:a,noscript:a,object:{attrs:{data:null,type:null,
+name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{"for":null,form:null,name:null}},p:a,param:{attrs:{name:null,value:null}},pre:a,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:a,rt:a,ruby:a,s:a,samp:a,script:{attrs:{type:["text/javascript"],
+src:null,async:["","async"],defer:["","defer"],charset:h}},section:a,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:a,source:{attrs:{src:null,type:null,media:null}},span:a,strike:a,strong:a,style:{attrs:{type:["text/css"],media:e,scoped:null}},sub:a,summary:a,sup:a,table:a,tbody:a,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,
+cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:a,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:a,time:{attrs:{datetime:null}},title:a,tr:a,track:{attrs:{src:null,label:null,"default":null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:d}},tt:a,u:a,ul:a,"var":a,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous",
+"use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:a},g={accesskey:"abcdefghijklmnopqrstuvwxyz0123456789".split(""),"class":null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,
+lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:"123456789".split(""),title:null,translate:["yes","no"],onclick:null,rel:"stylesheet alternate author bookmark help license next nofollow noreferrer prefetch prev search tag".split(" ")};n(a);for(var m in f)f.hasOwnProperty(m)&&f[m]!=a&&n(f[m]);b.htmlSchema=f;b.registerHelper("hint","html",function(a,c){var d={schemaInfo:f};if(c)for(var e in c)d[e]=c[e];return b.hint.xml(a,d)})});
index d7088c1..357a083 100644 (file)
@@ -1,155 +1,6 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  var Pos = CodeMirror.Pos;
-
-  function forEach(arr, f) {
-    for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
-  }
-
-  function arrayContains(arr, item) {
-    if (!Array.prototype.indexOf) {
-      var i = arr.length;
-      while (i--) {
-        if (arr[i] === item) {
-          return true;
-        }
-      }
-      return false;
-    }
-    return arr.indexOf(item) != -1;
-  }
-
-  function scriptHint(editor, keywords, getToken, options) {
-    // Find the token at the cursor
-    var cur = editor.getCursor(), token = getToken(editor, cur);
-    if (/\b(?:string|comment)\b/.test(token.type)) return;
-    token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;
-
-    // If it's not a 'word-style' token, ignore the token.
-    if (!/^[\w$_]*$/.test(token.string)) {
-      token = {start: cur.ch, end: cur.ch, string: "", state: token.state,
-               type: token.string == "." ? "property" : null};
-    } else if (token.end > cur.ch) {
-      token.end = cur.ch;
-      token.string = token.string.slice(0, cur.ch - token.start);
-    }
-
-    var tprop = token;
-    // If it is a property, find out what it is a property of.
-    while (tprop.type == "property") {
-      tprop = getToken(editor, Pos(cur.line, tprop.start));
-      if (tprop.string != ".") return;
-      tprop = getToken(editor, Pos(cur.line, tprop.start));
-      if (!context) var context = [];
-      context.push(tprop);
-    }
-    return {list: getCompletions(token, context, keywords, options),
-            from: Pos(cur.line, token.start),
-            to: Pos(cur.line, token.end)};
-  }
-
-  function javascriptHint(editor, options) {
-    return scriptHint(editor, javascriptKeywords,
-                      function (e, cur) {return e.getTokenAt(cur);},
-                      options);
-  };
-  CodeMirror.registerHelper("hint", "javascript", javascriptHint);
-
-  function getCoffeeScriptToken(editor, cur) {
-  // This getToken, it is for coffeescript, imitates the behavior of
-  // getTokenAt method in javascript.js, that is, returning "property"
-  // type and treat "." as indepenent token.
-    var token = editor.getTokenAt(cur);
-    if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') {
-      token.end = token.start;
-      token.string = '.';
-      token.type = "property";
-    }
-    else if (/^\.[\w$_]*$/.test(token.string)) {
-      token.type = "property";
-      token.start++;
-      token.string = token.string.replace(/\./, '');
-    }
-    return token;
-  }
-
-  function coffeescriptHint(editor, options) {
-    return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options);
-  }
-  CodeMirror.registerHelper("hint", "coffeescript", coffeescriptHint);
-
-  var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " +
-                     "toUpperCase toLowerCase split concat match replace search").split(" ");
-  var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " +
-                    "lastIndexOf every some filter forEach map reduce reduceRight ").split(" ");
-  var funcProps = "prototype apply call bind".split(" ");
-  var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " +
-                  "if in instanceof new null return switch throw true try typeof var void while with").split(" ");
-  var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " +
-                  "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");
-
-  function forAllProps(obj, callback) {
-    if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) {
-      for (var name in obj) callback(name)
-    } else {
-      for (var o = obj; o; o = Object.getPrototypeOf(o))
-        Object.getOwnPropertyNames(o).forEach(callback)
-    }
-  }
-
-  function getCompletions(token, context, keywords, options) {
-    var found = [], start = token.string, global = options && options.globalScope || window;
-    function maybeAdd(str) {
-      if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str);
-    }
-    function gatherCompletions(obj) {
-      if (typeof obj == "string") forEach(stringProps, maybeAdd);
-      else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
-      else if (obj instanceof Function) forEach(funcProps, maybeAdd);
-      forAllProps(obj, maybeAdd)
-    }
-
-    if (context && context.length) {
-      // If this is a property, see if it belongs to some object we can
-      // find in the current environment.
-      var obj = context.pop(), base;
-      if (obj.type && obj.type.indexOf("variable") === 0) {
-        if (options && options.additionalContext)
-          base = options.additionalContext[obj.string];
-        if (!options || options.useGlobalScope !== false)
-          base = base || global[obj.string];
-      } else if (obj.type == "string") {
-        base = "";
-      } else if (obj.type == "atom") {
-        base = 1;
-      } else if (obj.type == "function") {
-        if (global.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
-            (typeof global.jQuery == 'function'))
-          base = global.jQuery();
-        else if (global._ != null && (obj.string == '_') && (typeof global._ == 'function'))
-          base = global._();
-      }
-      while (base != null && context.length)
-        base = base[context.pop().string];
-      if (base != null) gatherCompletions(base);
-    } else {
-      // If not, just look in the global object and any local scope
-      // (reading into JS mode internals to get at the local and global variables)
-      for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
-      for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);
-      if (!options || options.useGlobalScope !== false)
-        gatherCompletions(global);
-      forEach(keywords, maybeAdd);
-    }
-    return found;
-  }
-});
+'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){function m(a,b){for(var k=0,e=a.length;k<e;++k)b(a[k])}function p(a,b,k,e){var f,g=a.getCursor(),c=k(a,g);if(!/\b(?:string|comment)\b/.test(c.type)){c.state=d.innerMode(a.getMode(),c.state).state;/^[\w$_]*$/.test(c.string)?c.end>g.ch&&(c.end=g.ch,c.string=c.string.slice(0,g.ch-c.start)):c=
+{start:g.ch,end:g.ch,string:"",state:c.state,type:"."==c.string?"property":null};for(var l=c;"property"==l.type;){l=k(a,n(g.line,l.start));if("."!=l.string)return;l=k(a,n(g.line,l.start));f||(f=[]);f.push(l)}return{list:q(c,f,b,e),from:n(g.line,c.start),to:n(g.line,c.end)}}}function r(a,b){a=a.getTokenAt(b);b.ch==a.start+1&&"."==a.string.charAt(0)?(a.end=a.start,a.string=".",a.type="property"):/^\.[\w$_]*$/.test(a.string)&&(a.type="property",a.start++,a.string=a.string.replace(/\./,""));return a}
+function q(a,b,k,e){function f(a){var b;if(b=0==a.lastIndexOf(l,0)){a:if(Array.prototype.indexOf)b=-1!=c.indexOf(a);else{for(b=c.length;b--;)if(c[b]===a){b=!0;break a}b=!1}b=!b}b&&c.push(a)}function g(a){"string"==typeof a?m(t,f):a instanceof Array?m(u,f):a instanceof Function&&m(v,f);if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(;a;a=Object.getPrototypeOf(a))Object.getOwnPropertyNames(a).forEach(f);else for(var b in a)f(b)}var c=[],l=a.string,d=e&&e.globalScope||window;if(b&&b.length){a=
+b.pop();var h;a.type&&0===a.type.indexOf("variable")?(e&&e.additionalContext&&(h=e.additionalContext[a.string]),e&&!1===e.useGlobalScope||(h=h||d[a.string])):"string"==a.type?h="":"atom"==a.type?h=1:"function"==a.type&&(null==d.jQuery||"$"!=a.string&&"jQuery"!=a.string||"function"!=typeof d.jQuery?null!=d._&&"_"==a.string&&"function"==typeof d._&&(h=d._()):h=d.jQuery());for(;null!=h&&b.length;)h=h[b.pop().string];null!=h&&g(h)}else{for(b=a.state.localVars;b;b=b.next)f(b.name);for(b=a.state.globalVars;b;b=
+b.next)f(b.name);e&&!1===e.useGlobalScope||g(d);m(k,f)}return c}var n=d.Pos;d.registerHelper("hint","javascript",function(a,b){return p(a,w,function(a,b){return a.getTokenAt(b)},b)});d.registerHelper("hint","coffeescript",function(a,b){return p(a,x,r,b)});var t="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),u="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),
+v=["prototype","apply","call","bind"],w="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),x="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")});
index 5617ccc..311e1c3 100644 (file)
@@ -1,36 +1 @@
-.CodeMirror-hints {
-  position: absolute;
-  z-index: 10;
-  overflow: hidden;
-  list-style: none;
-
-  margin: 0;
-  padding: 2px;
-
-  -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
-  -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
-  box-shadow: 2px 3px 5px rgba(0,0,0,.2);
-  border-radius: 3px;
-  border: 1px solid silver;
-
-  background: white;
-  font-size: 90%;
-  font-family: monospace;
-
-  max-height: 20em;
-  overflow-y: auto;
-}
-
-.CodeMirror-hint {
-  margin: 0;
-  padding: 0 4px;
-  border-radius: 2px;
-  white-space: pre;
-  color: black;
-  cursor: pointer;
-}
-
-li.CodeMirror-hint-active {
-  background: #08f;
-  color: white;
-}
+.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}
\ No newline at end of file
index 604bd3b..7c0d49d 100644 (file)
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var HINT_ELEMENT_CLASS        = "CodeMirror-hint";
-  var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active";
-
-  // This is the old interface, kept around for now to stay
-  // backwards-compatible.
-  CodeMirror.showHint = function(cm, getHints, options) {
-    if (!getHints) return cm.showHint(options);
-    if (options && options.async) getHints.async = true;
-    var newOpts = {hint: getHints};
-    if (options) for (var prop in options) newOpts[prop] = options[prop];
-    return cm.showHint(newOpts);
-  };
-
-  CodeMirror.defineExtension("showHint", function(options) {
-    options = parseOptions(this, this.getCursor("start"), options);
-    var selections = this.listSelections()
-    if (selections.length > 1) return;
-    // By default, don't allow completion when something is selected.
-    // A hint function can have a `supportsSelection` property to
-    // indicate that it can handle selections.
-    if (this.somethingSelected()) {
-      if (!options.hint.supportsSelection) return;
-      // Don't try with cross-line selections
-      for (var i = 0; i < selections.length; i++)
-        if (selections[i].head.line != selections[i].anchor.line) return;
-    }
-
-    if (this.state.completionActive) this.state.completionActive.close();
-    var completion = this.state.completionActive = new Completion(this, options);
-    if (!completion.options.hint) return;
-
-    CodeMirror.signal(this, "startCompletion", this);
-    completion.update(true);
-  });
-
-  function Completion(cm, options) {
-    this.cm = cm;
-    this.options = options;
-    this.widget = null;
-    this.debounce = 0;
-    this.tick = 0;
-    this.startPos = this.cm.getCursor("start");
-    this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;
-
-    var self = this;
-    cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); });
-  }
-
-  var requestAnimationFrame = window.requestAnimationFrame || function(fn) {
-    return setTimeout(fn, 1000/60);
-  };
-  var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
-
-  Completion.prototype = {
-    close: function() {
-      if (!this.active()) return;
-      this.cm.state.completionActive = null;
-      this.tick = null;
-      this.cm.off("cursorActivity", this.activityFunc);
-
-      if (this.widget && this.data) CodeMirror.signal(this.data, "close");
-      if (this.widget) this.widget.close();
-      CodeMirror.signal(this.cm, "endCompletion", this.cm);
-    },
-
-    active: function() {
-      return this.cm.state.completionActive == this;
-    },
-
-    pick: function(data, i) {
-      var completion = data.list[i];
-      if (completion.hint) completion.hint(this.cm, data, completion);
-      else this.cm.replaceRange(getText(completion), completion.from || data.from,
-                                completion.to || data.to, "complete");
-      CodeMirror.signal(data, "pick", completion);
-      this.close();
-    },
-
-    cursorActivity: function() {
-      if (this.debounce) {
-        cancelAnimationFrame(this.debounce);
-        this.debounce = 0;
-      }
-
-      var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);
-      if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||
-          pos.ch < this.startPos.ch || this.cm.somethingSelected() ||
-          (pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {
-        this.close();
-      } else {
-        var self = this;
-        this.debounce = requestAnimationFrame(function() {self.update();});
-        if (this.widget) this.widget.disable();
-      }
-    },
-
-    update: function(first) {
-      if (this.tick == null) return
-      var self = this, myTick = ++this.tick
-      fetchHints(this.options.hint, this.cm, this.options, function(data) {
-        if (self.tick == myTick) self.finishUpdate(data, first)
-      })
-    },
-
-    finishUpdate: function(data, first) {
-      if (this.data) CodeMirror.signal(this.data, "update");
-
-      var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);
-      if (this.widget) this.widget.close();
-
-      if (data && this.data && isNewCompletion(this.data, data)) return;
-      this.data = data;
-
-      if (data && data.list.length) {
-        if (picked && data.list.length == 1) {
-          this.pick(data, 0);
-        } else {
-          this.widget = new Widget(this, data);
-          CodeMirror.signal(data, "shown");
-        }
-      }
-    }
-  };
-
-  function isNewCompletion(old, nw) {
-    var moved = CodeMirror.cmpPos(nw.from, old.from)
-    return moved > 0 && old.to.ch - old.from.ch != nw.to.ch - nw.from.ch
-  }
-
-  function parseOptions(cm, pos, options) {
-    var editor = cm.options.hintOptions;
-    var out = {};
-    for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
-    if (editor) for (var prop in editor)
-      if (editor[prop] !== undefined) out[prop] = editor[prop];
-    if (options) for (var prop in options)
-      if (options[prop] !== undefined) out[prop] = options[prop];
-    if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)
-    return out;
-  }
-
-  function getText(completion) {
-    if (typeof completion == "string") return completion;
-    else return completion.text;
-  }
-
-  function buildKeyMap(completion, handle) {
-    var baseMap = {
-      Up: function() {handle.moveFocus(-1);},
-      Down: function() {handle.moveFocus(1);},
-      PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},
-      PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},
-      Home: function() {handle.setFocus(0);},
-      End: function() {handle.setFocus(handle.length - 1);},
-      Enter: handle.pick,
-      Tab: handle.pick,
-      Esc: handle.close
-    };
-    var custom = completion.options.customKeys;
-    var ourMap = custom ? {} : baseMap;
-    function addBinding(key, val) {
-      var bound;
-      if (typeof val != "string")
-        bound = function(cm) { return val(cm, handle); };
-      // This mechanism is deprecated
-      else if (baseMap.hasOwnProperty(val))
-        bound = baseMap[val];
-      else
-        bound = val;
-      ourMap[key] = bound;
-    }
-    if (custom)
-      for (var key in custom) if (custom.hasOwnProperty(key))
-        addBinding(key, custom[key]);
-    var extra = completion.options.extraKeys;
-    if (extra)
-      for (var key in extra) if (extra.hasOwnProperty(key))
-        addBinding(key, extra[key]);
-    return ourMap;
-  }
-
-  function getHintElement(hintsElement, el) {
-    while (el && el != hintsElement) {
-      if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el;
-      el = el.parentNode;
-    }
-  }
-
-  function Widget(completion, data) {
-    this.completion = completion;
-    this.data = data;
-    this.picked = false;
-    var widget = this, cm = completion.cm;
-
-    var hints = this.hints = document.createElement("ul");
-    hints.className = "CodeMirror-hints";
-    this.selectedHint = data.selectedHint || 0;
-
-    var completions = data.list;
-    for (var i = 0; i < completions.length; ++i) {
-      var elt = hints.appendChild(document.createElement("li")), cur = completions[i];
-      var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
-      if (cur.className != null) className = cur.className + " " + className;
-      elt.className = className;
-      if (cur.render) cur.render(elt, data, cur);
-      else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));
-      elt.hintId = i;
-    }
-
-    var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);
-    var left = pos.left, top = pos.bottom, below = true;
-    hints.style.left = left + "px";
-    hints.style.top = top + "px";
-    // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
-    var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
-    var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
-    (completion.options.container || document.body).appendChild(hints);
-    var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
-    var scrolls = hints.scrollHeight > hints.clientHeight + 1
-    var startScroll = cm.getScrollInfo();
-
-    if (overlapY > 0) {
-      var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
-      if (curTop - height > 0) { // Fits above cursor
-        hints.style.top = (top = pos.top - height) + "px";
-        below = false;
-      } else if (height > winH) {
-        hints.style.height = (winH - 5) + "px";
-        hints.style.top = (top = pos.bottom - box.top) + "px";
-        var cursor = cm.getCursor();
-        if (data.from.ch != cursor.ch) {
-          pos = cm.cursorCoords(cursor);
-          hints.style.left = (left = pos.left) + "px";
-          box = hints.getBoundingClientRect();
-        }
-      }
-    }
-    var overlapX = box.right - winW;
-    if (overlapX > 0) {
-      if (box.right - box.left > winW) {
-        hints.style.width = (winW - 5) + "px";
-        overlapX -= (box.right - box.left) - winW;
-      }
-      hints.style.left = (left = pos.left - overlapX) + "px";
-    }
-    if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)
-      node.style.paddingRight = cm.display.nativeBarWidth + "px"
-
-    cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
-      moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
-      setFocus: function(n) { widget.changeActive(n); },
-      menuSize: function() { return widget.screenAmount(); },
-      length: completions.length,
-      close: function() { completion.close(); },
-      pick: function() { widget.pick(); },
-      data: data
-    }));
-
-    if (completion.options.closeOnUnfocus) {
-      var closingOnBlur;
-      cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });
-      cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); });
-    }
-
-    cm.on("scroll", this.onScroll = function() {
-      var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
-      var newTop = top + startScroll.top - curScroll.top;
-      var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);
-      if (!below) point += hints.offsetHeight;
-      if (point <= editor.top || point >= editor.bottom) return completion.close();
-      hints.style.top = newTop + "px";
-      hints.style.left = (left + startScroll.left - curScroll.left) + "px";
-    });
-
-    CodeMirror.on(hints, "dblclick", function(e) {
-      var t = getHintElement(hints, e.target || e.srcElement);
-      if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}
-    });
-
-    CodeMirror.on(hints, "click", function(e) {
-      var t = getHintElement(hints, e.target || e.srcElement);
-      if (t && t.hintId != null) {
-        widget.changeActive(t.hintId);
-        if (completion.options.completeOnSingleClick) widget.pick();
-      }
-    });
-
-    CodeMirror.on(hints, "mousedown", function() {
-      setTimeout(function(){cm.focus();}, 20);
-    });
-
-    CodeMirror.signal(data, "select", completions[0], hints.firstChild);
-    return true;
-  }
-
-  Widget.prototype = {
-    close: function() {
-      if (this.completion.widget != this) return;
-      this.completion.widget = null;
-      this.hints.parentNode.removeChild(this.hints);
-      this.completion.cm.removeKeyMap(this.keyMap);
-
-      var cm = this.completion.cm;
-      if (this.completion.options.closeOnUnfocus) {
-        cm.off("blur", this.onBlur);
-        cm.off("focus", this.onFocus);
-      }
-      cm.off("scroll", this.onScroll);
-    },
-
-    disable: function() {
-      this.completion.cm.removeKeyMap(this.keyMap);
-      var widget = this;
-      this.keyMap = {Enter: function() { widget.picked = true; }};
-      this.completion.cm.addKeyMap(this.keyMap);
-    },
-
-    pick: function() {
-      this.completion.pick(this.data, this.selectedHint);
-    },
-
-    changeActive: function(i, avoidWrap) {
-      if (i >= this.data.list.length)
-        i = avoidWrap ? this.data.list.length - 1 : 0;
-      else if (i < 0)
-        i = avoidWrap ? 0  : this.data.list.length - 1;
-      if (this.selectedHint == i) return;
-      var node = this.hints.childNodes[this.selectedHint];
-      node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
-      node = this.hints.childNodes[this.selectedHint = i];
-      node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
-      if (node.offsetTop < this.hints.scrollTop)
-        this.hints.scrollTop = node.offsetTop - 3;
-      else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
-        this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;
-      CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
-    },
-
-    screenAmount: function() {
-      return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
-    }
-  };
-
-  function applicableHelpers(cm, helpers) {
-    if (!cm.somethingSelected()) return helpers
-    var result = []
-    for (var i = 0; i < helpers.length; i++)
-      if (helpers[i].supportsSelection) result.push(helpers[i])
-    return result
-  }
-
-  function fetchHints(hint, cm, options, callback) {
-    if (hint.async) {
-      hint(cm, callback, options)
-    } else {
-      var result = hint(cm, options)
-      if (result && result.then) result.then(callback)
-      else callback(result)
-    }
-  }
-
-  function resolveAutoHints(cm, pos) {
-    var helpers = cm.getHelpers(pos, "hint"), words
-    if (helpers.length) {
-      var resolved = function(cm, callback, options) {
-        var app = applicableHelpers(cm, helpers);
-        function run(i) {
-          if (i == app.length) return callback(null)
-          fetchHints(app[i], cm, options, function(result) {
-            if (result && result.list.length > 0) callback(result)
-            else run(i + 1)
-          })
-        }
-        run(0)
-      }
-      resolved.async = true
-      resolved.supportsSelection = true
-      return resolved
-    } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
-      return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }
-    } else if (CodeMirror.hint.anyword) {
-      return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }
-    } else {
-      return function() {}
-    }
-  }
-
-  CodeMirror.registerHelper("hint", "auto", {
-    resolve: resolveAutoHints
-  });
-
-  CodeMirror.registerHelper("hint", "fromList", function(cm, options) {
-    var cur = cm.getCursor(), token = cm.getTokenAt(cur);
-    var to = CodeMirror.Pos(cur.line, token.end);
-    if (token.string && /\w/.test(token.string[token.string.length - 1])) {
-      var term = token.string, from = CodeMirror.Pos(cur.line, token.start);
-    } else {
-      var term = "", from = to;
-    }
-    var found = [];
-    for (var i = 0; i < options.words.length; i++) {
-      var word = options.words[i];
-      if (word.slice(0, term.length) == term)
-        found.push(word);
-    }
-
-    if (found.length) return {list: found, from: from, to: to};
-  });
-
-  CodeMirror.commands.autocomplete = CodeMirror.showHint;
-
-  var defaultOptions = {
-    hint: CodeMirror.hint.auto,
-    completeSingle: true,
-    alignWithWord: true,
-    closeCharacters: /[\s()\[\]{};:>,]/,
-    closeOnUnfocus: true,
-    completeOnSingleClick: true,
-    container: null,
-    customKeys: null,
-    extraKeys: null
-  };
-
-  CodeMirror.defineOption("hintOptions", null);
-});
+'use strict';(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){function n(a,b){this.cm=a;this.options=b;this.widget=null;this.tick=this.debounce=0;this.startPos=this.cm.getCursor("start");this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var c=this;a.on("cursorActivity",this.activityFunc=function(){c.cursorActivity()})}
+function y(a,b){function c(a,d){var c="string"!=typeof d?function(a){return d(a,b)}:e.hasOwnProperty(d)?e[d]:d;f[a]=c}var e={Up:function(){b.moveFocus(-1)},Down:function(){b.moveFocus(1)},PageUp:function(){b.moveFocus(-b.menuSize()+1,!0)},PageDown:function(){b.moveFocus(b.menuSize()-1,!0)},Home:function(){b.setFocus(0)},End:function(){b.setFocus(b.length-1)},Enter:b.pick,Tab:b.pick,Esc:b.close},d=a.options.customKeys,f=d?{}:e;if(d)for(var g in d)d.hasOwnProperty(g)&&c(g,d[g]);if(a=a.options.extraKeys)for(g in a)a.hasOwnProperty(g)&&
+c(g,a[g]);return f}function w(a,b){for(;b&&b!=a;){if("LI"===b.nodeName.toUpperCase()&&b.parentNode==a)return b;b=b.parentNode}}function q(a,b){this.completion=a;this.data=b;this.picked=!1;var c=this,e=a.cm,d=this.hints=document.createElement("ul");d.className="CodeMirror-hints";this.selectedHint=b.selectedHint||0;for(var m=b.list,g=0;g<m.length;++g){var l=d.appendChild(document.createElement("li")),h=m[g],p="CodeMirror-hint"+(g!=this.selectedHint?"":" CodeMirror-hint-active");null!=h.className&&(p=
+h.className+" "+p);l.className=p;h.render?h.render(l,b,h):l.appendChild(document.createTextNode(h.displayText||("string"==typeof h?h:h.text)));l.hintId=g}var g=e.cursorCoords(a.options.alignWithWord?b.from:null),u=g.left,v=g.bottom,n=!0;d.style.left=u+"px";d.style.top=v+"px";var l=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),k=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(a.options.container||document.body).appendChild(d);
+var h=d.getBoundingClientRect(),r=h.bottom-k,p=d.scrollHeight>d.clientHeight+1,q=e.getScrollInfo();0<r&&(r=h.bottom-h.top,0<g.top-(g.bottom-h.top)-r?(d.style.top=(v=g.top-r)+"px",n=!1):r>k&&(d.style.height=k-5+"px",d.style.top=(v=g.bottom-h.top)+"px",k=e.getCursor(),b.from.ch!=k.ch&&(g=e.cursorCoords(k),d.style.left=(u=g.left)+"px",h=d.getBoundingClientRect())));k=h.right-l;0<k&&(h.right-h.left>l&&(d.style.width=l-5+"px",k-=h.right-h.left-l),d.style.left=(u=g.left-k)+"px");if(p)for(g=d.firstChild;g;g=
+g.nextSibling)g.style.paddingRight=e.display.nativeBarWidth+"px";e.addKeyMap(this.keyMap=y(a,{moveFocus:function(a,b){c.changeActive(c.selectedHint+a,b)},setFocus:function(a){c.changeActive(a)},menuSize:function(){return c.screenAmount()},length:m.length,close:function(){a.close()},pick:function(){c.pick()},data:b}));if(a.options.closeOnUnfocus){var t;e.on("blur",this.onBlur=function(){t=setTimeout(function(){a.close()},100)});e.on("focus",this.onFocus=function(){clearTimeout(t)})}e.on("scroll",this.onScroll=
+function(){var b=e.getScrollInfo(),c=e.getWrapperElement().getBoundingClientRect(),g=v+q.top-b.top,f=g-(window.pageYOffset||(document.documentElement||document.body).scrollTop);n||(f+=d.offsetHeight);if(f<=c.top||f>=c.bottom)return a.close();d.style.top=g+"px";d.style.left=u+q.left-b.left+"px"});f.on(d,"dblclick",function(a){(a=w(d,a.target||a.srcElement))&&null!=a.hintId&&(c.changeActive(a.hintId),c.pick())});f.on(d,"click",function(b){(b=w(d,b.target||b.srcElement))&&null!=b.hintId&&(c.changeActive(b.hintId),
+a.options.completeOnSingleClick&&c.pick())});f.on(d,"mousedown",function(){setTimeout(function(){e.focus()},20)});f.signal(b,"select",m[0],d.firstChild);return!0}function z(a,b){if(!a.somethingSelected())return b;a=[];for(var c=0;c<b.length;c++)b[c].supportsSelection&&a.push(b[c]);return a}function t(a,b,c,e){a.async?a(b,e,c):(a=a(b,c))&&a.then?a.then(e):e(a)}f.showHint=function(a,b,c){if(!b)return a.showHint(c);c&&c.async&&(b.async=!0);b={hint:b};if(c)for(var e in c)b[e]=c[e];return a.showHint(b)};
+f.defineExtension("showHint",function(a){var b=this.getCursor("start"),c=this.options.hintOptions,e={},d;for(d in x)e[d]=x[d];if(c)for(d in c)void 0!==c[d]&&(e[d]=c[d]);if(a)for(d in a)void 0!==a[d]&&(e[d]=a[d]);e.hint.resolve&&(e.hint=e.hint.resolve(this,b));a=e;b=this.listSelections();if(!(1<b.length)){if(this.somethingSelected()){if(!a.hint.supportsSelection)return;for(d=0;d<b.length;d++)if(b[d].head.line!=b[d].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();
+b=this.state.completionActive=new n(this,a);b.options.hint&&(f.signal(this,"startCompletion",this),b.update(!0))}});var A=window.requestAnimationFrame||function(a){return setTimeout(a,1E3/60)},B=window.cancelAnimationFrame||clearTimeout;n.prototype={close:function(){this.active()&&(this.tick=this.cm.state.completionActive=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&f.signal(this.data,"close"),this.widget&&this.widget.close(),f.signal(this.cm,"endCompletion",this.cm))},
+active:function(){return this.cm.state.completionActive==this},pick:function(a,b){b=a.list[b];b.hint?b.hint(this.cm,a,b):this.cm.replaceRange("string"==typeof b?b:b.text,b.from||a.from,b.to||a.to,"complete");f.signal(a,"pick",b);this.close()},cursorActivity:function(){this.debounce&&(B(this.debounce),this.debounce=0);var a=this.cm.getCursor(),b=this.cm.getLine(a.line);if(a.line!=this.startPos.line||b.length-a.ch!=this.startLen-this.startPos.ch||a.ch<this.startPos.ch||this.cm.somethingSelected()||
+a.ch&&this.options.closeCharacters.test(b.charAt(a.ch-1)))this.close();else{var c=this;this.debounce=A(function(){c.update()});this.widget&&this.widget.disable()}},update:function(a){if(null!=this.tick){var b=this,c=++this.tick;t(this.options.hint,this.cm,this.options,function(e){b.tick==c&&b.finishUpdate(e,a)})}},finishUpdate:function(a,b){this.data&&f.signal(this.data,"update");b=this.widget&&this.widget.picked||b&&this.options.completeSingle;this.widget&&this.widget.close();var c;if(c=a&&this.data)c=
+this.data,c=0<f.cmpPos(a.from,c.from)&&c.to.ch-c.from.ch!=a.to.ch-a.from.ch;c||(this.data=a)&&a.list.length&&(b&&1==a.list.length?this.pick(a,0):(this.widget=new q(this,a),f.signal(a,"shown")))}};q.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null;this.hints.parentNode.removeChild(this.hints);this.completion.cm.removeKeyMap(this.keyMap);var a=this.completion.cm;this.completion.options.closeOnUnfocus&&(a.off("blur",this.onBlur),a.off("focus",this.onFocus));a.off("scroll",
+this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var a=this;this.keyMap={Enter:function(){a.picked=!0}};this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(a,b){a>=this.data.list.length?a=b?this.data.list.length-1:0:0>a&&(a=b?0:this.data.list.length-1);this.selectedHint!=a&&(b=this.hints.childNodes[this.selectedHint],b.className=b.className.replace(" CodeMirror-hint-active",""),b=this.hints.childNodes[this.selectedHint=
+a],b.className+=" CodeMirror-hint-active",b.offsetTop<this.hints.scrollTop?this.hints.scrollTop=b.offsetTop-3:b.offsetTop+b.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=b.offsetTop+b.offsetHeight-this.hints.clientHeight+3),f.signal(this.data,"select",this.data.list[this.selectedHint],b))},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}};f.registerHelper("hint","auto",{resolve:function(a,b){var c=a.getHelpers(b,
+"hint"),e;return c.length?(a=function(a,b,e){function d(c){if(c==f.length)return b(null);t(f[c],a,e,function(a){a&&0<a.list.length?b(a):d(c+1)})}var f=z(a,c);d(0)},a.async=!0,a.supportsSelection=!0,a):(e=a.getHelper(a.getCursor(),"hintWords"))?function(a){return f.hint.fromList(a,{words:e})}:f.hint.anyword?function(a,b){return f.hint.anyword(a,b)}:function(){}}});f.registerHelper("hint","fromList",function(a,b){var c=a.getCursor();var e=a.getTokenAt(c),d=f.Pos(c.line,e.end);e.string&&/\w/.test(e.string[e.string.length-
+1])?(a=e.string,c=f.Pos(c.line,e.start)):(a="",c=d);for(var e=[],m=0;m<b.words.length;m++){var g=b.words[m];g.slice(0,a.length)==a&&e.push(g)}if(e.length)return{list:e,from:c,to:d}});f.commands.autocomplete=f.showHint;var x={hint:f.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};f.defineOption("hintOptions",null)});
index f5ec2ca..ae64763 100644 (file)
@@ -1,284 +1,7 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"), require("../../mode/sql/sql"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror", "../../mode/sql/sql"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var tables;
-  var defaultTable;
-  var keywords;
-  var identifierQuote;
-  var CONS = {
-    QUERY_DIV: ";",
-    ALIAS_KEYWORD: "AS"
-  };
-  var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;
-
-  function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" }
-
-  function getKeywords(editor) {
-    var mode = editor.doc.modeOption;
-    if (mode === "sql") mode = "text/x-sql";
-    return CodeMirror.resolveMode(mode).keywords;
-  }
-
-  function getIdentifierQuote(editor) {
-    var mode = editor.doc.modeOption;
-    if (mode === "sql") mode = "text/x-sql";
-    return CodeMirror.resolveMode(mode).identifierQuote || "`";
-  }
-
-  function getText(item) {
-    return typeof item == "string" ? item : item.text;
-  }
-
-  function wrapTable(name, value) {
-    if (isArray(value)) value = {columns: value}
-    if (!value.text) value.text = name
-    return value
-  }
-
-  function parseTables(input) {
-    var result = {}
-    if (isArray(input)) {
-      for (var i = input.length - 1; i >= 0; i--) {
-        var item = input[i]
-        result[getText(item).toUpperCase()] = wrapTable(getText(item), item)
-      }
-    } else if (input) {
-      for (var name in input)
-        result[name.toUpperCase()] = wrapTable(name, input[name])
-    }
-    return result
-  }
-
-  function getTable(name) {
-    return tables[name.toUpperCase()]
-  }
-
-  function shallowClone(object) {
-    var result = {};
-    for (var key in object) if (object.hasOwnProperty(key))
-      result[key] = object[key];
-    return result;
-  }
-
-  function match(string, word) {
-    var len = string.length;
-    var sub = getText(word).substr(0, len);
-    return string.toUpperCase() === sub.toUpperCase();
-  }
-
-  function addMatches(result, search, wordlist, formatter) {
-    if (isArray(wordlist)) {
-      for (var i = 0; i < wordlist.length; i++)
-        if (match(search, wordlist[i])) result.push(formatter(wordlist[i]))
-    } else {
-      for (var word in wordlist) if (wordlist.hasOwnProperty(word)) {
-        var val = wordlist[word]
-        if (!val || val === true)
-          val = word
-        else
-          val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text
-        if (match(search, val)) result.push(formatter(val))
-      }
-    }
-  }
-
-  function cleanName(name) {
-    // Get rid name from identifierQuote and preceding dot(.)
-    if (name.charAt(0) == ".") {
-      name = name.substr(1);
-    }
-    // replace doublicated identifierQuotes with single identifierQuotes
-    // and remove single identifierQuotes
-    var nameParts = name.split(identifierQuote+identifierQuote);
-    for (var i = 0; i < nameParts.length; i++)
-      nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote,"g"), "");
-    return nameParts.join(identifierQuote);
-  }
-
-  function insertIdentifierQuotes(name) {
-    var nameParts = getText(name).split(".");
-    for (var i = 0; i < nameParts.length; i++)
-      nameParts[i] = identifierQuote +
-        // doublicate identifierQuotes
-        nameParts[i].replace(new RegExp(identifierQuote,"g"), identifierQuote+identifierQuote) +
-        identifierQuote;
-    var escaped = nameParts.join(".");
-    if (typeof name == "string") return escaped;
-    name = shallowClone(name);
-    name.text = escaped;
-    return name;
-  }
-
-  function nameCompletion(cur, token, result, editor) {
-    // Try to complete table, column names and return start position of completion
-    var useIdentifierQuotes = false;
-    var nameParts = [];
-    var start = token.start;
-    var cont = true;
-    while (cont) {
-      cont = (token.string.charAt(0) == ".");
-      useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);
-
-      start = token.start;
-      nameParts.unshift(cleanName(token.string));
-
-      token = editor.getTokenAt(Pos(cur.line, token.start));
-      if (token.string == ".") {
-        cont = true;
-        token = editor.getTokenAt(Pos(cur.line, token.start));
-      }
-    }
-
-    // Try to complete table names
-    var string = nameParts.join(".");
-    addMatches(result, string, tables, function(w) {
-      return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
-    });
-
-    // Try to complete columns from defaultTable
-    addMatches(result, string, defaultTable, function(w) {
-      return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
-    });
-
-    // Try to complete columns
-    string = nameParts.pop();
-    var table = nameParts.join(".");
-
-    var alias = false;
-    var aliasTable = table;
-    // Check if table is available. If not, find table by Alias
-    if (!getTable(table)) {
-      var oldTable = table;
-      table = findTableByAlias(table, editor);
-      if (table !== oldTable) alias = true;
-    }
-
-    var columns = getTable(table);
-    if (columns && columns.columns)
-      columns = columns.columns;
-
-    if (columns) {
-      addMatches(result, string, columns, function(w) {
-        var tableInsert = table;
-        if (alias == true) tableInsert = aliasTable;
-        if (typeof w == "string") {
-          w = tableInsert + "." + w;
-        } else {
-          w = shallowClone(w);
-          w.text = tableInsert + "." + w.text;
-        }
-        return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
-      });
-    }
-
-    return start;
-  }
-
-  function eachWord(lineText, f) {
-    var words = lineText.split(/\s+/)
-    for (var i = 0; i < words.length; i++)
-      if (words[i]) f(words[i].replace(/[,;]/g, ''))
-  }
-
-  function findTableByAlias(alias, editor) {
-    var doc = editor.doc;
-    var fullQuery = doc.getValue();
-    var aliasUpperCase = alias.toUpperCase();
-    var previousWord = "";
-    var table = "";
-    var separator = [];
-    var validRange = {
-      start: Pos(0, 0),
-      end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)
-    };
-
-    //add separator
-    var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);
-    while(indexOfSeparator != -1) {
-      separator.push(doc.posFromIndex(indexOfSeparator));
-      indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1);
-    }
-    separator.unshift(Pos(0, 0));
-    separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));
-
-    //find valid range
-    var prevItem = null;
-    var current = editor.getCursor()
-    for (var i = 0; i < separator.length; i++) {
-      if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {
-        validRange = {start: prevItem, end: separator[i]};
-        break;
-      }
-      prevItem = separator[i];
-    }
-
-    var query = doc.getRange(validRange.start, validRange.end, false);
-
-    for (var i = 0; i < query.length; i++) {
-      var lineText = query[i];
-      eachWord(lineText, function(word) {
-        var wordUpperCase = word.toUpperCase();
-        if (wordUpperCase === aliasUpperCase && getTable(previousWord))
-          table = previousWord;
-        if (wordUpperCase !== CONS.ALIAS_KEYWORD)
-          previousWord = word;
-      });
-      if (table) break;
-    }
-    return table;
-  }
-
-  CodeMirror.registerHelper("hint", "sql", function(editor, options) {
-    tables = parseTables(options && options.tables)
-    var defaultTableName = options && options.defaultTable;
-    var disableKeywords = options && options.disableKeywords;
-    defaultTable = defaultTableName && getTable(defaultTableName);
-    keywords = getKeywords(editor);
-    identifierQuote = getIdentifierQuote(editor);
-
-    if (defaultTableName && !defaultTable)
-      defaultTable = findTableByAlias(defaultTableName, editor);
-
-    defaultTable = defaultTable || [];
-
-    if (defaultTable.columns)
-      defaultTable = defaultTable.columns;
-
-    var cur = editor.getCursor();
-    var result = [];
-    var token = editor.getTokenAt(cur), start, end, search;
-    if (token.end > cur.ch) {
-      token.end = cur.ch;
-      token.string = token.string.slice(0, cur.ch - token.start);
-    }
-
-    if (token.string.match(/^[.`"\w@]\w*$/)) {
-      search = token.string;
-      start = token.start;
-      end = token.end;
-    } else {
-      start = end = cur.ch;
-      search = "";
-    }
-    if (search.charAt(0) == "." || search.charAt(0) == identifierQuote) {
-      start = nameCompletion(cur, token, result, editor);
-    } else {
-      addMatches(result, search, tables, function(w) {return w;});
-      addMatches(result, search, defaultTable, function(w) {return w;});
-      if (!disableKeywords)
-        addMatches(result, search, keywords, function(w) {return w.toUpperCase();});
-    }
-
-    return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};
-  });
-});
+'use strict';(function(g){"object"==typeof exports&&"object"==typeof module?g(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],g):g(CodeMirror)})(function(g){function r(a){return"[object Array]"==Object.prototype.toString.call(a)}function D(a){a=a.doc.modeOption;"sql"===a&&(a="text/x-sql");return g.resolveMode(a).keywords}function E(a){a=a.doc.modeOption;"sql"===a&&(a="text/x-sql");return g.resolveMode(a).identifierQuote||
+"`"}function m(a){return"string"==typeof a?a:a.text}function v(a,b){r(b)&&(b={columns:b});b.text||(b.text=a);return b}function F(a){var b={};if(r(a))for(var c=a.length-1;0<=c;c--){var d=a[c];b[m(d).toUpperCase()]=v(m(d),d)}else if(a)for(c in a)b[c.toUpperCase()]=v(c,a[c]);return b}function w(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function x(a,b){var c=a.length;b=m(b).substr(0,c);return a.toUpperCase()===b.toUpperCase()}function q(a,b,c,d){if(r(c))for(var e=0;e<c.length;e++)x(b,
+c[e])&&a.push(d(c[e]));else for(e in c)if(c.hasOwnProperty(e)){var f=c[e],f=f&&!0!==f?f.displayText?{text:f.text,displayText:f.displayText}:f.text:e;x(b,f)&&a.push(d(f))}}function G(a){"."==a.charAt(0)&&(a=a.substr(1));a=a.split(k+k);for(var b=0;b<a.length;b++)a[b]=a[b].replace(new RegExp(k,"g"),"");return a.join(k)}function t(a){for(var b=m(a).split("."),c=0;c<b.length;c++)b[c]=k+b[c].replace(new RegExp(k,"g"),k+k)+k;b=b.join(".");if("string"==typeof a)return b;a=w(a);a.text=b;return a}function H(a,
+b,c,d){for(var e=!1,f=[],y=b.start,g=!0;g;)g="."==b.string.charAt(0),e=e||b.string.charAt(0)==k,y=b.start,f.unshift(G(b.string)),b=d.getTokenAt(n(a.line,b.start)),"."==b.string&&(g=!0,b=d.getTokenAt(n(a.line,b.start)));a=f.join(".");q(c,a,p,function(a){return e?t(a):a});q(c,a,h,function(a){return e?t(a):a});a=f.pop();var l=f.join("."),z=!1,m=l;p[l.toUpperCase()]||(f=l,l=A(l,d),l!==f&&(z=!0));(d=p[l.toUpperCase()])&&d.columns&&(d=d.columns);d&&q(c,a,d,function(a){var b=l;1==z&&(b=m);"string"==typeof a?
+a=b+"."+a:(a=w(a),a.text=b+"."+a.text);return e?t(a):a});return y}function I(a,b){a=a.split(/\s+/);for(var c=0;c<a.length;c++)a[c]&&b(a[c].replace(/[,;]/g,""))}function A(a,b){var c=b.doc,d=c.getValue(),e=a.toUpperCase(),f="",g="";a=[];for(var k=n(0,0),l=n(b.lastLine(),b.getLineHandle(b.lastLine()).length),h=d.indexOf(u.QUERY_DIV);-1!=h;)a.push(c.posFromIndex(h)),h=d.indexOf(u.QUERY_DIV,h+1);a.unshift(n(0,0));a.push(n(b.lastLine(),b.getLineHandle(b.lastLine()).text.length));d=null;h=b.getCursor();
+for(b=0;b<a.length;b++){if((null==d||0<B(h,d))&&0>=B(h,a[b])){k=d;l=a[b];break}d=a[b]}c=c.getRange(k,l,!1);for(b=0;b<c.length&&(I(c[b],function(a){var b=a.toUpperCase();b===e&&p[f.toUpperCase()]&&(g=f);b!==u.ALIAS_KEYWORD&&(f=a)}),!g);b++);return g}var p,h,C,k,u={QUERY_DIV:";",ALIAS_KEYWORD:"AS"},n=g.Pos,B=g.cmpPos;g.registerHelper("hint","sql",function(a,b){p=F(b&&b.tables);var c=b&&b.defaultTable;b=b&&b.disableKeywords;h=c&&p[c.toUpperCase()];C=D(a);k=E(a);c&&!h&&(h=A(c,a));h=h||[];h.columns&&(h=
+h.columns);var c=a.getCursor(),d=[],e=a.getTokenAt(c);e.end>c.ch&&(e.end=c.ch,e.string=e.string.slice(0,c.ch-e.start));if(e.string.match(/^[.`"\w@]\w*$/)){var f=e.string;var g=e.start;var m=e.end}else g=m=c.ch,f="";"."==f.charAt(0)||f.charAt(0)==k?g=H(c,e,d,a):(q(d,f,p,function(a){return a}),q(d,f,h,function(a){return a}),b||q(d,f,C,function(a){return a.toUpperCase()}));return{list:d,from:n(c.line,g),to:n(c.line,m)}})});
index 9b9baa0..c0a3526 100644 (file)
@@ -1,110 +1,5 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var Pos = CodeMirror.Pos;
-
-  function getHints(cm, options) {
-    var tags = options && options.schemaInfo;
-    var quote = (options && options.quoteChar) || '"';
-    if (!tags) return;
-    var cur = cm.getCursor(), token = cm.getTokenAt(cur);
-    if (token.end > cur.ch) {
-      token.end = cur.ch;
-      token.string = token.string.slice(0, cur.ch - token.start);
-    }
-    var inner = CodeMirror.innerMode(cm.getMode(), token.state);
-    if (inner.mode.name != "xml") return;
-    var result = [], replaceToken = false, prefix;
-    var tag = /\btag\b/.test(token.type) && !/>$/.test(token.string);
-    var tagName = tag && /^\w/.test(token.string), tagStart;
-
-    if (tagName) {
-      var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start);
-      var tagType = /<\/$/.test(before) ? "close" : /<$/.test(before) ? "open" : null;
-      if (tagType) tagStart = token.start - (tagType == "close" ? 2 : 1);
-    } else if (tag && token.string == "<") {
-      tagType = "open";
-    } else if (tag && token.string == "</") {
-      tagType = "close";
-    }
-
-    if (!tag && !inner.state.tagName || tagType) {
-      if (tagName)
-        prefix = token.string;
-      replaceToken = tagType;
-      var cx = inner.state.context, curTag = cx && tags[cx.tagName];
-      var childList = cx ? curTag && curTag.children : tags["!top"];
-      if (childList && tagType != "close") {
-        for (var i = 0; i < childList.length; ++i) if (!prefix || childList[i].lastIndexOf(prefix, 0) == 0)
-          result.push("<" + childList[i]);
-      } else if (tagType != "close") {
-        for (var name in tags)
-          if (tags.hasOwnProperty(name) && name != "!top" && name != "!attrs" && (!prefix || name.lastIndexOf(prefix, 0) == 0))
-            result.push("<" + name);
-      }
-      if (cx && (!prefix || tagType == "close" && cx.tagName.lastIndexOf(prefix, 0) == 0))
-        result.push("</" + cx.tagName + ">");
-    } else {
-      // Attribute completion
-      var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;
-      var globalAttrs = tags["!attrs"];
-      if (!attrs && !globalAttrs) return;
-      if (!attrs) {
-        attrs = globalAttrs;
-      } else if (globalAttrs) { // Combine tag-local and global attributes
-        var set = {};
-        for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm];
-        for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm];
-        attrs = set;
-      }
-      if (token.type == "string" || token.string == "=") { // A value
-        var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),
-                                 Pos(cur.line, token.type == "string" ? token.start : token.end));
-        var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues;
-        if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;
-        if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget
-        if (token.type == "string") {
-          prefix = token.string;
-          var n = 0;
-          if (/['"]/.test(token.string.charAt(0))) {
-            quote = token.string.charAt(0);
-            prefix = token.string.slice(1);
-            n++;
-          }
-          var len = token.string.length;
-          if (/['"]/.test(token.string.charAt(len - 1))) {
-            quote = token.string.charAt(len - 1);
-            prefix = token.string.substr(n, len - 2);
-          }
-          replaceToken = true;
-        }
-        for (var i = 0; i < atValues.length; ++i) if (!prefix || atValues[i].lastIndexOf(prefix, 0) == 0)
-          result.push(quote + atValues[i] + quote);
-      } else { // An attribute name
-        if (token.type == "attribute") {
-          prefix = token.string;
-          replaceToken = true;
-        }
-        for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || attr.lastIndexOf(prefix, 0) == 0))
-          result.push(attr);
-      }
-    }
-    return {
-      list: result,
-      from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur,
-      to: replaceToken ? Pos(cur.line, token.end) : cur
-    };
-  }
-
-  CodeMirror.registerHelper("hint", "xml", getHints);
-});
+'use strict';(function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)})(function(n){var r=n.Pos;n.registerHelper("hint","xml",function(b,d){var c=d&&d.schemaInfo,l=d&&d.quoteChar||'"';if(c){d=b.getCursor();var a=b.getTokenAt(d);a.end>d.ch&&(a.end=d.ch,a.string=a.string.slice(0,d.ch-a.start));var k=n.innerMode(b.getMode(),a.state);if("xml"==k.mode.name){var q=[],m=!1,t=/\btag\b/.test(a.type)&&
+!/>$/.test(a.string),w=t&&/^\w/.test(a.string),u;if(w){var e=b.getLine(d.line).slice(Math.max(0,a.start-2),a.start);(e=/<\/$/.test(e)?"close":/<$/.test(e)?"open":null)&&(u=a.start-("close"==e?2:1))}else t&&"<"==a.string?e="open":t&&"</"==a.string&&(e="close");if(!t&&!k.state.tagName||e){if(w)var g=a.string;var m=e,h=k.state.context;k=h&&c[h.tagName];if((l=h?k&&k.children:c["!top"])&&"close"!=e)for(b=0;b<l.length;++b)g&&0!=l[b].lastIndexOf(g,0)||q.push("<"+l[b]);else if("close"!=e)for(var f in c)!c.hasOwnProperty(f)||
+"!top"==f||"!attrs"==f||g&&0!=f.lastIndexOf(g,0)||q.push("<"+f);h&&(!g||"close"==e&&0==h.tagName.lastIndexOf(g,0))&&q.push("</"+h.tagName+">")}else{f=(k=c[k.state.tagName])&&k.attrs;c=c["!attrs"];if(!f&&!c)return;if(!f)f=c;else if(c){e={};for(var p in c)c.hasOwnProperty(p)&&(e[p]=c[p]);for(p in f)f.hasOwnProperty(p)&&(e[p]=f[p]);f=e}if("string"==a.type||"="==a.string){e=b.getRange(r(d.line,Math.max(0,d.ch-60)),r(d.line,"string"==a.type?a.start:a.end));c=e.match(/([^\s\u00a0=<>\"\']+)=$/);if(!c||!f.hasOwnProperty(c[1])||
+!(h=f[c[1]]))return;"function"==typeof h&&(h=h.call(this,b));"string"==a.type&&(g=a.string,m=0,/['"]/.test(a.string.charAt(0))&&(l=a.string.charAt(0),g=a.string.slice(1),m++),b=a.string.length,/['"]/.test(a.string.charAt(b-1))&&(l=a.string.charAt(b-1),g=a.string.substr(m,b-2)),m=!0);for(b=0;b<h.length;++b)g&&0!=h[b].lastIndexOf(g,0)||q.push(l+h[b]+l)}else{"attribute"==a.type&&(g=a.string,m=!0);for(var v in f)!f.hasOwnProperty(v)||g&&0!=v.lastIndexOf(g,0)||q.push(v)}}return{list:q,from:m?r(d.line,
+null==u?a.start:u):d,to:m?r(d.line,a.end):d}}}})});
index 70621a1..d32990c 100644 (file)
@@ -1,47 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js
-
-// declare global: coffeelint
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.registerHelper("lint", "coffeescript", function(text) {
-  var found = [];
-  if (!window.coffeelint) {
-    if (window.console) {
-      window.console.error("Error: window.coffeelint not defined, CodeMirror CoffeeScript linting cannot run.");
-    }
-    return found;
-  }
-  var parseError = function(err) {
-    var loc = err.lineNumber;
-    found.push({from: CodeMirror.Pos(loc-1, 0),
-                to: CodeMirror.Pos(loc, 0),
-                severity: err.level,
-                message: err.message});
-  };
-  try {
-    var res = coffeelint.lint(text);
-    for(var i = 0; i < res.length; i++) {
-      parseError(res[i]);
-    }
-  } catch(e) {
-    found.push({from: CodeMirror.Pos(e.location.first_line, 0),
-                to: CodeMirror.Pos(e.location.last_line, e.location.last_column),
-                severity: 'error',
-                message: e.message});
-  }
-  return found;
-});
-
-});
+'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.registerHelper("lint","coffeescript",function(b){var c=[];if(!window.coffeelint)return window.console&&window.console.error("Error: window.coffeelint not defined, CodeMirror CoffeeScript linting cannot run."),c;try{var f=coffeelint.lint(b);for(b=0;b<f.length;b++){var e=f[b],g=e.lineNumber;
+c.push({from:a.Pos(g-1,0),to:a.Pos(g,0),severity:e.level,message:e.message})}}catch(d){c.push({from:a.Pos(d.location.first_line,0),to:a.Pos(d.location.last_line,d.location.last_column),severity:"error",message:d.message})}return c})});
index b7e1a4f..3d53a17 100644 (file)
@@ -1,40 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on csslint.js from https://github.com/stubbornella/csslint
-
-// declare global: CSSLint
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.registerHelper("lint", "css", function(text) {
-  var found = [];
-  if (!window.CSSLint) {
-    if (window.console) {
-        window.console.error("Error: window.CSSLint not defined, CodeMirror CSS linting cannot run.");
-    }
-    return found;
-  }
-  var results = CSSLint.verify(text), messages = results.messages, message = null;
-  for ( var i = 0; i < messages.length; i++) {
-    message = messages[i];
-    var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col;
-    found.push({
-      from: CodeMirror.Pos(startLine, startCol),
-      to: CodeMirror.Pos(endLine, endCol),
-      message: message.message,
-      severity : message.type
-    });
-  }
-  return found;
-});
-
-});
+'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.registerHelper("lint","css",function(c){var d=[];if(!window.CSSLint)return window.console&&window.console.error("Error: window.CSSLint not defined, CodeMirror CSS linting cannot run."),d;c=CSSLint.verify(c).messages;for(var b,e=0;e<c.length;e++){b=c[e];var f=b.line-1,g=b.col;d.push({from:a.Pos(b.line-
+1,b.col-1),to:a.Pos(f,g),message:b.message,severity:b.type})}return d})});
index 98c36b0..26c857c 100644 (file)
@@ -1,51 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on htmlhint.js from http://htmlhint.com/js/htmlhint.js
-
-// declare global: HTMLHint
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"), require("htmlhint"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror", "htmlhint"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-
-  var defaultRules = {
-    "tagname-lowercase": true,
-    "attr-lowercase": true,
-    "attr-value-double-quotes": true,
-    "doctype-first": false,
-    "tag-pair": true,
-    "spec-char-escape": true,
-    "id-unique": true,
-    "src-not-empty": true,
-    "attr-no-duplication": true
-  };
-
-  CodeMirror.registerHelper("lint", "html", function(text, options) {
-    var found = [];
-    if (!window.HTMLHint) {
-      if (window.console) {
-          window.console.error("Error: window.HTMLHint not defined, CodeMirror HTML linting cannot run.");
-      }
-      return found;
-    }
-    var messages = HTMLHint.verify(text, options && options.rules || defaultRules);
-    for (var i = 0; i < messages.length; i++) {
-      var message = messages[i];
-      var startLine = message.line - 1, endLine = message.line - 1, startCol = message.col - 1, endCol = message.col;
-      found.push({
-        from: CodeMirror.Pos(startLine, startCol),
-        to: CodeMirror.Pos(endLine, endCol),
-        message: message.message,
-        severity : message.type
-      });
-    }
-    return found;
-  });
-});
+'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("htmlhint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","htmlhint"],a):a(CodeMirror)})(function(a){var f={"tagname-lowercase":!0,"attr-lowercase":!0,"attr-value-double-quotes":!0,"doctype-first":!1,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0};a.registerHelper("lint","html",function(d,b){var e=[];if(!window.HTMLHint)return window.console&&
+window.console.error("Error: window.HTMLHint not defined, CodeMirror HTML linting cannot run."),e;d=HTMLHint.verify(d,b&&b.rules||f);for(b=0;b<d.length;b++){var c=d[b],g=c.line-1,h=c.col;e.push({from:a.Pos(c.line-1,c.col-1),to:a.Pos(g,h),message:c.message,severity:c.type})}return e})});
index c58f785..1fcb257 100644 (file)
@@ -1,141 +1,4 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-  // declare global: JSHINT
-
-  var bogus = [ "Dangerous comment" ];
-
-  var warnings = [ [ "Expected '{'",
-                     "Statement body should be inside '{ }' braces." ] ];
-
-  var errors = [ "Missing semicolon", "Extra comma", "Missing property name",
-                 "Unmatched ", " and instead saw", " is not defined",
-                 "Unclosed string", "Stopping, unable to continue" ];
-
-  function validator(text, options) {
-    if (!window.JSHINT) {
-      if (window.console) {
-        window.console.error("Error: window.JSHINT not defined, CodeMirror JavaScript linting cannot run.");
-      }
-      return [];
-    }
-    JSHINT(text, options, options.globals);
-    var errors = JSHINT.data().errors, result = [];
-    if (errors) parseErrors(errors, result);
-    return result;
-  }
-
-  CodeMirror.registerHelper("lint", "javascript", validator);
-
-  function cleanup(error) {
-    // All problems are warnings by default
-    fixWith(error, warnings, "warning", true);
-    fixWith(error, errors, "error");
-
-    return isBogus(error) ? null : error;
-  }
-
-  function fixWith(error, fixes, severity, force) {
-    var description, fix, find, replace, found;
-
-    description = error.description;
-
-    for ( var i = 0; i < fixes.length; i++) {
-      fix = fixes[i];
-      find = (typeof fix === "string" ? fix : fix[0]);
-      replace = (typeof fix === "string" ? null : fix[1]);
-      found = description.indexOf(find) !== -1;
-
-      if (force || found) {
-        error.severity = severity;
-      }
-      if (found && replace) {
-        error.description = replace;
-      }
-    }
-  }
-
-  function isBogus(error) {
-    var description = error.description;
-    for ( var i = 0; i < bogus.length; i++) {
-      if (description.indexOf(bogus[i]) !== -1) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  function parseErrors(errors, output) {
-    for ( var i = 0; i < errors.length; i++) {
-      var error = errors[i];
-      if (error) {
-        var linetabpositions, index;
-
-        linetabpositions = [];
-
-        // This next block is to fix a problem in jshint. Jshint
-        // replaces
-        // all tabs with spaces then performs some checks. The error
-        // positions (character/space) are then reported incorrectly,
-        // not taking the replacement step into account. Here we look
-        // at the evidence line and try to adjust the character position
-        // to the correct value.
-        if (error.evidence) {
-          // Tab positions are computed once per line and cached
-          var tabpositions = linetabpositions[error.line];
-          if (!tabpositions) {
-            var evidence = error.evidence;
-            tabpositions = [];
-            // ugggh phantomjs does not like this
-            // forEachChar(evidence, function(item, index) {
-            Array.prototype.forEach.call(evidence, function(item,
-                                                            index) {
-              if (item === '\t') {
-                // First col is 1 (not 0) to match error
-                // positions
-                tabpositions.push(index + 1);
-              }
-            });
-            linetabpositions[error.line] = tabpositions;
-          }
-          if (tabpositions.length > 0) {
-            var pos = error.character;
-            tabpositions.forEach(function(tabposition) {
-              if (pos > tabposition) pos -= 1;
-            });
-            error.character = pos;
-          }
-        }
-
-        var start = error.character - 1, end = start + 1;
-        if (error.evidence) {
-          index = error.evidence.substring(start).search(/.\b/);
-          if (index > -1) {
-            end += index;
-          }
-        }
-
-        // Convert to format expected by validation service
-        error.description = error.reason;// + "(jshint)";
-        error.start = error.character;
-        error.end = end;
-        error = cleanup(error);
-
-        if (error)
-          output.push({message: error.description,
-                       severity: error.severity,
-                       from: CodeMirror.Pos(error.line - 1, start),
-                       to: CodeMirror.Pos(error.line - 1, end)});
-      }
-    }
-  }
-});
+'use strict';(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){function p(b){m(b,q,"warning",!0);m(b,r,"error");a:{var c=b.description;for(var g=0;g<n.length;g++)if(-1!==c.indexOf(n[g])){c=!0;break a}c=!1}return c?null:b}function m(b,c,g,a){var f=b.description;for(var e=0;e<c.length;e++){var d=c[e];var h="string"===typeof d?d:d[0];d="string"===typeof d?
+null:d[1];h=-1!==f.indexOf(h);if(a||h)b.severity=g;h&&d&&(b.description=d)}}function t(b,c){for(var g=0;g<b.length;g++){var a=b[g];if(a){var k=[];if(a.evidence){var e=k[a.line];if(!e){var d=a.evidence,e=[];Array.prototype.forEach.call(d,function(a,b){"\t"===a&&e.push(b+1)});k[a.line]=e}if(0<e.length){var h=a.character;e.forEach(function(a){h>a&&--h});a.character=h}}var d=a.character-1,l=d+1;a.evidence&&(k=a.evidence.substring(d).search(/.\b/),-1<k&&(l+=k));a.description=a.reason;a.start=a.character;
+a.end=l;(a=p(a))&&c.push({message:a.description,severity:a.severity,from:f.Pos(a.line-1,d),to:f.Pos(a.line-1,l)})}}}var n=["Dangerous comment"],q=[["Expected '{'","Statement body should be inside '{ }' braces."]],r="Missing semicolon;Extra comma;Missing property name;Unmatched ; and instead saw; is not defined;Unclosed string;Stopping, unable to continue".split(";");f.registerHelper("lint","javascript",function(b,c){if(!window.JSHINT)return window.console&&window.console.error("Error: window.JSHINT not defined, CodeMirror JavaScript linting cannot run."),
+[];JSHINT(b,c,c.globals);b=JSHINT.data().errors;c=[];b&&t(b,c);return c})});
index 849641e..0a22d44 100644 (file)
@@ -1,37 +1,2 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on jsonlint.js from https://github.com/zaach/jsonlint
-
-// declare global: jsonlint
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.registerHelper("lint", "json", function(text) {
-  var found = [];
-  if (!window.jsonlint) {
-    if (window.console) {
-      window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.");
-    }
-    return found;
-  }
-  jsonlint.parseError = function(str, hash) {
-    var loc = hash.loc;
-    found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
-                to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
-                message: str});
-  };
-  try { jsonlint.parse(text); }
-  catch(e) {}
-  return found;
-});
-
-});
+'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.registerHelper("lint","json",function(e){var c=[];if(!window.jsonlint)return window.console&&window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run."),c;jsonlint.parseError=function(d,b){b=b.loc;c.push({from:a.Pos(b.first_line-1,b.first_column),to:a.Pos(b.last_line-
+1,b.last_column),message:d})};try{jsonlint.parse(e)}catch(d){}return c})});
index f097cfe..2120ceb 100644 (file)
@@ -1,73 +1 @@
-/* The lint marker gutter */
-.CodeMirror-lint-markers {
-  width: 16px;
-}
-
-.CodeMirror-lint-tooltip {
-  background-color: #ffd;
-  border: 1px solid black;
-  border-radius: 4px 4px 4px 4px;
-  color: black;
-  font-family: monospace;
-  font-size: 10pt;
-  overflow: hidden;
-  padding: 2px 5px;
-  position: fixed;
-  white-space: pre;
-  white-space: pre-wrap;
-  z-index: 100;
-  max-width: 600px;
-  opacity: 0;
-  transition: opacity .4s;
-  -moz-transition: opacity .4s;
-  -webkit-transition: opacity .4s;
-  -o-transition: opacity .4s;
-  -ms-transition: opacity .4s;
-}
-
-.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning {
-  background-position: left bottom;
-  background-repeat: repeat-x;
-}
-
-.CodeMirror-lint-mark-error {
-  background-image:
-  url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")
-  ;
-}
-
-.CodeMirror-lint-mark-warning {
-  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
-}
-
-.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {
-  background-position: center center;
-  background-repeat: no-repeat;
-  cursor: pointer;
-  display: inline-block;
-  height: 16px;
-  width: 16px;
-  vertical-align: middle;
-  position: relative;
-}
-
-.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
-  padding-left: 18px;
-  background-position: top left;
-  background-repeat: no-repeat;
-}
-
-.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
-  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");
-}
-
-.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {
-  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=");
-}
-
-.CodeMirror-lint-marker-multiple {
-  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");
-  background-repeat: no-repeat;
-  background-position: right bottom;
-  width: 100%; height: 100%;
-}
+.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid #000;border-radius:4px 4px 4px 4px;color:#000;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==)}.CodeMirror-lint-mark-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=)}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-multiple{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}
\ No newline at end of file
index 825065e..d1c9c45 100644 (file)
@@ -1,248 +1,8 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-  var GUTTER_ID = "CodeMirror-lint-markers";
-
-  function showTooltip(e, content) {
-    var tt = document.createElement("div");
-    tt.className = "CodeMirror-lint-tooltip";
-    tt.appendChild(content.cloneNode(true));
-    document.body.appendChild(tt);
-
-    function position(e) {
-      if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
-      tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
-      tt.style.left = (e.clientX + 5) + "px";
-    }
-    CodeMirror.on(document, "mousemove", position);
-    position(e);
-    if (tt.style.opacity != null) tt.style.opacity = 1;
-    return tt;
-  }
-  function rm(elt) {
-    if (elt.parentNode) elt.parentNode.removeChild(elt);
-  }
-  function hideTooltip(tt) {
-    if (!tt.parentNode) return;
-    if (tt.style.opacity == null) rm(tt);
-    tt.style.opacity = 0;
-    setTimeout(function() { rm(tt); }, 600);
-  }
-
-  function showTooltipFor(e, content, node) {
-    var tooltip = showTooltip(e, content);
-    function hide() {
-      CodeMirror.off(node, "mouseout", hide);
-      if (tooltip) { hideTooltip(tooltip); tooltip = null; }
-    }
-    var poll = setInterval(function() {
-      if (tooltip) for (var n = node;; n = n.parentNode) {
-        if (n && n.nodeType == 11) n = n.host;
-        if (n == document.body) return;
-        if (!n) { hide(); break; }
-      }
-      if (!tooltip) return clearInterval(poll);
-    }, 400);
-    CodeMirror.on(node, "mouseout", hide);
-  }
-
-  function LintState(cm, options, hasGutter) {
-    this.marked = [];
-    this.options = options;
-    this.timeout = null;
-    this.hasGutter = hasGutter;
-    this.onMouseOver = function(e) { onMouseOver(cm, e); };
-    this.waitingFor = 0
-  }
-
-  function parseOptions(_cm, options) {
-    if (options instanceof Function) return {getAnnotations: options};
-    if (!options || options === true) options = {};
-    return options;
-  }
-
-  function clearMarks(cm) {
-    var state = cm.state.lint;
-    if (state.hasGutter) cm.clearGutter(GUTTER_ID);
-    for (var i = 0; i < state.marked.length; ++i)
-      state.marked[i].clear();
-    state.marked.length = 0;
-  }
-
-  function makeMarker(labels, severity, multiple, tooltips) {
-    var marker = document.createElement("div"), inner = marker;
-    marker.className = "CodeMirror-lint-marker-" + severity;
-    if (multiple) {
-      inner = marker.appendChild(document.createElement("div"));
-      inner.className = "CodeMirror-lint-marker-multiple";
-    }
-
-    if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
-      showTooltipFor(e, labels, inner);
-    });
-
-    return marker;
-  }
-
-  function getMaxSeverity(a, b) {
-    if (a == "error") return a;
-    else return b;
-  }
-
-  function groupByLine(annotations) {
-    var lines = [];
-    for (var i = 0; i < annotations.length; ++i) {
-      var ann = annotations[i], line = ann.from.line;
-      (lines[line] || (lines[line] = [])).push(ann);
-    }
-    return lines;
-  }
-
-  function annotationTooltip(ann) {
-    var severity = ann.severity;
-    if (!severity) severity = "error";
-    var tip = document.createElement("div");
-    tip.className = "CodeMirror-lint-message-" + severity;
-    if (typeof ann.messageHTML != 'undefined') {
-        tip.innerHTML = ann.messageHTML;
-    } else {
-        tip.appendChild(document.createTextNode(ann.message));
-    }
-    return tip;
-  }
-
-  function lintAsync(cm, getAnnotations, passOptions) {
-    var state = cm.state.lint
-    var id = ++state.waitingFor
-    function abort() {
-      id = -1
-      cm.off("change", abort)
-    }
-    cm.on("change", abort)
-    getAnnotations(cm.getValue(), function(annotations, arg2) {
-      cm.off("change", abort)
-      if (state.waitingFor != id) return
-      if (arg2 && annotations instanceof CodeMirror) annotations = arg2
-      updateLinting(cm, annotations)
-    }, passOptions, cm);
-  }
-
-  function startLinting(cm) {
-    var state = cm.state.lint, options = state.options;
-    var passOptions = options.options || options; // Support deprecated passing of `options` property in options
-    var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
-    if (!getAnnotations) return;
-    if (options.async || getAnnotations.async) {
-      lintAsync(cm, getAnnotations, passOptions)
-    } else {
-      var annotations = getAnnotations(cm.getValue(), passOptions, cm);
-      if (!annotations) return;
-      if (annotations.then) annotations.then(function(issues) {
-        updateLinting(cm, issues);
-      });
-      else updateLinting(cm, annotations);
-    }
-  }
-
-  function updateLinting(cm, annotationsNotSorted) {
-    clearMarks(cm);
-    var state = cm.state.lint, options = state.options;
-
-    var annotations = groupByLine(annotationsNotSorted);
-
-    for (var line = 0; line < annotations.length; ++line) {
-      var anns = annotations[line];
-      if (!anns) continue;
-
-      var maxSeverity = null;
-      var tipLabel = state.hasGutter && document.createDocumentFragment();
-
-      for (var i = 0; i < anns.length; ++i) {
-        var ann = anns[i];
-        var severity = ann.severity;
-        if (!severity) severity = "error";
-        maxSeverity = getMaxSeverity(maxSeverity, severity);
-
-        if (options.formatAnnotation) ann = options.formatAnnotation(ann);
-        if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));
-
-        if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {
-          className: "CodeMirror-lint-mark-" + severity,
-          __annotation: ann
-        }));
-      }
-
-      if (state.hasGutter)
-        cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1,
-                                                       state.options.tooltips));
-    }
-    if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
-  }
-
-  function onChange(cm) {
-    var state = cm.state.lint;
-    if (!state) return;
-    clearTimeout(state.timeout);
-    state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
-  }
-
-  function popupTooltips(annotations, e) {
-    var target = e.target || e.srcElement;
-    var tooltip = document.createDocumentFragment();
-    for (var i = 0; i < annotations.length; i++) {
-      var ann = annotations[i];
-      tooltip.appendChild(annotationTooltip(ann));
-    }
-    showTooltipFor(e, tooltip, target);
-  }
-
-  function onMouseOver(cm, e) {
-    var target = e.target || e.srcElement;
-    if (!/\bCodeMirror-lint-mark-/.test(target.className)) return;
-    var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2;
-    var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client"));
-
-    var annotations = [];
-    for (var i = 0; i < spans.length; ++i) {
-      var ann = spans[i].__annotation;
-      if (ann) annotations.push(ann);
-    }
-    if (annotations.length) popupTooltips(annotations, e);
-  }
-
-  CodeMirror.defineOption("lint", false, function(cm, val, old) {
-    if (old && old != CodeMirror.Init) {
-      clearMarks(cm);
-      if (cm.state.lint.options.lintOnChange !== false)
-        cm.off("change", onChange);
-      CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
-      clearTimeout(cm.state.lint.timeout);
-      delete cm.state.lint;
-    }
-
-    if (val) {
-      var gutters = cm.getOption("gutters"), hasLintGutter = false;
-      for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
-      var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);
-      if (state.options.lintOnChange !== false)
-        cm.on("change", onChange);
-      if (state.options.tooltips != false && state.options.tooltips != "gutter")
-        CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
-
-      startLinting(cm);
-    }
-  });
-
-  CodeMirror.defineExtension("performLint", function() {
-    if (this.state.lint) startLinting(this);
-  });
-});
+'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function v(a,c){function b(a){if(!d.parentNode)return e.off(document,"mousemove",b);d.style.top=Math.max(0,a.clientY-d.offsetHeight-5)+"px";d.style.left=a.clientX+5+"px"}var d=document.createElement("div");d.className="CodeMirror-lint-tooltip";d.appendChild(c.cloneNode(!0));document.body.appendChild(d);
+e.on(document,"mousemove",b);b(a);null!=d.style.opacity&&(d.style.opacity=1);return d}function w(a){a.parentNode&&(null==a.style.opacity&&a.parentNode&&a.parentNode.removeChild(a),a.style.opacity=0,setTimeout(function(){a.parentNode&&a.parentNode.removeChild(a)},600))}function q(a,c,b){function d(){e.off(b,"mouseout",d);g&&(w(g),g=null)}var g=v(a,c),f=setInterval(function(){if(g)for(var a=b;;a=a.parentNode){a&&11==a.nodeType&&(a=a.host);if(a==document.body)return;if(!a){d();break}}if(!g)return clearInterval(f)},
+400);e.on(b,"mouseout",d)}function x(a,c,b){this.marked=[];this.options=c;this.timeout=null;this.hasGutter=b;this.onMouseOver=function(c){var b=c.target||c.srcElement;if(/\bCodeMirror-lint-mark-/.test(b.className)){for(var b=b.getBoundingClientRect(),d=a.findMarksAt(a.coordsChar({left:(b.left+b.right)/2,top:(b.top+b.bottom)/2},"client")),b=[],h=0;h<d.length;++h){var e=d[h].__annotation;e&&b.push(e)}if(b.length){d=c.target||c.srcElement;h=document.createDocumentFragment();for(e=0;e<b.length;e++)h.appendChild(r(b[e]));
+q(c,h,d)}}};this.waitingFor=0}function t(a){var c=a.state.lint;c.hasGutter&&a.clearGutter("CodeMirror-lint-markers");for(a=0;a<c.marked.length;++a)c.marked[a].clear();c.marked.length=0}function y(a,c,b,d){var g=document.createElement("div"),f=g;g.className="CodeMirror-lint-marker-"+c;b&&(f=g.appendChild(document.createElement("div")),f.className="CodeMirror-lint-marker-multiple");if(0!=d)e.on(f,"mouseover",function(b){q(b,a,f)});return g}function r(a){var c=a.severity;c||(c="error");var b=document.createElement("div");
+b.className="CodeMirror-lint-message-"+c;"undefined"!=typeof a.messageHTML?b.innerHTML=a.messageHTML:b.appendChild(document.createTextNode(a.message));return b}function z(a,c,b){function d(){f=-1;a.off("change",d)}var g=a.state.lint,f=++g.waitingFor;a.on("change",d);c(a.getValue(),function(b,c){a.off("change",d);g.waitingFor==f&&(c&&b instanceof e&&(b=c),n(a,b))},b,a)}function l(a){var c=a.state.lint.options,b=c.options||c,d=c.getAnnotations||a.getHelper(e.Pos(0,0),"lint");d&&(c.async||d.async?z(a,
+d,b):(c=d(a.getValue(),b,a))&&(c.then?c.then(function(b){n(a,b)}):n(a,c)))}function n(a,c){t(a);for(var b=a.state.lint,d=b.options,e=[],f=0;f<c.length;++f){var h=c[f],m=h.from.line;(e[m]||(e[m]=[])).push(h)}for(f=0;f<e.length;++f)if(h=e[f]){for(var m=null,n=b.hasGutter&&document.createDocumentFragment(),l=0;l<h.length;++l){var k=h[l],p=k.severity;p||(p="error");"error"!=m&&(m=p);d.formatAnnotation&&(k=d.formatAnnotation(k));b.hasGutter&&n.appendChild(r(k));k.to&&b.marked.push(a.markText(k.from,k.to,
+{className:"CodeMirror-lint-mark-"+p,__annotation:k}))}b.hasGutter&&a.setGutterMarker(f,"CodeMirror-lint-markers",y(n,m,1<h.length,b.options.tooltips))}if(d.onUpdateLinting)d.onUpdateLinting(c,e,a)}function u(a){var c=a.state.lint;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(function(){l(a)},c.options.delay||500))}e.defineOption("lint",!1,function(a,c,b){b&&b!=e.Init&&(t(a),!1!==a.state.lint.options.lintOnChange&&a.off("change",u),e.off(a.getWrapperElement(),"mouseover",a.state.lint.onMouseOver),
+clearTimeout(a.state.lint.timeout),delete a.state.lint);if(c){var d=a.getOption("gutters");b=!1;for(var g=0;g<d.length;++g)"CodeMirror-lint-markers"==d[g]&&(b=!0);d=a.state;c instanceof Function?c={getAnnotations:c}:c&&!0!==c||(c={});b=d.lint=new x(a,c,b);if(!1!==b.options.lintOnChange)a.on("change",u);if(0!=b.options.tooltips&&"gutter"!=b.options.tooltips)e.on(a.getWrapperElement(),"mouseover",b.onMouseOver);l(a)}});e.defineExtension("performLint",function(){this.state.lint&&l(this)})});
index 3954ed3..777cf9d 100644 (file)
@@ -1,41 +1 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-// Depends on js-yaml.js from https://github.com/nodeca/js-yaml
-
-// declare global: jsyaml
-
-CodeMirror.registerHelper("lint", "yaml", function(text) {
-  var found = [];
-  if (!window.jsyaml) {
-    if (window.console) {
-      window.console.error("Error: window.jsyaml not defined, CodeMirror YAML linting cannot run.");
-    }
-    return found;
-  }
-  try { jsyaml.load(text); }
-  catch(e) {
-      var loc = e.mark,
-          // js-yaml YAMLException doesn't always provide an accurate lineno
-          // e.g., when there are multiple yaml docs
-          // ---
-          // ---
-          // foo:bar
-          from = loc ? CodeMirror.Pos(loc.line, loc.column) : CodeMirror.Pos(0, 0),
-          to = from;
-      found.push({ from: from, to: to, message: e.message });
-  }
-  return found;
-});
-
-});
+'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.registerHelper("lint","yaml",function(b){var c=[];if(!window.jsyaml)return window.console&&window.console.error("Error: window.jsyaml not defined, CodeMirror YAML linting cannot run."),c;try{jsyaml.load(b)}catch(d){b=(b=d.mark)?a.Pos(b.line,b.column):a.Pos(0,0),c.push({from:b,to:b,message:d.message})}return c})});
index bda3d9f..48f0775 100644 (file)
@@ -1,113 +1 @@
-.CodeMirror-merge {
-  position: relative;
-  border: 1px solid #ddd;
-  white-space: pre;
-}
-
-.CodeMirror-merge, .CodeMirror-merge .CodeMirror {
-  height: 350px;
-}
-
-.CodeMirror-merge-2pane .CodeMirror-merge-pane { width: 47%; }
-.CodeMirror-merge-2pane .CodeMirror-merge-gap { width: 6%; }
-.CodeMirror-merge-3pane .CodeMirror-merge-pane { width: 31%; }
-.CodeMirror-merge-3pane .CodeMirror-merge-gap { width: 3.5%; }
-
-.CodeMirror-merge-pane {
-  display: inline-block;
-  white-space: normal;
-  vertical-align: top;
-}
-.CodeMirror-merge-pane-rightmost {
-  position: absolute;
-  right: 0px;
-  z-index: 1;
-}
-
-.CodeMirror-merge-gap {
-  z-index: 2;
-  display: inline-block;
-  height: 100%;
-  -moz-box-sizing: border-box;
-  box-sizing: border-box;
-  overflow: hidden;
-  border-left: 1px solid #ddd;
-  border-right: 1px solid #ddd;
-  position: relative;
-  background: #f8f8f8;
-}
-
-.CodeMirror-merge-scrolllock-wrap {
-  position: absolute;
-  bottom: 0; left: 50%;
-}
-.CodeMirror-merge-scrolllock {
-  position: relative;
-  left: -50%;
-  cursor: pointer;
-  color: #555;
-  line-height: 1;
-}
-
-.CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right {
-  position: absolute;
-  left: 0; top: 0;
-  right: 0; bottom: 0;
-  line-height: 1;
-}
-
-.CodeMirror-merge-copy {
-  position: absolute;
-  cursor: pointer;
-  color: #44c;
-  z-index: 3;
-}
-
-.CodeMirror-merge-copy-reverse {
-  position: absolute;
-  cursor: pointer;
-  color: #44c;
-}
-
-.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy { left: 2px; }
-.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy { right: 2px; }
-
-.CodeMirror-merge-r-inserted, .CodeMirror-merge-l-inserted {
-  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);
-  background-position: bottom left;
-  background-repeat: repeat-x;
-}
-
-.CodeMirror-merge-r-deleted, .CodeMirror-merge-l-deleted {
-  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==);
-  background-position: bottom left;
-  background-repeat: repeat-x;
-}
-
-.CodeMirror-merge-r-chunk { background: #ffffe0; }
-.CodeMirror-merge-r-chunk-start { border-top: 1px solid #ee8; }
-.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #ee8; }
-.CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #ee8; stroke-width: 1px; }
-
-.CodeMirror-merge-l-chunk { background: #eef; }
-.CodeMirror-merge-l-chunk-start { border-top: 1px solid #88e; }
-.CodeMirror-merge-l-chunk-end { border-bottom: 1px solid #88e; }
-.CodeMirror-merge-l-connect { fill: #eef; stroke: #88e; stroke-width: 1px; }
-
-.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk { background: #dfd; }
-.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start { border-top: 1px solid #4e4; }
-.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #4e4; }
-
-.CodeMirror-merge-collapsed-widget:before {
-  content: "(...)";
-}
-.CodeMirror-merge-collapsed-widget {
-  cursor: pointer;
-  color: #88b;
-  background: #eef;
-  border: 1px solid #ddf;
-  font-size: 90%;
-  padding: 0 3px;
-  border-radius: 4px;
-}
-.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt { display: none; }
+.CodeMirror-merge{position:relative;border:1px solid #ddd;white-space:pre}.CodeMirror-merge,.CodeMirror-merge .CodeMirror{height:350px}.CodeMirror-merge-2pane .CodeMirror-merge-pane{width:47%}.CodeMirror-merge-2pane .CodeMirror-merge-gap{width:6%}.CodeMirror-merge-3pane .CodeMirror-merge-pane{width:31%}.CodeMirror-merge-3pane .CodeMirror-merge-gap{width:3.5%}.CodeMirror-merge-pane{display:inline-block;white-space:normal;vertical-align:top}.CodeMirror-merge-pane-rightmost{position:absolute;right:0;z-index:1}.CodeMirror-merge-gap{z-index:2;display:inline-block;height:100%;-moz-box-sizing:border-box;box-sizing:border-box;overflow:hidden;border-left:1px solid #ddd;border-right:1px solid #ddd;position:relative;background:#f8f8f8}.CodeMirror-merge-scrolllock-wrap{position:absolute;bottom:0;left:50%}.CodeMirror-merge-scrolllock{position:relative;left:-50%;cursor:pointer;color:#555;line-height:1}.CodeMirror-merge-copybuttons-left,.CodeMirror-merge-copybuttons-right{position:absolute;left:0;top:0;right:0;bottom:0;line-height:1}.CodeMirror-merge-copy{position:absolute;cursor:pointer;color:#44c;z-index:3}.CodeMirror-merge-copy-reverse{position:absolute;cursor:pointer;color:#44c}.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy{left:2px}.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy{right:2px}.CodeMirror-merge-l-inserted,.CodeMirror-merge-r-inserted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);background-position:bottom left;background-repeat:repeat-x}.CodeMirror-merge-l-deleted,.CodeMirror-merge-r-deleted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==);background-position:bottom left;background-repeat:repeat-x}.CodeMirror-merge-r-chunk{background:#ffffe0}.CodeMirror-merge-r-chunk-start{border-top:1px solid #ee8}.CodeMirror-merge-r-chunk-end{border-bottom:1px solid #ee8}.CodeMirror-merge-r-connect{fill:#ffffe0;stroke:#ee8;stroke-width:1px}.CodeMirror-merge-l-chunk{background:#eef}.CodeMirror-merge-l-chunk-start{border-top:1px solid #88e}.CodeMirror-merge-l-chunk-end{border-bottom:1px solid #88e}.CodeMirror-merge-l-connect{fill:#eef;stroke:#88e;stroke-width:1px}.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk{background:#dfd}.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start{border-top:1px solid #4e4}.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end{border-bottom:1px solid #4e4}.CodeMirror-merge-collapsed-widget:before{content:"(...)"}.CodeMirror-merge-collapsed-widget{cursor:pointer;color:#88b;background:#eef;border:1px solid #ddf;font-size:90%;padding:0 3px;border-radius:4px}.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt{display:none}
\ No newline at end of file
index 76460dd..af132cd 100644 (file)
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// declare global: diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL
-
-(function(mod) {
-  if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror")); // Note non-packaged dependency diff_match_patch
-  else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror", "diff_match_patch"], mod);
-  else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
-  "use strict";
-  var Pos = CodeMirror.Pos;
-  var svgNS = "http://www.w3.org/2000/svg";
-
-  function DiffView(mv, type) {
-    this.mv = mv;
-    this.type = type;
-    this.classes = type == "left"
-      ? {chunk: "CodeMirror-merge-l-chunk",
-         start: "CodeMirror-merge-l-chunk-start",
-         end: "CodeMirror-merge-l-chunk-end",
-         insert: "CodeMirror-merge-l-inserted",
-         del: "CodeMirror-merge-l-deleted",
-         connect: "CodeMirror-merge-l-connect"}
-      : {chunk: "CodeMirror-merge-r-chunk",
-         start: "CodeMirror-merge-r-chunk-start",
-         end: "CodeMirror-merge-r-chunk-end",
-         insert: "CodeMirror-merge-r-inserted",
-         del: "CodeMirror-merge-r-deleted",
-         connect: "CodeMirror-merge-r-connect"};
-  }
-
-  DiffView.prototype = {
-    constructor: DiffView,
-    init: function(pane, orig, options) {
-      this.edit = this.mv.edit;
-      ;(this.edit.state.diffViews || (this.edit.state.diffViews = [])).push(this);
-      this.orig = CodeMirror(pane, copyObj({value: orig, readOnly: !this.mv.options.allowEditingOriginals}, copyObj(options)));
-      if (this.mv.options.connect == "align") {
-        if (!this.edit.state.trackAlignable) this.edit.state.trackAlignable = new TrackAlignable(this.edit)
-        this.orig.state.trackAlignable = new TrackAlignable(this.orig)
-      }
-
-      this.orig.state.diffViews = [this];
-      var classLocation = options.chunkClassLocation || "background";
-      if (Object.prototype.toString.call(classLocation) != "[object Array]") classLocation = [classLocation]
-      this.classes.classLocation = classLocation
-
-      this.diff = getDiff(asString(orig), asString(options.value), this.mv.options.ignoreWhitespace);
-      this.chunks = getChunks(this.diff);
-      this.diffOutOfDate = this.dealigned = false;
-      this.needsScrollSync = null
-
-      this.showDifferences = options.showDifferences !== false;
-    },
-    registerEvents: function(otherDv) {
-      this.forceUpdate = registerUpdate(this);
-      setScrollLock(this, true, false);
-      registerScroll(this, otherDv);
-    },
-    setShowDifferences: function(val) {
-      val = val !== false;
-      if (val != this.showDifferences) {
-        this.showDifferences = val;
-        this.forceUpdate("full");
-      }
-    }
-  };
-
-  function ensureDiff(dv) {
-    if (dv.diffOutOfDate) {
-      dv.diff = getDiff(dv.orig.getValue(), dv.edit.getValue(), dv.mv.options.ignoreWhitespace);
-      dv.chunks = getChunks(dv.diff);
-      dv.diffOutOfDate = false;
-      CodeMirror.signal(dv.edit, "updateDiff", dv.diff);
-    }
-  }
-
-  var updating = false;
-  function registerUpdate(dv) {
-    var edit = {from: 0, to: 0, marked: []};
-    var orig = {from: 0, to: 0, marked: []};
-    var debounceChange, updatingFast = false;
-    function update(mode) {
-      updating = true;
-      updatingFast = false;
-      if (mode == "full") {
-        if (dv.svg) clear(dv.svg);
-        if (dv.copyButtons) clear(dv.copyButtons);
-        clearMarks(dv.edit, edit.marked, dv.classes);
-        clearMarks(dv.orig, orig.marked, dv.classes);
-        edit.from = edit.to = orig.from = orig.to = 0;
-      }
-      ensureDiff(dv);
-      if (dv.showDifferences) {
-        updateMarks(dv.edit, dv.diff, edit, DIFF_INSERT, dv.classes);
-        updateMarks(dv.orig, dv.diff, orig, DIFF_DELETE, dv.classes);
-      }
-
-      if (dv.mv.options.connect == "align")
-        alignChunks(dv);
-      makeConnections(dv);
-      if (dv.needsScrollSync != null) syncScroll(dv, dv.needsScrollSync)
-
-      updating = false;
-    }
-    function setDealign(fast) {
-      if (updating) return;
-      dv.dealigned = true;
-      set(fast);
-    }
-    function set(fast) {
-      if (updating || updatingFast) return;
-      clearTimeout(debounceChange);
-      if (fast === true) updatingFast = true;
-      debounceChange = setTimeout(update, fast === true ? 20 : 250);
-    }
-    function change(_cm, change) {
-      if (!dv.diffOutOfDate) {
-        dv.diffOutOfDate = true;
-        edit.from = edit.to = orig.from = orig.to = 0;
-      }
-      // Update faster when a line was added/removed
-      setDealign(change.text.length - 1 != change.to.line - change.from.line);
-    }
-    function swapDoc() {
-      dv.diffOutOfDate = true;
-      dv.dealigned = true;
-      update("full");
-    }
-    dv.edit.on("change", change);
-    dv.orig.on("change", change);
-    dv.edit.on("swapDoc", swapDoc);
-    dv.orig.on("swapDoc", swapDoc);
-    if (dv.mv.options.connect == "align") {
-      CodeMirror.on(dv.edit.state.trackAlignable, "realign", setDealign)
-      CodeMirror.on(dv.orig.state.trackAlignable, "realign", setDealign)
-    }
-    dv.edit.on("viewportChange", function() { set(false); });
-    dv.orig.on("viewportChange", function() { set(false); });
-    update();
-    return update;
-  }
-
-  function registerScroll(dv, otherDv) {
-    dv.edit.on("scroll", function() {
-      syncScroll(dv, true) && makeConnections(dv);
-    });
-    dv.orig.on("scroll", function() {
-      syncScroll(dv, false) && makeConnections(dv);
-      if (otherDv) syncScroll(otherDv, true) && makeConnections(otherDv);
-    });
-  }
-
-  function syncScroll(dv, toOrig) {
-    // Change handler will do a refresh after a timeout when diff is out of date
-    if (dv.diffOutOfDate) {
-      if (dv.lockScroll && dv.needsScrollSync == null) dv.needsScrollSync = toOrig
-      return false
-    }
-    dv.needsScrollSync = null
-    if (!dv.lockScroll) return true;
-    var editor, other, now = +new Date;
-    if (toOrig) { editor = dv.edit; other = dv.orig; }
-    else { editor = dv.orig; other = dv.edit; }
-    // Don't take action if the position of this editor was recently set
-    // (to prevent feedback loops)
-    if (editor.state.scrollSetBy == dv && (editor.state.scrollSetAt || 0) + 250 > now) return false;
-
-    var sInfo = editor.getScrollInfo();
-    if (dv.mv.options.connect == "align") {
-      targetPos = sInfo.top;
-    } else {
-      var halfScreen = .5 * sInfo.clientHeight, midY = sInfo.top + halfScreen;
-      var mid = editor.lineAtHeight(midY, "local");
-      var around = chunkBoundariesAround(dv.chunks, mid, toOrig);
-      var off = getOffsets(editor, toOrig ? around.edit : around.orig);
-      var offOther = getOffsets(other, toOrig ? around.orig : around.edit);
-      var ratio = (midY - off.top) / (off.bot - off.top);
-      var targetPos = (offOther.top - halfScreen) + ratio * (offOther.bot - offOther.top);
-
-      var botDist, mix;
-      // Some careful tweaking to make sure no space is left out of view
-      // when scrolling to top or bottom.
-      if (targetPos > sInfo.top && (mix = sInfo.top / halfScreen) < 1) {
-        targetPos = targetPos * mix + sInfo.top * (1 - mix);
-      } else if ((botDist = sInfo.height - sInfo.clientHeight - sInfo.top) < halfScreen) {
-        var otherInfo = other.getScrollInfo();
-        var botDistOther = otherInfo.height - otherInfo.clientHeight - targetPos;
-        if (botDistOther > botDist && (mix = botDist / halfScreen) < 1)
-          targetPos = targetPos * mix + (otherInfo.height - otherInfo.clientHeight - botDist) * (1 - mix);
-      }
-    }
-
-    other.scrollTo(sInfo.left, targetPos);
-    other.state.scrollSetAt = now;
-    other.state.scrollSetBy = dv;
-    return true;
-  }
-
-  function getOffsets(editor, around) {
-    var bot = around.after;
-    if (bot == null) bot = editor.lastLine() + 1;
-    return {top: editor.heightAtLine(around.before || 0, "local"),
-            bot: editor.heightAtLine(bot, "local")};
-  }
-
-  function setScrollLock(dv, val, action) {
-    dv.lockScroll = val;
-    if (val && action != false) syncScroll(dv, DIFF_INSERT) && makeConnections(dv);
-    dv.lockButton.innerHTML = val ? "\u21db\u21da" : "\u21db&nbsp;&nbsp;\u21da";
-  }
-
-  // Updating the marks for editor content
-
-  function removeClass(editor, line, classes) {
-    var locs = classes.classLocation
-    for (var i = 0; i < locs.length; i++) {
-      editor.removeLineClass(line, locs[i], classes.chunk);
-      editor.removeLineClass(line, locs[i], classes.start);
-      editor.removeLineClass(line, locs[i], classes.end);
-    }
-  }
-
-  function clearMarks(editor, arr, classes) {
-    for (var i = 0; i < arr.length; ++i) {
-      var mark = arr[i];
-      if (mark instanceof CodeMirror.TextMarker)
-        mark.clear();
-      else if (mark.parent)
-        removeClass(editor, mark, classes);
-    }
-    arr.length = 0;
-  }
-
-  // FIXME maybe add a margin around viewport to prevent too many updates
-  function updateMarks(editor, diff, state, type, classes) {
-    var vp = editor.getViewport();
-    editor.operation(function() {
-      if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
-        clearMarks(editor, state.marked, classes);
-        markChanges(editor, diff, type, state.marked, vp.from, vp.to, classes);
-        state.from = vp.from; state.to = vp.to;
-      } else {
-        if (vp.from < state.from) {
-          markChanges(editor, diff, type, state.marked, vp.from, state.from, classes);
-          state.from = vp.from;
-        }
-        if (vp.to > state.to) {
-          markChanges(editor, diff, type, state.marked, state.to, vp.to, classes);
-          state.to = vp.to;
-        }
-      }
-    });
-  }
-
-  function addClass(editor, lineNr, classes, main, start, end) {
-    var locs = classes.classLocation, line = editor.getLineHandle(lineNr);
-    for (var i = 0; i < locs.length; i++) {
-      if (main) editor.addLineClass(line, locs[i], classes.chunk);
-      if (start) editor.addLineClass(line, locs[i], classes.start);
-      if (end) editor.addLineClass(line, locs[i], classes.end);
-    }
-    return line;
-  }
-
-  function markChanges(editor, diff, type, marks, from, to, classes) {
-    var pos = Pos(0, 0);
-    var top = Pos(from, 0), bot = editor.clipPos(Pos(to - 1));
-    var cls = type == DIFF_DELETE ? classes.del : classes.insert;
-    function markChunk(start, end) {
-      var bfrom = Math.max(from, start), bto = Math.min(to, end);
-      for (var i = bfrom; i < bto; ++i)
-        marks.push(addClass(editor, i, classes, true, i == start, i == end - 1));
-      // When the chunk is empty, make sure a horizontal line shows up
-      if (start == end && bfrom == end && bto == end) {
-        if (bfrom)
-          marks.push(addClass(editor, bfrom - 1, classes, false, false, true));
-        else
-          marks.push(addClass(editor, bfrom, classes, false, true, false));
-      }
-    }
-
-    var chunkStart = 0, pending = false;
-    for (var i = 0; i < diff.length; ++i) {
-      var part = diff[i], tp = part[0], str = part[1];
-      if (tp == DIFF_EQUAL) {
-        var cleanFrom = pos.line + (startOfLineClean(diff, i) ? 0 : 1);
-        moveOver(pos, str);
-        var cleanTo = pos.line + (endOfLineClean(diff, i) ? 1 : 0);
-        if (cleanTo > cleanFrom) {
-          if (pending) { markChunk(chunkStart, cleanFrom); pending = false }
-          chunkStart = cleanTo;
-        }
-      } else {
-        pending = true
-        if (tp == type) {
-          var end = moveOver(pos, str, true);
-          var a = posMax(top, pos), b = posMin(bot, end);
-          if (!posEq(a, b))
-            marks.push(editor.markText(a, b, {className: cls}));
-          pos = end;
-        }
-      }
-    }
-    if (pending) markChunk(chunkStart, pos.line + 1);
-  }
-
-  // Updating the gap between editor and original
-
-  function makeConnections(dv) {
-    if (!dv.showDifferences) return;
-
-    if (dv.svg) {
-      clear(dv.svg);
-      var w = dv.gap.offsetWidth;
-      attrs(dv.svg, "width", w, "height", dv.gap.offsetHeight);
-    }
-    if (dv.copyButtons) clear(dv.copyButtons);
-
-    var vpEdit = dv.edit.getViewport(), vpOrig = dv.orig.getViewport();
-    var outerTop = dv.mv.wrap.getBoundingClientRect().top
-    var sTopEdit = outerTop - dv.edit.getScrollerElement().getBoundingClientRect().top + dv.edit.getScrollInfo().top
-    var sTopOrig = outerTop - dv.orig.getScrollerElement().getBoundingClientRect().top + dv.orig.getScrollInfo().top;
-    for (var i = 0; i < dv.chunks.length; i++) {
-      var ch = dv.chunks[i];
-      if (ch.editFrom <= vpEdit.to && ch.editTo >= vpEdit.from &&
-          ch.origFrom <= vpOrig.to && ch.origTo >= vpOrig.from)
-        drawConnectorsForChunk(dv, ch, sTopOrig, sTopEdit, w);
-    }
-  }
-
-  function getMatchingOrigLine(editLine, chunks) {
-    var editStart = 0, origStart = 0;
-    for (var i = 0; i < chunks.length; i++) {
-      var chunk = chunks[i];
-      if (chunk.editTo > editLine && chunk.editFrom <= editLine) return null;
-      if (chunk.editFrom > editLine) break;
-      editStart = chunk.editTo;
-      origStart = chunk.origTo;
-    }
-    return origStart + (editLine - editStart);
-  }
-
-  // Combines information about chunks and widgets/markers to return
-  // an array of lines, in a single editor, that probably need to be
-  // aligned with their counterparts in the editor next to it.
-  function alignableFor(cm, chunks, isOrig) {
-    var tracker = cm.state.trackAlignable
-    var start = cm.firstLine(), trackI = 0
-    var result = []
-    for (var i = 0;; i++) {
-      var chunk = chunks[i]
-      var chunkStart = !chunk ? 1e9 : isOrig ? chunk.origFrom : chunk.editFrom
-      for (; trackI < tracker.alignable.length; trackI += 2) {
-        var n = tracker.alignable[trackI] + 1
-        if (n <= start) continue
-        if (n <= chunkStart) result.push(n)
-        else break
-      }
-      if (!chunk) break
-      result.push(start = isOrig ? chunk.origTo : chunk.editTo)
-    }
-    return result
-  }
-
-  // Given information about alignable lines in two editors, fill in
-  // the result (an array of three-element arrays) to reflect the
-  // lines that need to be aligned with each other.
-  function mergeAlignable(result, origAlignable, chunks, setIndex) {
-    var rI = 0, origI = 0, chunkI = 0, diff = 0
-    outer: for (;; rI++) {
-      var nextR = result[rI], nextO = origAlignable[origI]
-      if (!nextR && nextO == null) break
-
-      var rLine = nextR ? nextR[0] : 1e9, oLine = nextO == null ? 1e9 : nextO
-      while (chunkI < chunks.length) {
-        var chunk = chunks[chunkI]
-        if (chunk.origFrom <= oLine && chunk.origTo > oLine) {
-          origI++
-          rI--
-          continue outer;
-        }
-        if (chunk.editTo > rLine) {
-          if (chunk.editFrom <= rLine) continue outer;
-          break
-        }
-        diff += (chunk.origTo - chunk.origFrom) - (chunk.editTo - chunk.editFrom)
-        chunkI++
-      }
-      if (rLine == oLine - diff) {
-        nextR[setIndex] = oLine
-        origI++
-      } else if (rLine < oLine - diff) {
-        nextR[setIndex] = rLine + diff
-      } else {
-        var record = [oLine - diff, null, null]
-        record[setIndex] = oLine
-        result.splice(rI, 0, record)
-        origI++
-      }
-    }
-  }
-
-  function findAlignedLines(dv, other) {
-    var alignable = alignableFor(dv.edit, dv.chunks, false), result = []
-    if (other) for (var i = 0, j = 0; i < other.chunks.length; i++) {
-      var n = other.chunks[i].editTo
-      while (j < alignable.length && alignable[j] < n) j++
-      if (j == alignable.length || alignable[j] != n) alignable.splice(j++, 0, n)
-    }
-    for (var i = 0; i < alignable.length; i++)
-      result.push([alignable[i], null, null])
-
-    mergeAlignable(result, alignableFor(dv.orig, dv.chunks, true), dv.chunks, 1)
-    if (other)
-      mergeAlignable(result, alignableFor(other.orig, other.chunks, true), other.chunks, 2)
-
-    return result
-  }
-
-  function alignChunks(dv, force) {
-    if (!dv.dealigned && !force) return;
-    if (!dv.orig.curOp) return dv.orig.operation(function() {
-      alignChunks(dv, force);
-    });
-
-    dv.dealigned = false;
-    var other = dv.mv.left == dv ? dv.mv.right : dv.mv.left;
-    if (other) {
-      ensureDiff(other);
-      other.dealigned = false;
-    }
-    var linesToAlign = findAlignedLines(dv, other);
-
-    // Clear old aligners
-    var aligners = dv.mv.aligners;
-    for (var i = 0; i < aligners.length; i++)
-      aligners[i].clear();
-    aligners.length = 0;
-
-    var cm = [dv.edit, dv.orig], scroll = [];
-    if (other) cm.push(other.orig);
-    for (var i = 0; i < cm.length; i++)
-      scroll.push(cm[i].getScrollInfo().top);
-
-    for (var ln = 0; ln < linesToAlign.length; ln++)
-      alignLines(cm, linesToAlign[ln], aligners);
-
-    for (var i = 0; i < cm.length; i++)
-      cm[i].scrollTo(null, scroll[i]);
-  }
-
-  function alignLines(cm, lines, aligners) {
-    var maxOffset = 0, offset = [];
-    for (var i = 0; i < cm.length; i++) if (lines[i] != null) {
-      var off = cm[i].heightAtLine(lines[i], "local");
-      offset[i] = off;
-      maxOffset = Math.max(maxOffset, off);
-    }
-    for (var i = 0; i < cm.length; i++) if (lines[i] != null) {
-      var diff = maxOffset - offset[i];
-      if (diff > 1)
-        aligners.push(padAbove(cm[i], lines[i], diff));
-    }
-  }
-
-  function padAbove(cm, line, size) {
-    var above = true;
-    if (line > cm.lastLine()) {
-      line--;
-      above = false;
-    }
-    var elt = document.createElement("div");
-    elt.className = "CodeMirror-merge-spacer";
-    elt.style.height = size + "px"; elt.style.minWidth = "1px";
-    return cm.addLineWidget(line, elt, {height: size, above: above, mergeSpacer: true, handleMouseEvents: true});
-  }
-
-  function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w) {
-    var flip = dv.type == "left";
-    var top = dv.orig.heightAtLine(chunk.origFrom, "local", true) - sTopOrig;
-    if (dv.svg) {
-      var topLpx = top;
-      var topRpx = dv.edit.heightAtLine(chunk.editFrom, "local", true) - sTopEdit;
-      if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; }
-      var botLpx = dv.orig.heightAtLine(chunk.origTo, "local", true) - sTopOrig;
-      var botRpx = dv.edit.heightAtLine(chunk.editTo, "local", true) - sTopEdit;
-      if (flip) { var tmp = botLpx; botLpx = botRpx; botRpx = tmp; }
-      var curveTop = " C " + w/2 + " " + topRpx + " " + w/2 + " " + topLpx + " " + (w + 2) + " " + topLpx;
-      var curveBot = " C " + w/2 + " " + botLpx + " " + w/2 + " " + botRpx + " -1 " + botRpx;
-      attrs(dv.svg.appendChild(document.createElementNS(svgNS, "path")),
-            "d", "M -1 " + topRpx + curveTop + " L " + (w + 2) + " " + botLpx + curveBot + " z",
-            "class", dv.classes.connect);
-    }
-    if (dv.copyButtons) {
-      var copy = dv.copyButtons.appendChild(elt("div", dv.type == "left" ? "\u21dd" : "\u21dc",
-                                                "CodeMirror-merge-copy"));
-      var editOriginals = dv.mv.options.allowEditingOriginals;
-      copy.title = editOriginals ? "Push to left" : "Revert chunk";
-      copy.chunk = chunk;
-      copy.style.top = (chunk.origTo > chunk.origFrom ? top : dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit) + "px";
-
-      if (editOriginals) {
-        var topReverse = dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit;
-        var copyReverse = dv.copyButtons.appendChild(elt("div", dv.type == "right" ? "\u21dd" : "\u21dc",
-                                                         "CodeMirror-merge-copy-reverse"));
-        copyReverse.title = "Push to right";
-        copyReverse.chunk = {editFrom: chunk.origFrom, editTo: chunk.origTo,
-                             origFrom: chunk.editFrom, origTo: chunk.editTo};
-        copyReverse.style.top = topReverse + "px";
-        dv.type == "right" ? copyReverse.style.left = "2px" : copyReverse.style.right = "2px";
-      }
-    }
-  }
-
-  function copyChunk(dv, to, from, chunk) {
-    if (dv.diffOutOfDate) return;
-    var origStart = chunk.origTo > from.lastLine() ? Pos(chunk.origFrom - 1) : Pos(chunk.origFrom, 0)
-    var origEnd = Pos(chunk.origTo, 0)
-    var editStart = chunk.editTo > to.lastLine() ? Pos(chunk.editFrom - 1) : Pos(chunk.editFrom, 0)
-    var editEnd = Pos(chunk.editTo, 0)
-    var handler = dv.mv.options.revertChunk
-    if (handler)
-      handler(dv.mv, from, origStart, origEnd, to, editStart, editEnd)
-    else
-      to.replaceRange(from.getRange(origStart, origEnd), editStart, editEnd)
-  }
-
-  // Merge view, containing 0, 1, or 2 diff views.
-
-  var MergeView = CodeMirror.MergeView = function(node, options) {
-    if (!(this instanceof MergeView)) return new MergeView(node, options);
-
-    this.options = options;
-    var origLeft = options.origLeft, origRight = options.origRight == null ? options.orig : options.origRight;
-
-    var hasLeft = origLeft != null, hasRight = origRight != null;
-    var panes = 1 + (hasLeft ? 1 : 0) + (hasRight ? 1 : 0);
-    var wrap = [], left = this.left = null, right = this.right = null;
-    var self = this;
-
-    if (hasLeft) {
-      left = this.left = new DiffView(this, "left");
-      var leftPane = elt("div", null, "CodeMirror-merge-pane CodeMirror-merge-left");
-      wrap.push(leftPane);
-      wrap.push(buildGap(left));
-    }
-
-    var editPane = elt("div", null, "CodeMirror-merge-pane CodeMirror-merge-editor");
-    wrap.push(editPane);
-
-    if (hasRight) {
-      right = this.right = new DiffView(this, "right");
-      wrap.push(buildGap(right));
-      var rightPane = elt("div", null, "CodeMirror-merge-pane CodeMirror-merge-right");
-      wrap.push(rightPane);
-    }
-
-    (hasRight ? rightPane : editPane).className += " CodeMirror-merge-pane-rightmost";
-
-    wrap.push(elt("div", null, null, "height: 0; clear: both;"));
-
-    var wrapElt = this.wrap = node.appendChild(elt("div", wrap, "CodeMirror-merge CodeMirror-merge-" + panes + "pane"));
-    this.edit = CodeMirror(editPane, copyObj(options));
-
-    if (left) left.init(leftPane, origLeft, options);
-    if (right) right.init(rightPane, origRight, options);
-    if (options.collapseIdentical)
-      this.editor().operation(function() {
-        collapseIdenticalStretches(self, options.collapseIdentical);
-      });
-    if (options.connect == "align") {
-      this.aligners = [];
-      alignChunks(this.left || this.right, true);
-    }
-    if (left) left.registerEvents(right)
-    if (right) right.registerEvents(left)
-
-
-    var onResize = function() {
-      if (left) makeConnections(left);
-      if (right) makeConnections(right);
-    };
-    CodeMirror.on(window, "resize", onResize);
-    var resizeInterval = setInterval(function() {
-      for (var p = wrapElt.parentNode; p && p != document.body; p = p.parentNode) {}
-      if (!p) { clearInterval(resizeInterval); CodeMirror.off(window, "resize", onResize); }
-    }, 5000);
-  };
-
-  function buildGap(dv) {
-    var lock = dv.lockButton = elt("div", null, "CodeMirror-merge-scrolllock");
-    lock.title = "Toggle locked scrolling";
-    var lockWrap = elt("div", [lock], "CodeMirror-merge-scrolllock-wrap");
-    CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); });
-    var gapElts = [lockWrap];
-    if (dv.mv.options.revertButtons !== false) {
-      dv.copyButtons = elt("div", null, "CodeMirror-merge-copybuttons-" + dv.type);
-      CodeMirror.on(dv.copyButtons, "click", function(e) {
-        var node = e.target || e.srcElement;
-        if (!node.chunk) return;
-        if (node.className == "CodeMirror-merge-copy-reverse") {
-          copyChunk(dv, dv.orig, dv.edit, node.chunk);
-          return;
-        }
-        copyChunk(dv, dv.edit, dv.orig, node.chunk);
-      });
-      gapElts.unshift(dv.copyButtons);
-    }
-    if (dv.mv.options.connect != "align") {
-      var svg = document.createElementNS && document.createElementNS(svgNS, "svg");
-      if (svg && !svg.createSVGRect) svg = null;
-      dv.svg = svg;
-      if (svg) gapElts.push(svg);
-    }
-
-    return dv.gap = elt("div", gapElts, "CodeMirror-merge-gap");
-  }
-
-  MergeView.prototype = {
-    constructor: MergeView,
-    editor: function() { return this.edit; },
-    rightOriginal: function() { return this.right && this.right.orig; },
-    leftOriginal: function() { return this.left && this.left.orig; },
-    setShowDifferences: function(val) {
-      if (this.right) this.right.setShowDifferences(val);
-      if (this.left) this.left.setShowDifferences(val);
-    },
-    rightChunks: function() {
-      if (this.right) { ensureDiff(this.right); return this.right.chunks; }
-    },
-    leftChunks: function() {
-      if (this.left) { ensureDiff(this.left); return this.left.chunks; }
-    }
-  };
-
-  function asString(obj) {
-    if (typeof obj == "string") return obj;
-    else return obj.getValue();
-  }
-
-  // Operations on diffs
-
-  var dmp = new diff_match_patch();
-  function getDiff(a, b, ignoreWhitespace) {
-    var diff = dmp.diff_main(a, b);
-    // The library sometimes leaves in empty parts, which confuse the algorithm
-    for (var i = 0; i < diff.length; ++i) {
-      var part = diff[i];
-      if (ignoreWhitespace ? !/[^ \t]/.test(part[1]) : !part[1]) {
-        diff.splice(i--, 1);
-      } else if (i && diff[i - 1][0] == part[0]) {
-        diff.splice(i--, 1);
-        diff[i][1] += part[1];
-      }
-    }
-    return diff;
-  }
-
-  function getChunks(diff) {
-    var chunks = [];
-    var startEdit = 0, startOrig = 0;
-    var edit = Pos(0, 0), orig = Pos(0, 0);
-    for (var i = 0; i < diff.length; ++i) {
-      var part = diff[i], tp = part[0];
-      if (tp == DIFF_EQUAL) {
-        var startOff = !startOfLineClean(diff, i) || edit.line < startEdit || orig.line < startOrig ? 1 : 0;
-        var cleanFromEdit = edit.line + startOff, cleanFromOrig = orig.line + startOff;
-        moveOver(edit, part[1], null, orig);
-        var endOff = endOfLineClean(diff, i) ? 1 : 0;
-        var cleanToEdit = edit.line + endOff, cleanToOrig = orig.line + endOff;
-        if (cleanToEdit > cleanFromEdit) {
-          if (i) chunks.push({origFrom: startOrig, origTo: cleanFromOrig,
-                              editFrom: startEdit, editTo: cleanFromEdit});
-          startEdit = cleanToEdit; startOrig = cleanToOrig;
-        }
-      } else {
-        moveOver(tp == DIFF_INSERT ? edit : orig, part[1]);
-      }
-    }
-    if (startEdit <= edit.line || startOrig <= orig.line)
-      chunks.push({origFrom: startOrig, origTo: orig.line + 1,
-                   editFrom: startEdit, editTo: edit.line + 1});
-    return chunks;
-  }
-
-  function endOfLineClean(diff, i) {
-    if (i == diff.length - 1) return true;
-    var next = diff[i + 1][1];
-    if ((next.length == 1 && i < diff.length - 2) || next.charCodeAt(0) != 10) return false;
-    if (i == diff.length - 2) return true;
-    next = diff[i + 2][1];
-    return (next.length > 1 || i == diff.length - 3) && next.charCodeAt(0) == 10;
-  }
-
-  function startOfLineClean(diff, i) {
-    if (i == 0) return true;
-    var last = diff[i - 1][1];
-    if (last.charCodeAt(last.length - 1) != 10) return false;
-    if (i == 1) return true;
-    last = diff[i - 2][1];
-    return last.charCodeAt(last.length - 1) == 10;
-  }
-
-  function chunkBoundariesAround(chunks, n, nInEdit) {
-    var beforeE, afterE, beforeO, afterO;
-    for (var i = 0; i < chunks.length; i++) {
-      var chunk = chunks[i];
-      var fromLocal = nInEdit ? chunk.editFrom : chunk.origFrom;
-      var toLocal = nInEdit ? chunk.editTo : chunk.origTo;
-      if (afterE == null) {
-        if (fromLocal > n) { afterE = chunk.editFrom; afterO = chunk.origFrom; }
-        else if (toLocal > n) { afterE = chunk.editTo; afterO = chunk.origTo; }
-      }
-      if (toLocal <= n) { beforeE = chunk.editTo; beforeO = chunk.origTo; }
-      else if (fromLocal <= n) { beforeE = chunk.editFrom; beforeO = chunk.origFrom; }
-    }
-    return {edit: {before: beforeE, after: afterE}, orig: {before: beforeO, after: afterO}};
-  }
-
-  function collapseSingle(cm, from, to) {
-    cm.addLineClass(from, "wrap", "CodeMirror-merge-collapsed-line");
-    var widget = document.createElement("span");
-    widget.className = "CodeMirror-merge-collapsed-widget";
-    widget.title = "Identical text collapsed. Click to expand.";
-    var mark = cm.markText(Pos(from, 0), Pos(to - 1), {
-      inclusiveLeft: true,
-      inclusiveRight: true,
-      replacedWith: widget,
-      clearOnEnter: true
-    });
-    function clear() {
-      mark.clear();
-      cm.removeLineClass(from, "wrap", "CodeMirror-merge-collapsed-line");
-    }
-    CodeMirror.on(widget, "click", clear);
-    return {mark: mark, clear: clear};
-  }
-
-  function collapseStretch(size, editors) {
-    var marks = [];
-    function clear() {
-      for (var i = 0; i < marks.length; i++) marks[i].clear();
-    }
-    for (var i = 0; i < editors.length; i++) {
-      var editor = editors[i];
-      var mark = collapseSingle(editor.cm, editor.line, editor.line + size);
-      marks.push(mark);
-      mark.mark.on("clear", clear);
-    }
-    return marks[0].mark;
-  }
-
-  function unclearNearChunks(dv, margin, off, clear) {
-    for (var i = 0; i < dv.chunks.length; i++) {
-      var chunk = dv.chunks[i];
-      for (var l = chunk.editFrom - margin; l < chunk.editTo + margin; l++) {
-        var pos = l + off;
-        if (pos >= 0 && pos < clear.length) clear[pos] = false;
-      }
-    }
-  }
-
-  function collapseIdenticalStretches(mv, margin) {
-    if (typeof margin != "number") margin = 2;
-    var clear = [], edit = mv.editor(), off = edit.firstLine();
-    for (var l = off, e = edit.lastLine(); l <= e; l++) clear.push(true);
-    if (mv.left) unclearNearChunks(mv.left, margin, off, clear);
-    if (mv.right) unclearNearChunks(mv.right, margin, off, clear);
-
-    for (var i = 0; i < clear.length; i++) {
-      if (clear[i]) {
-        var line = i + off;
-        for (var size = 1; i < clear.length - 1 && clear[i + 1]; i++, size++) {}
-        if (size > margin) {
-          var editors = [{line: line, cm: edit}];
-          if (mv.left) editors.push({line: getMatchingOrigLine(line, mv.left.chunks), cm: mv.left.orig});
-          if (mv.right) editors.push({line: getMatchingOrigLine(line, mv.right.chunks), cm: mv.right.orig});
-          var mark = collapseStretch(size, editors);
-          if (mv.options.onCollapse) mv.options.onCollapse(mv, line, size, mark);
-        }
-      }
-    }
-  }
-
-  // General utilities
-
-  function elt(tag, content, className, style) {
-    var e = document.createElement(tag);
-    if (className) e.className = className;
-    if (style) e.style.cssText = style;
-    if (typeof content == "string") e.appendChild(document.createTextNode(content));
-    else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);
-    return e;
-  }
-
-  function clear(node) {
-    for (var count = node.childNodes.length; count > 0; --count)
-      node.removeChild(node.firstChild);
-  }
-
-  function attrs(elt) {
-    for (var i = 1; i < arguments.length; i += 2)
-      elt.setAttribute(arguments[i], arguments[i+1]);
-  }
-
-  function copyObj(obj, target) {
-    if (!target) target = {};
-    for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop];
-    return target;
-  }
-
-  function moveOver(pos, str, copy, other) {
-    var out = copy ? Pos(pos.line, pos.ch) : pos, at = 0;
-    for (;;) {
-      var nl = str.indexOf("\n", at);
-      if (nl == -1) break;
-      ++out.line;
-      if (other) ++other.line;
-      at = nl + 1;
-    }
-    out.ch = (at ? 0 : out.ch) + (str.length - at);
-    if (other) other.ch = (at ? 0 : other.ch) + (str.length - at);
-    return out;
-  }
-
-  // Tracks collapsed markers and line widgets, in order to be able to
-  // accurately align the content of two editors.
-
-  var F_WIDGET = 1, F_WIDGET_BELOW = 2, F_MARKER = 4
-
-  function TrackAlignable(cm) {
-    this.cm = cm
-    this.alignable = []
-    this.height = cm.doc.height
-    var self = this
-    cm.on("markerAdded", function(_, marker) {
-      if (!marker.collapsed) return
-      var found = marker.find(1)
-      if (found != null) self.set(found.line, F_MARKER)
-    })
-    cm.on("markerCleared", function(_, marker, _min, max) {
-      if (max != null && marker.collapsed)
-        self.check(max, F_MARKER, self.hasMarker)
-    })
-    cm.on("markerChanged", this.signal.bind(this))
-    cm.on("lineWidgetAdded", function(_, widget, lineNo) {
-      if (widget.mergeSpacer) return
-      if (widget.above) self.set(lineNo - 1, F_WIDGET_BELOW)
-      else self.set(lineNo, F_WIDGET)
-    })
-    cm.on("lineWidgetCleared", function(_, widget, lineNo) {
-      if (widget.mergeSpacer) return
-      if (widget.above) self.check(lineNo - 1, F_WIDGET_BELOW, self.hasWidgetBelow)
-      else self.check(lineNo, F_WIDGET, self.hasWidget)
-    })
-    cm.on("lineWidgetChanged", this.signal.bind(this))
-    cm.on("change", function(_, change) {
-      var start = change.from.line, nBefore = change.to.line - change.from.line
-      var nAfter = change.text.length - 1, end = start + nAfter
-      if (nBefore || nAfter) self.map(start, nBefore, nAfter)
-      self.check(end, F_MARKER, self.hasMarker)
-      if (nBefore || nAfter) self.check(change.from.line, F_MARKER, self.hasMarker)
-    })
-    cm.on("viewportChange", function() {
-      if (self.cm.doc.height != self.height) self.signal()
-    })
-  }
-
-  TrackAlignable.prototype = {
-    signal: function() {
-      CodeMirror.signal(this, "realign")
-      this.height = this.cm.doc.height
-    },
-
-    set: function(n, flags) {
-      var pos = -1
-      for (; pos < this.alignable.length; pos += 2) {
-        var diff = this.alignable[pos] - n
-        if (diff == 0) {
-          if ((this.alignable[pos + 1] & flags) == flags) return
-          this.alignable[pos + 1] |= flags
-          this.signal()
-          return
-        }
-        if (diff > 0) break
-      }
-      this.signal()
-      this.alignable.splice(pos, 0, n, flags)
-    },
-
-    find: function(n) {
-      for (var i = 0; i < this.alignable.length; i += 2)
-        if (this.alignable[i] == n) return i
-      return -1
-    },
-
-    check: function(n, flag, pred) {
-      var found = this.find(n)
-      if (found == -1 || !(this.alignable[found + 1] & flag)) return
-      if (!pred.call(this, n)) {
-        this.signal()
-        var flags = this.alignable[found + 1] & ~flag
-        if (flags) this.alignable[found + 1] = flags
-        else this.alignable.splice(found, 2)
-      }
-    },
-
-    hasMarker: function(n) {
-      var handle = this.cm.getLineHandle(n)
-      if (handle.markedSpans) for (var i = 0; i < handle.markedSpans.length; i++)
-        if (handle.markedSpans[i].mark.collapsed && handle.markedSpans[i].to != null)
-          return true
-      return false
-    },
-
-    hasWidget: function(n) {
-      var handle = this.cm.getLineHandle(n)
-      if (handle.widgets) for (var i = 0; i < handle.widgets.length; i++)
-        if (!handle.widgets[i].above && !handle.widgets[i].mergeSpacer) return true
-      return false
-    },
-
-    hasWidgetBelow: function(n) {
-      if (n == this.cm.lastLine()) return false
-      var handle = this.cm.getLineHandle(n + 1)
-      if (handle.widgets) for (var i = 0; i < handle.widgets.length; i++)
-        if (handle.widgets[i].above && !handle.widgets[i].mergeSpacer) return true
-      return false
-    },
-
-    map: function(from, nBefore, nAfter) {
-      var diff = nAfter - nBefore, to = from + nBefore, widgetFrom = -1, widgetTo = -1
-      for (var i = 0; i < this.alignable.length; i += 2) {
-        var n = this.alignable[i]
-        if (n == from && (this.alignable[i + 1] & F_WIDGET_BELOW)) widgetFrom = i
-        if (n == to && (this.alignable[i + 1] & F_WIDGET_BELOW)) widgetTo = i
-        if (n <= from) continue
-        else if (n < to) this.alignable.splice(i--, 2)
-        else this.alignable[i] += diff
-      }
-      if (widgetFrom > -1) {
-        var flags = this.alignable[widgetFrom + 1]
-        if (flags == F_WIDGET_BELOW) this.alignable.splice(widgetFrom, 2)
-        else this.alignable[widgetFrom + 1] = flags & ~F_WIDGET_BELOW
-      }
-      if (widgetTo > -1 && nAfter)
-        this.set(from + nAfter, F_WIDGET_BELOW)
-    }
-  }
-
-  function posMin(a, b) { return (a.line - b.line || a.ch - b.ch) < 0 ? a : b; }
-  function posMax(a, b) { return (a.line - b.line || a.ch - b.ch) > 0 ? a : b; }
-  function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
-
-  function findPrevDiff(chunks, start, isOrig) {
-    for (var i = chunks.length - 1; i >= 0; i--) {
-      var chunk = chunks[i];
-      var to = (isOrig ? chunk.origTo : chunk.editTo) - 1;
-      if (to < start) return to;
-    }
-  }
-
-  function findNextDiff(chunks, start, isOrig) {
-    for (var i = 0; i < chunks.length; i++) {
-      var chunk = chunks[i];
-      var from = (isOrig ? chunk.origFrom : chunk.editFrom);
-      if (from > start) return from;
-    }
-  }
-
-  function goNearbyDiff(cm, dir) {
-    var found = null, views = cm.state.diffViews, line = cm.getCursor().line;
-    if (views) for (var i = 0; i < views.length; i++) {
-      var dv = views[i], isOrig = cm == dv.orig;
-      ensureDiff(dv);
-      var pos = dir < 0 ? findPrevDiff(dv.chunks, line, isOrig) : findNextDiff(dv.chunks, line, isOrig);
-      if (pos != null && (found == null || (dir < 0 ? pos > found : pos < found)))
-        found = pos;
-    }
-    if (found != null)
-      cm.setCursor(found, 0);
-    else
-      return CodeMirror.Pass;
-  }
-
-  CodeMirror.commands.goNextDiff = function(cm) {
-    return goNearbyDiff(cm, 1);
-  };
-  CodeMirror.commands.goPrevDiff = function(cm) {
-    return goNearbyDiff(cm, -1);
-  };
-});
+'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(l,w,n){l instanceof String&&(l=String(l));for(var x=l.length,y=0;y<x;y++){var B=l[y];if(w.call(n,B,y,l))return{i:y,v:B}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(l,w,n){l!=Array.prototype&&l!=Object.prototype&&(l[w]=n.value)};
+$jscomp.getGlobal=function(l){return"undefined"!=typeof window&&window===l?l:"undefined"!=typeof global&&null!=global?global:l};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(l,w,n,x){if(w){n=$jscomp.global;l=l.split(".");for(x=0;x<l.length-1;x++){var y=l[x];y in n||(n[y]={});n=n[y]}l=l[l.length-1];x=n[l];w=w(x);w!=x&&null!=w&&$jscomp.defineProperty(n,l,{configurable:!0,writable:!0,value:w})}};
+$jscomp.polyfill("Array.prototype.find",function(l){return l?l:function(l,n){return $jscomp.findInternal(this,l,n).v}},"es6-impl","es3");
+(function(l){"object"==typeof exports&&"object"==typeof module?l(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],l):l(CodeMirror)})(function(l){function w(a,b){this.mv=a;this.type=b;this.classes="left"==b?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",
+start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}function n(a){a.diffOutOfDate&&(a.diff=R(a.orig.getValue(),a.edit.getValue(),a.mv.options.ignoreWhitespace),a.chunks=S(a.diff),a.diffOutOfDate=!1,l.signal(a.edit,"updateDiff",a.diff))}function x(a){function b(b){F=!0;m=!1;"full"==b&&(a.svg&&G(a.svg),a.copyButtons&&G(a.copyButtons),K(a.edit,h.marked,a.classes),K(a.orig,
+g.marked,a.classes),h.from=h.to=g.from=g.to=0);n(a);a.showDifferences&&(T(a.edit,a.diff,h,DIFF_INSERT,a.classes),T(a.orig,a.diff,g,DIFF_DELETE,a.classes));"align"==a.mv.options.connect&&L(a);C(a);null!=a.needsScrollSync&&B(a,a.needsScrollSync);F=!1}function c(b){F||(a.dealigned=!0,d(b))}function d(a){F||m||(clearTimeout(k),!0===a&&(m=!0),k=setTimeout(b,!0===a?20:250))}function f(b,d){a.diffOutOfDate||(a.diffOutOfDate=!0,h.from=h.to=g.from=g.to=0);c(d.text.length-1!=d.to.line-d.from.line)}function e(){a.diffOutOfDate=
+!0;a.dealigned=!0;b("full")}var h={from:0,to:0,marked:[]},g={from:0,to:0,marked:[]},k,m=!1;a.edit.on("change",f);a.orig.on("change",f);a.edit.on("swapDoc",e);a.orig.on("swapDoc",e);"align"==a.mv.options.connect&&(l.on(a.edit.state.trackAlignable,"realign",c),l.on(a.orig.state.trackAlignable,"realign",c));a.edit.on("viewportChange",function(){d(!1)});a.orig.on("viewportChange",function(){d(!1)});b();return b}function y(a,b){a.edit.on("scroll",function(){B(a,!0)&&C(a)});a.orig.on("scroll",function(){B(a,
+!1)&&C(a);b&&B(b,!0)&&C(b)})}function B(a,b){if(a.diffOutOfDate)return a.lockScroll&&null==a.needsScrollSync&&(a.needsScrollSync=b),!1;a.needsScrollSync=null;if(!a.lockScroll)return!0;var c=+new Date;if(b){var d=a.edit;var f=a.orig}else d=a.orig,f=a.edit;if(d.state.scrollSetBy==a&&(d.state.scrollSetAt||0)+250>c)return!1;var e=d.getScrollInfo();if("align"==a.mv.options.connect)var h=e.top;else{var g=.5*e.clientHeight;h=e.top+g;var k=d.lineAtHeight(h,"local");for(var m=a.chunks,l,r,n,t=0;t<m.length;t++){var p=
+m[t],q=b?p.editFrom:p.origFrom,u=b?p.editTo:p.origTo;null==r&&(q>k?(r=p.editFrom,n=p.origFrom):u>k&&(r=p.editTo,n=p.origTo));if(u<=k){l=p.editTo;var A=p.origTo}else q<=k&&(l=p.editFrom,A=p.origFrom)}k={before:l,after:r};A={before:A,after:n};d=U(d,b?k:A);b=U(f,b?A:k);h=b.top-g+(h-d.top)/(d.bot-d.top)*(b.bot-b.top);var E;h>e.top&&1>(E=e.top/g)?h=h*E+e.top*(1-E):(b=e.height-e.clientHeight-e.top)<g&&(d=f.getScrollInfo(),d.height-d.clientHeight-h>b&&1>(E=b/g)&&(h=h*E+(d.height-d.clientHeight-b)*(1-E)))}f.scrollTo(e.left,
+h);f.state.scrollSetAt=c;f.state.scrollSetBy=a;return!0}function U(a,b){var c=b.after;null==c&&(c=a.lastLine()+1);return{top:a.heightAtLine(b.before||0,"local"),bot:a.heightAtLine(c,"local")}}function V(a,b,c){(a.lockScroll=b)&&0!=c&&B(a,DIFF_INSERT)&&C(a);a.lockButton.innerHTML=b?"\u21db\u21da":"\u21db&nbsp;&nbsp;\u21da"}function K(a,b,c){for(var d=0;d<b.length;++d){var f=b[d];if(f instanceof l.TextMarker)f.clear();else if(f.parent)for(var e=a,h=c,g=h.classLocation,k=0;k<g.length;k++)e.removeLineClass(f,
+g[k],h.chunk),e.removeLineClass(f,g[k],h.start),e.removeLineClass(f,g[k],h.end)}b.length=0}function T(a,b,c,d,f){var e=a.getViewport();a.operation(function(){c.from==c.to||20<e.from-c.to||20<c.from-e.to?(K(a,c.marked,f),M(a,b,d,c.marked,e.from,e.to,f),c.from=e.from,c.to=e.to):(e.from<c.from&&(M(a,b,d,c.marked,e.from,c.from,f),c.from=e.from),e.to>c.to&&(M(a,b,d,c.marked,c.to,e.to,f),c.to=e.to))})}function N(a,b,c,d,f,e){var h=c.classLocation;b=a.getLineHandle(b);for(var g=0;g<h.length;g++)d&&a.addLineClass(b,
+h[g],c.chunk),f&&a.addLineClass(b,h[g],c.start),e&&a.addLineClass(b,h[g],c.end);return b}function M(a,b,c,d,f,e,h){function g(b,c){for(var g=Math.max(f,b),k=Math.min(e,c),m=g;m<k;++m)d.push(N(a,m,h,!0,m==b,m==c-1));b==c&&g==c&&k==c&&(g?d.push(N(a,g-1,h,!1,!1,!0)):d.push(N(a,g,h,!1,!0,!1)))}for(var k=v(0,0),m=v(f,0),l=a.clipPos(v(e-1)),r=c==DIFF_DELETE?h.del:h.insert,n=0,t=!1,p=0;p<b.length;++p){var q=b[p],u=q[0],q=q[1];u==DIFF_EQUAL?(u=k.line+(W(b,p)?0:1),H(k,q),q=k.line+(X(b,p)?1:0),q>u&&(t&&(g(n,
+u),t=!1),n=q)):(t=!0,u==c&&(u=H(k,q,!0),k=0<(m.line-k.line||m.ch-k.ch)?m:k,q=0>(l.line-u.line||l.ch-u.ch)?l:u,k.line==q.line&&k.ch==q.ch||d.push(a.markText(k,q,{className:r})),k=u))}t&&g(n,k.line+1)}function C(a){if(a.showDifferences){if(a.svg){G(a.svg);var b=a.gap.offsetWidth;Y(a.svg,"width",b,"height",a.gap.offsetHeight)}a.copyButtons&&G(a.copyButtons);for(var c=a.edit.getViewport(),d=a.orig.getViewport(),f=a.mv.wrap.getBoundingClientRect().top,e=f-a.edit.getScrollerElement().getBoundingClientRect().top+
+a.edit.getScrollInfo().top,f=f-a.orig.getScrollerElement().getBoundingClientRect().top+a.orig.getScrollInfo().top,h=0;h<a.chunks.length;h++){var g=a.chunks[h];if(g.editFrom<=c.to&&g.editTo>=c.from&&g.origFrom<=d.to&&g.origTo>=d.from){var k=a,m=f,l=e,r=b,n="left"==k.type,t=k.orig.heightAtLine(g.origFrom,"local",!0)-m;if(k.svg){var p=t,q=k.edit.heightAtLine(g.editFrom,"local",!0)-l;if(n){var u=p;p=q;q=u}var m=k.orig.heightAtLine(g.origTo,"local",!0)-m,A=k.edit.heightAtLine(g.editTo,"local",!0)-l;n&&
+(u=m,m=A,A=u);u=" C "+r/2+" "+q+" "+r/2+" "+p+" "+(r+2)+" "+p;n=" C "+r/2+" "+m+" "+r/2+" "+A+" -1 "+A;Y(k.svg.appendChild(document.createElementNS("http://www.w3.org/2000/svg","path")),"d","M -1 "+q+u+" L "+(r+2)+" "+m+n+" z","class",k.classes.connect)}k.copyButtons&&(r=k.copyButtons.appendChild(z("div","left"==k.type?"\u21dd":"\u21dc","CodeMirror-merge-copy")),q=k.mv.options.allowEditingOriginals,r.title=q?"Push to left":"Revert chunk",r.chunk=g,r.style.top=(g.origTo>g.origFrom?t:k.edit.heightAtLine(g.editFrom,
+"local")-l)+"px",q&&(l=k.edit.heightAtLine(g.editFrom,"local")-l,t=k.copyButtons.appendChild(z("div","right"==k.type?"\u21dd":"\u21dc","CodeMirror-merge-copy-reverse")),t.title="Push to right",t.chunk={editFrom:g.origFrom,editTo:g.origTo,origFrom:g.editFrom,origTo:g.editTo},t.style.top=l+"px","right"==k.type?t.style.left="2px":t.style.right="2px"))}}}}function Z(a,b){for(var c=0,d=0,f=0;f<b.length;f++){var e=b[f];if(e.editTo>a&&e.editFrom<=a)return null;if(e.editFrom>a)break;c=e.editTo;d=e.origTo}return d+
+(a-c)}function O(a,b,c){var d=a.state.trackAlignable;a=a.firstLine();for(var f=0,e=[],h=0;;h++){for(var g=b[h],k=g?c?g.origFrom:g.editFrom:1E9;f<d.alignable.length;f+=2){var m=d.alignable[f]+1;if(!(m<=a))if(m<=k)e.push(m);else break}if(!g)break;e.push(a=c?g.origTo:g.editTo)}return e}function aa(a,b,c,d){var f=0,e=0,h=0,g=0;a:for(;;f++){var k=a[f],m=b[e];if(!k&&null==m)break;for(var l=k?k[0]:1E9,m=null==m?1E9:m;h<c.length;){var n=c[h];if(n.origFrom<=m&&n.origTo>m){e++;f--;continue a}if(n.editTo>l){if(n.editFrom<=
+l)continue a;break}g+=n.origTo-n.origFrom-(n.editTo-n.editFrom);h++}l==m-g?(k[d]=m,e++):l<m-g?k[d]=l+g:(k=[m-g,null,null],k[d]=m,a.splice(f,0,k),e++)}}function ha(a,b){var c=O(a.edit,a.chunks,!1),d=[];if(b)for(var f=0,e=0;f<b.chunks.length;f++){for(var h=b.chunks[f].editTo;e<c.length&&c[e]<h;)e++;e!=c.length&&c[e]==h||c.splice(e++,0,h)}for(f=0;f<c.length;f++)d.push([c[f],null,null]);aa(d,O(a.orig,a.chunks,!0),a.chunks,1);b&&aa(d,O(b.orig,b.chunks,!0),b.chunks,2);return d}function L(a,b){if(a.dealigned||
+b){if(!a.orig.curOp)return a.orig.operation(function(){L(a,b)});a.dealigned=!1;var c=a.mv.left==a?a.mv.right:a.mv.left;c&&(n(c),c.dealigned=!1);for(var d=ha(a,c),f=a.mv.aligners,e=0;e<f.length;e++)f[e].clear();f.length=0;var h=[a.edit,a.orig],g=[];c&&h.push(c.orig);for(e=0;e<h.length;e++)g.push(h[e].getScrollInfo().top);for(c=0;c<d.length;c++)ia(h,d[c],f);for(e=0;e<h.length;e++)h[e].scrollTo(null,g[e])}}function ia(a,b,c){for(var d=0,f=[],e=0;e<a.length;e++)if(null!=b[e]){var h=a[e].heightAtLine(b[e],
+"local");f[e]=h;d=Math.max(d,h)}for(e=0;e<a.length;e++)null!=b[e]&&(h=d-f[e],1<h&&c.push(ja(a[e],b[e],h)))}function ja(a,b,c){var d=!0;b>a.lastLine()&&(b--,d=!1);var f=document.createElement("div");f.className="CodeMirror-merge-spacer";f.style.height=c+"px";f.style.minWidth="1px";return a.addLineWidget(b,f,{height:c,above:d,mergeSpacer:!0,handleMouseEvents:!0})}function ba(a,b,c,d){if(!a.diffOutOfDate){var f=d.origTo>c.lastLine()?v(d.origFrom-1):v(d.origFrom,0),e=v(d.origTo,0),h=d.editTo>b.lastLine()?
+v(d.editFrom-1):v(d.editFrom,0);d=v(d.editTo,0);var g=a.mv.options.revertChunk;g?g(a.mv,c,f,e,b,h,d):b.replaceRange(c.getRange(f,e),h,d)}}function ca(a){var b=a.lockButton=z("div",null,"CodeMirror-merge-scrolllock");b.title="Toggle locked scrolling";var c=z("div",[b],"CodeMirror-merge-scrolllock-wrap");l.on(b,"click",function(){V(a,!a.lockScroll)});b=[c];!1!==a.mv.options.revertButtons&&(a.copyButtons=z("div",null,"CodeMirror-merge-copybuttons-"+a.type),l.on(a.copyButtons,"click",function(b){b=b.target||
+b.srcElement;b.chunk&&("CodeMirror-merge-copy-reverse"==b.className?ba(a,a.orig,a.edit,b.chunk):ba(a,a.edit,a.orig,b.chunk))}),b.unshift(a.copyButtons));"align"!=a.mv.options.connect&&((c=document.createElementNS&&document.createElementNS("http://www.w3.org/2000/svg","svg"))&&!c.createSVGRect&&(c=null),(a.svg=c)&&b.push(c));return a.gap=z("div",b,"CodeMirror-merge-gap")}function da(a){return"string"==typeof a?a:a.getValue()}function R(a,b,c){a=ka.diff_main(a,b);for(b=0;b<a.length;++b){var d=a[b];
+(c?/[^ \t]/.test(d[1]):d[1])?b&&a[b-1][0]==d[0]&&(a.splice(b--,1),a[b][1]+=d[1]):a.splice(b--,1)}return a}function S(a){for(var b=[],c=0,d=0,f=v(0,0),e=v(0,0),h=0;h<a.length;++h){var g=a[h],k=g[0];if(k==DIFF_EQUAL){var l=!W(a,h)||f.line<c||e.line<d?1:0,k=f.line+l,l=e.line+l;H(f,g[1],null,e);var n=X(a,h)?1:0,g=f.line+n,n=e.line+n;g>k&&(h&&b.push({origFrom:d,origTo:l,editFrom:c,editTo:k}),c=g,d=n)}else H(k==DIFF_INSERT?f:e,g[1])}(c<=f.line||d<=e.line)&&b.push({origFrom:d,origTo:e.line+1,editFrom:c,
+editTo:f.line+1});return b}function X(a,b){if(b==a.length-1)return!0;var c=a[b+1][1];if(1==c.length&&b<a.length-2||10!=c.charCodeAt(0))return!1;if(b==a.length-2)return!0;c=a[b+2][1];return(1<c.length||b==a.length-3)&&10==c.charCodeAt(0)}function W(a,b){if(0==b)return!0;var c=a[b-1][1];if(10!=c.charCodeAt(c.length-1))return!1;if(1==b)return!0;c=a[b-2][1];return 10==c.charCodeAt(c.length-1)}function la(a,b,c){function d(){e.clear();a.removeLineClass(b,"wrap","CodeMirror-merge-collapsed-line")}a.addLineClass(b,
+"wrap","CodeMirror-merge-collapsed-line");var f=document.createElement("span");f.className="CodeMirror-merge-collapsed-widget";f.title="Identical text collapsed. Click to expand.";var e=a.markText(v(b,0),v(c-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:f,clearOnEnter:!0});l.on(f,"click",d);return{mark:e,clear:d}}function ma(a,b){function c(){for(var a=0;a<d.length;a++)d[a].clear()}for(var d=[],f=0;f<b.length;f++){var e=b[f],e=la(e.cm,e.line,e.line+a);d.push(e);e.mark.on("clear",c)}return d[0].mark}
+function ea(a,b,c,d){for(var f=0;f<a.chunks.length;f++)for(var e=a.chunks[f],h=e.editFrom-b;h<e.editTo+b;h++){var g=h+c;0<=g&&g<d.length&&(d[g]=!1)}}function z(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)a.appendChild(document.createTextNode(b));else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function G(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild)}function Y(a){for(var b=1;b<arguments.length;b+=2)a.setAttribute(arguments[b],
+arguments[b+1])}function P(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function H(a,b,c,d){a=c?v(a.line,a.ch):a;for(c=0;;){var f=b.indexOf("\n",c);if(-1==f)break;++a.line;d&&++d.line;c=f+1}a.ch=(c?0:a.ch)+(b.length-c);d&&(d.ch=(c?0:d.ch)+(b.length-c));return a}function Q(a){this.cm=a;this.alignable=[];this.height=a.doc.height;var b=this;a.on("markerAdded",function(a,d){d.collapsed&&(a=d.find(1),null!=a&&b.set(a.line,I))});a.on("markerCleared",function(a,d,f,e){null!=e&&
+d.collapsed&&b.check(e,I,b.hasMarker)});a.on("markerChanged",this.signal.bind(this));a.on("lineWidgetAdded",function(a,d,f){d.mergeSpacer||(d.above?b.set(f-1,D):b.set(f,fa))});a.on("lineWidgetCleared",function(a,d,f){d.mergeSpacer||(d.above?b.check(f-1,D,b.hasWidgetBelow):b.check(f,fa,b.hasWidget))});a.on("lineWidgetChanged",this.signal.bind(this));a.on("change",function(a,d){a=d.from.line;var c=d.to.line-d.from.line,e=d.text.length-1,h=a+e;(c||e)&&b.map(a,c,e);b.check(h,I,b.hasMarker);(c||e)&&b.check(d.from.line,
+I,b.hasMarker)});a.on("viewportChange",function(){b.cm.doc.height!=b.height&&b.signal()})}function ga(a,b){var c=null,d=a.state.diffViews,f=a.getCursor().line;if(d)for(var e=0;e<d.length;e++){var h=d[e],g=a==h.orig;n(h);if(0>b)a:{for(var h=h.chunks,k=h.length-1;0<=k;k--){var m=h[k],m=(g?m.origTo:m.editTo)-1;if(m<f){g=m;break a}}g=void 0}else a:{h=h.chunks;for(k=0;k<h.length;k++)if(m=h[k],m=g?m.origFrom:m.editFrom,m>f){g=m;break a}g=void 0}null!=g&&(null==c||(0>b?g>c:g<c))&&(c=g)}if(null!=c)a.setCursor(c,
+0);else return l.Pass}var v=l.Pos;w.prototype={constructor:w,init:function(a,b,c){this.edit=this.mv.edit;(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this);this.orig=l(a,P({value:b,readOnly:!this.mv.options.allowEditingOriginals},P(c)));"align"==this.mv.options.connect&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=new Q(this.edit)),this.orig.state.trackAlignable=new Q(this.orig));this.orig.state.diffViews=[this];a=c.chunkClassLocation||"background";"[object Array]"!=
+Object.prototype.toString.call(a)&&(a=[a]);this.classes.classLocation=a;this.diff=R(da(b),da(c.value),this.mv.options.ignoreWhitespace);this.chunks=S(this.diff);this.diffOutOfDate=this.dealigned=!1;this.needsScrollSync=null;this.showDifferences=!1!==c.showDifferences},registerEvents:function(a){this.forceUpdate=x(this);V(this,!0,!1);y(this,a)},setShowDifferences:function(a){a=!1!==a;a!=this.showDifferences&&(this.showDifferences=a,this.forceUpdate("full"))}};var F=!1,J=l.MergeView=function(a,b){if(!(this instanceof
+J))return new J(a,b);this.options=b;var c=b.origLeft,d=null==b.origRight?b.orig:b.origRight,f=null!=c,e=null!=d,h=1+(f?1:0)+(e?1:0),g=[],k=this.left=null,m=this.right=null,n=this;if(f){k=this.left=new w(this,"left");var r=z("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");g.push(r);g.push(ca(k))}f=z("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");g.push(f);if(e){m=this.right=new w(this,"right");g.push(ca(m));var v=z("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");g.push(v)}(e?
+v:f).className+=" CodeMirror-merge-pane-rightmost";g.push(z("div",null,null,"height: 0; clear: both;"));var t=this.wrap=a.appendChild(z("div",g,"CodeMirror-merge CodeMirror-merge-"+h+"pane"));this.edit=l(f,P(b));k&&k.init(r,c,b);m&&m.init(v,d,b);b.collapseIdentical&&this.editor().operation(function(){var a=b.collapseIdentical;"number"!=typeof a&&(a=2);for(var c=[],d=n.editor(),e=d.firstLine(),f=e,g=d.lastLine();f<=g;f++)c.push(!0);n.left&&ea(n.left,a,e,c);n.right&&ea(n.right,a,e,c);for(f=0;f<c.length;f++)if(c[f]){for(var g=
+f+e,h=1;f<c.length-1&&c[f+1];f++,h++);if(h>a){var k=[{line:g,cm:d}];n.left&&k.push({line:Z(g,n.left.chunks),cm:n.left.orig});n.right&&k.push({line:Z(g,n.right.chunks),cm:n.right.orig});k=ma(h,k);if(n.options.onCollapse)n.options.onCollapse(n,g,h,k)}}});"align"==b.connect&&(this.aligners=[],L(this.left||this.right,!0));k&&k.registerEvents(m);m&&m.registerEvents(k);var p=function(){k&&C(k);m&&C(m)};l.on(window,"resize",p);var q=setInterval(function(){for(var a=t.parentNode;a&&a!=document.body;a=a.parentNode);
+a||(clearInterval(q),l.off(window,"resize",p))},5E3)};J.prototype={constructor:J,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(a){this.right&&this.right.setShowDifferences(a);this.left&&this.left.setShowDifferences(a)},rightChunks:function(){if(this.right)return n(this.right),this.right.chunks},leftChunks:function(){if(this.left)return n(this.left),this.left.chunks}};
+var ka=new diff_match_patch,fa=1,D=2,I=4;Q.prototype={signal:function(){l.signal(this,"realign");this.height=this.cm.doc.height},set:function(a,b){for(var c=-1;c<this.alignable.length;c+=2){var d=this.alignable[c]-a;if(0==d){if((this.alignable[c+1]&b)==b)return;this.alignable[c+1]|=b;this.signal();return}if(0<d)break}this.signal();this.alignable.splice(c,0,a,b)},find:function(a){for(var b=0;b<this.alignable.length;b+=2)if(this.alignable[b]==a)return b;return-1},check:function(a,b,c){var d=this.find(a);
+-1!=d&&this.alignable[d+1]&b&&!c.call(this,a)&&(this.signal(),(a=this.alignable[d+1]&~b)?this.alignable[d+1]=a:this.alignable.splice(d,2))},hasMarker:function(a){a=this.cm.getLineHandle(a);if(a.markedSpans)for(var b=0;b<a.markedSpans.length;b++)if(a.markedSpans[b].mark.collapsed&&null!=a.markedSpans[b].to)return!0;return!1},hasWidget:function(a){a=this.cm.getLineHandle(a);if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(!a.widgets[b].above&&!a.widgets[b].mergeSpacer)return!0;return!1},hasWidgetBelow:function(a){if(a==
+this.cm.lastLine())return!1;a=this.cm.getLineHandle(a+1);if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].above&&!a.widgets[b].mergeSpacer)return!0;return!1},map:function(a,b,c){for(var d=c-b,f=a+b,e=b=-1,h=0;h<this.alignable.length;h+=2){var g=this.alignable[h];g==a&&this.alignable[h+1]&D&&(b=h);g==f&&this.alignable[h+1]&D&&(e=h);g<=a||(g<f?this.alignable.splice(h--,2):this.alignable[h]+=d)}-1<b&&(d=this.alignable[b+1],d==D?this.alignable.splice(b,2):this.alignable[b+1]=d&~D);-1<e&&
+c&&this.set(a+c,D)}};l.commands.goNextDiff=function(a){return ga(a,1)};l.commands.goPrevDiff=function(a){return ga(a,-1)}});