efront 4.21.3 → 4.22.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 (96) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +117 -66
  2. package/apps/blank/index.html +1 -1
  3. package/apps/index.jsp +76 -27
  4. package/apps/pay/alipay-query.jsp +1 -1
  5. package/apps/pay/alipay.jsp +1 -1
  6. package/apps/pivot/auth/login.js +2 -2
  7. package/apps/pivot/cert/main.xht +18 -5
  8. package/apps/pivot/db/act.xht +53 -0
  9. package/apps/pivot/db/config.xht +56 -16
  10. package/apps/pivot/home/welcome.html +12 -13
  11. package/apps/pivot/home/welcome.js +6 -6
  12. package/apps/pivot/home/welcome.less +12 -3
  13. package/apps/pivot/link/room.js +1 -1
  14. package/apps/pivot/main.js +3 -2
  15. package/apps/pivot/task/invoke.js +3 -3
  16. package/apps/pivot/task/rsync.js +2 -2
  17. package/apps/pivot/wow/root.js +8 -8
  18. package/coms/basic/#loader.js +9 -8
  19. package/coms/basic/Item.js +2 -2
  20. package/coms/basic/Tree.js +14 -2
  21. package/coms/basic/crc.js +5 -1
  22. package/coms/basic/cross_.js +2 -2
  23. package/coms/basic/decode62S.js +44 -0
  24. package/coms/basic/encode62S.js +40 -0
  25. package/coms/basic/encode62S_test.js +18 -0
  26. package/coms/basic/enrich.js +6 -1
  27. package/coms/basic/parseNumber.js +12 -7
  28. package/coms/basic/percent.js +28 -0
  29. package/coms/basic/refilm.js +24 -5
  30. package/coms/basic/refilm_decode.js +46 -22
  31. package/coms/basic/refilm_decode_test.js +5 -0
  32. package/coms/basic/valid.js +4 -0
  33. package/coms/basic_/&Array.js +64 -49
  34. package/coms/basic_/&extends.js +9 -2
  35. package/coms/compile/Html_test.js +5 -0
  36. package/coms/compile/Javascript.js +13 -3
  37. package/coms/compile/Javascript_test.js +3 -0
  38. package/coms/compile/Program.js +119 -43
  39. package/coms/compile/audit.js +23 -1
  40. package/coms/compile/cloneNode.js +3 -1
  41. package/coms/compile/common.js +7 -1
  42. package/coms/compile/downLevel.js +21 -11
  43. package/coms/compile/downLevel_test.js +52 -14
  44. package/coms/compile/rescan.js +8 -2
  45. package/coms/compile/scanner2.js +53 -7
  46. package/coms/compile/translate.js +1 -1
  47. package/coms/compile/unstruct.js +9 -9
  48. package/coms/crypt/encode62.js +36 -6
  49. package/coms/crypt/encode62_test.js +8 -48
  50. package/coms/explorer/main.less +1 -5
  51. package/coms/frame/chat.js +2 -2
  52. package/coms/frame/left.html +5 -4
  53. package/coms/frame/left.js +1 -0
  54. package/coms/frame/left.less +5 -3
  55. package/coms/frame/payment.js +2 -2
  56. package/coms/pivot/acme2.js +7 -4
  57. package/coms/pivot/left-footer.xht +25 -0
  58. package/coms/pivot/pedit.js +3 -3
  59. package/coms/pivot/plist.js +2 -2
  60. package/coms/pivot/qrcode.xht +3 -0
  61. package/coms/zimoli/XMLHttpRequest.js +16 -13
  62. package/coms/zimoli/container.js +34 -34
  63. package/coms/zimoli/design.html +6 -13
  64. package/coms/zimoli/design.js +49 -13
  65. package/coms/zimoli/design.less +62 -25
  66. package/coms/zimoli/drag.js +8 -3
  67. package/coms/zimoli/encode62.js +40 -12
  68. package/coms/zimoli/lattice.js +0 -1
  69. package/coms/zimoli/list.js +0 -8
  70. package/coms/zimoli/menu.js +29 -5
  71. package/coms/zimoli/model.js +150 -195
  72. package/coms/zimoli/model.less +4 -8
  73. package/coms/zimoli/on.js +14 -12
  74. package/coms/zimoli/padding.less +1 -0
  75. package/coms/zimoli/progbar.xht +9 -8
  76. package/coms/zimoli/prompt.less +0 -3
  77. package/coms/zimoli/render.js +210 -125
  78. package/coms/zimoli/select.js +9 -4
  79. package/coms/zimoli/select.less +3 -14
  80. package/coms/zimoli/selectList.js +5 -1
  81. package/coms/zimoli/selectList.less +3 -0
  82. package/coms/zimoli/table.html +7 -7
  83. package/coms/zimoli/table.js +12 -9
  84. package/coms/zimoli/table.less +5 -0
  85. package/coms/zimoli/user.js +2 -2
  86. package/coms/zimoli/view.js +3 -4
  87. package/coms/zimoli/watch.js +3 -1
  88. package/coms/zimoli/zimoli.js +6 -2
  89. package/coms//350/214/250/350/217/260/tab.js +26 -2
  90. package/coms//350/214/250/350/217/260//346/240/207/347/255/276/345/214/226.js +1 -1
  91. package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +183 -20
  92. package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +5 -0
  93. package/package.json +1 -1
  94. package/public/efront.js +1 -1
  95. package/readme-en.md +3 -5
  96. package/readme.md +3 -4
