@standardnotes/classic-code-editor 1.5.5 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codemirror/addon/comment/comment.js +1 -0
- package/dist/codemirror/addon/comment/continuecomment.js +1 -0
- package/dist/codemirror/addon/dialog/dialog.css +32 -0
- package/dist/codemirror/addon/dialog/dialog.js +1 -0
- package/dist/codemirror/addon/display/autorefresh.js +1 -0
- package/dist/codemirror/addon/display/fullscreen.css +6 -0
- package/dist/codemirror/addon/display/fullscreen.js +1 -0
- package/dist/codemirror/addon/display/panel.js +1 -0
- package/dist/codemirror/addon/display/placeholder.js +1 -0
- package/dist/codemirror/addon/display/rulers.js +1 -0
- package/dist/codemirror/addon/edit/closebrackets.js +1 -0
- package/dist/codemirror/addon/edit/closetag.js +1 -0
- package/dist/codemirror/addon/edit/continuelist.js +1 -0
- package/dist/codemirror/addon/edit/matchbrackets.js +1 -0
- package/dist/codemirror/addon/edit/matchtags.js +1 -0
- package/dist/codemirror/addon/edit/trailingspace.js +1 -0
- package/dist/codemirror/addon/fold/brace-fold.js +1 -0
- package/dist/codemirror/addon/fold/comment-fold.js +1 -0
- package/dist/codemirror/addon/fold/foldcode.js +1 -0
- package/dist/codemirror/addon/fold/foldgutter.css +20 -0
- package/dist/codemirror/addon/fold/foldgutter.js +1 -0
- package/dist/codemirror/addon/fold/indent-fold.js +1 -0
- package/dist/codemirror/addon/fold/markdown-fold.js +1 -0
- package/dist/codemirror/addon/fold/xml-fold.js +1 -0
- package/dist/codemirror/addon/hint/anyword-hint.js +1 -0
- package/dist/codemirror/addon/hint/css-hint.js +1 -0
- package/dist/codemirror/addon/hint/html-hint.js +1 -0
- package/dist/codemirror/addon/hint/javascript-hint.js +1 -0
- package/dist/codemirror/addon/hint/show-hint.css +36 -0
- package/dist/codemirror/addon/hint/show-hint.js +1 -0
- package/dist/codemirror/addon/hint/sql-hint.js +1 -0
- package/dist/codemirror/addon/hint/xml-hint.js +1 -0
- package/dist/codemirror/addon/lint/coffeescript-lint.js +1 -0
- package/dist/codemirror/addon/lint/css-lint.js +1 -0
- package/dist/codemirror/addon/lint/html-lint.js +1 -0
- package/dist/codemirror/addon/lint/javascript-lint.js +1 -0
- package/dist/codemirror/addon/lint/json-lint.js +1 -0
- package/dist/codemirror/addon/lint/lint.css +79 -0
- package/dist/codemirror/addon/lint/lint.js +1 -0
- package/dist/codemirror/addon/lint/yaml-lint.js +1 -0
- package/dist/codemirror/addon/merge/merge.css +119 -0
- package/dist/codemirror/addon/merge/merge.js +1 -0
- package/dist/codemirror/addon/mode/loadmode.js +1 -0
- package/dist/codemirror/addon/mode/multiplex.js +1 -0
- package/dist/codemirror/addon/mode/multiplex_test.js +1 -0
- package/dist/codemirror/addon/mode/overlay.js +1 -0
- package/dist/codemirror/addon/mode/simple.js +1 -0
- package/dist/codemirror/addon/runmode/colorize.js +1 -0
- package/dist/codemirror/addon/runmode/runmode-standalone.js +1 -0
- package/dist/codemirror/addon/runmode/runmode.js +1 -0
- package/dist/codemirror/addon/runmode/runmode.node.js +1 -0
- package/dist/codemirror/addon/scroll/annotatescrollbar.js +1 -0
- package/dist/codemirror/addon/scroll/scrollpastend.js +1 -0
- package/dist/codemirror/addon/scroll/simplescrollbars.css +66 -0
- package/dist/codemirror/addon/scroll/simplescrollbars.js +1 -0
- package/dist/codemirror/addon/search/jump-to-line.js +1 -0
- package/dist/codemirror/addon/search/match-highlighter.js +1 -0
- package/dist/codemirror/addon/search/matchesonscrollbar.css +8 -0
- package/dist/codemirror/addon/search/matchesonscrollbar.js +1 -0
- package/dist/codemirror/addon/search/search.js +1 -0
- package/dist/codemirror/addon/search/searchcursor.js +1 -0
- package/dist/codemirror/addon/selection/active-line.js +1 -0
- package/dist/codemirror/addon/selection/mark-selection.js +1 -0
- package/dist/codemirror/addon/selection/selection-pointer.js +1 -0
- package/dist/codemirror/addon/tern/tern.css +87 -0
- package/dist/codemirror/addon/tern/tern.js +1 -0
- package/dist/codemirror/addon/tern/worker.js +1 -0
- package/dist/codemirror/addon/wrap/hardwrap.js +1 -0
- package/dist/codemirror/keymap/vim.js +1 -0
- package/dist/codemirror/lib/codemirror.css +344 -0
- package/dist/codemirror/lib/codemirror.js +1 -0
- package/dist/codemirror/mode/apl/apl.js +1 -0
- package/dist/codemirror/mode/asciiarmor/asciiarmor.js +1 -0
- package/dist/codemirror/mode/asn.1/asn.1.js +1 -0
- package/dist/codemirror/mode/asterisk/asterisk.js +1 -0
- package/dist/codemirror/mode/brainfuck/brainfuck.js +1 -0
- package/dist/codemirror/mode/clike/clike.js +1 -0
- package/dist/codemirror/mode/clojure/clojure.js +1 -0
- package/dist/codemirror/mode/cmake/cmake.js +1 -0
- package/dist/codemirror/mode/cobol/cobol.js +1 -0
- package/dist/codemirror/mode/coffeescript/coffeescript.js +1 -0
- package/dist/codemirror/mode/commonlisp/commonlisp.js +1 -0
- package/dist/codemirror/mode/crystal/crystal.js +1 -0
- package/dist/codemirror/mode/css/css.js +1 -0
- package/dist/codemirror/mode/cypher/cypher.js +1 -0
- package/dist/codemirror/mode/d/d.js +1 -0
- package/dist/codemirror/mode/dart/dart.js +1 -0
- package/dist/codemirror/mode/diff/diff.js +1 -0
- package/dist/codemirror/mode/django/django.js +1 -0
- package/dist/codemirror/mode/dockerfile/dockerfile.js +1 -0
- package/dist/codemirror/mode/dtd/dtd.js +1 -0
- package/dist/codemirror/mode/dylan/dylan.js +1 -0
- package/dist/codemirror/mode/ebnf/ebnf.js +1 -0
- package/dist/codemirror/mode/ecl/ecl.js +1 -0
- package/dist/codemirror/mode/eiffel/eiffel.js +1 -0
- package/dist/codemirror/mode/elm/elm.js +1 -0
- package/dist/codemirror/mode/erlang/erlang.js +1 -0
- package/dist/codemirror/mode/factor/factor.js +1 -0
- package/dist/codemirror/mode/fcl/fcl.js +1 -0
- package/dist/codemirror/mode/forth/forth.js +1 -0
- package/dist/codemirror/mode/fortran/fortran.js +1 -0
- package/dist/codemirror/mode/gas/gas.js +1 -0
- package/dist/codemirror/mode/gfm/gfm.js +1 -0
- package/dist/codemirror/mode/gherkin/gherkin.js +1 -0
- package/dist/codemirror/mode/go/go.js +1 -0
- package/dist/codemirror/mode/groovy/groovy.js +1 -0
- package/dist/codemirror/mode/haml/haml.js +1 -0
- package/dist/codemirror/mode/handlebars/handlebars.js +1 -0
- package/dist/codemirror/mode/haskell/haskell.js +1 -0
- package/dist/codemirror/mode/haskell-literate/haskell-literate.js +1 -0
- package/dist/codemirror/mode/haxe/haxe.js +1 -0
- package/dist/codemirror/mode/htmlembedded/htmlembedded.js +1 -0
- package/dist/codemirror/mode/htmlmixed/htmlmixed.js +1 -0
- package/dist/codemirror/mode/http/http.js +1 -0
- package/dist/codemirror/mode/idl/idl.js +1 -0
- package/dist/codemirror/mode/javascript/javascript.js +1 -0
- package/dist/codemirror/mode/jinja2/jinja2.js +1 -0
- package/dist/codemirror/mode/jsx/jsx.js +1 -0
- package/dist/codemirror/mode/julia/julia.js +1 -0
- package/dist/codemirror/mode/livescript/livescript.js +1 -0
- package/dist/codemirror/mode/lua/lua.js +1 -0
- package/dist/codemirror/mode/markdown/markdown.js +1 -0
- package/dist/codemirror/mode/mathematica/mathematica.js +1 -0
- package/dist/codemirror/mode/mbox/mbox.js +1 -0
- package/dist/codemirror/mode/meta.js +1 -0
- package/dist/codemirror/mode/mirc/mirc.js +1 -0
- package/dist/codemirror/mode/mllike/mllike.js +1 -0
- package/dist/codemirror/mode/modelica/modelica.js +1 -0
- package/dist/codemirror/mode/mscgen/mscgen.js +1 -0
- package/dist/codemirror/mode/mumps/mumps.js +1 -0
- package/dist/codemirror/mode/nginx/nginx.js +1 -0
- package/dist/codemirror/mode/nsis/nsis.js +1 -0
- package/dist/codemirror/mode/ntriples/ntriples.js +1 -0
- package/dist/codemirror/mode/octave/octave.js +1 -0
- package/dist/codemirror/mode/oz/oz.js +1 -0
- package/dist/codemirror/mode/pascal/pascal.js +1 -0
- package/dist/codemirror/mode/pegjs/pegjs.js +1 -0
- package/dist/codemirror/mode/perl/perl.js +1 -0
- package/dist/codemirror/mode/php/php.js +1 -0
- package/dist/codemirror/mode/pig/pig.js +1 -0
- package/dist/codemirror/mode/powershell/powershell.js +1 -0
- package/dist/codemirror/mode/properties/properties.js +1 -0
- package/dist/codemirror/mode/protobuf/protobuf.js +1 -0
- package/dist/codemirror/mode/pug/pug.js +1 -0
- package/dist/codemirror/mode/puppet/puppet.js +1 -0
- package/dist/codemirror/mode/python/python.js +1 -0
- package/dist/codemirror/mode/q/q.js +1 -0
- package/dist/codemirror/mode/r/r.js +1 -0
- package/dist/codemirror/mode/rpm/changes/index.html +66 -0
- package/dist/codemirror/mode/rpm/rpm.js +1 -0
- package/dist/codemirror/mode/rst/rst.js +1 -0
- package/dist/codemirror/mode/ruby/ruby.js +1 -0
- package/dist/codemirror/mode/rust/rust.js +1 -0
- package/dist/codemirror/mode/sas/sas.js +1 -0
- package/dist/codemirror/mode/sass/sass.js +1 -0
- package/dist/codemirror/mode/scheme/scheme.js +1 -0
- package/dist/codemirror/mode/shell/shell.js +1 -0
- package/dist/codemirror/mode/sieve/sieve.js +1 -0
- package/dist/codemirror/mode/slim/slim.js +1 -0
- package/dist/codemirror/mode/smalltalk/smalltalk.js +1 -0
- package/dist/codemirror/mode/smarty/smarty.js +1 -0
- package/dist/codemirror/mode/solr/solr.js +1 -0
- package/dist/codemirror/mode/soy/soy.js +1 -0
- package/dist/codemirror/mode/sparql/sparql.js +1 -0
- package/dist/codemirror/mode/spreadsheet/spreadsheet.js +1 -0
- package/dist/codemirror/mode/sql/sql.js +1 -0
- package/dist/codemirror/mode/stex/stex.js +1 -0
- package/dist/codemirror/mode/stylus/stylus.js +1 -0
- package/dist/codemirror/mode/swift/swift.js +1 -0
- package/dist/codemirror/mode/tcl/tcl.js +1 -0
- package/dist/codemirror/mode/textile/textile.js +1 -0
- package/dist/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- package/dist/codemirror/mode/tiddlywiki/tiddlywiki.js +1 -0
- package/dist/codemirror/mode/tiki/tiki.css +26 -0
- package/dist/codemirror/mode/tiki/tiki.js +1 -0
- package/dist/codemirror/mode/toml/toml.js +1 -0
- package/dist/codemirror/mode/tornado/tornado.js +1 -0
- package/dist/codemirror/mode/troff/troff.js +1 -0
- package/dist/codemirror/mode/ttcn/ttcn.js +1 -0
- package/dist/codemirror/mode/ttcn-cfg/ttcn-cfg.js +1 -0
- package/dist/codemirror/mode/turtle/turtle.js +1 -0
- package/dist/codemirror/mode/twig/twig.js +1 -0
- package/dist/codemirror/mode/vb/vb.js +1 -0
- package/dist/codemirror/mode/vbscript/vbscript.js +1 -0
- package/dist/codemirror/mode/velocity/velocity.js +1 -0
- package/dist/codemirror/mode/verilog/verilog.js +1 -0
- package/dist/codemirror/mode/vhdl/vhdl.js +1 -0
- package/dist/codemirror/mode/vue/vue.js +1 -0
- package/dist/codemirror/mode/wast/wast.js +1 -0
- package/dist/codemirror/mode/webidl/webidl.js +1 -0
- package/dist/codemirror/mode/xml/xml.js +1 -0
- package/dist/codemirror/mode/xquery/xquery.js +1 -0
- package/dist/codemirror/mode/yacas/yacas.js +1 -0
- package/dist/codemirror/mode/yaml/yaml.js +1 -0
- package/dist/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +1 -0
- package/dist/codemirror/mode/z80/z80.js +1 -0
- package/dist/lib/component-relay.js +1 -0
- package/dist/lib/component-relay.js.LICENSE.txt +1 -0
- package/dist/main.css +3 -0
- package/dist/main.css.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -0
- package/dist/stylekit.css +3242 -0
- package/package.json +2 -3
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
.CodeMirror-merge {
|
|
2
|
+
position: relative;
|
|
3
|
+
border: 1px solid #ddd;
|
|
4
|
+
white-space: pre;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.CodeMirror-merge, .CodeMirror-merge .CodeMirror {
|
|
8
|
+
height: 350px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.CodeMirror-merge-2pane .CodeMirror-merge-pane { width: 47%; }
|
|
12
|
+
.CodeMirror-merge-2pane .CodeMirror-merge-gap { width: 6%; }
|
|
13
|
+
.CodeMirror-merge-3pane .CodeMirror-merge-pane { width: 31%; }
|
|
14
|
+
.CodeMirror-merge-3pane .CodeMirror-merge-gap { width: 3.5%; }
|
|
15
|
+
|
|
16
|
+
.CodeMirror-merge-pane {
|
|
17
|
+
display: inline-block;
|
|
18
|
+
white-space: normal;
|
|
19
|
+
vertical-align: top;
|
|
20
|
+
}
|
|
21
|
+
.CodeMirror-merge-pane-rightmost {
|
|
22
|
+
position: absolute;
|
|
23
|
+
right: 0px;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.CodeMirror-merge-gap {
|
|
28
|
+
z-index: 2;
|
|
29
|
+
display: inline-block;
|
|
30
|
+
height: 100%;
|
|
31
|
+
-moz-box-sizing: border-box;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
border-left: 1px solid #ddd;
|
|
35
|
+
border-right: 1px solid #ddd;
|
|
36
|
+
position: relative;
|
|
37
|
+
background: #f8f8f8;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.CodeMirror-merge-scrolllock-wrap {
|
|
41
|
+
position: absolute;
|
|
42
|
+
bottom: 0; left: 50%;
|
|
43
|
+
}
|
|
44
|
+
.CodeMirror-merge-scrolllock {
|
|
45
|
+
position: relative;
|
|
46
|
+
left: -50%;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
color: #555;
|
|
49
|
+
line-height: 1;
|
|
50
|
+
}
|
|
51
|
+
.CodeMirror-merge-scrolllock:after {
|
|
52
|
+
content: "\21db\00a0\00a0\21da";
|
|
53
|
+
}
|
|
54
|
+
.CodeMirror-merge-scrolllock.CodeMirror-merge-scrolllock-enabled:after {
|
|
55
|
+
content: "\21db\21da";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right {
|
|
59
|
+
position: absolute;
|
|
60
|
+
left: 0; top: 0;
|
|
61
|
+
right: 0; bottom: 0;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.CodeMirror-merge-copy {
|
|
66
|
+
position: absolute;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
color: #44c;
|
|
69
|
+
z-index: 3;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.CodeMirror-merge-copy-reverse {
|
|
73
|
+
position: absolute;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
color: #44c;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy { left: 2px; }
|
|
79
|
+
.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy { right: 2px; }
|
|
80
|
+
|
|
81
|
+
.CodeMirror-merge-r-inserted, .CodeMirror-merge-l-inserted {
|
|
82
|
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);
|
|
83
|
+
background-position: bottom left;
|
|
84
|
+
background-repeat: repeat-x;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.CodeMirror-merge-r-deleted, .CodeMirror-merge-l-deleted {
|
|
88
|
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==);
|
|
89
|
+
background-position: bottom left;
|
|
90
|
+
background-repeat: repeat-x;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.CodeMirror-merge-r-chunk { background: #ffffe0; }
|
|
94
|
+
.CodeMirror-merge-r-chunk-start { border-top: 1px solid #ee8; }
|
|
95
|
+
.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #ee8; }
|
|
96
|
+
.CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #ee8; stroke-width: 1px; }
|
|
97
|
+
|
|
98
|
+
.CodeMirror-merge-l-chunk { background: #eef; }
|
|
99
|
+
.CodeMirror-merge-l-chunk-start { border-top: 1px solid #88e; }
|
|
100
|
+
.CodeMirror-merge-l-chunk-end { border-bottom: 1px solid #88e; }
|
|
101
|
+
.CodeMirror-merge-l-connect { fill: #eef; stroke: #88e; stroke-width: 1px; }
|
|
102
|
+
|
|
103
|
+
.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk { background: #dfd; }
|
|
104
|
+
.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start { border-top: 1px solid #4e4; }
|
|
105
|
+
.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #4e4; }
|
|
106
|
+
|
|
107
|
+
.CodeMirror-merge-collapsed-widget:before {
|
|
108
|
+
content: "(...)";
|
|
109
|
+
}
|
|
110
|
+
.CodeMirror-merge-collapsed-widget {
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
color: #88b;
|
|
113
|
+
background: #eef;
|
|
114
|
+
border: 1px solid #ddf;
|
|
115
|
+
font-size: 90%;
|
|
116
|
+
padding: 0 3px;
|
|
117
|
+
border-radius: 4px;
|
|
118
|
+
}
|
|
119
|
+
.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt { display: none; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],e):e(CodeMirror)}((function(e){"use strict";var t=e.Pos,i="http://www.w3.org/2000/svg";function r(e,t){this.mv=e,this.type=t,this.classes="left"==t?{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(t){t.diffOutOfDate&&(t.diff=L(t.orig.getValue(),t.edit.getValue(),t.mv.options.ignoreWhitespace),t.chunks=D(t.diff),t.diffOutOfDate=!1,e.signal(t.edit,"updateDiff",t.diff))}r.prototype={constructor:r,init:function(t,i,r){this.edit=this.mv.edit,(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this),this.orig=e(t,W({value:i,readOnly:!this.mv.options.allowEditingOriginals},W(r))),"align"==this.mv.options.connect&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=new _(this.edit)),this.orig.state.trackAlignable=new _(this.orig)),this.lockButton.title=this.edit.phrase("Toggle locked scrolling"),this.orig.state.diffViews=[this];var n=r.chunkClassLocation||"background";"[object Array]"!=Object.prototype.toString.call(n)&&(n=[n]),this.classes.classLocation=n,this.diff=L(M(i),M(r.value),this.mv.options.ignoreWhitespace),this.chunks=D(this.diff),this.diffOutOfDate=this.dealigned=!1,this.needsScrollSync=null,this.showDifferences=!1!==r.showDifferences},registerEvents:function(t){this.forceUpdate=function(t){var i,r={from:0,to:0,marked:[]},a={from:0,to:0,marked:[]},s=!1;function c(e){o=!0,s=!1,"full"==e&&(t.svg&&N(t.svg),t.copyButtons&&N(t.copyButtons),h(t.edit,r.marked,t.classes),h(t.orig,a.marked,t.classes),r.from=r.to=a.from=a.to=0),n(t),t.showDifferences&&(f(t.edit,t.diff,r,DIFF_INSERT,t.classes),f(t.orig,t.diff,a,DIFF_DELETE,t.classes)),"align"==t.mv.options.connect&&k(t),u(t),null!=t.needsScrollSync&&l(t,t.needsScrollSync),o=!1}function g(e){o||(t.dealigned=!0,d(e))}function d(e){o||s||(clearTimeout(i),!0===e&&(s=!0),i=setTimeout(c,!0===e?20:250))}function m(e,i){t.diffOutOfDate||(t.diffOutOfDate=!0,r.from=r.to=a.from=a.to=0),g(i.text.length-1!=i.to.line-i.from.line)}function v(){t.diffOutOfDate=!0,t.dealigned=!0,c("full")}return t.edit.on("change",m),t.orig.on("change",m),t.edit.on("swapDoc",v),t.orig.on("swapDoc",v),"align"==t.mv.options.connect&&(e.on(t.edit.state.trackAlignable,"realign",g),e.on(t.orig.state.trackAlignable,"realign",g)),t.edit.on("viewportChange",(function(){d(!1)})),t.orig.on("viewportChange",(function(){d(!1)})),c(),c}(this),s(this,!0,!1),function(e,t){e.edit.on("scroll",(function(){l(e,!0)&&u(e)})),e.orig.on("scroll",(function(){l(e,!1)&&u(e),t&&l(t,!0)&&u(t)}))}(this,t)},setShowDifferences:function(e){(e=!1!==e)!=this.showDifferences&&(this.showDifferences=e,this.forceUpdate("full"))}};var o=!1;function l(e,t){if(e.diffOutOfDate)return e.lockScroll&&null==e.needsScrollSync&&(e.needsScrollSync=t),!1;if(e.needsScrollSync=null,!e.lockScroll)return!0;var i,r,n=+new Date;if(t?(i=e.edit,r=e.orig):(i=e.orig,r=e.edit),i.state.scrollSetBy==e&&(i.state.scrollSetAt||0)+250>n)return!1;var o=i.getScrollInfo();if("align"==e.mv.options.connect)v=o.top;else{var l,s,c=.5*o.clientHeight,h=o.top+c,f=i.lineAtHeight(h,"local"),g=function(e,t,i){for(var r,n,o,l,a=0;a<e.length;a++){var s=e[a],c=i?s.editFrom:s.origFrom,h=i?s.editTo:s.origTo;null==n&&(c>t?(n=s.editFrom,l=s.origFrom):h>t&&(n=s.editTo,l=s.origTo)),h<=t?(r=s.editTo,o=s.origTo):c<=t&&(r=s.editFrom,o=s.origFrom)}return{edit:{before:r,after:n},orig:{before:o,after:l}}}(e.chunks,f,t),d=a(i,t?g.edit:g.orig),u=a(r,t?g.orig:g.edit),m=(h-d.top)/(d.bot-d.top),v=u.top-c+m*(u.bot-u.top);if(v>o.top&&(s=o.top/c)<1)v=v*s+o.top*(1-s);else if((l=o.height-o.clientHeight-o.top)<c){var p=r.getScrollInfo();p.height-p.clientHeight-v>l&&(s=l/c)<1&&(v=v*s+(p.height-p.clientHeight-l)*(1-s))}}return r.scrollTo(o.left,v),r.state.scrollSetAt=n,r.state.scrollSetBy=e,!0}function a(e,t){var i=t.after;return null==i&&(i=e.lastLine()+1),{top:e.heightAtLine(t.before||0,"local"),bot:e.heightAtLine(i,"local")}}function s(t,i,r){t.lockScroll=i,i&&0!=r&&l(t,DIFF_INSERT)&&u(t),(i?e.addClass:e.rmClass)(t.lockButton,"CodeMirror-merge-scrolllock-enabled")}function c(e,t,i){for(var r=i.classLocation,n=0;n<r.length;n++)e.removeLineClass(t,r[n],i.chunk),e.removeLineClass(t,r[n],i.start),e.removeLineClass(t,r[n],i.end)}function h(t,i,r){for(var n=0;n<i.length;++n){var o=i[n];o instanceof e.TextMarker?o.clear():o.parent&&c(t,o,r)}i.length=0}function f(e,t,i,r,n){var o=e.getViewport();e.operation((function(){i.from==i.to||o.from-i.to>20||i.from-o.to>20?(h(e,i.marked,n),d(e,t,r,i.marked,o.from,o.to,n),i.from=o.from,i.to=o.to):(o.from<i.from&&(d(e,t,r,i.marked,o.from,i.from,n),i.from=o.from),o.to>i.to&&(d(e,t,r,i.marked,i.to,o.to,n),i.to=o.to))}))}function g(e,t,i,r,n,o){for(var l=i.classLocation,a=e.getLineHandle(t),s=0;s<l.length;s++)r&&e.addLineClass(a,l[s],i.chunk),n&&e.addLineClass(a,l[s],i.start),o&&e.addLineClass(a,l[s],i.end);return a}function d(e,i,r,n,o,l,a){var s=t(0,0),c=t(o,0),h=e.clipPos(t(l-1)),f=r==DIFF_DELETE?a.del:a.insert;function d(t,i){for(var r=Math.max(o,t),s=Math.min(l,i),c=r;c<s;++c)n.push(g(e,c,a,!0,c==t,c==i-1));t==i&&r==i&&s==i&&(r?n.push(g(e,r-1,a,!1,!1,!0)):n.push(g(e,r,a,!1,!0,!1)))}for(var u=0,m=!1,v=0;v<i.length;++v){var p=i[v],k=p[0],C=p[1];if(k==DIFF_EQUAL){var b=s.line+(E(i,v)?0:1);V(s,C);var w=s.line+(A(i,v)?1:0);w>b&&(m&&(d(u,b),m=!1),u=w)}else if(m=!0,k==r){var T=V(s,C,!0),y=P(c,s),F=H(h,T);j(y,F)||n.push(e.markText(y,F,{className:f})),s=T}}m&&d(u,s.line+1)}function u(e){if(e.showDifferences){if(e.svg){N(e.svg);var t=e.gap.offsetWidth;R(e.svg,"width",t,"height",e.gap.offsetHeight)}e.copyButtons&&N(e.copyButtons);for(var i=e.edit.getViewport(),r=e.orig.getViewport(),n=e.mv.wrap.getBoundingClientRect().top,o=n-e.edit.getScrollerElement().getBoundingClientRect().top+e.edit.getScrollInfo().top,l=n-e.orig.getScrollerElement().getBoundingClientRect().top+e.orig.getScrollInfo().top,a=0;a<e.chunks.length;a++){var s=e.chunks[a];s.editFrom<=i.to&&s.editTo>=i.from&&s.origFrom<=r.to&&s.origTo>=r.from&&w(e,s,l,o,t)}}}function m(e,t){for(var i=0,r=0,n=0;n<t.length;n++){var o=t[n];if(o.editTo>e&&o.editFrom<=e)return null;if(o.editFrom>e)break;i=o.editTo,r=o.origTo}return r+(e-i)}function v(e,t,i){for(var r=e.state.trackAlignable,n=e.firstLine(),o=0,l=[],a=0;;a++){for(var s=t[a],c=s?i?s.origFrom:s.editFrom:1e9;o<r.alignable.length;o+=2){var h=r.alignable[o]+1;if(!(h<=n)){if(!(h<=c))break;l.push(h)}}if(!s)break;l.push(n=i?s.origTo:s.editTo)}return l}function p(e,t,i,r){var n=0,o=0,l=0,a=0;e:for(;;n++){var s=e[n],c=t[o];if(!s&&null==c)break;for(var h=s?s[0]:1e9,f=null==c?1e9:c;l<i.length;){var g=i[l];if(g.origFrom<=f&&g.origTo>f){o++,n--;continue e}if(g.editTo>h){if(g.editFrom<=h)continue e;break}a+=g.origTo-g.origFrom-(g.editTo-g.editFrom),l++}if(h==f-a)s[r]=f,o++;else if(h<f-a)s[r]=h+a;else{var d=[f-a,null,null];d[r]=f,e.splice(n,0,d),o++}}}function k(e,t){if(e.dealigned||t){if(!e.orig.curOp)return e.orig.operation((function(){k(e,t)}));e.dealigned=!1;var i=e.mv.left==e?e.mv.right:e.mv.left;i&&(n(i),i.dealigned=!1);for(var r=function(e,t){var i=v(e.edit,e.chunks,!1),r=[];if(t)for(var n=0,o=0;n<t.chunks.length;n++){for(var l=t.chunks[n].editTo;o<i.length&&i[o]<l;)o++;o!=i.length&&i[o]==l||i.splice(o++,0,l)}for(n=0;n<i.length;n++)r.push([i[n],null,null]);return p(r,v(e.orig,e.chunks,!0),e.chunks,1),t&&p(r,v(t.orig,t.chunks,!0),t.chunks,2),r}(e,i),o=e.mv.aligners,l=0;l<o.length;l++)o[l].clear();o.length=0;var a=[e.edit,e.orig],s=[],c=[];for(i&&a.push(i.orig),l=0;l<a.length;l++)s.push(a[l].getScrollInfo().top),c.push(-a[l].getScrollerElement().getBoundingClientRect().top);(c[0]!=c[1]||3==a.length&&c[1]!=c[2])&&C(a,c,[0,0,0],o);for(var h=0;h<r.length;h++)C(a,c,r[h],o);for(l=0;l<a.length;l++)a[l].scrollTo(null,s[l])}}function C(e,t,i,r){for(var n=-1e8,o=[],l=0;l<e.length;l++)if(null!=i[l]){var a=e[l].heightAtLine(i[l],"local")-t[l];o[l]=a,n=Math.max(n,a)}for(l=0;l<e.length;l++)if(null!=i[l]){var s=n-o[l];s>1&&r.push(b(e[l],i[l],s))}}function b(e,t,i){var r=!0;t>e.lastLine()&&(t--,r=!1);var n=document.createElement("div");return n.className="CodeMirror-merge-spacer",n.style.height=i+"px",n.style.minWidth="1px",e.addLineWidget(t,n,{height:i,above:r,mergeSpacer:!0,handleMouseEvents:!0})}function w(e,t,r,n,o){var l="left"==e.type,a=e.orig.heightAtLine(t.origFrom,"local",!0)-r;if(e.svg){var s=a,c=e.edit.heightAtLine(t.editFrom,"local",!0)-n;if(l){var h=s;s=c,c=h}var f=e.orig.heightAtLine(t.origTo,"local",!0)-r,g=e.edit.heightAtLine(t.editTo,"local",!0)-n;l&&(h=f,f=g,g=h);var d=" C "+o/2+" "+c+" "+o/2+" "+s+" "+(o+2)+" "+s,u=" C "+o/2+" "+f+" "+o/2+" "+g+" -1 "+g;R(e.svg.appendChild(document.createElementNS(i,"path")),"d","M -1 "+c+d+" L "+(o+2)+" "+f+u+" z","class",e.classes.connect)}if(e.copyButtons){var m=e.copyButtons.appendChild(I("div","left"==e.type?"⇝":"⇜","CodeMirror-merge-copy")),v=e.mv.options.allowEditingOriginals;if(m.title=e.edit.phrase(v?"Push to left":"Revert chunk"),m.chunk=t,m.style.top=(t.origTo>t.origFrom?a:e.edit.heightAtLine(t.editFrom,"local")-n)+"px",m.setAttribute("role","button"),v){var p=e.edit.heightAtLine(t.editFrom,"local")-n,k=e.copyButtons.appendChild(I("div","right"==e.type?"⇝":"⇜","CodeMirror-merge-copy-reverse"));k.title="Push to right",k.chunk={editFrom:t.origFrom,editTo:t.origTo,origFrom:t.editFrom,origTo:t.editTo},k.style.top=p+"px","right"==e.type?k.style.left="2px":k.style.right="2px",k.setAttribute("role","button")}}}function T(e,i,r,n){if(!e.diffOutOfDate){var o=n.origTo>r.lastLine()?t(n.origFrom-1):t(n.origFrom,0),l=t(n.origTo,0),a=n.editTo>i.lastLine()?t(n.editFrom-1):t(n.editFrom,0),s=t(n.editTo,0),c=e.mv.options.revertChunk;c?c(e.mv,r,o,l,i,a,s):i.replaceRange(r.getRange(o,l),a,s)}}var y,F=e.MergeView=function(t,i){if(!(this instanceof F))return new F(t,i);this.options=i;var n=i.origLeft,o=null==i.origRight?i.orig:i.origRight,l=null!=n,a=null!=o,s=1+(l?1:0)+(a?1:0),c=[],h=this.left=null,f=this.right=null,g=this;if(l){h=this.left=new r(this,"left");var d=I("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");c.push(d),c.push(S(h))}var v=I("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");if(c.push(v),a){f=this.right=new r(this,"right"),c.push(S(f));var p=I("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");c.push(p)}(a?p:v).className+=" CodeMirror-merge-pane-rightmost",c.push(I("div",null,null,"height: 0; clear: both;"));var C=this.wrap=t.appendChild(I("div",c,"CodeMirror-merge CodeMirror-merge-"+s+"pane"));this.edit=e(v,W(i)),h&&h.init(d,n,i),f&&f.init(p,o,i),i.collapseIdentical&&this.editor().operation((function(){!function(e,t){"number"!=typeof t&&(t=2);for(var i=[],r=e.editor(),n=r.firstLine(),o=n,l=r.lastLine();o<=l;o++)i.push(!0);e.left&&x(e.left,t,n,i),e.right&&x(e.right,t,n,i);for(var a=0;a<i.length;a++)if(i[a]){for(var s=a+n,c=1;a<i.length-1&&i[a+1];a++,c++);if(c>t){var h=[{line:s,cm:r}];e.left&&h.push({line:m(s,e.left.chunks),cm:e.left.orig}),e.right&&h.push({line:m(s,e.right.chunks),cm:e.right.orig});var f=B(c,h);e.options.onCollapse&&e.options.onCollapse(e,s,c,f)}}}(g,i.collapseIdentical)})),"align"==i.connect&&(this.aligners=[],k(this.left||this.right,!0)),h&&h.registerEvents(f),f&&f.registerEvents(h);var b=function(){h&&u(h),f&&u(f)};e.on(window,"resize",b);var w=setInterval((function(){for(var t=C.parentNode;t&&t!=document.body;t=t.parentNode);t||(clearInterval(w),e.off(window,"resize",b))}),5e3)};function S(t){var r=t.lockButton=I("div",null,"CodeMirror-merge-scrolllock");r.setAttribute("role","button");var n=I("div",[r],"CodeMirror-merge-scrolllock-wrap");e.on(r,"click",(function(){s(t,!t.lockScroll)}));var o=[n];if(!1!==t.mv.options.revertButtons&&(t.copyButtons=I("div",null,"CodeMirror-merge-copybuttons-"+t.type),e.on(t.copyButtons,"click",(function(e){var i=e.target||e.srcElement;i.chunk&&("CodeMirror-merge-copy-reverse"!=i.className?T(t,t.edit,t.orig,i.chunk):T(t,t.orig,t.edit,i.chunk))})),o.unshift(t.copyButtons)),"align"!=t.mv.options.connect){var l=document.createElementNS&&document.createElementNS(i,"svg");l&&!l.createSVGRect&&(l=null),t.svg=l,l&&o.push(l)}return t.gap=I("div",o,"CodeMirror-merge-gap")}function M(e){return"string"==typeof e?e:e.getValue()}function L(e,t,i){y||(y=new diff_match_patch);for(var r=y.diff_main(e,t),n=0;n<r.length;++n){var o=r[n];(i?/[^ \t]/.test(o[1]):o[1])?n&&r[n-1][0]==o[0]&&(r.splice(n--,1),r[n][1]+=o[1]):r.splice(n--,1)}return r}function D(e){var i=[];if(!e.length)return i;for(var r=0,n=0,o=t(0,0),l=t(0,0),a=0;a<e.length;++a){var s=e[a],c=s[0];if(c==DIFF_EQUAL){var h=!E(e,a)||o.line<r||l.line<n?1:0,f=o.line+h,g=l.line+h;V(o,s[1],null,l);var d=A(e,a)?1:0,u=o.line+d,m=l.line+d;u>f&&(a&&i.push({origFrom:n,origTo:g,editFrom:r,editTo:f}),r=u,n=m)}else V(c==DIFF_INSERT?o:l,s[1])}return(r<=o.line||n<=l.line)&&i.push({origFrom:n,origTo:l.line+1,editFrom:r,editTo:o.line+1}),i}function A(e,t){if(t==e.length-1)return!0;var i=e[t+1][1];return!(1==i.length&&t<e.length-2||10!=i.charCodeAt(0))&&(t==e.length-2||((i=e[t+2][1]).length>1||t==e.length-3)&&10==i.charCodeAt(0))}function E(e,t){if(0==t)return!0;var i=e[t-1][1];return 10==i.charCodeAt(i.length-1)&&(1==t||10==(i=e[t-2][1]).charCodeAt(i.length-1))}function O(i,r,n){i.addLineClass(r,"wrap","CodeMirror-merge-collapsed-line");var o=document.createElement("span");o.className="CodeMirror-merge-collapsed-widget",o.title=i.phrase("Identical text collapsed. Click to expand.");var l=i.markText(t(r,0),t(n-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:o,clearOnEnter:!0});function a(){l.clear(),i.removeLineClass(r,"wrap","CodeMirror-merge-collapsed-line")}return l.explicitlyCleared&&a(),e.on(o,"click",a),l.on("clear",a),e.on(o,"click",a),{mark:l,clear:a}}function B(e,t){var i=[];function r(){for(var e=0;e<i.length;e++)i[e].clear()}for(var n=0;n<t.length;n++){var o=t[n],l=O(o.cm,o.line,o.line+e);i.push(l),l.mark.on("clear",r)}return i[0].mark}function x(e,t,i,r){for(var n=0;n<e.chunks.length;n++)for(var o=e.chunks[n],l=o.editFrom-t;l<o.editTo+t;l++){var a=l+i;a>=0&&a<r.length&&(r[a]=!1)}}function I(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function N(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild)}function R(e){for(var t=1;t<arguments.length;t+=2)e.setAttribute(arguments[t],arguments[t+1])}function W(e,t){for(var i in t||(t={}),e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function V(e,i,r,n){for(var o=r?t(e.line,e.ch):e,l=0;;){var a=i.indexOf("\n",l);if(-1==a)break;++o.line,n&&++n.line,l=a+1}return o.ch=(l?0:o.ch)+(i.length-l),n&&(n.ch=(l?0:n.ch)+(i.length-l)),o}function _(e){this.cm=e,this.alignable=[],this.height=e.doc.height;var t=this;e.on("markerAdded",(function(e,i){if(i.collapsed){var r=i.find(1);null!=r&&t.set(r.line,4)}})),e.on("markerCleared",(function(e,i,r,n){null!=n&&i.collapsed&&t.check(n,4,t.hasMarker)})),e.on("markerChanged",this.signal.bind(this)),e.on("lineWidgetAdded",(function(e,i,r){i.mergeSpacer||(i.above?t.set(r-1,2):t.set(r,1))})),e.on("lineWidgetCleared",(function(e,i,r){i.mergeSpacer||(i.above?t.check(r-1,2,t.hasWidgetBelow):t.check(r,1,t.hasWidget))})),e.on("lineWidgetChanged",this.signal.bind(this)),e.on("change",(function(e,i){var r=i.from.line,n=i.to.line-i.from.line,o=i.text.length-1,l=r+o;(n||o)&&t.map(r,n,o),t.check(l,4,t.hasMarker),(n||o)&&t.check(i.from.line,4,t.hasMarker)})),e.on("viewportChange",(function(){t.cm.doc.height!=t.height&&t.signal()}))}function H(e,t){return(e.line-t.line||e.ch-t.ch)<0?e:t}function P(e,t){return(e.line-t.line||e.ch-t.ch)>0?e:t}function j(e,t){return e.line==t.line&&e.ch==t.ch}function U(e,t,i){for(var r=e.length-1;r>=0;r--){var n=e[r],o=(i?n.origTo:n.editTo)-1;if(o<t)return o}}function z(e,t,i){for(var r=0;r<e.length;r++){var n=e[r],o=i?n.origFrom:n.editFrom;if(o>t)return o}}function Q(t,i){var r=null,o=t.state.diffViews,l=t.getCursor().line;if(o)for(var a=0;a<o.length;a++){var s=o[a],c=t==s.orig;n(s);var h=i<0?U(s.chunks,l,c):z(s.chunks,l,c);null==h||null!=r&&!(i<0?h>r:h<r)||(r=h)}if(null==r)return e.Pass;t.setCursor(r,0)}F.prototype={constructor:F,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(e){this.right&&this.right.setShowDifferences(e),this.left&&this.left.setShowDifferences(e)},rightChunks:function(){if(this.right)return n(this.right),this.right.chunks},leftChunks:function(){if(this.left)return n(this.left),this.left.chunks}},_.prototype={signal:function(){e.signal(this,"realign"),this.height=this.cm.doc.height},set:function(e,t){for(var i=-1;i<this.alignable.length;i+=2){var r=this.alignable[i]-e;if(0==r){if((this.alignable[i+1]&t)==t)return;return this.alignable[i+1]|=t,void this.signal()}if(r>0)break}this.signal(),this.alignable.splice(i,0,e,t)},find:function(e){for(var t=0;t<this.alignable.length;t+=2)if(this.alignable[t]==e)return t;return-1},check:function(e,t,i){var r=this.find(e);if(-1!=r&&this.alignable[r+1]&t&&!i.call(this,e)){this.signal();var n=this.alignable[r+1]&~t;n?this.alignable[r+1]=n:this.alignable.splice(r,2)}},hasMarker:function(e){var t=this.cm.getLineHandle(e);if(t.markedSpans)for(var i=0;i<t.markedSpans.length;i++)if(t.markedSpans[i].marker.collapsed&&null!=t.markedSpans[i].to)return!0;return!1},hasWidget:function(e){var t=this.cm.getLineHandle(e);if(t.widgets)for(var i=0;i<t.widgets.length;i++)if(!t.widgets[i].above&&!t.widgets[i].mergeSpacer)return!0;return!1},hasWidgetBelow:function(e){if(e==this.cm.lastLine())return!1;var t=this.cm.getLineHandle(e+1);if(t.widgets)for(var i=0;i<t.widgets.length;i++)if(t.widgets[i].above&&!t.widgets[i].mergeSpacer)return!0;return!1},map:function(e,t,i){for(var r=i-t,n=e+t,o=-1,l=-1,a=0;a<this.alignable.length;a+=2){var s=this.alignable[a];s==e&&2&this.alignable[a+1]&&(o=a),s==n&&2&this.alignable[a+1]&&(l=a),s<=e||(s<n?this.alignable.splice(a--,2):this.alignable[a]+=r)}if(o>-1){var c=this.alignable[o+1];2==c?this.alignable.splice(o,2):this.alignable[o+1]=-3&c}l>-1&&i&&this.set(e+i,2)}},e.commands.goNextDiff=function(e){return Q(e,1)},e.commands.goPrevDiff=function(e){return Q(e,-1)}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],(function(o){e(o,"amd")})):e(CodeMirror,"plain")}((function(e,o){e.modeURL||(e.modeURL="../mode/%N/%N.js");var r={};function n(o,r,n){var t=e.modes[o],i=t&&t.dependencies;if(!i)return r();for(var d=[],a=0;a<i.length;++a)e.modes.hasOwnProperty(i[a])||d.push(i[a]);if(!d.length)return r();var f=function(e,o){var r=o;return function(){0==--r&&e()}}(r,d.length);for(a=0;a<d.length;++a)e.requireMode(d[a],f,n)}e.requireMode=function(t,i,d){if("string"!=typeof t&&(t=t.name),e.modes.hasOwnProperty(t))return n(t,i,d);if(r.hasOwnProperty(t))return r[t].push(i);var a=d&&d.path?d.path(t):e.modeURL.replace(/%N/g,t);if(d&&d.loadMode)d.loadMode(a,(function(){n(t,i,d)}));else if("plain"==o){var f=document.createElement("script");f.src=a;var u=document.getElementsByTagName("script")[0],c=r[t]=[i];e.on(f,"load",(function(){n(t,(function(){for(var e=0;e<c.length;++e)c[e]()}),d)})),u.parentNode.insertBefore(f,u)}else"cjs"==o?(require(a),i()):"amd"==o&&requirejs([a],i)},e.autoLoadMode=function(o,r,n){e.modes.hasOwnProperty(r)||e.requireMode(r,(function(){o.setOption("mode",o.getOption("mode"))}),n)}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!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){"use strict";e.multiplexingMode=function(n){var t=Array.prototype.slice.call(arguments,1);function r(e,n,t,r){if("string"==typeof n){var i=e.indexOf(n,t);return r&&i>-1?i+n.length:i}var o=n.exec(t?e.slice(t):e);return o?o.index+t+(r?o[0].length:0):-1}return{startState:function(){return{outer:e.startState(n),innerActive:null,inner:null,startingInner:!1}},copyState:function(t){return{outer:e.copyState(n,t.outer),innerActive:t.innerActive,inner:t.innerActive&&e.copyState(t.innerActive.mode,t.inner),startingInner:t.startingInner}},token:function(i,o){if(o.innerActive){var l=o.innerActive;if(a=i.string,!l.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);if((v=l.close&&!o.startingInner?r(a,l.close,i.pos,l.parseDelimiters):-1)==i.pos&&!l.parseDelimiters)return i.match(l.close),o.innerActive=o.inner=null,l.delimStyle&&l.delimStyle+" "+l.delimStyle+"-close";v>-1&&(i.string=a.slice(0,v));var c=l.mode.token(i,o.inner);return v>-1?i.string=a:i.pos>i.start&&(o.startingInner=!1),v==i.pos&&l.parseDelimiters&&(o.innerActive=o.inner=null),l.innerStyle&&(c=c?c+" "+l.innerStyle:l.innerStyle),c}for(var s=1/0,a=i.string,u=0;u<t.length;++u){var v,d=t[u];if((v=r(a,d.open,i.pos))==i.pos){d.parseDelimiters||i.match(d.open),o.startingInner=!!d.parseDelimiters,o.innerActive=d;var f=0;if(n.indent){var m=n.indent(o.outer,"","");m!==e.Pass&&(f=m)}return o.inner=e.startState(d.mode,f),d.delimStyle&&d.delimStyle+" "+d.delimStyle+"-open"}-1!=v&&v<s&&(s=v)}s!=1/0&&(i.string=a.slice(0,s));var p=n.token(i,o.outer);return s!=1/0&&(i.string=a),p},indent:function(t,r,i){var o=t.innerActive?t.innerActive.mode:n;return o.indent?o.indent(t.innerActive?t.inner:t.outer,r,i):e.Pass},blankLine:function(r){var i=r.innerActive?r.innerActive.mode:n;if(i.blankLine&&i.blankLine(r.innerActive?r.inner:r.outer),r.innerActive)"\n"===r.innerActive.close&&(r.innerActive=r.inner=null);else for(var o=0;o<t.length;++o){var l=t[o];"\n"===l.open&&(r.innerActive=l,r.inner=e.startState(l.mode,i.indent?i.indent(r.outer,"",""):0))}},electricChars:n.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:n}}}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){CodeMirror.defineMode("markdown_with_stex",(function(){var e=CodeMirror.getMode({},"stex"),i=CodeMirror.getMode({},"markdown"),r={open:"$",close:"$",mode:e,delimStyle:"delim",innerStyle:"inner"};return CodeMirror.multiplexingMode(i,r)}));var e=CodeMirror.getMode({},"markdown_with_stex");!function(i){test.mode(i,e,Array.prototype.slice.call(arguments,1),"multiplexing")}("stexInsideMarkdown","[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]"),CodeMirror.defineMode("identical_delim_multiplex",(function(){return CodeMirror.multiplexingMode(CodeMirror.getMode({indentUnit:2},"javascript"),{open:"#",close:"#",mode:CodeMirror.getMode({},"markdown"),parseDelimiters:!0,innerStyle:"q"})}));var i=CodeMirror.getMode({},"identical_delim_multiplex");test.mode("identical_delimiters_with_parseDelimiters",i,["[keyword let] [def x] [operator =] [q #foo][q&em *bar*][q #];"],"multiplexing")}();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!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){"use strict";e.overlayMode=function(o,r,a){return{startState:function(){return{base:e.startState(o),overlay:e.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(a){return{base:e.copyState(o,a.base),overlay:e.copyState(r,a.overlay),basePos:a.basePos,baseCur:null,overlayPos:a.overlayPos,overlayCur:null}},token:function(e,n){return(e!=n.streamSeen||Math.min(n.basePos,n.overlayPos)<e.start)&&(n.streamSeen=e,n.basePos=n.overlayPos=e.start),e.start==n.basePos&&(n.baseCur=o.token(e,n.base),n.basePos=e.pos),e.start==n.overlayPos&&(e.pos=e.start,n.overlayCur=r.token(e,n.overlay),n.overlayPos=e.pos),e.pos=Math.min(n.basePos,n.overlayPos),null==n.overlayCur?n.baseCur:null!=n.baseCur&&n.overlay.combineTokens||a&&null==n.overlay.combineTokens?n.baseCur+" "+n.overlayCur:n.overlayCur},indent:o.indent&&function(e,r,a){return o.indent(e.base,r,a)},electricChars:o.electricChars,innerMode:function(e){return{state:e.base,mode:o}},blankLine:function(e){var n,t;return o.blankLine&&(n=o.blankLine(e.base)),r.blankLine&&(t=r.blankLine(e.overlay)),null==t?n:a&&null!=n?n+" "+t:t}}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!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){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+" in simple mode")}function n(e,t){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e.unicode&&(n+="u"),e=e.source):e=String(e),new RegExp((!1===t?"":"^")+"(?:"+e+")",n)}function a(e,a){(e.next||e.push)&&t(a,e.next||e.push),this.regex=n(e.regex),this.token=function(e){if(!e)return null;if(e.apply)return e;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],n=0;n<e.length;n++)t.push(e[n]&&e[n].replace(/\./g," "));return t}(e.token),this.data=e}function r(e,t){return function(n,a){if(a.pending){var r=a.pending.shift();return 0==a.pending.length&&(a.pending=null),n.pos+=r.text.length,r.token}if(a.local){if(a.local.end&&n.match(a.local.end)){var o=a.local.endToken||null;return a.local=a.localState=null,o}var l;return o=a.local.mode.token(n,a.localState),a.local.endScan&&(l=a.local.endScan.exec(n.current()))&&(n.pos=n.start+l.index),o}for(var s=e[a.state],d=0;d<s.length;d++){var c=s[d],u=(!c.data.sol||n.sol())&&n.match(c.regex);if(u){c.data.next?a.state=c.data.next:c.data.push?((a.stack||(a.stack=[])).push(a.state),a.state=c.data.push):c.data.pop&&a.stack&&a.stack.length&&(a.state=a.stack.pop()),c.data.mode&&i(t,a,c.data.mode,c.token),c.data.indent&&a.indent.push(n.indentation()+t.indentUnit),c.data.dedent&&a.indent.pop();var p=c.token;if(p&&p.apply&&(p=p(u)),u.length>2&&c.token&&"string"!=typeof c.token){for(var f=2;f<u.length;f++)u[f]&&(a.pending||(a.pending=[])).push({text:u[f],token:c.token[f-1]});return n.backUp(u[0].length-(u[1]?u[1].length:0)),p[0]}return p&&p.join?p[0]:p}}return n.next(),null}}function o(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=0;for(var a in e)if(e.hasOwnProperty(a)){if(!t.hasOwnProperty(a)||!o(e[a],t[a]))return!1;n++}for(var a in t)t.hasOwnProperty(a)&&n--;return 0==n}function i(t,a,r,i){var l;if(r.persistent)for(var s=a.persistentStates;s&&!l;s=s.next)(r.spec?o(r.spec,s.spec):r.mode==s.mode)&&(l=s);var d=l?l.mode:r.mode||e.getMode(t,r.spec),c=l?l.state:e.startState(d);r.persistent&&!l&&(a.persistentStates={mode:d,spec:r.spec,state:c,next:a.persistentStates}),a.localState=c,a.local={mode:d,end:r.end&&n(r.end),endScan:r.end&&!1!==r.forceEnd&&n(r.end,!1),endToken:i&&i.join?i[i.length-1]:i}}function l(t,n){return function(a,r,o){if(a.local&&a.local.mode.indent)return a.local.mode.indent(a.localState,r,o);if(null==a.indent||a.local||n.dontIndentStates&&function(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0}(a.state,n.dontIndentStates)>-1)return e.Pass;var i=a.indent.length-1,l=t[a.state];e:for(;;){for(var s=0;s<l.length;s++){var d=l[s];if(d.data.dedent&&!1!==d.data.dedentIfLineStart){var c=d.regex.exec(r);if(c&&c[0]){i--,(d.next||d.push)&&(l=t[d.next||d.push]),r=r.slice(c[0].length);continue e}}}break}return i<0?0:a.indent[i]}}e.defineSimpleMode=function(t,n){e.defineMode(t,(function(t){return e.simpleMode(t,n)}))},e.simpleMode=function(n,o){t(o,"start");var i={},s=o.meta||{},d=!1;for(var c in o)if(c!=s&&o.hasOwnProperty(c))for(var u=i[c]=[],p=o[c],f=0;f<p.length;f++){var h=p[f];u.push(new a(h,o)),(h.indent||h.dedent)&&(d=!0)}var g={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:d?[]:null}},copyState:function(t){var n={state:t.state,pending:t.pending,local:t.local,localState:null,indent:t.indent&&t.indent.slice(0)};t.localState&&(n.localState=e.copyState(t.local.mode,t.localState)),t.stack&&(n.stack=t.stack.slice(0));for(var a=t.persistentStates;a;a=a.next)n.persistentStates={mode:a.mode,spec:a.spec,state:a.state==t.localState?n.localState:e.copyState(a.mode,a.state),next:n.persistentStates};return n},token:r(i,n),innerMode:function(e){return e.local&&{mode:e.local.mode,state:e.localState}},indent:l(i,s)};if(s)for(var S in s)s.hasOwnProperty(S)&&(g[S]=s[S]);return g}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./runmode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./runmode"],e):e(CodeMirror)}((function(e){"use strict";var o=/^(p|li|div|h\\d|pre|blockquote|td)$/;function r(e,n){if(3==e.nodeType)return n.push(e.nodeValue);for(var t=e.firstChild;t;t=t.nextSibling)r(t,n),o.test(e.nodeType)&&n.push("\n")}e.colorize=function(o,n){o||(o=document.body.getElementsByTagName("pre"));for(var t=0;t<o.length;++t){var i=o[t],d=i.getAttribute("data-lang")||n;if(d){var u=[];r(i,u),i.innerHTML="",e.runMode(u.join(""),d,i),i.className+=" cm-s-default"}}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){"use strict";function t(t,e,r){for(var n in e||(e={}),t)!t.hasOwnProperty(n)||!1===r&&e.hasOwnProperty(n)||(e[n]=t[n]);return e}function e(t,e,r,n,i){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=n||0,s=i||0;;){var a=t.indexOf("\t",o);if(a<0||a>=e)return s+(e-o);s+=a-o,s+=r-s%r,o=a+1}}function r(){}var n=function(t,e,r){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};n.prototype.eol=function(){return this.pos>=this.string.length},n.prototype.sol=function(){return this.pos==this.lineStart},n.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},n.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},n.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},n.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},n.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},n.prototype.skipToEnd=function(){this.pos=this.string.length},n.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},n.prototype.backUp=function(t){this.pos-=t},n.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=e(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?e(this.string,this.lineStart,this.tabSize):0)},n.prototype.indentation=function(){return e(this.string,null,this.tabSize)-(this.lineStart?e(this.string,this.lineStart,this.tabSize):0)},n.prototype.match=function(t,e,r){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&!1!==e&&(this.pos+=n[0].length),n)}var i=function(t){return r?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},n.prototype.current=function(){return this.string.slice(this.start,this.pos)},n.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},n.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},n.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var i={},o={};function s(e){if("string"==typeof e&&o.hasOwnProperty(e))e=o[e];else if(e&&"string"==typeof e.name&&o.hasOwnProperty(e.name)){var n=o[e.name];"string"==typeof n&&(n={name:n}),i=n,a=e,Object.create?p=Object.create(i):(r.prototype=i,p=new r),a&&t(a,p),(e=p).name=n.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return s("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return s("application/json")}var i,a,p;return"string"==typeof e?{name:e}:e||{name:"null"}}var a,p={},l={__proto__:null,modes:i,mimeModes:o,defineMode:function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),i[t]=e},defineMIME:function(t,e){o[t]=e},resolveMode:s,getMode:function t(e,r){r=s(r);var n=i[r.name];if(!n)return t(e,"text/plain");var o=n(e,r);if(p.hasOwnProperty(r.name)){var a=p[r.name];for(var l in a)a.hasOwnProperty(l)&&(o.hasOwnProperty(l)&&(o["_"+l]=o[l]),o[l]=a[l])}if(o.name=r.name,r.helperType&&(o.helperType=r.helperType),r.modeProps)for(var u in r.modeProps)o[u]=r.modeProps[u];return o},modeExtensions:p,extendMode:function(e,r){t(r,p.hasOwnProperty(e)?p[e]:p[e]={})},copyState:function(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var r={};for(var n in e){var i=e[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},innerMode:function(t,e){for(var r;t.innerMode&&(r=t.innerMode(e))&&r.mode!=t;)e=r.state,t=r.mode;return r||{mode:t,state:e}},startState:function(t,e,r){return!t.startState||t.startState(e,r)}},u="undefined"!=typeof globalThis?globalThis:window;for(var h in u.CodeMirror={},CodeMirror.StringStream=n,l)CodeMirror[h]=l[h];CodeMirror.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),CodeMirror.defineMIME("text/plain","null"),CodeMirror.registerHelper=CodeMirror.registerGlobalHelper=Math.min,CodeMirror.splitLines=function(t){return t.split(/\r?\n|\r/)},CodeMirror.countColumn=e,CodeMirror.defaults={indentUnit:2},a=function(t){t.runMode=function(e,r,n,i){var o=t.getMode(t.defaults,r),s=i&&i.tabSize||t.defaults.tabSize;if(n.appendChild){var a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),p=n,l=0;p.innerHTML="",n=function(t,e){if("\n"==t)return p.appendChild(document.createTextNode(a?"\r":t)),void(l=0);for(var r="",n=0;;){var i=t.indexOf("\t",n);if(-1==i){r+=t.slice(n),l+=t.length-n;break}l+=i-n,r+=t.slice(n,i);var o=s-l%s;l+=o;for(var u=0;u<o;++u)r+=" ";n=i+1}if(e){var h=p.appendChild(document.createElement("span"));h.className="cm-"+e.replace(/ +/g," cm-"),h.appendChild(document.createTextNode(r))}else p.appendChild(document.createTextNode(r))}}for(var u=t.splitLines(e),h=i&&i.state||t.startState(o),f=0,c=u.length;f<c;++f){f&&n("\n");var d=new t.StringStream(u[f],null,{lookAhead:function(t){return u[f+t]},baseToken:function(){}});for(!d.string&&o.blankLine&&o.blankLine(h);!d.eol();){var m=o.token(d,h);n(d.current(),m,f,d.start,h,o),d.start=d.pos}}}},"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!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){"use strict";e.runMode=function(t,n,r,o){var a=e.getMode(e.defaults,n),i=o&&o.tabSize||e.defaults.tabSize;if(r.appendChild){var d=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),c=r,l=0;c.innerHTML="",r=function(e,t){if("\n"==e)return c.appendChild(document.createTextNode(d?"\r":e)),void(l=0);for(var n="",r=0;;){var o=e.indexOf("\t",r);if(-1==o){n+=e.slice(r),l+=e.length-r;break}l+=o-r,n+=e.slice(r,o);var a=i-l%i;l+=a;for(var u=0;u<a;++u)n+=" ";r=o+1}if(t){var f=c.appendChild(document.createElement("span"));f.className="cm-"+t.replace(/ +/g," cm-"),f.appendChild(document.createTextNode(n))}else c.appendChild(document.createTextNode(n))}}for(var u=e.splitLines(t),f=o&&o.state||e.startState(a),s=0,p=u.length;s<p;++s){s&&r("\n");var m=new e.StringStream(u[s],null,{lookAhead:function(e){return u[s+e]},baseToken:function(){}});for(!m.string&&a.blankLine&&a.blankLine(f);!m.eol();){var v=a.token(m,f);r(m.current(),v,s,m.start,f,a),m.start=m.pos}}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function copyObj(t,e,n){for(var r in e||(e={}),t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function countColumn(t,e,n,r,o){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var i=r||0,s=o||0;;){var a=t.indexOf("\t",i);if(a<0||a>=e)return s+(e-i);s+=a-i,s+=n-s%n,i=a+1}}function nothing(){}function createObj(t,e){var n;return Object.create?n=Object.create(t):(nothing.prototype=t,n=new nothing),e&©Obj(e,n),n}var StringStream=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};StringStream.prototype.eol=function(){return this.pos>=this.string.length},StringStream.prototype.sol=function(){return this.pos==this.lineStart},StringStream.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},StringStream.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},StringStream.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},StringStream.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},StringStream.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},StringStream.prototype.skipToEnd=function(){this.pos=this.string.length},StringStream.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},StringStream.prototype.backUp=function(t){this.pos-=t},StringStream.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=countColumn(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.indentation=function(){return countColumn(this.string,null,this.tabSize)-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var o=function(t){return n?t.toLowerCase():t};if(o(this.string.substr(this.pos,t.length))==o(t))return!1!==e&&(this.pos+=t.length),!0},StringStream.prototype.current=function(){return this.string.slice(this.start,this.pos)},StringStream.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},StringStream.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},StringStream.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var modes={},mimeModes={};function defineMode(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),modes[t]=e}function defineMIME(t,e){mimeModes[t]=e}function resolveMode(t){if("string"==typeof t&&mimeModes.hasOwnProperty(t))t=mimeModes[t];else if(t&&"string"==typeof t.name&&mimeModes.hasOwnProperty(t.name)){var e=mimeModes[t.name];"string"==typeof e&&(e={name:e}),(t=createObj(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return resolveMode("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return resolveMode("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function getMode(t,e){e=resolveMode(e);var n=modes[e.name];if(!n)return getMode(t,"text/plain");var r=n(t,e);if(modeExtensions.hasOwnProperty(e.name)){var o=modeExtensions[e.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)r[s]=e.modeProps[s];return r}var modeExtensions={};function extendMode(t,e){copyObj(e,modeExtensions.hasOwnProperty(t)?modeExtensions[t]:modeExtensions[t]={})}function copyState(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var o=e[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function innerMode(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function startState(t,e,n){return!t.startState||t.startState(e,n)}var modeMethods={__proto__:null,modes,mimeModes,defineMode,defineMIME,resolveMode,getMode,modeExtensions,extendMode,copyState,innerMode,startState};for(var exported in exports.StringStream=StringStream,exports.countColumn=countColumn,modeMethods)exports[exported]=modeMethods[exported];require.cache[require.resolve("../../lib/codemirror")]=require.cache[require.resolve("./runmode.node")],require.cache[require.resolve("../../addon/runmode/runmode")]=require.cache[require.resolve("./runmode.node")],exports.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),exports.defineMIME("text/plain","null"),exports.registerHelper=exports.registerGlobalHelper=Math.min,exports.splitLines=function(t){return t.split(/\r?\n|\r/)},exports.defaults={indentUnit:2},function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){t.runMode=function(e,n,r,o){var i=t.getMode(t.defaults,n),s=o&&o.tabSize||t.defaults.tabSize;if(r.appendChild){var a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),u=r,p=0;u.innerHTML="",r=function(t,e){if("\n"==t)return u.appendChild(document.createTextNode(a?"\r":t)),void(p=0);for(var n="",r=0;;){var o=t.indexOf("\t",r);if(-1==o){n+=t.slice(r),p+=t.length-r;break}p+=o-r,n+=t.slice(r,o);var i=s-p%s;p+=i;for(var l=0;l<i;++l)n+=" ";r=o+1}if(e){var d=u.appendChild(document.createElement("span"));d.className="cm-"+e.replace(/ +/g," cm-"),d.appendChild(document.createTextNode(n))}else u.appendChild(document.createTextNode(n))}}for(var l=t.splitLines(e),d=o&&o.state||t.startState(i),h=0,c=l.length;h<c;++h){h&&r("\n");var m=new t.StringStream(l[h],null,{lookAhead:function(t){return l[h+t]},baseToken:function(){}});for(!m.string&&i.blankLine&&i.blankLine(d);!m.eol();){var f=i.token(m,d);r(m.current(),f,h,m.start,d,i),m.start=m.pos}}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";function e(t,e){function i(t){clearTimeout(n.doRedraw),n.doRedraw=setTimeout((function(){n.redraw()}),t)}this.cm=t,this.options=e,this.buttonHeight=e.scrollButtonHeight||t.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=t.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var n=this;t.on("refresh",this.resizeHandler=function(){clearTimeout(n.doUpdate),n.doUpdate=setTimeout((function(){n.computeScale()&&i(20)}),100)}),t.on("markerAdded",this.resizeHandler),t.on("markerCleared",this.resizeHandler),!1!==e.listenForChanges&&t.on("changes",this.changeHandler=function(){i(250)})}t.defineExtension("annotateScrollbar",(function(t){return"string"==typeof t&&(t={className:t}),new e(this,t)})),t.defineOption("scrollButtonHeight",0),e.prototype.computeScale=function(){var t=this.cm,e=(t.getWrapperElement().clientHeight-t.display.barHeight-2*this.buttonHeight)/t.getScrollerElement().scrollHeight;if(e!=this.hScale)return this.hScale=e,!0},e.prototype.update=function(t){this.annotations=t,this.redraw()},e.prototype.redraw=function(t){!1!==t&&this.computeScale();var e=this.cm,i=this.hScale,n=document.createDocumentFragment(),o=this.annotations,r=e.getOption("lineWrapping"),a=r&&1.5*e.defaultTextHeight(),s=null,h=null;function l(t,i){if(s!=t.line){s=t.line,h=e.getLineHandle(t.line);var n=e.getLineHandleVisualStart(h);n!=h&&(s=e.getLineNumber(n),h=n)}return h.widgets&&h.widgets.length||r&&h.height>a?e.charCoords(t,"local")[i?"top":"bottom"]:e.heightAtLine(h,"local")+(i?0:h.height)}var d=e.lastLine();if(e.display.barWidth)for(var c,p=0;p<o.length;p++){var u=o[p];if(!(u.to.line>d)){for(var f=c||l(u.from,!0)*i,m=l(u.to,!1)*i;p<o.length-1&&!(o[p+1].to.line>d)&&!((c=l(o[p+1].from,!0)*i)>m+.9);)m=l((u=o[++p]).to,!1)*i;if(m!=f){var g=Math.max(m-f,3),H=n.appendChild(document.createElement("div"));H.style.cssText="position: absolute; right: 0px; width: "+Math.max(e.display.barWidth-1,2)+"px; top: "+(f+this.buttonHeight)+"px; height: "+g+"px",H.className=this.options.className,u.id&&H.setAttribute("annotation-id",u.id)}}}this.div.textContent="",this.div.appendChild(n)},e.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!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){"use strict";function n(n,i){e.changeEnd(i).line==n.lastLine()&&t(n)}function t(e){var n="";e.lineCount()>1&&(n=e.display.scroller.clientHeight-30-e.getLineHandle(e.lastLine()).height+"px"),e.state.scrollPastEndPadding!=n&&(e.state.scrollPastEndPadding=n,e.display.lineSpace.parentNode.style.paddingBottom=n,e.off("refresh",t),e.setSize(),e.on("refresh",t))}e.defineOption("scrollPastEnd",!1,(function(i,o,d){d&&d!=e.Init&&(i.off("change",n),i.off("refresh",t),i.display.lineSpace.parentNode.style.paddingBottom="",i.state.scrollPastEndPadding=null),o&&(i.on("change",n),i.on("refresh",t),t(i))}))}));
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div {
|
|
2
|
+
position: absolute;
|
|
3
|
+
background: #ccc;
|
|
4
|
+
-moz-box-sizing: border-box;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
border: 1px solid #bbb;
|
|
7
|
+
border-radius: 2px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical {
|
|
11
|
+
position: absolute;
|
|
12
|
+
z-index: 6;
|
|
13
|
+
background: #eee;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.CodeMirror-simplescroll-horizontal {
|
|
17
|
+
bottom: 0; left: 0;
|
|
18
|
+
height: 8px;
|
|
19
|
+
}
|
|
20
|
+
.CodeMirror-simplescroll-horizontal div {
|
|
21
|
+
bottom: 0;
|
|
22
|
+
height: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.CodeMirror-simplescroll-vertical {
|
|
26
|
+
right: 0; top: 0;
|
|
27
|
+
width: 8px;
|
|
28
|
+
}
|
|
29
|
+
.CodeMirror-simplescroll-vertical div {
|
|
30
|
+
right: 0;
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div {
|
|
40
|
+
position: absolute;
|
|
41
|
+
background: #bcd;
|
|
42
|
+
border-radius: 3px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical {
|
|
46
|
+
position: absolute;
|
|
47
|
+
z-index: 6;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.CodeMirror-overlayscroll-horizontal {
|
|
51
|
+
bottom: 0; left: 0;
|
|
52
|
+
height: 6px;
|
|
53
|
+
}
|
|
54
|
+
.CodeMirror-overlayscroll-horizontal div {
|
|
55
|
+
bottom: 0;
|
|
56
|
+
height: 100%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.CodeMirror-overlayscroll-vertical {
|
|
60
|
+
right: 0; top: 0;
|
|
61
|
+
width: 6px;
|
|
62
|
+
}
|
|
63
|
+
.CodeMirror-overlayscroll-vertical div {
|
|
64
|
+
right: 0;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";function e(e,o,i){this.orientation=o,this.scroll=i,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=e+"-"+o,this.inner=this.node.appendChild(document.createElement("div"));var n=this;function s(e){var o=t.wheelEventPixels(e)["horizontal"==n.orientation?"x":"y"],i=n.pos;n.moveTo(n.pos+o),n.pos!=i&&t.e_preventDefault(e)}t.on(this.inner,"mousedown",(function(e){if(1==e.which){t.e_preventDefault(e);var o="horizontal"==n.orientation?"pageX":"pageY",i=e[o],s=n.pos;t.on(document,"mousemove",h),t.on(document,"mouseup",r)}function r(){t.off(document,"mousemove",h),t.off(document,"mouseup",r)}function h(t){if(1!=t.which)return r();n.moveTo(s+(t[o]-i)*(n.total/n.size))}})),t.on(this.node,"click",(function(e){t.e_preventDefault(e);var o,i=n.inner.getBoundingClientRect();o="horizontal"==n.orientation?e.clientX<i.left?-1:e.clientX>i.right?1:0:e.clientY<i.top?-1:e.clientY>i.bottom?1:0,n.moveTo(n.pos+o*n.screen)})),t.on(this.node,"mousewheel",s),t.on(this.node,"DOMMouseScroll",s)}function o(t,o,i){this.addClass=t,this.horiz=new e(t,"horizontal",i),o(this.horiz.node),this.vert=new e(t,"vertical",i),o(this.vert.node),this.width=null}e.prototype.setPos=function(t,e){return t<0&&(t=0),t>this.total-this.screen&&(t=this.total-this.screen),!(!e&&t==this.pos||(this.pos=t,this.inner.style["horizontal"==this.orientation?"left":"top"]=t*(this.size/this.total)+"px",0))},e.prototype.moveTo=function(t){this.setPos(t)&&this.scroll(t,this.orientation)},e.prototype.update=function(t,e,o){var i=this.screen!=e||this.total!=t||this.size!=o;i&&(this.screen=e,this.total=t,this.size=o);var n=this.screen*(this.size/this.total);n<10&&(this.size-=10-n,n=10),this.inner.style["horizontal"==this.orientation?"width":"height"]=n+"px",this.setPos(this.pos,i)},o.prototype.update=function(t){if(null==this.width){var e=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;e&&(this.width=parseInt(e.height))}var o=this.width||0,i=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1;return this.vert.node.style.display=n?"block":"none",this.horiz.node.style.display=i?"block":"none",n&&(this.vert.update(t.scrollHeight,t.clientHeight,t.viewHeight-(i?o:0)),this.vert.node.style.bottom=i?o+"px":"0"),i&&(this.horiz.update(t.scrollWidth,t.clientWidth,t.viewWidth-(n?o:0)-t.barLeft),this.horiz.node.style.right=n?o+"px":"0",this.horiz.node.style.left=t.barLeft+"px"),{right:n?o:0,bottom:i?o:0}},o.prototype.setScrollTop=function(t){this.vert.setPos(t)},o.prototype.setScrollLeft=function(t){this.horiz.setPos(t)},o.prototype.clear=function(){var t=this.horiz.node.parentNode;t.removeChild(this.horiz.node),t.removeChild(this.vert.node)},t.scrollbarModel.simple=function(t,e){return new o("CodeMirror-simplescroll",t,e)},t.scrollbarModel.overlay=function(t,e){return new o("CodeMirror-overlayscroll",t,e)}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}((function(e){"use strict";function o(e,o){var r=Number(o);return/^[-+]/.test(o)?e.getCursor().line+r:r-1}e.defineOption("search",{bottom:!1}),e.commands.jumpToLine=function(e){var r=e.getCursor();!function(e,o,r,t,i){e.openDialog?e.openDialog(o,i,{value:t,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(r,t))}(e,function(e){return e.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use line:column or scroll% syntax)")+"</span>"}(e),e.phrase("Jump to line:"),r.line+1+":"+r.ch,(function(t){var i;if(t)if(i=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(o(e,i[1]),Number(i[2]));else if(i=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var n=Math.round(e.lineCount()*Number(i[1])/100);/^[-+]/.test(i[1])&&(n=r.line+n+1),e.setCursor(n-1,r.ch)}else(i=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(o(e,i[1]),r.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],t):t(CodeMirror)}((function(t){"use strict";var e={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function o(t){for(var o in this.options={},e)this.options[o]=(t&&t.hasOwnProperty(o)?t:e)[o];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function n(t){var e=t.state.matchHighlighter;(e.active||t.hasFocus())&&r(t,e)}function i(t){var e=t.state.matchHighlighter;e.active||(e.active=!0,r(t,e))}function r(t,e){clearTimeout(e.timeout),e.timeout=setTimeout((function(){c(t)}),e.options.delay)}function a(t,e,o,n){var i=t.state.matchHighlighter;if(t.addOverlay(i.overlay=function(t,e,o){return{token:function(n){if(n.match(t)&&(!e||function(t,e){return!(t.start&&e.test(t.string.charAt(t.start-1))||t.pos!=t.string.length&&e.test(t.string.charAt(t.pos)))}(n,e)))return o;n.next(),n.skipTo(t.charAt(0))||n.skipToEnd()}}}(e,o,n)),i.options.annotateScrollbar&&t.showMatchesOnScrollbar){var r=o?new RegExp((/\w/.test(e.charAt(0))?"\\b":"")+e.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(e.charAt(e.length-1))?"\\b":"")):e;i.matchesonscroll=t.showMatchesOnScrollbar(r,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function s(t){var e=t.state.matchHighlighter;e.overlay&&(t.removeOverlay(e.overlay),e.overlay=null,e.matchesonscroll&&(e.matchesonscroll.clear(),e.matchesonscroll=null))}function c(t){t.operation((function(){var e=t.state.matchHighlighter;if(s(t),t.somethingSelected()||!e.options.showToken){var o=t.getCursor("from"),n=t.getCursor("to");if(o.line==n.line&&(!e.options.wordsOnly||function(t,e,o){if(null!==t.getRange(e,o).match(/^\w+$/)){if(e.ch>0){var n={line:e.line,ch:e.ch-1};if(null===t.getRange(n,e).match(/\W/))return!1}return!(o.ch<t.getLine(e.line).length&&(n={line:o.line,ch:o.ch+1},null===t.getRange(o,n).match(/\W/)))}return!1}(t,o,n))){var i=t.getRange(o,n);e.options.trim&&(i=i.replace(/^\s+|\s+$/g,"")),i.length>=e.options.minChars&&a(t,i,!1,e.options.style)}}else{for(var r=!0===e.options.showToken?/[\w$]/:e.options.showToken,c=t.getCursor(),l=t.getLine(c.line),h=c.ch,u=h;h&&r.test(l.charAt(h-1));)--h;for(;u<l.length&&r.test(l.charAt(u));)++u;h<u&&a(t,l.slice(h,u),r,e.options.style)}}))}t.defineOption("highlightSelectionMatches",!1,(function(e,r,a){if(a&&a!=t.Init&&(s(e),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",n),e.off("focus",i)),r){var l=e.state.matchHighlighter=new o(r);e.hasFocus()?(l.active=!0,c(e)):e.on("focus",i),e.on("cursorActivity",n)}}))}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],t):t(CodeMirror)}((function(t){"use strict";function e(t,e,i,o){this.cm=t,this.options=o;var a={listenForChanges:!1};for(var n in o)a[n]=o[n];a.className||(a.className="CodeMirror-search-match"),this.annotation=t.annotateScrollbar(a),this.query=e,this.caseFold=i,this.gap={from:t.firstLine(),to:t.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var s=this;t.on("change",this.changeHandler=function(t,e){s.onChange(e)})}function i(t,e,i){return t<=e?t:Math.max(e,t+i)}t.defineExtension("showMatchesOnScrollbar",(function(t,i,o){return"string"==typeof o&&(o={className:o}),o||(o={}),new e(this,t,i,o)})),e.prototype.findMatches=function(){if(this.gap){for(var e=0;e<this.matches.length&&!((a=this.matches[e]).from.line>=this.gap.to);e++)a.to.line>=this.gap.from&&this.matches.splice(e--,1);for(var i=this.cm.getSearchCursor(this.query,t.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),o=this.options&&this.options.maxMatches||1e3;i.findNext();){var a;if((a={from:i.from(),to:i.to()}).from.line>=this.gap.to)break;if(this.matches.splice(e++,0,a),this.matches.length>o)break}this.gap=null}},e.prototype.onChange=function(e){var o=e.from.line,a=t.changeEnd(e).line,n=a-e.to.line;if(this.gap?(this.gap.from=Math.min(i(this.gap.from,o,n),e.from.line),this.gap.to=Math.max(i(this.gap.to,o,n),e.from.line)):this.gap={from:e.from.line,to:a+1},n)for(var s=0;s<this.matches.length;s++){var r=this.matches[s],h=i(r.from.line,o,n);h!=r.from.line&&(r.from=t.Pos(h,r.from.ch));var c=i(r.to.line,o,n);c!=r.to.line&&(r.to=t.Pos(c,r.to.ch))}clearTimeout(this.update);var f=this;this.update=setTimeout((function(){f.updateAfterChange()}),250)},e.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},e.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}((function(e){"use strict";function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function o(e){return e.state.search||(e.state.search=new n)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function t(e,n,o){return e.getSearchCursor(n,o,{caseFold:r(n),multiline:!0})}function a(e,n,o,r,t){e.openDialog?e.openDialog(n,t,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):t(prompt(o,r))}function i(e){return e.replace(/\\([nrt\\])/g,(function(e,n){return"n"==n?"\n":"r"==n?"\r":"t"==n?"\t":"\\"==n?"\\":e}))}function s(e){var n=e.match(/^\/(.*)\/([a-z]*)$/);if(n)try{e=new RegExp(n[1],-1==n[2].indexOf("i")?"":"i")}catch(e){}else e=i(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,n,o){n.queryText=o,n.query=s(o),e.removeOverlay(n.overlay,r(n.query)),n.overlay=function(e,n){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),n?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(n){e.lastIndex=n.pos;var o=e.exec(n.string);if(o&&o.index==n.pos)return n.pos+=o[0].length||1,"searching";o?n.pos=o.index:n.skipToEnd()}}}(n.query,r(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,r(n.query)))}function l(n,r,t,i){var s=o(n);if(s.query)return u(n,r);var l=n.getSelection()||s.lastQuery;if(l instanceof RegExp&&"x^"==l.source&&(l=null),t&&n.openDialog){var p=null,m=function(o,r){e.e_stop(r),o&&(o!=s.queryText&&(c(n,s,o),s.posFrom=s.posTo=n.getCursor()),p&&(p.style.opacity=1),u(n,r.shiftKey,(function(e,o){var r;o.line<3&&document.querySelector&&(r=n.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>n.cursorCoords(o,"window").top&&((p=r).style.opacity=.4)})))};!function(e,n,o,r,t){e.openDialog(n,r,{value:o,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){f(e)},onKeyDown:t,bottom:e.options.search.bottom})}(n,d(n),l,m,(function(r,t){var a=e.keyName(r),i=n.getOption("extraKeys"),s=i&&i[a]||e.keyMap[n.getOption("keyMap")][a];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(r),c(n,o(n),t),n.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(r),m(t,r))})),i&&l&&(c(n,s,l),u(n,r))}else a(n,d(n),"Search for:",l,(function(e){e&&!s.query&&n.operation((function(){c(n,s,e),s.posFrom=s.posTo=n.getCursor(),u(n,r)}))}))}function u(n,r,a){n.operation((function(){var i=o(n),s=t(n,i.query,r?i.posFrom:i.posTo);(s.find(r)||(s=t(n,i.query,r?e.Pos(n.lastLine()):e.Pos(n.firstLine(),0))).find(r))&&(n.setSelection(s.from(),s.to()),n.scrollIntoView({from:s.from(),to:s.to()},20),i.posFrom=s.from(),i.posTo=s.to(),a&&a(s.from(),s.to()))}))}function f(e){e.operation((function(){var n=o(e);n.lastQuery=n.query,n.query&&(n.query=n.queryText=null,e.removeOverlay(n.overlay),n.annotate&&(n.annotate.clear(),n.annotate=null))}))}function p(e,n){var o=e?document.createElement(e):document.createDocumentFragment();for(var r in n)o[r]=n[r];for(var t=2;t<arguments.length;t++){var a=arguments[t];o.appendChild("string"==typeof a?document.createTextNode(a):a)}return o}function d(e){return p("",null,p("span",{className:"CodeMirror-search-label"},e.phrase("Search:"))," ",p("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",p("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}function m(e,n,o){e.operation((function(){for(var r=t(e,n);r.findNext();)if("string"!=typeof n){var a=e.getRange(r.from(),r.to()).match(n);r.replace(o.replace(/\$(\d)/g,(function(e,n){return a[n]})))}else r.replace(o)}))}function y(e,n){if(!e.getOption("readOnly")){var r=e.getSelection()||o(e).lastQuery,c=n?e.phrase("Replace all:"):e.phrase("Replace:"),l=p("",null,p("span",{className:"CodeMirror-search-label"},c),function(e){return p("",null," ",p("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",p("span",{style:"color: #888",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}(e));a(e,l,c,r,(function(o){o&&(o=s(o),a(e,function(e){return p("",null,p("span",{className:"CodeMirror-search-label"},e.phrase("With:"))," ",p("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}(e),e.phrase("Replace with:"),"",(function(r){if(r=i(r),n)m(e,o,r);else{f(e);var a=t(e,o,e.getCursor("from")),s=function(){var n,i=a.from();!(n=a.findNext())&&(a=t(e,o),!(n=a.findNext())||i&&a.from().line==i.line&&a.from().ch==i.ch)||(e.setSelection(a.from(),a.to()),e.scrollIntoView({from:a.from(),to:a.to()}),function(e,n,o,r){e.openConfirm?e.openConfirm(n,r):confirm(o)&&r[0]()}(e,function(e){return p("",null,p("span",{className:"CodeMirror-search-label"},e.phrase("Replace?"))," ",p("button",{},e.phrase("Yes"))," ",p("button",{},e.phrase("No"))," ",p("button",{},e.phrase("All"))," ",p("button",{},e.phrase("Stop")))}(e),e.phrase("Replace?"),[function(){c(n)},s,function(){m(e,o,r)}]))},c=function(e){a.replace("string"==typeof o?r:r.replace(/\$(\d)/g,(function(n,o){return e[o]}))),s()};s()}})))}))}}e.defineOption("search",{bottom:!1}),e.commands.find=function(e){f(e),l(e)},e.commands.findPersistent=function(e){f(e),l(e,!1,!0)},e.commands.findPersistentNext=function(e){l(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){l(e,!0,!0,!0)},e.commands.findNext=l,e.commands.findPrev=function(e){l(e,!0)},e.commands.clearSearch=f,e.commands.replace=y,e.commands.replaceAll=function(e){y(e,!0)}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var e,n,r=t.Pos;function i(t,e){for(var n=function(t){var e=t.flags;return null!=e?e:(t.ignoreCase?"i":"")+(t.global?"g":"")+(t.multiline?"m":"")}(t),r=n,i=0;i<e.length;i++)-1==r.indexOf(e.charAt(i))&&(r+=e.charAt(i));return n==r?t:new RegExp(t.source,r)}function o(t){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(t.source)}function h(t,e,n){e=i(e,"g");for(var o=n.line,h=n.ch,l=t.lastLine();o<=l;o++,h=0){e.lastIndex=h;var c=t.getLine(o),s=e.exec(c);if(s)return{from:r(o,s.index),to:r(o,s.index+s[0].length),match:s}}}function l(t,e,n){if(!o(e))return h(t,e,n);e=i(e,"gm");for(var l,c=1,s=n.line,f=t.lastLine();s<=f;){for(var a=0;a<c&&!(s>f);a++){var u=t.getLine(s++);l=null==l?u:l+"\n"+u}c*=2,e.lastIndex=n.ch;var g=e.exec(l);if(g){var m=l.slice(0,g.index).split("\n"),v=g[0].split("\n"),d=n.line+m.length-1,p=m[m.length-1].length;return{from:r(d,p),to:r(d+v.length-1,1==v.length?p+v[0].length:v[v.length-1].length),match:g}}}}function c(t,e,n){for(var r,i=0;i<=t.length;){e.lastIndex=i;var o=e.exec(t);if(!o)break;var h=o.index+o[0].length;if(h>t.length-n)break;(!r||h>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function s(t,e,n){e=i(e,"g");for(var o=n.line,h=n.ch,l=t.firstLine();o>=l;o--,h=-1){var s=t.getLine(o),f=c(s,e,h<0?0:s.length-h);if(f)return{from:r(o,f.index),to:r(o,f.index+f[0].length),match:f}}}function f(t,e,n){if(!o(e))return s(t,e,n);e=i(e,"gm");for(var h,l=1,f=t.getLine(n.line).length-n.ch,a=n.line,u=t.firstLine();a>=u;){for(var g=0;g<l&&a>=u;g++){var m=t.getLine(a--);h=null==h?m:m+"\n"+h}l*=2;var v=c(h,e,f);if(v){var d=h.slice(0,v.index).split("\n"),p=v[0].split("\n"),x=a+d.length,L=d[d.length-1].length;return{from:r(x,L),to:r(x+p.length-1,1==p.length?L+p[0].length:p[p.length-1].length),match:v}}}}function a(t,e,n,r){if(t.length==e.length)return n;for(var i=0,o=n+Math.max(0,t.length-e.length);;){if(i==o)return i;var h=i+o>>1,l=r(t.slice(0,h)).length;if(l==n)return h;l>n?o=h:i=h+1}}function u(t,i,o,h){if(!i.length)return null;var l=h?e:n,c=l(i).split(/\r|\n\r?/);t:for(var s=o.line,f=o.ch,u=t.lastLine()+1-c.length;s<=u;s++,f=0){var g=t.getLine(s).slice(f),m=l(g);if(1==c.length){var v=m.indexOf(c[0]);if(-1==v)continue t;return o=a(g,m,v,l)+f,{from:r(s,a(g,m,v,l)+f),to:r(s,a(g,m,v+c[0].length,l)+f)}}var d=m.length-c[0].length;if(m.slice(d)==c[0]){for(var p=1;p<c.length-1;p++)if(l(t.getLine(s+p))!=c[p])continue t;var x=t.getLine(s+c.length-1),L=l(x),O=c[c.length-1];if(L.slice(0,O.length)==O)return{from:r(s,a(g,m,d,l)+f),to:r(s+c.length-1,a(x,L,O.length,l))}}}}function g(t,i,o,h){if(!i.length)return null;var l=h?e:n,c=l(i).split(/\r|\n\r?/);t:for(var s=o.line,f=o.ch,u=t.firstLine()-1+c.length;s>=u;s--,f=-1){var g=t.getLine(s);f>-1&&(g=g.slice(0,f));var m=l(g);if(1==c.length){var v=m.lastIndexOf(c[0]);if(-1==v)continue t;return{from:r(s,a(g,m,v,l)),to:r(s,a(g,m,v+c[0].length,l))}}var d=c[c.length-1];if(m.slice(0,d.length)==d){var p=1;for(o=s-c.length+1;p<c.length-1;p++)if(l(t.getLine(o+p))!=c[p])continue t;var x=t.getLine(s+1-c.length),L=l(x);if(L.slice(L.length-c[0].length)==c[0])return{from:r(s+1-c.length,a(x,L,x.length-c[0].length,l)),to:r(s,a(g,m,d.length,l))}}}}function m(t,e,n,o){var c;this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=t,n=n?t.clipPos(n):r(0,0),this.pos={from:n,to:n},"object"==typeof o?c=o.caseFold:(c=o,o=null),"string"==typeof e?(null==c&&(c=!1),this.matches=function(n,r){return(n?g:u)(t,e,r,c)}):(e=i(e,"gm"),o&&!1===o.multiline?this.matches=function(n,r){return(n?s:h)(t,e,r)}:this.matches=function(n,r){return(n?f:l)(t,e,r)})}String.prototype.normalize?(e=function(t){return t.normalize("NFD").toLowerCase()},n=function(t){return t.normalize("NFD")}):(e=function(t){return t.toLowerCase()},n=function(t){return t}),m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){var n=this.doc.clipPos(e?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(n=r(n.line,n.ch),e?(n.ch--,n.ch<0&&(n.line--,n.ch=(this.doc.getLine(n.line)||"").length)):(n.ch++,n.ch>(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=t.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var i=this.matches(e,n);if(this.afterEmptyMatch=i&&0==t.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=r(e?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e,n){if(this.atOccurrence){var i=t.splitLines(e);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},t.defineExtension("getSearchCursor",(function(t,e,n){return new m(this.doc,t,e,n)})),t.defineDocExtension("getSearchCursor",(function(t,e,n){return new m(this,t,e,n)})),t.defineExtension("selectMatches",(function(e,n){for(var r=[],i=this.getSearchCursor(e,this.getCursor("from"),n);i.findNext()&&!(t.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!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){"use strict";var t="CodeMirror-activeline",n="CodeMirror-activeline-background",i="CodeMirror-activeline-gutter";function r(e){for(var r=0;r<e.state.activeLines.length;r++)e.removeLineClass(e.state.activeLines[r],"wrap",t),e.removeLineClass(e.state.activeLines[r],"background",n),e.removeLineClass(e.state.activeLines[r],"gutter",i)}function o(e,o){for(var a=[],s=0;s<o.length;s++){var c=o[s],l=e.getOption("styleActiveLine");if("object"==typeof l&&l.nonEmpty?c.anchor.line==c.head.line:c.empty()){var f=e.getLineHandleVisualStart(c.head.line);a[a.length-1]!=f&&a.push(f)}}(function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0})(e.state.activeLines,a)||e.operation((function(){r(e);for(var o=0;o<a.length;o++)e.addLineClass(a[o],"wrap",t),e.addLineClass(a[o],"background",n),e.addLineClass(a[o],"gutter",i);e.state.activeLines=a}))}function a(e,t){o(e,t.ranges)}e.defineOption("styleActiveLine",!1,(function(t,n,i){var s=i!=e.Init&&i;n!=s&&(s&&(t.off("beforeSelectionChange",a),r(t),delete t.state.activeLines),n&&(t.state.activeLines=[],o(t,t.listSelections()),t.on("beforeSelectionChange",a)))}))}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!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){"use strict";function t(e){e.state.markedSelection&&e.operation((function(){!function(e){if(!e.somethingSelected())return l(e);if(e.listSelections().length>1)return f(e);var t=e.getCursor("start"),n=e.getCursor("end"),o=e.state.markedSelection;if(!o.length)return i(e,t,n);var c=o[0].find(),a=o[o.length-1].find();if(!c||!a||n.line-t.line<=8||r(t,a.to)>=0||r(n,c.from)<=0)return f(e);for(;r(t,c.from)>0;)o.shift().clear(),c=o[0].find();for(r(t,c.from)<0&&(c.to.line-t.line<8?(o.shift().clear(),i(e,t,c.to,0)):i(e,t,c.from,0));r(n,a.to)<0;)o.pop().clear(),a=o[o.length-1].find();r(n,a.to)>0&&(n.line-a.from.line<8?(o.pop().clear(),i(e,a.from,n)):i(e,a.to,n))}(e)}))}function n(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation((function(){l(e)}))}e.defineOption("styleSelectedText",!1,(function(o,r,i){var c=i&&i!=e.Init;r&&!c?(o.state.markedSelection=[],o.state.markedSelectionStyle="string"==typeof r?r:"CodeMirror-selectedtext",f(o),o.on("cursorActivity",t),o.on("change",n)):!r&&c&&(o.off("cursorActivity",t),o.off("change",n),l(o),o.state.markedSelection=o.state.markedSelectionStyle=null)}));var o=e.Pos,r=e.cmpPos;function i(e,t,n,i){if(0!=r(t,n))for(var l=e.state.markedSelection,f=e.state.markedSelectionStyle,c=t.line;;){var a=c==t.line?t:o(c,0),s=c+8,d=s>=n.line,m=d?n:o(s,0),u=e.markText(a,m,{className:f});if(null==i?l.push(u):l.splice(i++,0,u),d)break;c=s}}function l(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function f(e){l(e);for(var t=e.listSelections(),n=0;n<t.length;n++)i(e,t[n].from(),t[n].to())}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!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){"use strict";function t(e){e.state.selectionPointer.rects=null,o(e)}function o(e){e.state.selectionPointer.willUpdate||(e.state.selectionPointer.willUpdate=!0,setTimeout((function(){!function(e){var t=e.state.selectionPointer;if(t){if(null==t.rects&&null!=t.mouseX&&(t.rects=[],e.somethingSelected()))for(var o=e.display.selectionDiv.firstChild;o;o=o.nextSibling)t.rects.push(o.getBoundingClientRect());var n=!1;if(null!=t.mouseX)for(var i=0;i<t.rects.length;i++){var l=t.rects[i];l.left<=t.mouseX&&l.right>=t.mouseX&&l.top<=t.mouseY&&l.bottom>=t.mouseY&&(n=!0)}var s=n?t.value:"";e.display.lineDiv.style.cursor!=s&&(e.display.lineDiv.style.cursor=s)}}(e),e.state.selectionPointer.willUpdate=!1}),50))}e.defineOption("selectionPointer",!1,(function(n,i){var l=n.state.selectionPointer;l&&(e.off(n.getWrapperElement(),"mousemove",l.mousemove),e.off(n.getWrapperElement(),"mouseout",l.mouseout),e.off(window,"scroll",l.windowScroll),n.off("cursorActivity",t),n.off("scroll",t),n.state.selectionPointer=null,n.display.lineDiv.style.cursor=""),i&&(l=n.state.selectionPointer={value:"string"==typeof i?i:"default",mousemove:function(e){!function(e,t){var n=e.state.selectionPointer;(null==t.buttons?t.which:t.buttons)?n.mouseX=n.mouseY=null:(n.mouseX=t.clientX,n.mouseY=t.clientY),o(e)}(n,e)},mouseout:function(e){!function(e,t){if(!e.getWrapperElement().contains(t.relatedTarget)){var n=e.state.selectionPointer;n.mouseX=n.mouseY=null,o(e)}}(n,e)},windowScroll:function(){t(n)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},e.on(n.getWrapperElement(),"mousemove",l.mousemove),e.on(n.getWrapperElement(),"mouseout",l.mouseout),e.on(window,"scroll",l.windowScroll),n.on("cursorActivity",t),n.on("scroll",t))}))}));
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
.CodeMirror-Tern-completion {
|
|
2
|
+
padding-left: 22px;
|
|
3
|
+
position: relative;
|
|
4
|
+
line-height: 1.5;
|
|
5
|
+
}
|
|
6
|
+
.CodeMirror-Tern-completion:before {
|
|
7
|
+
position: absolute;
|
|
8
|
+
left: 2px;
|
|
9
|
+
bottom: 2px;
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
height: 15px;
|
|
14
|
+
width: 15px;
|
|
15
|
+
line-height: 16px;
|
|
16
|
+
text-align: center;
|
|
17
|
+
color: white;
|
|
18
|
+
-moz-box-sizing: border-box;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
.CodeMirror-Tern-completion-unknown:before {
|
|
22
|
+
content: "?";
|
|
23
|
+
background: #4bb;
|
|
24
|
+
}
|
|
25
|
+
.CodeMirror-Tern-completion-object:before {
|
|
26
|
+
content: "O";
|
|
27
|
+
background: #77c;
|
|
28
|
+
}
|
|
29
|
+
.CodeMirror-Tern-completion-fn:before {
|
|
30
|
+
content: "F";
|
|
31
|
+
background: #7c7;
|
|
32
|
+
}
|
|
33
|
+
.CodeMirror-Tern-completion-array:before {
|
|
34
|
+
content: "A";
|
|
35
|
+
background: #c66;
|
|
36
|
+
}
|
|
37
|
+
.CodeMirror-Tern-completion-number:before {
|
|
38
|
+
content: "1";
|
|
39
|
+
background: #999;
|
|
40
|
+
}
|
|
41
|
+
.CodeMirror-Tern-completion-string:before {
|
|
42
|
+
content: "S";
|
|
43
|
+
background: #999;
|
|
44
|
+
}
|
|
45
|
+
.CodeMirror-Tern-completion-bool:before {
|
|
46
|
+
content: "B";
|
|
47
|
+
background: #999;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.CodeMirror-Tern-completion-guess {
|
|
51
|
+
color: #999;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.CodeMirror-Tern-tooltip {
|
|
55
|
+
border: 1px solid silver;
|
|
56
|
+
border-radius: 3px;
|
|
57
|
+
color: #444;
|
|
58
|
+
padding: 2px 5px;
|
|
59
|
+
font-size: 90%;
|
|
60
|
+
font-family: monospace;
|
|
61
|
+
background-color: white;
|
|
62
|
+
white-space: pre-wrap;
|
|
63
|
+
|
|
64
|
+
max-width: 40em;
|
|
65
|
+
position: absolute;
|
|
66
|
+
z-index: 10;
|
|
67
|
+
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
68
|
+
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
69
|
+
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
70
|
+
|
|
71
|
+
transition: opacity 1s;
|
|
72
|
+
-moz-transition: opacity 1s;
|
|
73
|
+
-webkit-transition: opacity 1s;
|
|
74
|
+
-o-transition: opacity 1s;
|
|
75
|
+
-ms-transition: opacity 1s;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.CodeMirror-Tern-hint-doc {
|
|
79
|
+
max-width: 25em;
|
|
80
|
+
margin-top: -3px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.CodeMirror-Tern-fname { color: black; }
|
|
84
|
+
.CodeMirror-Tern-farg { color: #70a; }
|
|
85
|
+
.CodeMirror-Tern-farg-current { text-decoration: underline; }
|
|
86
|
+
.CodeMirror-Tern-type { color: #07c; }
|
|
87
|
+
.CodeMirror-Tern-fhint-guess { opacity: .7; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";t.TernServer=function(r){var a=this;this.options=r||{};var c=this.options.plugins||(this.options.plugins={});c.doc_comment||(c.doc_comment=!0),this.docs=Object.create(null),this.options.useWorker?this.server=new T(this):this.server=new tern.Server({getFile:function(t,e){return o(a,t,e)},async:!0,defs:this.options.defs||[],plugins:c}),this.trackChange=function(t,e){!function(t,e,n){var o=i(t,e),r=t.cachedArgHints;r&&r.doc==e&&p(r.start,n.to)>=0&&(t.cachedArgHints=null);var a=o.changed;null==a&&(o.changed=a={from:n.from.line,to:n.from.line});var c=n.from.line+(n.text.length-1);n.from.line<a.to&&(a.to=a.to-(n.to.line-c)),c>=a.to&&(a.to=c+1),a.from>n.from.line&&(a.from=n.from.line),e.lineCount()>250&&n.to-a.from>100&&setTimeout((function(){o.changed&&o.changed.to-o.changed.from>100&&s(t,o)}),200)}(a,t,e)},this.cachedArgHints=null,this.activeArgHints=null,this.jumpStack=[],this.getHint=function(o,i){return function(o,i,r){o.request(i,{type:"completions",types:!0,docs:!0,urls:!0},(function(s,a){if(s)return x(o,i,s);var c,l,u=[],f="",d=a.start,p=a.end;'["'==i.getRange(e(d.line,d.ch-2),d)&&'"]'!=i.getRange(p,e(p.line,p.ch+2))&&(f='"]');for(var h=0;h<a.completions.length;++h){var g=a.completions[h],m=(c=g.type,l=void 0,l="?"==c?"unknown":"number"==c||"string"==c||"bool"==c?c:/^fn\(/.test(c)?"fn":/^\[/.test(c)?"array":"object",n+"completion "+n+"completion-"+l);a.guess&&(m+=" "+n+"guess"),u.push({text:g.name+f,displayText:g.displayName||g.name,className:m,data:g})}var v={from:d,to:p,list:u},w=null;t.on(v,"close",(function(){C(w)})),t.on(v,"update",(function(){C(w)})),t.on(v,"select",(function(t,e){C(w);var r=o.options.completionTip?o.options.completionTip(t.data):t.data.doc;r&&(w=y(e.parentNode.getBoundingClientRect().right+window.pageXOffset,e.getBoundingClientRect().top+window.pageYOffset,r,i,n+"hint-doc"))})),r(v)}))}(a,o,i)},this.getHint.async=!0},t.TernServer.prototype={addDoc:function(e,n){var o={doc:n,name:e,changed:null};return this.server.addFile(e,b(this,o)),t.on(n,"change",this.trackChange),this.docs[e]=o},delDoc:function(e){var n=r(this,e);n&&(t.off(n.doc,"change",this.trackChange),delete this.docs[n.name],this.server.delFile(n.name))},hideDoc:function(t){w(this);var e=r(this,t);e&&e.changed&&s(this,e)},complete:function(t){t.showHint({hint:this.getHint})},showType:function(t,e,n){a(this,t,e,"type",n)},showDocs:function(t,e,n){a(this,t,e,"documentation",n)},updateArgHints:function(n){!function(n,o){if(w(n),!o.somethingSelected()){var i=o.getTokenAt(o.getCursor()).state,r=t.innerMode(o.getMode(),i);if("javascript"==r.mode.name){var s=r.state.lexical;if("call"==s.info){for(var a,u=s.pos||0,f=o.getOption("tabSize"),d=o.getCursor().line,h=Math.max(0,d-9),g=!1;d>=h;--d){for(var m=o.getLine(d),v=0,y=0;;){var C=m.indexOf("\t",y);if(-1==C)break;v+=f-(C+v)%f-1,y=C+1}if(a=s.column-v,"("==m.charAt(a)){g=!0;break}}if(g){var x=e(d,a),b=n.cachedArgHints;if(b&&b.doc==o.getDoc()&&0==p(x,b.start))return c(n,o,u);n.request(o,{type:"type",preferFunction:!0,end:x},(function(t,e){!t&&e.type&&/^fn\(/.test(e.type)&&(n.cachedArgHints={start:x,type:l(e.type),name:e.exprName||e.name||"fn",guess:e.guess,doc:o.getDoc()},c(n,o,u))}))}}}}}(this,n)},jumpToDef:function(t){!function(t,n){function o(o){var r={type:"definition",variable:o||null},s=i(t,n.getDoc());t.server.request(d(t,s,r),(function(o,i){if(o)return x(t,n,o);if(i.file||!i.url){if(i.file){var r,a=t.docs[i.file];if(a&&(r=function(t,n){for(var o=n.context.slice(0,n.contextOffset).split("\n"),i=n.start.line-(o.length-1),r=e(i,(1==o.length?n.start.ch:t.getLine(i).length)-o[0].length),s=t.getLine(i).slice(r.ch),a=i+1;a<t.lineCount()&&s.length<n.context.length;++a)s+="\n"+t.getLine(a);if(s.slice(0,n.context.length)==n.context)return n;for(var c,l=t.getSearchCursor(n.context,0,!1),u=1/0;l.findNext();){var f=l.from(),d=1e4*Math.abs(f.line-r.line);d||(d=Math.abs(f.ch-r.ch)),d<u&&(c=f,u=d)}if(!c)return null;if(1==o.length?c.ch+=o[0].length:c=e(c.line+(o.length-1),o[o.length-1].length),n.start.line==n.end.line)var p=e(c.line,c.ch+(n.end.ch-n.start.ch));else p=e(c.line+(n.end.line-n.start.line),n.end.ch);return{start:c,end:p}}(a.doc,i)))return t.jumpStack.push({file:s.name,start:n.getCursor("from"),end:n.getCursor("to")}),void u(t,s,a,r.start,r.end)}x(t,n,"Could not find a definition.")}else window.open(i.url)}))}!function(t){var e=t.getCursor("end"),n=t.getTokenAt(e);return!(n.start<e.ch&&"comment"==n.type)&&/[\w)\]]/.test(t.getLine(e.line).slice(Math.max(e.ch-1,0),e.ch+1))}(n)?g(n,"Jump to variable",(function(t){t&&o(t)})):o()}(this,t)},jumpBack:function(t){!function(t,e){var n=t.jumpStack.pop(),o=n&&t.docs[n.file];o&&u(t,i(t,e.getDoc()),o,n.start,n.end)}(this,t)},rename:function(t){!function(t,e){var n=e.getTokenAt(e.getCursor());if(!/\w/.test(n.string))return x(t,e,"Not at a variable");g(e,"New name for "+n.string,(function(n){t.request(e,{type:"rename",newName:n,fullDocs:!0},(function(n,o){if(n)return x(t,e,n);!function(t,e){for(var n=Object.create(null),o=0;o<e.length;++o)(n[(c=e[o]).file]||(n[c.file]=[])).push(c);for(var i in n){var r=t.docs[i],s=n[i];if(r){s.sort((function(t,e){return p(e.start,t.start)}));var a="*rename"+ ++f;for(o=0;o<s.length;++o){var c=s[o];r.doc.replaceRange(c.text,c.start,c.end,a)}}}}(t,o.changes)}))}))}(this,t)},selectName:function(t){!function(t,e){var n=i(t,e.doc).name;t.request(e,{type:"refs"},(function(o,i){if(o)return x(t,e,o);for(var r=[],s=0,a=e.getCursor(),c=0;c<i.refs.length;c++){var l=i.refs[c];l.file==n&&(r.push({anchor:l.start,head:l.end}),p(a,l.start)>=0&&p(a,l.end)<=0&&(s=r.length-1))}e.setSelections(r,s)}))}(this,t)},request:function(t,e,n,o){var r=this,s=i(this,t.getDoc()),a=d(this,s,e,o),c=a.query&&this.options.queryOptions&&this.options.queryOptions[a.query.type];if(c)for(var l in c)a.query[l]=c[l];this.server.request(a,(function(t,o){!t&&r.options.responseFilter&&(o=r.options.responseFilter(s,e,a,t,o)),n(t,o)}))},destroy:function(){w(this),this.worker&&(this.worker.terminate(),this.worker=null)}};var e=t.Pos,n="CodeMirror-Tern-";function o(t,e,n){var o=t.docs[e];o?n(b(t,o)):t.options.getFile?t.options.getFile(e,n):n(null)}function i(t,e,n){for(var o in t.docs){var i=t.docs[o];if(i.doc==e)return i}if(!n)for(var r=0;;++r)if(o="[doc"+(r||"")+"]",!t.docs[o]){n=o;break}return t.addDoc(n,e)}function r(e,n){return"string"==typeof n?e.docs[n]:(n instanceof t&&(n=n.getDoc()),n instanceof t.Doc?i(e,n):void 0)}function s(t,e){t.server.request({files:[{type:"full",name:e.name,text:b(t,e)}]},(function(t){t?window.console.error(t):e.changed=null}))}function a(t,e,n,o,i){t.request(e,o,(function(n,o){if(n)return x(t,e,n);if(t.options.typeTip)var r=t.options.typeTip(o);else if(r=h("span",null,h("strong",null,o.type||"not found")),o.doc&&r.appendChild(document.createTextNode(" — "+o.doc)),o.url){r.appendChild(document.createTextNode(" "));var s=r.appendChild(h("a",null,"[docs]"));s.href=o.url,s.target="_blank"}m(e,r,t),i&&i()}),n)}function c(t,e,o){w(t);for(var i=t.cachedArgHints,r=i.type,s=h("span",i.guess?n+"fhint-guess":null,h("span",n+"fname",i.name),"("),a=0;a<r.args.length;++a){a&&s.appendChild(document.createTextNode(", "));var c=r.args[a];s.appendChild(h("span",n+"farg"+(a==o?" "+n+"farg-current":""),c.name||"?")),"?"!=c.type&&(s.appendChild(document.createTextNode(": ")),s.appendChild(h("span",n+"type",c.type)))}s.appendChild(document.createTextNode(r.rettype?") -> ":")")),r.rettype&&s.appendChild(h("span",n+"type",r.rettype));var l=e.cursorCoords(null,"page"),u=t.activeArgHints=y(l.right+1,l.bottom,s,e);setTimeout((function(){u.clear=v(e,(function(){t.activeArgHints==u&&w(t)}))}),20)}function l(t){var e=[],n=3;function o(e){for(var o=0,i=n;;){var r=t.charAt(n);if(e.test(r)&&!o)return t.slice(i,n);/[{\[\(]/.test(r)?++o:/[}\]\)]/.test(r)&&--o,++n}}if(")"!=t.charAt(n))for(;;){var i=t.slice(n).match(/^([^, \(\[\{]+): /);if(i&&(n+=i[0].length,i=i[1]),e.push({name:i,type:o(/[\),]/)}),")"==t.charAt(n))break;n+=2}var r=t.slice(n).match(/^\) -> (.*)$/);return{args:e,rettype:r&&r[1]}}function u(t,e,n,o,i){n.doc.setSelection(o,i),e!=n&&t.options.switchToDoc&&(w(t),t.options.switchToDoc(n.name,n.doc))}var f=0;function d(n,o,i,r){var s=[],a=0,c=!i.fullDocs;c||delete i.fullDocs,"string"==typeof i&&(i={type:i}),i.lineCharPositions=!0,null==i.end&&(i.end=r||o.doc.getCursor("end"),o.doc.somethingSelected()&&(i.start=o.doc.getCursor("start")));var l=i.start||i.end;for(var u in o.changed?o.doc.lineCount()>250&&!1!==c&&o.changed.to-o.changed.from<100&&o.changed.from<=l.line&&o.changed.to>i.end.line?(s.push(function(n,o,i){for(var r,s=n.doc,a=null,c=null,l=o.line-1,u=Math.max(0,l-50);l>=u;--l){var f=s.getLine(l);if(!(f.search(/\bfunction\b/)<0)){var d=t.countColumn(f,null,4);null!=a&&a<=d||(a=d,c=l)}}null==c&&(c=u);var p=Math.min(s.lastLine(),i.line+20);if(null==a||a==t.countColumn(s.getLine(o.line),null,4))r=p;else for(r=i.line+1;r<p&&!((d=t.countColumn(s.getLine(r),null,4))<=a);++r);var h=e(c,0);return{type:"part",name:n.name,offsetLines:h.line,text:s.getRange(h,e(r,i.line==r?null:0))}}(o,l,i.end)),i.file="#0",a=s[0].offsetLines,null!=i.start&&(i.start=e(i.start.line- -a,i.start.ch)),i.end=e(i.end.line-a,i.end.ch)):(s.push({type:"full",name:o.name,text:b(n,o)}),i.file=o.name,o.changed=null):i.file=o.name,n.docs){var f=n.docs[u];f.changed&&f!=o&&(s.push({type:"full",name:f.name,text:b(n,f)}),f.changed=null)}return{query:i,files:s}}var p=t.cmpPos;function h(t,e){var n=document.createElement(t);e&&(n.className=e);for(var o=2;o<arguments.length;++o){var i=arguments[o];"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i)}return n}function g(t,e,n){t.openDialog?t.openDialog(e+": <input type=text>",n):n(prompt(e,""))}function m(e,n,o){e.state.ternTooltip&&C(e.state.ternTooltip);var i=e.cursorCoords(),r=e.state.ternTooltip=y(i.right+1,i.bottom,n,e);function s(){var t;e.state.ternTooltip=null,r.parentNode&&((t=r).style.opacity="0",setTimeout((function(){C(t)}),1100)),l()}var a=!1,c=!1;t.on(r,"mousemove",(function(){a=!0})),t.on(r,"mouseout",(function(e){var n=e.relatedTarget||e.toElement;n&&t.contains(r,n)||(c?s():a=!1)})),setTimeout((function(){c=!0,a||s()}),o.options.hintDelay?o.options.hintDelay:1700);var l=v(e,s)}function v(t,e){return t.on("cursorActivity",e),t.on("blur",e),t.on("scroll",e),t.on("setDoc",e),function(){t.off("cursorActivity",e),t.off("blur",e),t.off("scroll",e),t.off("setDoc",e)}}function y(t,e,o,i,r){var s=h("div",n+"tooltip "+(r||""),o);s.style.left=t+"px",s.style.top=e+"px",(((i.options||{}).hintOptions||{}).container||document.body).appendChild(s);var a=i.cursorCoords(),c=window.innerWidth,l=window.innerHeight,u=s.getBoundingClientRect(),f=document.querySelector(".CodeMirror-hints"),d=u.bottom-l,p=u.right-c;if(f&&p>0&&(s.style.left=0,u=s.getBoundingClientRect(),s.style.left=(t=t-f.offsetWidth-u.width)+"px",p=u.right-c),d>0){var g=u.bottom-u.top;a.top-(a.bottom-u.top)-g>0?s.style.top=a.top-g+"px":g>l&&(s.style.height=l-5+"px",s.style.top=a.bottom-u.top+"px")}return p>0&&(u.right-u.left>c&&(s.style.width=c-5+"px",p-=u.right-u.left-c),s.style.left=t-p+"px"),s}function C(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function x(t,e,n){t.options.showError?t.options.showError(e,n):m(e,String(n),t)}function w(t){t.activeArgHints&&(t.activeArgHints.clear&&t.activeArgHints.clear(),C(t.activeArgHints),t.activeArgHints=null)}function b(t,e){var n=e.doc.getValue();return t.options.fileFilter&&(n=t.options.fileFilter(n,e.name,e.doc)),n}function T(t){var e=t.worker=new Worker(t.options.workerScript);e.postMessage({type:"init",defs:t.options.defs,plugins:t.options.plugins,scripts:t.options.workerDeps});var n=0,i={};function r(t,o){o&&(t.id=++n,i[n]=o),e.postMessage(t)}e.onmessage=function(e){var n=e.data;"getFile"==n.type?o(t,n.name,(function(t,e){r({type:"getFile",err:String(t),text:e,id:n.id})})):"debug"==n.type?window.console.log(n.message):n.id&&i[n.id]&&(i[n.id](n.err,n.body),delete i[n.id])},e.onerror=function(t){for(var e in i)i[e](t);i={}},this.addFile=function(t,e){r({type:"add",name:t,text:e})},this.delFile=function(t){r({type:"del",name:t})},this.request=function(t,e){r({type:"req",body:t},e)}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var server;this.onmessage=function(e){var t=e.data;switch(t.type){case"init":return startServer(t.defs,t.plugins,t.scripts);case"add":return server.addFile(t.name,t.text);case"del":return server.delFile(t.name);case"req":return server.request(t.body,(function(e,r){postMessage({id:t.id,body:r,err:e&&String(e)})}));case"getFile":var r=pending[t.id];return delete pending[t.id],r(t.err,t.text);default:throw new Error("Unknown message type: "+t.type)}};var nextId=0,pending={};function getFile(e,t){postMessage({type:"getFile",name:e,id:++nextId}),pending[nextId]=t}function startServer(e,t,r){r&&importScripts.apply(null,r),server=new tern.Server({getFile,async:!0,defs:e,plugins:t})}this.console={log:function(e){postMessage({type:"debug",message:e})}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var r=t.Pos;function e(t,r,e){for(var n=e.paragraphStart||t.getHelper(r,"paragraphStart"),o=r.line,a=t.firstLine();o>a;--o){var i=t.getLine(o);if(n&&n.test(i))break;if(!/\S/.test(i)){++o;break}}for(var f=e.paragraphEnd||t.getHelper(r,"paragraphEnd"),l=r.line+1,h=t.lastLine();l<=h;++l){if(i=t.getLine(l),f&&f.test(i)){++l;break}if(!/\S/.test(i))break}return{from:o,to:l}}function n(t,r,e,n,o){for(var a=r;a<t.length&&" "==t.charAt(a);)a++;for(;a>0&&!e.test(t.slice(a-1,a+1));--a);if(!o&&a<=t.match(/^[ \t]*/)[0].length)for(a=r+1;a<t.length-1&&!e.test(t.slice(a-1,a+1));++a);for(var i=!0;;i=!1){var f=a;if(n)for(;" "==t.charAt(f-1);)--f;if(0!=f||!i)return{from:f,to:a};a=r}}function o(e,o,a,i){o=e.clipPos(o),a=e.clipPos(a);var f=i.column||80,l=i.wrapOn||/\s\S|-[^\.\d]/,h=!1!==i.forceBreak,s=!1!==i.killTrailingSpace,c=[],g="",p=o.line,m=e.getRange(o,a,!1);if(!m.length)return null;var u=m[0].match(/^[ \t]*/)[0];u.length>=f&&(f=u.length+1);for(var v=0;v<m.length;++v){var d=m[v],b=g.length,x=0;g&&d&&!l.test(g.charAt(g.length-1)+d.charAt(0))&&(g+=" ",x=1);var k="";if(v&&(k=d.match(/^\s*/)[0],d=d.slice(k.length)),g+=d,v){var S=g.length>f&&u==k&&n(g,f,l,s,h);S&&S.from==b&&S.to==b+x?(g=u+d,++p):c.push({text:[x?" ":""],from:r(p,b),to:r(p+1,k.length)})}for(;g.length>f;){var E=n(g,f,l,s,h);if(!(E.from!=E.to||h&&u!==g.slice(0,E.to)))break;c.push({text:["",u],from:r(p,E.from),to:r(p,E.to)}),g=u+g.slice(E.to),++p}}return c.length&&e.operation((function(){for(var r=0;r<c.length;++r){var n=c[r];(n.text||t.cmpPos(n.from,n.to))&&e.replaceRange(n.text,n.from,n.to)}})),c.length?{from:c[0].from,to:t.changeEnd(c[c.length-1])}:null}t.defineExtension("wrapParagraph",(function(t,n){n=n||{},t||(t=this.getCursor());var a=e(this,t,n);return o(this,r(a.from,0),r(a.to-1),n)})),t.commands.wrapLines=function(t){t.operation((function(){for(var n=t.listSelections(),a=t.lastLine()+1,i=n.length-1;i>=0;i--){var f,l=n[i];if(l.empty()){var h=e(t,l.head,{});f={from:r(h.from,0),to:r(h.to-1)}}else f={from:l.from(),to:l.to()};f.to.line>=a||(a=f.from.line,o(t,f.from,f.to,{}))}}))},t.defineExtension("wrapRange",(function(t,r,e){return o(this,t,r,e||{})})),t.defineExtension("wrapParagraphsInRange",(function(t,n,a){a=a||{};for(var i=this,f=[],l=t.line;l<=n.line;){var h=e(i,r(l,0),a);f.push(h),l=h.to}var s=!1;return f.length&&i.operation((function(){for(var t=f.length-1;t>=0;--t)s=s||o(i,r(f[t].from,0),r(f[t].to-1),a)})),s}))}));
|