efront 4.23.9 → 4.24.1

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 (80) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +347 -65
  2. package/apps/pivot/#/345/233/275/351/231/205/345/214/226.yml +2 -0
  3. package/apps/pivot/api.yml +1 -0
  4. package/apps/pivot/auth/login.html +2 -1
  5. package/apps/pivot/auth/login.js +1 -0
  6. package/apps/pivot/auth/login.less +1 -0
  7. package/apps/pivot/cert/edit.js +1 -1
  8. package/apps/pivot/cert/list.js +1 -1
  9. package/apps/pivot/cert/main.xht +6 -6
  10. package/apps/pivot/cert/orders.xht +8 -8
  11. package/apps/pivot/cert/update.xht +3 -3
  12. package/apps/pivot/db/config.xht +1 -1
  13. package/apps/pivot/db/edit.xht +4 -4
  14. package/apps/pivot/db/list.xht +4 -4
  15. package/apps/pivot/dht/list.js +4 -4
  16. package/apps/pivot/dict/edit.js +1 -1
  17. package/apps/pivot/dict/list.js +1 -1
  18. package/apps/pivot/home/welcome.html +47 -12
  19. package/apps/pivot/home/welcome.js +11 -5
  20. package/apps/pivot/home/welcome.less +16 -1
  21. package/apps/pivot/link/index.js +7 -4
  22. package/apps/pivot/link/list.html +2 -2
  23. package/apps/pivot/link/room.js +2 -2
  24. package/apps/pivot/main.js +2 -0
  25. package/apps/pivot/menu-en.yml +16 -0
  26. package/apps/pivot/proxy/edit.js +1 -1
  27. package/apps/pivot/proxy/list.js +2 -2
  28. package/apps/pivot/register.jsp +4 -0
  29. package/apps/pivot/share/edit.html +3 -3
  30. package/apps/pivot/share/list.js +3 -3
  31. package/apps/pivot/task/edit.js +1 -1
  32. package/apps/pivot/task/invoke.html +2 -2
  33. package/apps/pivot/task/invoke.js +11 -3
  34. package/apps/pivot/task/invoke.less +3 -1
  35. package/apps/pivot/task/list.js +3 -3
  36. package/apps/pivot/task/rsync.html +3 -3
  37. package/apps/pivot/task/rsync.js +1 -1
  38. package/apps/pivot/token/edit.js +1 -1
  39. package/apps/pivot/token/list.js +1 -1
  40. package/apps/pivot/wow/root.js +1 -1
  41. package/apps/pivot//344/270/273/351/241/265.html +1 -1
  42. package/coms/basic/#loader.js +7 -0
  43. package/coms/basic/cross_.js +4 -3
  44. package/coms/basic/i18n-chooser.xht +17 -0
  45. package/coms/basic/i18n-supports.js +30 -0
  46. package/coms/basic/i18n.js +25 -1
  47. package/coms/basic/parseURL.js +2 -2
  48. package/coms/basic/parseURL_test.js +2 -1
  49. package/coms/basic_/Promise.js +21 -18
  50. package/coms/basic_/WeakMap.js +12 -6
  51. package/coms/compile/Program.js +4 -4
  52. package/coms/compile/translate.js +23 -0
  53. package/coms/explorer/context.js +11 -11
  54. package/coms/frame/dict.js +1 -1
  55. package/coms/frame/edit.html +3 -3
  56. package/coms/frame/list.html +1 -1
  57. package/coms/frame/list.js +3 -3
  58. package/coms/frame/route.js +21 -9
  59. package/coms/pivot/left-footer.xht +4 -1
  60. package/coms/pivot/server-status.js +1 -0
  61. package/coms/reptile/cross.js +1 -0
  62. package/coms/zimoli/chooseFile.js +1 -1
  63. package/coms/zimoli/cless.js +2 -2
  64. package/coms/zimoli/createUploadURL.js +1 -1
  65. package/coms/zimoli/field.html +1 -1
  66. package/coms/zimoli/field.js +1 -0
  67. package/coms/zimoli/menuItem.js +3 -1
  68. package/coms/zimoli/prompt.less +3 -1
  69. package/coms/zimoli/render.js +3 -2
  70. package/coms/zimoli/selectList.js +3 -3
  71. package/coms/zimoli/selectListEdit.html +5 -5
  72. package/coms/zimoli/table.js +1 -1
  73. package/coms/zimoli/table.less +1 -2
  74. package/coms/zimoli/yousure.js +2 -2
  75. package/coms/zimoli/zimoli.js +46 -15
  76. package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +31 -12
  77. package/docs/main.xht +19 -6
  78. package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +32 -40
  79. package/package.json +1 -1
  80. package/public/efront.js +1 -1