@@ -203,17 +203,62 @@ class Code extends Array {
203
203
 
204
204
  var avoidMap = null;
205
205
  var typeMap = Object.create(null);
206
- function scan() {
207
- var [text, type = "js", lastIndex = 0] = arguments;
208
- if (isFinite(type)) lastIndex = +type, type = arguments[2] || type;
209
- var program = typeMap[type];
206
+ function scan(text) {
207
+ var fullpath, type, lastIndex = 0, program;
208
+ for (var cx = 1, dx = arguments.length; cx < dx; cx++) {
209
+ var a = arguments[cx];
210
+ switch (typeof a) {
211
+ case "number":
212
+ lastIndex = a;
213
+ break;
214
+ case "string":
215
+ if (!fullpath) {
216
+ fullpath = a;
217
+ break;
218
+ }
219
+ else if (!type) {
220
+ type = a;
221
+ break;
222
+ }
223
+ case "object":
224
+ case "function":
225
+ type = a;
226
+ break;
227
+ default:
228
+ throw new Error('无效参数: ' + type);
229
+ }
230
+ }
231
+ if (!type) {
232
+ if (/\.[^\.\/\\]+$/i.test(fullpath)) {
233
+ type = /[^\.\/\\]+$/.exec(fullpath)[0].toLowerCase();
234
+ }
235
+ else {
236
+ type = fullpath || 'js';
237
+ }
238
+ }
210
239
  if (!program) switch (type) {
211
240
  case "html":
212
- program = typeMap[type] = new Html;
241
+ case "xht":
242
+ case "htm":
243
+ case "jsp":
244
+ case "asp":
245
+ case "php":
246
+ case "hta":
247
+ case "vue":
248
+ type = 'html';
249
+ program = typeMap[type];
250
+ if (!program) program = typeMap[type] = new Html;
213
251
  break;
214
252
  case "js":
253
+ case "ts":
254
+ case "jsx":
255
+ case "tsx":
256
+ case "mjs":
257
+ case "cjs":
215
258
  case "javascript":
216
- program = typeMap[type] = new Javascript;
259
+ type = "js";
260
+ program = typeMap[type];
261
+ if (!program) program = typeMap[type] = new Javascript;
217
262
  break;
218
263
  default:
219
264
  if (type instanceof Function) {
@@ -223,12 +268,13 @@ function scan() {
223
268
  program = type;
224
269
  }
225
270
  else {
226
- console.log(i18n`类型不支持`, type)
271
+ throw new Error(i18n`类型不支持: ${console.format(`<red2>${type}</red2>`)}`);
227
272
  }
228
273
  break;
229
274
  }
230
275
  program.Code = Code;
231
276
  program.lastIndex = lastIndex;
277
+ program.mindpath = fullpath;
232
278
  var res = program.exec(text);
233
279
  res.autospace = !program.keepspace;
234
280
  Object.defineProperty(res, "program", { value: program, enumerable: false })
@@ -100,7 +100,7 @@ function translate([imap, supports], code) {
100
100
  return 0;
101
101
  });
102
102
  var getm = function (tt, nodup, warn) {
103
- var mq = /^(\s*)([\s\S]*?)(\s*)$/.exec(tt);
103
+ var mq = /^(\s*)([\s\S]*?)([\:\:]?\s*)$/.exec(tt);
104
104
  var mq = [mq[1] || '', mq[2], mq[3] || ''];
105
105
  var tt = mq[1];
106
106
  var wrap = m => {
@@ -134,13 +134,13 @@ var _withget = function (text) {
134
134
  if (index < 0) index = text.length;
135
135
  var name = text.slice(0, index);
136
136
  var prop = text.slice(index);
137
- return rescan`${patchMark + "wget"}(${`"${name}"`},[${_evals()}],${name})${prop}`;
137
+ return rescan.keep`${patchMark + "wget"}(${`"${name}"`},[${_evals()}],${name})${prop}`;
138
138
  };
139
139
  var _withset = function (text, tmpname, valname) {
140
140
  var index = text.indexOf(".");
141
141
  if (index < 0) index = text.length;
142
142
  var name = text.slice(0, index);
143
- return rescan`if(${tmpname}=${patchMark + "with"}(${`"${name}"`},[${_evals()}]))${tmpname}.${text}=${valname};else ${text}=${valname};`;
143
+ return rescan.keep`if(${tmpname}=${patchMark + "with"}(${`"${name}"`},[${_evals()}]))${tmpname}.${text}=${valname};else ${text}=${valname};`;
144
144
  };
145
145
  var _switch = function (body, cx, unblock, result, getname) {
146
146
  var o = body[cx];
@@ -324,7 +324,7 @@ var _while = function (body, cx, unblock, result) {
324
324
  o = o.next;
325
325
  while (cx < body.length && body[cx] !== o) cx++;
326
326
  var i = result.length;
327
- var b = rescan`if (${getCondition(o, unblock, true)}) return []`;
327
+ var b = rescan.keep`if (${getCondition(o, unblock, true)}) return []`;
328
328
  var be = b[b.length - 1];
329
329
  pushstep(result, b);
330
330
  var i2 = result.length - 1;
@@ -351,7 +351,7 @@ var pushstep = function (result, step) {
351
351
  }
352
352
  else if (q.await_) {
353
353
  if (!step.awaited) {
354
- step.unshift(...rescan`${q.name}=${ret_};`), relink(step);
354
+ step.unshift(...rescan.keep`${q.name}=${ret_};`), relink(step);
355
355
  step.awaited = true;
356
356
  }
357
357
  result.push(step);
@@ -435,7 +435,7 @@ var _do = function (body, cx, unblock, result) {
435
435
  o = o.next.next;
436
436
 
437
437
  if (label.continue) ifpatch(result), label.contat = result.length;
438
- var b = rescan`if (${getCondition(o, unblock)}) return [${i - result.length}, 0]`;
438
+ var b = rescan.keep`if (${getCondition(o, unblock)}) return [${i - result.length}, 0]`;
439
439
  pushstep(result, b);
440
440
  b[b.length - 1][0].text = String(i - result.length + 1);
441
441
  while (cx < body.length && body[cx] !== o) cx++;
@@ -464,7 +464,7 @@ var _return = function (r) {
464
464
  x = stepReturn(name, 2);
465
465
  }
466
466
  else if (e === THROW) {
467
- x = rescan`throw ${name}`;
467
+ x = rescan.keep`throw ${name}`;
468
468
  }
469
469
  else if (e === YIELD) {
470
470
  x = stepReturn(name, 3);
@@ -781,7 +781,7 @@ var ternary = function (body, getname, ret) {
781
781
  }
782
782
  pushstep(d, stepReturn(1, 0, d));
783
783
  pushstep(c, stepReturn(d.length + 1, 0, c));
784
- pushstep(explist, rescan`if (${getCondition(b, function (b) {
784
+ pushstep(explist, rescan.keep`if (${getCondition(b, function (b) {
785
785
  b = ternary(b, getnextname, true);
786
786
  for (var b of b) pushstep(explist, b);
787
787
  return b;
@@ -1323,10 +1323,10 @@ function toqueue(body, getname, ret = false, result = []) {
1323
1323
  var n = getCondition(o, unblock, !isbr);
1324
1324
  o = o.next;
1325
1325
  if (isbr) {
1326
- var c = rescan`if (${n})`;
1326
+ var c = rescan.keep`if (${n})`;
1327
1327
  }
1328
1328
  else {
1329
- var c = rescan`if (${n}) return [0, 0]`;
1329
+ var c = rescan.keep`if (${n}) return [0, 0]`;
1330
1330
  }
1331
1331
  var ce = c[3];
1332
1332
  pushstep(result, c);
@@ -28,6 +28,16 @@ Object.assign(encode62, {
28
28
  src,
29
29
  map,
30
30
  time_delta: parseInt("zzzzz", 36),
31
+ pack: 'efront-encode62s',
32
+ packdecode(string) {
33
+ return this.timedecode(string, this.pack);
34
+ },
35
+ packencode(string) {
36
+ return this.timeencode(string, this.pack);
37
+ },
38
+ packupdate(string) {
39
+ return this.timeupdate(string, this.pack);
40
+ },
31
41
  safeencode(string, sign, offset) {
32
42
  string = encodeURIComponent(string).replace(/\./g, '..').replace(/[\!'\(\)~]/g, a => escape(a)).replace(/%/g, '.');
33
43
  return this.encode62(string, sign, offset);
@@ -36,23 +46,43 @@ Object.assign(encode62, {
36
46
  string = this.decode62(string, sign, offset).replace(/\.\.?/g, a => a === '.' ? "%" : ".");
37
47
  return decodeURIComponent(string);
38
48
  },
39
- timedecode(string) {
49
+ timedecode(string, pack) {
40
50
  var { time_delta } = this;
41
51
  var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
42
52
  var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
43
53
  var time_stamp = time_start + parseInt(time_rest, 36);
44
- return this.safedecode(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36));
54
+ string = string.slice(0, string.length - time_delta.toString(36).length);
55
+ if (pack) {
56
+ string = this.decode62(string, time_stamp.toString(36) + pack);
57
+ var sign = string.slice(string.length - 7, string.length);
58
+ sign = parseInt(sign, 36);
59
+ sign -= 0x600000000 + (time_stamp & 0xffffffff);
60
+ string = string.slice(0, string.length - 7);
61
+ string = decode62S(string);
62
+ if (crc.string(time_stamp.toString(36) + pack + string) !== sign) throw new Error('数据校验不通过!');
63
+ return string;
64
+ }
65
+ return this.safedecode(string, time_stamp.toString(36));
45
66
  },
46
- timeencode(string) {
67
+ timeencode(string, pack) {
47
68
  var { time_delta } = this;
48
69
  var time_free = time_delta / 6 | 0;
49
70
  var time_stamp = +new Date() - time_free;
50
71
  var time_rest = time_stamp % time_delta;
51
72
  var time_rest_str = time_rest.toString(36);
52
73
  var time_delta_str = time_delta.toString(36);
53
- return this.safeencode(string, time_stamp.toString(36)) + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
74
+ if (pack) {
75
+ var sign = crc.string(time_stamp.toString(36) + pack + string);
76
+ sign += 0x600000000 + (time_stamp & 0xffffffff);
77
+ string = encode62S(string) + sign.toString(36);
78
+ string = this.encode62(string, time_stamp.toString(36) + pack);
79
+ }
80
+ else {
81
+ string = this.safeencode(string, time_stamp.toString(36));
82
+ }
83
+ return string + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
54
84
  },
55
- timeupdate(string) {
85
+ timeupdate(string, pack) {
56
86
  var { time_delta } = this;
57
87
  var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
58
88
  var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
@@ -60,7 +90,7 @@ Object.assign(encode62, {
60
90
  if (time_stamp + (time_delta >> 1) > +new Date()) {
61
91
  return string;
62
92
  } else {
63
- return this.timeencode(this.timedecode(string));
93
+ return this.timeencode(this.timedecode(string, pack), pack);
64
94
  }
65
95
  },
66
96
  encode62(data, sign, offset = 0) {
@@ -1,51 +1,11 @@
1
1
  "use strict";
2
2
  // 中文编码 utf-8
3
- describe("encode62_test", function () {
4
- var encode62, a, b, c, d;
5
- var expect = require("chai").expect;
6
- var timeencoded;
7
- before(function () {
8
- encode62 = require("./encode62");
9
- });
10
- it("encode62", function () {
11
- console.log(encode62("你好啊"));
12
- });
13
- it("encode62.timeencode", function () {
14
- console.log(timeencoded = encode62.timeencode("xiao"));
15
- });
16
- it("encode62.timedecode", function () {
17
- console.log(encode62.timedecode(timeencoded));
18
- });
19
- it("encode62.encode", function () {
20
- console.log(timeencoded = encode62.encode("adfasd", 'abcd'));
21
- });
22
- it("encode62.decode", function () {
23
- console.log(encode62.decode(timeencoded, 'abcd').toString());
24
- });
25
- it("geta", function () {
26
- a = encode62.geta("efront");
27
- });
28
- it("genb", function () {
29
- b = encode62.genb();
30
- });
31
- it("ab2c", function () {
32
- c = encode62.ab2c(a, b);
33
- });
34
- it("ba2d", function () {
35
- // 注意,参数顺序已变更
36
- d = encode62.ba2d(b, a);
37
- });
38
- it("ca2b", function () {
39
- expect(encode62.ca2b(c, a)).to.be.eq(b);
40
- });
41
- it("cb2a", function () {
42
- expect(encode62.cb2a(c, b)).to.be.eq(a);
43
- });
44
- it("da2b", function () {
45
- expect(encode62.da2b(d, a)).to.be.eq(b);
46
- });
47
- it("db2a", function () {
48
- expect(encode62.db2a(d, b)).to.be.eq(a);
49
- })
3
+ var test = function (string) {
4
+ var packed = encode62.packencode(string);
5
+ var unpacked = encode62.packdecode(packed);
6
+ assert(string, unpacked);
7
+ }
50
8
 
51
- });
9
+ test('adsfa');
10
+ test('a');
11
+ test('');
@@ -59,11 +59,7 @@ fileitem {
59
59
  outline: 1.2px solid #28c;
60
60
  }
61
61
 
62
- &:active {
63
- color: #28c;
64
- outline: 2px solid;
65
- }
66
-
62
+
67
63
  &.focused {
68
64
  background: #28c2;
69
65
  outline: 1.2px solid #28c;
@@ -136,7 +136,7 @@ function chat(title = '会话窗口') {
136
136
  break;
137
137
  }
138
138
  return false;
139
- }).map(m => JSAM.parse(encode62.timedecode(m))).filter(m => {
139
+ }).map(m => JSAM.parse(encode62.packdecode(m))).filter(m => {
140
140
  if (m.type === 'accept') {
141
141
  page.$scope.pushFile(m.content);
142
142
  return false;
@@ -266,7 +266,7 @@ function chat(title = '会话窗口') {
266
266
  if (this.user && this.user.id !== this.localid && type !== "accept") {
267
267
  addToMsgList(this.msglist, [msg]);
268
268
  }
269
- data = encode62.timeencode(data);
269
+ data = encode62.packencode(data);
270
270
  cast(page, "send", data);
271
271
  this.body.lastElementChild.focus();
272
272
  this.text = '';
@@ -1,13 +1,14 @@
1
- <header ng-if="!user.isLogin" class="navbar-header">
1
+ <header head ng-if="!user.isLogin" class="navbar-header">
2
2
  <!-- <avatar></avatar> -->
3
3
  <a @click="popup('#/user/login')" class="dashboard_text">请登录</a>
4
4
  </header>
5
- <header -else class="navbar-header">
5
+ <header head -else class="navbar-header">
6
6
  <span class="dashboard_text" @click="go('/user/profile')">
7
7
  <avatar ng-src="user.avatar" size=30></avatar>
8
8
  <span ng-bind="user.name"></span>
9
9
  <span ng-bind="user.roles"></span>
10
10
  </span>
11
11
  </header>
12
- <ylist mode=inline ng-src="menu in menus" class="sidebar-menu" ng-active="menus.open(menu)">
13
- </ylist>
12
+ <ylist body mode=inline ng-src="menu in menus" class="sidebar-menu" ng-active="menus.open(menu)">
13
+ </ylist>
14
+ <footer foot></footer>
@@ -17,5 +17,6 @@ function main() {
17
17
  on('append')(page, function () {
18
18
  frame$route.open();
19
19
  });
20
+ view(page)
20
21
  return page;
21
22
  }
@@ -1,16 +1,18 @@
1
1
  & {
2
- padding: 50px 0 0 0;
2
+ padding: 0 0 0 0;
3
3
  position: relative;
4
4
  }
5
5
 
6
6
  .navbar-header {
7
+ &:before{
8
+ display: none;
9
+ }
7
10
  min-height: 50px;
8
11
  padding: 10px 15px 10px 25px;
9
12
  font-size: 25px;
10
13
  line-height: 25px;
11
14
  text-transform: uppercase;
12
15
  color: #b8c7ce;
13
- margin-top: -50px;
14
16
  display: block;
15
17
  }
16
18
 
@@ -32,7 +34,7 @@ ylist {
32
34
  box-shadow: none;
33
35
  }
34
36
 
35
- .label {
37
+ >.header .label {
36
38
  border-radius: 4px;
37
39
  height: 18px;
38
40
  line-height: 18px;
@@ -22,7 +22,7 @@ function main(paytypes, price, subject = '网站扫码支付') {
22
22
  if (!pay) return 'about:blank';
23
23
  var url = pay.url;
24
24
  if (isFunction(url)) url = url.call(pay, this.finalpay, subject);
25
- else if (url) url += encode62.timeencode(this.finalpay + "," + subject);
25
+ else if (url) url += encode62.packencode(this.finalpay + "," + subject);
26
26
  return url;
27
27
  },
28
28
  get finalpay() {
@@ -50,7 +50,7 @@ function main(paytypes, price, subject = '网站扫码支付') {
50
50
  var query = lazy(async function () {
51
51
  if (!tradeid || queryres) return;
52
52
  if (isFunction(queryurl)) var res = await queryurl(tradeid);
53
- else if (isString(queryurl)) var res = await cross('get', queryurl + encode62.timeencode(tradeid)), res = JSAM.parse(res.response || res.responseText);
53
+ else if (isString(queryurl)) var res = await cross('get', queryurl + encode62.packencode(tradeid)), res = JSAM.parse(res.response || res.responseText);
54
54
  if (queryres) return;
55
55
  if (res) queryres = res, cast(page, 'payment', res._id);
56
56
  }, -200);
@@ -253,12 +253,15 @@ var acme2 = new class {
253
253
  var termsOfService = data?.meta?.termsOfService;
254
254
  return termsOfService;
255
255
  }
256
- async newAccount(params) {
256
+ getAccount(params) {
257
+ return this.newAccount(params, true);
258
+ }
259
+ async newAccount(params, onlyReturnExisting) {
257
260
  var account = await request("new-account", {
258
261
  "contact": [
259
262
  "mailto:" + params.email
260
263
  ],
261
- // onlyReturnExisting: false,// 可选
264
+ onlyReturnExisting: onlyReturnExisting,// 可选
262
265
  // externalAccountBinding: {},// 可选
263
266
  "termsOfServiceAgreed": params.termsOfServiceAgreed
264
267
  });
@@ -267,7 +270,7 @@ var acme2 = new class {
267
270
  this.kid = account;
268
271
  var a = data.getUrlParamsForApi(accountApi, account);
269
272
  this.aid = a.aid;
270
- alert('创建成功!', 'success');
273
+ alert(onlyReturnExisting ? "账号存在" : '创建成功!', 'success');
271
274
  return account;
272
275
  }
273
276
  async newOrder(params) {
@@ -366,7 +369,7 @@ var acme2 = new class {
366
369
  o = await acme2.auditOrder(o, setauth);
367
370
  }
368
371
  if (o.status === 'ready') {
369
- await this.finalizeOrder(o, upload);
372
+ o = await this.finalizeOrder(o, upload);
370
373
  o = await this.waitStatus(o);
371
374
  }
372
375
  if (o.status === 'valid') {
@@ -0,0 +1,25 @@
1
+ <style>
2
+ & {
3
+ position: absolute;
4
+ width: 100%;
5
+ bottom: 0;
6
+ left: 0;
7
+ right: 0;
8
+ z-index: 1;
9
+ display: block;
10
+ text-align: center;
11
+ }
12
+ </style>
13
+ <div>
14
+ <a @click="logout">${i18n`退出登录`}</a>
15
+ </div>
16
+
17
+ <script>
18
+ var a = button;
19
+ async function logout() {
20
+ data.setSource({});
21
+ await user.Logout();
22
+ zimoli.switch();
23
+ zimoli();
24
+ }
25
+ </script>
@@ -1,9 +1,9 @@
1
1
  function send(type, key, value, origin) {
2
2
  return data.from(origin, {
3
3
  type,
4
- key: encode62.timeencode(key),
5
- value: isHandled(value) ? encode62.timeencode(JSON.stringify(value)) : '',
6
- }, e => e ? JSAM.parse(encode62.timedecode(e)) : '').loading_promise;
4
+ key: encode62.packencode(key),
5
+ value: isHandled(value) ? encode62.packencode(JSON.stringify(value)) : '',
6
+ }, e => e ? JSAM.parse(encode62.packdecode(e)) : '').loading_promise;
7
7
  }
8
8
  function pedit(title, type, params, idkey = params.fields[0].key) {
9
9
  var pdata = params.data;
@@ -1,8 +1,8 @@
1
1
  function load(type, idkey) {
2
- return data.from("list", { type, idkey: encode62.timeencode(idkey) }, a => JSAM.parse(encode62.timedecode(a || '')));
2
+ return data.from("list", { type, idkey: encode62.packencode(idkey) }, a => JSAM.parse(encode62.packdecode(a || '')));
3
3
  }
4
4
  function remove(type, key) {
5
- return data.from("edit", { type, key: encode62.timeencode(key), value: encode62.timeencode("") }).loading_promise;
5
+ return data.from("edit", { type, key: encode62.packencode(key), value: encode62.packencode("") }).loading_promise;
6
6
  }
7
7
  function plist() {
8
8
  var title, type, fields, edit_ref, options, idkey, buttons;
@@ -2,6 +2,9 @@
2
2
  &[empty] {
3
3
  opacity: .3;
4
4
  }
5
+ &{
6
+ cursor: pointer;
7
+ }
5
8
  </style>
6
9
  <canvas width="240" height="240" style="width:240px;height:240px;image-rendering: pixelated;" />
7
10
  <script>
@@ -1,4 +1,4 @@
1
- if (this.XMLHttpRequest) return this.XMLHttpRequest;
1
+ if (this.XMLHttpRequest && this.XMLHttpRequest.prototype && "onreadystatechange" in this.XMLHttpRequest.prototype) return this.XMLHttpRequest;
2
2
  if (this.ActiveXObject) return this.ActiveXObject.bind(null, 'Microsoft.XMLHTTP');
3
3
  if (!this.fetch) return;
4
4
  var window = this;
@@ -17,18 +17,21 @@ XMLHttpRequest.prototype.open = function (method, url) {
17
17
  XMLHttpRequest.prototype.send = function (data) {
18
18
  var params = { method: this.method, headers: { referer: document.location.href.replace(/^#[\s\S]*$/g, '') } };
19
19
  if (data != null) params.body = data;
20
- this.fetch(this.url, params).then(function (d) {
21
- this.fetched = d;
22
- this.readyState = 4;
23
- this.status = d.status;
20
+ var fetched = this.fetch(this.url, params);
21
+ var xhr = this;
22
+ fetched.then(function (d) {
23
+ xhr.fetched = d;
24
+ xhr.readyState = 4;
25
+ xhr.status = d.status;
24
26
  return d.text();
25
27
  }).then(function (d) {
26
- this.responseText = d;
27
- if (this.onreadystatechange) this.onreadystatechange({ target: this });
28
- if (this.onload) this.onload({ target: this });
29
- }, function (e) {
30
- this.readyState = 4;
31
- if (this.onreadystatechange) this.onreadystatechange({ target: this });
32
- if (this.onerror) this.onerror({ target: this });
28
+ xhr.responseText = d;
29
+ if (xhr.onreadystatechange) xhr.onreadystatechange({ target: xhr });
30
+ if (xhr.onload) xhr.onload({ target: xhr });
31
+ })["catch"](function (e) {
32
+ xhr.readyState = 4;
33
+ if (xhr.onreadystatechange) xhr.onreadystatechange({ target: xhr });
34
+ if (xhr.onerror) xhr.onerror({ target: xhr });
33
35
  });
34
- }
36
+ }
37
+ return XMLHttpRequest;
@@ -1,45 +1,45 @@
1
- function container(element) {
2
- var change = lazy(async function (src) {
3
- if (src !== this.$src) return;
4
- if (!src) remove(this.with);
5
- else if (isNode(src)) {
6
- if (isElement(src) && this.$struct.copys) {
7
- for (var c of this.$struct.copys) {
8
- if (c.name === 'class') {
9
- addClass(src, c.value);
10
- }
11
- else if (c.name === 'style') {
12
- css(src, c.value);
13
- }
14
- else src.setAttribute(c.name, c.value);
1
+ var change = async function (src) {
2
+ if (src !== this.$src) return;
3
+ if (!src) remove(this.with);
4
+ else if (isNode(src)) {
5
+ if (isElement(src) && this.$struct.copys) {
6
+ for (var c of this.$struct.copys) {
7
+ if (c.name === 'class') {
8
+ addClass(src, c.value);
9
+ }
10
+ else if (c.name === 'style') {
11
+ css(src, c.value);
15
12
  }
13
+ else src.setAttribute(c.name, c.value);
16
14
  }
17
- zimoli.global(src, this);
18
- }
19
- else if (isString(src) || +src < 0) {
20
- watch(this, 'params', onparams);
21
- onparams.call(this, this.params);
22
- }
23
- });
24
- var gosrc = function (src) {
25
- if (!isHandled(this.$src) && !isHandled(src)) return;
26
- if (src !== this.$src) {
27
- this.$src = src;
28
- change.call(this, src);
29
15
  }
30
- };
31
- var onparams = lazy(function (params) {
32
- zimoli.go(this.$src, params, this);
33
- });
16
+ zimoli.global(src, this);
17
+ }
18
+ else if (isString(src) || +src < 0) {
19
+ onparams.call(this, this.params);
20
+ }
21
+ };
22
+ var gosrc = function (src) {
23
+ if (!isHandled(this.$src) && !isHandled(src)) return;
24
+ if (src !== this.$src) {
25
+ this.$src = src;
26
+ change.call(this, src);
27
+ }
28
+ };
29
+ var goone = function (src) {
30
+ if ("$src" in this) return;
31
+ gosrc.call(this, src);
32
+ };
33
+ var onparams = function (params) {
34
+ zimoli.go(this.$src, params, this);
35
+ };
36
+ function container(element) {
34
37
  var comment = document.createComment('container');
35
38
  comment.$struct = element.$struct;
36
39
  care(comment, gosrc);
37
40
  if (element.hasAttribute && element.hasAttribute('src')) {
38
41
  var src = element.getAttribute('src');
39
- if (src) oncemount(comment, function () {
40
- if ("$src" in this) return;
41
- gosrc.call(this, src);
42
- });
42
+ if (src) oncemount(comment, goone);
43
43
  }
44
44
  return comment;
45
45
  }
@@ -1,19 +1,12 @@
1
1
  <div class="options">
2
- <btn class="add" ng-click=add()><i>+</i>添加</btn>
2
+ <btn ng-click=add()><i>+</i><SPAN>添加字段</SPAN></btn>
3
3
  </div>
4
- <list ng-src='(field,cx) in fields' class="fields">
4
+ <dlist ng-src='(f,cx) in fields' class="fields">
5
5
  <padding>
6
6
  <div class="field-item">
7
- <span class="index" ng-bind='field.id'></span>
8
- <input @focus="focus(this.parentNode)" @blur="blur(this.parentNode)" placeholder="显示名称"
9
- ng-model=field.name />
10
- <input @focus="focus(this.parentNode)" @blur="blur(this.parentNode)" placeholder="键名" ng-model=field.key />
11
- <select @focus="focus(this.parentNode)" -model="field.type" @blur="blur(this.parentNode)"
12
- ng-model=field.type >
13
- <option value="">请选择字段类型</option>
14
- <option _value="type.key" ng-repeat="type in types" -text="type.name"></option>
15
- </select>
16
- <btn ng-click=remove(field)>移除</btn>
7
+ <i .index -bind="cx+1"></i>
8
+ <field -src="[d,f]" -repeat="d in defines"></field>
9
+ <drop ng-click="remove(f)"></drop>
17
10
  </div>
18
11
  </padding>
19
- </list>
12
+ </dlist>