mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
add editor component
This commit is contained in:
parent
b559826db5
commit
76ccbf333e
47 changed files with 188519 additions and 2 deletions
11
.vscode/settings.json
vendored
Normal file
11
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
}
|
||||
}
|
||||
|
|
@ -282,6 +282,26 @@ body {
|
|||
@apply relative flex flex-col items-start;
|
||||
}
|
||||
|
||||
.input-editor-container {
|
||||
@apply h-full relative;
|
||||
}
|
||||
|
||||
.disabled.input-editor-container {
|
||||
@apply opacity-50 cursor-not-allowed;
|
||||
}
|
||||
|
||||
.input-editor {
|
||||
@apply min-h-[200px] w-full;
|
||||
}
|
||||
|
||||
.disabled.input-editor {
|
||||
@apply -z-10 pointer-events-none;
|
||||
}
|
||||
|
||||
.input-editor-error {
|
||||
@apply absolute w-full h-full border-2 border-red-500 z-10 pointer-events-none outline-red-500;
|
||||
}
|
||||
|
||||
.invalid.input-regular,
|
||||
.invalid.input-regular:hover,
|
||||
.invalid.input-regular:focus,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
18939
vuejs/client/src/assets/script/editor/ace.js
Normal file
18939
vuejs/client/src/assets/script/editor/ace.js
Normal file
File diff suppressed because one or more lines are too long
280
vuejs/client/src/assets/script/editor/ext-beautify.js
Normal file
280
vuejs/client/src/assets/script/editor/ext-beautify.js
Normal file
|
|
@ -0,0 +1,280 @@
|
|||
define("ace/ext/beautify", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/token_iterator",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
function i(e, t) {
|
||||
return e.type.lastIndexOf(t + ".xml") > -1;
|
||||
}
|
||||
var r = e("../token_iterator").TokenIterator;
|
||||
(t.singletonTags = [
|
||||
"area",
|
||||
"base",
|
||||
"br",
|
||||
"col",
|
||||
"command",
|
||||
"embed",
|
||||
"hr",
|
||||
"html",
|
||||
"img",
|
||||
"input",
|
||||
"keygen",
|
||||
"link",
|
||||
"meta",
|
||||
"param",
|
||||
"source",
|
||||
"track",
|
||||
"wbr",
|
||||
]),
|
||||
(t.blockTags = [
|
||||
"article",
|
||||
"aside",
|
||||
"blockquote",
|
||||
"body",
|
||||
"div",
|
||||
"dl",
|
||||
"fieldset",
|
||||
"footer",
|
||||
"form",
|
||||
"head",
|
||||
"header",
|
||||
"html",
|
||||
"nav",
|
||||
"ol",
|
||||
"p",
|
||||
"script",
|
||||
"section",
|
||||
"style",
|
||||
"table",
|
||||
"tbody",
|
||||
"tfoot",
|
||||
"thead",
|
||||
"ul",
|
||||
]),
|
||||
(t.formatOptions = { lineBreaksAfterCommasInCurlyBlock: !0 }),
|
||||
(t.beautify = function (e) {
|
||||
var n = new r(e, 0, 0),
|
||||
s = n.getCurrentToken(),
|
||||
o = e.getTabString(),
|
||||
u = t.singletonTags,
|
||||
a = t.blockTags,
|
||||
f = t.formatOptions || {},
|
||||
l,
|
||||
c = !1,
|
||||
h = !1,
|
||||
p = !1,
|
||||
d = "",
|
||||
v = "",
|
||||
m = "",
|
||||
g = 0,
|
||||
y = 0,
|
||||
b = 0,
|
||||
w = 0,
|
||||
E = 0,
|
||||
S = 0,
|
||||
x = 0,
|
||||
T,
|
||||
N = 0,
|
||||
C = 0,
|
||||
k = [],
|
||||
L = !1,
|
||||
A,
|
||||
O = !1,
|
||||
M = !1,
|
||||
_ = !1,
|
||||
D = !1,
|
||||
P = { 0: 0 },
|
||||
H = [],
|
||||
B = !1,
|
||||
j = function () {
|
||||
l &&
|
||||
l.value &&
|
||||
l.type !== "string.regexp" &&
|
||||
(l.value = l.value.replace(/^\s*/, ""));
|
||||
},
|
||||
F = function () {
|
||||
var e = d.length - 1;
|
||||
for (;;) {
|
||||
if (e == 0) break;
|
||||
if (d[e] !== " ") break;
|
||||
e -= 1;
|
||||
}
|
||||
d = d.slice(0, e + 1);
|
||||
},
|
||||
I = function () {
|
||||
(d = d.trimRight()), (c = !1);
|
||||
};
|
||||
while (s !== null) {
|
||||
(N = n.getCurrentTokenRow()), (k = n.$rowTokens), (l = n.stepForward());
|
||||
if (typeof s != "undefined") {
|
||||
(v = s.value),
|
||||
(E = 0),
|
||||
(_ = m === "style" || e.$modeId === "ace/mode/css"),
|
||||
i(s, "tag-open")
|
||||
? ((M = !0),
|
||||
l && (D = a.indexOf(l.value) !== -1),
|
||||
v === "</" &&
|
||||
(D && !c && C < 1 && C++, _ && (C = 1), (E = 1), (D = !1)))
|
||||
: i(s, "tag-close")
|
||||
? (M = !1)
|
||||
: i(s, "comment.start")
|
||||
? (D = !0)
|
||||
: i(s, "comment.end") && (D = !1),
|
||||
!M &&
|
||||
!C &&
|
||||
s.type === "paren.rparen" &&
|
||||
s.value.substr(0, 1) === "}" &&
|
||||
C++,
|
||||
N !== T && ((C = N), T && (C -= T));
|
||||
if (C) {
|
||||
I();
|
||||
for (; C > 0; C--) d += "\n";
|
||||
(c = !0),
|
||||
!i(s, "comment") &&
|
||||
!s.type.match(/^(comment|string)$/) &&
|
||||
(v = v.trimLeft());
|
||||
}
|
||||
if (v) {
|
||||
s.type === "keyword" &&
|
||||
v.match(/^(if|else|elseif|for|foreach|while|switch)$/)
|
||||
? ((H[g] = v),
|
||||
j(),
|
||||
(p = !0),
|
||||
v.match(/^(else|elseif)$/) &&
|
||||
d.match(/\}[\s]*$/) &&
|
||||
(I(), (h = !0)))
|
||||
: s.type === "paren.lparen"
|
||||
? (j(),
|
||||
v.substr(-1) === "{" && ((p = !0), (O = !1), M || (C = 1)),
|
||||
v.substr(0, 1) === "{" &&
|
||||
((h = !0),
|
||||
d.substr(-1) !== "[" && d.trimRight().substr(-1) === "["
|
||||
? (I(), (h = !1))
|
||||
: d.trimRight().substr(-1) === ")"
|
||||
? I()
|
||||
: F()))
|
||||
: s.type === "paren.rparen"
|
||||
? ((E = 1),
|
||||
v.substr(0, 1) === "}" &&
|
||||
(H[g - 1] === "case" && E++,
|
||||
d.trimRight().substr(-1) === "{"
|
||||
? I()
|
||||
: ((h = !0), _ && (C += 2))),
|
||||
v.substr(0, 1) === "]" &&
|
||||
d.substr(-1) !== "}" &&
|
||||
d.trimRight().substr(-1) === "}" &&
|
||||
((h = !1), w++, I()),
|
||||
v.substr(0, 1) === ")" &&
|
||||
d.substr(-1) !== "(" &&
|
||||
d.trimRight().substr(-1) === "(" &&
|
||||
((h = !1), w++, I()),
|
||||
F())
|
||||
: (s.type !== "keyword.operator" && s.type !== "keyword") ||
|
||||
!v.match(
|
||||
/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/,
|
||||
)
|
||||
? s.type === "punctuation.operator" && v === ";"
|
||||
? (I(), j(), (p = !0), _ && C++)
|
||||
: s.type === "punctuation.operator" && v.match(/^(:|,)$/)
|
||||
? (I(),
|
||||
j(),
|
||||
v.match(/^(,)$/) &&
|
||||
x > 0 &&
|
||||
S === 0 &&
|
||||
f.lineBreaksAfterCommasInCurlyBlock
|
||||
? C++
|
||||
: ((p = !0), (c = !1)))
|
||||
: s.type === "support.php_tag" && v === "?>" && !c
|
||||
? (I(), (h = !0))
|
||||
: i(s, "attribute-name") && d.substr(-1).match(/^\s$/)
|
||||
? (h = !0)
|
||||
: i(s, "attribute-equals")
|
||||
? (F(), j())
|
||||
: i(s, "tag-close")
|
||||
? (F(), v === "/>" && (h = !0))
|
||||
: s.type === "keyword" &&
|
||||
v.match(/^(case|default)$/) &&
|
||||
B &&
|
||||
(E = 1)
|
||||
: (I(), j(), (h = !0), (p = !0));
|
||||
if (
|
||||
c &&
|
||||
(!s.type.match(/^(comment)$/) ||
|
||||
!!v.substr(0, 1).match(/^[/#]$/)) &&
|
||||
(!s.type.match(/^(string)$/) || !!v.substr(0, 1).match(/^['"@]$/))
|
||||
) {
|
||||
w = b;
|
||||
if (g > y) {
|
||||
w++;
|
||||
for (A = g; A > y; A--) P[A] = w;
|
||||
} else g < y && (w = P[g]);
|
||||
(y = g), (b = w), E && (w -= E), O && !S && (w++, (O = !1));
|
||||
for (A = 0; A < w; A++) d += o;
|
||||
}
|
||||
s.type === "keyword" && v.match(/^(case|default)$/)
|
||||
? B === !1 && ((H[g] = v), g++, (B = !0))
|
||||
: s.type === "keyword" &&
|
||||
v.match(/^(break)$/) &&
|
||||
H[g - 1] &&
|
||||
H[g - 1].match(/^(case|default)$/) &&
|
||||
(g--, (B = !1)),
|
||||
s.type === "paren.lparen" &&
|
||||
((S += (v.match(/\(/g) || []).length),
|
||||
(x += (v.match(/\{/g) || []).length),
|
||||
(g += v.length)),
|
||||
s.type === "keyword" && v.match(/^(if|else|elseif|for|while)$/)
|
||||
? ((O = !0), (S = 0))
|
||||
: !S && v.trim() && s.type !== "comment" && (O = !1);
|
||||
if (s.type === "paren.rparen") {
|
||||
(S -= (v.match(/\)/g) || []).length),
|
||||
(x -= (v.match(/\}/g) || []).length);
|
||||
for (A = 0; A < v.length; A++)
|
||||
g--, v.substr(A, 1) === "}" && H[g] === "case" && g--;
|
||||
}
|
||||
s.type == "text" && (v = v.replace(/\s+$/, " ")),
|
||||
h && !c && (F(), d.substr(-1) !== "\n" && (d += " ")),
|
||||
(d += v),
|
||||
p && (d += " "),
|
||||
(c = !1),
|
||||
(h = !1),
|
||||
(p = !1);
|
||||
if (
|
||||
(i(s, "tag-close") && (D || a.indexOf(m) !== -1)) ||
|
||||
(i(s, "doctype") && v === ">")
|
||||
)
|
||||
D && l && l.value === "</" ? (C = -1) : (C = 1);
|
||||
l &&
|
||||
u.indexOf(l.value) === -1 &&
|
||||
(i(s, "tag-open") && v === "</"
|
||||
? g--
|
||||
: i(s, "tag-open") && v === "<"
|
||||
? g++
|
||||
: i(s, "tag-close") && v === "/>" && g--),
|
||||
i(s, "tag-name") && (m = v),
|
||||
(T = N);
|
||||
}
|
||||
}
|
||||
s = l;
|
||||
}
|
||||
(d = d.trim()), e.doc.setValue(d);
|
||||
}),
|
||||
(t.commands = [
|
||||
{
|
||||
name: "beautify",
|
||||
description: "Format selection (Beautify)",
|
||||
exec: function (e) {
|
||||
t.beautify(e.session);
|
||||
},
|
||||
bindKey: "Ctrl-Shift-B",
|
||||
},
|
||||
]);
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/beautify"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
189
vuejs/client/src/assets/script/editor/ext-code_lens.js
Normal file
189
vuejs/client/src/assets/script/editor/ext-code_lens.js
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
define("ace/ext/code_lens", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/line_widgets",
|
||||
"ace/lib/event",
|
||||
"ace/lib/lang",
|
||||
"ace/lib/dom",
|
||||
"ace/editor",
|
||||
"ace/config",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
function u(e) {
|
||||
var t = e.$textLayer,
|
||||
n = t.$lenses;
|
||||
n &&
|
||||
n.forEach(function (e) {
|
||||
e.remove();
|
||||
}),
|
||||
(t.$lenses = null);
|
||||
}
|
||||
function a(e, t) {
|
||||
var n =
|
||||
e & t.CHANGE_LINES ||
|
||||
e & t.CHANGE_FULL ||
|
||||
e & t.CHANGE_SCROLL ||
|
||||
e & t.CHANGE_TEXT;
|
||||
if (!n) return;
|
||||
var r = t.session,
|
||||
i = t.session.lineWidgets,
|
||||
s = t.$textLayer,
|
||||
a = s.$lenses;
|
||||
if (!i) {
|
||||
a && u(t);
|
||||
return;
|
||||
}
|
||||
var f = t.$textLayer.$lines.cells,
|
||||
l = t.layerConfig,
|
||||
c = t.$padding;
|
||||
a || (a = s.$lenses = []);
|
||||
var h = 0;
|
||||
for (var p = 0; p < f.length; p++) {
|
||||
var d = f[p].row,
|
||||
v = i[d],
|
||||
m = v && v.lenses;
|
||||
if (!m || !m.length) continue;
|
||||
var g = a[h];
|
||||
g ||
|
||||
(g = a[h] =
|
||||
o.buildDom(["div", { class: "ace_codeLens" }], t.container)),
|
||||
(g.style.height = l.lineHeight + "px"),
|
||||
h++;
|
||||
for (var y = 0; y < m.length; y++) {
|
||||
var b = g.childNodes[2 * y];
|
||||
b ||
|
||||
(y != 0 && g.appendChild(o.createTextNode("\u00a0|\u00a0")),
|
||||
(b = o.buildDom(["a"], g))),
|
||||
(b.textContent = m[y].title),
|
||||
(b.lensCommand = m[y]);
|
||||
}
|
||||
while (g.childNodes.length > 2 * y - 1) g.lastChild.remove();
|
||||
var w =
|
||||
t.$cursorLayer.getPixelPosition({ row: d, column: 0 }, !0).top -
|
||||
l.lineHeight * v.rowsAbove -
|
||||
l.offset;
|
||||
g.style.top = w + "px";
|
||||
var E = t.gutterWidth,
|
||||
S = r.getLine(d).search(/\S|$/);
|
||||
S == -1 && (S = 0),
|
||||
(E += S * l.characterWidth),
|
||||
(g.style.paddingLeft = c + E + "px");
|
||||
}
|
||||
while (h < a.length) a.pop().remove();
|
||||
}
|
||||
function f(e) {
|
||||
if (!e.lineWidgets) return;
|
||||
var t = e.widgetManager;
|
||||
e.lineWidgets.forEach(function (e) {
|
||||
e && e.lenses && t.removeLineWidget(e);
|
||||
});
|
||||
}
|
||||
function l(e) {
|
||||
(e.codeLensProviders = []),
|
||||
e.renderer.on("afterRender", a),
|
||||
e.$codeLensClickHandler ||
|
||||
((e.$codeLensClickHandler = function (t) {
|
||||
var n = t.target.lensCommand;
|
||||
if (!n) return;
|
||||
e.execCommand(n.id, n.arguments), e._emit("codeLensClick", t);
|
||||
}),
|
||||
i.addListener(e.container, "click", e.$codeLensClickHandler, e)),
|
||||
(e.$updateLenses = function () {
|
||||
function o() {
|
||||
var r = n.selection.cursor,
|
||||
i = n.documentToScreenRow(r),
|
||||
o = n.getScrollTop(),
|
||||
u = t.setLenses(n, s),
|
||||
a = n.$undoManager && n.$undoManager.$lastDelta;
|
||||
if (a && a.action == "remove" && a.lines.length > 1) return;
|
||||
var f = n.documentToScreenRow(r),
|
||||
l = e.renderer.layerConfig.lineHeight,
|
||||
c = n.getScrollTop() + (f - i) * l;
|
||||
u == 0 && o < l / 4 && o > -l / 4 && (c = -l), n.setScrollTop(c);
|
||||
}
|
||||
var n = e.session;
|
||||
if (!n) return;
|
||||
n.widgetManager ||
|
||||
((n.widgetManager = new r(n)), n.widgetManager.attach(e));
|
||||
var i = e.codeLensProviders.length,
|
||||
s = [];
|
||||
e.codeLensProviders.forEach(function (e) {
|
||||
e.provideCodeLenses(n, function (e, t) {
|
||||
if (e) return;
|
||||
t.forEach(function (e) {
|
||||
s.push(e);
|
||||
}),
|
||||
i--,
|
||||
i == 0 && o();
|
||||
});
|
||||
});
|
||||
});
|
||||
var n = s.delayedCall(e.$updateLenses);
|
||||
(e.$updateLensesOnInput = function () {
|
||||
n.delay(250);
|
||||
}),
|
||||
e.on("input", e.$updateLensesOnInput);
|
||||
}
|
||||
function c(e) {
|
||||
e.off("input", e.$updateLensesOnInput),
|
||||
e.renderer.off("afterRender", a),
|
||||
e.$codeLensClickHandler &&
|
||||
e.container.removeEventListener("click", e.$codeLensClickHandler);
|
||||
}
|
||||
var r = e("../line_widgets").LineWidgets,
|
||||
i = e("../lib/event"),
|
||||
s = e("../lib/lang"),
|
||||
o = e("../lib/dom");
|
||||
(t.setLenses = function (e, t) {
|
||||
var n = Number.MAX_VALUE;
|
||||
return (
|
||||
f(e),
|
||||
t &&
|
||||
t.forEach(function (t) {
|
||||
var r = t.start.row,
|
||||
i = t.start.column,
|
||||
s = e.lineWidgets && e.lineWidgets[r];
|
||||
if (!s || !s.lenses)
|
||||
s = e.widgetManager.$registerLineWidget({
|
||||
rowCount: 1,
|
||||
rowsAbove: 1,
|
||||
row: r,
|
||||
column: i,
|
||||
lenses: [],
|
||||
});
|
||||
s.lenses.push(t.command), r < n && (n = r);
|
||||
}),
|
||||
e._emit("changeFold", { data: { start: { row: n } } }),
|
||||
n
|
||||
);
|
||||
}),
|
||||
(t.registerCodeLensProvider = function (e, t) {
|
||||
e.setOption("enableCodeLens", !0),
|
||||
e.codeLensProviders.push(t),
|
||||
e.$updateLensesOnInput();
|
||||
}),
|
||||
(t.clear = function (e) {
|
||||
t.setLenses(e, null);
|
||||
});
|
||||
var h = e("../editor").Editor;
|
||||
e("../config").defineOptions(h.prototype, "editor", {
|
||||
enableCodeLens: {
|
||||
set: function (e) {
|
||||
e ? l(this) : c(this);
|
||||
},
|
||||
},
|
||||
}),
|
||||
o.importCssString(
|
||||
"\n.ace_codeLens {\n position: absolute;\n color: #aaa;\n font-size: 88%;\n background: inherit;\n width: 100%;\n display: flex;\n align-items: flex-end;\n pointer-events: none;\n}\n.ace_codeLens > a {\n cursor: pointer;\n pointer-events: auto;\n}\n.ace_codeLens > a:hover {\n color: #0000ff;\n text-decoration: underline;\n}\n.ace_dark > .ace_codeLens > a:hover {\n color: #4e94ce;\n}\n",
|
||||
"codelense.css",
|
||||
!1,
|
||||
);
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/code_lens"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
define("ace/ext/elastic_tabstops_lite", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/editor",
|
||||
"ace/config",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
var r = function (e) {
|
||||
this.$editor = e;
|
||||
var t = this,
|
||||
n = [],
|
||||
r = !1;
|
||||
(this.onAfterExec = function () {
|
||||
(r = !1), t.processRows(n), (n = []);
|
||||
}),
|
||||
(this.onExec = function () {
|
||||
r = !0;
|
||||
}),
|
||||
(this.onChange = function (e) {
|
||||
r &&
|
||||
(n.indexOf(e.start.row) == -1 && n.push(e.start.row),
|
||||
e.end.row != e.start.row && n.push(e.end.row));
|
||||
});
|
||||
};
|
||||
(function () {
|
||||
(this.processRows = function (e) {
|
||||
this.$inChange = !0;
|
||||
var t = [];
|
||||
for (var n = 0, r = e.length; n < r; n++) {
|
||||
var i = e[n];
|
||||
if (t.indexOf(i) > -1) continue;
|
||||
var s = this.$findCellWidthsForBlock(i),
|
||||
o = this.$setBlockCellWidthsToMax(s.cellWidths),
|
||||
u = s.firstRow;
|
||||
for (var a = 0, f = o.length; a < f; a++) {
|
||||
var l = o[a];
|
||||
t.push(u), this.$adjustRow(u, l), u++;
|
||||
}
|
||||
}
|
||||
this.$inChange = !1;
|
||||
}),
|
||||
(this.$findCellWidthsForBlock = function (e) {
|
||||
var t = [],
|
||||
n,
|
||||
r = e;
|
||||
while (r >= 0) {
|
||||
n = this.$cellWidthsForRow(r);
|
||||
if (n.length == 0) break;
|
||||
t.unshift(n), r--;
|
||||
}
|
||||
var i = r + 1;
|
||||
r = e;
|
||||
var s = this.$editor.session.getLength();
|
||||
while (r < s - 1) {
|
||||
r++, (n = this.$cellWidthsForRow(r));
|
||||
if (n.length == 0) break;
|
||||
t.push(n);
|
||||
}
|
||||
return { cellWidths: t, firstRow: i };
|
||||
}),
|
||||
(this.$cellWidthsForRow = function (e) {
|
||||
var t = this.$selectionColumnsForRow(e),
|
||||
n = [-1].concat(this.$tabsForRow(e)),
|
||||
r = n
|
||||
.map(function (e) {
|
||||
return 0;
|
||||
})
|
||||
.slice(1),
|
||||
i = this.$editor.session.getLine(e);
|
||||
for (var s = 0, o = n.length - 1; s < o; s++) {
|
||||
var u = n[s] + 1,
|
||||
a = n[s + 1],
|
||||
f = this.$rightmostSelectionInCell(t, a),
|
||||
l = i.substring(u, a);
|
||||
r[s] = Math.max(l.replace(/\s+$/g, "").length, f - u);
|
||||
}
|
||||
return r;
|
||||
}),
|
||||
(this.$selectionColumnsForRow = function (e) {
|
||||
var t = [],
|
||||
n = this.$editor.getCursorPosition();
|
||||
return (
|
||||
this.$editor.session.getSelection().isEmpty() &&
|
||||
e == n.row &&
|
||||
t.push(n.column),
|
||||
t
|
||||
);
|
||||
}),
|
||||
(this.$setBlockCellWidthsToMax = function (e) {
|
||||
var t = !0,
|
||||
n,
|
||||
r,
|
||||
i,
|
||||
s = this.$izip_longest(e);
|
||||
for (var o = 0, u = s.length; o < u; o++) {
|
||||
var a = s[o];
|
||||
if (!a.push) {
|
||||
console.error(a);
|
||||
continue;
|
||||
}
|
||||
a.push(NaN);
|
||||
for (var f = 0, l = a.length; f < l; f++) {
|
||||
var c = a[f];
|
||||
t && ((n = f), (i = 0), (t = !1));
|
||||
if (isNaN(c)) {
|
||||
r = f;
|
||||
for (var h = n; h < r; h++) e[h][o] = i;
|
||||
t = !0;
|
||||
}
|
||||
i = Math.max(i, c);
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}),
|
||||
(this.$rightmostSelectionInCell = function (e, t) {
|
||||
var n = 0;
|
||||
if (e.length) {
|
||||
var r = [];
|
||||
for (var i = 0, s = e.length; i < s; i++)
|
||||
e[i] <= t ? r.push(i) : r.push(0);
|
||||
n = Math.max.apply(Math, r);
|
||||
}
|
||||
return n;
|
||||
}),
|
||||
(this.$tabsForRow = function (e) {
|
||||
var t = [],
|
||||
n = this.$editor.session.getLine(e),
|
||||
r = /\t/g,
|
||||
i;
|
||||
while ((i = r.exec(n)) != null) t.push(i.index);
|
||||
return t;
|
||||
}),
|
||||
(this.$adjustRow = function (e, t) {
|
||||
var n = this.$tabsForRow(e);
|
||||
if (n.length == 0) return;
|
||||
var r = 0,
|
||||
i = -1,
|
||||
s = this.$izip(t, n);
|
||||
for (var o = 0, u = s.length; o < u; o++) {
|
||||
var a = s[o][0],
|
||||
f = s[o][1];
|
||||
(i += 1 + a), (f += r);
|
||||
var l = i - f;
|
||||
if (l == 0) continue;
|
||||
var c = this.$editor.session.getLine(e).substr(0, f),
|
||||
h = c.replace(/\s*$/g, ""),
|
||||
p = c.length - h.length;
|
||||
l > 0 &&
|
||||
(this.$editor.session
|
||||
.getDocument()
|
||||
.insertInLine(
|
||||
{ row: e, column: f + 1 },
|
||||
Array(l + 1).join(" ") + " ",
|
||||
),
|
||||
this.$editor.session.getDocument().removeInLine(e, f, f + 1),
|
||||
(r += l)),
|
||||
l < 0 &&
|
||||
p >= -l &&
|
||||
(this.$editor.session.getDocument().removeInLine(e, f + l, f),
|
||||
(r += l));
|
||||
}
|
||||
}),
|
||||
(this.$izip_longest = function (e) {
|
||||
if (!e[0]) return [];
|
||||
var t = e[0].length,
|
||||
n = e.length;
|
||||
for (var r = 1; r < n; r++) {
|
||||
var i = e[r].length;
|
||||
i > t && (t = i);
|
||||
}
|
||||
var s = [];
|
||||
for (var o = 0; o < t; o++) {
|
||||
var u = [];
|
||||
for (var r = 0; r < n; r++)
|
||||
e[r][o] === "" ? u.push(NaN) : u.push(e[r][o]);
|
||||
s.push(u);
|
||||
}
|
||||
return s;
|
||||
}),
|
||||
(this.$izip = function (e, t) {
|
||||
var n = e.length >= t.length ? t.length : e.length,
|
||||
r = [];
|
||||
for (var i = 0; i < n; i++) {
|
||||
var s = [e[i], t[i]];
|
||||
r.push(s);
|
||||
}
|
||||
return r;
|
||||
});
|
||||
}).call(r.prototype),
|
||||
(t.ElasticTabstopsLite = r);
|
||||
var i = e("../editor").Editor;
|
||||
e("../config").defineOptions(i.prototype, "editor", {
|
||||
useElasticTabstops: {
|
||||
set: function (e) {
|
||||
e
|
||||
? (this.elasticTabstops || (this.elasticTabstops = new r(this)),
|
||||
this.commands.on("afterExec", this.elasticTabstops.onAfterExec),
|
||||
this.commands.on("exec", this.elasticTabstops.onExec),
|
||||
this.on("change", this.elasticTabstops.onChange))
|
||||
: this.elasticTabstops &&
|
||||
(this.commands.removeListener(
|
||||
"afterExec",
|
||||
this.elasticTabstops.onAfterExec,
|
||||
),
|
||||
this.commands.removeListener("exec", this.elasticTabstops.onExec),
|
||||
this.removeListener("change", this.elasticTabstops.onChange));
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/elastic_tabstops_lite"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
1222
vuejs/client/src/assets/script/editor/ext-emmet.js
Normal file
1222
vuejs/client/src/assets/script/editor/ext-emmet.js
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,7 @@
|
|||
(function () {
|
||||
window.require(["ace/ext/error_marker"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
88
vuejs/client/src/assets/script/editor/ext-hardwrap.js
Normal file
88
vuejs/client/src/assets/script/editor/ext-hardwrap.js
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
define("ace/ext/hardwrap", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/range",
|
||||
"ace/editor",
|
||||
"ace/config",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
function i(e, t) {
|
||||
function m(e, t, n) {
|
||||
if (e.length < t) return;
|
||||
var r = e.slice(0, t),
|
||||
i = e.slice(t),
|
||||
s = /^(?:(\s+)|(\S+)(\s+))/.exec(i),
|
||||
o = /(?:(\s+)|(\s+)(\S+))$/.exec(r),
|
||||
u = 0,
|
||||
a = 0;
|
||||
o && !o[2] && ((u = t - o[1].length), (a = t)),
|
||||
s && !s[2] && (u || (u = t), (a = t + s[1].length));
|
||||
if (u) return { start: u, end: a };
|
||||
if (o && o[2] && o.index > n)
|
||||
return { start: o.index, end: o.index + o[2].length };
|
||||
if (s && s[2])
|
||||
return (u = t + s[2].length), { start: u, end: u + s[3].length };
|
||||
}
|
||||
var n = t.column || e.getOption("printMarginColumn"),
|
||||
i = t.allowMerge != 0,
|
||||
s = Math.min(t.startRow, t.endRow),
|
||||
o = Math.max(t.startRow, t.endRow),
|
||||
u = e.session;
|
||||
while (s <= o) {
|
||||
var a = u.getLine(s);
|
||||
if (a.length > n) {
|
||||
var f = m(a, n, 5);
|
||||
if (f) {
|
||||
var l = /^\s*/.exec(a)[0];
|
||||
u.replace(new r(s, f.start, s, f.end), "\n" + l);
|
||||
}
|
||||
o++;
|
||||
} else if (i && /\S/.test(a) && s != o) {
|
||||
var c = u.getLine(s + 1);
|
||||
if (c && /\S/.test(c)) {
|
||||
var h = a.replace(/\s+$/, ""),
|
||||
p = c.replace(/^\s+/, ""),
|
||||
d = h + " " + p,
|
||||
f = m(d, n, 5);
|
||||
if ((f && f.start > h.length) || d.length < n) {
|
||||
var v = new r(s, h.length, s + 1, c.length - p.length);
|
||||
u.replace(v, " "), s--, o--;
|
||||
} else
|
||||
h.length < a.length && u.remove(new r(s, h.length, s, a.length));
|
||||
}
|
||||
}
|
||||
s++;
|
||||
}
|
||||
}
|
||||
function s(e) {
|
||||
if (e.command.name == "insertstring" && /\S/.test(e.args)) {
|
||||
var t = e.editor,
|
||||
n = t.selection.cursor;
|
||||
if (n.column <= t.renderer.$printMarginColumn) return;
|
||||
var r = t.session.$undoManager.$lastDelta;
|
||||
i(t, { startRow: n.row, endRow: n.row, allowMerge: !1 }),
|
||||
r != t.session.$undoManager.$lastDelta && t.session.markUndoGroup();
|
||||
}
|
||||
}
|
||||
var r = e("../range").Range,
|
||||
o = e("../editor").Editor;
|
||||
e("../config").defineOptions(o.prototype, "editor", {
|
||||
hardWrap: {
|
||||
set: function (e) {
|
||||
e
|
||||
? this.commands.on("afterExec", s)
|
||||
: this.commands.off("afterExec", s);
|
||||
},
|
||||
value: !1,
|
||||
},
|
||||
}),
|
||||
(t.hardWrap = i);
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/hardwrap"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
153
vuejs/client/src/assets/script/editor/ext-keybinding_menu.js
Normal file
153
vuejs/client/src/assets/script/editor/ext-keybinding_menu.js
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
define(
|
||||
"ace/ext/menu_tools/settings_menu.css",
|
||||
["require", "exports", "module"],
|
||||
function (e, t, n) {
|
||||
n.exports =
|
||||
"#ace_settingsmenu, #kbshortcutmenu {\n background-color: #F7F7F7;\n color: black;\n box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\n padding: 1em 0.5em 2em 1em;\n overflow: auto;\n position: absolute;\n margin: 0;\n bottom: 0;\n right: 0;\n top: 0;\n z-index: 9991;\n cursor: default;\n}\n\n.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\n box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\n background-color: rgba(255, 255, 255, 0.6);\n color: black;\n}\n\n.ace_optionsMenuEntry:hover {\n background-color: rgba(100, 100, 100, 0.1);\n transition: all 0.3s\n}\n\n.ace_closeButton {\n background: rgba(245, 146, 146, 0.5);\n border: 1px solid #F48A8A;\n border-radius: 50%;\n padding: 7px;\n position: absolute;\n right: -8px;\n top: -8px;\n z-index: 100000;\n}\n.ace_closeButton{\n background: rgba(245, 146, 146, 0.9);\n}\n.ace_optionsMenuKey {\n color: darkslateblue;\n font-weight: bold;\n}\n.ace_optionsMenuCommand {\n color: darkcyan;\n font-weight: normal;\n}\n.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\n vertical-align: middle;\n}\n\n.ace_optionsMenuEntry button[ace_selected_button=true] {\n background: #e7e7e7;\n box-shadow: 1px 0px 2px 0px #adadad inset;\n border-color: #adadad;\n}\n.ace_optionsMenuEntry button {\n background: white;\n border: 1px solid lightgray;\n margin: 0px;\n}\n.ace_optionsMenuEntry button:hover{\n background: #f0f0f0;\n}";
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/menu_tools/overlay_page",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/lib/dom",
|
||||
"ace/ext/menu_tools/settings_menu.css",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("../../lib/dom"),
|
||||
i = e("./settings_menu.css");
|
||||
r.importCssString(i, "settings_menu.css", !1),
|
||||
(n.exports.overlayPage = function (t, n, r) {
|
||||
function o(e) {
|
||||
e.keyCode === 27 && u();
|
||||
}
|
||||
function u() {
|
||||
if (!i) return;
|
||||
document.removeEventListener("keydown", o),
|
||||
i.parentNode.removeChild(i),
|
||||
t && t.focus(),
|
||||
(i = null),
|
||||
r && r();
|
||||
}
|
||||
function a(e) {
|
||||
(s = e),
|
||||
e &&
|
||||
((i.style.pointerEvents = "none"),
|
||||
(n.style.pointerEvents = "auto"));
|
||||
}
|
||||
var i = document.createElement("div"),
|
||||
s = !1;
|
||||
return (
|
||||
(i.style.cssText =
|
||||
"margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; " +
|
||||
(t ? "background-color: rgba(0, 0, 0, 0.3);" : "")),
|
||||
i.addEventListener("click", function (e) {
|
||||
s || u();
|
||||
}),
|
||||
document.addEventListener("keydown", o),
|
||||
n.addEventListener("click", function (e) {
|
||||
e.stopPropagation();
|
||||
}),
|
||||
i.appendChild(n),
|
||||
document.body.appendChild(i),
|
||||
t && t.blur(),
|
||||
{ close: u, setIgnoreFocusOut: a }
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/menu_tools/get_editor_keyboard_shortcuts",
|
||||
["require", "exports", "module", "ace/lib/keys"],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("../../lib/keys");
|
||||
n.exports.getEditorKeybordShortcuts = function (e) {
|
||||
var t = r.KEY_MODS,
|
||||
n = [],
|
||||
i = {};
|
||||
return (
|
||||
e.keyBinding.$handlers.forEach(function (e) {
|
||||
var t = e.commandKeyBinding;
|
||||
for (var r in t) {
|
||||
var s = r.replace(/(^|-)\w/g, function (e) {
|
||||
return e.toUpperCase();
|
||||
}),
|
||||
o = t[r];
|
||||
Array.isArray(o) || (o = [o]),
|
||||
o.forEach(function (e) {
|
||||
typeof e != "string" && (e = e.name),
|
||||
i[e]
|
||||
? (i[e].key += "|" + s)
|
||||
: ((i[e] = { key: s, command: e }), n.push(i[e]));
|
||||
});
|
||||
}
|
||||
}),
|
||||
n
|
||||
);
|
||||
};
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/keybinding_menu",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/editor",
|
||||
"ace/ext/menu_tools/overlay_page",
|
||||
"ace/ext/menu_tools/get_editor_keyboard_shortcuts",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
function i(t) {
|
||||
if (!document.getElementById("kbshortcutmenu")) {
|
||||
var n = e("./menu_tools/overlay_page").overlayPage,
|
||||
r = e(
|
||||
"./menu_tools/get_editor_keyboard_shortcuts",
|
||||
).getEditorKeybordShortcuts,
|
||||
i = r(t),
|
||||
s = document.createElement("div"),
|
||||
o = i.reduce(function (e, t) {
|
||||
return (
|
||||
e +
|
||||
'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">' +
|
||||
t.command +
|
||||
"</span> : " +
|
||||
'<span class="ace_optionsMenuKey">' +
|
||||
t.key +
|
||||
"</span></div>"
|
||||
);
|
||||
}, "");
|
||||
(s.id = "kbshortcutmenu"),
|
||||
(s.innerHTML = "<h1>Keyboard Shortcuts</h1>" + o + "</div>"),
|
||||
n(t, s);
|
||||
}
|
||||
}
|
||||
var r = e("../editor").Editor;
|
||||
n.exports.init = function (e) {
|
||||
(r.prototype.showKeyboardShortcuts = function () {
|
||||
i(this);
|
||||
}),
|
||||
e.commands.addCommands([
|
||||
{
|
||||
name: "showKeyboardShortcuts",
|
||||
bindKey: { win: "Ctrl-Alt-h", mac: "Command-Alt-h" },
|
||||
exec: function (e, t) {
|
||||
e.showKeyboardShortcuts();
|
||||
},
|
||||
},
|
||||
]);
|
||||
};
|
||||
},
|
||||
);
|
||||
(function () {
|
||||
window.require(["ace/ext/keybinding_menu"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
1939
vuejs/client/src/assets/script/editor/ext-language_tools.js
Normal file
1939
vuejs/client/src/assets/script/editor/ext-language_tools.js
Normal file
File diff suppressed because it is too large
Load diff
55
vuejs/client/src/assets/script/editor/ext-linking.js
Normal file
55
vuejs/client/src/assets/script/editor/ext-linking.js
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
define("ace/ext/linking", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/editor",
|
||||
"ace/config",
|
||||
], function (e, t, n) {
|
||||
function i(e) {
|
||||
var n = e.editor,
|
||||
r = e.getAccelKey();
|
||||
if (r) {
|
||||
var n = e.editor,
|
||||
i = e.getDocumentPosition(),
|
||||
s = n.session,
|
||||
o = s.getTokenAt(i.row, i.column);
|
||||
t.previousLinkingHover &&
|
||||
t.previousLinkingHover != o &&
|
||||
n._emit("linkHoverOut"),
|
||||
n._emit("linkHover", { position: i, token: o }),
|
||||
(t.previousLinkingHover = o);
|
||||
} else
|
||||
t.previousLinkingHover &&
|
||||
(n._emit("linkHoverOut"), (t.previousLinkingHover = !1));
|
||||
}
|
||||
function s(e) {
|
||||
var t = e.getAccelKey(),
|
||||
n = e.getButton();
|
||||
if (n == 0 && t) {
|
||||
var r = e.editor,
|
||||
i = e.getDocumentPosition(),
|
||||
s = r.session,
|
||||
o = s.getTokenAt(i.row, i.column);
|
||||
r._emit("linkClick", { position: i, token: o });
|
||||
}
|
||||
}
|
||||
var r = e("../editor").Editor;
|
||||
e("../config").defineOptions(r.prototype, "editor", {
|
||||
enableLinking: {
|
||||
set: function (e) {
|
||||
e
|
||||
? (this.on("click", s), this.on("mousemove", i))
|
||||
: (this.off("click", s), this.off("mousemove", i));
|
||||
},
|
||||
value: !1,
|
||||
},
|
||||
}),
|
||||
(t.previousLinkingHover = !1);
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/linking"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
248
vuejs/client/src/assets/script/editor/ext-modelist.js
Normal file
248
vuejs/client/src/assets/script/editor/ext-modelist.js
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
define("ace/ext/modelist", ["require", "exports", "module"], function (
|
||||
e,
|
||||
t,
|
||||
n,
|
||||
) {
|
||||
"use strict";
|
||||
function i(e) {
|
||||
var t = a.text,
|
||||
n = e.split(/[\/\\]/).pop();
|
||||
for (var i = 0; i < r.length; i++)
|
||||
if (r[i].supportsFile(n)) {
|
||||
t = r[i];
|
||||
break;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
var r = [],
|
||||
s = function (e, t, n) {
|
||||
(this.name = e),
|
||||
(this.caption = t),
|
||||
(this.mode = "ace/mode/" + e),
|
||||
(this.extensions = n);
|
||||
var r;
|
||||
/\^/.test(n)
|
||||
? (r =
|
||||
n.replace(/\|(\^)?/g, function (e, t) {
|
||||
return "$|" + (t ? "^" : "^.*\\.");
|
||||
}) + "$")
|
||||
: (r = "^.*\\.(" + n + ")$"),
|
||||
(this.extRe = new RegExp(r, "gi"));
|
||||
};
|
||||
s.prototype.supportsFile = function (e) {
|
||||
return e.match(this.extRe);
|
||||
};
|
||||
var o = {
|
||||
ABAP: ["abap"],
|
||||
ABC: ["abc"],
|
||||
ActionScript: ["as"],
|
||||
ADA: ["ada|adb"],
|
||||
Alda: ["alda"],
|
||||
Apache_Conf: [
|
||||
"^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd",
|
||||
],
|
||||
Apex: ["apex|cls|trigger|tgr"],
|
||||
AQL: ["aql"],
|
||||
AsciiDoc: ["asciidoc|adoc"],
|
||||
ASL: ["dsl|asl|asl.json"],
|
||||
Assembly_x86: ["asm|a"],
|
||||
AutoHotKey: ["ahk"],
|
||||
BatchFile: ["bat|cmd"],
|
||||
BibTeX: ["bib"],
|
||||
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
|
||||
C9Search: ["c9search_results"],
|
||||
Cirru: ["cirru|cr"],
|
||||
Clojure: ["clj|cljs"],
|
||||
Cobol: ["CBL|COB"],
|
||||
coffee: ["coffee|cf|cson|^Cakefile"],
|
||||
ColdFusion: ["cfm"],
|
||||
Crystal: ["cr"],
|
||||
CSharp: ["cs"],
|
||||
Csound_Document: ["csd"],
|
||||
Csound_Orchestra: ["orc"],
|
||||
Csound_Score: ["sco"],
|
||||
CSS: ["css"],
|
||||
Curly: ["curly"],
|
||||
D: ["d|di"],
|
||||
Dart: ["dart"],
|
||||
Diff: ["diff|patch"],
|
||||
Dockerfile: ["^Dockerfile"],
|
||||
Dot: ["dot"],
|
||||
Drools: ["drl"],
|
||||
Edifact: ["edi"],
|
||||
Eiffel: ["e|ge"],
|
||||
EJS: ["ejs"],
|
||||
Elixir: ["ex|exs"],
|
||||
Elm: ["elm"],
|
||||
Erlang: ["erl|hrl"],
|
||||
Forth: ["frt|fs|ldr|fth|4th"],
|
||||
Fortran: ["f|f90"],
|
||||
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
|
||||
FSL: ["fsl"],
|
||||
FTL: ["ftl"],
|
||||
Gcode: ["gcode"],
|
||||
Gherkin: ["feature"],
|
||||
Gitignore: ["^.gitignore"],
|
||||
Glsl: ["glsl|frag|vert"],
|
||||
Gobstones: ["gbs"],
|
||||
golang: ["go"],
|
||||
GraphQLSchema: ["gql"],
|
||||
Groovy: ["groovy"],
|
||||
HAML: ["haml"],
|
||||
Handlebars: ["hbs|handlebars|tpl|mustache"],
|
||||
Haskell: ["hs"],
|
||||
Haskell_Cabal: ["cabal"],
|
||||
haXe: ["hx"],
|
||||
Hjson: ["hjson"],
|
||||
HTML: ["html|htm|xhtml|vue|we|wpy"],
|
||||
HTML_Elixir: ["eex|html.eex"],
|
||||
HTML_Ruby: ["erb|rhtml|html.erb"],
|
||||
INI: ["ini|conf|cfg|prefs"],
|
||||
Io: ["io"],
|
||||
Ion: ["ion"],
|
||||
Jack: ["jack"],
|
||||
Jade: ["jade|pug"],
|
||||
Java: ["java"],
|
||||
JavaScript: ["js|jsm|jsx|cjs|mjs"],
|
||||
JSON: ["json"],
|
||||
JSON5: ["json5"],
|
||||
JSONiq: ["jq"],
|
||||
JSP: ["jsp"],
|
||||
JSSM: ["jssm|jssm_state"],
|
||||
JSX: ["jsx"],
|
||||
Julia: ["jl"],
|
||||
Kotlin: ["kt|kts"],
|
||||
LaTeX: ["tex|latex|ltx|bib"],
|
||||
Latte: ["latte"],
|
||||
LESS: ["less"],
|
||||
Liquid: ["liquid"],
|
||||
Lisp: ["lisp"],
|
||||
LiveScript: ["ls"],
|
||||
Log: ["log"],
|
||||
LogiQL: ["logic|lql"],
|
||||
Logtalk: ["lgt"],
|
||||
LSL: ["lsl"],
|
||||
Lua: ["lua"],
|
||||
LuaPage: ["lp"],
|
||||
Lucene: ["lucene"],
|
||||
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
|
||||
Markdown: ["md|markdown"],
|
||||
Mask: ["mask"],
|
||||
MATLAB: ["matlab"],
|
||||
Maze: ["mz"],
|
||||
MediaWiki: ["wiki|mediawiki"],
|
||||
MEL: ["mel"],
|
||||
MIPS: ["s|asm"],
|
||||
MIXAL: ["mixal"],
|
||||
MUSHCode: ["mc|mush"],
|
||||
MySQL: ["mysql"],
|
||||
Nginx: ["nginx|conf"],
|
||||
Nim: ["nim"],
|
||||
Nix: ["nix"],
|
||||
NSIS: ["nsi|nsh"],
|
||||
Nunjucks: ["nunjucks|nunjs|nj|njk"],
|
||||
ObjectiveC: ["m|mm"],
|
||||
OCaml: ["ml|mli"],
|
||||
PartiQL: ["partiql|pql"],
|
||||
Pascal: ["pas|p"],
|
||||
Perl: ["pl|pm"],
|
||||
pgSQL: ["pgsql"],
|
||||
PHP_Laravel_blade: ["blade.php"],
|
||||
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
||||
Pig: ["pig"],
|
||||
Powershell: ["ps1"],
|
||||
Praat: ["praat|praatscript|psc|proc"],
|
||||
Prisma: ["prisma"],
|
||||
Prolog: ["plg|prolog"],
|
||||
Properties: ["properties"],
|
||||
Protobuf: ["proto"],
|
||||
Puppet: ["epp|pp"],
|
||||
Python: ["py"],
|
||||
QML: ["qml"],
|
||||
R: ["r"],
|
||||
Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"],
|
||||
Razor: ["cshtml|asp"],
|
||||
RDoc: ["Rd"],
|
||||
Red: ["red|reds"],
|
||||
RHTML: ["Rhtml"],
|
||||
Robot: ["robot|resource"],
|
||||
RST: ["rst"],
|
||||
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
|
||||
Rust: ["rs"],
|
||||
SaC: ["sac"],
|
||||
SASS: ["sass"],
|
||||
SCAD: ["scad"],
|
||||
Scala: ["scala|sbt"],
|
||||
Scheme: ["scm|sm|rkt|oak|scheme"],
|
||||
Scrypt: ["scrypt"],
|
||||
SCSS: ["scss"],
|
||||
SH: ["sh|bash|^.bashrc"],
|
||||
SJS: ["sjs"],
|
||||
Slim: ["slim|skim"],
|
||||
Smarty: ["smarty|tpl"],
|
||||
Smithy: ["smithy"],
|
||||
snippets: ["snippets"],
|
||||
Soy_Template: ["soy"],
|
||||
Space: ["space"],
|
||||
SPARQL: ["rq"],
|
||||
SQL: ["sql"],
|
||||
SQLServer: ["sqlserver"],
|
||||
Stylus: ["styl|stylus"],
|
||||
SVG: ["svg"],
|
||||
Swift: ["swift"],
|
||||
Tcl: ["tcl"],
|
||||
Terraform: ["tf", "tfvars", "terragrunt"],
|
||||
Tex: ["tex"],
|
||||
Text: ["txt"],
|
||||
Textile: ["textile"],
|
||||
Toml: ["toml"],
|
||||
TSX: ["tsx"],
|
||||
Turtle: ["ttl"],
|
||||
Twig: ["twig|swig"],
|
||||
Typescript: ["ts|typescript|str"],
|
||||
Vala: ["vala"],
|
||||
VBScript: ["vbs|vb"],
|
||||
Velocity: ["vm"],
|
||||
Verilog: ["v|vh|sv|svh"],
|
||||
VHDL: ["vhd|vhdl"],
|
||||
Visualforce: ["vfp|component|page"],
|
||||
Wollok: ["wlk|wpgm|wtest"],
|
||||
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
|
||||
XQuery: ["xq"],
|
||||
YAML: ["yaml|yml"],
|
||||
Zeek: ["zeek|bro"],
|
||||
Django: ["html"],
|
||||
},
|
||||
u = {
|
||||
ObjectiveC: "Objective-C",
|
||||
CSharp: "C#",
|
||||
golang: "Go",
|
||||
C_Cpp: "C and C++",
|
||||
Csound_Document: "Csound Document",
|
||||
Csound_Orchestra: "Csound",
|
||||
Csound_Score: "Csound Score",
|
||||
coffee: "CoffeeScript",
|
||||
HTML_Ruby: "HTML (Ruby)",
|
||||
HTML_Elixir: "HTML (Elixir)",
|
||||
FTL: "FreeMarker",
|
||||
PHP_Laravel_blade: "PHP (Blade Template)",
|
||||
Perl6: "Perl 6",
|
||||
AutoHotKey: "AutoHotkey / AutoIt",
|
||||
},
|
||||
a = {};
|
||||
for (var f in o) {
|
||||
var l = o[f],
|
||||
c = (u[f] || f).replace(/_/g, " "),
|
||||
h = f.toLowerCase(),
|
||||
p = new s(h, c, l[0]);
|
||||
(a[h] = p), r.push(p);
|
||||
}
|
||||
n.exports = { getModeForPath: i, modes: r, modesByName: a };
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/modelist"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
727
vuejs/client/src/assets/script/editor/ext-options.js
Normal file
727
vuejs/client/src/assets/script/editor/ext-options.js
Normal file
|
|
@ -0,0 +1,727 @@
|
|||
define(
|
||||
"ace/ext/menu_tools/settings_menu.css",
|
||||
["require", "exports", "module"],
|
||||
function (e, t, n) {
|
||||
n.exports =
|
||||
"#ace_settingsmenu, #kbshortcutmenu {\n background-color: #F7F7F7;\n color: black;\n box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\n padding: 1em 0.5em 2em 1em;\n overflow: auto;\n position: absolute;\n margin: 0;\n bottom: 0;\n right: 0;\n top: 0;\n z-index: 9991;\n cursor: default;\n}\n\n.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\n box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\n background-color: rgba(255, 255, 255, 0.6);\n color: black;\n}\n\n.ace_optionsMenuEntry:hover {\n background-color: rgba(100, 100, 100, 0.1);\n transition: all 0.3s\n}\n\n.ace_closeButton {\n background: rgba(245, 146, 146, 0.5);\n border: 1px solid #F48A8A;\n border-radius: 50%;\n padding: 7px;\n position: absolute;\n right: -8px;\n top: -8px;\n z-index: 100000;\n}\n.ace_closeButton{\n background: rgba(245, 146, 146, 0.9);\n}\n.ace_optionsMenuKey {\n color: darkslateblue;\n font-weight: bold;\n}\n.ace_optionsMenuCommand {\n color: darkcyan;\n font-weight: normal;\n}\n.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\n vertical-align: middle;\n}\n\n.ace_optionsMenuEntry button[ace_selected_button=true] {\n background: #e7e7e7;\n box-shadow: 1px 0px 2px 0px #adadad inset;\n border-color: #adadad;\n}\n.ace_optionsMenuEntry button {\n background: white;\n border: 1px solid lightgray;\n margin: 0px;\n}\n.ace_optionsMenuEntry button:hover{\n background: #f0f0f0;\n}";
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/menu_tools/overlay_page",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/lib/dom",
|
||||
"ace/ext/menu_tools/settings_menu.css",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("../../lib/dom"),
|
||||
i = e("./settings_menu.css");
|
||||
r.importCssString(i, "settings_menu.css", !1),
|
||||
(n.exports.overlayPage = function (t, n, r) {
|
||||
function o(e) {
|
||||
e.keyCode === 27 && u();
|
||||
}
|
||||
function u() {
|
||||
if (!i) return;
|
||||
document.removeEventListener("keydown", o),
|
||||
i.parentNode.removeChild(i),
|
||||
t && t.focus(),
|
||||
(i = null),
|
||||
r && r();
|
||||
}
|
||||
function a(e) {
|
||||
(s = e),
|
||||
e &&
|
||||
((i.style.pointerEvents = "none"),
|
||||
(n.style.pointerEvents = "auto"));
|
||||
}
|
||||
var i = document.createElement("div"),
|
||||
s = !1;
|
||||
return (
|
||||
(i.style.cssText =
|
||||
"margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; " +
|
||||
(t ? "background-color: rgba(0, 0, 0, 0.3);" : "")),
|
||||
i.addEventListener("click", function (e) {
|
||||
s || u();
|
||||
}),
|
||||
document.addEventListener("keydown", o),
|
||||
n.addEventListener("click", function (e) {
|
||||
e.stopPropagation();
|
||||
}),
|
||||
i.appendChild(n),
|
||||
document.body.appendChild(i),
|
||||
t && t.blur(),
|
||||
{ close: u, setIgnoreFocusOut: a }
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/modelist",
|
||||
["require", "exports", "module"],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
function i(e) {
|
||||
var t = a.text,
|
||||
n = e.split(/[\/\\]/).pop();
|
||||
for (var i = 0; i < r.length; i++)
|
||||
if (r[i].supportsFile(n)) {
|
||||
t = r[i];
|
||||
break;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
var r = [],
|
||||
s = function (e, t, n) {
|
||||
(this.name = e),
|
||||
(this.caption = t),
|
||||
(this.mode = "ace/mode/" + e),
|
||||
(this.extensions = n);
|
||||
var r;
|
||||
/\^/.test(n)
|
||||
? (r =
|
||||
n.replace(/\|(\^)?/g, function (e, t) {
|
||||
return "$|" + (t ? "^" : "^.*\\.");
|
||||
}) + "$")
|
||||
: (r = "^.*\\.(" + n + ")$"),
|
||||
(this.extRe = new RegExp(r, "gi"));
|
||||
};
|
||||
s.prototype.supportsFile = function (e) {
|
||||
return e.match(this.extRe);
|
||||
};
|
||||
var o = {
|
||||
ABAP: ["abap"],
|
||||
ABC: ["abc"],
|
||||
ActionScript: ["as"],
|
||||
ADA: ["ada|adb"],
|
||||
Alda: ["alda"],
|
||||
Apache_Conf: [
|
||||
"^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd",
|
||||
],
|
||||
Apex: ["apex|cls|trigger|tgr"],
|
||||
AQL: ["aql"],
|
||||
AsciiDoc: ["asciidoc|adoc"],
|
||||
ASL: ["dsl|asl|asl.json"],
|
||||
Assembly_x86: ["asm|a"],
|
||||
AutoHotKey: ["ahk"],
|
||||
BatchFile: ["bat|cmd"],
|
||||
BibTeX: ["bib"],
|
||||
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
|
||||
C9Search: ["c9search_results"],
|
||||
Cirru: ["cirru|cr"],
|
||||
Clojure: ["clj|cljs"],
|
||||
Cobol: ["CBL|COB"],
|
||||
coffee: ["coffee|cf|cson|^Cakefile"],
|
||||
ColdFusion: ["cfm"],
|
||||
Crystal: ["cr"],
|
||||
CSharp: ["cs"],
|
||||
Csound_Document: ["csd"],
|
||||
Csound_Orchestra: ["orc"],
|
||||
Csound_Score: ["sco"],
|
||||
CSS: ["css"],
|
||||
Curly: ["curly"],
|
||||
D: ["d|di"],
|
||||
Dart: ["dart"],
|
||||
Diff: ["diff|patch"],
|
||||
Dockerfile: ["^Dockerfile"],
|
||||
Dot: ["dot"],
|
||||
Drools: ["drl"],
|
||||
Edifact: ["edi"],
|
||||
Eiffel: ["e|ge"],
|
||||
EJS: ["ejs"],
|
||||
Elixir: ["ex|exs"],
|
||||
Elm: ["elm"],
|
||||
Erlang: ["erl|hrl"],
|
||||
Forth: ["frt|fs|ldr|fth|4th"],
|
||||
Fortran: ["f|f90"],
|
||||
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
|
||||
FSL: ["fsl"],
|
||||
FTL: ["ftl"],
|
||||
Gcode: ["gcode"],
|
||||
Gherkin: ["feature"],
|
||||
Gitignore: ["^.gitignore"],
|
||||
Glsl: ["glsl|frag|vert"],
|
||||
Gobstones: ["gbs"],
|
||||
golang: ["go"],
|
||||
GraphQLSchema: ["gql"],
|
||||
Groovy: ["groovy"],
|
||||
HAML: ["haml"],
|
||||
Handlebars: ["hbs|handlebars|tpl|mustache"],
|
||||
Haskell: ["hs"],
|
||||
Haskell_Cabal: ["cabal"],
|
||||
haXe: ["hx"],
|
||||
Hjson: ["hjson"],
|
||||
HTML: ["html|htm|xhtml|vue|we|wpy"],
|
||||
HTML_Elixir: ["eex|html.eex"],
|
||||
HTML_Ruby: ["erb|rhtml|html.erb"],
|
||||
INI: ["ini|conf|cfg|prefs"],
|
||||
Io: ["io"],
|
||||
Ion: ["ion"],
|
||||
Jack: ["jack"],
|
||||
Jade: ["jade|pug"],
|
||||
Java: ["java"],
|
||||
JavaScript: ["js|jsm|jsx|cjs|mjs"],
|
||||
JSON: ["json"],
|
||||
JSON5: ["json5"],
|
||||
JSONiq: ["jq"],
|
||||
JSP: ["jsp"],
|
||||
JSSM: ["jssm|jssm_state"],
|
||||
JSX: ["jsx"],
|
||||
Julia: ["jl"],
|
||||
Kotlin: ["kt|kts"],
|
||||
LaTeX: ["tex|latex|ltx|bib"],
|
||||
Latte: ["latte"],
|
||||
LESS: ["less"],
|
||||
Liquid: ["liquid"],
|
||||
Lisp: ["lisp"],
|
||||
LiveScript: ["ls"],
|
||||
Log: ["log"],
|
||||
LogiQL: ["logic|lql"],
|
||||
Logtalk: ["lgt"],
|
||||
LSL: ["lsl"],
|
||||
Lua: ["lua"],
|
||||
LuaPage: ["lp"],
|
||||
Lucene: ["lucene"],
|
||||
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
|
||||
Markdown: ["md|markdown"],
|
||||
Mask: ["mask"],
|
||||
MATLAB: ["matlab"],
|
||||
Maze: ["mz"],
|
||||
MediaWiki: ["wiki|mediawiki"],
|
||||
MEL: ["mel"],
|
||||
MIPS: ["s|asm"],
|
||||
MIXAL: ["mixal"],
|
||||
MUSHCode: ["mc|mush"],
|
||||
MySQL: ["mysql"],
|
||||
Nginx: ["nginx|conf"],
|
||||
Nim: ["nim"],
|
||||
Nix: ["nix"],
|
||||
NSIS: ["nsi|nsh"],
|
||||
Nunjucks: ["nunjucks|nunjs|nj|njk"],
|
||||
ObjectiveC: ["m|mm"],
|
||||
OCaml: ["ml|mli"],
|
||||
PartiQL: ["partiql|pql"],
|
||||
Pascal: ["pas|p"],
|
||||
Perl: ["pl|pm"],
|
||||
pgSQL: ["pgsql"],
|
||||
PHP_Laravel_blade: ["blade.php"],
|
||||
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
||||
Pig: ["pig"],
|
||||
Powershell: ["ps1"],
|
||||
Praat: ["praat|praatscript|psc|proc"],
|
||||
Prisma: ["prisma"],
|
||||
Prolog: ["plg|prolog"],
|
||||
Properties: ["properties"],
|
||||
Protobuf: ["proto"],
|
||||
Puppet: ["epp|pp"],
|
||||
Python: ["py"],
|
||||
QML: ["qml"],
|
||||
R: ["r"],
|
||||
Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"],
|
||||
Razor: ["cshtml|asp"],
|
||||
RDoc: ["Rd"],
|
||||
Red: ["red|reds"],
|
||||
RHTML: ["Rhtml"],
|
||||
Robot: ["robot|resource"],
|
||||
RST: ["rst"],
|
||||
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
|
||||
Rust: ["rs"],
|
||||
SaC: ["sac"],
|
||||
SASS: ["sass"],
|
||||
SCAD: ["scad"],
|
||||
Scala: ["scala|sbt"],
|
||||
Scheme: ["scm|sm|rkt|oak|scheme"],
|
||||
Scrypt: ["scrypt"],
|
||||
SCSS: ["scss"],
|
||||
SH: ["sh|bash|^.bashrc"],
|
||||
SJS: ["sjs"],
|
||||
Slim: ["slim|skim"],
|
||||
Smarty: ["smarty|tpl"],
|
||||
Smithy: ["smithy"],
|
||||
snippets: ["snippets"],
|
||||
Soy_Template: ["soy"],
|
||||
Space: ["space"],
|
||||
SPARQL: ["rq"],
|
||||
SQL: ["sql"],
|
||||
SQLServer: ["sqlserver"],
|
||||
Stylus: ["styl|stylus"],
|
||||
SVG: ["svg"],
|
||||
Swift: ["swift"],
|
||||
Tcl: ["tcl"],
|
||||
Terraform: ["tf", "tfvars", "terragrunt"],
|
||||
Tex: ["tex"],
|
||||
Text: ["txt"],
|
||||
Textile: ["textile"],
|
||||
Toml: ["toml"],
|
||||
TSX: ["tsx"],
|
||||
Turtle: ["ttl"],
|
||||
Twig: ["twig|swig"],
|
||||
Typescript: ["ts|typescript|str"],
|
||||
Vala: ["vala"],
|
||||
VBScript: ["vbs|vb"],
|
||||
Velocity: ["vm"],
|
||||
Verilog: ["v|vh|sv|svh"],
|
||||
VHDL: ["vhd|vhdl"],
|
||||
Visualforce: ["vfp|component|page"],
|
||||
Wollok: ["wlk|wpgm|wtest"],
|
||||
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
|
||||
XQuery: ["xq"],
|
||||
YAML: ["yaml|yml"],
|
||||
Zeek: ["zeek|bro"],
|
||||
Django: ["html"],
|
||||
},
|
||||
u = {
|
||||
ObjectiveC: "Objective-C",
|
||||
CSharp: "C#",
|
||||
golang: "Go",
|
||||
C_Cpp: "C and C++",
|
||||
Csound_Document: "Csound Document",
|
||||
Csound_Orchestra: "Csound",
|
||||
Csound_Score: "Csound Score",
|
||||
coffee: "CoffeeScript",
|
||||
HTML_Ruby: "HTML (Ruby)",
|
||||
HTML_Elixir: "HTML (Elixir)",
|
||||
FTL: "FreeMarker",
|
||||
PHP_Laravel_blade: "PHP (Blade Template)",
|
||||
Perl6: "Perl 6",
|
||||
AutoHotKey: "AutoHotkey / AutoIt",
|
||||
},
|
||||
a = {};
|
||||
for (var f in o) {
|
||||
var l = o[f],
|
||||
c = (u[f] || f).replace(/_/g, " "),
|
||||
h = f.toLowerCase(),
|
||||
p = new s(h, c, l[0]);
|
||||
(a[h] = p), r.push(p);
|
||||
}
|
||||
n.exports = { getModeForPath: i, modes: r, modesByName: a };
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/themelist",
|
||||
["require", "exports", "module"],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
var r = [
|
||||
["Chrome"],
|
||||
["Clouds"],
|
||||
["Crimson Editor"],
|
||||
["Dawn"],
|
||||
["Dreamweaver"],
|
||||
["Eclipse"],
|
||||
["GitHub"],
|
||||
["IPlastic"],
|
||||
["Solarized Light"],
|
||||
["TextMate"],
|
||||
["Tomorrow"],
|
||||
["XCode"],
|
||||
["Kuroir"],
|
||||
["KatzenMilch"],
|
||||
["SQL Server", "sqlserver", "light"],
|
||||
["Ambiance", "ambiance", "dark"],
|
||||
["Chaos", "chaos", "dark"],
|
||||
["Clouds Midnight", "clouds_midnight", "dark"],
|
||||
["Dracula", "", "dark"],
|
||||
["Cobalt", "cobalt", "dark"],
|
||||
["Gruvbox", "gruvbox", "dark"],
|
||||
["Green on Black", "gob", "dark"],
|
||||
["idle Fingers", "idle_fingers", "dark"],
|
||||
["krTheme", "kr_theme", "dark"],
|
||||
["Merbivore", "merbivore", "dark"],
|
||||
["Merbivore Soft", "merbivore_soft", "dark"],
|
||||
["Mono Industrial", "mono_industrial", "dark"],
|
||||
["Monokai", "monokai", "dark"],
|
||||
["Nord Dark", "nord_dark", "dark"],
|
||||
["One Dark", "one_dark", "dark"],
|
||||
["Pastel on dark", "pastel_on_dark", "dark"],
|
||||
["Solarized Dark", "solarized_dark", "dark"],
|
||||
["Terminal", "terminal", "dark"],
|
||||
["Tomorrow Night", "tomorrow_night", "dark"],
|
||||
["Tomorrow Night Blue", "tomorrow_night_blue", "dark"],
|
||||
["Tomorrow Night Bright", "tomorrow_night_bright", "dark"],
|
||||
["Tomorrow Night 80s", "tomorrow_night_eighties", "dark"],
|
||||
["Twilight", "twilight", "dark"],
|
||||
["Vibrant Ink", "vibrant_ink", "dark"],
|
||||
];
|
||||
(t.themesByName = {}),
|
||||
(t.themes = r.map(function (e) {
|
||||
var n = e[1] || e[0].replace(/ /g, "_").toLowerCase(),
|
||||
r = {
|
||||
caption: e[0],
|
||||
theme: "ace/theme/" + n,
|
||||
isDark: e[2] == "dark",
|
||||
name: n,
|
||||
};
|
||||
return (t.themesByName[n] = r), r;
|
||||
}));
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/options",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/ext/menu_tools/overlay_page",
|
||||
"ace/lib/dom",
|
||||
"ace/lib/oop",
|
||||
"ace/config",
|
||||
"ace/lib/event_emitter",
|
||||
"ace/ext/modelist",
|
||||
"ace/ext/themelist",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
e("./menu_tools/overlay_page");
|
||||
var r = e("../lib/dom"),
|
||||
i = e("../lib/oop"),
|
||||
s = e("../config"),
|
||||
o = e("../lib/event_emitter").EventEmitter,
|
||||
u = r.buildDom,
|
||||
a = e("./modelist"),
|
||||
f = e("./themelist"),
|
||||
l = { Bright: [], Dark: [] };
|
||||
f.themes.forEach(function (e) {
|
||||
l[e.isDark ? "Dark" : "Bright"].push({
|
||||
caption: e.caption,
|
||||
value: e.theme,
|
||||
});
|
||||
});
|
||||
var c = a.modes.map(function (e) {
|
||||
return { caption: e.caption, value: e.mode };
|
||||
}),
|
||||
h = {
|
||||
Main: {
|
||||
Mode: { path: "mode", type: "select", items: c },
|
||||
Theme: { path: "theme", type: "select", items: l },
|
||||
Keybinding: {
|
||||
type: "buttonBar",
|
||||
path: "keyboardHandler",
|
||||
items: [
|
||||
{ caption: "Ace", value: null },
|
||||
{ caption: "Vim", value: "ace/keyboard/vim" },
|
||||
{ caption: "Emacs", value: "ace/keyboard/emacs" },
|
||||
{ caption: "Sublime", value: "ace/keyboard/sublime" },
|
||||
{ caption: "VSCode", value: "ace/keyboard/vscode" },
|
||||
],
|
||||
},
|
||||
"Font Size": {
|
||||
path: "fontSize",
|
||||
type: "number",
|
||||
defaultValue: 12,
|
||||
defaults: [
|
||||
{ caption: "12px", value: 12 },
|
||||
{ caption: "24px", value: 24 },
|
||||
],
|
||||
},
|
||||
"Soft Wrap": {
|
||||
type: "buttonBar",
|
||||
path: "wrap",
|
||||
items: [
|
||||
{ caption: "Off", value: "off" },
|
||||
{ caption: "View", value: "free" },
|
||||
{ caption: "margin", value: "printMargin" },
|
||||
{ caption: "40", value: "40" },
|
||||
],
|
||||
},
|
||||
"Cursor Style": {
|
||||
path: "cursorStyle",
|
||||
items: [
|
||||
{ caption: "Ace", value: "ace" },
|
||||
{ caption: "Slim", value: "slim" },
|
||||
{ caption: "Smooth", value: "smooth" },
|
||||
{ caption: "Smooth And Slim", value: "smooth slim" },
|
||||
{ caption: "Wide", value: "wide" },
|
||||
],
|
||||
},
|
||||
Folding: {
|
||||
path: "foldStyle",
|
||||
items: [
|
||||
{ caption: "Manual", value: "manual" },
|
||||
{ caption: "Mark begin", value: "markbegin" },
|
||||
{ caption: "Mark begin and end", value: "markbeginend" },
|
||||
],
|
||||
},
|
||||
"Soft Tabs": [
|
||||
{ path: "useSoftTabs" },
|
||||
{
|
||||
ariaLabel: "Tab Size",
|
||||
path: "tabSize",
|
||||
type: "number",
|
||||
values: [2, 3, 4, 8, 16],
|
||||
},
|
||||
],
|
||||
Overscroll: {
|
||||
type: "buttonBar",
|
||||
path: "scrollPastEnd",
|
||||
items: [
|
||||
{ caption: "None", value: 0 },
|
||||
{ caption: "Half", value: 0.5 },
|
||||
{ caption: "Full", value: 1 },
|
||||
],
|
||||
},
|
||||
},
|
||||
More: {
|
||||
"Atomic soft tabs": { path: "navigateWithinSoftTabs" },
|
||||
"Enable Behaviours": { path: "behavioursEnabled" },
|
||||
"Wrap with quotes": { path: "wrapBehavioursEnabled" },
|
||||
"Enable Auto Indent": { path: "enableAutoIndent" },
|
||||
"Full Line Selection": {
|
||||
type: "checkbox",
|
||||
values: "text|line",
|
||||
path: "selectionStyle",
|
||||
},
|
||||
"Highlight Active Line": { path: "highlightActiveLine" },
|
||||
"Show Invisibles": { path: "showInvisibles" },
|
||||
"Show Indent Guides": { path: "displayIndentGuides" },
|
||||
"Highlight Indent Guides": { path: "highlightIndentGuides" },
|
||||
"Persistent HScrollbar": { path: "hScrollBarAlwaysVisible" },
|
||||
"Persistent VScrollbar": { path: "vScrollBarAlwaysVisible" },
|
||||
"Animate scrolling": { path: "animatedScroll" },
|
||||
"Show Gutter": { path: "showGutter" },
|
||||
"Show Line Numbers": { path: "showLineNumbers" },
|
||||
"Relative Line Numbers": { path: "relativeLineNumbers" },
|
||||
"Fixed Gutter Width": { path: "fixedWidthGutter" },
|
||||
"Show Print Margin": [
|
||||
{ path: "showPrintMargin" },
|
||||
{
|
||||
ariaLabel: "Print Margin",
|
||||
type: "number",
|
||||
path: "printMarginColumn",
|
||||
},
|
||||
],
|
||||
"Indented Soft Wrap": { path: "indentedSoftWrap" },
|
||||
"Highlight selected word": { path: "highlightSelectedWord" },
|
||||
"Fade Fold Widgets": { path: "fadeFoldWidgets" },
|
||||
"Use textarea for IME": { path: "useTextareaForIME" },
|
||||
"Merge Undo Deltas": {
|
||||
path: "mergeUndoDeltas",
|
||||
items: [
|
||||
{ caption: "Always", value: "always" },
|
||||
{ caption: "Never", value: "false" },
|
||||
{ caption: "Timed", value: "true" },
|
||||
],
|
||||
},
|
||||
"Elastic Tabstops": { path: "useElasticTabstops" },
|
||||
"Incremental Search": { path: "useIncrementalSearch" },
|
||||
"Read-only": { path: "readOnly" },
|
||||
"Copy without selection": { path: "copyWithEmptySelection" },
|
||||
"Live Autocompletion": { path: "enableLiveAutocompletion" },
|
||||
"Custom scrollbar": { path: "customScrollbar" },
|
||||
},
|
||||
},
|
||||
p = function (e, t) {
|
||||
(this.editor = e),
|
||||
(this.container = t || document.createElement("div")),
|
||||
(this.groups = []),
|
||||
(this.options = {});
|
||||
};
|
||||
(function () {
|
||||
i.implement(this, o),
|
||||
(this.add = function (e) {
|
||||
e.Main && i.mixin(h.Main, e.Main),
|
||||
e.More && i.mixin(h.More, e.More);
|
||||
}),
|
||||
(this.render = function () {
|
||||
(this.container.innerHTML = ""),
|
||||
u(
|
||||
[
|
||||
"table",
|
||||
{ role: "presentation", id: "controls" },
|
||||
this.renderOptionGroup(h.Main),
|
||||
[
|
||||
"tr",
|
||||
null,
|
||||
[
|
||||
"td",
|
||||
{ colspan: 2 },
|
||||
[
|
||||
"table",
|
||||
{ role: "presentation", id: "more-controls" },
|
||||
this.renderOptionGroup(h.More),
|
||||
],
|
||||
],
|
||||
],
|
||||
["tr", null, ["td", { colspan: 2 }, "version " + s.version]],
|
||||
],
|
||||
this.container,
|
||||
);
|
||||
}),
|
||||
(this.renderOptionGroup = function (e) {
|
||||
return Object.keys(e)
|
||||
.map(function (t, n) {
|
||||
var r = e[t];
|
||||
return (
|
||||
r.position || (r.position = n / 1e4),
|
||||
r.label || (r.label = t),
|
||||
r
|
||||
);
|
||||
})
|
||||
.sort(function (e, t) {
|
||||
return e.position - t.position;
|
||||
})
|
||||
.map(function (e) {
|
||||
return this.renderOption(e.label, e);
|
||||
}, this);
|
||||
}),
|
||||
(this.renderOptionControl = function (e, t) {
|
||||
var n = this;
|
||||
if (Array.isArray(t))
|
||||
return t.map(function (t) {
|
||||
return n.renderOptionControl(e, t);
|
||||
});
|
||||
var r,
|
||||
i = n.getOption(t);
|
||||
t.values &&
|
||||
t.type != "checkbox" &&
|
||||
(typeof t.values == "string" && (t.values = t.values.split("|")),
|
||||
(t.items = t.values.map(function (e) {
|
||||
return { value: e, name: e };
|
||||
})));
|
||||
if (t.type == "buttonBar")
|
||||
r = [
|
||||
"div",
|
||||
{ role: "group", "aria-labelledby": t.path + "-label" },
|
||||
t.items.map(function (e) {
|
||||
return [
|
||||
"button",
|
||||
{
|
||||
value: e.value,
|
||||
ace_selected_button: i == e.value,
|
||||
"aria-pressed": i == e.value,
|
||||
onclick: function () {
|
||||
n.setOption(t, e.value);
|
||||
var r = this.parentNode.querySelectorAll(
|
||||
"[ace_selected_button]",
|
||||
);
|
||||
for (var i = 0; i < r.length; i++)
|
||||
r[i].removeAttribute("ace_selected_button"),
|
||||
r[i].setAttribute("aria-pressed", !1);
|
||||
this.setAttribute("ace_selected_button", !0),
|
||||
this.setAttribute("aria-pressed", !0);
|
||||
},
|
||||
},
|
||||
e.desc || e.caption || e.name,
|
||||
];
|
||||
}),
|
||||
];
|
||||
else if (t.type == "number")
|
||||
(r = [
|
||||
"input",
|
||||
{
|
||||
type: "number",
|
||||
value: i || t.defaultValue,
|
||||
style: "width:3em",
|
||||
oninput: function () {
|
||||
n.setOption(t, parseInt(this.value));
|
||||
},
|
||||
},
|
||||
]),
|
||||
t.ariaLabel
|
||||
? (r[1]["aria-label"] = t.ariaLabel)
|
||||
: (r[1].id = e),
|
||||
t.defaults &&
|
||||
(r = [
|
||||
r,
|
||||
t.defaults.map(function (e) {
|
||||
return [
|
||||
"button",
|
||||
{
|
||||
onclick: function () {
|
||||
var t = this.parentNode.firstChild;
|
||||
(t.value = e.value), t.oninput();
|
||||
},
|
||||
},
|
||||
e.caption,
|
||||
];
|
||||
}),
|
||||
]);
|
||||
else if (t.items) {
|
||||
var s = function (e) {
|
||||
return e.map(function (e) {
|
||||
return [
|
||||
"option",
|
||||
{ value: e.value || e.name },
|
||||
e.desc || e.caption || e.name,
|
||||
];
|
||||
});
|
||||
},
|
||||
o = Array.isArray(t.items)
|
||||
? s(t.items)
|
||||
: Object.keys(t.items).map(function (e) {
|
||||
return ["optgroup", { label: e }, s(t.items[e])];
|
||||
});
|
||||
r = [
|
||||
"select",
|
||||
{
|
||||
id: e,
|
||||
value: i,
|
||||
onchange: function () {
|
||||
n.setOption(t, this.value);
|
||||
},
|
||||
},
|
||||
o,
|
||||
];
|
||||
} else
|
||||
typeof t.values == "string" && (t.values = t.values.split("|")),
|
||||
t.values && (i = i == t.values[1]),
|
||||
(r = [
|
||||
"input",
|
||||
{
|
||||
type: "checkbox",
|
||||
id: e,
|
||||
checked: i || null,
|
||||
onchange: function () {
|
||||
var e = this.checked;
|
||||
t.values && (e = t.values[e ? 1 : 0]), n.setOption(t, e);
|
||||
},
|
||||
},
|
||||
]),
|
||||
t.type == "checkedNumber" && (r = [r, []]);
|
||||
return r;
|
||||
}),
|
||||
(this.renderOption = function (e, t) {
|
||||
if (t.path && !t.onchange && !this.editor.$options[t.path]) return;
|
||||
var n = Array.isArray(t) ? t[0].path : t.path;
|
||||
this.options[n] = t;
|
||||
var r = "-" + n,
|
||||
i = n + "-label",
|
||||
s = this.renderOptionControl(r, t);
|
||||
return [
|
||||
"tr",
|
||||
{ class: "ace_optionsMenuEntry" },
|
||||
["td", ["label", { for: r, id: i }, e]],
|
||||
["td", s],
|
||||
];
|
||||
}),
|
||||
(this.setOption = function (e, t) {
|
||||
typeof e == "string" && (e = this.options[e]),
|
||||
t == "false" && (t = !1),
|
||||
t == "true" && (t = !0),
|
||||
t == "null" && (t = null),
|
||||
t == "undefined" && (t = undefined),
|
||||
typeof t == "string" &&
|
||||
parseFloat(t).toString() == t &&
|
||||
(t = parseFloat(t)),
|
||||
e.onchange
|
||||
? e.onchange(t)
|
||||
: e.path && this.editor.setOption(e.path, t),
|
||||
this._signal("setOption", { name: e.path, value: t });
|
||||
}),
|
||||
(this.getOption = function (e) {
|
||||
return e.getValue ? e.getValue() : this.editor.getOption(e.path);
|
||||
});
|
||||
}).call(p.prototype),
|
||||
(t.OptionPanel = p);
|
||||
},
|
||||
);
|
||||
(function () {
|
||||
window.require(["ace/ext/options"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
2472
vuejs/client/src/assets/script/editor/ext-prompt.js
Normal file
2472
vuejs/client/src/assets/script/editor/ext-prompt.js
Normal file
File diff suppressed because it is too large
Load diff
113
vuejs/client/src/assets/script/editor/ext-rtl.js
Normal file
113
vuejs/client/src/assets/script/editor/ext-rtl.js
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
define("ace/ext/rtl", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/editor",
|
||||
"ace/config",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
function s(e, t) {
|
||||
var n = t.getSelection().lead;
|
||||
t.session.$bidiHandler.isRtlLine(n.row) &&
|
||||
n.column === 0 &&
|
||||
(t.session.$bidiHandler.isMoveLeftOperation && n.row > 0
|
||||
? t
|
||||
.getSelection()
|
||||
.moveCursorTo(n.row - 1, t.session.getLine(n.row - 1).length)
|
||||
: t.getSelection().isEmpty()
|
||||
? (n.column += 1)
|
||||
: n.setPosition(n.row, n.column + 1));
|
||||
}
|
||||
function o(e) {
|
||||
e.editor.session.$bidiHandler.isMoveLeftOperation =
|
||||
/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name);
|
||||
}
|
||||
function u(e, t) {
|
||||
var n = t.session;
|
||||
n.$bidiHandler.currentRow = null;
|
||||
if (
|
||||
n.$bidiHandler.isRtlLine(e.start.row) &&
|
||||
e.action === "insert" &&
|
||||
e.lines.length > 1
|
||||
)
|
||||
for (var r = e.start.row; r < e.end.row; r++)
|
||||
n.getLine(r + 1).charAt(0) !== n.$bidiHandler.RLE &&
|
||||
(n.doc.$lines[r + 1] = n.$bidiHandler.RLE + n.getLine(r + 1));
|
||||
}
|
||||
function a(e, t) {
|
||||
var n = t.session,
|
||||
r = n.$bidiHandler,
|
||||
i = t.$textLayer.$lines.cells,
|
||||
s = t.layerConfig.width - t.layerConfig.padding + "px";
|
||||
i.forEach(function (e) {
|
||||
var t = e.element.style;
|
||||
r && r.isRtlLine(e.row)
|
||||
? ((t.direction = "rtl"), (t.textAlign = "right"), (t.width = s))
|
||||
: ((t.direction = ""), (t.textAlign = ""), (t.width = ""));
|
||||
});
|
||||
}
|
||||
function f(e) {
|
||||
function n(e) {
|
||||
var t = e.element.style;
|
||||
t.direction = t.textAlign = t.width = "";
|
||||
}
|
||||
var t = e.$textLayer.$lines;
|
||||
t.cells.forEach(n), t.cellCache.forEach(n);
|
||||
}
|
||||
var r = [
|
||||
{
|
||||
name: "leftToRight",
|
||||
bindKey: { win: "Ctrl-Alt-Shift-L", mac: "Command-Alt-Shift-L" },
|
||||
exec: function (e) {
|
||||
e.session.$bidiHandler.setRtlDirection(e, !1);
|
||||
},
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "rightToLeft",
|
||||
bindKey: { win: "Ctrl-Alt-Shift-R", mac: "Command-Alt-Shift-R" },
|
||||
exec: function (e) {
|
||||
e.session.$bidiHandler.setRtlDirection(e, !0);
|
||||
},
|
||||
readOnly: !0,
|
||||
},
|
||||
],
|
||||
i = e("../editor").Editor;
|
||||
e("../config").defineOptions(i.prototype, "editor", {
|
||||
rtlText: {
|
||||
set: function (e) {
|
||||
e
|
||||
? (this.on("change", u),
|
||||
this.on("changeSelection", s),
|
||||
this.renderer.on("afterRender", a),
|
||||
this.commands.on("exec", o),
|
||||
this.commands.addCommands(r))
|
||||
: (this.off("change", u),
|
||||
this.off("changeSelection", s),
|
||||
this.renderer.off("afterRender", a),
|
||||
this.commands.off("exec", o),
|
||||
this.commands.removeCommands(r),
|
||||
f(this.renderer)),
|
||||
this.renderer.updateFull();
|
||||
},
|
||||
},
|
||||
rtl: {
|
||||
set: function (e) {
|
||||
(this.session.$bidiHandler.$isRtl = e),
|
||||
e
|
||||
? (this.setOption("rtlText", !1),
|
||||
this.renderer.on("afterRender", a),
|
||||
(this.session.$bidiHandler.seenBidi = !0))
|
||||
: (this.renderer.off("afterRender", a), f(this.renderer)),
|
||||
this.renderer.updateFull();
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/rtl"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
470
vuejs/client/src/assets/script/editor/ext-searchbox.js
Normal file
470
vuejs/client/src/assets/script/editor/ext-searchbox.js
Normal file
|
|
@ -0,0 +1,470 @@
|
|||
define(
|
||||
"ace/ext/searchbox.css",
|
||||
["require", "exports", "module"],
|
||||
function (e, t, n) {
|
||||
n.exports =
|
||||
'\n\n/* ------------------------------------------------------------------------------------------\n * Editor Search Form\n * --------------------------------------------------------------------------------------- */\n.ace_search {\n background-color: #ddd;\n color: #666;\n border: 1px solid #cbcbcb;\n border-top: 0 none;\n overflow: hidden;\n margin: 0;\n padding: 4px 6px 0 4px;\n position: absolute;\n top: 0;\n z-index: 99;\n white-space: normal;\n}\n.ace_search.left {\n border-left: 0 none;\n border-radius: 0px 0px 5px 0px;\n left: 0;\n}\n.ace_search.right {\n border-radius: 0px 0px 0px 5px;\n border-right: 0 none;\n right: 0;\n}\n\n.ace_search_form, .ace_replace_form {\n margin: 0 20px 4px 0;\n overflow: hidden;\n line-height: 1.9;\n}\n.ace_replace_form {\n margin-right: 0;\n}\n.ace_search_form.ace_nomatch {\n outline: 1px solid red;\n}\n\n.ace_search_field {\n border-radius: 3px 0 0 3px;\n background-color: white;\n color: black;\n border: 1px solid #cbcbcb;\n border-right: 0 none;\n outline: 0;\n padding: 0;\n font-size: inherit;\n margin: 0;\n line-height: inherit;\n padding: 0 6px;\n min-width: 17em;\n vertical-align: top;\n min-height: 1.8em;\n box-sizing: content-box;\n}\n.ace_searchbtn {\n border: 1px solid #cbcbcb;\n line-height: inherit;\n display: inline-block;\n padding: 0 6px;\n background: #fff;\n border-right: 0 none;\n border-left: 1px solid #dcdcdc;\n cursor: pointer;\n margin: 0;\n position: relative;\n color: #666;\n}\n.ace_searchbtn:last-child {\n border-radius: 0 3px 3px 0;\n border-right: 1px solid #cbcbcb;\n}\n.ace_searchbtn:disabled {\n background: none;\n cursor: default;\n}\n.ace_searchbtn:hover {\n background-color: #eef1f6;\n}\n.ace_searchbtn.prev, .ace_searchbtn.next {\n padding: 0px 0.7em\n}\n.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\n content: "";\n border: solid 2px #888;\n width: 0.5em;\n height: 0.5em;\n border-width: 2px 0 0 2px;\n display:inline-block;\n transform: rotate(-45deg);\n}\n.ace_searchbtn.next:after {\n border-width: 0 2px 2px 0 ;\n}\n.ace_searchbtn_close {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\n border-radius: 50%;\n border: 0 none;\n color: #656565;\n cursor: pointer;\n font: 16px/16px Arial;\n padding: 0;\n height: 14px;\n width: 14px;\n top: 9px;\n right: 7px;\n position: absolute;\n}\n.ace_searchbtn_close:hover {\n background-color: #656565;\n background-position: 50% 100%;\n color: white;\n}\n\n.ace_button {\n margin-left: 2px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n opacity: 0.7;\n border: 1px solid rgba(100,100,100,0.23);\n padding: 1px;\n box-sizing: border-box!important;\n color: black;\n}\n\n.ace_button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_button:active {\n background-color: #ddd;\n}\n\n.ace_button.checked {\n border-color: #3399ff;\n opacity:1;\n}\n\n.ace_search_options{\n margin-bottom: 3px;\n text-align: right;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n clear: both;\n}\n\n.ace_search_counter {\n float: left;\n font-family: arial;\n padding: 0 8px;\n}';
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/searchbox",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/lib/dom",
|
||||
"ace/lib/lang",
|
||||
"ace/lib/event",
|
||||
"ace/ext/searchbox.css",
|
||||
"ace/keyboard/hash_handler",
|
||||
"ace/lib/keys",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("../lib/dom"),
|
||||
i = e("../lib/lang"),
|
||||
s = e("../lib/event"),
|
||||
o = e("./searchbox.css"),
|
||||
u = e("../keyboard/hash_handler").HashHandler,
|
||||
a = e("../lib/keys"),
|
||||
f = 999;
|
||||
r.importCssString(o, "ace_searchbox", !1);
|
||||
var l = function (e, t, n) {
|
||||
var i = r.createElement("div");
|
||||
r.buildDom(
|
||||
[
|
||||
"div",
|
||||
{ class: "ace_search right" },
|
||||
["span", { action: "hide", class: "ace_searchbtn_close" }],
|
||||
[
|
||||
"div",
|
||||
{ class: "ace_search_form" },
|
||||
[
|
||||
"input",
|
||||
{
|
||||
class: "ace_search_field",
|
||||
placeholder: "Search for",
|
||||
spellcheck: "false",
|
||||
},
|
||||
],
|
||||
[
|
||||
"span",
|
||||
{ action: "findPrev", class: "ace_searchbtn prev" },
|
||||
"\u200b",
|
||||
],
|
||||
[
|
||||
"span",
|
||||
{ action: "findNext", class: "ace_searchbtn next" },
|
||||
"\u200b",
|
||||
],
|
||||
[
|
||||
"span",
|
||||
{
|
||||
action: "findAll",
|
||||
class: "ace_searchbtn",
|
||||
title: "Alt-Enter",
|
||||
},
|
||||
"All",
|
||||
],
|
||||
],
|
||||
[
|
||||
"div",
|
||||
{ class: "ace_replace_form" },
|
||||
[
|
||||
"input",
|
||||
{
|
||||
class: "ace_search_field",
|
||||
placeholder: "Replace with",
|
||||
spellcheck: "false",
|
||||
},
|
||||
],
|
||||
[
|
||||
"span",
|
||||
{ action: "replaceAndFindNext", class: "ace_searchbtn" },
|
||||
"Replace",
|
||||
],
|
||||
["span", { action: "replaceAll", class: "ace_searchbtn" }, "All"],
|
||||
],
|
||||
[
|
||||
"div",
|
||||
{ class: "ace_search_options" },
|
||||
[
|
||||
"span",
|
||||
{
|
||||
action: "toggleReplace",
|
||||
class: "ace_button",
|
||||
title: "Toggle Replace mode",
|
||||
style: "float:left;margin-top:-2px;padding:0 5px;",
|
||||
},
|
||||
"+",
|
||||
],
|
||||
["span", { class: "ace_search_counter" }],
|
||||
[
|
||||
"span",
|
||||
{
|
||||
action: "toggleRegexpMode",
|
||||
class: "ace_button",
|
||||
title: "RegExp Search",
|
||||
},
|
||||
".*",
|
||||
],
|
||||
[
|
||||
"span",
|
||||
{
|
||||
action: "toggleCaseSensitive",
|
||||
class: "ace_button",
|
||||
title: "CaseSensitive Search",
|
||||
},
|
||||
"Aa",
|
||||
],
|
||||
[
|
||||
"span",
|
||||
{
|
||||
action: "toggleWholeWords",
|
||||
class: "ace_button",
|
||||
title: "Whole Word Search",
|
||||
},
|
||||
"\\b",
|
||||
],
|
||||
[
|
||||
"span",
|
||||
{
|
||||
action: "searchInSelection",
|
||||
class: "ace_button",
|
||||
title: "Search In Selection",
|
||||
},
|
||||
"S",
|
||||
],
|
||||
],
|
||||
],
|
||||
i,
|
||||
),
|
||||
(this.element = i.firstChild),
|
||||
(this.setSession = this.setSession.bind(this)),
|
||||
this.$init(),
|
||||
this.setEditor(e),
|
||||
r.importCssString(o, "ace_searchbox", e.container);
|
||||
};
|
||||
(function () {
|
||||
(this.setEditor = function (e) {
|
||||
(e.searchBox = this),
|
||||
e.renderer.scroller.appendChild(this.element),
|
||||
(this.editor = e);
|
||||
}),
|
||||
(this.setSession = function (e) {
|
||||
(this.searchRange = null), this.$syncOptions(!0);
|
||||
}),
|
||||
(this.$initElements = function (e) {
|
||||
(this.searchBox = e.querySelector(".ace_search_form")),
|
||||
(this.replaceBox = e.querySelector(".ace_replace_form")),
|
||||
(this.searchOption = e.querySelector(
|
||||
"[action=searchInSelection]",
|
||||
)),
|
||||
(this.replaceOption = e.querySelector("[action=toggleReplace]")),
|
||||
(this.regExpOption = e.querySelector(
|
||||
"[action=toggleRegexpMode]",
|
||||
)),
|
||||
(this.caseSensitiveOption = e.querySelector(
|
||||
"[action=toggleCaseSensitive]",
|
||||
)),
|
||||
(this.wholeWordOption = e.querySelector(
|
||||
"[action=toggleWholeWords]",
|
||||
)),
|
||||
(this.searchInput =
|
||||
this.searchBox.querySelector(".ace_search_field")),
|
||||
(this.replaceInput =
|
||||
this.replaceBox.querySelector(".ace_search_field")),
|
||||
(this.searchCounter = e.querySelector(".ace_search_counter"));
|
||||
}),
|
||||
(this.$init = function () {
|
||||
var e = this.element;
|
||||
this.$initElements(e);
|
||||
var t = this;
|
||||
s.addListener(e, "mousedown", function (e) {
|
||||
setTimeout(function () {
|
||||
t.activeInput.focus();
|
||||
}, 0),
|
||||
s.stopPropagation(e);
|
||||
}),
|
||||
s.addListener(e, "click", function (e) {
|
||||
var n = e.target || e.srcElement,
|
||||
r = n.getAttribute("action");
|
||||
r && t[r]
|
||||
? t[r]()
|
||||
: t.$searchBarKb.commands[r] &&
|
||||
t.$searchBarKb.commands[r].exec(t),
|
||||
s.stopPropagation(e);
|
||||
}),
|
||||
s.addCommandKeyListener(e, function (e, n, r) {
|
||||
var i = a.keyCodeToString(r),
|
||||
o = t.$searchBarKb.findKeyCommand(n, i);
|
||||
o && o.exec && (o.exec(t), s.stopEvent(e));
|
||||
}),
|
||||
(this.$onChange = i.delayedCall(function () {
|
||||
t.find(!1, !1);
|
||||
})),
|
||||
s.addListener(this.searchInput, "input", function () {
|
||||
t.$onChange.schedule(20);
|
||||
}),
|
||||
s.addListener(this.searchInput, "focus", function () {
|
||||
(t.activeInput = t.searchInput),
|
||||
t.searchInput.value && t.highlight();
|
||||
}),
|
||||
s.addListener(this.replaceInput, "focus", function () {
|
||||
(t.activeInput = t.replaceInput),
|
||||
t.searchInput.value && t.highlight();
|
||||
});
|
||||
}),
|
||||
(this.$closeSearchBarKb = new u([
|
||||
{
|
||||
bindKey: "Esc",
|
||||
name: "closeSearchBar",
|
||||
exec: function (e) {
|
||||
e.searchBox.hide();
|
||||
},
|
||||
},
|
||||
])),
|
||||
(this.$searchBarKb = new u()),
|
||||
this.$searchBarKb.bindKeys({
|
||||
"Ctrl-f|Command-f": function (e) {
|
||||
var t = (e.isReplace = !e.isReplace);
|
||||
(e.replaceBox.style.display = t ? "" : "none"),
|
||||
(e.replaceOption.checked = !1),
|
||||
e.$syncOptions(),
|
||||
e.searchInput.focus();
|
||||
},
|
||||
"Ctrl-H|Command-Option-F": function (e) {
|
||||
if (e.editor.getReadOnly()) return;
|
||||
(e.replaceOption.checked = !0),
|
||||
e.$syncOptions(),
|
||||
e.replaceInput.focus();
|
||||
},
|
||||
"Ctrl-G|Command-G": function (e) {
|
||||
e.findNext();
|
||||
},
|
||||
"Ctrl-Shift-G|Command-Shift-G": function (e) {
|
||||
e.findPrev();
|
||||
},
|
||||
esc: function (e) {
|
||||
setTimeout(function () {
|
||||
e.hide();
|
||||
});
|
||||
},
|
||||
Return: function (e) {
|
||||
e.activeInput == e.replaceInput && e.replace(), e.findNext();
|
||||
},
|
||||
"Shift-Return": function (e) {
|
||||
e.activeInput == e.replaceInput && e.replace(), e.findPrev();
|
||||
},
|
||||
"Alt-Return": function (e) {
|
||||
e.activeInput == e.replaceInput && e.replaceAll(), e.findAll();
|
||||
},
|
||||
Tab: function (e) {
|
||||
(e.activeInput == e.replaceInput
|
||||
? e.searchInput
|
||||
: e.replaceInput
|
||||
).focus();
|
||||
},
|
||||
}),
|
||||
this.$searchBarKb.addCommands([
|
||||
{
|
||||
name: "toggleRegexpMode",
|
||||
bindKey: { win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/" },
|
||||
exec: function (e) {
|
||||
(e.regExpOption.checked = !e.regExpOption.checked),
|
||||
e.$syncOptions();
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "toggleCaseSensitive",
|
||||
bindKey: { win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I" },
|
||||
exec: function (e) {
|
||||
(e.caseSensitiveOption.checked =
|
||||
!e.caseSensitiveOption.checked),
|
||||
e.$syncOptions();
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "toggleWholeWords",
|
||||
bindKey: { win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W" },
|
||||
exec: function (e) {
|
||||
(e.wholeWordOption.checked = !e.wholeWordOption.checked),
|
||||
e.$syncOptions();
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "toggleReplace",
|
||||
exec: function (e) {
|
||||
(e.replaceOption.checked = !e.replaceOption.checked),
|
||||
e.$syncOptions();
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "searchInSelection",
|
||||
exec: function (e) {
|
||||
(e.searchOption.checked = !e.searchRange),
|
||||
e.setSearchRange(
|
||||
e.searchOption.checked && e.editor.getSelectionRange(),
|
||||
),
|
||||
e.$syncOptions();
|
||||
},
|
||||
},
|
||||
]),
|
||||
(this.setSearchRange = function (e) {
|
||||
(this.searchRange = e),
|
||||
e
|
||||
? (this.searchRangeMarker = this.editor.session.addMarker(
|
||||
e,
|
||||
"ace_active-line",
|
||||
))
|
||||
: this.searchRangeMarker &&
|
||||
(this.editor.session.removeMarker(this.searchRangeMarker),
|
||||
(this.searchRangeMarker = null));
|
||||
}),
|
||||
(this.$syncOptions = function (e) {
|
||||
r.setCssClass(this.replaceOption, "checked", this.searchRange),
|
||||
r.setCssClass(
|
||||
this.searchOption,
|
||||
"checked",
|
||||
this.searchOption.checked,
|
||||
),
|
||||
(this.replaceOption.textContent = this.replaceOption.checked
|
||||
? "-"
|
||||
: "+"),
|
||||
r.setCssClass(
|
||||
this.regExpOption,
|
||||
"checked",
|
||||
this.regExpOption.checked,
|
||||
),
|
||||
r.setCssClass(
|
||||
this.wholeWordOption,
|
||||
"checked",
|
||||
this.wholeWordOption.checked,
|
||||
),
|
||||
r.setCssClass(
|
||||
this.caseSensitiveOption,
|
||||
"checked",
|
||||
this.caseSensitiveOption.checked,
|
||||
);
|
||||
var t = this.editor.getReadOnly();
|
||||
(this.replaceOption.style.display = t ? "none" : ""),
|
||||
(this.replaceBox.style.display =
|
||||
this.replaceOption.checked && !t ? "" : "none"),
|
||||
this.find(!1, !1, e);
|
||||
}),
|
||||
(this.highlight = function (e) {
|
||||
this.editor.session.highlight(e || this.editor.$search.$options.re),
|
||||
this.editor.renderer.updateBackMarkers();
|
||||
}),
|
||||
(this.find = function (e, t, n) {
|
||||
var i = this.editor.find(this.searchInput.value, {
|
||||
skipCurrent: e,
|
||||
backwards: t,
|
||||
wrap: !0,
|
||||
regExp: this.regExpOption.checked,
|
||||
caseSensitive: this.caseSensitiveOption.checked,
|
||||
wholeWord: this.wholeWordOption.checked,
|
||||
preventScroll: n,
|
||||
range: this.searchRange,
|
||||
}),
|
||||
s = !i && this.searchInput.value;
|
||||
r.setCssClass(this.searchBox, "ace_nomatch", s),
|
||||
this.editor._emit("findSearchBox", { match: !s }),
|
||||
this.highlight(),
|
||||
this.updateCounter();
|
||||
}),
|
||||
(this.updateCounter = function () {
|
||||
var e = this.editor,
|
||||
t = e.$search.$options.re,
|
||||
n = 0,
|
||||
r = 0;
|
||||
if (t) {
|
||||
var i = this.searchRange
|
||||
? e.session.getTextRange(this.searchRange)
|
||||
: e.getValue(),
|
||||
s = e.session.doc.positionToIndex(e.selection.anchor);
|
||||
this.searchRange &&
|
||||
(s -= e.session.doc.positionToIndex(this.searchRange.start));
|
||||
var o = (t.lastIndex = 0),
|
||||
u;
|
||||
while ((u = t.exec(i))) {
|
||||
n++, (o = u.index), o <= s && r++;
|
||||
if (n > f) break;
|
||||
if (!u[0]) {
|
||||
t.lastIndex = o += 1;
|
||||
if (o >= i.length) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.searchCounter.textContent = r + " of " + (n > f ? f + "+" : n);
|
||||
}),
|
||||
(this.findNext = function () {
|
||||
this.find(!0, !1);
|
||||
}),
|
||||
(this.findPrev = function () {
|
||||
this.find(!0, !0);
|
||||
}),
|
||||
(this.findAll = function () {
|
||||
var e = this.editor.findAll(this.searchInput.value, {
|
||||
regExp: this.regExpOption.checked,
|
||||
caseSensitive: this.caseSensitiveOption.checked,
|
||||
wholeWord: this.wholeWordOption.checked,
|
||||
}),
|
||||
t = !e && this.searchInput.value;
|
||||
r.setCssClass(this.searchBox, "ace_nomatch", t),
|
||||
this.editor._emit("findSearchBox", { match: !t }),
|
||||
this.highlight(),
|
||||
this.hide();
|
||||
}),
|
||||
(this.replace = function () {
|
||||
this.editor.getReadOnly() ||
|
||||
this.editor.replace(this.replaceInput.value);
|
||||
}),
|
||||
(this.replaceAndFindNext = function () {
|
||||
this.editor.getReadOnly() ||
|
||||
(this.editor.replace(this.replaceInput.value), this.findNext());
|
||||
}),
|
||||
(this.replaceAll = function () {
|
||||
this.editor.getReadOnly() ||
|
||||
this.editor.replaceAll(this.replaceInput.value);
|
||||
}),
|
||||
(this.hide = function () {
|
||||
(this.active = !1),
|
||||
this.setSearchRange(null),
|
||||
this.editor.off("changeSession", this.setSession),
|
||||
(this.element.style.display = "none"),
|
||||
this.editor.keyBinding.removeKeyboardHandler(
|
||||
this.$closeSearchBarKb,
|
||||
),
|
||||
this.editor.focus();
|
||||
}),
|
||||
(this.show = function (e, t) {
|
||||
(this.active = !0),
|
||||
this.editor.on("changeSession", this.setSession),
|
||||
(this.element.style.display = ""),
|
||||
(this.replaceOption.checked = t),
|
||||
e && (this.searchInput.value = e),
|
||||
this.searchInput.focus(),
|
||||
this.searchInput.select(),
|
||||
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),
|
||||
this.$syncOptions(!0);
|
||||
}),
|
||||
(this.isFocused = function () {
|
||||
var e = document.activeElement;
|
||||
return e == this.searchInput || e == this.replaceInput;
|
||||
});
|
||||
}).call(l.prototype),
|
||||
(t.SearchBox = l),
|
||||
(t.Search = function (e, t) {
|
||||
var n = e.searchBox || new l(e);
|
||||
n.show(e.session.getTextRange(), t);
|
||||
});
|
||||
},
|
||||
);
|
||||
(function () {
|
||||
window.require(["ace/ext/searchbox"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
758
vuejs/client/src/assets/script/editor/ext-settings_menu.js
Normal file
758
vuejs/client/src/assets/script/editor/ext-settings_menu.js
Normal file
|
|
@ -0,0 +1,758 @@
|
|||
define(
|
||||
"ace/ext/menu_tools/settings_menu.css",
|
||||
["require", "exports", "module"],
|
||||
function (e, t, n) {
|
||||
n.exports =
|
||||
"#ace_settingsmenu, #kbshortcutmenu {\n background-color: #F7F7F7;\n color: black;\n box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\n padding: 1em 0.5em 2em 1em;\n overflow: auto;\n position: absolute;\n margin: 0;\n bottom: 0;\n right: 0;\n top: 0;\n z-index: 9991;\n cursor: default;\n}\n\n.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\n box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\n background-color: rgba(255, 255, 255, 0.6);\n color: black;\n}\n\n.ace_optionsMenuEntry:hover {\n background-color: rgba(100, 100, 100, 0.1);\n transition: all 0.3s\n}\n\n.ace_closeButton {\n background: rgba(245, 146, 146, 0.5);\n border: 1px solid #F48A8A;\n border-radius: 50%;\n padding: 7px;\n position: absolute;\n right: -8px;\n top: -8px;\n z-index: 100000;\n}\n.ace_closeButton{\n background: rgba(245, 146, 146, 0.9);\n}\n.ace_optionsMenuKey {\n color: darkslateblue;\n font-weight: bold;\n}\n.ace_optionsMenuCommand {\n color: darkcyan;\n font-weight: normal;\n}\n.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\n vertical-align: middle;\n}\n\n.ace_optionsMenuEntry button[ace_selected_button=true] {\n background: #e7e7e7;\n box-shadow: 1px 0px 2px 0px #adadad inset;\n border-color: #adadad;\n}\n.ace_optionsMenuEntry button {\n background: white;\n border: 1px solid lightgray;\n margin: 0px;\n}\n.ace_optionsMenuEntry button:hover{\n background: #f0f0f0;\n}";
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/menu_tools/overlay_page",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/lib/dom",
|
||||
"ace/ext/menu_tools/settings_menu.css",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("../../lib/dom"),
|
||||
i = e("./settings_menu.css");
|
||||
r.importCssString(i, "settings_menu.css", !1),
|
||||
(n.exports.overlayPage = function (t, n, r) {
|
||||
function o(e) {
|
||||
e.keyCode === 27 && u();
|
||||
}
|
||||
function u() {
|
||||
if (!i) return;
|
||||
document.removeEventListener("keydown", o),
|
||||
i.parentNode.removeChild(i),
|
||||
t && t.focus(),
|
||||
(i = null),
|
||||
r && r();
|
||||
}
|
||||
function a(e) {
|
||||
(s = e),
|
||||
e &&
|
||||
((i.style.pointerEvents = "none"),
|
||||
(n.style.pointerEvents = "auto"));
|
||||
}
|
||||
var i = document.createElement("div"),
|
||||
s = !1;
|
||||
return (
|
||||
(i.style.cssText =
|
||||
"margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; " +
|
||||
(t ? "background-color: rgba(0, 0, 0, 0.3);" : "")),
|
||||
i.addEventListener("click", function (e) {
|
||||
s || u();
|
||||
}),
|
||||
document.addEventListener("keydown", o),
|
||||
n.addEventListener("click", function (e) {
|
||||
e.stopPropagation();
|
||||
}),
|
||||
i.appendChild(n),
|
||||
document.body.appendChild(i),
|
||||
t && t.blur(),
|
||||
{ close: u, setIgnoreFocusOut: a }
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/modelist",
|
||||
["require", "exports", "module"],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
function i(e) {
|
||||
var t = a.text,
|
||||
n = e.split(/[\/\\]/).pop();
|
||||
for (var i = 0; i < r.length; i++)
|
||||
if (r[i].supportsFile(n)) {
|
||||
t = r[i];
|
||||
break;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
var r = [],
|
||||
s = function (e, t, n) {
|
||||
(this.name = e),
|
||||
(this.caption = t),
|
||||
(this.mode = "ace/mode/" + e),
|
||||
(this.extensions = n);
|
||||
var r;
|
||||
/\^/.test(n)
|
||||
? (r =
|
||||
n.replace(/\|(\^)?/g, function (e, t) {
|
||||
return "$|" + (t ? "^" : "^.*\\.");
|
||||
}) + "$")
|
||||
: (r = "^.*\\.(" + n + ")$"),
|
||||
(this.extRe = new RegExp(r, "gi"));
|
||||
};
|
||||
s.prototype.supportsFile = function (e) {
|
||||
return e.match(this.extRe);
|
||||
};
|
||||
var o = {
|
||||
ABAP: ["abap"],
|
||||
ABC: ["abc"],
|
||||
ActionScript: ["as"],
|
||||
ADA: ["ada|adb"],
|
||||
Alda: ["alda"],
|
||||
Apache_Conf: [
|
||||
"^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd",
|
||||
],
|
||||
Apex: ["apex|cls|trigger|tgr"],
|
||||
AQL: ["aql"],
|
||||
AsciiDoc: ["asciidoc|adoc"],
|
||||
ASL: ["dsl|asl|asl.json"],
|
||||
Assembly_x86: ["asm|a"],
|
||||
AutoHotKey: ["ahk"],
|
||||
BatchFile: ["bat|cmd"],
|
||||
BibTeX: ["bib"],
|
||||
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
|
||||
C9Search: ["c9search_results"],
|
||||
Cirru: ["cirru|cr"],
|
||||
Clojure: ["clj|cljs"],
|
||||
Cobol: ["CBL|COB"],
|
||||
coffee: ["coffee|cf|cson|^Cakefile"],
|
||||
ColdFusion: ["cfm"],
|
||||
Crystal: ["cr"],
|
||||
CSharp: ["cs"],
|
||||
Csound_Document: ["csd"],
|
||||
Csound_Orchestra: ["orc"],
|
||||
Csound_Score: ["sco"],
|
||||
CSS: ["css"],
|
||||
Curly: ["curly"],
|
||||
D: ["d|di"],
|
||||
Dart: ["dart"],
|
||||
Diff: ["diff|patch"],
|
||||
Dockerfile: ["^Dockerfile"],
|
||||
Dot: ["dot"],
|
||||
Drools: ["drl"],
|
||||
Edifact: ["edi"],
|
||||
Eiffel: ["e|ge"],
|
||||
EJS: ["ejs"],
|
||||
Elixir: ["ex|exs"],
|
||||
Elm: ["elm"],
|
||||
Erlang: ["erl|hrl"],
|
||||
Forth: ["frt|fs|ldr|fth|4th"],
|
||||
Fortran: ["f|f90"],
|
||||
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
|
||||
FSL: ["fsl"],
|
||||
FTL: ["ftl"],
|
||||
Gcode: ["gcode"],
|
||||
Gherkin: ["feature"],
|
||||
Gitignore: ["^.gitignore"],
|
||||
Glsl: ["glsl|frag|vert"],
|
||||
Gobstones: ["gbs"],
|
||||
golang: ["go"],
|
||||
GraphQLSchema: ["gql"],
|
||||
Groovy: ["groovy"],
|
||||
HAML: ["haml"],
|
||||
Handlebars: ["hbs|handlebars|tpl|mustache"],
|
||||
Haskell: ["hs"],
|
||||
Haskell_Cabal: ["cabal"],
|
||||
haXe: ["hx"],
|
||||
Hjson: ["hjson"],
|
||||
HTML: ["html|htm|xhtml|vue|we|wpy"],
|
||||
HTML_Elixir: ["eex|html.eex"],
|
||||
HTML_Ruby: ["erb|rhtml|html.erb"],
|
||||
INI: ["ini|conf|cfg|prefs"],
|
||||
Io: ["io"],
|
||||
Ion: ["ion"],
|
||||
Jack: ["jack"],
|
||||
Jade: ["jade|pug"],
|
||||
Java: ["java"],
|
||||
JavaScript: ["js|jsm|jsx|cjs|mjs"],
|
||||
JSON: ["json"],
|
||||
JSON5: ["json5"],
|
||||
JSONiq: ["jq"],
|
||||
JSP: ["jsp"],
|
||||
JSSM: ["jssm|jssm_state"],
|
||||
JSX: ["jsx"],
|
||||
Julia: ["jl"],
|
||||
Kotlin: ["kt|kts"],
|
||||
LaTeX: ["tex|latex|ltx|bib"],
|
||||
Latte: ["latte"],
|
||||
LESS: ["less"],
|
||||
Liquid: ["liquid"],
|
||||
Lisp: ["lisp"],
|
||||
LiveScript: ["ls"],
|
||||
Log: ["log"],
|
||||
LogiQL: ["logic|lql"],
|
||||
Logtalk: ["lgt"],
|
||||
LSL: ["lsl"],
|
||||
Lua: ["lua"],
|
||||
LuaPage: ["lp"],
|
||||
Lucene: ["lucene"],
|
||||
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
|
||||
Markdown: ["md|markdown"],
|
||||
Mask: ["mask"],
|
||||
MATLAB: ["matlab"],
|
||||
Maze: ["mz"],
|
||||
MediaWiki: ["wiki|mediawiki"],
|
||||
MEL: ["mel"],
|
||||
MIPS: ["s|asm"],
|
||||
MIXAL: ["mixal"],
|
||||
MUSHCode: ["mc|mush"],
|
||||
MySQL: ["mysql"],
|
||||
Nginx: ["nginx|conf"],
|
||||
Nim: ["nim"],
|
||||
Nix: ["nix"],
|
||||
NSIS: ["nsi|nsh"],
|
||||
Nunjucks: ["nunjucks|nunjs|nj|njk"],
|
||||
ObjectiveC: ["m|mm"],
|
||||
OCaml: ["ml|mli"],
|
||||
PartiQL: ["partiql|pql"],
|
||||
Pascal: ["pas|p"],
|
||||
Perl: ["pl|pm"],
|
||||
pgSQL: ["pgsql"],
|
||||
PHP_Laravel_blade: ["blade.php"],
|
||||
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
||||
Pig: ["pig"],
|
||||
Powershell: ["ps1"],
|
||||
Praat: ["praat|praatscript|psc|proc"],
|
||||
Prisma: ["prisma"],
|
||||
Prolog: ["plg|prolog"],
|
||||
Properties: ["properties"],
|
||||
Protobuf: ["proto"],
|
||||
Puppet: ["epp|pp"],
|
||||
Python: ["py"],
|
||||
QML: ["qml"],
|
||||
R: ["r"],
|
||||
Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"],
|
||||
Razor: ["cshtml|asp"],
|
||||
RDoc: ["Rd"],
|
||||
Red: ["red|reds"],
|
||||
RHTML: ["Rhtml"],
|
||||
Robot: ["robot|resource"],
|
||||
RST: ["rst"],
|
||||
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
|
||||
Rust: ["rs"],
|
||||
SaC: ["sac"],
|
||||
SASS: ["sass"],
|
||||
SCAD: ["scad"],
|
||||
Scala: ["scala|sbt"],
|
||||
Scheme: ["scm|sm|rkt|oak|scheme"],
|
||||
Scrypt: ["scrypt"],
|
||||
SCSS: ["scss"],
|
||||
SH: ["sh|bash|^.bashrc"],
|
||||
SJS: ["sjs"],
|
||||
Slim: ["slim|skim"],
|
||||
Smarty: ["smarty|tpl"],
|
||||
Smithy: ["smithy"],
|
||||
snippets: ["snippets"],
|
||||
Soy_Template: ["soy"],
|
||||
Space: ["space"],
|
||||
SPARQL: ["rq"],
|
||||
SQL: ["sql"],
|
||||
SQLServer: ["sqlserver"],
|
||||
Stylus: ["styl|stylus"],
|
||||
SVG: ["svg"],
|
||||
Swift: ["swift"],
|
||||
Tcl: ["tcl"],
|
||||
Terraform: ["tf", "tfvars", "terragrunt"],
|
||||
Tex: ["tex"],
|
||||
Text: ["txt"],
|
||||
Textile: ["textile"],
|
||||
Toml: ["toml"],
|
||||
TSX: ["tsx"],
|
||||
Turtle: ["ttl"],
|
||||
Twig: ["twig|swig"],
|
||||
Typescript: ["ts|typescript|str"],
|
||||
Vala: ["vala"],
|
||||
VBScript: ["vbs|vb"],
|
||||
Velocity: ["vm"],
|
||||
Verilog: ["v|vh|sv|svh"],
|
||||
VHDL: ["vhd|vhdl"],
|
||||
Visualforce: ["vfp|component|page"],
|
||||
Wollok: ["wlk|wpgm|wtest"],
|
||||
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
|
||||
XQuery: ["xq"],
|
||||
YAML: ["yaml|yml"],
|
||||
Zeek: ["zeek|bro"],
|
||||
Django: ["html"],
|
||||
},
|
||||
u = {
|
||||
ObjectiveC: "Objective-C",
|
||||
CSharp: "C#",
|
||||
golang: "Go",
|
||||
C_Cpp: "C and C++",
|
||||
Csound_Document: "Csound Document",
|
||||
Csound_Orchestra: "Csound",
|
||||
Csound_Score: "Csound Score",
|
||||
coffee: "CoffeeScript",
|
||||
HTML_Ruby: "HTML (Ruby)",
|
||||
HTML_Elixir: "HTML (Elixir)",
|
||||
FTL: "FreeMarker",
|
||||
PHP_Laravel_blade: "PHP (Blade Template)",
|
||||
Perl6: "Perl 6",
|
||||
AutoHotKey: "AutoHotkey / AutoIt",
|
||||
},
|
||||
a = {};
|
||||
for (var f in o) {
|
||||
var l = o[f],
|
||||
c = (u[f] || f).replace(/_/g, " "),
|
||||
h = f.toLowerCase(),
|
||||
p = new s(h, c, l[0]);
|
||||
(a[h] = p), r.push(p);
|
||||
}
|
||||
n.exports = { getModeForPath: i, modes: r, modesByName: a };
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/themelist",
|
||||
["require", "exports", "module"],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
var r = [
|
||||
["Chrome"],
|
||||
["Clouds"],
|
||||
["Crimson Editor"],
|
||||
["Dawn"],
|
||||
["Dreamweaver"],
|
||||
["Eclipse"],
|
||||
["GitHub"],
|
||||
["IPlastic"],
|
||||
["Solarized Light"],
|
||||
["TextMate"],
|
||||
["Tomorrow"],
|
||||
["XCode"],
|
||||
["Kuroir"],
|
||||
["KatzenMilch"],
|
||||
["SQL Server", "sqlserver", "light"],
|
||||
["Ambiance", "ambiance", "dark"],
|
||||
["Chaos", "chaos", "dark"],
|
||||
["Clouds Midnight", "clouds_midnight", "dark"],
|
||||
["Dracula", "", "dark"],
|
||||
["Cobalt", "cobalt", "dark"],
|
||||
["Gruvbox", "gruvbox", "dark"],
|
||||
["Green on Black", "gob", "dark"],
|
||||
["idle Fingers", "idle_fingers", "dark"],
|
||||
["krTheme", "kr_theme", "dark"],
|
||||
["Merbivore", "merbivore", "dark"],
|
||||
["Merbivore Soft", "merbivore_soft", "dark"],
|
||||
["Mono Industrial", "mono_industrial", "dark"],
|
||||
["Monokai", "monokai", "dark"],
|
||||
["Nord Dark", "nord_dark", "dark"],
|
||||
["One Dark", "one_dark", "dark"],
|
||||
["Pastel on dark", "pastel_on_dark", "dark"],
|
||||
["Solarized Dark", "solarized_dark", "dark"],
|
||||
["Terminal", "terminal", "dark"],
|
||||
["Tomorrow Night", "tomorrow_night", "dark"],
|
||||
["Tomorrow Night Blue", "tomorrow_night_blue", "dark"],
|
||||
["Tomorrow Night Bright", "tomorrow_night_bright", "dark"],
|
||||
["Tomorrow Night 80s", "tomorrow_night_eighties", "dark"],
|
||||
["Twilight", "twilight", "dark"],
|
||||
["Vibrant Ink", "vibrant_ink", "dark"],
|
||||
];
|
||||
(t.themesByName = {}),
|
||||
(t.themes = r.map(function (e) {
|
||||
var n = e[1] || e[0].replace(/ /g, "_").toLowerCase(),
|
||||
r = {
|
||||
caption: e[0],
|
||||
theme: "ace/theme/" + n,
|
||||
isDark: e[2] == "dark",
|
||||
name: n,
|
||||
};
|
||||
return (t.themesByName[n] = r), r;
|
||||
}));
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/options",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/ext/menu_tools/overlay_page",
|
||||
"ace/lib/dom",
|
||||
"ace/lib/oop",
|
||||
"ace/config",
|
||||
"ace/lib/event_emitter",
|
||||
"ace/ext/modelist",
|
||||
"ace/ext/themelist",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
e("./menu_tools/overlay_page");
|
||||
var r = e("../lib/dom"),
|
||||
i = e("../lib/oop"),
|
||||
s = e("../config"),
|
||||
o = e("../lib/event_emitter").EventEmitter,
|
||||
u = r.buildDom,
|
||||
a = e("./modelist"),
|
||||
f = e("./themelist"),
|
||||
l = { Bright: [], Dark: [] };
|
||||
f.themes.forEach(function (e) {
|
||||
l[e.isDark ? "Dark" : "Bright"].push({
|
||||
caption: e.caption,
|
||||
value: e.theme,
|
||||
});
|
||||
});
|
||||
var c = a.modes.map(function (e) {
|
||||
return { caption: e.caption, value: e.mode };
|
||||
}),
|
||||
h = {
|
||||
Main: {
|
||||
Mode: { path: "mode", type: "select", items: c },
|
||||
Theme: { path: "theme", type: "select", items: l },
|
||||
Keybinding: {
|
||||
type: "buttonBar",
|
||||
path: "keyboardHandler",
|
||||
items: [
|
||||
{ caption: "Ace", value: null },
|
||||
{ caption: "Vim", value: "ace/keyboard/vim" },
|
||||
{ caption: "Emacs", value: "ace/keyboard/emacs" },
|
||||
{ caption: "Sublime", value: "ace/keyboard/sublime" },
|
||||
{ caption: "VSCode", value: "ace/keyboard/vscode" },
|
||||
],
|
||||
},
|
||||
"Font Size": {
|
||||
path: "fontSize",
|
||||
type: "number",
|
||||
defaultValue: 12,
|
||||
defaults: [
|
||||
{ caption: "12px", value: 12 },
|
||||
{ caption: "24px", value: 24 },
|
||||
],
|
||||
},
|
||||
"Soft Wrap": {
|
||||
type: "buttonBar",
|
||||
path: "wrap",
|
||||
items: [
|
||||
{ caption: "Off", value: "off" },
|
||||
{ caption: "View", value: "free" },
|
||||
{ caption: "margin", value: "printMargin" },
|
||||
{ caption: "40", value: "40" },
|
||||
],
|
||||
},
|
||||
"Cursor Style": {
|
||||
path: "cursorStyle",
|
||||
items: [
|
||||
{ caption: "Ace", value: "ace" },
|
||||
{ caption: "Slim", value: "slim" },
|
||||
{ caption: "Smooth", value: "smooth" },
|
||||
{ caption: "Smooth And Slim", value: "smooth slim" },
|
||||
{ caption: "Wide", value: "wide" },
|
||||
],
|
||||
},
|
||||
Folding: {
|
||||
path: "foldStyle",
|
||||
items: [
|
||||
{ caption: "Manual", value: "manual" },
|
||||
{ caption: "Mark begin", value: "markbegin" },
|
||||
{ caption: "Mark begin and end", value: "markbeginend" },
|
||||
],
|
||||
},
|
||||
"Soft Tabs": [
|
||||
{ path: "useSoftTabs" },
|
||||
{
|
||||
ariaLabel: "Tab Size",
|
||||
path: "tabSize",
|
||||
type: "number",
|
||||
values: [2, 3, 4, 8, 16],
|
||||
},
|
||||
],
|
||||
Overscroll: {
|
||||
type: "buttonBar",
|
||||
path: "scrollPastEnd",
|
||||
items: [
|
||||
{ caption: "None", value: 0 },
|
||||
{ caption: "Half", value: 0.5 },
|
||||
{ caption: "Full", value: 1 },
|
||||
],
|
||||
},
|
||||
},
|
||||
More: {
|
||||
"Atomic soft tabs": { path: "navigateWithinSoftTabs" },
|
||||
"Enable Behaviours": { path: "behavioursEnabled" },
|
||||
"Wrap with quotes": { path: "wrapBehavioursEnabled" },
|
||||
"Enable Auto Indent": { path: "enableAutoIndent" },
|
||||
"Full Line Selection": {
|
||||
type: "checkbox",
|
||||
values: "text|line",
|
||||
path: "selectionStyle",
|
||||
},
|
||||
"Highlight Active Line": { path: "highlightActiveLine" },
|
||||
"Show Invisibles": { path: "showInvisibles" },
|
||||
"Show Indent Guides": { path: "displayIndentGuides" },
|
||||
"Highlight Indent Guides": { path: "highlightIndentGuides" },
|
||||
"Persistent HScrollbar": { path: "hScrollBarAlwaysVisible" },
|
||||
"Persistent VScrollbar": { path: "vScrollBarAlwaysVisible" },
|
||||
"Animate scrolling": { path: "animatedScroll" },
|
||||
"Show Gutter": { path: "showGutter" },
|
||||
"Show Line Numbers": { path: "showLineNumbers" },
|
||||
"Relative Line Numbers": { path: "relativeLineNumbers" },
|
||||
"Fixed Gutter Width": { path: "fixedWidthGutter" },
|
||||
"Show Print Margin": [
|
||||
{ path: "showPrintMargin" },
|
||||
{
|
||||
ariaLabel: "Print Margin",
|
||||
type: "number",
|
||||
path: "printMarginColumn",
|
||||
},
|
||||
],
|
||||
"Indented Soft Wrap": { path: "indentedSoftWrap" },
|
||||
"Highlight selected word": { path: "highlightSelectedWord" },
|
||||
"Fade Fold Widgets": { path: "fadeFoldWidgets" },
|
||||
"Use textarea for IME": { path: "useTextareaForIME" },
|
||||
"Merge Undo Deltas": {
|
||||
path: "mergeUndoDeltas",
|
||||
items: [
|
||||
{ caption: "Always", value: "always" },
|
||||
{ caption: "Never", value: "false" },
|
||||
{ caption: "Timed", value: "true" },
|
||||
],
|
||||
},
|
||||
"Elastic Tabstops": { path: "useElasticTabstops" },
|
||||
"Incremental Search": { path: "useIncrementalSearch" },
|
||||
"Read-only": { path: "readOnly" },
|
||||
"Copy without selection": { path: "copyWithEmptySelection" },
|
||||
"Live Autocompletion": { path: "enableLiveAutocompletion" },
|
||||
"Custom scrollbar": { path: "customScrollbar" },
|
||||
},
|
||||
},
|
||||
p = function (e, t) {
|
||||
(this.editor = e),
|
||||
(this.container = t || document.createElement("div")),
|
||||
(this.groups = []),
|
||||
(this.options = {});
|
||||
};
|
||||
(function () {
|
||||
i.implement(this, o),
|
||||
(this.add = function (e) {
|
||||
e.Main && i.mixin(h.Main, e.Main),
|
||||
e.More && i.mixin(h.More, e.More);
|
||||
}),
|
||||
(this.render = function () {
|
||||
(this.container.innerHTML = ""),
|
||||
u(
|
||||
[
|
||||
"table",
|
||||
{ role: "presentation", id: "controls" },
|
||||
this.renderOptionGroup(h.Main),
|
||||
[
|
||||
"tr",
|
||||
null,
|
||||
[
|
||||
"td",
|
||||
{ colspan: 2 },
|
||||
[
|
||||
"table",
|
||||
{ role: "presentation", id: "more-controls" },
|
||||
this.renderOptionGroup(h.More),
|
||||
],
|
||||
],
|
||||
],
|
||||
["tr", null, ["td", { colspan: 2 }, "version " + s.version]],
|
||||
],
|
||||
this.container,
|
||||
);
|
||||
}),
|
||||
(this.renderOptionGroup = function (e) {
|
||||
return Object.keys(e)
|
||||
.map(function (t, n) {
|
||||
var r = e[t];
|
||||
return (
|
||||
r.position || (r.position = n / 1e4),
|
||||
r.label || (r.label = t),
|
||||
r
|
||||
);
|
||||
})
|
||||
.sort(function (e, t) {
|
||||
return e.position - t.position;
|
||||
})
|
||||
.map(function (e) {
|
||||
return this.renderOption(e.label, e);
|
||||
}, this);
|
||||
}),
|
||||
(this.renderOptionControl = function (e, t) {
|
||||
var n = this;
|
||||
if (Array.isArray(t))
|
||||
return t.map(function (t) {
|
||||
return n.renderOptionControl(e, t);
|
||||
});
|
||||
var r,
|
||||
i = n.getOption(t);
|
||||
t.values &&
|
||||
t.type != "checkbox" &&
|
||||
(typeof t.values == "string" && (t.values = t.values.split("|")),
|
||||
(t.items = t.values.map(function (e) {
|
||||
return { value: e, name: e };
|
||||
})));
|
||||
if (t.type == "buttonBar")
|
||||
r = [
|
||||
"div",
|
||||
{ role: "group", "aria-labelledby": t.path + "-label" },
|
||||
t.items.map(function (e) {
|
||||
return [
|
||||
"button",
|
||||
{
|
||||
value: e.value,
|
||||
ace_selected_button: i == e.value,
|
||||
"aria-pressed": i == e.value,
|
||||
onclick: function () {
|
||||
n.setOption(t, e.value);
|
||||
var r = this.parentNode.querySelectorAll(
|
||||
"[ace_selected_button]",
|
||||
);
|
||||
for (var i = 0; i < r.length; i++)
|
||||
r[i].removeAttribute("ace_selected_button"),
|
||||
r[i].setAttribute("aria-pressed", !1);
|
||||
this.setAttribute("ace_selected_button", !0),
|
||||
this.setAttribute("aria-pressed", !0);
|
||||
},
|
||||
},
|
||||
e.desc || e.caption || e.name,
|
||||
];
|
||||
}),
|
||||
];
|
||||
else if (t.type == "number")
|
||||
(r = [
|
||||
"input",
|
||||
{
|
||||
type: "number",
|
||||
value: i || t.defaultValue,
|
||||
style: "width:3em",
|
||||
oninput: function () {
|
||||
n.setOption(t, parseInt(this.value));
|
||||
},
|
||||
},
|
||||
]),
|
||||
t.ariaLabel
|
||||
? (r[1]["aria-label"] = t.ariaLabel)
|
||||
: (r[1].id = e),
|
||||
t.defaults &&
|
||||
(r = [
|
||||
r,
|
||||
t.defaults.map(function (e) {
|
||||
return [
|
||||
"button",
|
||||
{
|
||||
onclick: function () {
|
||||
var t = this.parentNode.firstChild;
|
||||
(t.value = e.value), t.oninput();
|
||||
},
|
||||
},
|
||||
e.caption,
|
||||
];
|
||||
}),
|
||||
]);
|
||||
else if (t.items) {
|
||||
var s = function (e) {
|
||||
return e.map(function (e) {
|
||||
return [
|
||||
"option",
|
||||
{ value: e.value || e.name },
|
||||
e.desc || e.caption || e.name,
|
||||
];
|
||||
});
|
||||
},
|
||||
o = Array.isArray(t.items)
|
||||
? s(t.items)
|
||||
: Object.keys(t.items).map(function (e) {
|
||||
return ["optgroup", { label: e }, s(t.items[e])];
|
||||
});
|
||||
r = [
|
||||
"select",
|
||||
{
|
||||
id: e,
|
||||
value: i,
|
||||
onchange: function () {
|
||||
n.setOption(t, this.value);
|
||||
},
|
||||
},
|
||||
o,
|
||||
];
|
||||
} else
|
||||
typeof t.values == "string" && (t.values = t.values.split("|")),
|
||||
t.values && (i = i == t.values[1]),
|
||||
(r = [
|
||||
"input",
|
||||
{
|
||||
type: "checkbox",
|
||||
id: e,
|
||||
checked: i || null,
|
||||
onchange: function () {
|
||||
var e = this.checked;
|
||||
t.values && (e = t.values[e ? 1 : 0]), n.setOption(t, e);
|
||||
},
|
||||
},
|
||||
]),
|
||||
t.type == "checkedNumber" && (r = [r, []]);
|
||||
return r;
|
||||
}),
|
||||
(this.renderOption = function (e, t) {
|
||||
if (t.path && !t.onchange && !this.editor.$options[t.path]) return;
|
||||
var n = Array.isArray(t) ? t[0].path : t.path;
|
||||
this.options[n] = t;
|
||||
var r = "-" + n,
|
||||
i = n + "-label",
|
||||
s = this.renderOptionControl(r, t);
|
||||
return [
|
||||
"tr",
|
||||
{ class: "ace_optionsMenuEntry" },
|
||||
["td", ["label", { for: r, id: i }, e]],
|
||||
["td", s],
|
||||
];
|
||||
}),
|
||||
(this.setOption = function (e, t) {
|
||||
typeof e == "string" && (e = this.options[e]),
|
||||
t == "false" && (t = !1),
|
||||
t == "true" && (t = !0),
|
||||
t == "null" && (t = null),
|
||||
t == "undefined" && (t = undefined),
|
||||
typeof t == "string" &&
|
||||
parseFloat(t).toString() == t &&
|
||||
(t = parseFloat(t)),
|
||||
e.onchange
|
||||
? e.onchange(t)
|
||||
: e.path && this.editor.setOption(e.path, t),
|
||||
this._signal("setOption", { name: e.path, value: t });
|
||||
}),
|
||||
(this.getOption = function (e) {
|
||||
return e.getValue ? e.getValue() : this.editor.getOption(e.path);
|
||||
});
|
||||
}).call(p.prototype),
|
||||
(t.OptionPanel = p);
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/settings_menu",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/ext/options",
|
||||
"ace/ext/menu_tools/overlay_page",
|
||||
"ace/editor",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
function s(e) {
|
||||
if (!document.getElementById("ace_settingsmenu")) {
|
||||
var t = new r(e);
|
||||
t.render(),
|
||||
(t.container.id = "ace_settingsmenu"),
|
||||
i(e, t.container),
|
||||
t.container.querySelector("select,input,button,checkbox").focus();
|
||||
}
|
||||
}
|
||||
var r = e("./options").OptionPanel,
|
||||
i = e("./menu_tools/overlay_page").overlayPage;
|
||||
n.exports.init = function () {
|
||||
var t = e("../editor").Editor;
|
||||
t.prototype.showSettingsMenu = function () {
|
||||
s(this);
|
||||
};
|
||||
};
|
||||
},
|
||||
);
|
||||
(function () {
|
||||
window.require(["ace/ext/settings_menu"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
64
vuejs/client/src/assets/script/editor/ext-spellcheck.js
Normal file
64
vuejs/client/src/assets/script/editor/ext-spellcheck.js
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
define("ace/ext/spellcheck", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/lib/event",
|
||||
"ace/editor",
|
||||
"ace/config",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("../lib/event");
|
||||
t.contextMenuHandler = function (e) {
|
||||
var t = e.target,
|
||||
n = t.textInput.getElement();
|
||||
if (!t.selection.isEmpty()) return;
|
||||
var i = t.getCursorPosition(),
|
||||
s = t.session.getWordRange(i.row, i.column),
|
||||
o = t.session.getTextRange(s);
|
||||
t.session.tokenRe.lastIndex = 0;
|
||||
if (!t.session.tokenRe.test(o)) return;
|
||||
var u = "\x01\x01",
|
||||
a = o + " " + u;
|
||||
(n.value = a),
|
||||
n.setSelectionRange(o.length, o.length + 1),
|
||||
n.setSelectionRange(0, 0),
|
||||
n.setSelectionRange(0, o.length);
|
||||
var f = !1;
|
||||
r.addListener(n, "keydown", function l() {
|
||||
r.removeListener(n, "keydown", l), (f = !0);
|
||||
}),
|
||||
t.textInput.setInputHandler(function (e) {
|
||||
if (e == a) return "";
|
||||
if (e.lastIndexOf(a, 0) === 0) return e.slice(a.length);
|
||||
if (e.substr(n.selectionEnd) == a) return e.slice(0, -a.length);
|
||||
if (e.slice(-2) == u) {
|
||||
var r = e.slice(0, -2);
|
||||
if (r.slice(-1) == " ")
|
||||
return f
|
||||
? r.substring(0, n.selectionEnd)
|
||||
: ((r = r.slice(0, -1)), t.session.replace(s, r), "");
|
||||
}
|
||||
return e;
|
||||
});
|
||||
};
|
||||
var i = e("../editor").Editor;
|
||||
e("../config").defineOptions(i.prototype, "editor", {
|
||||
spellcheck: {
|
||||
set: function (e) {
|
||||
var n = this.textInput.getElement();
|
||||
(n.spellcheck = !!e),
|
||||
e
|
||||
? this.on("nativecontextmenu", t.contextMenuHandler)
|
||||
: this.removeListener("nativecontextmenu", t.contextMenuHandler);
|
||||
},
|
||||
value: !0,
|
||||
},
|
||||
});
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/spellcheck"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
186
vuejs/client/src/assets/script/editor/ext-split.js
Normal file
186
vuejs/client/src/assets/script/editor/ext-split.js
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
define(
|
||||
"ace/split",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/lib/oop",
|
||||
"ace/lib/lang",
|
||||
"ace/lib/event_emitter",
|
||||
"ace/editor",
|
||||
"ace/virtual_renderer",
|
||||
"ace/edit_session",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("./lib/oop"),
|
||||
i = e("./lib/lang"),
|
||||
s = e("./lib/event_emitter").EventEmitter,
|
||||
o = e("./editor").Editor,
|
||||
u = e("./virtual_renderer").VirtualRenderer,
|
||||
a = e("./edit_session").EditSession,
|
||||
f = function (e, t, n) {
|
||||
(this.BELOW = 1),
|
||||
(this.BESIDE = 0),
|
||||
(this.$container = e),
|
||||
(this.$theme = t),
|
||||
(this.$splits = 0),
|
||||
(this.$editorCSS = ""),
|
||||
(this.$editors = []),
|
||||
(this.$orientation = this.BESIDE),
|
||||
this.setSplits(n || 1),
|
||||
(this.$cEditor = this.$editors[0]),
|
||||
this.on(
|
||||
"focus",
|
||||
function (e) {
|
||||
this.$cEditor = e;
|
||||
}.bind(this),
|
||||
);
|
||||
};
|
||||
(function () {
|
||||
r.implement(this, s),
|
||||
(this.$createEditor = function () {
|
||||
var e = document.createElement("div");
|
||||
(e.className = this.$editorCSS),
|
||||
(e.style.cssText = "position: absolute; top:0px; bottom:0px"),
|
||||
this.$container.appendChild(e);
|
||||
var t = new o(new u(e, this.$theme));
|
||||
return (
|
||||
t.on(
|
||||
"focus",
|
||||
function () {
|
||||
this._emit("focus", t);
|
||||
}.bind(this),
|
||||
),
|
||||
this.$editors.push(t),
|
||||
t.setFontSize(this.$fontSize),
|
||||
t
|
||||
);
|
||||
}),
|
||||
(this.setSplits = function (e) {
|
||||
var t;
|
||||
if (e < 1) throw "The number of splits have to be > 0!";
|
||||
if (e == this.$splits) return;
|
||||
if (e > this.$splits) {
|
||||
while (this.$splits < this.$editors.length && this.$splits < e)
|
||||
(t = this.$editors[this.$splits]),
|
||||
this.$container.appendChild(t.container),
|
||||
t.setFontSize(this.$fontSize),
|
||||
this.$splits++;
|
||||
while (this.$splits < e) this.$createEditor(), this.$splits++;
|
||||
} else
|
||||
while (this.$splits > e)
|
||||
(t = this.$editors[this.$splits - 1]),
|
||||
this.$container.removeChild(t.container),
|
||||
this.$splits--;
|
||||
this.resize();
|
||||
}),
|
||||
(this.getSplits = function () {
|
||||
return this.$splits;
|
||||
}),
|
||||
(this.getEditor = function (e) {
|
||||
return this.$editors[e];
|
||||
}),
|
||||
(this.getCurrentEditor = function () {
|
||||
return this.$cEditor;
|
||||
}),
|
||||
(this.focus = function () {
|
||||
this.$cEditor.focus();
|
||||
}),
|
||||
(this.blur = function () {
|
||||
this.$cEditor.blur();
|
||||
}),
|
||||
(this.setTheme = function (e) {
|
||||
this.$editors.forEach(function (t) {
|
||||
t.setTheme(e);
|
||||
});
|
||||
}),
|
||||
(this.setKeyboardHandler = function (e) {
|
||||
this.$editors.forEach(function (t) {
|
||||
t.setKeyboardHandler(e);
|
||||
});
|
||||
}),
|
||||
(this.forEach = function (e, t) {
|
||||
this.$editors.forEach(e, t);
|
||||
}),
|
||||
(this.$fontSize = ""),
|
||||
(this.setFontSize = function (e) {
|
||||
(this.$fontSize = e),
|
||||
this.forEach(function (t) {
|
||||
t.setFontSize(e);
|
||||
});
|
||||
}),
|
||||
(this.$cloneSession = function (e) {
|
||||
var t = new a(e.getDocument(), e.getMode()),
|
||||
n = e.getUndoManager();
|
||||
return (
|
||||
t.setUndoManager(n),
|
||||
t.setTabSize(e.getTabSize()),
|
||||
t.setUseSoftTabs(e.getUseSoftTabs()),
|
||||
t.setOverwrite(e.getOverwrite()),
|
||||
t.setBreakpoints(e.getBreakpoints()),
|
||||
t.setUseWrapMode(e.getUseWrapMode()),
|
||||
t.setUseWorker(e.getUseWorker()),
|
||||
t.setWrapLimitRange(e.$wrapLimitRange.min, e.$wrapLimitRange.max),
|
||||
(t.$foldData = e.$cloneFoldData()),
|
||||
t
|
||||
);
|
||||
}),
|
||||
(this.setSession = function (e, t) {
|
||||
var n;
|
||||
t == null ? (n = this.$cEditor) : (n = this.$editors[t]);
|
||||
var r = this.$editors.some(function (t) {
|
||||
return t.session === e;
|
||||
});
|
||||
return r && (e = this.$cloneSession(e)), n.setSession(e), e;
|
||||
}),
|
||||
(this.getOrientation = function () {
|
||||
return this.$orientation;
|
||||
}),
|
||||
(this.setOrientation = function (e) {
|
||||
if (this.$orientation == e) return;
|
||||
(this.$orientation = e), this.resize();
|
||||
}),
|
||||
(this.resize = function () {
|
||||
var e = this.$container.clientWidth,
|
||||
t = this.$container.clientHeight,
|
||||
n;
|
||||
if (this.$orientation == this.BESIDE) {
|
||||
var r = e / this.$splits;
|
||||
for (var i = 0; i < this.$splits; i++)
|
||||
(n = this.$editors[i]),
|
||||
(n.container.style.width = r + "px"),
|
||||
(n.container.style.top = "0px"),
|
||||
(n.container.style.left = i * r + "px"),
|
||||
(n.container.style.height = t + "px"),
|
||||
n.resize();
|
||||
} else {
|
||||
var s = t / this.$splits;
|
||||
for (var i = 0; i < this.$splits; i++)
|
||||
(n = this.$editors[i]),
|
||||
(n.container.style.width = e + "px"),
|
||||
(n.container.style.top = i * s + "px"),
|
||||
(n.container.style.left = "0px"),
|
||||
(n.container.style.height = s + "px"),
|
||||
n.resize();
|
||||
}
|
||||
});
|
||||
}).call(f.prototype),
|
||||
(t.Split = f);
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/split",
|
||||
["require", "exports", "module", "ace/split"],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
n.exports = e("../split");
|
||||
},
|
||||
);
|
||||
(function () {
|
||||
window.require(["ace/ext/split"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
170
vuejs/client/src/assets/script/editor/ext-static_highlight.js
Normal file
170
vuejs/client/src/assets/script/editor/ext-static_highlight.js
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
define(
|
||||
"ace/ext/static.css",
|
||||
["require", "exports", "module"],
|
||||
function (e, t, n) {
|
||||
n.exports =
|
||||
".ace_static_highlight {\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\n font-size: 12px;\n white-space: pre-wrap\n}\n\n.ace_static_highlight .ace_gutter {\n width: 2em;\n text-align: right;\n padding: 0 3px 0 0;\n margin-right: 3px;\n contain: none;\n}\n\n.ace_static_highlight.ace_show_gutter .ace_line {\n padding-left: 2.6em;\n}\n\n.ace_static_highlight .ace_line { position: relative; }\n\n.ace_static_highlight .ace_gutter-cell {\n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n top: 0;\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n\n.ace_static_highlight .ace_gutter-cell:before {\n content: counter(ace_line, decimal);\n counter-increment: ace_line;\n}\n.ace_static_highlight {\n counter-reset: ace_line;\n}\n";
|
||||
},
|
||||
),
|
||||
define(
|
||||
"ace/ext/static_highlight",
|
||||
[
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/edit_session",
|
||||
"ace/layer/text",
|
||||
"ace/ext/static.css",
|
||||
"ace/config",
|
||||
"ace/lib/dom",
|
||||
"ace/lib/lang",
|
||||
],
|
||||
function (e, t, n) {
|
||||
"use strict";
|
||||
function f(e) {
|
||||
(this.type = e), (this.style = {}), (this.textContent = "");
|
||||
}
|
||||
var r = e("../edit_session").EditSession,
|
||||
i = e("../layer/text").Text,
|
||||
s = e("./static.css"),
|
||||
o = e("../config"),
|
||||
u = e("../lib/dom"),
|
||||
a = e("../lib/lang").escapeHTML;
|
||||
(f.prototype.cloneNode = function () {
|
||||
return this;
|
||||
}),
|
||||
(f.prototype.appendChild = function (e) {
|
||||
this.textContent += e.toString();
|
||||
}),
|
||||
(f.prototype.toString = function () {
|
||||
var e = [];
|
||||
if (this.type != "fragment") {
|
||||
e.push("<", this.type),
|
||||
this.className && e.push(" class='", this.className, "'");
|
||||
var t = [];
|
||||
for (var n in this.style) t.push(n, ":", this.style[n]);
|
||||
t.length && e.push(" style='", t.join(""), "'"), e.push(">");
|
||||
}
|
||||
return (
|
||||
this.textContent && e.push(this.textContent),
|
||||
this.type != "fragment" && e.push("</", this.type, ">"),
|
||||
e.join("")
|
||||
);
|
||||
});
|
||||
var l = {
|
||||
createTextNode: function (e, t) {
|
||||
return a(e);
|
||||
},
|
||||
createElement: function (e) {
|
||||
return new f(e);
|
||||
},
|
||||
createFragment: function () {
|
||||
return new f("fragment");
|
||||
},
|
||||
},
|
||||
c = function () {
|
||||
(this.config = {}), (this.dom = l);
|
||||
};
|
||||
c.prototype = i.prototype;
|
||||
var h = function (e, t, n) {
|
||||
var r = e.className.match(/lang-(\w+)/),
|
||||
i = t.mode || (r && "ace/mode/" + r[1]);
|
||||
if (!i) return !1;
|
||||
var s = t.theme || "ace/theme/textmate",
|
||||
o = "",
|
||||
a = [];
|
||||
if (e.firstElementChild) {
|
||||
var f = 0;
|
||||
for (var l = 0; l < e.childNodes.length; l++) {
|
||||
var c = e.childNodes[l];
|
||||
c.nodeType == 3
|
||||
? ((f += c.data.length), (o += c.data))
|
||||
: a.push(f, c);
|
||||
}
|
||||
} else (o = e.textContent), t.trim && (o = o.trim());
|
||||
h.render(o, i, s, t.firstLineNumber, !t.showGutter, function (t) {
|
||||
u.importCssString(t.css, "ace_highlight"), (e.innerHTML = t.html);
|
||||
var r = e.firstChild.firstChild;
|
||||
for (var i = 0; i < a.length; i += 2) {
|
||||
var s = t.session.doc.indexToPosition(a[i]),
|
||||
o = a[i + 1],
|
||||
f = r.children[s.row];
|
||||
f && f.appendChild(o);
|
||||
}
|
||||
n && n();
|
||||
});
|
||||
};
|
||||
(h.render = function (e, t, n, i, s, u) {
|
||||
function c() {
|
||||
var r = h.renderSync(e, t, n, i, s);
|
||||
return u ? u(r) : r;
|
||||
}
|
||||
var a = 1,
|
||||
f = r.prototype.$modes;
|
||||
typeof n == "string" &&
|
||||
(a++,
|
||||
o.loadModule(["theme", n], function (e) {
|
||||
(n = e), --a || c();
|
||||
}));
|
||||
var l;
|
||||
return (
|
||||
t &&
|
||||
typeof t == "object" &&
|
||||
!t.getTokenizer &&
|
||||
((l = t), (t = l.path)),
|
||||
typeof t == "string" &&
|
||||
(a++,
|
||||
o.loadModule(["mode", t], function (e) {
|
||||
if (!f[t] || l) f[t] = new e.Mode(l);
|
||||
(t = f[t]), --a || c();
|
||||
})),
|
||||
--a || c()
|
||||
);
|
||||
}),
|
||||
(h.renderSync = function (e, t, n, i, o) {
|
||||
i = parseInt(i || 1, 10);
|
||||
var u = new r("");
|
||||
u.setUseWorker(!1), u.setMode(t);
|
||||
var a = new c();
|
||||
a.setSession(u),
|
||||
Object.keys(a.$tabStrings).forEach(function (e) {
|
||||
if (typeof a.$tabStrings[e] == "string") {
|
||||
var t = l.createFragment();
|
||||
(t.textContent = a.$tabStrings[e]), (a.$tabStrings[e] = t);
|
||||
}
|
||||
}),
|
||||
u.setValue(e);
|
||||
var f = u.getLength(),
|
||||
h = l.createElement("div");
|
||||
h.className = n.cssClass;
|
||||
var p = l.createElement("div");
|
||||
(p.className =
|
||||
"ace_static_highlight" + (o ? "" : " ace_show_gutter")),
|
||||
(p.style["counter-reset"] = "ace_line " + (i - 1));
|
||||
for (var d = 0; d < f; d++) {
|
||||
var v = l.createElement("div");
|
||||
v.className = "ace_line";
|
||||
if (!o) {
|
||||
var m = l.createElement("span");
|
||||
(m.className = "ace_gutter ace_gutter-cell"),
|
||||
(m.textContent = ""),
|
||||
v.appendChild(m);
|
||||
}
|
||||
a.$renderLine(v, d, !1), (v.textContent += "\n"), p.appendChild(v);
|
||||
}
|
||||
return (
|
||||
h.appendChild(p),
|
||||
{ css: s + n.cssText, html: h.toString(), session: u }
|
||||
);
|
||||
}),
|
||||
(n.exports = h),
|
||||
(n.exports.highlight = h);
|
||||
},
|
||||
);
|
||||
(function () {
|
||||
window.require(["ace/ext/static_highlight"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
61
vuejs/client/src/assets/script/editor/ext-statusbar.js
Normal file
61
vuejs/client/src/assets/script/editor/ext-statusbar.js
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
define("ace/ext/statusbar", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/lib/dom",
|
||||
"ace/lib/lang",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("../lib/dom"),
|
||||
i = e("../lib/lang"),
|
||||
s = function (e, t) {
|
||||
(this.element = r.createElement("div")),
|
||||
(this.element.className = "ace_status-indicator"),
|
||||
(this.element.style.cssText = "display: inline-block;"),
|
||||
t.appendChild(this.element);
|
||||
var n = i
|
||||
.delayedCall(
|
||||
function () {
|
||||
this.updateStatus(e);
|
||||
}.bind(this),
|
||||
)
|
||||
.schedule.bind(null, 100);
|
||||
e.on("changeStatus", n),
|
||||
e.on("changeSelection", n),
|
||||
e.on("keyboardActivity", n);
|
||||
};
|
||||
(function () {
|
||||
this.updateStatus = function (e) {
|
||||
function n(e, n) {
|
||||
e && t.push(e, n || "|");
|
||||
}
|
||||
var t = [];
|
||||
n(e.keyBinding.getStatusText(e)), e.commands.recording && n("REC");
|
||||
var r = e.selection,
|
||||
i = r.lead;
|
||||
if (!r.isEmpty()) {
|
||||
var s = e.getSelectionRange();
|
||||
n(
|
||||
"(" +
|
||||
(s.end.row - s.start.row) +
|
||||
":" +
|
||||
(s.end.column - s.start.column) +
|
||||
")",
|
||||
" ",
|
||||
);
|
||||
}
|
||||
n(i.row + ":" + i.column, " "),
|
||||
r.rangeCount && n("[" + r.rangeCount + "]", " "),
|
||||
t.pop(),
|
||||
(this.element.textContent = t.join(""));
|
||||
};
|
||||
}).call(s.prototype),
|
||||
(t.StatusBar = s);
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/statusbar"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
362
vuejs/client/src/assets/script/editor/ext-textarea.js
Normal file
362
vuejs/client/src/assets/script/editor/ext-textarea.js
Normal file
|
|
@ -0,0 +1,362 @@
|
|||
define("ace/ext/textarea", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/lib/event",
|
||||
"ace/lib/useragent",
|
||||
"ace/lib/net",
|
||||
"ace/ace",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
function a(e, t) {
|
||||
for (var n in t) e.style[n] = t[n];
|
||||
}
|
||||
function f(e, t) {
|
||||
if (e.type != "textarea") throw new Error("Textarea required!");
|
||||
var n = e.parentNode,
|
||||
i = document.createElement("div"),
|
||||
s = function () {
|
||||
var t = "position:relative;";
|
||||
["margin-top", "margin-left", "margin-right", "margin-bottom"].forEach(
|
||||
function (n) {
|
||||
t += n + ":" + u(e, i, n) + ";";
|
||||
},
|
||||
);
|
||||
var n = u(e, i, "width") || e.clientWidth + "px",
|
||||
r = u(e, i, "height") || e.clientHeight + "px";
|
||||
(t += "height:" + r + ";width:" + n + ";"),
|
||||
(t += "display:inline-block;"),
|
||||
i.setAttribute("style", t);
|
||||
};
|
||||
r.addListener(window, "resize", s), s(), n.insertBefore(i, e.nextSibling);
|
||||
while (n !== document) {
|
||||
if (n.tagName.toUpperCase() === "FORM") {
|
||||
var o = n.onsubmit;
|
||||
n.onsubmit = function (n) {
|
||||
(e.value = t()), o && o.call(this, n);
|
||||
};
|
||||
break;
|
||||
}
|
||||
n = n.parentNode;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
function l(t, n, r) {
|
||||
s.loadScript(t, function () {
|
||||
e([n], r);
|
||||
});
|
||||
}
|
||||
function c(e, t, n, r, i) {
|
||||
function u(e) {
|
||||
return e === "true" || e == 1;
|
||||
}
|
||||
var s = e.getSession(),
|
||||
o = e.renderer;
|
||||
return (
|
||||
(e.setDisplaySettings = function (t) {
|
||||
t == null && (t = n.style.display == "none"),
|
||||
t
|
||||
? ((n.style.display = "block"),
|
||||
n.hideButton.focus(),
|
||||
e.on("focus", function r() {
|
||||
e.removeListener("focus", r), (n.style.display = "none");
|
||||
}))
|
||||
: e.focus();
|
||||
}),
|
||||
(e.$setOption = e.setOption),
|
||||
(e.$getOption = e.getOption),
|
||||
(e.setOption = function (t, n) {
|
||||
switch (t) {
|
||||
case "mode":
|
||||
e.$setOption("mode", "ace/mode/" + n);
|
||||
break;
|
||||
case "theme":
|
||||
e.$setOption("theme", "ace/theme/" + n);
|
||||
break;
|
||||
case "keybindings":
|
||||
switch (n) {
|
||||
case "vim":
|
||||
e.setKeyboardHandler("ace/keyboard/vim");
|
||||
break;
|
||||
case "emacs":
|
||||
e.setKeyboardHandler("ace/keyboard/emacs");
|
||||
break;
|
||||
default:
|
||||
e.setKeyboardHandler(null);
|
||||
}
|
||||
break;
|
||||
case "wrap":
|
||||
case "fontSize":
|
||||
e.$setOption(t, n);
|
||||
break;
|
||||
default:
|
||||
e.$setOption(t, u(n));
|
||||
}
|
||||
}),
|
||||
(e.getOption = function (t) {
|
||||
switch (t) {
|
||||
case "mode":
|
||||
return e.$getOption("mode").substr("ace/mode/".length);
|
||||
case "theme":
|
||||
return e.$getOption("theme").substr("ace/theme/".length);
|
||||
case "keybindings":
|
||||
var n = e.getKeyboardHandler();
|
||||
switch (n && n.$id) {
|
||||
case "ace/keyboard/vim":
|
||||
return "vim";
|
||||
case "ace/keyboard/emacs":
|
||||
return "emacs";
|
||||
default:
|
||||
return "ace";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return e.$getOption(t);
|
||||
}
|
||||
}),
|
||||
e.setOptions(i),
|
||||
e
|
||||
);
|
||||
}
|
||||
function h(e, n, i) {
|
||||
function f(e, t, n, r) {
|
||||
if (!n) {
|
||||
e.push(
|
||||
"<input type='checkbox' title='",
|
||||
t,
|
||||
"' ",
|
||||
r + "" == "true" ? "checked='true'" : "",
|
||||
"'></input>",
|
||||
);
|
||||
return;
|
||||
}
|
||||
e.push("<select title='" + t + "'>");
|
||||
for (var i in n)
|
||||
e.push("<option value='" + i + "' "),
|
||||
r == i && e.push(" selected "),
|
||||
e.push(">", n[i], "</option>");
|
||||
e.push("</select>");
|
||||
}
|
||||
var s = null,
|
||||
o = {
|
||||
mode: "Mode:",
|
||||
wrap: "Soft Wrap:",
|
||||
theme: "Theme:",
|
||||
fontSize: "Font Size:",
|
||||
showGutter: "Display Gutter:",
|
||||
keybindings: "Keyboard",
|
||||
showPrintMargin: "Show Print Margin:",
|
||||
useSoftTabs: "Use Soft Tabs:",
|
||||
showInvisibles: "Show Invisibles",
|
||||
},
|
||||
u = {
|
||||
mode: {
|
||||
text: "Plain",
|
||||
javascript: "JavaScript",
|
||||
xml: "XML",
|
||||
html: "HTML",
|
||||
css: "CSS",
|
||||
scss: "SCSS",
|
||||
python: "Python",
|
||||
php: "PHP",
|
||||
java: "Java",
|
||||
ruby: "Ruby",
|
||||
c_cpp: "C/C++",
|
||||
coffee: "CoffeeScript",
|
||||
json: "json",
|
||||
perl: "Perl",
|
||||
clojure: "Clojure",
|
||||
ocaml: "OCaml",
|
||||
csharp: "C#",
|
||||
haxe: "haXe",
|
||||
svg: "SVG",
|
||||
textile: "Textile",
|
||||
groovy: "Groovy",
|
||||
liquid: "Liquid",
|
||||
Scala: "Scala",
|
||||
},
|
||||
theme: {
|
||||
clouds: "Clouds",
|
||||
clouds_midnight: "Clouds Midnight",
|
||||
cobalt: "Cobalt",
|
||||
crimson_editor: "Crimson Editor",
|
||||
dawn: "Dawn",
|
||||
gob: "Green on Black",
|
||||
eclipse: "Eclipse",
|
||||
idle_fingers: "Idle Fingers",
|
||||
kr_theme: "Kr Theme",
|
||||
merbivore: "Merbivore",
|
||||
merbivore_soft: "Merbivore Soft",
|
||||
mono_industrial: "Mono Industrial",
|
||||
monokai: "Monokai",
|
||||
pastel_on_dark: "Pastel On Dark",
|
||||
solarized_dark: "Solarized Dark",
|
||||
solarized_light: "Solarized Light",
|
||||
textmate: "Textmate",
|
||||
twilight: "Twilight",
|
||||
vibrant_ink: "Vibrant Ink",
|
||||
},
|
||||
showGutter: s,
|
||||
fontSize: {
|
||||
"10px": "10px",
|
||||
"11px": "11px",
|
||||
"12px": "12px",
|
||||
"14px": "14px",
|
||||
"16px": "16px",
|
||||
},
|
||||
wrap: { off: "Off", 40: "40", 80: "80", free: "Free" },
|
||||
keybindings: { ace: "ace", vim: "vim", emacs: "emacs" },
|
||||
showPrintMargin: s,
|
||||
useSoftTabs: s,
|
||||
showInvisibles: s,
|
||||
},
|
||||
a = [];
|
||||
a.push("<table><tr><th>Setting</th><th>Value</th></tr>");
|
||||
for (var l in t.defaultOptions)
|
||||
a.push("<tr><td>", o[l], "</td>"),
|
||||
a.push("<td>"),
|
||||
f(a, l, u[l], i.getOption(l)),
|
||||
a.push("</td></tr>");
|
||||
a.push("</table>"), (e.innerHTML = a.join(""));
|
||||
var c = function (e) {
|
||||
var t = e.currentTarget;
|
||||
i.setOption(t.title, t.value);
|
||||
},
|
||||
h = function (e) {
|
||||
var t = e.currentTarget;
|
||||
i.setOption(t.title, t.checked);
|
||||
},
|
||||
p = e.getElementsByTagName("select");
|
||||
for (var d = 0; d < p.length; d++) p[d].onchange = c;
|
||||
var v = e.getElementsByTagName("input");
|
||||
for (var d = 0; d < v.length; d++) v[d].onclick = h;
|
||||
var m = document.createElement("input");
|
||||
(m.type = "button"),
|
||||
(m.value = "Hide"),
|
||||
r.addListener(m, "click", function () {
|
||||
i.setDisplaySettings(!1);
|
||||
}),
|
||||
e.appendChild(m),
|
||||
(e.hideButton = m);
|
||||
}
|
||||
var r = e("../lib/event"),
|
||||
i = e("../lib/useragent"),
|
||||
s = e("../lib/net"),
|
||||
o = e("../ace");
|
||||
n.exports = t = o;
|
||||
var u = function (e, t, n) {
|
||||
var r = e.style[n];
|
||||
r ||
|
||||
(window.getComputedStyle
|
||||
? (r = window.getComputedStyle(e, "").getPropertyValue(n))
|
||||
: (r = e.currentStyle[n]));
|
||||
if (!r || r == "auto" || r == "intrinsic") r = t.style[n];
|
||||
return r;
|
||||
};
|
||||
(t.transformTextarea = function (e, n) {
|
||||
var s = e.autofocus || document.activeElement == e,
|
||||
u,
|
||||
l = f(e, function () {
|
||||
return u.getValue();
|
||||
});
|
||||
(e.style.display = "none"), (l.style.background = "white");
|
||||
var p = document.createElement("div");
|
||||
a(p, {
|
||||
top: "0px",
|
||||
left: "0px",
|
||||
right: "0px",
|
||||
bottom: "0px",
|
||||
border: "1px solid gray",
|
||||
position: "absolute",
|
||||
}),
|
||||
l.appendChild(p);
|
||||
var d = document.createElement("div");
|
||||
a(d, {
|
||||
position: "absolute",
|
||||
right: "0px",
|
||||
bottom: "0px",
|
||||
cursor: "nw-resize",
|
||||
border: "solid 9px",
|
||||
borderColor: "lightblue gray gray #ceade6",
|
||||
zIndex: 101,
|
||||
});
|
||||
var v = document.createElement("div"),
|
||||
m = {
|
||||
top: "0px",
|
||||
left: "20%",
|
||||
right: "0px",
|
||||
bottom: "0px",
|
||||
position: "absolute",
|
||||
padding: "5px",
|
||||
zIndex: 100,
|
||||
color: "white",
|
||||
display: "none",
|
||||
overflow: "auto",
|
||||
fontSize: "14px",
|
||||
boxShadow: "-5px 2px 3px gray",
|
||||
};
|
||||
i.isOldIE
|
||||
? (m.backgroundColor = "#333")
|
||||
: (m.backgroundColor = "rgba(0, 0, 0, 0.6)"),
|
||||
a(v, m),
|
||||
l.appendChild(v),
|
||||
(n = n || t.defaultOptions);
|
||||
var g = o.edit(p);
|
||||
(u = g.getSession()),
|
||||
u.setValue(e.value || e.innerHTML),
|
||||
s && g.focus(),
|
||||
l.appendChild(d),
|
||||
c(g, p, v, o, n),
|
||||
h(v, d, g);
|
||||
var y = "";
|
||||
return (
|
||||
r.addListener(d, "mousemove", function (e) {
|
||||
var t = this.getBoundingClientRect(),
|
||||
n = e.clientX - t.left,
|
||||
r = e.clientY - t.top;
|
||||
n + r < (t.width + t.height) / 2
|
||||
? ((this.style.cursor = "pointer"), (y = "toggle"))
|
||||
: ((y = "resize"), (this.style.cursor = "nw-resize"));
|
||||
}),
|
||||
r.addListener(d, "mousedown", function (e) {
|
||||
e.preventDefault();
|
||||
if (y == "toggle") {
|
||||
g.setDisplaySettings();
|
||||
return;
|
||||
}
|
||||
l.style.zIndex = 1e5;
|
||||
var t = l.getBoundingClientRect(),
|
||||
n = t.width + t.left - e.clientX,
|
||||
i = t.height + t.top - e.clientY;
|
||||
r.capture(
|
||||
d,
|
||||
function (e) {
|
||||
(l.style.width = e.clientX - t.left + n + "px"),
|
||||
(l.style.height = e.clientY - t.top + i + "px"),
|
||||
g.resize();
|
||||
},
|
||||
function () {},
|
||||
);
|
||||
}),
|
||||
g
|
||||
);
|
||||
}),
|
||||
(t.defaultOptions = {
|
||||
mode: "javascript",
|
||||
theme: "textmate",
|
||||
wrap: "off",
|
||||
fontSize: "12px",
|
||||
showGutter: "false",
|
||||
keybindings: "ace",
|
||||
showPrintMargin: "false",
|
||||
useSoftTabs: "true",
|
||||
showInvisibles: "false",
|
||||
});
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/textarea"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
66
vuejs/client/src/assets/script/editor/ext-themelist.js
Normal file
66
vuejs/client/src/assets/script/editor/ext-themelist.js
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
define("ace/ext/themelist", ["require", "exports", "module"], function (
|
||||
e,
|
||||
t,
|
||||
n,
|
||||
) {
|
||||
"use strict";
|
||||
var r = [
|
||||
["Chrome"],
|
||||
["Clouds"],
|
||||
["Crimson Editor"],
|
||||
["Dawn"],
|
||||
["Dreamweaver"],
|
||||
["Eclipse"],
|
||||
["GitHub"],
|
||||
["IPlastic"],
|
||||
["Solarized Light"],
|
||||
["TextMate"],
|
||||
["Tomorrow"],
|
||||
["XCode"],
|
||||
["Kuroir"],
|
||||
["KatzenMilch"],
|
||||
["SQL Server", "sqlserver", "light"],
|
||||
["Ambiance", "ambiance", "dark"],
|
||||
["Chaos", "chaos", "dark"],
|
||||
["Clouds Midnight", "clouds_midnight", "dark"],
|
||||
["Dracula", "", "dark"],
|
||||
["Cobalt", "cobalt", "dark"],
|
||||
["Gruvbox", "gruvbox", "dark"],
|
||||
["Green on Black", "gob", "dark"],
|
||||
["idle Fingers", "idle_fingers", "dark"],
|
||||
["krTheme", "kr_theme", "dark"],
|
||||
["Merbivore", "merbivore", "dark"],
|
||||
["Merbivore Soft", "merbivore_soft", "dark"],
|
||||
["Mono Industrial", "mono_industrial", "dark"],
|
||||
["Monokai", "monokai", "dark"],
|
||||
["Nord Dark", "nord_dark", "dark"],
|
||||
["One Dark", "one_dark", "dark"],
|
||||
["Pastel on dark", "pastel_on_dark", "dark"],
|
||||
["Solarized Dark", "solarized_dark", "dark"],
|
||||
["Terminal", "terminal", "dark"],
|
||||
["Tomorrow Night", "tomorrow_night", "dark"],
|
||||
["Tomorrow Night Blue", "tomorrow_night_blue", "dark"],
|
||||
["Tomorrow Night Bright", "tomorrow_night_bright", "dark"],
|
||||
["Tomorrow Night 80s", "tomorrow_night_eighties", "dark"],
|
||||
["Twilight", "twilight", "dark"],
|
||||
["Vibrant Ink", "vibrant_ink", "dark"],
|
||||
];
|
||||
(t.themesByName = {}),
|
||||
(t.themes = r.map(function (e) {
|
||||
var n = e[1] || e[0].replace(/ /g, "_").toLowerCase(),
|
||||
r = {
|
||||
caption: e[0],
|
||||
theme: "ace/theme/" + n,
|
||||
isDark: e[2] == "dark",
|
||||
name: n,
|
||||
};
|
||||
return (t.themesByName[n] = r), r;
|
||||
}));
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/themelist"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
171
vuejs/client/src/assets/script/editor/ext-whitespace.js
Normal file
171
vuejs/client/src/assets/script/editor/ext-whitespace.js
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
define("ace/ext/whitespace", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/lib/lang",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("../lib/lang");
|
||||
(t.$detectIndentation = function (e, t) {
|
||||
function c(e) {
|
||||
var t = 0;
|
||||
for (var r = e; r < n.length; r += e) t += n[r] || 0;
|
||||
return t;
|
||||
}
|
||||
var n = [],
|
||||
r = [],
|
||||
i = 0,
|
||||
s = 0,
|
||||
o = Math.min(e.length, 1e3);
|
||||
for (var u = 0; u < o; u++) {
|
||||
var a = e[u];
|
||||
if (!/^\s*[^*+\-\s]/.test(a)) continue;
|
||||
if (a[0] == " ") i++, (s = -Number.MAX_VALUE);
|
||||
else {
|
||||
var f = a.match(/^ */)[0].length;
|
||||
if (f && a[f] != " ") {
|
||||
var l = f - s;
|
||||
l > 0 && !(s % l) && !(f % l) && (r[l] = (r[l] || 0) + 1),
|
||||
(n[f] = (n[f] || 0) + 1);
|
||||
}
|
||||
s = f;
|
||||
}
|
||||
while (u < o && a[a.length - 1] == "\\") a = e[u++];
|
||||
}
|
||||
var h = r.reduce(function (e, t) {
|
||||
return e + t;
|
||||
}, 0),
|
||||
p = { score: 0, length: 0 },
|
||||
d = 0;
|
||||
for (var u = 1; u < 12; u++) {
|
||||
var v = c(u);
|
||||
u == 1
|
||||
? ((d = v), (v = n[1] ? 0.9 : 0.8), n.length || (v = 0))
|
||||
: (v /= d),
|
||||
r[u] && (v += r[u] / h),
|
||||
v > p.score && (p = { score: v, length: u });
|
||||
}
|
||||
if (p.score && p.score > 1.4) var m = p.length;
|
||||
if (i > d + 1) {
|
||||
if (m == 1 || d < i / 4 || p.score < 1.8) m = undefined;
|
||||
return { ch: " ", length: m };
|
||||
}
|
||||
if (d > i + 1) return { ch: " ", length: m };
|
||||
}),
|
||||
(t.detectIndentation = function (e) {
|
||||
var n = e.getLines(0, 1e3),
|
||||
r = t.$detectIndentation(n) || {};
|
||||
return (
|
||||
r.ch && e.setUseSoftTabs(r.ch == " "),
|
||||
r.length && e.setTabSize(r.length),
|
||||
r
|
||||
);
|
||||
}),
|
||||
(t.trimTrailingSpace = function (e, t) {
|
||||
var n = e.getDocument(),
|
||||
r = n.getAllLines(),
|
||||
i = t && t.trimEmpty ? -1 : 0,
|
||||
s = [],
|
||||
o = -1;
|
||||
t &&
|
||||
t.keepCursorPosition &&
|
||||
(e.selection.rangeCount
|
||||
? e.selection.rangeList.ranges.forEach(function (e, t, n) {
|
||||
var r = n[t + 1];
|
||||
if (r && r.cursor.row == e.cursor.row) return;
|
||||
s.push(e.cursor);
|
||||
})
|
||||
: s.push(e.selection.getCursor()),
|
||||
(o = 0));
|
||||
var u = s[o] && s[o].row;
|
||||
for (var a = 0, f = r.length; a < f; a++) {
|
||||
var l = r[a],
|
||||
c = l.search(/\s+$/);
|
||||
a == u &&
|
||||
(c < s[o].column && c > i && (c = s[o].column),
|
||||
o++,
|
||||
(u = s[o] ? s[o].row : -1)),
|
||||
c > i && n.removeInLine(a, c, l.length);
|
||||
}
|
||||
}),
|
||||
(t.convertIndentation = function (e, t, n) {
|
||||
var i = e.getTabString()[0],
|
||||
s = e.getTabSize();
|
||||
n || (n = s), t || (t = i);
|
||||
var o = t == " " ? t : r.stringRepeat(t, n),
|
||||
u = e.doc,
|
||||
a = u.getAllLines(),
|
||||
f = {},
|
||||
l = {};
|
||||
for (var c = 0, h = a.length; c < h; c++) {
|
||||
var p = a[c],
|
||||
d = p.match(/^\s*/)[0];
|
||||
if (d) {
|
||||
var v = e.$getStringScreenWidth(d)[0],
|
||||
m = Math.floor(v / s),
|
||||
g = v % s,
|
||||
y = f[m] || (f[m] = r.stringRepeat(o, m));
|
||||
(y += l[g] || (l[g] = r.stringRepeat(" ", g))),
|
||||
y != d &&
|
||||
(u.removeInLine(c, 0, d.length),
|
||||
u.insertInLine({ row: c, column: 0 }, y));
|
||||
}
|
||||
}
|
||||
e.setTabSize(n), e.setUseSoftTabs(t == " ");
|
||||
}),
|
||||
(t.$parseStringArg = function (e) {
|
||||
var t = {};
|
||||
/t/.test(e) ? (t.ch = " ") : /s/.test(e) && (t.ch = " ");
|
||||
var n = e.match(/\d+/);
|
||||
return n && (t.length = parseInt(n[0], 10)), t;
|
||||
}),
|
||||
(t.$parseArg = function (e) {
|
||||
return e
|
||||
? typeof e == "string"
|
||||
? t.$parseStringArg(e)
|
||||
: typeof e.text == "string"
|
||||
? t.$parseStringArg(e.text)
|
||||
: e
|
||||
: {};
|
||||
}),
|
||||
(t.commands = [
|
||||
{
|
||||
name: "detectIndentation",
|
||||
description: "Detect indentation from content",
|
||||
exec: function (e) {
|
||||
t.detectIndentation(e.session);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "trimTrailingSpace",
|
||||
description: "Trim trailing whitespace",
|
||||
exec: function (e, n) {
|
||||
t.trimTrailingSpace(e.session, n);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "convertIndentation",
|
||||
description: "Convert indentation to ...",
|
||||
exec: function (e, n) {
|
||||
var r = t.$parseArg(n);
|
||||
t.convertIndentation(e.session, r.ch, r.length);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "setIndentation",
|
||||
description: "Set indentation",
|
||||
exec: function (e, n) {
|
||||
var r = t.$parseArg(n);
|
||||
r.length && e.session.setTabSize(r.length),
|
||||
r.ch && e.session.setUseSoftTabs(r.ch == " ");
|
||||
},
|
||||
},
|
||||
]);
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/ext/whitespace"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
1140
vuejs/client/src/assets/script/editor/keybinding-emacs.js
Normal file
1140
vuejs/client/src/assets/script/editor/keybinding-emacs.js
Normal file
File diff suppressed because it is too large
Load diff
421
vuejs/client/src/assets/script/editor/keybinding-sublime.js
Normal file
421
vuejs/client/src/assets/script/editor/keybinding-sublime.js
Normal file
|
|
@ -0,0 +1,421 @@
|
|||
define("ace/keyboard/sublime", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/keyboard/hash_handler",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
function i(e, t, n) {
|
||||
function f(e) {
|
||||
return e
|
||||
? /\s/.test(e)
|
||||
? "s"
|
||||
: e == "_"
|
||||
? "_"
|
||||
: e.toUpperCase() == e && e.toLowerCase() != e
|
||||
? "W"
|
||||
: e.toUpperCase() != e && e.toLowerCase() == e
|
||||
? "w"
|
||||
: "o"
|
||||
: "-";
|
||||
}
|
||||
var r = e.selection,
|
||||
i = r.lead.row,
|
||||
s = r.lead.column,
|
||||
o = e.session.getLine(i);
|
||||
if (!o[s + t]) {
|
||||
var u =
|
||||
(n ? "selectWord" : "moveCursorShortWord") +
|
||||
(t == 1 ? "Right" : "Left");
|
||||
return e.selection[u]();
|
||||
}
|
||||
t == -1 && s--;
|
||||
while (o[s]) {
|
||||
var a = f(o[s]) + f(o[s + t]);
|
||||
s += t;
|
||||
if (t == 1) {
|
||||
if (a == "WW" && f(o[s + 1]) == "w") break;
|
||||
} else {
|
||||
if (a == "wW") {
|
||||
if (f(o[s - 1]) == "W") {
|
||||
s -= 1;
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (a == "Ww") break;
|
||||
}
|
||||
if (/w[s_oW]|_[sWo]|o[s_wW]|s[W]|W[so]/.test(a)) break;
|
||||
}
|
||||
t == -1 && s++,
|
||||
n ? e.selection.moveCursorTo(i, s) : e.selection.moveTo(i, s);
|
||||
}
|
||||
var r = e("../keyboard/hash_handler").HashHandler;
|
||||
(t.handler = new r()),
|
||||
t.handler.addCommands([
|
||||
{
|
||||
name: "find_all_under",
|
||||
exec: function (e) {
|
||||
e.selection.isEmpty() && e.selection.selectWord(), e.findAll();
|
||||
},
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "find_under",
|
||||
exec: function (e) {
|
||||
e.selection.isEmpty() && e.selection.selectWord(), e.findNext();
|
||||
},
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "find_under_prev",
|
||||
exec: function (e) {
|
||||
e.selection.isEmpty() && e.selection.selectWord(), e.findPrevious();
|
||||
},
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "find_under_expand",
|
||||
exec: function (e) {
|
||||
e.selectMore(1, !1, !0);
|
||||
},
|
||||
scrollIntoView: "animate",
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "find_under_expand_skip",
|
||||
exec: function (e) {
|
||||
e.selectMore(1, !0, !0);
|
||||
},
|
||||
scrollIntoView: "animate",
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "delete_to_hard_bol",
|
||||
exec: function (e) {
|
||||
var t = e.selection.getCursor();
|
||||
e.session.remove({ start: { row: t.row, column: 0 }, end: t });
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
},
|
||||
{
|
||||
name: "delete_to_hard_eol",
|
||||
exec: function (e) {
|
||||
var t = e.selection.getCursor();
|
||||
e.session.remove({ start: t, end: { row: t.row, column: Infinity } });
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
},
|
||||
{
|
||||
name: "moveToWordStartLeft",
|
||||
exec: function (e) {
|
||||
e.selection.moveCursorLongWordLeft(), e.clearSelection();
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
},
|
||||
{
|
||||
name: "moveToWordEndRight",
|
||||
exec: function (e) {
|
||||
e.selection.moveCursorLongWordRight(), e.clearSelection();
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
},
|
||||
{
|
||||
name: "selectToWordStartLeft",
|
||||
exec: function (e) {
|
||||
var t = e.selection;
|
||||
t.$moveSelection(t.moveCursorLongWordLeft);
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
},
|
||||
{
|
||||
name: "selectToWordEndRight",
|
||||
exec: function (e) {
|
||||
var t = e.selection;
|
||||
t.$moveSelection(t.moveCursorLongWordRight);
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
},
|
||||
{
|
||||
name: "selectSubWordRight",
|
||||
exec: function (e) {
|
||||
i(e, 1, !0);
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "selectSubWordLeft",
|
||||
exec: function (e) {
|
||||
i(e, -1, !0);
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "moveSubWordRight",
|
||||
exec: function (e) {
|
||||
i(e, 1);
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "moveSubWordLeft",
|
||||
exec: function (e) {
|
||||
i(e, -1);
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: !0,
|
||||
},
|
||||
]),
|
||||
[
|
||||
{
|
||||
bindKey: {
|
||||
mac: "cmd-k cmd-backspace|cmd-backspace",
|
||||
win: "ctrl-shift-backspace|ctrl-k ctrl-backspace",
|
||||
},
|
||||
name: "removetolinestarthard",
|
||||
},
|
||||
{
|
||||
bindKey: {
|
||||
mac: "cmd-k cmd-k|cmd-delete|ctrl-k",
|
||||
win: "ctrl-shift-delete|ctrl-k ctrl-k",
|
||||
},
|
||||
name: "removetolineendhard",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-shift-d", win: "ctrl-shift-d" },
|
||||
name: "duplicateSelection",
|
||||
},
|
||||
{ bindKey: { mac: "cmd-l", win: "ctrl-l" }, name: "expandtoline" },
|
||||
{
|
||||
bindKey: { mac: "cmd-shift-a", win: "ctrl-shift-a" },
|
||||
name: "expandSelection",
|
||||
args: { to: "tag" },
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-shift-j", win: "ctrl-shift-j" },
|
||||
name: "expandSelection",
|
||||
args: { to: "indentation" },
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "ctrl-shift-m", win: "ctrl-shift-m" },
|
||||
name: "expandSelection",
|
||||
args: { to: "brackets" },
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-shift-space", win: "ctrl-shift-space" },
|
||||
name: "expandSelection",
|
||||
args: { to: "scope" },
|
||||
},
|
||||
{ bindKey: { mac: "ctrl-cmd-g", win: "alt-f3" }, name: "find_all_under" },
|
||||
{ bindKey: { mac: "alt-cmd-g", win: "ctrl-f3" }, name: "find_under" },
|
||||
{
|
||||
bindKey: { mac: "shift-alt-cmd-g", win: "ctrl-shift-f3" },
|
||||
name: "find_under_prev",
|
||||
},
|
||||
{ bindKey: { mac: "cmd-g", win: "f3" }, name: "findnext" },
|
||||
{
|
||||
bindKey: { mac: "shift-cmd-g", win: "shift-f3" },
|
||||
name: "findprevious",
|
||||
},
|
||||
{ bindKey: { mac: "cmd-d", win: "ctrl-d" }, name: "find_under_expand" },
|
||||
{
|
||||
bindKey: { mac: "cmd-k cmd-d", win: "ctrl-k ctrl-d" },
|
||||
name: "find_under_expand_skip",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-alt-[", win: "ctrl-shift-[" },
|
||||
name: "toggleFoldWidget",
|
||||
},
|
||||
{ bindKey: { mac: "cmd-alt-]", win: "ctrl-shift-]" }, name: "unfold" },
|
||||
{
|
||||
bindKey: {
|
||||
mac: "cmd-k cmd-0|cmd-k cmd-j",
|
||||
win: "ctrl-k ctrl-0|ctrl-k ctrl-j",
|
||||
},
|
||||
name: "unfoldall",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-k cmd-1", win: "ctrl-k ctrl-1" },
|
||||
name: "foldOther",
|
||||
args: { level: 1 },
|
||||
},
|
||||
{
|
||||
bindKey: { win: "ctrl-left", mac: "alt-left" },
|
||||
name: "moveToWordStartLeft",
|
||||
},
|
||||
{
|
||||
bindKey: { win: "ctrl-right", mac: "alt-right" },
|
||||
name: "moveToWordEndRight",
|
||||
},
|
||||
{
|
||||
bindKey: { win: "ctrl-shift-left", mac: "alt-shift-left" },
|
||||
name: "selectToWordStartLeft",
|
||||
},
|
||||
{
|
||||
bindKey: { win: "ctrl-shift-right", mac: "alt-shift-right" },
|
||||
name: "selectToWordEndRight",
|
||||
},
|
||||
{
|
||||
bindKey: {
|
||||
mac: "ctrl-alt-shift-right|ctrl-shift-right",
|
||||
win: "alt-shift-right",
|
||||
},
|
||||
name: "selectSubWordRight",
|
||||
},
|
||||
{
|
||||
bindKey: {
|
||||
mac: "ctrl-alt-shift-left|ctrl-shift-left",
|
||||
win: "alt-shift-left",
|
||||
},
|
||||
name: "selectSubWordLeft",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "ctrl-alt-right|ctrl-right", win: "alt-right" },
|
||||
name: "moveSubWordRight",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "ctrl-alt-left|ctrl-left", win: "alt-left" },
|
||||
name: "moveSubWordLeft",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "ctrl-m", win: "ctrl-m" },
|
||||
name: "jumptomatching",
|
||||
args: { to: "brackets" },
|
||||
},
|
||||
{ bindKey: { mac: "ctrl-f6", win: "ctrl-f6" }, name: "goToNextError" },
|
||||
{
|
||||
bindKey: { mac: "ctrl-shift-f6", win: "ctrl-shift-f6" },
|
||||
name: "goToPreviousError",
|
||||
},
|
||||
{ bindKey: { mac: "ctrl-o" }, name: "splitline" },
|
||||
{
|
||||
bindKey: { mac: "ctrl-shift-w", win: "alt-shift-w" },
|
||||
name: "surrowndWithTag",
|
||||
},
|
||||
{ bindKey: { mac: "cmd-alt-.", win: "alt-." }, name: "close_tag" },
|
||||
{ bindKey: { mac: "cmd-j", win: "ctrl-j" }, name: "joinlines" },
|
||||
{ bindKey: { mac: "ctrl--", win: "alt--" }, name: "jumpBack" },
|
||||
{
|
||||
bindKey: { mac: "ctrl-shift--", win: "alt-shift--" },
|
||||
name: "jumpForward",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-k cmd-l", win: "ctrl-k ctrl-l" },
|
||||
name: "tolowercase",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-k cmd-u", win: "ctrl-k ctrl-u" },
|
||||
name: "touppercase",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-shift-v", win: "ctrl-shift-v" },
|
||||
name: "paste_and_indent",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-k cmd-v|cmd-alt-v", win: "ctrl-k ctrl-v" },
|
||||
name: "paste_from_history",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-shift-enter", win: "ctrl-shift-enter" },
|
||||
name: "addLineBefore",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-enter", win: "ctrl-enter" },
|
||||
name: "addLineAfter",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "ctrl-shift-k", win: "ctrl-shift-k" },
|
||||
name: "removeline",
|
||||
},
|
||||
{ bindKey: { mac: "ctrl-alt-up", win: "ctrl-up" }, name: "scrollup" },
|
||||
{
|
||||
bindKey: { mac: "ctrl-alt-down", win: "ctrl-down" },
|
||||
name: "scrolldown",
|
||||
},
|
||||
{ bindKey: { mac: "cmd-a", win: "ctrl-a" }, name: "selectall" },
|
||||
{
|
||||
bindKey: {
|
||||
linux: "alt-shift-down",
|
||||
mac: "ctrl-shift-down",
|
||||
win: "ctrl-alt-down",
|
||||
},
|
||||
name: "addCursorBelow",
|
||||
},
|
||||
{
|
||||
bindKey: {
|
||||
linux: "alt-shift-up",
|
||||
mac: "ctrl-shift-up",
|
||||
win: "ctrl-alt-up",
|
||||
},
|
||||
name: "addCursorAbove",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-k cmd-c|ctrl-l", win: "ctrl-k ctrl-c" },
|
||||
name: "centerselection",
|
||||
},
|
||||
{ bindKey: { mac: "f5", win: "f9" }, name: "sortlines" },
|
||||
{
|
||||
bindKey: { mac: "ctrl-f5", win: "ctrl-f9" },
|
||||
name: "sortlines",
|
||||
args: { caseSensitive: !0 },
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "cmd-shift-l", win: "ctrl-shift-l" },
|
||||
name: "splitSelectionIntoLines",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "ctrl-cmd-down", win: "ctrl-shift-down" },
|
||||
name: "movelinesdown",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "ctrl-cmd-up", win: "ctrl-shift-up" },
|
||||
name: "movelinesup",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "alt-down", win: "alt-down" },
|
||||
name: "modifyNumberDown",
|
||||
},
|
||||
{ bindKey: { mac: "alt-up", win: "alt-up" }, name: "modifyNumberUp" },
|
||||
{ bindKey: { mac: "cmd-/", win: "ctrl-/" }, name: "togglecomment" },
|
||||
{
|
||||
bindKey: { mac: "cmd-alt-/", win: "ctrl-shift-/" },
|
||||
name: "toggleBlockComment",
|
||||
},
|
||||
{
|
||||
bindKey: { linux: "ctrl-alt-q", mac: "ctrl-q", win: "ctrl-q" },
|
||||
name: "togglerecording",
|
||||
},
|
||||
{
|
||||
bindKey: {
|
||||
linux: "ctrl-alt-shift-q",
|
||||
mac: "ctrl-shift-q",
|
||||
win: "ctrl-shift-q",
|
||||
},
|
||||
name: "replaymacro",
|
||||
},
|
||||
{ bindKey: { mac: "ctrl-t", win: "ctrl-t" }, name: "transpose" },
|
||||
].forEach(function (e) {
|
||||
var n = t.handler.commands[e.name];
|
||||
n && (n.bindKey = e.bindKey), t.handler.bindKey(e.bindKey, n || e.name);
|
||||
});
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/keyboard/sublime"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
6184
vuejs/client/src/assets/script/editor/keybinding-vim.js
Normal file
6184
vuejs/client/src/assets/script/editor/keybinding-vim.js
Normal file
File diff suppressed because it is too large
Load diff
293
vuejs/client/src/assets/script/editor/keybinding-vscode.js
Normal file
293
vuejs/client/src/assets/script/editor/keybinding-vscode.js
Normal file
|
|
@ -0,0 +1,293 @@
|
|||
define("ace/keyboard/vscode", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/keyboard/hash_handler",
|
||||
"ace/config",
|
||||
], function (e, t, n) {
|
||||
"use strict";
|
||||
var r = e("../keyboard/hash_handler").HashHandler,
|
||||
i = e("../config");
|
||||
(t.handler = new r()),
|
||||
(t.handler.$id = "ace/keyboard/vscode"),
|
||||
t.handler.addCommands([
|
||||
{
|
||||
name: "toggleWordWrap",
|
||||
exec: function (e) {
|
||||
var t = e.session.getUseWrapMode();
|
||||
e.session.setUseWrapMode(!t);
|
||||
},
|
||||
readOnly: !0,
|
||||
},
|
||||
{
|
||||
name: "navigateToLastEditLocation",
|
||||
exec: function (e) {
|
||||
var t = e.session.getUndoManager().$lastDelta,
|
||||
n = t.action == "remove" ? t.start : t.end;
|
||||
e.moveCursorTo(n.row, n.column), e.clearSelection();
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "replaceAll",
|
||||
exec: function (e) {
|
||||
e.searchBox
|
||||
? e.searchBox.active === !0 &&
|
||||
e.searchBox.replaceOption.checked === !0 &&
|
||||
e.searchBox.replaceAll()
|
||||
: i.loadModule("ace/ext/searchbox", function (t) {
|
||||
t.Search(e, !0);
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "replaceOne",
|
||||
exec: function (e) {
|
||||
e.searchBox
|
||||
? e.searchBox.active === !0 &&
|
||||
e.searchBox.replaceOption.checked === !0 &&
|
||||
e.searchBox.replace()
|
||||
: i.loadModule("ace/ext/searchbox", function (t) {
|
||||
t.Search(e, !0);
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "selectAllMatches",
|
||||
exec: function (e) {
|
||||
e.searchBox
|
||||
? e.searchBox.active === !0 && e.searchBox.findAll()
|
||||
: i.loadModule("ace/ext/searchbox", function (t) {
|
||||
t.Search(e, !1);
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "toggleFindCaseSensitive",
|
||||
exec: function (e) {
|
||||
i.loadModule("ace/ext/searchbox", function (t) {
|
||||
t.Search(e, !1);
|
||||
var n = e.searchBox;
|
||||
(n.caseSensitiveOption.checked = !n.caseSensitiveOption.checked),
|
||||
n.$syncOptions();
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "toggleFindInSelection",
|
||||
exec: function (e) {
|
||||
i.loadModule("ace/ext/searchbox", function (t) {
|
||||
t.Search(e, !1);
|
||||
var n = e.searchBox;
|
||||
(n.searchOption.checked = !n.searchRange),
|
||||
n.setSearchRange(
|
||||
n.searchOption.checked && n.editor.getSelectionRange(),
|
||||
),
|
||||
n.$syncOptions();
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "toggleFindRegex",
|
||||
exec: function (e) {
|
||||
i.loadModule("ace/ext/searchbox", function (t) {
|
||||
t.Search(e, !1);
|
||||
var n = e.searchBox;
|
||||
(n.regExpOption.checked = !n.regExpOption.checked),
|
||||
n.$syncOptions();
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "toggleFindWholeWord",
|
||||
exec: function (e) {
|
||||
i.loadModule("ace/ext/searchbox", function (t) {
|
||||
t.Search(e, !1);
|
||||
var n = e.searchBox;
|
||||
(n.wholeWordOption.checked = !n.wholeWordOption.checked),
|
||||
n.$syncOptions();
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "removeSecondaryCursors",
|
||||
exec: function (e) {
|
||||
var t = e.selection.ranges;
|
||||
t && t.length > 1
|
||||
? e.selection.toSingleRange(t[t.length - 1])
|
||||
: e.selection.clearSelection();
|
||||
},
|
||||
},
|
||||
]),
|
||||
[
|
||||
{ bindKey: { mac: "Ctrl-G", win: "Ctrl-G" }, name: "gotoline" },
|
||||
{
|
||||
bindKey: {
|
||||
mac: "Command-Shift-L|Command-F2",
|
||||
win: "Ctrl-Shift-L|Ctrl-F2",
|
||||
},
|
||||
name: "findAll",
|
||||
},
|
||||
{
|
||||
bindKey: {
|
||||
mac: "Shift-F8|Shift-Option-F8",
|
||||
win: "Shift-F8|Shift-Alt-F8",
|
||||
},
|
||||
name: "goToPreviousError",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "F8|Option-F8", win: "F8|Alt-F8" },
|
||||
name: "goToNextError",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-Shift-P|F1", win: "Ctrl-Shift-P|F1" },
|
||||
name: "openCommandPallete",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-K|Command-S", win: "Ctrl-K|Ctrl-S" },
|
||||
name: "showKeyboardShortcuts",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Shift-Option-Up", win: "Alt-Shift-Up" },
|
||||
name: "copylinesup",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Shift-Option-Down", win: "Alt-Shift-Down" },
|
||||
name: "copylinesdown",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-Shift-K", win: "Ctrl-Shift-K" },
|
||||
name: "removeline",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-Enter", win: "Ctrl-Enter" },
|
||||
name: "addLineAfter",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-Shift-Enter", win: "Ctrl-Shift-Enter" },
|
||||
name: "addLineBefore",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-Shift-\\", win: "Ctrl-Shift-\\" },
|
||||
name: "jumptomatching",
|
||||
},
|
||||
{ bindKey: { mac: "Command-]", win: "Ctrl-]" }, name: "blockindent" },
|
||||
{ bindKey: { mac: "Command-[", win: "Ctrl-[" }, name: "blockoutdent" },
|
||||
{
|
||||
bindKey: { mac: "Ctrl-PageDown", win: "Alt-PageDown" },
|
||||
name: "pagedown",
|
||||
},
|
||||
{ bindKey: { mac: "Ctrl-PageUp", win: "Alt-PageUp" }, name: "pageup" },
|
||||
{
|
||||
bindKey: { mac: "Shift-Option-A", win: "Shift-Alt-A" },
|
||||
name: "toggleBlockComment",
|
||||
},
|
||||
{ bindKey: { mac: "Option-Z", win: "Alt-Z" }, name: "toggleWordWrap" },
|
||||
{
|
||||
bindKey: { mac: "Command-G", win: "F3|Ctrl-K Ctrl-D" },
|
||||
name: "findnext",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-Shift-G", win: "Shift-F3" },
|
||||
name: "findprevious",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Option-Enter", win: "Alt-Enter" },
|
||||
name: "selectAllMatches",
|
||||
},
|
||||
{ bindKey: { mac: "Command-D", win: "Ctrl-D" }, name: "selectMoreAfter" },
|
||||
{
|
||||
bindKey: { mac: "Command-K Command-D", win: "Ctrl-K Ctrl-D" },
|
||||
name: "selectOrFindNext",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Shift-Option-I", win: "Shift-Alt-I" },
|
||||
name: "splitSelectionIntoLines",
|
||||
},
|
||||
{ bindKey: { mac: "Command-K M", win: "Ctrl-K M" }, name: "modeSelect" },
|
||||
{
|
||||
bindKey: { mac: "Command-Option-[", win: "Ctrl-Shift-[" },
|
||||
name: "toggleFoldWidget",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-Option-]", win: "Ctrl-Shift-]" },
|
||||
name: "toggleFoldWidget",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-K Command-0", win: "Ctrl-K Ctrl-0" },
|
||||
name: "foldall",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-K Command-J", win: "Ctrl-K Ctrl-J" },
|
||||
name: "unfoldall",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-K Command-1", win: "Ctrl-K Ctrl-1" },
|
||||
name: "foldOther",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-K Command-Q", win: "Ctrl-K Ctrl-Q" },
|
||||
name: "navigateToLastEditLocation",
|
||||
},
|
||||
{
|
||||
bindKey: {
|
||||
mac: "Command-K Command-R|Command-K Command-S",
|
||||
win: "Ctrl-K Ctrl-R|Ctrl-K Ctrl-S",
|
||||
},
|
||||
name: "showKeyboardShortcuts",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-K Command-X", win: "Ctrl-K Ctrl-X" },
|
||||
name: "trimTrailingSpace",
|
||||
},
|
||||
{
|
||||
bindKey: {
|
||||
mac: "Shift-Down|Command-Shift-Down",
|
||||
win: "Shift-Down|Ctrl-Shift-Down",
|
||||
},
|
||||
name: "selectdown",
|
||||
},
|
||||
{
|
||||
bindKey: {
|
||||
mac: "Shift-Up|Command-Shift-Up",
|
||||
win: "Shift-Up|Ctrl-Shift-Up",
|
||||
},
|
||||
name: "selectup",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-Alt-Enter", win: "Ctrl-Alt-Enter" },
|
||||
name: "replaceAll",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Command-Shift-1", win: "Ctrl-Shift-1" },
|
||||
name: "replaceOne",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Option-C", win: "Alt-C" },
|
||||
name: "toggleFindCaseSensitive",
|
||||
},
|
||||
{
|
||||
bindKey: { mac: "Option-L", win: "Alt-L" },
|
||||
name: "toggleFindInSelection",
|
||||
},
|
||||
{ bindKey: { mac: "Option-R", win: "Alt-R" }, name: "toggleFindRegex" },
|
||||
{
|
||||
bindKey: { mac: "Option-W", win: "Alt-W" },
|
||||
name: "toggleFindWholeWord",
|
||||
},
|
||||
{ bindKey: { mac: "Command-L", win: "Ctrl-L" }, name: "expandtoline" },
|
||||
{
|
||||
bindKey: { mac: "Shift-Esc", win: "Shift-Esc" },
|
||||
name: "removeSecondaryCursors",
|
||||
},
|
||||
].forEach(function (e) {
|
||||
var n = t.handler.commands[e.name];
|
||||
n && (n.bindKey = e.bindKey), t.handler.bindKey(e.bindKey, n || e.name);
|
||||
});
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/keyboard/vscode"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
7
vuejs/client/src/assets/script/editor/mode-text.js
Normal file
7
vuejs/client/src/assets/script/editor/mode-text.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
(function () {
|
||||
window.require(["ace/mode/text"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
29
vuejs/client/src/assets/script/editor/theme-dawn.js
Normal file
29
vuejs/client/src/assets/script/editor/theme-dawn.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
define("ace/theme/dawn.css", ["require", "exports", "module"], function (
|
||||
require,
|
||||
exports,
|
||||
module,
|
||||
) {
|
||||
module.exports =
|
||||
'.ace-dawn .ace_gutter {\n background: #ebebeb;\n color: #333\n}\n\n.ace-dawn .ace_print-margin {\n width: 1px;\n background: #e8e8e8\n}\n\n.ace-dawn {\n background-color: #F9F9F9;\n color: #080808\n}\n\n.ace-dawn .ace_cursor {\n color: #000000\n}\n\n.ace-dawn .ace_marker-layer .ace_selection {\n background: rgba(39, 95, 255, 0.30)\n}\n\n.ace-dawn.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #F9F9F9;\n}\n\n.ace-dawn .ace_marker-layer .ace_step {\n background: rgb(255, 255, 0)\n}\n\n.ace-dawn .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(75, 75, 126, 0.50)\n}\n\n.ace-dawn .ace_marker-layer .ace_active-line {\n background: rgba(36, 99, 180, 0.12)\n}\n\n.ace-dawn .ace_gutter-active-line {\n background-color : #dcdcdc\n}\n\n.ace-dawn .ace_marker-layer .ace_selected-word {\n border: 1px solid rgba(39, 95, 255, 0.30)\n}\n\n.ace-dawn .ace_invisible {\n color: rgba(75, 75, 126, 0.50)\n}\n\n.ace-dawn .ace_keyword,\n.ace-dawn .ace_meta {\n color: #794938\n}\n\n.ace-dawn .ace_constant,\n.ace-dawn .ace_constant.ace_character,\n.ace-dawn .ace_constant.ace_character.ace_escape,\n.ace-dawn .ace_constant.ace_other {\n color: #811F24\n}\n\n.ace-dawn .ace_invalid.ace_illegal {\n text-decoration: underline;\n font-style: italic;\n color: #F8F8F8;\n background-color: #B52A1D\n}\n\n.ace-dawn .ace_invalid.ace_deprecated {\n text-decoration: underline;\n font-style: italic;\n color: #B52A1D\n}\n\n.ace-dawn .ace_support {\n color: #691C97\n}\n\n.ace-dawn .ace_support.ace_constant {\n color: #B4371F\n}\n\n.ace-dawn .ace_fold {\n background-color: #794938;\n border-color: #080808\n}\n\n.ace-dawn .ace_list,\n.ace-dawn .ace_markup.ace_list,\n.ace-dawn .ace_support.ace_function {\n color: #693A17\n}\n\n.ace-dawn .ace_storage {\n font-style: italic;\n color: #A71D5D\n}\n\n.ace-dawn .ace_string {\n color: #0B6125\n}\n\n.ace-dawn .ace_string.ace_regexp {\n color: #CF5628\n}\n\n.ace-dawn .ace_comment {\n font-style: italic;\n color: #5A525F\n}\n\n.ace-dawn .ace_heading,\n.ace-dawn .ace_markup.ace_heading {\n color: #19356D\n}\n\n.ace-dawn .ace_variable {\n color: #234A97\n}\n\n.ace-dawn .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-dawn .ace_indent-guide-active {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;\n} \n';
|
||||
});
|
||||
|
||||
define("ace/theme/dawn", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/theme/dawn.css",
|
||||
"ace/lib/dom",
|
||||
], function (require, exports, module) {
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-dawn";
|
||||
exports.cssText = require("./dawn.css");
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass, false);
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/theme/dawn"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
30
vuejs/client/src/assets/script/editor/theme-dracula.js
Normal file
30
vuejs/client/src/assets/script/editor/theme-dracula.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
define("ace/theme/dracula.css", ["require", "exports", "module"], function (
|
||||
require,
|
||||
exports,
|
||||
module,
|
||||
) {
|
||||
module.exports =
|
||||
'/*\n * Copyright \u00A9 2017 Zeno Rocha <hi@zenorocha.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201CSoftware\u201D), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \u201CAS IS\u201D, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n.ace-dracula .ace_gutter {\n background: #282a36;\n color: rgb(144,145,148)\n}\n\n.ace-dracula .ace_print-margin {\n width: 1px;\n background: #44475a\n}\n\n.ace-dracula {\n background-color: #282a36;\n color: #f8f8f2\n}\n\n.ace-dracula .ace_cursor {\n color: #f8f8f0\n}\n\n.ace-dracula .ace_marker-layer .ace_selection {\n background: #44475a\n}\n\n.ace-dracula.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #282a36;\n border-radius: 2px\n}\n\n.ace-dracula .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174)\n}\n\n.ace-dracula .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a29709\n}\n\n.ace-dracula .ace_marker-layer .ace_active-line {\n background: #44475a\n}\n\n.ace-dracula .ace_gutter-active-line {\n background-color: #44475a\n}\n\n.ace-dracula .ace_marker-layer .ace_selected-word {\n box-shadow: 0px 0px 0px 1px #a29709;\n border-radius: 3px;\n}\n\n.ace-dracula .ace_fold {\n background-color: #50fa7b;\n border-color: #f8f8f2\n}\n\n.ace-dracula .ace_keyword {\n color: #ff79c6\n}\n\n.ace-dracula .ace_constant.ace_language {\n color: #bd93f9\n}\n\n.ace-dracula .ace_constant.ace_numeric {\n color: #bd93f9\n}\n\n.ace-dracula .ace_constant.ace_character {\n color: #bd93f9\n}\n\n.ace-dracula .ace_constant.ace_character.ace_escape {\n color: #ff79c6\n}\n\n.ace-dracula .ace_constant.ace_other {\n color: #bd93f9\n}\n\n.ace-dracula .ace_support.ace_function {\n color: #8be9fd\n}\n\n.ace-dracula .ace_support.ace_constant {\n color: #6be5fd\n}\n\n.ace-dracula .ace_support.ace_class {\n font-style: italic;\n color: #66d9ef\n}\n\n.ace-dracula .ace_support.ace_type {\n font-style: italic;\n color: #66d9ef\n}\n\n.ace-dracula .ace_storage {\n color: #ff79c6\n}\n\n.ace-dracula .ace_storage.ace_type {\n font-style: italic;\n color: #8be9fd\n}\n\n.ace-dracula .ace_invalid {\n color: #F8F8F0;\n background-color: #ff79c6\n}\n\n.ace-dracula .ace_invalid.ace_deprecated {\n color: #F8F8F0;\n background-color: #bd93f9\n}\n\n.ace-dracula .ace_string {\n color: #f1fa8c\n}\n\n.ace-dracula .ace_comment {\n color: #6272a4\n}\n\n.ace-dracula .ace_variable {\n color: #50fa7b\n}\n\n.ace-dracula .ace_variable.ace_parameter {\n font-style: italic;\n color: #ffb86c\n}\n\n.ace-dracula .ace_entity.ace_other.ace_attribute-name {\n color: #50fa7b\n}\n\n.ace-dracula .ace_entity.ace_name.ace_function {\n color: #50fa7b\n}\n\n.ace-dracula .ace_entity.ace_name.ace_tag {\n color: #ff79c6\n}\n.ace-dracula .ace_invisible {\n color: #626680;\n}\n\n.ace-dracula .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-dracula .ace_indent-guide-active {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACAQMAAACjTyRkAAAABlBMVEUAAADCwsK76u2xAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjYGBoAAAAhACBGFbxzQAAAABJRU5ErkJggg==") right repeat-y;\n}\n';
|
||||
});
|
||||
|
||||
define("ace/theme/dracula", [
|
||||
"require",
|
||||
"exports",
|
||||
"module",
|
||||
"ace/theme/dracula.css",
|
||||
"ace/lib/dom",
|
||||
], function (require, exports, module) {
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-dracula";
|
||||
exports.cssText = require("./dracula.css");
|
||||
exports.$selectionColorConflict = true;
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass, false);
|
||||
});
|
||||
(function () {
|
||||
window.require(["ace/theme/dracula"], function (m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
1115
vuejs/client/src/assets/script/editor/worker-base.js
Normal file
1115
vuejs/client/src/assets/script/editor/worker-base.js
Normal file
File diff suppressed because it is too large
Load diff
33673
vuejs/client/src/assets/script/editor/worker-coffee.js
Normal file
33673
vuejs/client/src/assets/script/editor/worker-coffee.js
Normal file
File diff suppressed because it is too large
Load diff
7975
vuejs/client/src/assets/script/editor/worker-css.js
Normal file
7975
vuejs/client/src/assets/script/editor/worker-css.js
Normal file
File diff suppressed because it is too large
Load diff
10122
vuejs/client/src/assets/script/editor/worker-html.js
Normal file
10122
vuejs/client/src/assets/script/editor/worker-html.js
Normal file
File diff suppressed because it is too large
Load diff
13060
vuejs/client/src/assets/script/editor/worker-javascript.js
Normal file
13060
vuejs/client/src/assets/script/editor/worker-javascript.js
Normal file
File diff suppressed because one or more lines are too long
1306
vuejs/client/src/assets/script/editor/worker-json.js
Normal file
1306
vuejs/client/src/assets/script/editor/worker-json.js
Normal file
File diff suppressed because it is too large
Load diff
2757
vuejs/client/src/assets/script/editor/worker-lua.js
Normal file
2757
vuejs/client/src/assets/script/editor/worker-lua.js
Normal file
File diff suppressed because it is too large
Load diff
2953
vuejs/client/src/assets/script/editor/worker-php.js
Normal file
2953
vuejs/client/src/assets/script/editor/worker-php.js
Normal file
File diff suppressed because it is too large
Load diff
2569
vuejs/client/src/assets/script/editor/worker-xml.js
Normal file
2569
vuejs/client/src/assets/script/editor/worker-xml.js
Normal file
File diff suppressed because it is too large
Load diff
70687
vuejs/client/src/assets/script/editor/worker-xquery.js
Normal file
70687
vuejs/client/src/assets/script/editor/worker-xquery.js
Normal file
File diff suppressed because it is too large
Load diff
4831
vuejs/client/src/assets/script/editor/worker-yaml.js
Normal file
4831
vuejs/client/src/assets/script/editor/worker-yaml.js
Normal file
File diff suppressed because it is too large
Load diff
363
vuejs/client/src/components/Forms/Field/Editor.vue
Normal file
363
vuejs/client/src/components/Forms/Field/Editor.vue
Normal file
|
|
@ -0,0 +1,363 @@
|
|||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
computed,
|
||||
defineEmits,
|
||||
onMounted,
|
||||
defineProps,
|
||||
onUnmounted,
|
||||
} from "vue";
|
||||
import { contentIndex } from "@utils/tabindex.js";
|
||||
import Container from "@components/Widget/Container.vue";
|
||||
import Header from "@components/Forms/Header/Field.vue";
|
||||
import ErrorField from "@components/Forms/Error/Field.vue";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import "@assets/script/editor/ace.js";
|
||||
import "@assets/script/editor/theme-dracula.js";
|
||||
import "@assets/script/editor/theme-dawn.js";
|
||||
/**
|
||||
@name Forms/Field/Editor.vue
|
||||
@description This component is used to create a complete editor field input with error handling and label.
|
||||
We can also add popover to display more information.
|
||||
It is mainly use in forms.
|
||||
@example
|
||||
{
|
||||
id: 'test-input',
|
||||
value: 'yes',
|
||||
type: "text",
|
||||
name: 'test-input',
|
||||
disabled: false,
|
||||
required: true,
|
||||
label: 'Test input',
|
||||
pattern : "(test)",
|
||||
inpType: "input",
|
||||
popovers : [
|
||||
{
|
||||
text: "This is a popover text",
|
||||
iconName: "info",
|
||||
iconColor: "info",
|
||||
},
|
||||
],
|
||||
}
|
||||
@param {string} [id=uuidv4()] - Unique id
|
||||
@param {string} label - The label of the field. Can be a translation key or by default raw text.
|
||||
@param {string} name - The name of the field. Case no label, this is the fallback. Can be a translation key or by default raw text. @param {string} label
|
||||
@param {string} value
|
||||
@param {array} [popovers] - List of popovers to display more information
|
||||
@param {string} [inpType="editor"] - The type of the field, useful when we have multiple fields in the same container to display the right field
|
||||
@param {object} [columns={"pc": "12", "tablet": "12", "mobile": "12}] - Field has a grid system. This allow to get multiple field in the same row if needed.
|
||||
@param {string} [pattern=""]
|
||||
@param {boolean} [disabled=false]
|
||||
@param {boolean} [required=false]
|
||||
@param {boolean} [clipboard=false] - allow to copy the input value
|
||||
@param {boolean} [hideLabel=false]
|
||||
@param {string} [containerClass=""]
|
||||
@param {string} [editorClass=""]
|
||||
@param {string} [headerClass=""]
|
||||
@param {string|number} [tabId=contentIndex] - The tabindex of the field, by default it is the contentIndex
|
||||
*/
|
||||
|
||||
const props = defineProps({
|
||||
// id && value && method
|
||||
id: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: uuidv4(),
|
||||
},
|
||||
columns: {
|
||||
type: [Object, Boolean],
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
inpType: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: "editor",
|
||||
},
|
||||
required: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
pattern: {
|
||||
type: String,
|
||||
required: false,
|
||||
defaut: "",
|
||||
},
|
||||
clipboard: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
popovers: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: [],
|
||||
},
|
||||
hideLabel: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
containerClass: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: "",
|
||||
},
|
||||
headerClass: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: "",
|
||||
},
|
||||
editorClass: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: "",
|
||||
},
|
||||
tabId: {
|
||||
type: [String, Number],
|
||||
required: false,
|
||||
default: contentIndex,
|
||||
},
|
||||
});
|
||||
|
||||
const editor = reactive({
|
||||
value: props.value,
|
||||
showInp: false,
|
||||
isClipAllow: false,
|
||||
isValid: computed(() => {
|
||||
if (props.required && !editor.value) return false;
|
||||
if (props.pattern) {
|
||||
const regex = new RegExp(props.pattern);
|
||||
return regex.test(editor.value);
|
||||
}
|
||||
return true;
|
||||
}),
|
||||
});
|
||||
|
||||
const emits = defineEmits(["inp"]);
|
||||
|
||||
let editorEl = null;
|
||||
|
||||
// Ace editor vanilla logic
|
||||
class Editor {
|
||||
constructor() {
|
||||
this.editor = ace.edit(props.id);
|
||||
this.darkMode = document.querySelector("[data-dark-toggle]");
|
||||
this.initEditor();
|
||||
this.listenDarkToggle();
|
||||
}
|
||||
|
||||
initEditor() {
|
||||
// handle tabindex
|
||||
this.editor.commands.addCommand({
|
||||
name: "prevTabIndex",
|
||||
bindKey: { win: "Shift-Tab", mac: "Shift-Tab" },
|
||||
exec: function (editor) {
|
||||
try {
|
||||
// Get all elements with the same tabindex
|
||||
const elements = document.querySelectorAll(
|
||||
`[tabindex="${contentIndex}"]`
|
||||
);
|
||||
// Get index of the current element
|
||||
const index = Array.from(elements).indexOf(document.activeElement);
|
||||
// Focus on the next element if exists
|
||||
if (elements[index - 1]) return elements[index - 1].focus();
|
||||
// Else try to find tabIndex + 1 element
|
||||
const prevElements = document.querySelectorAll(
|
||||
`[tabindex="${+contentIndex - 1}"]`
|
||||
);
|
||||
// Else find the highest tabindex element in a limit of +20
|
||||
let maxTabIndex = -10;
|
||||
let currTabIndex = +contentIndex - 1;
|
||||
while (currTabIndex > maxTabIndex) {
|
||||
const minElements = document.querySelectorAll(
|
||||
`[tabindex="${currTabIndex}"]`
|
||||
);
|
||||
if (minElements[0]) return minElements[0].focus();
|
||||
currTabIndex++;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
readOnly: true,
|
||||
});
|
||||
|
||||
this.editor.commands.addCommand({
|
||||
name: "NextTabIndex",
|
||||
bindKey: { win: "Tab", mac: "Tab" },
|
||||
exec: function (editor) {
|
||||
try {
|
||||
// Get all elements with the same tabindex
|
||||
const elements = document.querySelectorAll(
|
||||
`[tabindex="${contentIndex}"]`
|
||||
);
|
||||
// Get index of the current element
|
||||
const index = Array.from(elements).indexOf(document.activeElement);
|
||||
// Focus on the next element if exists
|
||||
if (elements[index + 1]) return elements[index + 1].focus();
|
||||
// Else find the highest tabindex element in a limit of +20
|
||||
let maxTabIndex = +contentIndex + 20;
|
||||
let currTabIndex = +contentIndex + 1;
|
||||
while (currTabIndex < maxTabIndex) {
|
||||
const maxElements = document.querySelectorAll(
|
||||
`[tabindex="${currTabIndex}"]`
|
||||
);
|
||||
if (maxElements[0]) return maxElements[0].focus();
|
||||
currTabIndex++;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
readOnly: true,
|
||||
});
|
||||
|
||||
this.editor.setShowPrintMargin(false);
|
||||
this.setDarkMode();
|
||||
}
|
||||
|
||||
//listen to dark toggle button to change theme
|
||||
listenDarkToggle() {
|
||||
this.darkMode.addEventListener("click", (e) => {
|
||||
this.darkMode.checked
|
||||
? this.changeDarkMode(true)
|
||||
: this.changeDarkMode(false);
|
||||
});
|
||||
}
|
||||
|
||||
setDarkMode() {
|
||||
document.querySelector("html").className.includes("dark")
|
||||
? this.editor.setTheme("ace/theme/dracula")
|
||||
: this.editor.setTheme("ace/theme/dawn");
|
||||
}
|
||||
|
||||
//change theme according to mode
|
||||
changeDarkMode(bool) {
|
||||
bool
|
||||
? this.editor.setTheme("ace/theme/dracula")
|
||||
: this.editor.setTheme("ace/theme/dawn");
|
||||
}
|
||||
|
||||
readOnlyBool(bool) {
|
||||
this.editor.setReadOnly(bool);
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.editor.destroy();
|
||||
}
|
||||
|
||||
getValue() {
|
||||
return this.editor.getValue();
|
||||
}
|
||||
|
||||
setValue(content) {
|
||||
return this.editor.setValue(content, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Use ace editor
|
||||
onMounted(() => {
|
||||
// Default value
|
||||
editorEl = new Editor();
|
||||
editorEl.setValue(editor.value);
|
||||
editorEl.readOnlyBool(props.disabled);
|
||||
editorEl.editor.on("change", () => {
|
||||
editor.value = editorEl.getValue();
|
||||
});
|
||||
// Add tabindex to editor
|
||||
try {
|
||||
const editorArea = document.querySelector("textarea.ace_text-input");
|
||||
editorArea.tabIndex = contentIndex;
|
||||
editorArea.setAttribute("name", props.name);
|
||||
} catch (e) {}
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
try {
|
||||
editorEl.destroy();
|
||||
} catch (err) {}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Container
|
||||
:containerClass="`field-container ${props.containerClass}`"
|
||||
:columns="props.columns"
|
||||
>
|
||||
<Header
|
||||
:popovers="props.popovers"
|
||||
:required="props.required"
|
||||
:name="props.name"
|
||||
:label="props.label"
|
||||
:hideLabel="props.hideLabel"
|
||||
:headerClass="props.headerClass"
|
||||
/>
|
||||
|
||||
<div
|
||||
:class="[
|
||||
'input-editor-container',
|
||||
props.disabled ? 'disabled' : 'enabled',
|
||||
]"
|
||||
>
|
||||
<div
|
||||
v-if="(!editor.value && props.required) || !editor.isValid"
|
||||
class="input-editor-error"
|
||||
></div>
|
||||
<div
|
||||
:class="['input-editor', props.disabled ? 'disabled' : 'enabled']"
|
||||
:aria-description="$t('inp_editor_desc')"
|
||||
:id="props.id"
|
||||
></div>
|
||||
<div
|
||||
v-if="props.clipboard && inp.isClipAllow"
|
||||
:class="[props.type === 'password' ? 'pw-input' : 'no-pw-input']"
|
||||
class="input-clipboard-container"
|
||||
>
|
||||
<button
|
||||
:tabindex="contentIndex"
|
||||
@click.prevent="copyClipboard()"
|
||||
:class="[props.disabled ? 'disabled' : 'enabled']"
|
||||
class="input-clipboard-button"
|
||||
:aria-describedby="`${props.id}-clipboard-text`"
|
||||
>
|
||||
<span :id="`${props.id}-clipboard-text`" class="sr-only"
|
||||
>{{ $t("inp_input_clipboard_desc") }}
|
||||
</span>
|
||||
<svg
|
||||
role="img"
|
||||
aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor"
|
||||
class="input-clipboard-svg"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<ErrorField :isValid="editor.isValid" :isValue="!!editor.value" />
|
||||
</Container>
|
||||
</template>
|
||||
|
|
@ -108,6 +108,7 @@
|
|||
"inp_select_plugin_context_desc": "Only show plugins of the chosen context.",
|
||||
"inp_search_key": "search key",
|
||||
"inp_search_key_desc": "Search within the settings key.",
|
||||
"inp_editor_desc" : "Editor input behaving like a code editor.",
|
||||
"action_send": "send {name}",
|
||||
"action_start": "start {name}",
|
||||
"action_disable": "disable {name}",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import Select from "@components/Forms/Field/Select.vue";
|
|||
import Input from "@components/Forms/Field/Input.vue";
|
||||
import Datepicker from "@components/Forms/Field/Datepicker.vue";
|
||||
import Combobox from "@components/Forms/Field/Combobox.vue";
|
||||
import Editor from "@components/Forms/Field/Editor.vue";
|
||||
import Button from "@components/Widget/Button.vue";
|
||||
import DashboardLayout from "@components/Dashboard/Layout.vue";
|
||||
import GridLayout from "@components/Widget/GridLayout.vue";
|
||||
|
|
@ -42,7 +43,6 @@ const inputData = {
|
|||
required: true,
|
||||
label: "Test input",
|
||||
pattern: "(test)",
|
||||
tabId: "1",
|
||||
columns: { pc: 12, tablet: 12, mobile: 12 },
|
||||
};
|
||||
|
||||
|
|
@ -115,6 +115,17 @@ const comboboxData = {
|
|||
required: false,
|
||||
requiredValues: ["no"],
|
||||
label: "Test combobox",
|
||||
columns: { pc: 12, tablet: 12, mobile: 12 },
|
||||
};
|
||||
|
||||
const editorData = {
|
||||
id: "test-editor",
|
||||
value: "yes",
|
||||
name: "test-editor",
|
||||
disabled: false,
|
||||
required: true,
|
||||
pattern: "(test)",
|
||||
label: "Test editor",
|
||||
tabId: "1",
|
||||
columns: { pc: 12, tablet: 12, mobile: 12 },
|
||||
};
|
||||
|
|
@ -132,6 +143,7 @@ const comboboxData = {
|
|||
<!-- widget grid -->
|
||||
<Grid>
|
||||
<Combobox v-bind="comboboxData" />
|
||||
<Editor v-bind="editorData" />
|
||||
</Grid>
|
||||
</GridLayout>
|
||||
</DashboardLayout>
|
||||
|
|
|
|||
Loading…
Reference in a new issue