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.
Files changed (54) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +42 -24
  2. package/apps/pivot/auth/login.js +4 -4
  3. package/apps/pivot/cert/edit.js +1 -1
  4. package/apps/pivot/cert/list.js +1 -1
  5. package/apps/pivot/cert/main.xht +2 -3
  6. package/apps/pivot/db/list.xht +5 -0
  7. package/apps/pivot/dht/list.js +6 -7
  8. package/apps/pivot/dict/edit.js +1 -1
  9. package/apps/pivot/dict/list.js +8 -6
  10. package/apps/pivot/home/welcome.html +1 -1
  11. package/apps/pivot/link/room.js +3 -3
  12. package/apps/pivot/log/count.js +22 -22
  13. package/apps/pivot/main.js +8 -2
  14. package/apps/pivot/proxy/edit.js +1 -1
  15. package/apps/pivot/proxy/list.js +4 -5
  16. package/apps/pivot/share/list.js +3 -3
  17. package/apps/pivot/task/edit.js +1 -1
  18. package/apps/pivot/task/list.js +1 -1
  19. package/apps/pivot/token/edit.js +1 -1
  20. package/apps/pivot/token/list.js +1 -1
  21. package/apps/pivot/wow/root.js +0 -3
  22. package/coms/basic/i18n.js +18 -5
  23. package/coms/basic/migrate.js +43 -0
  24. package/coms/compile/Asm.js +252 -0
  25. package/coms/compile/Asm_test.js +22 -0
  26. package/coms/compile/Html_test.js +1 -0
  27. package/coms/compile/Javascript.js +1 -143
  28. package/coms/compile/Javascript_test.js +4 -1
  29. package/coms/compile/Program.js +186 -22
  30. package/coms/compile/common.js +16 -4
  31. package/coms/compile/powermap.js +2 -2
  32. package/coms/compile/unstruct.js +5 -5
  33. package/coms/compile/unstruct_test.js +3 -1
  34. package/coms/explorer/context.js +2 -2
  35. package/coms/explorer/main.js +1 -1
  36. package/coms/frame/edit.html +1 -1
  37. package/coms/frame/edit.js +13 -6
  38. package/coms/frame/list.js +75 -42
  39. package/coms/frame/route.js +11 -6
  40. package/coms/pivot/plist.js +8 -5
  41. package/coms/zimoli/autodragchildren.js +5 -1
  42. package/coms/zimoli/moveupon.js +8 -5
  43. package/coms/zimoli/prompt.js +1 -0
  44. package/coms/zimoli/render.js +1 -0
  45. package/coms/zimoli/resize.js +3 -0
  46. package/coms/zimoli/tree.js +4 -1
  47. package/coms/zimoli/zimoli.js +13 -2
  48. package/coms//350/214/250/350/217/260//346/240/207/347/255/276/345/214/226.js +7 -3
  49. package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +6 -3
  50. package/coms//350/214/250/350/217/260//350/257/255/350/250/200.js +1 -22
  51. package/docs/main.xht +21 -17
  52. package/docs//345/221/275/344/273/244.xht +33 -32
  53. package/package.json +1 -1
  54. package/public/efront.js +1 -1
@@ -1,20 +1,23 @@
1
- - zh-CN: 英文
2
- en: English
1
+ - zh-CN: "不能有特殊符号\"$1\""
2
+ en: "Cannot have special symbol '$1'"
3
3
 
4
- - zh-CN: 英语
5
- en: English
4
+ - zh-CN: 不启用
5
+ en: Disable
6
6
 
7
- - zh-CN: 中文繁体
8
- en: Traditional Chinese
7
+ - zh-CN: 禁用
8
+ en: Disable
9
9
 
10
- - zh-CN: 繁体中文
11
- en: Traditional Chinese
10
+ - zh-CN: 无法在当前浏览器操作!
11
+ en: Cannot operate in the current browser!
12
12
 
13
- - zh-CN: 返回
14
- en: Return
13
+ - zh-CN: 无法在当前浏览器操作!
14
+ en: Cannot operate in the current browser!
15
15
 
