efront 4.35.7 → 4.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/#/345/233/275/351/231/205/345/214/226.yml +3 -0
- package/coms/basic/ASN1.js +1 -1
- package/coms/basic/JSAM.js +2 -2
- package/coms/basic/Matrix.js +1 -1
- package/coms/basic/decodeLZW.js +35 -22
- package/coms/basic/math.js +110 -32
- package/coms/basic/math.md +118 -40
- package/coms/basic/math_test.xht +10 -0
- package/coms/basic/refilm_decode.js +20 -18
- package/coms/basic/refilm_parse.js +6 -7
- package/coms/basic/strings.js +43 -6
- package/coms/basic_/JSON.js +5 -1
- package/coms/compile/Html.js +21 -1
- package/coms/compile/Program.js +9 -3
- package/coms/compile/autoeval.js +8 -2
- package/coms/compile/autoeval_test.js +10 -8
- package/coms/compile/common.js +37 -2
- package/coms/compile/common_test.js +48 -0
- package/coms/compile/namekill.js +13 -0
- package/coms/compile/powermap.js +1 -1
- package/coms/compile/scanner2.js +8 -2
- package/coms/compile/wraphtml.js +1 -1
- package/coms/compile//347/256/227/345/274/217.js +82 -26
- package/coms/compile//347/256/227/345/274/217_test.js +6 -1
- package/coms/compile//347/264/240/351/246/250.js +1 -1
- package/coms/frame/chat.js +2 -1
- package/coms/zimoli/arriswise.js +7 -3
- package/coms/zimoli/bggrid-func.less +2 -2
- package/coms/zimoli/drag.js +11 -6
- package/coms/zimoli/list.js +1 -2
- package/coms/zimoli/moveupon.js +26 -1
- package/coms/zimoli/picture.less +1 -18
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/public//346/226/207/344/273/266/347/263/273/347/273/237//344/270/273/351/241/265.jsp +2 -2
package/coms/compile/common.js
CHANGED
|
@@ -287,6 +287,21 @@ var getContitionHeadBeforeScoped = function (p, nodo) {
|
|
|
287
287
|
return getIfElseHead(pp);
|
|
288
288
|
}
|
|
289
289
|
};
|
|
290
|
+
var getClassHeadBeforeScoped = function (p) {
|
|
291
|
+
var i = 0;
|
|
292
|
+
while (p && p.isClass) {
|
|
293
|
+
p = p.prev;
|
|
294
|
+
i++;
|
|
295
|
+
}
|
|
296
|
+
while (p && i > 0) {
|
|
297
|
+
var o = p;
|
|
298
|
+
if (p.type === STRAP && /^(class|interface)$/.test(p.text)) {
|
|
299
|
+
i--;
|
|
300
|
+
}
|
|
301
|
+
p = p.prev;
|
|
302
|
+
}
|
|
303
|
+
return o;
|
|
304
|
+
}
|
|
290
305
|
var getFunctionHeadBeforeScoped = function (p) {
|
|
291
306
|
var pp = getprev(p);
|
|
292
307
|
if (pp && pp.type === EXPRESS) pp = getprev(pp);
|
|
@@ -1282,9 +1297,25 @@ var getSemicolonBetween = function (prev, next) {
|
|
|
1282
1297
|
}
|
|
1283
1298
|
return;
|
|
1284
1299
|
}
|
|
1300
|
+
if (prev.brace) {
|
|
1301
|
+
if (pp.type === SCOPED && pp.entry === '(' ||
|
|
1302
|
+
pp.type === STAMP && pp.text === '=>'
|
|
1303
|
+
) pp = getFunctionHeadBeforeScoped(pp);
|
|
1304
|
+
else if (prev.isClass) {
|
|
1305
|
+
pp = getClassHeadBeforeScoped(prev);
|
|
1306
|
+
}
|
|
1307
|
+
else pp = null;
|
|
1308
|
+
if (pp) pp = getprev(pp);
|
|
1309
|
+
if (!pp) return;
|
|
1310
|
+
if (pp.type === STAMP && (
|
|
1311
|
+
!/^([,;]|\+\+|\-\-)$/.test(pp.text)
|
|
1312
|
+
|| pp.unary
|
|
1313
|
+
) || pp.type === STRAP && pp.transive && !pp.isend) return ';';
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1285
1316
|
if (prev.type === STRAP) {
|
|
1286
1317
|
if ((STRAP | EXPRESS | VALUE | QUOTED) & next.type) return " ";
|
|
1287
|
-
if (next.type === LABEL) return ";";
|
|
1318
|
+
if (next.type === LABEL) return /^(do|else|try|catch|finally)$/.test(prev.text) ? " " : ";";
|
|
1288
1319
|
}
|
|
1289
1320
|
}
|
|
1290
1321
|
var needBreakBetween = function (prev, next) {
|
|
@@ -1475,7 +1506,7 @@ var createString = function (parsed) {
|
|
|
1475
1506
|
var prev = getprev(o);
|
|
1476
1507
|
if (patchspace && !intag && prev && o.type !== QUOTED && (lasttype === STAMP && !prev.unary && !prev.needle
|
|
1477
1508
|
|| lasttype & ~(SPACE | STAMP | COMMENT) && o.brace
|
|
1478
|
-
|| lasttype === STRAP && !/^(this|arguments|import)$/.test(prev.text)
|
|
1509
|
+
|| lasttype === STRAP && !/^(this|arguments|import)$/.test(prev.text) && (!prev.unary || o.brace)
|
|
1479
1510
|
)) result.push(" ");
|
|
1480
1511
|
result.push(o.entry);
|
|
1481
1512
|
if (o.length > 0) {
|
|
@@ -1554,6 +1585,10 @@ var createString = function (parsed) {
|
|
|
1554
1585
|
lasttype = o.type;
|
|
1555
1586
|
};
|
|
1556
1587
|
parsed.forEach(run);
|
|
1588
|
+
var pend = parsed[parsed.length - 1];
|
|
1589
|
+
if (pend?.type === COMMENT && /^\/\//.test(pend.text)) {
|
|
1590
|
+
finalresult.push('\r\n');
|
|
1591
|
+
}
|
|
1557
1592
|
return finalresult.join("");
|
|
1558
1593
|
}
|
|
1559
1594
|
var rename = function (used, from, to) {
|
|
@@ -60,3 +60,51 @@ assert(common.number_reg.test("1.1920928955078125e-07F"), true)
|
|
|
60
60
|
assert(new RegExp(common.number_reg.source.replace(/^\^|\$$/g, ''), 'ig').exec("00080000h"), ["00080000h"])
|
|
61
61
|
assert(new RegExp(common.number_reg.source.replace(/^\^|\$$/g, ''), 'ig').exec("2A3h"), ["2A3h"])
|
|
62
62
|
assert(new RegExp(common.number_reg.source.replace(/^\^|\$$/g, ''), 'ig').exec("1.1920928955078125e-07F"), ["1.1920928955078125e-07F"])
|
|
63
|
+
function testCrateString(text, want = text) {
|
|
64
|
+
var code = scanner2(text);
|
|
65
|
+
code.keepspace = false;
|
|
66
|
+
var res = common.createString(code);
|
|
67
|
+
assert(res, want);
|
|
68
|
+
}
|
|
69
|
+
testCrateString('else\r\na:{break a}', 'else a:{break a}')
|
|
70
|
+
testCrateString('do\r\na:{break a}', 'do a:{break a}')
|
|
71
|
+
testCrateString('try\r\na:{break a}', 'try a:{break a}')
|
|
72
|
+
testCrateString('finally\r\na:{break a}', 'finally a:{break a}')
|
|
73
|
+
testCrateString('catch\r\na:{break a}', 'catch a:{break a}')
|
|
74
|
+
testCrateString(
|
|
75
|
+
'a = function () {}\r\n a: do { break a } white(true)',
|
|
76
|
+
'a=function(){};a:do{break a}white(true)'
|
|
77
|
+
)
|
|
78
|
+
testCrateString(
|
|
79
|
+
'function a() {}\r\nreturn',
|
|
80
|
+
'function a(){}return'
|
|
81
|
+
)
|
|
82
|
+
testCrateString(
|
|
83
|
+
'a = function () {}()\r\n return',
|
|
84
|
+
'a=function(){}();return'
|
|
85
|
+
)
|
|
86
|
+
testCrateString(
|
|
87
|
+
'a = class{}\r\n return',
|
|
88
|
+
'a=class{};return'
|
|
89
|
+
)
|
|
90
|
+
testCrateString(
|
|
91
|
+
'class a{}\r\n return',
|
|
92
|
+
'class a{}return'
|
|
93
|
+
)
|
|
94
|
+
testCrateString(
|
|
95
|
+
'class a extends class b{}{}\r\n return',
|
|
96
|
+
'class a extends class b{}{}return'
|
|
97
|
+
)
|
|
98
|
+
testCrateString(
|
|
99
|
+
'new class a extends class b{}{}\r\n return',
|
|
100
|
+
'new class a extends class b{}{};return'
|
|
101
|
+
)
|
|
102
|
+
testCrateString(
|
|
103
|
+
'new class a extends function b(){}{}\r\n return',
|
|
104
|
+
'new class a extends function b(){}{};return'
|
|
105
|
+
)
|
|
106
|
+
testCrateString(
|
|
107
|
+
'new class a extends()=>{}{}\r\n return',
|
|
108
|
+
'new class a extends()=>{}{};return'
|
|
109
|
+
)
|
|
110
|
+
testCrateString('if(true){}a:do{break a}white(true)')
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function till(kill, i, arr) {
|
|
2
|
+
var s = kill = "_" + i + kill.replace(/[&\^%\?@#\\]/g, '_');
|
|
3
|
+
var i = 1;
|
|
4
|
+
while (kill in this) {
|
|
5
|
+
kill = s + "_" + i++;
|
|
6
|
+
}
|
|
7
|
+
return kill;
|
|
8
|
+
}
|
|
9
|
+
module.exports = function nametill(names, prevent) {
|
|
10
|
+
prevent = Object.create(prevent);
|
|
11
|
+
names.forEach(n => prevent[n] = true);
|
|
12
|
+
return names.map(till, prevent);
|
|
13
|
+
}
|
package/coms/compile/powermap.js
CHANGED
|
@@ -12,7 +12,7 @@ var powermap = {
|
|
|
12
12
|
'instanceof,in,==,>=,<=,>,<,!=,!==,===,!in,!instanceof'/* 6 */,
|
|
13
13
|
'>>,>>>,<<'/* 7 */, '+,-'/* 8 */, '*,/,%,\\'/* 9 */, '**'/* 10 */,
|
|
14
14
|
'++,--'/* 11 */,
|
|
15
|
-
"typeof,await,yield,delete,void,..."/*12*/,
|
|
15
|
+
"typeof,import,await,yield,delete,void,..."/*12*/,
|
|
16
16
|
"',!,~,#,new"/* 13 */,
|
|
17
17
|
"::,?.,->,."/*14*/,
|
|
18
18
|
].forEach((pp, i) => {
|
package/coms/compile/scanner2.js
CHANGED
|
@@ -4,6 +4,7 @@ var createShortList = function (keys, prevent) {
|
|
|
4
4
|
return createShortName(keys.length, prevent);
|
|
5
5
|
};
|
|
6
6
|
var renameHashName = require("./nametill");
|
|
7
|
+
var renameBothName = require('./namekill');
|
|
7
8
|
var createNameList = createShortList;
|
|
8
9
|
var Html = require("./Html");
|
|
9
10
|
var Javascript = require("./Javascript");
|
|
@@ -190,11 +191,16 @@ class Code extends Array {
|
|
|
190
191
|
createNameList = createShortList;
|
|
191
192
|
}
|
|
192
193
|
// 压缩
|
|
193
|
-
press(keepspace) {
|
|
194
|
+
press(keepspace, pressMethod) {
|
|
194
195
|
this.keepspace = keepspace;
|
|
195
196
|
this.pressed = true;
|
|
196
197
|
this.helpcode = false;
|
|
197
|
-
|
|
198
|
+
if (pressMethod < 0) {
|
|
199
|
+
createNameList = renameBothName;
|
|
200
|
+
compress(this.scoped);
|
|
201
|
+
createShortList = createShortList;
|
|
202
|
+
}
|
|
203
|
+
else compress(this.scoped);
|
|
198
204
|
return this;
|
|
199
205
|
}
|
|
200
206
|
getNodeAt(row, col) {
|
package/coms/compile/wraphtml.js
CHANGED
|
@@ -6,15 +6,18 @@ const {
|
|
|
6
6
|
createString,
|
|
7
7
|
} = require("./common");
|
|
8
8
|
var powermap = require("./powermap");
|
|
9
|
-
var number_rep = /^([+-]?[\d\.]+)(?:e([+-]?\d+))
|
|
9
|
+
var number_rep = /^([+-]?[\d\.]+)(?:e([+-]?\d+))?([ijkn]*)$/;
|
|
10
|
+
var 三角函数 = `sin,cos,tan,cot,sec,csc,arcsin,arccos,arctan,arccot,arcsec,arccsc`.split(',');
|
|
10
11
|
class Math extends Program {
|
|
11
|
-
number_reg = /^(\d+(?:\.\d+){0,2}|(?:\.\d+){1,2}|(?:\d+\.){1,3})\.*(?:e[+-]?\d+)
|
|
12
|
+
number_reg = /^(\d+(?:\.\d+){0,2}|(?:\.\d+){1,2}|(?:\d+\.){1,3})\.*(?:e[+-]?\d+)?[ijkn]*$/;
|
|
12
13
|
powermap = Object.assign({}, powermap);
|
|
13
14
|
value_reg = /^(false|true|null|Infinity|NaN|undefined|eval|this|arguments)$/;
|
|
15
|
+
straps = 三角函数;
|
|
14
16
|
constructor() {
|
|
15
17
|
super();
|
|
16
18
|
var pmap = this.powermap;
|
|
17
19
|
pmap["+-"] = pmap["-+"] = powermap["+"];
|
|
20
|
+
pmap["+."] = powermap["?."];
|
|
18
21
|
pmap["×"] = pmap[".*"] = powermap["*"];
|
|
19
22
|
pmap["≈"] = pmap["~="] = pmap["=="];
|
|
20
23
|
pmap["≉"] = pmap["!≈"] = pmap["!~="] = pmap["~!="] = pmap["=="];
|
|
@@ -23,7 +26,13 @@ class Math extends Program {
|
|
|
23
26
|
pmap["^"] = powermap["**"];
|
|
24
27
|
pmap["_"] = powermap["?."];
|
|
25
28
|
pmap["'"] = powermap["?."];
|
|
26
|
-
|
|
29
|
+
var newp = powermap['new'];
|
|
30
|
+
三角函数.forEach(k => {
|
|
31
|
+
pmap[k] = newp;
|
|
32
|
+
})
|
|
33
|
+
pmap["$"] = pmap["@"] = powermap["!"];
|
|
34
|
+
this.stamps.push('\\', '_', "@", "$");
|
|
35
|
+
this.scopes.push(["|", "|"])
|
|
27
36
|
}
|
|
28
37
|
}
|
|
29
38
|
Math.prototype.createScoped = createScoped;
|
|
@@ -49,10 +58,10 @@ var make = function (pt, left, right) {
|
|
|
49
58
|
if (left) left = uncup(left);
|
|
50
59
|
if (right) right = uncup(right);
|
|
51
60
|
if (isNull(left)) {
|
|
52
|
-
return { [pt]: right instanceof Array ? ["", right] : right };
|
|
61
|
+
return { [pt]: right instanceof Array && !right.iscup ? ["", right] : right };
|
|
53
62
|
}
|
|
54
63
|
if (isNull(right)) {
|
|
55
|
-
return { [pt]: [left] };
|
|
64
|
+
return { [pt]: left instanceof Array && left.iscup ? left : [left] };
|
|
56
65
|
}
|
|
57
66
|
if (left[pt]) {
|
|
58
67
|
left[pt].push(right);
|
|
@@ -94,20 +103,29 @@ var getRows = function (code) {
|
|
|
94
103
|
var trs = [];
|
|
95
104
|
var maxsize = 0;
|
|
96
105
|
for (var r of rows) {
|
|
97
|
-
var row =
|
|
106
|
+
var row = getArgs(r);
|
|
98
107
|
maxsize = row.length;
|
|
99
108
|
trs.push(row);
|
|
100
109
|
}
|
|
101
110
|
rows.maxsize = maxsize;
|
|
111
|
+
trs.iscup = true;
|
|
102
112
|
return trs;
|
|
103
113
|
}
|
|
104
114
|
var getArgs = function (a) {
|
|
105
|
-
|
|
115
|
+
var res = [];
|
|
116
|
+
res.iscup = true;
|
|
117
|
+
split(a, ',').forEach(a => {
|
|
106
118
|
var cells = createExpressList(a);
|
|
107
119
|
if (!cells[cells.length - 1]?.first) cells.pop();
|
|
108
|
-
if (cells.length === 1)
|
|
109
|
-
|
|
120
|
+
if (cells.length === 1) {
|
|
121
|
+
res.push(toFlat(cells[0]));
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
cells.map(toFlat).forEach(a => {
|
|
125
|
+
res.push(a);
|
|
126
|
+
});
|
|
110
127
|
});
|
|
128
|
+
return res;
|
|
111
129
|
}
|
|
112
130
|
var uncup = function (cup) {
|
|
113
131
|
if (cup.iscup && cup.length <= 1) cup = cup[0];
|
|
@@ -142,7 +160,8 @@ var toFlat = function (exp) {
|
|
|
142
160
|
for (var cx = 0, dx = exp.length; cx < dx; cx++) {
|
|
143
161
|
var e = exp[cx];
|
|
144
162
|
if (e.type & (SPACE | COMMENT)) continue;
|
|
145
|
-
if (e.type & STAMP) {
|
|
163
|
+
if (e.type & (STAMP | STRAP)) {
|
|
164
|
+
if (e.text === '.') e.text = "+.";
|
|
146
165
|
var p = pmap[e.text] || 0;
|
|
147
166
|
if ((!p0 || p > p0 || !left.length) && !e.ion) {
|
|
148
167
|
cache.push(left, e.text, p0);
|
|
@@ -183,6 +202,10 @@ var toFlat = function (exp) {
|
|
|
183
202
|
else if (f instanceof Object) {
|
|
184
203
|
left.push(make("", f, args));
|
|
185
204
|
}
|
|
205
|
+
else if (/\d\.$/.test(f) && args.length === 1 && args[0]['/']) {
|
|
206
|
+
f = f.replace(/\.$/, '');
|
|
207
|
+
left.push(make("+.", f, args))
|
|
208
|
+
}
|
|
186
209
|
else {
|
|
187
210
|
left.push({ [f]: args });
|
|
188
211
|
}
|
|
@@ -213,25 +236,32 @@ var toFlat = function (exp) {
|
|
|
213
236
|
else {
|
|
214
237
|
args.push(ions);
|
|
215
238
|
}
|
|
216
|
-
left = [make("
|
|
239
|
+
left = [make("^*", left, args)];
|
|
217
240
|
}
|
|
218
241
|
else {
|
|
219
|
-
|
|
242
|
+
if (ions === '*' && left[0]["["] && left.length === 1) {
|
|
243
|
+
ions = "H";
|
|
244
|
+
}
|
|
245
|
+
left = [make("^*", left, ions)];
|
|
220
246
|
}
|
|
221
247
|
}
|
|
222
248
|
else {
|
|
223
249
|
var args = getArgs(e);
|
|
224
250
|
// 下标
|
|
225
|
-
left = [make("_", left,
|
|
251
|
+
left = [make("_", left, args)];
|
|
226
252
|
}
|
|
227
253
|
left.iscup = true;
|
|
228
254
|
}
|
|
229
255
|
else {
|
|
230
256
|
// 矩阵
|
|
231
|
-
left.push(getRows(e));
|
|
257
|
+
left.push(make("[", null, getRows(e)));
|
|
232
258
|
}
|
|
233
259
|
}
|
|
234
260
|
else if (e.entry === "{") {
|
|
261
|
+
left.push(make("{", null, getRows(e)));
|
|
262
|
+
}
|
|
263
|
+
else if (e.entry === '|') {
|
|
264
|
+
left.push(make("^|", getRows(e)));
|
|
235
265
|
}
|
|
236
266
|
}
|
|
237
267
|
else {
|
|
@@ -241,9 +271,9 @@ var toFlat = function (exp) {
|
|
|
241
271
|
}
|
|
242
272
|
if (e.isdigit) a: {
|
|
243
273
|
var et = e.text;
|
|
244
|
-
var [, a, e10] = number_rep.exec(et);
|
|
274
|
+
var [, a, e10, s] = number_rep.exec(et);
|
|
245
275
|
var b = a.split('.');
|
|
246
|
-
if (b.length > 2
|
|
276
|
+
if (b.length > 2) {
|
|
247
277
|
var nrep = b[2] || b[1];
|
|
248
278
|
var npre = b[0];
|
|
249
279
|
if (b[2]) {
|
|
@@ -257,15 +287,29 @@ var toFlat = function (exp) {
|
|
|
257
287
|
if (String(+nrep) === nrep) nrep = +nrep;
|
|
258
288
|
var v = [npre, nrep];
|
|
259
289
|
if (b.length > (b[2] ? 4 : b[1] ? 3 : 2)) v.push(b.slice(b[2] ? 3 : b[1] ? 2 : 1, b.length).join('.') + ".");
|
|
260
|
-
else if (e10) v.push('');
|
|
290
|
+
else if (e10 || s) v.push('');
|
|
261
291
|
if (e10) {
|
|
262
292
|
if (String(+e10) === e10) e10 = +e10;
|
|
263
293
|
v.push(e10);
|
|
264
294
|
}
|
|
295
|
+
else if (s) v.push('');
|
|
296
|
+
if (s) v.push(s);
|
|
265
297
|
v = { "..": v };
|
|
266
298
|
left.push(v);
|
|
267
299
|
continue;
|
|
268
300
|
}
|
|
301
|
+
else if (s || e10) {
|
|
302
|
+
if (String(+a) === a) a = +a;
|
|
303
|
+
var v = [a];
|
|
304
|
+
if (e10) {
|
|
305
|
+
if (String(+e10) === e10) e10 = +e10;
|
|
306
|
+
v.push(e10);
|
|
307
|
+
}
|
|
308
|
+
if (s) v.push(s);
|
|
309
|
+
v = { ".": v };
|
|
310
|
+
left.push(v);
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
269
313
|
var v = +a;
|
|
270
314
|
if (/^\+/.test(et)) {
|
|
271
315
|
if (String(v) !== a.slice(1)) break a;
|
|
@@ -275,7 +319,11 @@ var toFlat = function (exp) {
|
|
|
275
319
|
left.push(v);
|
|
276
320
|
continue;
|
|
277
321
|
}
|
|
278
|
-
|
|
322
|
+
var text = e.text;
|
|
323
|
+
if (e.type === QUOTED) {
|
|
324
|
+
text = strings.decode(text);
|
|
325
|
+
}
|
|
326
|
+
left.push(text);
|
|
279
327
|
}
|
|
280
328
|
}
|
|
281
329
|
if (!left.length) {
|
|
@@ -290,29 +338,37 @@ var toFlat = function (exp) {
|
|
|
290
338
|
}
|
|
291
339
|
return uncup(left);
|
|
292
340
|
}
|
|
293
|
-
|
|
294
|
-
function main(text) {
|
|
295
|
-
var code = scanner2(text, math);
|
|
341
|
+
function seprate(code, addrow) {
|
|
296
342
|
var rows = split(code, ';');
|
|
297
343
|
var res = [];
|
|
298
344
|
res.iscup = true;
|
|
299
345
|
for (var r of rows) {
|
|
300
346
|
var cells = split(r, ',');
|
|
347
|
+
var cup = addrow ? res : [];
|
|
301
348
|
for (var c of cells) {
|
|
302
349
|
var exps = createExpressList(c);
|
|
303
350
|
for (var e of exps) {
|
|
304
351
|
var a = toFlat(e);
|
|
305
352
|
if (!a) continue;
|
|
306
353
|
if (a.iscup) {
|
|
307
|
-
for (var b of a)
|
|
354
|
+
if (addrow) for (var b of a) cup.push(b, ' ');
|
|
355
|
+
else for (var b of a) cup.push(a);
|
|
308
356
|
}
|
|
309
|
-
else
|
|
357
|
+
else if (addrow) cup.push(a, ' ');
|
|
358
|
+
else cup.push(a);
|
|
310
359
|
}
|
|
311
|
-
if (
|
|
360
|
+
if (addrow && cup.length) cup[res.length - 1] = ', ';
|
|
361
|
+
}
|
|
362
|
+
if (cup.length) {
|
|
363
|
+
if (addrow) cup[res.length - 1] = '\r\n';
|
|
364
|
+
else res.push(cup.length === 1 ? cup[0] : cup);
|
|
312
365
|
}
|
|
313
|
-
if (res.length) res[res.length - 1] = '\r\n';
|
|
314
366
|
}
|
|
315
|
-
res.pop();
|
|
367
|
+
if (addrow) res.pop();
|
|
316
368
|
return uncup(res);
|
|
317
369
|
}
|
|
370
|
+
function main(text) {
|
|
371
|
+
var code = scanner2(text, math);
|
|
372
|
+
return seprate(code, true);
|
|
373
|
+
}
|
|
318
374
|
main.MathScript = Math;
|
|
@@ -214,7 +214,7 @@ var wrapColor = function (k) {
|
|
|
214
214
|
var f = color[k];
|
|
215
215
|
macros[k] = function (c) {
|
|
216
216
|
if (color.isColor(c)) return f(...arguments);
|
|
217
|
-
return `${k}(${Array.
|
|
217
|
+
return `${k}(${Array.prototype.join.call(arguments, ',')})`;
|
|
218
218
|
};
|
|
219
219
|
};
|
|
220
220
|
|
package/coms/frame/chat.js
CHANGED
|
@@ -164,10 +164,11 @@ async function pullFileWithRTC(scope, file) {
|
|
|
164
164
|
// <!-- console.log('接收端打开') -->
|
|
165
165
|
report();
|
|
166
166
|
};
|
|
167
|
-
channel.onclose = function () {
|
|
167
|
+
channel.onclose = async function () {
|
|
168
168
|
// <!-- console.log('接收端关闭') -->
|
|
169
169
|
if (writed === file.size) tipbox.setText(`接收完成`, 'success');
|
|
170
170
|
else tipbox.setText('接收异常', "error");
|
|
171
|
+
await writable.close();
|
|
171
172
|
};
|
|
172
173
|
channel.onerror = function (event) {
|
|
173
174
|
// <!-- console.log('接收端异常',event) -->
|
package/coms/zimoli/arriswise.js
CHANGED
|
@@ -33,12 +33,15 @@ var replaceArg = function (arg) {
|
|
|
33
33
|
}
|
|
34
34
|
return arg;
|
|
35
35
|
};
|
|
36
|
-
function build(func, argNames, argsArr) {
|
|
36
|
+
function build(func, argNames, argsArr, isWrapper) {
|
|
37
37
|
var newf = String(func).replace(regexps, rep);
|
|
38
|
-
|
|
38
|
+
if (isWrapper) newf = newf.replace(/^\s*function[\s\S]*?\{([\s\S]*)\}\s*$/, "$1");
|
|
39
|
+
else newf = "return " + newf;
|
|
40
|
+
return Function.apply(null, argNames.map(replaceArg).concat(newf))
|
|
39
41
|
.apply(this, argsArr.map(replaceArg));
|
|
40
42
|
}
|
|
41
43
|
var arriswise = function (func, args = []) {
|
|
44
|
+
var isWrapper = func === args[args.length - 3];
|
|
42
45
|
if (isFunction(args.slice)) {
|
|
43
46
|
// 兼容老方法
|
|
44
47
|
var argArr = args.slice(args.length - 3 >>> 1);
|
|
@@ -46,8 +49,9 @@ var arriswise = function (func, args = []) {
|
|
|
46
49
|
return build.call(arguments[2] || this, func,
|
|
47
50
|
args.slice(0, args.length - 3 >>> 1),
|
|
48
51
|
argArr,
|
|
52
|
+
isWrapper
|
|
49
53
|
);
|
|
50
54
|
}
|
|
51
55
|
var allArgumentsNames = args[args.length - 1];
|
|
52
|
-
return build.call(this, func, allArgumentsNames, [].slice.call(args, 0));
|
|
56
|
+
return build.call(this, func, allArgumentsNames, [].slice.call(args, 0), isWrapper);
|
|
53
57
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.grid() {
|
|
2
|
-
@mask-color1 : rgba(255, 255, 255, .
|
|
2
|
+
@mask-color1 : rgba(255, 255, 255, .3);
|
|
3
3
|
@mask-color2 : rgba(0, 0, 0, 0);
|
|
4
|
-
@mask-color3 : rgba(0, 0, 0, .
|
|
4
|
+
@mask-color3 : rgba(0, 0, 0, .3);
|
|
5
5
|
background-image:
|
|
6
6
|
linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
|
|
7
7
|
linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
|
package/coms/zimoli/drag.js
CHANGED
|
@@ -16,7 +16,8 @@ var getOffset = function (e) {
|
|
|
16
16
|
if (isFinite(e.screenX)) return [e.screenX, e.screenY];
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var getMousePosition = function (e) {
|
|
20
|
+
if ('screenX' in e) return [e.screenX, e.screenY];
|
|
20
21
|
return [e.clientX, e.clientY];
|
|
21
22
|
};
|
|
22
23
|
var z;
|
|
@@ -51,7 +52,7 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
|
|
|
51
52
|
if ((!target.hasAttribute || target.hasAttribute('draggable')) && target.draggable === false) return;
|
|
52
53
|
initialEvent.preventDefault();
|
|
53
54
|
var target_offset = getOffset(target);
|
|
54
|
-
var saved_delta = { x: target_offset[0] - initialEvent
|
|
55
|
+
var saved_delta = { x: target_offset[0] - getMousePosition(initialEvent)[0], y: target_offset[1] - getMousePosition(initialEvent)[1] };
|
|
55
56
|
var clone;
|
|
56
57
|
if (target.style) {
|
|
57
58
|
var saved_opacity = target.style.opacity;
|
|
@@ -90,12 +91,13 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
|
|
|
90
91
|
extraClones.map(c => document.body.appendChild(c));
|
|
91
92
|
saved_delta.x += clone_left - target_left;
|
|
92
93
|
saved_delta.y += clone_top - target_top;
|
|
93
|
-
target.setAttribute("dragging", '');
|
|
94
|
+
if (target.setAttribute) target.setAttribute("dragging", '');
|
|
94
95
|
dispatch("dragstart", target);
|
|
95
96
|
}
|
|
96
97
|
event.moveLocked = true;
|
|
97
|
-
var
|
|
98
|
-
var
|
|
98
|
+
var [screenX, screenY] = getMousePosition(event);
|
|
99
|
+
var offsetLeft = saved_delta.x + screenX;
|
|
100
|
+
var offsetTop = saved_delta.y + screenY;
|
|
99
101
|
var [c_left, c_top] = getOffset(clone);
|
|
100
102
|
var cloneDeltaLeft = -c_left, cloneDeltaTop = -c_top;
|
|
101
103
|
var [c_left, c_top] = move.call(clone, offsetLeft, offsetTop, preventOverflow);
|
|
@@ -115,7 +117,10 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
|
|
|
115
117
|
remove(extraClones);
|
|
116
118
|
extraTargets.map((target, cx) => css(target, extraStyles[cx]));
|
|
117
119
|
if (tgz != null) css(target, { zIndex: tgz });
|
|
118
|
-
if (saved_delta.ing)
|
|
120
|
+
if (saved_delta.ing) {
|
|
121
|
+
if (target.removeAttribute) target.removeAttribute("dragging");
|
|
122
|
+
dispatch("dragend", target);
|
|
123
|
+
}
|
|
119
124
|
drag.target = null;
|
|
120
125
|
saved_delta = null;
|
|
121
126
|
};
|
package/coms/zimoli/list.js
CHANGED
|
@@ -650,8 +650,7 @@ function ylist(container, generator, $Y) {
|
|
|
650
650
|
var allArgumentsNames = arguments[arguments.length - 1];
|
|
651
651
|
if (allArgumentsNames.done) return ylist;
|
|
652
652
|
allArgumentsNames.done = true;
|
|
653
|
-
var xlist = arriswise.call(this, arguments[arguments.length - 3], arguments)
|
|
654
|
-
|
|
653
|
+
var xlist = arriswise.call(this, arguments[arguments.length - 3], arguments);
|
|
655
654
|
var getGeneratorFromArray = function (source) {
|
|
656
655
|
return function (index) {
|
|
657
656
|
if (index >= source.length || index < 0) return null;
|
package/coms/zimoli/moveupon.js
CHANGED
|
@@ -50,16 +50,35 @@ var locktouch = function (target, handles) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
var getX = function (event) {
|
|
54
|
+
if ('screenX' in event) return event.screenX;
|
|
55
|
+
return event.clientX;
|
|
56
|
+
};
|
|
57
|
+
var getY = function (event) {
|
|
58
|
+
if ('screenY' in event) return event.screenY;
|
|
59
|
+
return event.clientY;
|
|
60
|
+
};
|
|
54
61
|
function moveupon(target, handles, initialEvent) {
|
|
55
62
|
var { start, move, end } = handles;
|
|
56
63
|
var touchLocked = false;
|
|
64
|
+
var savedX, savedY;
|
|
57
65
|
var offmouseup, offtouchend, offtouchcancel;
|
|
66
|
+
var setMovement = function (event) {
|
|
67
|
+
if ("movementX" in event) return
|
|
68
|
+
var x = getX(event);
|
|
69
|
+
event.movementX = x - savedX;
|
|
70
|
+
savedX = x;
|
|
71
|
+
var y = getY(event);
|
|
72
|
+
event.movementY = y - savedY;
|
|
73
|
+
savedY = y;
|
|
74
|
+
}
|
|
58
75
|
var mousemove = function (event) {
|
|
76
|
+
setMovement(event);
|
|
59
77
|
if (isFunction(move)) move.call(target, event);
|
|
60
78
|
};
|
|
61
79
|
|
|
62
80
|
var touchmove = function (event) {
|
|
81
|
+
setMovement(event);
|
|
63
82
|
extendTouchEvent(event);
|
|
64
83
|
if (isFunction(move)) move.call(target, event);
|
|
65
84
|
};
|
|
@@ -87,6 +106,7 @@ function moveupon(target, handles, initialEvent) {
|
|
|
87
106
|
|
|
88
107
|
if (initialEvent) {
|
|
89
108
|
if (locktouch(initialEvent.target, handles)) return;
|
|
109
|
+
if (target.notouch) return;
|
|
90
110
|
if (initialEvent.type === "touchstart") {
|
|
91
111
|
extendTouchEvent(initialEvent);
|
|
92
112
|
initialEvent.preventDefault();
|
|
@@ -100,8 +120,11 @@ function moveupon(target, handles, initialEvent) {
|
|
|
100
120
|
onmousedown(target, function (event) {
|
|
101
121
|
if (touchLocked) return;
|
|
102
122
|
if (locktouch(event.target, handles)) return;
|
|
123
|
+
if (target.notouch) return;
|
|
103
124
|
touchLocked = true;
|
|
104
125
|
hookmouse(event);
|
|
126
|
+
savedX = getX(event);
|
|
127
|
+
savedY = getY(event);
|
|
105
128
|
if (isFunction(start)) start.call(this, event);
|
|
106
129
|
});
|
|
107
130
|
ontouchstart(target, function (event) {
|
|
@@ -109,6 +132,8 @@ function moveupon(target, handles, initialEvent) {
|
|
|
109
132
|
if (locktouch(event.target, handles)) return;
|
|
110
133
|
touchLocked = true;
|
|
111
134
|
extendTouchEvent(event);
|
|
135
|
+
savedX = getX(event);
|
|
136
|
+
savedY = getY(event);
|
|
112
137
|
hooktouch(event);
|
|
113
138
|
if (isFunction(start)) start.call(this, event);
|
|
114
139
|
});
|
package/coms/zimoli/picture.less
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@import "bggrid-func.less";
|
|
1
2
|
& {
|
|
2
3
|
width: 100%;
|
|
3
4
|
height: 100%;
|
|
@@ -10,24 +11,6 @@
|
|
|
10
11
|
background-color: #000;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
.grid() {
|
|
15
|
-
@mask-color1 : rgba(255, 255, 255, .6);
|
|
16
|
-
@mask-color2 : rgba(0, 0, 0, 0);
|
|
17
|
-
@mask-color3 : rgba(0, 0, 0, .1);
|
|
18
|
-
background-image:
|
|
19
|
-
linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
|
|
20
|
-
linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
|
|
21
|
-
linear-gradient(45deg, @mask-color3, 25%, @mask-color3, 25%, @mask-color2, 75%, @mask-color3, 75%, @mask-color3),
|
|
22
|
-
linear-gradient(45deg, @mask-color3, 25%, @mask-color3, 25%, @mask-color2, 75%, @mask-color3, 75%, @mask-color3);
|
|
23
|
-
background-size: 20px 20px;
|
|
24
|
-
background-position: 0 0, 10px 10px, 10px 0, 0 10px;
|
|
25
|
-
background-repeat: repeat;
|
|
26
|
-
background-clip: border-box;
|
|
27
|
-
background-color: #fff;
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
14
|
&[grid],
|
|
32
15
|
&.grid,
|
|
33
16
|
&[type=grid] {
|