qword 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +10 -0
- package/bower.json +25 -0
- package/client/_clipboard.js +50 -0
- package/client/_init-socket.js +76 -0
- package/client/_on-save.js +38 -0
- package/client/content.d.ts +8 -0
- package/client/content.js +14 -0
- package/client/create.d.ts +33 -0
- package/client/create.js +101 -0
- package/client/decorations.d.ts +38 -0
- package/client/decorations.js +110 -0
- package/client/dom.d.ts +8 -0
- package/client/dom.js +17 -0
- package/client/editor.d.ts +46 -0
- package/client/editor.js +178 -0
- package/client/events.d.ts +8 -0
- package/client/events.js +8 -0
- package/client/highlight.d.ts +3 -0
- package/client/highlight.js +82 -0
- package/client/history.d.ts +5 -0
- package/client/history.js +14 -0
- package/client/index.d.ts +60 -0
- package/client/index.js +38 -0
- package/client/loadremote.js +102 -0
- package/client/options.d.ts +31 -0
- package/client/options.js +70 -0
- package/client/position.d.ts +19 -0
- package/client/position.js +33 -0
- package/client/qword.js +196 -0
- package/client/save.js +53 -0
- package/client/scroll.d.ts +11 -0
- package/client/scroll.js +9 -0
- package/client/show-message.js +30 -0
- package/client/story.js +55 -0
- package/client/types.d.ts +28 -0
- package/dist/qword.js +1 -1
- package/dist/qword.js.map +1 -1
- package/dist-dev/qword.js +1 -1
- package/package.json +1 -1
- package/modules/cm-searchbox/ChangeLog +0 -60
- package/modules/cm-searchbox/LICENSE +0 -21
- package/modules/cm-searchbox/README.md +0 -27
- package/modules/cm-searchbox/img/searchbox.png +0 -0
- package/modules/cm-searchbox/lib/searchbox.js +0 -679
- package/modules/cm-searchbox/package.json +0 -27
- package/modules/cm-show-invisibles/ChangeLog +0 -108
- package/modules/cm-show-invisibles/LICENSE +0 -21
- package/modules/cm-show-invisibles/README.md +0 -25
- package/modules/cm-show-invisibles/lib/show-invisibles.js +0 -131
- package/modules/cm-show-invisibles/package.json +0 -34
- package/modules/codemirror-emmet/README.md +0 -56
- package/modules/codemirror-emmet/dist/emmet.js +0 -48661
- package/modules/codemirror-emmet/dist/emmet.min.js +0 -8
- package/modules/codemirror-emmet/dist/emmetPlugin.js +0 -840
- package/modules/codemirror-emmet/dist/emmetPlugin.min.js +0 -1
- package/modules/codemirror-emmet/dist/index.html +0 -46
- package/modules/codemirror-emmet/editor.js +0 -204
- package/modules/codemirror-emmet/gulpfile.js +0 -54
- package/modules/codemirror-emmet/index.html +0 -68
- package/modules/codemirror-emmet/package.json +0 -36
- package/modules/codemirror-emmet/plugin.js +0 -201
- package/modules/codemirror-emmet/shim.js +0 -19
- package/modules/codemirror-emmet/vendor/almond.js +0 -410
- package/modules/codemirror-emmet/vendor/codemirror/v4/codemirror.css +0 -270
- package/modules/codemirror-emmet/vendor/codemirror/v4/codemirror.js +0 -7339
- package/modules/codemirror-emmet/vendor/codemirror/v4/css.js +0 -701
- package/modules/codemirror-emmet/vendor/codemirror/v4/htmlmixed.js +0 -117
- package/modules/codemirror-emmet/vendor/codemirror/v4/xml.js +0 -349
- package/modules/loadremote/ChangeLog +0 -23
- package/modules/loadremote/LICENSE +0 -21
- package/modules/loadremote/README.md +0 -53
- package/modules/loadremote/lib/loadremote.js +0 -147
- package/modules/loadremote/package.json +0 -26
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
(function(mod) {
|
|
2
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
3
|
-
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css"));
|
|
4
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
5
|
-
define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod);
|
|
6
|
-
else // Plain browser env
|
|
7
|
-
mod(CodeMirror);
|
|
8
|
-
})(function(CodeMirror) {
|
|
9
|
-
"use strict";
|
|
10
|
-
|
|
11
|
-
CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
|
|
12
|
-
var htmlMode = CodeMirror.getMode(config, {name: "xml",
|
|
13
|
-
htmlMode: true,
|
|
14
|
-
multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
|
|
15
|
-
multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag});
|
|
16
|
-
var cssMode = CodeMirror.getMode(config, "css");
|
|
17
|
-
|
|
18
|
-
var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes;
|
|
19
|
-
scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,
|
|
20
|
-
mode: CodeMirror.getMode(config, "javascript")});
|
|
21
|
-
if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) {
|
|
22
|
-
var conf = scriptTypesConf[i];
|
|
23
|
-
scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)});
|
|
24
|
-
}
|
|
25
|
-
scriptTypes.push({matches: /./,
|
|
26
|
-
mode: CodeMirror.getMode(config, "text/plain")});
|
|
27
|
-
|
|
28
|
-
function html(stream, state) {
|
|
29
|
-
var tagName = state.htmlState.tagName;
|
|
30
|
-
var style = htmlMode.token(stream, state.htmlState);
|
|
31
|
-
if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") {
|
|
32
|
-
// Script block: mode to change to depends on type attribute
|
|
33
|
-
var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);
|
|
34
|
-
scriptType = scriptType ? scriptType[1] : "";
|
|
35
|
-
if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1);
|
|
36
|
-
for (var i = 0; i < scriptTypes.length; ++i) {
|
|
37
|
-
var tp = scriptTypes[i];
|
|
38
|
-
if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) {
|
|
39
|
-
if (tp.mode) {
|
|
40
|
-
state.token = script;
|
|
41
|
-
state.localMode = tp.mode;
|
|
42
|
-
state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, ""));
|
|
43
|
-
}
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
} else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") {
|
|
48
|
-
state.token = css;
|
|
49
|
-
state.localMode = cssMode;
|
|
50
|
-
state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
|
|
51
|
-
}
|
|
52
|
-
return style;
|
|
53
|
-
}
|
|
54
|
-
function maybeBackup(stream, pat, style) {
|
|
55
|
-
var cur = stream.current();
|
|
56
|
-
var close = cur.search(pat), m;
|
|
57
|
-
if (close > -1) stream.backUp(cur.length - close);
|
|
58
|
-
else if (m = cur.match(/<\/?$/)) {
|
|
59
|
-
stream.backUp(cur.length);
|
|
60
|
-
if (!stream.match(pat, false)) stream.match(cur);
|
|
61
|
-
}
|
|
62
|
-
return style;
|
|
63
|
-
}
|
|
64
|
-
function script(stream, state) {
|
|
65
|
-
if (stream.match(/^<\/\s*script\s*>/i, false)) {
|
|
66
|
-
state.token = html;
|
|
67
|
-
state.localState = state.localMode = null;
|
|
68
|
-
return html(stream, state);
|
|
69
|
-
}
|
|
70
|
-
return maybeBackup(stream, /<\/\s*script\s*>/,
|
|
71
|
-
state.localMode.token(stream, state.localState));
|
|
72
|
-
}
|
|
73
|
-
function css(stream, state) {
|
|
74
|
-
if (stream.match(/^<\/\s*style\s*>/i, false)) {
|
|
75
|
-
state.token = html;
|
|
76
|
-
state.localState = state.localMode = null;
|
|
77
|
-
return html(stream, state);
|
|
78
|
-
}
|
|
79
|
-
return maybeBackup(stream, /<\/\s*style\s*>/,
|
|
80
|
-
cssMode.token(stream, state.localState));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
startState: function() {
|
|
85
|
-
var state = htmlMode.startState();
|
|
86
|
-
return {token: html, localMode: null, localState: null, htmlState: state};
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
copyState: function(state) {
|
|
90
|
-
if (state.localState)
|
|
91
|
-
var local = CodeMirror.copyState(state.localMode, state.localState);
|
|
92
|
-
return {token: state.token, localMode: state.localMode, localState: local,
|
|
93
|
-
htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
token: function(stream, state) {
|
|
97
|
-
return state.token(stream, state);
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
indent: function(state, textAfter) {
|
|
101
|
-
if (!state.localMode || /^\s*<\//.test(textAfter))
|
|
102
|
-
return htmlMode.indent(state.htmlState, textAfter);
|
|
103
|
-
else if (state.localMode.indent)
|
|
104
|
-
return state.localMode.indent(state.localState, textAfter);
|
|
105
|
-
else
|
|
106
|
-
return CodeMirror.Pass;
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
innerMode: function(state) {
|
|
110
|
-
return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
}, "xml", "javascript", "css");
|
|
114
|
-
|
|
115
|
-
CodeMirror.defineMIME("text/html", "htmlmixed");
|
|
116
|
-
|
|
117
|
-
});
|
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
(function(mod) {
|
|
2
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
3
|
-
mod(require("../../lib/codemirror"));
|
|
4
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
5
|
-
define(["../../lib/codemirror"], mod);
|
|
6
|
-
else // Plain browser env
|
|
7
|
-
mod(CodeMirror);
|
|
8
|
-
})(function(CodeMirror) {
|
|
9
|
-
"use strict";
|
|
10
|
-
|
|
11
|
-
CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
12
|
-
var indentUnit = config.indentUnit;
|
|
13
|
-
var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1;
|
|
14
|
-
var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag;
|
|
15
|
-
if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true;
|
|
16
|
-
|
|
17
|
-
var Kludges = parserConfig.htmlMode ? {
|
|
18
|
-
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
|
19
|
-
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
|
20
|
-
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
|
21
|
-
'track': true, 'wbr': true},
|
|
22
|
-
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
|
23
|
-
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
|
24
|
-
'th': true, 'tr': true},
|
|
25
|
-
contextGrabbers: {
|
|
26
|
-
'dd': {'dd': true, 'dt': true},
|
|
27
|
-
'dt': {'dd': true, 'dt': true},
|
|
28
|
-
'li': {'li': true},
|
|
29
|
-
'option': {'option': true, 'optgroup': true},
|
|
30
|
-
'optgroup': {'optgroup': true},
|
|
31
|
-
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
|
32
|
-
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
|
33
|
-
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
|
34
|
-
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
|
35
|
-
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
|
36
|
-
'rp': {'rp': true, 'rt': true},
|
|
37
|
-
'rt': {'rp': true, 'rt': true},
|
|
38
|
-
'tbody': {'tbody': true, 'tfoot': true},
|
|
39
|
-
'td': {'td': true, 'th': true},
|
|
40
|
-
'tfoot': {'tbody': true},
|
|
41
|
-
'th': {'td': true, 'th': true},
|
|
42
|
-
'thead': {'tbody': true, 'tfoot': true},
|
|
43
|
-
'tr': {'tr': true}
|
|
44
|
-
},
|
|
45
|
-
doNotIndent: {"pre": true},
|
|
46
|
-
allowUnquoted: true,
|
|
47
|
-
allowMissing: true,
|
|
48
|
-
caseFold: true
|
|
49
|
-
} : {
|
|
50
|
-
autoSelfClosers: {},
|
|
51
|
-
implicitlyClosed: {},
|
|
52
|
-
contextGrabbers: {},
|
|
53
|
-
doNotIndent: {},
|
|
54
|
-
allowUnquoted: false,
|
|
55
|
-
allowMissing: false,
|
|
56
|
-
caseFold: false
|
|
57
|
-
};
|
|
58
|
-
var alignCDATA = parserConfig.alignCDATA;
|
|
59
|
-
|
|
60
|
-
// Return variables for tokenizers
|
|
61
|
-
var tagName, type, setStyle;
|
|
62
|
-
|
|
63
|
-
function inText(stream, state) {
|
|
64
|
-
function chain(parser) {
|
|
65
|
-
state.tokenize = parser;
|
|
66
|
-
return parser(stream, state);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
var ch = stream.next();
|
|
70
|
-
if (ch == "<") {
|
|
71
|
-
if (stream.eat("!")) {
|
|
72
|
-
if (stream.eat("[")) {
|
|
73
|
-
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
|
74
|
-
else return null;
|
|
75
|
-
} else if (stream.match("--")) {
|
|
76
|
-
return chain(inBlock("comment", "-->"));
|
|
77
|
-
} else if (stream.match("DOCTYPE", true, true)) {
|
|
78
|
-
stream.eatWhile(/[\w\._\-]/);
|
|
79
|
-
return chain(doctype(1));
|
|
80
|
-
} else {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
} else if (stream.eat("?")) {
|
|
84
|
-
stream.eatWhile(/[\w\._\-]/);
|
|
85
|
-
state.tokenize = inBlock("meta", "?>");
|
|
86
|
-
return "meta";
|
|
87
|
-
} else {
|
|
88
|
-
var isClose = stream.eat("/");
|
|
89
|
-
tagName = "";
|
|
90
|
-
var c;
|
|
91
|
-
while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
|
|
92
|
-
if (Kludges.caseFold) tagName = tagName.toLowerCase();
|
|
93
|
-
if (!tagName) return "tag error";
|
|
94
|
-
type = isClose ? "closeTag" : "openTag";
|
|
95
|
-
state.tokenize = inTag;
|
|
96
|
-
return "tag";
|
|
97
|
-
}
|
|
98
|
-
} else if (ch == "&") {
|
|
99
|
-
var ok;
|
|
100
|
-
if (stream.eat("#")) {
|
|
101
|
-
if (stream.eat("x")) {
|
|
102
|
-
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
|
103
|
-
} else {
|
|
104
|
-
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
|
105
|
-
}
|
|
106
|
-
} else {
|
|
107
|
-
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
|
108
|
-
}
|
|
109
|
-
return ok ? "atom" : "error";
|
|
110
|
-
} else {
|
|
111
|
-
stream.eatWhile(/[^&<]/);
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function inTag(stream, state) {
|
|
117
|
-
var ch = stream.next();
|
|
118
|
-
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
|
119
|
-
state.tokenize = inText;
|
|
120
|
-
type = ch == ">" ? "endTag" : "selfcloseTag";
|
|
121
|
-
return "tag";
|
|
122
|
-
} else if (ch == "=") {
|
|
123
|
-
type = "equals";
|
|
124
|
-
return null;
|
|
125
|
-
} else if (ch == "<") {
|
|
126
|
-
state.tokenize = inText;
|
|
127
|
-
state.state = baseState;
|
|
128
|
-
state.tagName = state.tagStart = null;
|
|
129
|
-
var next = state.tokenize(stream, state);
|
|
130
|
-
return next ? next + " error" : "error";
|
|
131
|
-
} else if (/[\'\"]/.test(ch)) {
|
|
132
|
-
state.tokenize = inAttribute(ch);
|
|
133
|
-
state.stringStartCol = stream.column();
|
|
134
|
-
return state.tokenize(stream, state);
|
|
135
|
-
} else {
|
|
136
|
-
stream.eatWhile(/[^\s\u00a0=<>\"\']/);
|
|
137
|
-
return "word";
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function inAttribute(quote) {
|
|
142
|
-
var closure = function(stream, state) {
|
|
143
|
-
while (!stream.eol()) {
|
|
144
|
-
if (stream.next() == quote) {
|
|
145
|
-
state.tokenize = inTag;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return "string";
|
|
150
|
-
};
|
|
151
|
-
closure.isInAttribute = true;
|
|
152
|
-
return closure;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function inBlock(style, terminator) {
|
|
156
|
-
return function(stream, state) {
|
|
157
|
-
while (!stream.eol()) {
|
|
158
|
-
if (stream.match(terminator)) {
|
|
159
|
-
state.tokenize = inText;
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
stream.next();
|
|
163
|
-
}
|
|
164
|
-
return style;
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
function doctype(depth) {
|
|
168
|
-
return function(stream, state) {
|
|
169
|
-
var ch;
|
|
170
|
-
while ((ch = stream.next()) != null) {
|
|
171
|
-
if (ch == "<") {
|
|
172
|
-
state.tokenize = doctype(depth + 1);
|
|
173
|
-
return state.tokenize(stream, state);
|
|
174
|
-
} else if (ch == ">") {
|
|
175
|
-
if (depth == 1) {
|
|
176
|
-
state.tokenize = inText;
|
|
177
|
-
break;
|
|
178
|
-
} else {
|
|
179
|
-
state.tokenize = doctype(depth - 1);
|
|
180
|
-
return state.tokenize(stream, state);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return "meta";
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function Context(state, tagName, startOfLine) {
|
|
189
|
-
this.prev = state.context;
|
|
190
|
-
this.tagName = tagName;
|
|
191
|
-
this.indent = state.indented;
|
|
192
|
-
this.startOfLine = startOfLine;
|
|
193
|
-
if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
|
194
|
-
this.noIndent = true;
|
|
195
|
-
}
|
|
196
|
-
function popContext(state) {
|
|
197
|
-
if (state.context) state.context = state.context.prev;
|
|
198
|
-
}
|
|
199
|
-
function maybePopContext(state, nextTagName) {
|
|
200
|
-
var parentTagName;
|
|
201
|
-
while (true) {
|
|
202
|
-
if (!state.context) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
parentTagName = state.context.tagName;
|
|
206
|
-
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
|
|
207
|
-
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
popContext(state);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function baseState(type, stream, state) {
|
|
215
|
-
if (type == "openTag") {
|
|
216
|
-
state.tagName = tagName;
|
|
217
|
-
state.tagStart = stream.column();
|
|
218
|
-
return attrState;
|
|
219
|
-
} else if (type == "closeTag") {
|
|
220
|
-
var err = false;
|
|
221
|
-
if (state.context) {
|
|
222
|
-
if (state.context.tagName != tagName) {
|
|
223
|
-
if (Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
|
224
|
-
popContext(state);
|
|
225
|
-
err = !state.context || state.context.tagName != tagName;
|
|
226
|
-
}
|
|
227
|
-
} else {
|
|
228
|
-
err = true;
|
|
229
|
-
}
|
|
230
|
-
if (err) setStyle = "error";
|
|
231
|
-
return err ? closeStateErr : closeState;
|
|
232
|
-
} else {
|
|
233
|
-
return baseState;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function closeState(type, _stream, state) {
|
|
238
|
-
if (type != "endTag") {
|
|
239
|
-
setStyle = "error";
|
|
240
|
-
return closeState;
|
|
241
|
-
}
|
|
242
|
-
popContext(state);
|
|
243
|
-
return baseState;
|
|
244
|
-
}
|
|
245
|
-
function closeStateErr(type, stream, state) {
|
|
246
|
-
setStyle = "error";
|
|
247
|
-
return closeState(type, stream, state);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function attrState(type, _stream, state) {
|
|
251
|
-
if (type == "word") {
|
|
252
|
-
setStyle = "attribute";
|
|
253
|
-
return attrEqState;
|
|
254
|
-
} else if (type == "endTag" || type == "selfcloseTag") {
|
|
255
|
-
var tagName = state.tagName, tagStart = state.tagStart;
|
|
256
|
-
state.tagName = state.tagStart = null;
|
|
257
|
-
if (type == "selfcloseTag" ||
|
|
258
|
-
Kludges.autoSelfClosers.hasOwnProperty(tagName)) {
|
|
259
|
-
maybePopContext(state, tagName);
|
|
260
|
-
} else {
|
|
261
|
-
maybePopContext(state, tagName);
|
|
262
|
-
state.context = new Context(state, tagName, tagStart == state.indented);
|
|
263
|
-
}
|
|
264
|
-
return baseState;
|
|
265
|
-
}
|
|
266
|
-
setStyle = "error";
|
|
267
|
-
return attrState;
|
|
268
|
-
}
|
|
269
|
-
function attrEqState(type, stream, state) {
|
|
270
|
-
if (type == "equals") return attrValueState;
|
|
271
|
-
if (!Kludges.allowMissing) setStyle = "error";
|
|
272
|
-
return attrState(type, stream, state);
|
|
273
|
-
}
|
|
274
|
-
function attrValueState(type, stream, state) {
|
|
275
|
-
if (type == "string") return attrContinuedState;
|
|
276
|
-
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;}
|
|
277
|
-
setStyle = "error";
|
|
278
|
-
return attrState(type, stream, state);
|
|
279
|
-
}
|
|
280
|
-
function attrContinuedState(type, stream, state) {
|
|
281
|
-
if (type == "string") return attrContinuedState;
|
|
282
|
-
return attrState(type, stream, state);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
return {
|
|
286
|
-
startState: function() {
|
|
287
|
-
return {tokenize: inText,
|
|
288
|
-
state: baseState,
|
|
289
|
-
indented: 0,
|
|
290
|
-
tagName: null, tagStart: null,
|
|
291
|
-
context: null};
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
token: function(stream, state) {
|
|
295
|
-
if (!state.tagName && stream.sol())
|
|
296
|
-
state.indented = stream.indentation();
|
|
297
|
-
|
|
298
|
-
if (stream.eatSpace()) return null;
|
|
299
|
-
tagName = type = null;
|
|
300
|
-
var style = state.tokenize(stream, state);
|
|
301
|
-
if ((style || type) && style != "comment") {
|
|
302
|
-
setStyle = null;
|
|
303
|
-
state.state = state.state(type || style, stream, state);
|
|
304
|
-
if (setStyle)
|
|
305
|
-
style = setStyle == "error" ? style + " error" : setStyle;
|
|
306
|
-
}
|
|
307
|
-
return style;
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
indent: function(state, textAfter, fullLine) {
|
|
311
|
-
var context = state.context;
|
|
312
|
-
// Indent multi-line strings (e.g. css).
|
|
313
|
-
if (state.tokenize.isInAttribute) {
|
|
314
|
-
return state.stringStartCol + 1;
|
|
315
|
-
}
|
|
316
|
-
if (context && context.noIndent) return CodeMirror.Pass;
|
|
317
|
-
if (state.tokenize != inTag && state.tokenize != inText)
|
|
318
|
-
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
|
319
|
-
// Indent the starts of attribute names.
|
|
320
|
-
if (state.tagName) {
|
|
321
|
-
if (multilineTagIndentPastTag)
|
|
322
|
-
return state.tagStart + state.tagName.length + 2;
|
|
323
|
-
else
|
|
324
|
-
return state.tagStart + indentUnit * multilineTagIndentFactor;
|
|
325
|
-
}
|
|
326
|
-
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
|
327
|
-
if (context && /^<\//.test(textAfter))
|
|
328
|
-
context = context.prev;
|
|
329
|
-
while (context && !context.startOfLine)
|
|
330
|
-
context = context.prev;
|
|
331
|
-
if (context) return context.indent + indentUnit;
|
|
332
|
-
else return 0;
|
|
333
|
-
},
|
|
334
|
-
|
|
335
|
-
electricChars: "/",
|
|
336
|
-
blockCommentStart: "<!--",
|
|
337
|
-
blockCommentEnd: "-->",
|
|
338
|
-
|
|
339
|
-
configuration: parserConfig.htmlMode ? "html" : "xml",
|
|
340
|
-
helperType: parserConfig.htmlMode ? "html" : "xml"
|
|
341
|
-
};
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
CodeMirror.defineMIME("text/xml", "xml");
|
|
345
|
-
CodeMirror.defineMIME("application/xml", "xml");
|
|
346
|
-
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
|
347
|
-
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
|
348
|
-
|
|
349
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
2016.02.01, v1.2.0
|
|
2
|
-
|
|
3
|
-
fix:
|
|
4
|
-
- feature(loadremote) rm noPrefix
|
|
5
|
-
|
|
6
|
-
feature:
|
|
7
|
-
- (loadremote) rm noPrefix
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
2015.10.01, v1.1.1
|
|
11
|
-
|
|
12
|
-
fix:
|
|
13
|
-
- (loadremote) rm memo
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
2015.10.01, v1.1.0
|
|
17
|
-
|
|
18
|
-
feature:
|
|
19
|
-
- (loadremote) add memo, amemo, once
|
|
20
|
-
- (package) private
|
|
21
|
-
- (package) load-remote -> loadremote
|
|
22
|
-
- (bower) load-remote -> loadremote
|
|
23
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2015 coderaiser
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Load Remote
|
|
2
|
-
|
|
3
|
-
Library for loading modules from cdn or local file system.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
With npm:
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
npm i load-remote --save
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Or with bower:
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
bower i load-remote --save
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## How to use?
|
|
20
|
-
|
|
21
|
-
You should create files `modules.json` similar to this:
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
[{
|
|
25
|
-
"name": "socket",
|
|
26
|
-
"version": "1.3.5",
|
|
27
|
-
"local": "/socket.io/socket.io.js",
|
|
28
|
-
"remote": "//cdn.socket.io/socket.io-{{ version }}.js"
|
|
29
|
-
}]
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
And `options.js`:
|
|
33
|
-
|
|
34
|
-
```json
|
|
35
|
-
{
|
|
36
|
-
"online": true
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Then load [execon](https://github.com/coderaiser/execon "Execon") and `lib/load-remote.js`
|
|
41
|
-
and run this code:
|
|
42
|
-
|
|
43
|
-
```js
|
|
44
|
-
loadRemote('socket', { /* name of module in modules.json */
|
|
45
|
-
name : 'io', { /* name of variable in window object */
|
|
46
|
-
prefix: prefix, /* prefix for loading modules.json and options.json (could be empty) */
|
|
47
|
-
noPrefix: true /* do not add prefix to socket local url */
|
|
48
|
-
}, callback);
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## License
|
|
52
|
-
|
|
53
|
-
MIT
|