16
- - zh-CN: 返回
17
- en: Back
16
+ - zh-CN: 确定
17
+ en: Confirm
18
+
19
+ - zh-CN: 确认
20
+ en: Confirm
18
21
 
19
22
  - zh-CN: "参数异常: $1"
20
23
  en: "Parameter exception: $1"
@@ -22,23 +25,38 @@
22
25
  - zh-CN: 参数异常:$1
23
26
  en: "Parameter exception: $1"
24
27
 
25
- - zh-CN: 确定
26
- en: Confirm
28
+ - zh-CN: 返回
29
+ en: Return
27
30
 
28
- - zh-CN: 确认
29
- en: Confirm
31
+ - zh-CN: 返回
32
+ en: Back
30
33
 
31
- - zh-CN: 无法在当前浏览器操作!
32
- en: Cannot operate in the current browser!
34
+ - zh-CN: 中文繁体
35
+ en: Traditional Chinese
33
36
 
34
- - zh-CN: 无法在当前浏览器操作!
35
- en: Cannot operate in the current browser!
37
+ - zh-CN: 繁体中文
38
+ en: Traditional Chinese
36
39
 
37
- - zh-CN: 不启用
38
- en: Disable
40
+ - zh-CN: 英文
41
+ en: English
39
42
 
40
- - zh-CN: 禁用
41
- en: Disable
43
+ - zh-CN: 英语
44
+ en: English
45
+
46
+ - zh-CN: 商店
47
+ en: Store
48
+
49
+ - zh-CN: 订单
50
+ en: Orders
51
+
52
+ - zh-CN: 留言
53
+ en: Messages
54
+
55
+ - zh-CN: 手动输入
56
+ en: Manual input
57
+
58
+ - zh-CN: 请输入完整密钥对,以英文逗号分割
59
+ en: "Please enter the complete key pair, separated by commas in English"
42
60
 
43
61
  - zh-CN: 拥有注册号的用户可查看商品
44
62
  en: Users with registration numbers can view products
@@ -1,10 +1,10 @@
1
1
  var hosts = data.getItem("hosts");
2
2
  if (!hosts.length) hosts.push({ key: location.host, name: location.host });
