efront 4.23.8 → 4.24.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 +237 -0
- package/apps/pivot/#/345/233/275/351/231/205/345/214/226.yml +2 -0
- package/apps/pivot/auth/login.html +2 -1
- package/apps/pivot/auth/login.js +1 -0
- package/apps/pivot/auth/login.less +1 -0
- package/apps/pivot/cert/edit.js +1 -1
- package/apps/pivot/cert/list.js +1 -1
- package/apps/pivot/cert/main.xht +6 -6
- package/apps/pivot/cert/orders.xht +8 -8
- package/apps/pivot/cert/update.xht +3 -3
- package/apps/pivot/db/config.xht +1 -1
- package/apps/pivot/db/edit.xht +4 -5
- package/apps/pivot/db/list.xht +4 -4
- package/apps/pivot/dht/list.js +4 -4
- package/apps/pivot/dict/edit.js +1 -1
- package/apps/pivot/dict/list.js +1 -1
- package/apps/pivot/home/welcome.html +12 -9
- package/apps/pivot/home/welcome.js +3 -3
- package/apps/pivot/link/index.js +7 -4
- package/apps/pivot/link/list.html +2 -2
- package/apps/pivot/link/room.js +2 -2
- package/apps/pivot/main.js +2 -0
- package/apps/pivot/menu-en.yml +16 -0
- package/apps/pivot/proxy/edit.js +1 -1
- package/apps/pivot/proxy/list.js +2 -2
- package/apps/pivot/share/edit.html +3 -3
- package/apps/pivot/share/list.js +3 -3
- package/apps/pivot/task/edit.js +1 -1
- package/apps/pivot/task/invoke.html +1 -1
- package/apps/pivot/task/invoke.js +2 -2
- package/apps/pivot/task/list.js +3 -3
- package/apps/pivot/task/rsync.html +3 -3
- package/apps/pivot/task/rsync.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 +1 -1
- package/apps/pivot//344/270/273/351/241/265.html +1 -1
- package/coms/basic/#loader.js +7 -0
- package/coms/basic/cross_.js +4 -3
- package/coms/basic/i18n-chooser.xht +17 -0
- package/coms/basic/i18n-supports.js +30 -0
- package/coms/basic/i18n.js +25 -1
- package/coms/basic_/Promise.js +21 -18
- package/coms/basic_/WeakMap.js +12 -6
- package/coms/compile/Program.js +4 -4
- package/coms/compile/translate.js +11 -3
- package/coms/frame/list.html +1 -1
- package/coms/frame/list.js +1 -1
- package/coms/frame/route.js +22 -9
- package/coms/pivot/left-footer.xht +4 -1
- package/coms/zimoli/chooseFile.js +1 -1
- package/coms/zimoli/cless.js +2 -2
- package/coms/zimoli/confirm.js +7 -1
- package/coms/zimoli/createUploadURL.js +1 -1
- package/coms/zimoli/field.html +1 -1
- package/coms/zimoli/field.js +1 -0
- package/coms/zimoli/field.less +3 -1
- package/coms/zimoli/getCursorPosition.js +1 -1
- package/coms/zimoli/menu.js +1 -1
- package/coms/zimoli/menuItem.js +3 -1
- package/coms/zimoli/prompt.js +19 -26
- package/coms/zimoli/prompt.less +20 -7
- package/coms/zimoli/render.js +17 -8
- package/coms/zimoli/selectList.js +3 -3
- package/coms/zimoli/selectListEdit.html +5 -5
- package/coms/zimoli/yousure.js +2 -2
- package/coms/zimoli/zimoli.js +47 -14
- package/coms//350/214/250/350/217/260/tab.js +1 -0
- package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +50 -11
- package/docs/main.xht +19 -6
- package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +3 -36
- package/docs//347/273/204/344/273/266.xht +1 -1
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/public/pivot/api.yml +0 -46
- package/public/pivot/menu.yml +0 -16
- package/public/pivot/page/auth/login.txt +0 -1
- package/public/pivot/page/cert/main.txt +0 -1
- package/public/pivot/page/cert/orders.txt +0 -1
- package/public/pivot/page/cert/update.txt +0 -1
- package/public/pivot/page/db/act.txt +0 -1
- package/public/pivot/page/db/config.txt +0 -1
- package/public/pivot/page/db/edit.txt +0 -1
- package/public/pivot/page/db/list.txt +0 -1
- package/public/pivot//344/270/273/351/241/265.html +0 -46
package/apps/pivot/share/list.js
CHANGED
|
@@ -5,7 +5,7 @@ function main() {
|
|
|
5
5
|
var options = [
|
|
6
6
|
{
|
|
7
7
|
name(e) {
|
|
8
|
-
return this.confirm === e ?
|
|
8
|
+
return this.confirm === e ? i18n`确认取消` : i18n`取消`
|
|
9
9
|
},
|
|
10
10
|
type: 'danger',
|
|
11
11
|
confirm: false,
|
|
@@ -32,7 +32,7 @@ function main() {
|
|
|
32
32
|
});
|
|
33
33
|
},
|
|
34
34
|
fields: fields.concat({
|
|
35
|
-
name:
|
|
35
|
+
name: i18n`操作`,
|
|
36
36
|
width: 200,
|
|
37
37
|
type: 'button',
|
|
38
38
|
options,
|
|
@@ -42,7 +42,7 @@ function main() {
|
|
|
42
42
|
scope.load();
|
|
43
43
|
contextmenu(page, [
|
|
44
44
|
{
|
|
45
|
-
name:
|
|
45
|
+
name: i18n`添加`,
|
|
46
46
|
do(e) {
|
|
47
47
|
zimoli.prepare("/share/edit", function () {
|
|
48
48
|
var p = popup("/share/edit", { fields });
|
package/apps/pivot/task/edit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
pedit.bind(null,
|
|
1
|
+
pedit.bind(null, i18n`任务`, "task");
|
|
@@ -19,12 +19,12 @@ function main(a) {
|
|
|
19
19
|
jscode: 茨菰$编辑框,
|
|
20
20
|
async run() {
|
|
21
21
|
var id = ++taskid;
|
|
22
|
-
this.output =
|
|
22
|
+
this.output = i18n`正在执行..`;
|
|
23
23
|
this.error = false;
|
|
24
24
|
var params = JSON.stringify(this.data);
|
|
25
25
|
try {
|
|
26
26
|
var res = await data.from("invoke", { key: a.key, params: encode62.packencode(params) }, function (a) {
|
|
27
|
-
return a ? encode62.packdecode(a) :
|
|
27
|
+
return a ? encode62.packdecode(a) : i18n`完成!`;
|
|
28
28
|
});
|
|
29
29
|
if (id !== taskid) return;
|
|
30
30
|
this.output = res;
|
package/apps/pivot/task/list.js
CHANGED
|
@@ -5,7 +5,7 @@ model.setEditor('jscode', function (element) {
|
|
|
5
5
|
return element;
|
|
6
6
|
});
|
|
7
7
|
model.setReader('jscode', "text");
|
|
8
|
-
return plist.bind(null,
|
|
8
|
+
return plist.bind(null, i18n`任务管理`, "task", refilm`
|
|
9
9
|
*任务ID/key 100
|
|
10
10
|
*任务名/name 100
|
|
11
11
|
*是否启用/status radio 不启用#ccc,启用#396
|
|
@@ -15,7 +15,7 @@ return plist.bind(null, '任务管理', "task", refilm`
|
|
|
15
15
|
when(o) {
|
|
16
16
|
return o.status === 1;
|
|
17
17
|
},
|
|
18
|
-
name:
|
|
18
|
+
name: i18n`执行`, do(o) {
|
|
19
19
|
popup("/task/invoke", o);
|
|
20
20
|
}
|
|
21
21
|
},
|
|
@@ -23,7 +23,7 @@ return plist.bind(null, '任务管理', "task", refilm`
|
|
|
23
23
|
when(o) {
|
|
24
24
|
return o.status === 1;
|
|
25
25
|
},
|
|
26
|
-
name:
|
|
26
|
+
name: i18n`同步`, do(o) {
|
|
27
27
|
popup("/task/rsync", o);
|
|
28
28
|
}
|
|
29
29
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div head>
|
|
2
|
-
|
|
2
|
+
${i18n`同步任务`} - <span -text=task.name></span>(<span -text=task.key></span>)
|
|
3
3
|
<close @click="remove()"></close>
|
|
4
4
|
</div>
|
|
5
5
|
<div body>
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
<a @click="checked[h.key]=!checked[h.key]" disabled:="h.key===base.host" :class="{finished:finished[h.key]}">
|
|
8
8
|
<checker -model="checked[h.key]"></checker>
|
|
9
9
|
<span -text="h.name"></span>
|
|
10
|
-
<span v-if="h.key===base.host"
|
|
10
|
+
<span v-if="h.key===base.host">(${i18n`当前`})</span>
|
|
11
11
|
</a>
|
|
12
12
|
</padding>
|
|
13
13
|
</div>
|
|
14
14
|
<div foot>
|
|
15
|
-
<btn @click="flush()"
|
|
15
|
+
<btn @click="flush()">${i18n`同步`}</btn>
|
|
16
16
|
</div>
|
package/apps/pivot/task/rsync.js
CHANGED
package/apps/pivot/token/edit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
pedit.bind(null,
|
|
1
|
+
pedit.bind(null, i18n`密钥`, "private");
|
package/apps/pivot/token/list.js
CHANGED
package/apps/pivot/wow/root.js
CHANGED
|
@@ -126,7 +126,7 @@ function main(path) {
|
|
|
126
126
|
},
|
|
127
127
|
async mov(from, distpath) {
|
|
128
128
|
var currentHost = data.getInstance("base").base;
|
|
129
|
-
if (from.host !== currentHost) return alert(
|
|
129
|
+
if (from.host !== currentHost) return alert(i18n`暂不支持跨服务器操作!`);
|
|
130
130
|
from = encode62.packencode(from.fullpath);
|
|
131
131
|
distpath = encode62.packencode(distpath);
|
|
132
132
|
await data.from("folder", { opt: 'mov', path: from, to: distpath }).loading_promise;
|
package/coms/basic/#loader.js
CHANGED
|
@@ -494,11 +494,17 @@ var createModule = function (exec, originNames, compiledNames, prebuilds = {}) {
|
|
|
494
494
|
for (var k in prebuilds) if (hasOwnProperty.call(prebuilds, k)) prebuilds2[k] = prebuilds[k];
|
|
495
495
|
prebuilds = prebuilds2;
|
|
496
496
|
}
|
|
497
|
+
var isCless = argName === 'cless';
|
|
498
|
+
if (isCless && exec[argName]) return exec[argName];
|
|
497
499
|
var promise = init(aName, function (res) {
|
|
500
|
+
if (isCless) res = exec[argName] = res.bind(document.createElement('style'));
|
|
498
501
|
result = res;
|
|
499
502
|
created = true;
|
|
500
503
|
}, prebuilds);
|
|
501
504
|
if (created) return result;
|
|
505
|
+
if (isCless) promise = exec[argName] = promise.then(a => {
|
|
506
|
+
return result;
|
|
507
|
+
})
|
|
502
508
|
return promise;
|
|
503
509
|
});
|
|
504
510
|
var _this = isModuleInit ? exports : window;
|
|
@@ -651,6 +657,7 @@ var init = function (url, then, prebuilds, keeppage) {
|
|
|
651
657
|
if (saveAsModule) {
|
|
652
658
|
penddings[key] = created;
|
|
653
659
|
created.then(function (res) {
|
|
660
|
+
delete penddings[key];
|
|
654
661
|
then(modules[url] = res);
|
|
655
662
|
});
|
|
656
663
|
return;
|
package/coms/basic/cross_.js
CHANGED
|
@@ -379,9 +379,10 @@ function cross_(jsonp, digest = noop, method, url, headers) {
|
|
|
379
379
|
if (is_gb2312) method = method.slice(1);
|
|
380
380
|
if (nocross) {
|
|
381
381
|
extend(realHeaders, _headers);
|
|
382
|
-
|
|
382
|
+
method = method.toUpperCase();
|
|
383
|
+
xhr.open(method, url, true);
|
|
383
384
|
} else {
|
|
384
|
-
xhr.open(method, getCrossUrl(url, _headers, isencrypt && code));
|
|
385
|
+
xhr.open(method, getCrossUrl(url, _headers, isencrypt && code), true);
|
|
385
386
|
}
|
|
386
387
|
if (is_gb2312) xhr.overrideMimeType("text/plain; charset=gb2312");
|
|
387
388
|
if (location_href) delete realHeaders.Cookie;
|
|
@@ -393,7 +394,7 @@ function cross_(jsonp, digest = noop, method, url, headers) {
|
|
|
393
394
|
else send.call(xhr);
|
|
394
395
|
digest();
|
|
395
396
|
};
|
|
396
|
-
Promise.resolve(xhr.encrypt).then(fire
|
|
397
|
+
Promise.resolve(xhr.encrypt).then(fire).catch(onerror1);
|
|
397
398
|
}
|
|
398
399
|
var setRequestHeader = xhr.setRequestHeader;
|
|
399
400
|
var realHeaders = Object.create(null);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
&>select {
|
|
3
|
+
background: inherit;
|
|
4
|
+
vertical-align: top;
|
|
5
|
+
color: inherit;
|
|
6
|
+
margin-left: -2px;
|
|
7
|
+
padding-left: 2px;
|
|
8
|
+
}
|
|
9
|
+
</style>
|
|
10
|
+
<template>
|
|
11
|
+
<select -model="i18n.getIndex,i18n.setIndex" title:="title()" -src="(s,i) in i18n.supports">
|
|
12
|
+
<option -value="i" -bind="s.land===s.name?'🌏'+s.land:'🌐'+s.land +' - '+s.name"></option>
|
|
13
|
+
</select>
|
|
14
|
+
</template>
|
|
15
|
+
<script>
|
|
16
|
+
var title = () => i18n`切换语言`;
|
|
17
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var supports = [
|
|
2
|
+
{ land: i18n`中文简体`, name: `中文简体`, id: "zh", lang: "zh-CN" },
|
|
3
|
+
{ land: i18n`中文繁体`, name: `中文繁體`, id: "cht", lang: "zh-TW" },
|
|
4
|
+
{ land: i18n`英文`, name: `English`, id: "en", lang: "en" },
|
|
5
|
+
{ land: i18n`日语`, name: `日本語`, id: "jp", lang: "ja" },
|
|
6
|
+
{ land: i18n`法语`, name: `Français`, id: "fra", lang: 'fr' },
|
|
7
|
+
{ land: i18n`俄语`, name: `Русский язык`, id: "ru", lang: 'ru' },
|
|
8
|
+
{ land: i18n`韩语`, name: `한국어`, id: "kor", lang: "ko" },
|
|
9
|
+
{ land: i18n`德语`, name: `Deutsch`, id: "de", lang: "de" },
|
|
10
|
+
{ land: i18n`意大利语`, name: `Italiano`, id: "it", lang: 'it' },
|
|
11
|
+
{ land: i18n`泰语`, name: `ภาษาไทย`, id: "th", lang: "th" },
|
|
12
|
+
{ land: i18n`越南语`, name: `Tiếng Việt`, id: "vie", lang: 'vi' },
|
|
13
|
+
{ land: i18n`阿拉伯语`, name: `بالعربية`, id: "ara", lang: "ar" },
|
|
14
|
+
{ land: i18n`荷兰语`, name: `Nederlands`, id: "nl", lang: "nl" },
|
|
15
|
+
{ land: i18n`芬兰语`, name: `suomi`, id: "fin", lang: "fi" },
|
|
16
|
+
{ land: i18n`希腊语`, name: `Ελληνικά`, id: "el", lang: "el" },
|
|
17
|
+
{ land: i18n`西班牙语`, name: `Español`, id: "spa", lang: "es" },
|
|
18
|
+
{ land: i18n`葡萄牙语`, name: `Português`, id: "pt", lang: /pt\-(BR|PT)/ },
|
|
19
|
+
{ land: i18n`匈牙利语`, name: `Húngaro`, id: "hu", lang: 'hu' },
|
|
20
|
+
{ land: i18n`瑞典语`, name: `Svenska`, id: "swe", lang: 'sv' },
|
|
21
|
+
{ land: i18n`丹麦语`, name: `Dansk`, id: "dan", lang: 'da' },
|
|
22
|
+
{ land: i18n`捷克语`, name: `Čeština`, id: "cs", lang: 'cs' },
|
|
23
|
+
{ land: i18n`波兰语`, name: `Polski`, id: "pl" },
|
|
24
|
+
{ land: i18n`保加利亚语`, name: `Български`, id: "bul", lang: "bg" },
|
|
25
|
+
{ land: i18n`爱沙尼亚语`, name: `Eesti keel`, id: "est", lang: 'et' },
|
|
26
|
+
{ land: i18n`罗马尼亚语`, name: `Română`, id: "rom", lang: 'ro' },
|
|
27
|
+
{ land: i18n`斯洛文尼亚语`, name: `slovenski jezik`, id: "slo", lang: 'sl' },
|
|
28
|
+
];
|
|
29
|
+
supports.forEach(s => s.key = s.id);
|
|
30
|
+
module.exports = supports;
|
package/coms/basic/i18n.js
CHANGED
|
@@ -28,4 +28,28 @@ var getLanguageIndexFromName = function (language) {
|
|
|
28
28
|
i18n.setLanguage = function (language) {
|
|
29
29
|
languageIndex = getLanguageIndexFromName(language);
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
i18n.getIndex = function () {
|
|
32
|
+
return languageIndex;
|
|
33
|
+
};
|
|
34
|
+
i18n.setIndex = function (index) {
|
|
35
|
+
languageIndex = +index;
|
|
36
|
+
localStorage.setItem('language-index', index);
|
|
37
|
+
supports = [];
|
|
38
|
+
i18n.supports = supports;
|
|
39
|
+
i18n.reload();
|
|
40
|
+
};
|
|
41
|
+
var relaods = [];
|
|
42
|
+
i18n.reload = function () {
|
|
43
|
+
relaods.forEach(a => a());
|
|
44
|
+
};
|
|
45
|
+
i18n.setReloader = function () {
|
|
46
|
+
relaods = [];
|
|
47
|
+
for (var callback of arguments) {
|
|
48
|
+
if (isFunction(callback)) relaods.push(callback);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
if (this.navigator) i18n.setLanguage(this.navigator.language);
|
|
52
|
+
var i = +localStorage.getItem('language-index');
|
|
53
|
+
if (i >= 0) i18n.setIndex(i);
|
|
54
|
+
else i18n.setIndex(languageIndex);
|
|
55
|
+
var supports;
|
package/coms/basic_/Promise.js
CHANGED
|
@@ -15,32 +15,35 @@ if (!Promise) {
|
|
|
15
15
|
var isThenable = function (pendding) {
|
|
16
16
|
return pendding instanceof Promise || pendding && isFunction(pendding.then);
|
|
17
17
|
};
|
|
18
|
+
var thro = function (error) {
|
|
19
|
+
// <!--
|
|
20
|
+
console.error(i18n`在异步过程中发现未处理的异常:`, error);
|
|
21
|
+
// -->
|
|
22
|
+
};
|
|
18
23
|
var queue = [];
|
|
19
24
|
var running = false;
|
|
20
|
-
var run = function (
|
|
25
|
+
var run = function () {
|
|
21
26
|
while (queue.length) {
|
|
22
27
|
var threads = queue.splice(0, queue.length);
|
|
23
28
|
for (var t of threads) {
|
|
24
|
-
var
|
|
25
|
-
var
|
|
29
|
+
var { $j, $s } = t;
|
|
30
|
+
var PromiseRejectReactions = $j.splice(0, $j.length);
|
|
31
|
+
var PromiseFulfillReactions = $s.splice(0, $s.length);
|
|
26
32
|
if (t.oked) {
|
|
33
|
+
var oked = t.oked[0];
|
|
27
34
|
for (var r of PromiseFulfillReactions) {
|
|
28
|
-
r
|
|
35
|
+
r(oked);
|
|
29
36
|
}
|
|
30
37
|
}
|
|
31
38
|
if (t.ohed) {
|
|
32
39
|
var throwed = t.throwed;
|
|
33
40
|
t.throwed = true;
|
|
41
|
+
var ohed = t.ohed[0];
|
|
34
42
|
if (!throwed && !PromiseRejectReactions.length) {
|
|
35
|
-
|
|
36
|
-
console.warn(i18n`在异步过程中发现未处理的异常:`, t.ohed[0], t.ohed[1], t.ohed[2]);
|
|
37
|
-
// -->
|
|
38
|
-
requestAnimationFrame(function () {
|
|
39
|
-
throw t.ohed[0];
|
|
40
|
-
})
|
|
43
|
+
requestAnimationFrame(thro.bind(null, ohed));
|
|
41
44
|
}
|
|
42
45
|
for (var r of PromiseRejectReactions) {
|
|
43
|
-
r
|
|
46
|
+
r(ohed);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
}
|
|
@@ -54,8 +57,8 @@ if (!Promise) {
|
|
|
54
57
|
requestAnimationFrame(run);
|
|
55
58
|
};
|
|
56
59
|
var Promise = function (executor) {
|
|
57
|
-
this
|
|
58
|
-
this
|
|
60
|
+
this.$j = []; // rejects
|
|
61
|
+
this.$s = []; // resolves
|
|
59
62
|
this.oked = this.ohed = null;
|
|
60
63
|
var p = this;
|
|
61
64
|
var ResolvingFunctions_resolve = function (result) { //ok
|
|
@@ -82,7 +85,7 @@ if (!Promise) {
|
|
|
82
85
|
a = onok(a);
|
|
83
86
|
ok(a);
|
|
84
87
|
} catch (e) {
|
|
85
|
-
oh(e
|
|
88
|
+
oh(e);
|
|
86
89
|
}
|
|
87
90
|
};
|
|
88
91
|
else resolve = ok;
|
|
@@ -91,13 +94,13 @@ if (!Promise) {
|
|
|
91
94
|
a = onoh.apply(null, arguments);
|
|
92
95
|
ok(a);
|
|
93
96
|
} catch (e) {
|
|
94
|
-
oh(e
|
|
97
|
+
oh(e);
|
|
95
98
|
}
|
|
96
99
|
};
|
|
97
100
|
else reject = oh;
|
|
98
101
|
})
|
|
99
|
-
if (resolve) this.
|
|
100
|
-
if (reject) this.
|
|
102
|
+
if (resolve) this.$s.push(resolve);
|
|
103
|
+
if (reject) this.$j.push(reject);
|
|
101
104
|
if (this.oked || this.ohed) fire(this);
|
|
102
105
|
return promise;
|
|
103
106
|
}
|
|
@@ -107,7 +110,7 @@ if (!Promise) {
|
|
|
107
110
|
Promise.all = function (penddings) {
|
|
108
111
|
return new Promise(function (ok, oh) {
|
|
109
112
|
if (!(penddings && penddings.length)) {
|
|
110
|
-
return ok();
|
|
113
|
+
return ok([]);
|
|
111
114
|
}
|
|
112
115
|
var resolved_count = 0,
|
|
113
116
|
results = Array(penddings.length);
|
package/coms/basic_/WeakMap.js
CHANGED
|
@@ -4,11 +4,12 @@ var id = 0;
|
|
|
4
4
|
WeakMap = class WeakMap {
|
|
5
5
|
id = "#" + ++id;
|
|
6
6
|
get(o) {
|
|
7
|
+
if (o == null) return;
|
|
7
8
|
return o[this.id];
|
|
8
9
|
}
|
|
9
10
|
set(o, v) {
|
|
10
11
|
defineObj.value = v;
|
|
11
|
-
|
|
12
|
+
defineProperty(o, this.id, defineObj);
|
|
12
13
|
}
|
|
13
14
|
has(o) {
|
|
14
15
|
return this.id in o;
|
|
@@ -19,18 +20,23 @@ WeakMap = class WeakMap {
|
|
|
19
20
|
}
|
|
20
21
|
var defineObj = {
|
|
21
22
|
value: null,
|
|
22
|
-
enumerable:
|
|
23
|
+
enumerable: false,
|
|
23
24
|
writable: true,
|
|
24
|
-
configurable:
|
|
25
|
+
configurable: true
|
|
25
26
|
}
|
|
26
27
|
var defineProperty = Object.defineProperty;
|
|
27
28
|
try {
|
|
28
29
|
defineProperty(document, '#weakmap', defineObj);
|
|
29
30
|
delete document["#weakmap"];
|
|
30
31
|
} catch {
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
try {
|
|
33
|
+
delete defineObj.enumerable;
|
|
34
|
+
defineProperty(document, '#weakmap', defineObj);
|
|
35
|
+
delete document["#weakmap"];
|
|
36
|
+
} catch {
|
|
37
|
+
defineProperty = function (o, k, d) {
|
|
38
|
+
o[k] = d.value;
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
|
-
delete defineObj.enumerable;
|
|
35
41
|
}
|
|
36
42
|
return WeakMap;
|
package/coms/compile/Program.js
CHANGED
|
@@ -76,7 +76,7 @@ class Program {
|
|
|
76
76
|
["`", "`", /\\[\s\S]/, ["${", "}"]],
|
|
77
77
|
]
|
|
78
78
|
tags = [
|
|
79
|
-
[["<", "</"], /\/?>/, /\\[\s\S]/, "'", '"', "<!--", ["${", "}"]]
|
|
79
|
+
[["<", "</"], /\/?>/, /\\[\s\S]/, "'", '"', "<!--", ["${", "}"], ["<%", "%>"]]
|
|
80
80
|
];
|
|
81
81
|
scriptTags = [];
|
|
82
82
|
ignoreTags = ["STYLE", "SCRIPT"];
|
|
@@ -90,6 +90,7 @@ class Program {
|
|
|
90
90
|
["(", ")"],
|
|
91
91
|
["[", "]"],
|
|
92
92
|
["{", "}"],
|
|
93
|
+
["<%", "%>"],
|
|
93
94
|
]
|
|
94
95
|
stamps = "/=+;|:?<>-!~%^&*,".split("");
|
|
95
96
|
prefix = '&^%?:'.split('');
|
|
@@ -1048,8 +1049,7 @@ class Program {
|
|
|
1048
1049
|
this.stamps.forEach(s => {
|
|
1049
1050
|
if (s.length === 1) tokens[s] = true;
|
|
1050
1051
|
});
|
|
1051
|
-
var scopes = this.scopes.map(a => a.join("")).join("");
|
|
1052
|
-
scopes = this.compile(scopes);
|
|
1052
|
+
var scopes = this.scopes.map(a => a.map(this.compile).join("|")).join("|");
|
|
1053
1053
|
tokens = Object.keys(tokens).join("");
|
|
1054
1054
|
tokens = this.compile(tokens);
|
|
1055
1055
|
var express = `(?:\\\\u\\{[^\\}]+\\}|${spaceDefined.avoid(tokens, false)})+`;
|
|
@@ -1066,7 +1066,7 @@ class Program {
|
|
|
1066
1066
|
this.prefix_reg = prefix_reg;
|
|
1067
1067
|
var numbers = number_reg.source.replace(/^\^|\$$/g, "");
|
|
1068
1068
|
this.digit_reg = new RegExp(/^[+\-]?/.source + numbers, number_reg.flags);
|
|
1069
|
-
this.entry_reg = new RegExp([`${spaceDefined.reg.source}|${quotes_entries}
|
|
1069
|
+
this.entry_reg = new RegExp([`${spaceDefined.reg.source}|${quotes_entries}|${scopes}|${numbers}(?:${spaceDefined.avoid(tokens)})*|${express}|${powers_entries}|[${stamps}]`], "gi");
|
|
1070
1070
|
var stamps = this.stamps.slice();
|
|
1071
1071
|
for (var k in this.powermap) {
|
|
1072
1072
|
if (k.length === 1 && stamps.indexOf(k) < 0) stamps.push(k);
|
|
@@ -156,11 +156,19 @@ function translate([imap, supports], code) {
|
|
|
156
156
|
var a = v.replace(/^[\$&]+/, '');
|
|
157
157
|
var a = (a << 1) - 1;
|
|
158
158
|
if (a in t) v = t[a];
|
|
159
|
-
else v = scanner2(JSON.stringify(v));
|
|
159
|
+
else v = scanner2(`(${JSON.stringify(v)})`)[0];
|
|
160
160
|
}
|
|
161
161
|
else if (/^(name|holder|comment)$/.test(k)) v = ctn('i18n' + getm(v, t.nodup, t.warn), t);
|
|
162
|
-
else v = scanner2(JSON.stringify(v));
|
|
163
|
-
o.push({
|
|
162
|
+
else v = scanner2(`(${JSON.stringify(v)})`)[0];
|
|
163
|
+
o.push({
|
|
164
|
+
type: PROPERTY,
|
|
165
|
+
isprop: true,
|
|
166
|
+
text: JSON.stringify(k),
|
|
167
|
+
}, {
|
|
168
|
+
type: STAMP, text: ':'
|
|
169
|
+
}, ...v, {
|
|
170
|
+
type: STAMP, text: ','
|
|
171
|
+
});
|
|
164
172
|
})
|
|
165
173
|
o.pop();
|
|
166
174
|
setqueue(o);
|
package/coms/frame/list.html
CHANGED
package/coms/frame/list.js
CHANGED
package/coms/frame/route.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
(document.body.hasAttribute('menu-path')
|
|
1
|
+
(document.body.hasAttribute('menu-path')
|
|
2
|
+
|| document.body.hasAttribute("menu")
|
|
3
|
+
|| document.body.hasAttribute("config-path")
|
|
4
|
+
? data.fromURL(document.body.getAttribute('menu-path')
|
|
5
|
+
|| document.body.getAttribute('menu')
|
|
6
|
+
|| document.body.getAttribute('config-path')
|
|
7
|
+
|| 'menu.yml'
|
|
8
|
+
).loading_promise
|
|
9
|
+
: Promise.resolve([])
|
|
10
|
+
).then(function (items) {
|
|
2
11
|
var result = [];
|
|
3
|
-
var
|
|
12
|
+
var idmap = Object.create(null);
|
|
4
13
|
var savedChildren = Object.create(null);
|
|
5
14
|
var savedMenus = Object.create(null);
|
|
6
15
|
var keymap = {};
|
|
@@ -30,10 +39,6 @@
|
|
|
30
39
|
if (!icon && /(?!\.)\.(?=[\w\-])/.test(k)) {
|
|
31
40
|
icon = k.slice(k.indexOf(/(?!\.)\.(?=[\w\-])/));
|
|
32
41
|
}
|
|
33
|
-
if (!icon && /\s+/.test(k)) {
|
|
34
|
-
[icon] = k.split(/\s+/);
|
|
35
|
-
k = k.slice(icon.length).trim();
|
|
36
|
-
}
|
|
37
42
|
if (!name) name = k;
|
|
38
43
|
var item = {};
|
|
39
44
|
if (icon) item.icon = icon.replace(/\./g, ' ');
|
|
@@ -52,7 +57,10 @@
|
|
|
52
57
|
}
|
|
53
58
|
var getChildren = function (menu) {
|
|
54
59
|
if (!menu.id) {
|
|
55
|
-
|
|
60
|
+
var pathid = menu.path;
|
|
61
|
+
if (!idmap[pathid]) idmap[pathid] = 0;
|
|
62
|
+
menu.id = (menu.path || "") + "#" + idmap[pathid];
|
|
63
|
+
idmap[pathid]++;
|
|
56
64
|
}
|
|
57
65
|
if (!savedMenus[menu.id]) {
|
|
58
66
|
savedMenus[menu.id] = menu;
|
|
@@ -124,6 +132,10 @@
|
|
|
124
132
|
result.update = function (items) {
|
|
125
133
|
delete result.loading_promise;
|
|
126
134
|
delete result.then;
|
|
135
|
+
delete result.active;
|
|
136
|
+
savedChildren = Object.create(null);
|
|
137
|
+
savedMenus = Object.create(null);
|
|
138
|
+
idmap = Object.create(null);
|
|
127
139
|
firstMenu = null;
|
|
128
140
|
items = result.parse(items);
|
|
129
141
|
items.map(getChildren);
|
|
@@ -158,7 +170,7 @@
|
|
|
158
170
|
if (actived_value === historys.length) {
|
|
159
171
|
setActive(actived, true);
|
|
160
172
|
result.active = actived;
|
|
161
|
-
}
|
|
173
|
+
}
|
|
162
174
|
}
|
|
163
175
|
}
|
|
164
176
|
first_opened = false;
|
|
@@ -195,6 +207,7 @@
|
|
|
195
207
|
var menu = getChild(zimoli);
|
|
196
208
|
if (!menu) return;
|
|
197
209
|
if (menu !== result.active) {
|
|
210
|
+
console.log(zimoli, menu);
|
|
198
211
|
setActive(result.active, false);
|
|
199
212
|
setActive(menu, true);
|
|
200
213
|
result.active = menu;
|
|
@@ -210,6 +223,7 @@
|
|
|
210
223
|
result.open = function (menu) {
|
|
211
224
|
if (!menu) {
|
|
212
225
|
if (first_opened && result.active) return;
|
|
226
|
+
if (!result.length) result.update(items);
|
|
213
227
|
var zimoilPath = zimoli.getInitPath();
|
|
214
228
|
menu = result.active || findMenu(zimoilPath) || firstMenu;
|
|
215
229
|
if (!menu?.path) return;
|
|
@@ -280,6 +294,5 @@
|
|
|
280
294
|
ok(result);
|
|
281
295
|
result.then = then;
|
|
282
296
|
};
|
|
283
|
-
result.update(items);
|
|
284
297
|
return result;
|
|
285
298
|
});
|
|
@@ -9,13 +9,16 @@
|
|
|
9
9
|
display: block;
|
|
10
10
|
text-align: center;
|
|
11
11
|
}
|
|
12
|
+
|
|
12
13
|
</style>
|
|
13
14
|
<div>
|
|
14
|
-
<
|
|
15
|
+
<i18n-chooser style="float: left;"></i18n-chooser>
|
|
16
|
+
<a @click="logout" -bind="exitLabel()"></a>
|
|
15
17
|
</div>
|
|
16
18
|
|
|
17
19
|
<script>
|
|
18
20
|
var a = button;
|
|
21
|
+
var exitLabel = () => i18n`退出登录`;
|
|
19
22
|
async function logout() {
|
|
20
23
|
data.setSource({});
|
|
21
24
|
await user.Logout();
|
|
@@ -3,7 +3,7 @@ function chooseFile(accept, multiple, extra) {
|
|
|
3
3
|
form.innerHTML = `<input tabindex=0 ${extra ? extra + " " : ''}type='file'${accept ? ` accept="${accept}"` : ''}${multiple ? ' multiple' : ''} />`;
|
|
4
4
|
var [input] = form.children;
|
|
5
5
|
var result = new Promise(function (ok, oh) {
|
|
6
|
-
if (/msie\s+[2-9]/i.test(navigator.userAgent)) return alert(
|
|
6
|
+
if (/msie\s+[2-9]/i.test(navigator.userAgent)) return alert(i18n`无法在当前浏览器操作!`);
|
|
7
7
|
input.onfocus = function () {
|
|
8
8
|
// focus 事件比change事件早40-80毫秒
|
|
9
9
|
if (opened && document.hasFocus()) {
|
package/coms/zimoli/cless.js
CHANGED
|
@@ -50,7 +50,7 @@ var _create = function (commFactory, className, _invoke) {
|
|
|
50
50
|
var head = document.getElementsByTagName("head")[0];
|
|
51
51
|
function cless(commFactory, innerCss, className) {
|
|
52
52
|
if (innerCss) {
|
|
53
|
-
var stylesheet = document.createElement("style");
|
|
53
|
+
var stylesheet = isNode(this) ? this : document.createElement("style");
|
|
54
54
|
//<!-- stylesheet.setAttribute("scope",className) -->
|
|
55
55
|
stylesheet.type = "text/css";
|
|
56
56
|
stylesheet.savedText = innerCss;
|
|
@@ -59,7 +59,7 @@ function cless(commFactory, innerCss, className) {
|
|
|
59
59
|
} else {
|
|
60
60
|
stylesheet.innerHTML = innerCss;
|
|
61
61
|
}
|
|
62
|
-
appendChild(head, stylesheet);
|
|
62
|
+
if (!stylesheet.parentNode) appendChild(head, stylesheet);
|
|
63
63
|
}
|
|
64
64
|
return _create(commFactory, className, _create);
|
|
65
65
|
}
|
package/coms/zimoli/confirm.js
CHANGED
|
@@ -56,7 +56,13 @@ function confirm() {
|
|
|
56
56
|
element.style.width = fromPixel(width + 260);
|
|
57
57
|
body.innerHTML = message;
|
|
58
58
|
} else if (isNode(message)) {
|
|
59
|
-
|
|
59
|
+
if (message.nodeType === 1) {
|
|
60
|
+
addClass(message, 'body');
|
|
61
|
+
appendChild.replace(body, message);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
appendChild(body, message);
|
|
65
|
+
}
|
|
60
66
|
} else {
|
|
61
67
|
throw new Error(i18n`消息体不合法!`);
|
|
62
68
|
}
|
package/coms/zimoli/field.html
CHANGED