@@ -34,8 +34,8 @@
34
34
  }
35
35
  </style>
36
36
  <div head>
37
- 编辑数据 - <span -bind="db.name"></span>
38
- <a @click="add">添加</a>
37
+ ${i18n`编辑数据`} - <span -bind="db.name"></span>
38
+ <a @click="add">${i18n`添加`}</a>
39
39
  </div>
40
40
 
41
41
  <lattice body -src="m in items">
@@ -84,7 +84,7 @@
84
84
  茨菰$编辑框(elem);
85
85
  elem.setValue(JSON.stringify(m, null, 4));
86
86
  var changed = false;
87
- await prompt(elem, '输入JSON格式的数据', function (text) {
87
+ await prompt(elem, i18n`输入JSON格式的数据`, function (text) {
88
88
  try {
89
89
  JSON.parse(text);
90
90
  return true;
@@ -106,7 +106,7 @@
106
106
  elem.type = 'json';
107
107
  茨菰$编辑框(elem);
108
108
  var changed = false;
109
- await prompt(elem, '输入JSON格式的数据', function (text) {
109
+ await prompt(elem, i18n`输入JSON格式的数据`, function (text) {
110
110
  try {
111
111
  JSON.parse(text);
112
112
  return true;
@@ -25,13 +25,13 @@
25
25
  }
26
26
  </style>
27
27
  <lattice body a-src="db in dbs">
28
- <div insert><a @click="adddb">添加</a></div>
28
+ <div insert><a @click="adddb">${i18n`添加`}</a></div>
29
29
  <padding db>
30
30
  <div>
31
31
  <h2> ⩸ </h2>
32
32
  <h2 -bind="db.name"></h2>
33
- <a @click="go('/db/edit',db)">查看</a>
34
- <a @click="go('/db/config',db)">配置</a>
33
+ <a @click="go('/db/edit',db)">${i18n`查看`}</a>
34
+ <a @click="go('/db/config',db)">${i18n`配置`}</a>
35
35
  <drop @click.singly.stop="deldb(db)"></drop>
36
36
  </div>
37
37
  </padding>
@@ -53,7 +53,7 @@
53
53
  await load();
54
54
  };
55
55
  var deldb = async function (db) {
56
- var a = await prompt(i18n`输入名称以确认删除`, ["删除#danger", '取消'], a => a === db.name, {
56
+ var a = await prompt(i18n`输入名称以确认删除`, [i18n`删除` + "#danger", i18n`取消`], a => a === db.name, {
57
57
  async submit(v) {
58
58
  await data.from('dbdel', { id: v });
59
59
  }
@@ -12,11 +12,11 @@ var fields = refilm`名称/name
12
12
  return plist.bind({
13
13
  fields,
14
14
  type: 'nodes',
15
- title: "DHT服务器管理",
15
+ title: i18n`DHT服务器管理`,
16
16
  buttons: [{
17
- name: "从文件读取", async do() {
17
+ name: i18n`从文件读取`, async do() {
18
18
  var FileReader = window.FileReader;
19
- if (!FileReader) return alert('当前浏览器无法读取文件', 'warn')
19
+ if (!FileReader) return alert(i18n`当前浏览器无法读取文件`, 'warn')
20
20
  var f = await chooseFile(".torrent", true);
21
21
  var pg = await popup("/dht/rent");
22
22
  var scope = $scoped.get(pg);
@@ -34,7 +34,7 @@ return plist.bind({
34
34
  ok();
35
35
  };
36
36
  r.onerror = function () {
37
- alert("读取文件失败!", 'error');
37
+ alert(i18n`读取文件失败!`, 'error');
38
38
  oh();
39
39
  };
40
40
  r.readAsArrayBuffer(f);
@@ -1 +1 @@
1
- pedit.bind(null, "字典", "dict");
1
+ pedit.bind(null, i18n`字典`, "dict");
@@ -5,7 +5,7 @@ var types = refilm`
5
5
  model.setModels({
6
6
  dict: frame$dict.bind(null, types),
7
7
  });
8
- return plist.bind(null, '接口管理', "dict", refilm`
8
+ return plist.bind(null, i18n`接口管理`, "dict", refilm`
9
9
  *字典ID/key 100
10
10
  字典名/name 100
11
11
  字典数据/options dict
@@ -1,35 +1,70 @@
1
- <block>
2
- </block>
3
1
  <block>
4
2
  <padding>
5
- 服务器版本&nbsp;&nbsp;<span -text="String(version)"></span>
3
+ <span>
4
+ ${i18n`注册号`}
5
+ </span>
6
+ <template -if="usercode">
7
+ <span -text="String(usercode)"></span>
8
+ <!-- <a @click="unregister">${i18n`注销`}</a> -->
9
+ </template>
10
+ <a -else @click="register">${i18n`注册`}</a>
6
11
  </padding>
7
12
  <padding>
8
- nodejs版本&nbsp;&nbsp;<span -text="String(nodeVersion)"></span>
13
+ <span>
14
+ ${i18n`服务器版本`}
15
+ </span>
16
+ <span -text="String(version)"></span>
9
17
  </padding>
10
18
  <padding>
11
- 操作系统&nbsp;&nbsp;<span -text="String(platform)"></span>
19
+ <span>
20
+ ${i18n`nodejs版本`}
21
+ </span>
22
+ <span -text="String(nodeVersion)"></span>
12
23
  </padding>
13
24
  <padding>
14
- 处理器&nbsp;&nbsp;<span -text="String(arch)"></span>
25
+ <span>
26
+ ${i18n`操作系统`}
27
+ </span>
28
+ <span -text="String(platform)"></span>
29
+ </padding>
30
+ <padding>
31
+ <span>
32
+ ${i18n`处理器`}
33
+ </span>
34
+ <span -text="String(arch)"></span>
15
35
  </padding>
16
36
  </block>
17
37
  <block>
18
38
  <padding>
19
- 清理服务器缓存 <btn @click="run('clear-cache',this)">清理</btn>
39
+ <span>
40
+ ${i18n`清理服务器缓存`}
41
+ </span>
42
+ <btn @click="run('clear-cache',this)">${i18n`清理`}</btn>
20
43
  </padding>
21
44
  <padding>
22
- 重启服务器 <btn @click="run('rehost',this)" confirm type="danger">重启</btn>
45
+ <span>
46
+ ${i18n`重启服务器`}
47
+ </span>
48
+ <btn @click="run('rehost',this)" confirm type="danger">${i18n`重启`}</btn>
23
49
  </padding>
24
50
  </block>
25
51
  <block>
26
52
  <padding>
27
- 启动时间&nbsp;&nbsp;<span -text="filterTime(hrtime)"></span>
53
+ <span>
54
+ ${i18n`启动时间`}
55
+ </span>
56
+ <span -text="filterTime(hrtime)"></span>
28
57
  </padding>
29
58
  <padding>
30
- 内存 <progbar danger:="memery[0]/memery[1]<.05" :current="memeryUsed" :total="memery[1]"></progbar>
31
- <span style="color: #999;">
32
- 可用<span -bind="size(memery[0])"></span> / 总内存<span -bind="size(memery[1])"></span>
59
+ <span>
60
+ ${i18n`内存`}
61
+ </span>
62
+ <span>
63
+ <progbar danger:="memery[0]/memery[1]<.05" :current="memeryUsed" :total="memery[1]"></progbar>
64
+ <div>
65
+ <span -bind="size(memery[0])"></span>
66
+ / <span -bind="size(memery[1])"></span>
67
+ </div>
33
68
  </span>
34
69
  </padding>
35
70
  </block>
@@ -8,11 +8,16 @@ function main() {
8
8
  filterTime,
9
9
  memeryUsed: 0,
10
10
  memery: [0, 1],
11
- platform: '未知',
12
- arch: '未知',
13
- nodeVersion: "未知",
11
+ platform: i18n`未知`,
12
+ arch: i18n`未知`,
13
+ nodeVersion: i18n`未知`,
14
14
  size,
15
15
  progbar,
16
+ usercode: null,
17
+ async register() {
18
+ var usercode = await data.from("register");
19
+ serverStatus.userid = scope.usercode = usercode;
20
+ },
16
21
  async run(id) {
17
22
  await new Promise(ok => setTimeout(ok, 2000));
18
23
  var info = await data.from("run", {
@@ -22,13 +27,14 @@ function main() {
22
27
  }
23
28
  };
24
29
  renderWithDefaults(page, scope);
25
- data.from("status").then(a => {
30
+ (function (a) {
26
31
  var [mr, mt] = a.memery;
27
32
  scope.memeryUsed = mt - mr;
28
33
  scope.memery = a.memery;
29
34
  scope.nodeVersion = a.nodeVersion;
30
35
  scope.platform = a.platform;
31
36
  scope.arch = a.arch;
32
- });
37
+ scope.usercode = a.userid;
38
+ }(serverStatus));
33
39
  return page;
34
40
  }
@@ -13,8 +13,23 @@ btn {
13
13
  }
14
14
 
15
15
  padding {
16
+ display: block;
17
+ color: #666;
18
+ .button {
19
+ margin: 0;
20
+ }
21
+
16
22
  >span {
17
- color: #999;
23
+ vertical-align: top;
24
+ &:first-child {
25
+ // width: 120px;
26
+ }
27
+ >div{
28
+ line-height: 1.2;
29
+ font-size: 12px;
30
+ }
31
+ display: inline-block;
32
+ color: #333;
18
33
  margin-right: 10px;
19
34
  }
20
35
  }
@@ -2,10 +2,13 @@ function index() {
2
2
  var page = document.createElement('link-index');
3
3
  page.innerHTML = template;
4
4
  renderWithDefaults(page, {
5
- menus: "房间 /link/room, 会话 /link/list".split(/\s*,\s*/).map(a => {
6
- var [name, path] = a.split(/\s+/);
7
- return { name, path };
8
- }),
5
+ menus: [{
6
+ name: i18n`房间`,
7
+ path: '/link/room'
8
+ }, {
9
+ name: i18n`会话`,
10
+ path: '/link/list'
11
+ }],
9
12
  saveIndex(index) {
10
13
  data.setInstance('link-index', index);
11
14
  },
@@ -16,10 +16,10 @@
16
16
  </style>
17
17
  <div head>
18
18
  <span>
19
- 自动刷新
19
+ ${i18n`自动刷新`}
20
20
  </span>
21
21
  <swap -model="autoreload"></swap>
22
- <btn @click="chat()">新建连接</btn>
22
+ <btn @click="chat()">${i18n`新建连接`}</btn>
23
23
  </div>
24
24
  <div class="clusters">
25
25
  <a -repeat="(c,i) in clusters" ng-class="{current:i===index.index}" @click="active(i,c)">
@@ -1,7 +1,7 @@
1
- plist.bind(null, '房间', "room", refilm`
1
+ plist.bind(null, i18n`房间`, "room", refilm`
2
2
  *房间名/name 100
3
3
  / $ ${[{
4
- name: "连接",
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 });
@@ -1,3 +1,5 @@
1
+ frame$route.update(await data.fromURL(i18n`menu.yml`));
2
+ i18n.setReloader(zimoli.reload);
1
3
  data.loadConfig("api.yml");
2
4
  user.loginPath = '/auth/login';
3
5
  var login_queue = [], reject_queue = [];
@@ -0,0 +1,16 @@
1
+ Home Page: /home/welcome
2
+ WEB:
3
+ Path Redirects: /proxy/list
4
+ File Manager: /wow/root
5
+ Data Manager: /db/list
6
+ Living Link: /link/index
7
+ # Dictionary: /dict/list
8
+ Cert Manager: /cert/main
9
+ Shared Path: /share/list
10
+ Service:
11
+ Key Manager: /token/list
12
+ Task Manager: /task/list
13
+ Logs:
14
+ Visit Count: /log/count
15
+ Boot Log: /log/boot
16
+ # Shop: /shop/home
@@ -1 +1 @@
1
- pedit.bind(null, "短链接", "proxy");
1
+ pedit.bind(null, i18n`短链接`, "proxy");
@@ -1,6 +1,6 @@
1
1
  var actions = [
2
2
  {
3
- name: "访问",
3
+ name: i18n`访问`,
4
4
  do(o) {
5
5
  var url = o.url;
6
6
  if (!/\//.test(url)) url = "//" + url;
@@ -16,4 +16,4 @@ var fields = refilm`
16
16
  动作/action select/100 [跳转,转发]
17
17
  状态/status select/100 [启用,禁用]
18
18
  / $ ${actions}`;
19
- return plist.bind(null, '短链接', "proxy", fields, "/proxy/edit");
19
+ return plist.bind(null, i18n`短链接`, "proxy", fields, "/proxy/edit");
@@ -0,0 +1,4 @@
1
+ <script serverside>
2
+ var data = await readdata(req);
3
+ return await runtask('server-register', req, data);
4
+ </script>
@@ -1,10 +1,10 @@
1
- <div head>修改</div>
1
+ <div head>${i18n`修改`}</div>
2
2
  <div body>
3
3
  <form>
4
4
  <field -repeat="f in fields" -src="[f,data]"></field>
5
5
  </form>
6
6
  </div>
7
7
  <div foot>
8
- <btn white @click="close()">取消</btn>
9
- <button @click="save()"> 保存 </button>
8
+ <btn white @click="close()">${i18n`取消`}</btn>
9
+ <button @click="save()"> ${i18n`保存`} </button>
10
10
  </div>
@@ -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 });
@@ -1 +1 @@
1
- pedit.bind(null, "任务", "task");
1
+ pedit.bind(null, i18n`任务`, "task");
@@ -8,12 +8,12 @@
8
8
  <field -repeat="f in fields" -src="[f,data]"></field>
9
9
  </div>
10
10
  <div class="left">
11
- <jscode -value="task.code" type="js"></jscode>
11
+ <jscode readonly -value="task.code" type="js"></jscode>
12
12
  </div>
13
13
  <div class="right" :class="{error:error}">
14
14
  <pre -text="output"></pre>
15
15
  </div>
16
16
  </div>
17
17
  <div foot>
18
- <btn @click="run">执行</btn>
18
+ <btn @click="run">${i18n`执行`}</btn>
19
19
  </div>
@@ -19,12 +19,20 @@ 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
- var params = JSON.stringify(this.data);
24
+ var params = {};
25
+ for (var k in this.data) {
26
+ var v = this.data[k];
27
+ try {
28
+ v = JSAM.parse(v);
29
+ } catch { }
30
+ params[k] = v;
31
+ }
32
+ var params = JSON.stringify(params);
25
33
  try {
26
34
  var res = await data.from("invoke", { key: a.key, params: encode62.packencode(params) }, function (a) {
27
- return a ? encode62.packdecode(a) : '完成!';
35
+ return a ? encode62.packdecode(a) : i18n`完成!`;
28
36
  });
29
37
  if (id !== taskid) return;
30
38
  this.output = res;
@@ -13,6 +13,7 @@
13
13
  >jscode,
14
14
  >pre {
15
15
  height: 100%;
16
+ margin: 0;
16
17
  }
17
18
 
18
19
  &.top {
@@ -23,7 +24,8 @@
23
24
 
24
25
  &.left,
25
26
  &.right {
26
- height: 100%;
27
+ border-radius: 0;
28
+ height: 260px;
27
29
  width: 50%;
28
30
  }
29
31
 
@@ -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, '任务管理', "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
@@ -15,7 +15,7 @@ return plist.bind(null, '任务管理', "task", refilm`
15
15
  when(o) {
16
16
  return o.status === 1;
17
17
  },
18
- name: "执行", do(o) {
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: "同步", do(o) {
26
+ name: i18n`同步`, do(o) {
27
27
  popup("/task/rsync", o);
28
28
  }
29
29
  },
@@ -1,5 +1,5 @@
1
1
  <div head>
2
- 同步任务&nbsp;-&nbsp; <span -text=task.name></span>(<span -text=task.key></span>)
2
+ ${i18n`同步任务`}&nbsp;-&nbsp; <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">(当前)</span>
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()">同步</btn>
15
+ <btn @click="flush()">${i18n`同步`}</btn>
16
16
  </div>
@@ -29,7 +29,7 @@ function main(task) {
29
29
  });
30
30
  finished[h.key] = true;
31
31
  }
32
- alert('同步完成!');
32
+ alert(i18n`同步完成!`);
33
33
  },
34
34
  remove() {
35
35
  remove(page);
@@ -1 +1 @@
1
- pedit.bind(null, "密钥", "private");
1
+ pedit.bind(null, i18n`密钥`, "private");
@@ -1,4 +1,4 @@
1
- plist.bind(null, '密钥管理', "private", refilm`
1
+ plist.bind(null, i18n`密钥管理`, "private", refilm`
2
2
  *键名/key 100
3
3
  显示名/name input/300
4
4
  密钥/value text/100
@@ -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;
@@ -36,7 +36,7 @@
36
36
  </style>
37
37
  </head>
38
38
 
39
- <body scroll=no menu="menu.yml">
39
+ <body scroll=no>
40
40
  雪下的那么深,下的那么认真..
41
41
  </body>
42
42
 
@@ -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;
@@ -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
- xhr.open(method, url);
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, onerror1);
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;