3
- var fields = refilm`
4
- 服务器地址/host* select?a ${hosts}
5
- 密码/password* password
6
- `;
7
3
  function main(host) {
4
+ var fields = refilm`
5
+ 服务器地址/host* select?a ${hosts}
6
+ 密码/password* password
7
+ `;
8
8
  var page = view();
9
9
  page.innerHTML = login;
10
10
  drag.on(page);
@@ -1 +1 @@
1
- pedit.bind(null, i18n`证书`, "cert");
1
+ pedit.bind(null, () => i18n`证书`, "cert");
@@ -1,4 +1,4 @@
1
- plist.bind(null, i18n`接口管理`, "cert", refilm`
1
+ return plist.bind(null, () => i18n`接口管理`, "cert", () => refilm`
2
2
  *域名/hostname input/253
3
3
  公钥/private text
4
4
  私钥/public text
@@ -129,7 +129,7 @@
129
129
  fields: refilm`
130
130
  $公钥/public_key/单击生成 ${function (elem) {
131
131
  var { data, field } = elem;
132
- elem.innerHTML = `<a @click=ipt()>手动输入</a>&ensp;&ensp;<a @click="gen()" -if="!data[field.key]">单击生成</a><span -else -bind="data[field.key]"></span>`;
132
+ elem.innerHTML = `<a @click=ipt()>${i18n`手动输入`}</a>&ensp;&ensp;<a @click="gen()" -if="!data[field.key]">${i18n`单击生成`}</a><span -else -bind="data[field.key]"></span>`;
133
133
  render(elem, {
134
134
  data, field, async gen() {
135
135
  await acme2.initUnique();
@@ -137,11 +137,10 @@
137
137
  await saveUnique();
138
138
  },
139
139
  async ipt() {
140
- var data = await prompt('请输入完整密钥对,以英文逗号分割', {
140
+ var data = await prompt(i18n`请输入完整密钥对,以英文逗号分割`, {
141
141
  value: acme2.pickUnique()
142
142
  });
143
143
  acme2.makeUnique(data);
144
- console.log(data);
145
144
  },
146
145
  })
147
146
  }}
@@ -46,6 +46,11 @@
46
46
  load();
47
47
  var adddb = async function () {
48
48
  var a = await prompt(i18n`请输入名称`, {
49
+ check(a) {
50
+ if (a = /[\*\?\|\/\\\>\<"\:\.]/.exec(a)) {
51
+ return i18n`不能有特殊符号"${a[0]}"`;
52
+ }
53
+ },
49
54
  async submit(a) {
50
55
  await data.from('dbadd', { id: a, name: a });
51
56
  }
@@ -5,15 +5,14 @@ function hash(a) {
5
5
  }
6
6
  return r;
7
7
  }
8
- var fields = refilm`名称/name
9
- 服务器/host
10
- 端口/port
11
- `;
12
8
  return plist.bind({
13
- fields,
9
+ fields: () => refilm`名称/name
10
+ 服务器/host
11
+ 端口/port
12
+ `,
14
13
  type: 'nodes',
15
- title: i18n`DHT服务器管理`,
16
- buttons: [{
14
+ title: () => i18n`DHT服务器管理`,
15
+ buttons: () => [{
17
16
  name: i18n`从文件读取`, async do() {
18
17
  var FileReader = window.FileReader;
19
18
  if (!FileReader) return alert(i18n`当前浏览器无法读取文件`, 'warn')
@@ -1 +1 @@
1
- pedit.bind(null, i18n`字典`, "dict");
1
+ pedit.bind(null, () => i18n`字典`, "dict");
@@ -1,11 +1,13 @@
1
- var types = refilm`
2
- 数值/number
3
- 文本/input
4
- `;
5
1
  model.setModels({
6
- dict: frame$dict.bind(null, types),
2
+ dict() {
3
+ var types = refilm`
4
+ 数值/number
5
+ 文本/input
6
+ `;
7
+ return frame$dict(types, ...arguments);
8
+ }
7
9
  });
8
- return plist.bind(null, i18n`接口管理`, "dict", refilm`
10
+ return plist.bind(null, () => i18n`接口管理`, "dict", () => refilm`
9
11
  *字典ID/key 100
10
12
  字典名/name 100
11
13
  字典数据/options dict
@@ -62,8 +62,8 @@
62
62
  <span>
63
63
  <progbar danger:="memery[0]/memery[1]<.05" :current="memeryUsed" :total="memery[1]"></progbar>
64
64
  <div>
65
+ <span -bind="size(memery[1])"></span> \
65
66
  <span -bind="size(memery[0])"></span>
66
- / <span -bind="size(memery[1])"></span>
67
67
  </div>
68
68
  </span>
69
69
  </padding>
@@ -1,10 +1,10 @@
1
- plist.bind(null, i18n`房间`, "room", refilm`
1
+ return plist.bind(null, () => i18n`房间`, "room", () => refilm`
2
2
  *房间名/name 100
3
3
  / $ ${[{
4
- name: i18n`连接`,
4
+ name: () => i18n`连接`,
5
5
  async do(o) {
6
6
  var linkid = await data.from("room", { id: encode62.packencode(o.name) });
7
7
  popup("/link/chat", { linkid, name: o.name });
8
8
  }
9
9
  }]}
10
- `);
10
+ `);
@@ -1,26 +1,26 @@
1
- var fields = refilm`
2
- 访问量/count money/10
3
- 路径/path html/20
4
- `;
5
- var fields2 = refilm`
6
- 域名/host text/100
7
- 路径/path text/80
8
- 远程地址/remote text/100
9
- 地理位置/address/查看 act/80 ${checkGeo}
10
- 时间/time timestamp
11
- 来源/referer text/100
12
- 客户端/agent text/200
13
- `;
14
- var menus = [
15
- {
16
- name: i18n`计数`,
17
- },
18
- {
19
- name: i18n`千次快照`,
20
- }
21
- ];
22
- menus[state().index || 0].actived = true;
23
1
  function main() {
2
+ var fields = refilm`
3
+ 访问量/count money/10
4
+ 路径/path html/20
5
+ `;
6
+ var fields2 = refilm`
7
+ 域名/host text/100
8
+ 路径/path text/80
9
+ 远程地址/remote text/100
10
+ 地理位置/address/查看 act/80 ${checkGeo}
11
+ 时间/time timestamp
12
+ 来源/referer text/100
13
+ 客户端/agent text/200
14
+ `;
15
+ var menus = [
16
+ {
17
+ name: i18n`计数`,
18
+ },
19
+ {
20
+ name: i18n`千次快照`,
21
+ }
22
+ ];
23
+ menus[state().index || 0].actived = true;
24
24
  var page = div();
25
25
  page.innerHTML = template;
26
26
  var items = data.from("count", a => {
@@ -1,5 +1,11 @@
1
- frame$route.update(await data.fromURL(i18n`menu.yml`));
2
- i18n.setReloader(zimoli.reload);
1
+ var loadMenu = async function () {
2
+ frame$route.update(await data.fromURL(i18n`menu.yml`));
3
+ };
4
+ loadMenu();
5
+ i18n.setReloader(function () {
6
+ loadMenu();
7
+ zimoli.reload(false);
8
+ });
3
9
  data.loadConfig("api.yml");
4
10
  user.loginPath = '/auth/login';
5
11
  var login_queue = [], reject_queue = [];
@@ -1 +1 @@
1
- pedit.bind(null, i18n`短链接`, "proxy");
1
+ pedit.bind(null, () => i18n`短链接`, "proxy");
@@ -1,4 +1,4 @@
1
- var actions = [
1
+ var gtActions = () => [
2
2
  {
3
3
  name: i18n`访问`,
4
4
  do(o) {
@@ -8,12 +8,11 @@ var actions = [
8
8
  }
9
9
  }
10
10
  ];
11
-
12
- var fields = refilm`
11
+ var gtFields = () => refilm`
13
12
  *代理路径/url input/120
14
13
  &二维码/url ${qrcode}
15
14
  真实路径/realpath input/300
16
15
  动作/action select/100 [跳转,转发]
17
16
  状态/status select/100 [启用,禁用]
18
- / $ ${actions}`;
19
- return plist.bind(null, i18n`短链接`, "proxy", fields, "/proxy/edit");
17
+ / $ ${gtActions()}`;
18
+ return plist.bind(null, () => i18n`短链接`, "proxy", gtFields, "/proxy/edit");
@@ -1,7 +1,7 @@
1
- var fields = refilm`
2
- 路径/path
3
- `;
4
1
  function main() {
2
+ var fields = refilm`
3
+ 路径/path
4
+ `;
5
5
  var options = [
6
6
  {
7
7
  name(e) {
@@ -1 +1 @@
1
- pedit.bind(null, i18n`任务`, "task");
1
+ pedit.bind(null, () => i18n`任务`, "task");
@@ -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, i18n`任务管理`, "task", refilm`
8
+ return plist.bind(null, () => i18n`任务管理`, "task", () => refilm`
9
9
  *任务ID/key 100
10
10
  *任务名/name 100
11
11
  *是否启用/status radio 不启用#ccc,启用#396
@@ -1 +1 @@
1
- pedit.bind(null, i18n`密钥`, "private");
1
+ pedit.bind(null, () => i18n`密钥`, "private");
@@ -1,4 +1,4 @@
1
- plist.bind(null, i18n`密钥管理`, "private", refilm`
1
+ plist.bind(null, () => i18n`密钥管理`, "private", () => refilm`
2
2
  *键名/key 100
3
3
  显示名/name input/300
4
4
  密钥/value text/100
@@ -1,6 +1,3 @@
1
- var fields = refilm`
2
- 文件
3
- `;
4
1
  var passport = encode62.packencode(encode62.decode62(user._passport, user.session));
5
2
  var pending = [];
6
3
  async function upload(f, dist, token) {
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
+ // 中共命令或纵容腾讯、字节等公司控制中国人的言论,违反中国宪法,侵害中国人的言论自由,使得正义得不到及时申张,为恶之人逍遥法外。
3
+ // 有人说,现在的学历含金量不及恢复高考初期,现在上个大学不如当时上个初中。
4
+ // 在我看来,当时上了大学的人,也不及现在的初中生有文化。
5
+ // 这些没有文化的人占据了要职要位后,执法而不知法守法,滥用职权黑箱操作,又觉得人言可畏,怕人们了解真象,才有意控制言论。
2
6
  var languageMap = {};
3
7
  var languageIndex = 0;
4
8
  function i18n() {
5
9
  var [arg] = arguments;
6
10
  if (typeof arg === 'string' || !isArrayLike(arg)) arg = arguments;
7
- return arg[isFinite(this) ? this : languageIndex];
11
+ return isFinite(this) ? arg[this] : arg[languageIndex];
8
12
  };
13
+
9
14
  i18n.lang = function (type) {
10
15
  var id = getLanguageIndexFromName(type) || 0;
11
16
  return i18n.bind(id);
@@ -38,14 +43,22 @@ i18n.setIndex = function (index) {
38
43
  i18n.supports = supports;
39
44
  i18n.reload();
40
45
  };
41
- var relaods = [];
46
+ var reloads = [];
42
47
  i18n.reload = function () {
43
- relaods.forEach(a => a());
48
+ reloads.forEach(a => a());
44
49
  };
45
50
  i18n.setReloader = function () {
46
- relaods = [];
51
+ reloads = [];
52
+ addReloader(...arguments);
53
+ };
54
+ var addReloader = i18n.addReloader = function () {
55
+ for (var callback of arguments) {
56
+ if (isFunction(callback)) reloads.push(callback);
57
+ }
58
+ }
59
+ i18n.removeReloader = function () {
47
60
  for (var callback of arguments) {
48
- if (isFunction(callback)) relaods.push(callback);
61
+ removeFromList(reloads, callback)
49
62
  }
50
63
  };
51
64
  if (this.navigator) i18n.setLanguage(this.navigator.language);
@@ -0,0 +1,43 @@
1
+ // 将数据复制到目标对象,保持目标节点对应节点的对象不变
2
+ var allsrc, alldst;
3
+ var migrate = function (dst, src) {
4
+ var cap;
5
+ var i = allsrc.indexOf(src);
6
+ if (i >= 0) dst = alldst[i];
7
+ else if (isArray(src)) {
8
+ if (!isArray(dst)) dst = [];
9
+ alldst.push(dst);
10
+ allsrc.push(src);
11
+ cap = dst.splice(0, dst.length);
12
+ for (var cx = 0, dx = src.length; cx < dx; cx++) {
13
+ var s = src[cx];
14
+ var d = cap[cx];
15
+ dst[cx] = migrate(d, s);
16
+ }
17
+ }
18
+ else if (isObject(src)) {
19
+ if (!isObject(dst)) dst = {};
20
+ alldst.push(dst);
21
+ allsrc.push(src);
22
+ cap = {};
23
+ for (var k in dst) {
24
+ cap[k] = dst[k];
25
+ }
26
+ for (var k in cap) delete dst[k];
27
+ for (var k in src) {
28
+ var s = src[k];
29
+ var d = cap[k];
30
+ dst[k] = migrate(d, s);
31
+ }
32
+ }
33
+ else dst = src;
34
+ return dst;
35
+ }
36
+ return function (dst, src) {
37
+ allsrc = [];
38
+ alldst = [];
39
+ dst = migrate(dst, src);
40
+ allsrc = null;
41
+ alldst = null;
42
+ return dst;
43
+ }