efront 4.24.2 → 4.25.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 +42 -24
- package/apps/pivot/auth/login.js +4 -4
- package/apps/pivot/cert/edit.js +1 -1
- package/apps/pivot/cert/list.js +1 -1
- package/apps/pivot/cert/main.xht +2 -3
- package/apps/pivot/db/list.xht +5 -0
- package/apps/pivot/dht/list.js +6 -7
- package/apps/pivot/dict/edit.js +1 -1
- package/apps/pivot/dict/list.js +8 -6
- package/apps/pivot/home/welcome.html +1 -1
- package/apps/pivot/link/room.js +3 -3
- package/apps/pivot/log/count.js +22 -22
- package/apps/pivot/main.js +8 -2
- package/apps/pivot/proxy/edit.js +1 -1
- package/apps/pivot/proxy/list.js +4 -5
- package/apps/pivot/share/list.js +3 -3
- package/apps/pivot/task/edit.js +1 -1
- package/apps/pivot/task/list.js +1 -1
- package/apps/pivot/token/edit.js +1 -1
- package/apps/pivot/token/list.js +1 -1
- package/apps/pivot/wow/root.js +0 -3
- package/coms/basic/i18n.js +18 -5
- package/coms/basic/migrate.js +43 -0
- package/coms/compile/Asm.js +252 -0
- package/coms/compile/Asm_test.js +22 -0
- package/coms/compile/Html_test.js +1 -0
- package/coms/compile/Javascript.js +1 -143
- package/coms/compile/Javascript_test.js +4 -1
- package/coms/compile/Program.js +186 -22
- package/coms/compile/common.js +16 -4
- package/coms/compile/powermap.js +2 -2
- package/coms/compile/unstruct.js +5 -5
- package/coms/compile/unstruct_test.js +3 -1
- package/coms/explorer/context.js +2 -2
- package/coms/explorer/main.js +1 -1
- package/coms/frame/edit.html +1 -1
- package/coms/frame/edit.js +13 -6
- package/coms/frame/list.js +75 -42
- package/coms/frame/route.js +11 -6
- package/coms/pivot/plist.js +8 -5
- package/coms/zimoli/autodragchildren.js +5 -1
- package/coms/zimoli/moveupon.js +8 -5
- package/coms/zimoli/prompt.js +1 -0
- package/coms/zimoli/render.js +1 -0
- package/coms/zimoli/resize.js +3 -0
- package/coms/zimoli/tree.js +4 -1
- package/coms/zimoli/zimoli.js +13 -2
- package/coms//350/214/250/350/217/260//346/240/207/347/255/276/345/214/226.js +7 -3
- package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +6 -3
- package/coms//350/214/250/350/217/260//350/257/255/350/250/200.js +1 -22
- package/docs/main.xht +21 -17
- package/docs//345/221/275/344/273/244.xht +33 -32
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/frame/route.js
CHANGED
|
@@ -138,17 +138,22 @@
|
|
|
138
138
|
idmap = Object.create(null);
|
|
139
139
|
firstMenu = null;
|
|
140
140
|
items = result.parse(items);
|
|
141
|
-
items
|
|
141
|
+
migrate(result, items);
|
|
142
|
+
result.map(getChildren);
|
|
142
143
|
var opened = data.getInstance("menu-opened");
|
|
143
144
|
var historys = zimoli.getCurrentHistory();
|
|
144
145
|
var map = {}, mmap = {};
|
|
145
146
|
historys.forEach((a, i) => map[a] = i + 1);
|
|
146
|
-
result.splice(0, result.length);
|
|
147
147
|
var actived, actived_value = 0;
|
|
148
|
-
var a = function (menu) {
|
|
148
|
+
var a = function (menu, i, arr) {
|
|
149
149
|
var res = checkroles(user.roles, menu.roles);
|
|
150
|
-
if (res)
|
|
151
|
-
|
|
150
|
+
if (!res) arr.splice(i, 1);
|
|
151
|
+
else {
|
|
152
|
+
if (savedChildren[menu.id] instanceof Array) {
|
|
153
|
+
var children = savedChildren[menu.id];
|
|
154
|
+
backEach(children, a);
|
|
155
|
+
menu.children = children;
|
|
156
|
+
}
|
|
152
157
|
if (menu.path) {
|
|
153
158
|
if (!firstMenu) firstMenu = menu;
|
|
154
159
|
if (map[menu.path] > actived_value) {
|
|
@@ -161,7 +166,7 @@
|
|
|
161
166
|
}
|
|
162
167
|
return res;
|
|
163
168
|
};
|
|
164
|
-
|
|
169
|
+
backEach(result, a);
|
|
165
170
|
result.opened = opened.map(a => mmap[a]).filter(a => !!a);
|
|
166
171
|
var active = result.active;
|
|
167
172
|
if (!active || result.indexOf(active) < 0) {
|
package/coms/pivot/plist.js
CHANGED
|
@@ -9,8 +9,7 @@ function plist() {
|
|
|
9
9
|
var parse = function (a) {
|
|
10
10
|
switch (typeof a) {
|
|
11
11
|
case "string":
|
|
12
|
-
if (!
|
|
13
|
-
else if (!type) type = a;
|
|
12
|
+
if (!type) type = a;
|
|
14
13
|
else if (!edit_ref) edit_ref = a;
|
|
15
14
|
else idkey = a;
|
|
16
15
|
break;
|
|
@@ -31,11 +30,16 @@ function plist() {
|
|
|
31
30
|
} = a);
|
|
32
31
|
}
|
|
33
32
|
break;
|
|
33
|
+
case "function":
|
|
34
|
+
if (!title) title = a;
|
|
35
|
+
else if (!fields) fields = a;
|
|
36
|
+
else if (!options) options = a;
|
|
37
|
+
else if (!buttons) buttons = a;
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
for (var a of arguments) parse(a);
|
|
37
41
|
if (!fields) parse(this);
|
|
38
|
-
if (!idkey) idkey = fields[0].key;
|
|
42
|
+
if (!idkey) idkey = (isFunction(fields) ? fields() : fields)[0].key;
|
|
39
43
|
return frame$list(title, {
|
|
40
44
|
load() {
|
|
41
45
|
return load(type, idkey);
|
|
@@ -49,8 +53,7 @@ function plist() {
|
|
|
49
53
|
}, edit_ref ? edit_ref : function (o) {
|
|
50
54
|
var p = pedit(title, type, o);
|
|
51
55
|
p.initialStyle = popup.style;
|
|
52
|
-
popup(p,
|
|
53
|
-
move.setPosition(p, [.5, .5]);
|
|
56
|
+
popup(p, [.5, .5]);
|
|
54
57
|
return p;
|
|
55
58
|
});
|
|
56
59
|
}
|
|
@@ -353,7 +353,11 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
353
353
|
var copyZIndex = function (e) {
|
|
354
354
|
e.style.zIndex = zIndex;
|
|
355
355
|
var z = zIndex - 1;
|
|
356
|
-
|
|
356
|
+
var ws = e.with;
|
|
357
|
+
if (ws){
|
|
358
|
+
if (isNode(ws)) ws = [ws];
|
|
359
|
+
for (var w of ws) w.style.zIndex = z;
|
|
360
|
+
}
|
|
357
361
|
};
|
|
358
362
|
if (zIndex > 2) {
|
|
359
363
|
previousElements.forEach(copyZIndex);
|
package/coms/zimoli/moveupon.js
CHANGED
|
@@ -29,7 +29,9 @@ if (/Firefox/.test(navigator.userAgent)) on('dragstart')(document, function (e)
|
|
|
29
29
|
return false;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
var locktouch = function (target) {
|
|
32
|
+
var locktouch = function (target, handles) {
|
|
33
|
+
var resizing = moveupon.resizing;
|
|
34
|
+
if (resizing) return resizing !== handles;
|
|
33
35
|
if (target.resizable) return false;
|
|
34
36
|
if (/(input|textarea|select)/i.test(target.tagName) || getTargetIn(a => String(a.contentEditable) === 'true' || a.draggable, target)) {
|
|
35
37
|
return true;
|
|
@@ -49,7 +51,8 @@ var locktouch = function (target) {
|
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
53
|
|
|
52
|
-
function moveupon(target,
|
|
54
|
+
function moveupon(target, handles, initialEvent) {
|
|
55
|
+
var { start, move, end } = handles;
|
|
53
56
|
var touchLocked = false;
|
|
54
57
|
var offmouseup, offtouchend, offtouchcancel;
|
|
55
58
|
var mousemove = function (event) {
|
|
@@ -83,7 +86,7 @@ function moveupon(target, { start, move, end }, initialEvent) {
|
|
|
83
86
|
};
|
|
84
87
|
|
|
85
88
|
if (initialEvent) {
|
|
86
|
-
if (locktouch(initialEvent.target)) return;
|
|
89
|
+
if (locktouch(initialEvent.target, handles)) return;
|
|
87
90
|
if (initialEvent.type === "touchstart") {
|
|
88
91
|
extendTouchEvent(initialEvent);
|
|
89
92
|
initialEvent.preventDefault();
|
|
@@ -96,14 +99,14 @@ function moveupon(target, { start, move, end }, initialEvent) {
|
|
|
96
99
|
}
|
|
97
100
|
onmousedown(target, function (event) {
|
|
98
101
|
if (touchLocked) return;
|
|
99
|
-
if (locktouch(event.target)) return;
|
|
102
|
+
if (locktouch(event.target, handles)) return;
|
|
100
103
|
touchLocked = true;
|
|
101
104
|
hookmouse(event);
|
|
102
105
|
if (isFunction(start)) start.call(this, event);
|
|
103
106
|
});
|
|
104
107
|
ontouchstart(target, function (event) {
|
|
105
108
|
if (touchLocked) return;
|
|
106
|
-
if (locktouch(event.target)) return;
|
|
109
|
+
if (locktouch(event.target, handles)) return;
|
|
107
110
|
touchLocked = true;
|
|
108
111
|
extendTouchEvent(event);
|
|
109
112
|
hooktouch(event);
|
package/coms/zimoli/prompt.js
CHANGED
|
@@ -42,6 +42,7 @@ function prompt() {
|
|
|
42
42
|
else if (isFunction(arg) || arg instanceof RegExp) check = arg;
|
|
43
43
|
else if (isObject(arg)) {
|
|
44
44
|
if (isFunction(arg.test)) check = arg;
|
|
45
|
+
if (isFunction(arg.check)) check = arg.check;
|
|
45
46
|
if (isFunction(arg.submit)) submit = arg;
|
|
46
47
|
if (isString(arg.msg || arg.title)) msg = arg.msg || arg.title;
|
|
47
48
|
if (isHandled(arg.value)) value = arg.value;
|
package/coms/zimoli/render.js
CHANGED
package/coms/zimoli/resize.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
var resizingElements = [];
|
|
2
|
+
var currentResizing = null;
|
|
2
3
|
var getResizer = function (event) {
|
|
4
|
+
moveupon.resizing = null;
|
|
3
5
|
if (dragging) return;
|
|
4
6
|
var rect = getTargetIn(a => ~resizingElements.indexOf(a), event.target);
|
|
5
7
|
if (!rect) {
|
|
@@ -46,6 +48,7 @@ var getResizer = function (event) {
|
|
|
46
48
|
resize.height = parseFloat(computedStyle.height);
|
|
47
49
|
resize.rect = rect;
|
|
48
50
|
resize.cursor = fringe.cursor;
|
|
51
|
+
moveupon.resizing = handle;
|
|
49
52
|
return resize;
|
|
50
53
|
}
|
|
51
54
|
};
|
package/coms/zimoli/tree.js
CHANGED
|
@@ -201,6 +201,7 @@ function tree() {
|
|
|
201
201
|
css(banner, { paddingBottom: '' });
|
|
202
202
|
};
|
|
203
203
|
var time = size => (Math.log(-size / 30 + 2) * 100 | 0) / 1000;
|
|
204
|
+
var maxAnimateHeight = Math.min(element.clientHeight >> 1, screen.height >> 1) || 100;
|
|
204
205
|
if (com.isClosed() && com.length) {
|
|
205
206
|
z0();
|
|
206
207
|
setState(true);
|
|
@@ -213,6 +214,7 @@ function tree() {
|
|
|
213
214
|
} else {
|
|
214
215
|
marginTop = top.offsetTop - bottom.offsetTop - bottom.offsetHeight;
|
|
215
216
|
}
|
|
217
|
+
if (maxAnimateHeight && marginTop < -maxAnimateHeight) marginTop = -maxAnimateHeight | 0;
|
|
216
218
|
var res = transition(top, {
|
|
217
219
|
transition: `margin-top ${time(marginTop)}s ease-out`,
|
|
218
220
|
marginTop: fromOffset(marginTop)
|
|
@@ -231,7 +233,8 @@ function tree() {
|
|
|
231
233
|
}
|
|
232
234
|
setState(false);
|
|
233
235
|
z0();
|
|
234
|
-
var
|
|
236
|
+
var maxAnimateHeight = 100;
|
|
237
|
+
if (maxAnimateHeight && margin_top < -maxAnimateHeight) margin_top = -maxAnimateHeight | 0;
|
|
235
238
|
var res = transition(change_elem, { transition: `margin-top ${time(margin_top)}s ease-out`, marginTop: fromOffset(margin_top) }, false);
|
|
236
239
|
timeout(z1, res + 60);
|
|
237
240
|
}
|
package/coms/zimoli/zimoli.js
CHANGED
|
@@ -430,7 +430,7 @@ function create(pagepath, args, from, needroles, zimolidata) {
|
|
|
430
430
|
isRecover = isR;
|
|
431
431
|
addGlobal(this, history_name, isRecover);
|
|
432
432
|
}
|
|
433
|
-
_page.$reload = function () {
|
|
433
|
+
_page.$reload = _page.$reload || _page.reload || function () {
|
|
434
434
|
var _page = create(pagepath, undefined, from, undefined, zimolidata);
|
|
435
435
|
_page.mount(history_name, isRecover);
|
|
436
436
|
return _page;
|
|
@@ -891,7 +891,7 @@ zimoli.enableTouchBack = function () {
|
|
|
891
891
|
}
|
|
892
892
|
}, 'x')
|
|
893
893
|
};
|
|
894
|
-
|
|
894
|
+
var reloadFully = function () {
|
|
895
895
|
for (var k in history) {
|
|
896
896
|
var h = history[k];
|
|
897
897
|
if (!h) continue;
|
|
@@ -913,6 +913,17 @@ zimoli.reload = function () {
|
|
|
913
913
|
current_history = default_history;
|
|
914
914
|
body = document.body;
|
|
915
915
|
zimoli();
|
|
916
|
+
}
|
|
917
|
+
var reloadMounted = function () {
|
|
918
|
+
for (var k in global) {
|
|
919
|
+
var o = global[k];
|
|
920
|
+
if (!o || !o.$reload) continue;
|
|
921
|
+
if (isMounted(o)) o.$reload();
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
zimoli.reload = function (reloadAll = true) {
|
|
925
|
+
if (!reloadAll) reloadMounted();
|
|
926
|
+
else reloadFully();
|
|
916
927
|
};
|
|
917
928
|
zimoli.alert = function () {
|
|
918
929
|
var ae = alert.apply(this, arguments);
|
|
@@ -50,17 +50,22 @@ var codecolor = function (c, encode) {
|
|
|
50
50
|
isConstValue = a => strap_reg.test(a) || value_reg.test(a);
|
|
51
51
|
}
|
|
52
52
|
var isInvoke = function (o) {
|
|
53
|
-
var
|
|
53
|
+
var p = o.prev;
|
|
54
|
+
if (p?.type === STRAP && /^(invoke|call)$/i.test(p.text)) return true;
|
|
55
|
+
o = o.next;
|
|
56
|
+
if (o?.type === STRAP && /^(proc|endp)$/i.test(o.text)) return true;
|
|
54
57
|
if (o?.type === EXPRESS && needhead_reg.test(o.text)) o = o.next;
|
|
55
58
|
if (o?.type === ELEMENT && o.istype) o = o.next;
|
|
56
59
|
if (o?.type === STAMP && o.needle) o = o.next;
|
|
57
60
|
if (o?.type === SCOPED && o.entry === "(") return true;
|
|
61
|
+
|
|
58
62
|
return false;
|
|
59
63
|
};
|
|
60
64
|
var setExpress = function (o, label) {
|
|
61
65
|
if (!o.text || o.wraped) return;
|
|
62
66
|
o.wraped = true;
|
|
63
67
|
var keys = o.text.split(".");
|
|
68
|
+
if (!keys[0] && keys.length > 1) keys.shift(), keys[0] = "." + keys[0];
|
|
64
69
|
var invoked = null;
|
|
65
70
|
var endi = keys.length - 1;
|
|
66
71
|
if (isInvoke(o)) {
|
|
@@ -86,7 +91,7 @@ var codecolor = function (c, encode) {
|
|
|
86
91
|
used[k].forEach(k in predefs ? setPredef : setOutside);
|
|
87
92
|
}
|
|
88
93
|
if (c.program) var { space_exp: spaceReg, control_reg } = c.program;
|
|
89
|
-
if (spaceReg) var unspaceReg = new RegExp(`(?:${spaces.avoid(光标)}
|
|
94
|
+
if (spaceReg) var unspaceReg = new RegExp(`(?:${spaces.avoid(光标)})+`, 'g');
|
|
90
95
|
var wraptext = function (t, l) {
|
|
91
96
|
if (unspaceReg) t = t.replace(unspaceReg, a => {
|
|
92
97
|
if (encode) a = encode(a);
|
|
@@ -159,7 +164,6 @@ var codecolor = function (c, encode) {
|
|
|
159
164
|
setExpress(o, 'method');
|
|
160
165
|
}
|
|
161
166
|
else setExpress(o, 'property');
|
|
162
|
-
|
|
163
167
|
break;
|
|
164
168
|
case EXPRESS:
|
|
165
169
|
setExpress(o, o.istype || o.isdef || o.next?.needle ? 'predef' : 'express');
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
if (ta === " " && isEqual(tb, anchorChar)) {
|
|
203
203
|
col++;
|
|
204
204
|
}
|
|
205
|
-
else if (isEqual(ta, anchorChar) && !isEqual(tb, anchorChar)) {
|
|
205
|
+
else if (anchorChar && tb && isEqual(ta, anchorChar) && !isEqual(tb, anchorChar)) {
|
|
206
206
|
col++;
|
|
207
207
|
}
|
|
208
208
|
else if (anchorChar === " " && isEqual(ta, followChar) && !isEqual(tf, followChar)) {
|
|
@@ -286,6 +286,8 @@
|
|
|
286
286
|
};
|
|
287
287
|
var updatechar = function (event) {
|
|
288
288
|
if (event.defaultPrevented) return;
|
|
289
|
+
anchorChar = "";
|
|
290
|
+
followChar = '';
|
|
289
291
|
coderid++;
|
|
290
292
|
var { anchorNode, anchorOffset } = document_selection;
|
|
291
293
|
if (!coder || !anchorNode) return;
|
|
@@ -452,7 +454,7 @@
|
|
|
452
454
|
document.execCommand('forwardDelete');
|
|
453
455
|
}
|
|
454
456
|
else if (data in pairsmap) {
|
|
455
|
-
if (inText) {
|
|
457
|
+
if (inText && anchorChar) {
|
|
456
458
|
if (/^'/.test(data)) return;
|
|
457
459
|
}
|
|
458
460
|
patchAfter = pairsmap[data];
|
|
@@ -460,7 +462,7 @@
|
|
|
460
462
|
}
|
|
461
463
|
else {
|
|
462
464
|
if (data in pairsmap) {
|
|
463
|
-
if (inText) {
|
|
465
|
+
if (inText && anchorChar) {
|
|
464
466
|
if (/^'/.test(data)) return;
|
|
465
467
|
}
|
|
466
468
|
patchAfter = pairsmap[data];
|
|
@@ -482,6 +484,7 @@
|
|
|
482
484
|
}
|
|
483
485
|
if (patchAfter) {
|
|
484
486
|
insertText(patchAfter, true);
|
|
487
|
+
followChar = patchAfter;
|
|
485
488
|
markAnchorOffset();
|
|
486
489
|
}
|
|
487
490
|
return patchAfter;
|
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
var { SCOPED, QUOTED, SPACE, STAMP, STRAP, EXPRESS, PROPERTY } = compile$common;
|
|
2
|
-
var asm = new compile$
|
|
3
|
-
asm.straps = [
|
|
4
|
-
"include", "includelib",
|
|
5
|
-
"typedef",
|
|
6
|
-
"proto",
|
|
7
|
-
'equ', "and", 'or', 'not', "sizeof",
|
|
8
|
-
"invoke", "offset", 'addr',
|
|
9
|
-
"end", "start",
|
|
10
|
-
"proc", "endp", "uses",
|
|
11
|
-
"macro", 'struct', "ends",
|
|
12
|
-
".if", ".elseif", '.else', '.break', '.endif', '.while', '.endw', "db", 'real4', 'real8', 'dw', 'dd', 'dq', 'byte', 'word', 'dword', 'qword', 'tword', 'dt',
|
|
13
|
-
];
|
|
14
|
-
asm.control_reg = /^\.[\w]+$/;
|
|
15
|
-
asm.stamps = [",", ":", "<", ">", "=", "&", "|", "*", "~", "!", "+", "-", '/'];
|
|
16
|
-
asm.quotes = [
|
|
17
|
-
["'", "'"],
|
|
18
|
-
['"', '"']
|
|
19
|
-
];
|
|
20
|
-
asm.comments = [
|
|
21
|
-
[";", /(?=[\r\n\u2028\u2029])/]
|
|
22
|
-
];
|
|
23
|
-
|
|
2
|
+
var asm = new compile$Asm;
|
|
24
3
|
var go = new compile$Javascript;
|
|
25
4
|
go.straps = ["var", 'for', 'package', "import", 'type', 'func', 'struct', 'return', 'go', 'const', 'if', 'else', 'switch', 'case', 'default', 'range'];
|
|
26
5
|
go.istype = function (o) {
|
package/docs/main.xht
CHANGED
|
@@ -172,8 +172,10 @@
|
|
|
172
172
|
<div1 #content></div1>
|
|
173
173
|
<open #switch @click="switchMenu()" insert></open>
|
|
174
174
|
<script>
|
|
175
|
-
i18n.setReloader(
|
|
176
|
-
|
|
175
|
+
i18n.setReloader(function () {
|
|
176
|
+
initMenus();
|
|
177
|
+
});
|
|
178
|
+
var menus = () => [
|
|
177
179
|
{
|
|
178
180
|
name: i18n`efront简介`,
|
|
179
181
|
children: [
|
|
@@ -214,12 +216,12 @@
|
|
|
214
216
|
}
|
|
215
217
|
]);
|
|
216
218
|
});
|
|
217
|
-
var initVersionInfo = async function () {
|
|
219
|
+
var initVersionInfo = async function (menus) {
|
|
218
220
|
var xhr = await cross("get", "version");
|
|
219
221
|
var version = xhr.response.split(",");
|
|
220
222
|
menus[0].name += ` <v>${version[0]}</v>`;
|
|
221
223
|
};
|
|
222
|
-
var initCommandsDocs = async function () {
|
|
224
|
+
var initCommandsDocs = async function (menus) {
|
|
223
225
|
delete modules['docs$helps'];
|
|
224
226
|
var helps = await init("docs$helps");
|
|
225
227
|
var m = {
|
|
@@ -244,7 +246,7 @@
|
|
|
244
246
|
});
|
|
245
247
|
menus.splice(1, 0, m);
|
|
246
248
|
};
|
|
247
|
-
var initComponentDocs = async function () {
|
|
249
|
+
var initComponentDocs = async function (menus) {
|
|
248
250
|
var m = await cross("get", "components");
|
|
249
251
|
m = JSON.parse(m.response);
|
|
250
252
|
for (var c of m) {
|
|
@@ -280,17 +282,19 @@
|
|
|
280
282
|
menus[2].children = m;
|
|
281
283
|
};
|
|
282
284
|
var initMenus = async function () {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
await
|
|
287
|
-
await
|
|
288
|
-
|
|
289
|
-
|
|
285
|
+
var ms = menus();
|
|
286
|
+
ms[0].children.forEach(c => { c.path = "/mark/" + c.md });
|
|
287
|
+
zimoli.switch('', scope.content, ms[0].children[0].path);
|
|
288
|
+
await initVersionInfo(ms);
|
|
289
|
+
await initCommandsDocs(ms);
|
|
290
|
+
await initComponentDocs(ms);
|
|
291
|
+
var route = frame$route;
|
|
292
|
+
scope.menus = route;
|
|
293
|
+
route.update(ms);
|
|
290
294
|
route.open(route.active);
|
|
291
295
|
};
|
|
292
296
|
var scope = {
|
|
293
|
-
menus,
|
|
297
|
+
menus: [],
|
|
294
298
|
div2(elem, scope) {
|
|
295
299
|
if (scope.m.data?.mark) elem.setAttribute("mark", '');
|
|
296
300
|
if (scope.m.data?.test) elem.setAttribute("test", '');
|
|
@@ -326,10 +330,10 @@
|
|
|
326
330
|
drag.on(close, window);
|
|
327
331
|
}
|
|
328
332
|
render(page, scope);
|
|
329
|
-
var
|
|
333
|
+
var scrbar = scrollbar();
|
|
330
334
|
on("mounted")(page, initMenus);
|
|
331
|
-
|
|
332
|
-
page.with =
|
|
335
|
+
scrbar.bindTarget(scope.content);
|
|
336
|
+
page.with = scrbar;
|
|
333
337
|
resizingList.set(page, function () {
|
|
334
338
|
if (page.adapted === true) return;
|
|
335
339
|
if (calcPixel(page.offsetWidth) < 720) return;
|
|
@@ -338,7 +342,7 @@
|
|
|
338
342
|
});
|
|
339
343
|
bind("render")(page, function () {
|
|
340
344
|
requestAnimationFrame(function () {
|
|
341
|
-
|
|
345
|
+
scrbar.reshape();
|
|
342
346
|
})
|
|
343
347
|
});
|
|
344
348
|
drag.on(scope.switch);
|
|
@@ -66,41 +66,42 @@
|
|
|
66
66
|
</div>
|
|
67
67
|
<script>
|
|
68
68
|
var position = [.2, .2];
|
|
69
|
-
var page = view();
|
|
70
|
-
page.innerHTML = template;
|
|
71
|
-
once("append")(page, function () {
|
|
72
|
-
move.setPosition(this, position);
|
|
73
|
-
});
|
|
74
|
-
var scope = {
|
|
75
|
-
help: null,
|
|
76
|
-
dict: helps.topics,
|
|
77
|
-
cmds(elem, scope) {
|
|
78
|
-
var topics = scope.topics = [];
|
|
79
|
-
var cmds = scope.c.split(/\s+/).map(a => a.split("|"));
|
|
80
|
-
cmds = combine(...cmds).map(a => "<efront></efront>" + a.join(" ")).join("<br/>");
|
|
81
|
-
elem.innerHTML = cmds.replace(/[A-Z]+(\_[A-Z]+)*/g, m => {
|
|
82
|
-
if (topics.indexOf(m) < 0) topics.push(m);
|
|
83
|
-
return `<w>${m}</w>`;
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
|
-
topic(elem, s) {
|
|
87
|
-
var topics = s.topics.filter(a => scope.dict[a]);
|
|
88
|
-
if (!topics.length) return;
|
|
89
|
-
elem.innerHTML = i18n`其中,` + topics.map(a => {
|
|
90
|
-
var d = scope.dict[a];
|
|
91
|
-
var t = i18n`${a}是${d[0]}`;
|
|
92
|
-
if (d.length > 1) t += i18n`,可取值有${d.slice(1).join('、')}`;
|
|
93
|
-
if (d.default) t += i18n`,默认值是${d.default}`;
|
|
94
|
-
return t;
|
|
95
|
-
}).join(';');
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
drag.on(page, page.firstElementChild);
|
|
99
|
-
resize.on(page);
|
|
100
|
-
render(page, scope);
|
|
101
69
|
function main(dict) {
|
|
70
|
+
var page = view();
|
|
71
|
+
var helps = init('docs$helps');
|
|
72
|
+
once("append")(page, function () {
|
|
73
|
+
move.setPosition(this, position);
|
|
74
|
+
});
|
|
75
|
+
var scope = {
|
|
76
|
+
help: null,
|
|
77
|
+
dict: helps.topics,
|
|
78
|
+
cmds(elem, scope) {
|
|
79
|
+
var topics = scope.topics = [];
|
|
80
|
+
var cmds = scope.c.split(/\s+/).map(a => a.split("|"));
|
|
81
|
+
cmds = combine(...cmds).map(a => "<efront></efront>" + a.join(" ")).join("<br/>");
|
|
82
|
+
elem.innerHTML = cmds.replace(/[A-Z]+(\_[A-Z]+)*/g, m => {
|
|
83
|
+
if (topics.indexOf(m) < 0) topics.push(m);
|
|
84
|
+
return `<w>${m}</w>`;
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
topic(elem, s) {
|
|
88
|
+
var topics = s.topics.filter(a => scope.dict[a]);
|
|
89
|
+
if (!topics.length) return;
|
|
90
|
+
elem.innerHTML = i18n`其中,` + topics.map(a => {
|
|
91
|
+
var d = scope.dict[a];
|
|
92
|
+
var t = i18n`${a}是${d[0]}`;
|
|
93
|
+
if (d.length > 1) t += i18n`,可取值有${d.slice(1).join('、')}`;
|
|
94
|
+
if (d.default) t += i18n`,默认值是${d.default}`;
|
|
95
|
+
return t;
|
|
96
|
+
}).join(';');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
102
99
|
var [help] = helps.helps.filter(h => dict === h.info);
|
|
103
100
|
scope.help = help;
|
|
101
|
+
drag.on(page, page.firstElementChild);
|
|
102
|
+
resize.on(page);
|
|
103
|
+
page.innerHTML = template;
|
|
104
|
+
render(page, scope);
|
|
104
105
|
return page;
|
|
105
106
|
}
|
|
106
107
|
</script>
|