efront 4.5.15 → 4.5.17

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.
@@ -1,3 +1,24 @@
1
+ - zh-CN: 共$1个不同的项
2
+ en: A total of $1 different items
3
+
4
+ - zh-CN: 计数
5
+ en: Count
6
+
7
+ - zh-CN: 千次快照
8
+ en: Thousand snapshots
9
+
10
+ - zh-CN: 远程地址
11
+ en: Remote address
12
+
13
+ - zh-CN: 时间
14
+ en: Time
15
+
16
+ - zh-CN: 来源
17
+ en: From
18
+
19
+ - zh-CN: 客户端
20
+ en: Client
21
+
1
22
  - zh-CN: IP地址
2
23
  en: IP address
3
24
 
@@ -322,7 +343,7 @@
322
343
  - zh-CN: 消息体不合法!
323
344
  en: The message body is illegal!
324
345
 
325
- - zh-CN: 您的传达了有歧义的信息:$1
346
+ - zh-CN: 您传达了有歧义的信息:$1
326
347
  en: "Your message conveyed ambiguous information: $1"
327
348
 
328
349
  - zh-CN: 父元素不能是当前元素的子元素
@@ -1,48 +1,10 @@
1
- var checkPort = async function (p, ip) {
2
- if (!p.host) {
3
- if (/^::ffff:\d+\.\d+\.\d+\.\d+$/i.test(ip)) {
4
- ip = ip.slice(7);
5
- }
6
- else {
7
- ip = `[${ip}]`;
8
- }
9
- p.locate(ip);
10
- }
11
- try {
12
- p.locate("/:version");
13
- var xhr = await cross("@options", p.href);
14
- if (/^efront/.test(xhr.response)) {
15
- p.ok = true;
16
- }
17
- else {
18
- p.error = '异常';
19
- }
20
- } catch (e) {
21
- p.error = e;
22
- }
23
-
24
- }
25
1
  var fields = refilm`
26
2
  IP地址/ip text/120
27
- 地理位置/address/查看 act/80 ${async function (a) {
28
- var ip = a.ip;
29
- var m = /(\d+\.){3}\d+$/.exec(ip);
30
- var { address } = await data.from("iplocation", { ip: m ? m[0] : ip });
31
- a.address = address;
32
- }}
3
+ 地理位置/address/查看 act/80 ${checkGeo}
33
4
  启动时间/time ${function (e) {
34
5
  e.innerHTML = filterTime(e.data[e.field.key]);
35
6
  }}
36
- 绑定地址/port 120/${async function (e) {
37
- var { data, field } = e;
38
- var ports = data[field.key].split(/,/).map(p => parseURL(p));
39
- e.innerHTML = `<a -repeat="p in ports" @click="checkPort(p,ip)" -class="{ok:p.ok,error:p.error}"><span -bind=p></span></a>`;
40
- render(e, {
41
- ports,
42
- ip: data.ip,
43
- checkPort,
44
- })
45
- }}
7
+ 绑定地址/port 120/${checkPort}
46
8
  版本/version input
47
9
  进程/pid
48
10
  `;
@@ -1,5 +1,7 @@
1
+ <xmenu -src="(m,i)in menus" @actived="saveState(i)"></xmenu>
1
2
  <div class="searchbox">
2
3
  <input -model="searchText" />
3
4
  </div>
4
- <table -src="[fields,items]" _find="searchText">
5
- </talbe>
5
+ <table -if="menus[0].actived" -src="[fields,items]" _find="searchText">
6
+ </table>
7
+ <table -elseif="menus[1].actived" -src="[fields2,recent]" _find="searchText"></table>
@@ -2,21 +2,50 @@ var fields = refilm`
2
2
  访问量/count money/10
3
3
  路径/path html/20
4
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;
5
23
  function main() {
6
24
  var page = div();
7
25
  page.innerHTML = template;
8
26
  var items = data.from("count", a => {
9
- return Object.keys(a).map(b => ({ path: b, count: a[b] }));
27
+ if (a["#"]) {
28
+ delete a["#"];
29
+ }
30
+ var items = Object.keys(a).map(b => ({ path: b, count: a[b] }));
31
+ return items;
32
+ });
33
+ var recent = data.from("count", a => {
34
+ var recent = a["#"];
35
+ if (recent) recent = recent.slice().reverse();
36
+ return recent;
10
37
  });
11
38
  renderWithDefaults(page, {
12
39
  items,
13
- searchText: "",
14
- filter() {
15
- var text = this.searchText;
16
- if (!text) return this.items = items;
17
- this.items = search(text, items, 'path');
40
+ xmenu: menu,
41
+ menus,
42
+ saveState(i) {
43
+ state({ index: i });
18
44
  },
19
- fields
45
+ searchText: "",
46
+ fields,
47
+ fields2,
48
+ recent,
20
49
  });
21
50
  return page;
22
51
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  function minusPower(a, b) {
3
- return a.power - b.power >= 0;
3
+ return a.$power - b.$power >= 0;
4
4
  }
5
5
  function returnName() {
6
6
  return this.name;
@@ -20,12 +20,17 @@ class Table extends Array {
20
20
  searchid = 0;
21
21
  coverCount = 0;
22
22
  hasFullmatch = false;
23
+ summaryFields = [];
24
+ $summaryData = [];
25
+ $filterFields = [];
26
+ $unsummaryFileds = [];
23
27
  callback = null;
24
28
  static from(fields, data) {
25
29
  var t = new Table;
26
30
  t.fields = fields;
27
31
  t.source = data;
28
32
  t.searchFields = fields.filter(searchThis);
33
+ t.summaryFields = fields.filter(s => s.summary);
29
34
  t.update();
30
35
  return t;
31
36
  }
@@ -51,10 +56,47 @@ class Table extends Array {
51
56
  this.sorted = null;
52
57
  this.update();
53
58
  }
59
+ summary(o) {
60
+ var data = this.$summaryData;
61
+ var is = this.summaryFields.map((f, i) => {
62
+ if (!isHandled(f.key)) return;
63
+ var d = seek(o, f.key);
64
+ if (!isHandled(d)) d = '';
65
+ var dt = data[i];
66
+ var di = dt.indexOf(d);
67
+ if (di < 0) di = dt.length, dt.push(d);
68
+ return "-" + di;
69
+ }).join("");
70
+ var dis = data[is];
71
+ if (!dis) {
72
+ dis = data[is] = Object.assign({}, o);
73
+ dis.$summary = this.$unsummaryFileds.map(function (f, i) {
74
+ if (typeof f.key !== "string") return;
75
+ Object.defineProperty(dis, f.key, {
76
+ get() {
77
+ var s = this.$summary[i];
78
+ if (s.length === 1) return s[0];
79
+ return i18n`共${this.$summary[i].length}个不同的项`;
80
+ },
81
+ })
82
+ return [];
83
+ });
84
+ saveToOrderedArray(this, dis, minusPower);
85
+ }
86
+ var undata = dis.$summary;
87
+ this.$unsummaryFileds.forEach((f, i) => {
88
+ if (typeof f.key !== 'string') return;
89
+ var d = seek(o, f.key);
90
+ if (!isHandled(d)) d = '';
91
+ var dt = undata[i];
92
+ var di = dt.indexOf(d);
93
+ if (di < 0) di = dt.length, dt.push(d);
94
+ });
95
+ }
54
96
  addItem(o) {
55
97
  if (!isHandled(o)) return;
56
98
  var searchtext = this.searchText;
57
- var fields = this.searchFields ? this.searchFields : this.fields;
99
+ var fields = this.$filterFields;
58
100
  var power = 0;
59
101
  var s = o;
60
102
  if (isNode(o)) {
@@ -80,9 +122,11 @@ class Table extends Array {
80
122
  if (!isEmpty(f.key) && !isFunction(f.key)) o[f.key] = m;
81
123
  else o.name = m, o.toString = returnName, o.valueOf = returnName;
82
124
  }
83
- o.power = power;
84
- if (o.power > 0) {
85
- saveToOrderedArray(this, o, minusPower);
125
+ o.$power = power;
126
+ if (o.$power > 0) {
127
+ var summary = this.$summaryData;
128
+ if (!summary.length) saveToOrderedArray(this, o, minusPower);
129
+ else this.summary(o);
86
130
  }
87
131
  }
88
132
  search(text, callback) {
@@ -102,6 +146,12 @@ class Table extends Array {
102
146
  this.searched = 0;
103
147
  var source = this.sorted ? this.sorted : this.source;
104
148
  if (!source) return;
149
+ var summaryData = this.$summaryData = this.summaryFields.map(_ => []);
150
+ this.$unsummaryFileds = this.fields.filter(f => this.summaryFields.indexOf(f) < 0);
151
+ var $filterFields = this.searchFields?.length ? this.searchFields : this.fields;
152
+ if (this.summaryFields.length) this.$filterFields = $filterFields.filter(f => this.summaryFields.indexOf(f) >= 0);
153
+ else this.$filterFields = $filterFields;
154
+ var useSummaryOnly = !this.searchText && summaryData.length > 0;
105
155
  var searchid = ++this.searchid;
106
156
  this.complete = false;
107
157
  this.coverCount = 0;
@@ -110,13 +160,12 @@ class Table extends Array {
110
160
  source = source.filter(a => origin.indexOf(a) < 0);
111
161
  source = origin.concat(source);
112
162
  }
113
- if (this.searchText) for (var o of source) {
114
- this.addItem(o);
163
+ if (this.searchText || summaryData.length > 0) for (var o of source) {
164
+ if (useSummaryOnly) this.summary(o);
165
+ else this.addItem(o);
115
166
  if (++this.searched % 600 === 0) {
116
167
  if (isFunction(this.callback)) this.callback();
117
- await new Promise(function (ok) {
118
- requestAnimationFrame(ok)
119
- });
168
+ await new Promise(requestAnimationFrame);
120
169
  if (this.searchid !== searchid) break;
121
170
  }
122
171
  }
@@ -1,4 +1,17 @@
1
1
 
2
+ // 中国经济的下行,罪魁祸首不是疫情,也不是钟南山、许家印或俞敏洪,而是习近平。
3
+ // 这一切要从2012年开始说起。
4
+ // 习近平公然废止主席换界规则的行为,也许出发点是好的,但带来了副作用。它让人们看到一个没有时间限制的权力,几乎等于禁锢中华数千年的皇权复活了,他自己不这么想,但中国人被压迫几千年的记忆从此被唤醒了。
5
+ // 这种不被约束的权力,助长了全社会的溜须拍马之风,他提出一个中国梦,几乎是个舔狗都在说中国梦。什么文明、富强、和谐被粉刷的到处都是,最终都成了空喊的口号,每个人都还是为了每日生计奔波。
6
+ // 共产党一向如此,有个新领导提出一种思想就顺竿爬,罗列一堆。从“马克思列宁主义”到“毛泽东思想邓小平理论三个代表重要思想”再到“可持续发展”再到“中国梦”,都是为了溜须拍马背下来的。我读大学时,有一次不幸混入他们的党员会议,看着那些阿谀逢迎的嘴脸真的想吐。
7
+ // 中间层对至高权力的讨好,蒙蔽当权层的双眼,使当权层自高自大,好大喜功,无暇居安思危,做事考虑片面,错误决定频出,朝令夕改。这些也就算了,因为人都犯错,我们开发软件或制定生产流程也会遇到各种问题,一天改几十次,有些人甚至以挑毛病为职业,比如测试工程师。
8
+ // 共产党做错事,却怕承认错误,是一错到底,还要把错的说成对的,事后得到不惩戒,最高刑罚竟只是开除党籍。他们又掩耳盗铃,管控媒体,防民之口比防洪都积极。而这一切,从新中国成立,到现在没变吧。
9
+ // 习近平到陕西看运动会,把大感冒集中带到西安。当时,没人对他说吧。可是理发店的人却说运动会时就发现疫情了,就因为运动会要召开,所以基层小官不敢上报。
10
+ // 运动会时,我也往返西安和深圳好几次,而且被疫情办公室的通过移动网盯上,还公然对抗他们要求我做的一些事。他们居然没追问下去,一听说我过几天要走,就松了一口气。
11
+ // 现在想想,他们是不想在特殊时期惹事生非。后来,就因为开个小小的运动会,我要在淘宝上退的货,被延迟一个多月才有人揽件,淘宝的人还扣了我三千多的购物款。所以,我对这段记忆犹新。
12
+ // 习近平带着权力层的一举一动都不缺人恭维,他们的做事风格也影响着社会其他各界人士。反正胡作非为无所顾虑,那何需提防小人严于律己。权力层不是不做为,而是胡作非为,不做为他也爬不到那么高。
13
+ // 指鹿为马的手段是赵高用的,现在几乎渗透在社会的各个阶层。这一切是习近平带头的。
14
+ // 中国的底层人,被榨干最后一点自由,被按在工作岗位上999,麻木的思想不及10岁的孩童,牛马劳动到最后一秒,也不知道这一生是为了啥。
2
15
  function fixLength(minute, length = 2) {
3
16
  minute = String(minute);
4
17
  if (minute.length >= length) return minute;
@@ -18,8 +31,9 @@ function format(formater) {
18
31
  o.Y = o.y;
19
32
  o.D = o.d;
20
33
  o.H = o.h;
34
+ o.S = fixLength(o.S, 3);
21
35
  o.Day = v[v.length - 1];
22
- return formater.replace(/[yY年]+|[M月]+|[hH时]+|毫秒|[m+分]+|[sS]{3}|[Ss秒]+|[星期周天][dD]*|[dD]{3}|[日号dD]+/g, function (m) {
36
+ return formater.replace(/[yY年]+|[M月]+|[hH时]+|(S+)毫秒|[m+分]+|[sS]{3}|[Ss秒]+|[星期周天][dD]*|[dD]{3}|[日号dD]+/g, function (m) {
23
37
  if (/^[dD]{3}$/.test(m)) {
24
38
  return o.Day;
25
39
  }
@@ -51,8 +65,8 @@ function filterTime(time, formater) {
51
65
  .replace(/[三3]刻/g, "45")
52
66
  .replace(/凌晨|早上|上午/g, ' ')
53
67
  .replace(/(?:傍?晚上?|下午)(\d+)/g, (_, d) => " " + (+d + 12))
54
- .replace(/秒/g, '.')
55
- .replace(/毫/, "")
68
+ .replace(/(\d{0,3})毫秒/, (_, a) => (a / 1000 + "秒").slice(1))
69
+ .replace(/秒/g, '')
56
70
  .replace(/\.+$/, '')
57
71
  .replace(/\s+$/, '')
58
72
  .replace(/\s+/g, " ")
@@ -84,7 +98,6 @@ function filterTime(time, formater) {
84
98
  return `星期` + days[day] + time;
85
99
  }
86
100
  else if (delta > -7 && delta < -2) {
87
- console.log(day, day1)
88
101
  if (day <= day1) {
89
102
  return `下星期` + days[day] + time;
90
103
  }
@@ -4,6 +4,7 @@ assert(filterTime(undefined), '');
4
4
  assert(filterTime("我出生的第二年"), `我出生的第二年`);
5
5
  assert(filterTime(new Date(2024, 3, 3), `y年M月d日 h:mm`), '2024年4月3日 0:00');
6
6
  assert(filterTime(new Date(2024, 3, 3), `y年M月d日 h:mm`), '2024年4月3日 0:00');
7
+ assert(filterTime(new Date(2024, 3, 3, 19, 26, 2, 100), `y年M月d日 h:mm:ss.SSS`), '2024年4月3日 19:26:02.100');
7
8
  assert(filterTime("2024年4月3号", `y年M月d日h:mm`), '2024年4月3日0:00');
8
9
  assert(filterTime("2024年4月3号8点半", `y年M月d日h:mm`), '2024年4月3日8:30');
9
10
  assert(filterTime("2024年4月3号9点三刻", `y年M月d日h:mm`), '2024年4月3日9:45');
@@ -16,3 +17,6 @@ assert(filterTime("2024年4月3号凌晨6点", `y年M月d日h:mm`), '2024年4月
16
17
  assert(filterTime("2024年4月3号凌晨6点整", `y年M月d日h:mm`), '2024年4月3日6:00');
17
18
  assert(filterTime("2024/4/3凌晨6点整", `y年M月d日h:mm`), '2024年4月3日6:00');
18
19
  assert(filterTime("2024-4-3早上6点整", `y年M月d日h:mm`), '2024年4月3日6:00');
20
+ assert(filterTime("2024-4-3早上6点59分30秒20毫秒", `y年M月d日h:mm`), '2024年4月3日6:59');
21
+ assert(filterTime("2024-4-3早上6点59分30秒20毫秒", `y年M月d日h:mm:ss`), '2024年4月3日6:59:30');
22
+ assert(filterTime("2024-4-3早上6点59分30秒20毫秒", `y年M月d日h:mm:ss.S`), '2024年4月3日6:59:30.020');
@@ -20,6 +20,7 @@ const {
20
20
  getDeclared,
21
21
  createScoped,
22
22
  snapExpressHead,
23
+ patchArrawScope,
23
24
  snapExpressFoot,
24
25
  splice,
25
26
  relink,
@@ -481,11 +482,6 @@ Javascript.prototype.detour = function (body, ie) {
481
482
  context = null;
482
483
  return envs;
483
484
  }
484
- var getfunc = function (o, k) {
485
- var q = o.queue;
486
- while (q && (!q.scoped || !q.scoped.used[k])) q = q.queue;
487
- return q;
488
- };
489
485
  var context = null, rootenvs = null;
490
486
  function detour(o, ie) {
491
487
  while (o) {
@@ -514,15 +510,7 @@ function detour(o, ie) {
514
510
  if (hasdot) text = "..." + text;
515
511
  var o1 = scan(text);
516
512
  detour(o1.first, ie);
517
- var s1 = createScoped(o1);
518
- if (s1.used.this) {
519
- var s = getfunc(o, 'this').scoped;
520
- s.used.this.push(...s1.used.this);
521
- }
522
- if (s1.used.arguments) {
523
- var s = getfunc(o, 'arguments').scoped;
524
- s.used.arguments.push(...s1.used.arguments);
525
- };
513
+ patchArrawScope(o1, o);
526
514
  replace(o, ...o1);
527
515
  o = o1.last;
528
516
  continue;
@@ -1483,7 +1483,27 @@ var unshort = function (o, text) {
1483
1483
  o.isprop = false;
1484
1484
  o.type = EXPRESS;
1485
1485
  delete o.short;
1486
- }
1486
+ };
1487
+ var getScopeWith = function (o, k) {
1488
+ var q = o.queue;
1489
+ while (q && (!q.scoped || !q.scoped.used[k])) q = q.queue;
1490
+ return q;
1491
+ };
1492
+
1493
+ var patchArrawScope = function (arraw, origin) {
1494
+ var s1 = createScoped(arraw);
1495
+ if (s1.used.this) {
1496
+ var s = getScopeWith(origin, 'this').scoped;
1497
+ s.used.this.push(...s1.used.this);
1498
+ s.insett = true;
1499
+ }
1500
+ if (s1.used.arguments) {
1501
+ s.inseta = true;
1502
+ var s = getScopeWith(origin, 'arguments').scoped;
1503
+ s.used.arguments.push(...s1.used.arguments);
1504
+ };
1505
+ };
1506
+
1487
1507
  module.exports = {
1488
1508
  /* 1 */COMMENT,
1489
1509
  /* 2 */SPACE,
@@ -1502,6 +1522,8 @@ module.exports = {
1502
1522
  unshort,
1503
1523
  skipAssignment,
1504
1524
  getDeclared,
1525
+ getScopeWith,
1526
+ patchArrawScope,
1505
1527
  remove,
1506
1528
  createString,
1507
1529
  createScoped,
@@ -1,5 +1,5 @@
1
1
  var scanner2 = require("./scanner2");
2
- var { SCOPED, QUOTED, SCOPED, PROPERTY, STAMP, PIECE, setqueue, splice, relink, number_reg, replace, canbeDuplicate, createString } = require("./common");
2
+ var { SCOPED, QUOTED, SCOPED, PROPERTY, STAMP, PIECE, setqueue, splice, relink, patchArrawScope, number_reg, replace, canbeDuplicate, createString } = require("./common");
3
3
  var strings = require("../basic/strings");
4
4
  var program = null;
5
5
  var patchTranslate = function (c) {
@@ -88,7 +88,8 @@ var ctn = function (tt, t) {
88
88
  if (e in t) n[i] = t[e];
89
89
  });
90
90
  relink(n);
91
- })
91
+ });
92
+ patchArrawScope(tn, t);
92
93
  return tn;
93
94
  }
94
95
  var warningMap = Object.create(null);
@@ -1,3 +1,3 @@
1
1
  function wrapHtml(htmldata) {
2
- return "`" + String(htmldata).trim().replace(/>\s+</g, "><").replace(/\\[^`]/g, "\\$&") + "`";
2
+ return htmldata ? "`" + String(htmldata).trim().replace(/>\s+</g, "><").replace(/\\[^`]/g, "\\$&") + "`" : '``';
3
3
  }
@@ -0,0 +1,6 @@
1
+ return async function (a) {
2
+ var ip = a.ip || a.remote;
3
+ var m = /(\d+\.){3}\d+$/.exec(ip);
4
+ var { address } = await data.from("iplocation", { ip: m ? m[0] : ip });
5
+ a.address = address;
6
+ }
@@ -0,0 +1,35 @@
1
+ var checkPort = async function (p, ip) {
2
+ if (!p.host) {
3
+ if (/^::ffff:\d+\.\d+\.\d+\.\d+$/i.test(ip)) {
4
+ ip = ip.slice(7);
5
+ }
6
+ else {
7
+ ip = `[${ip}]`;
8
+ }
9
+ p.locate(ip);
10
+ }
11
+ try {
12
+ p.locate("/:version");
13
+ var xhr = await cross("@options", p.href);
14
+ if (/^efront/.test(xhr.response)) {
15
+ p.ok = true;
16
+ }
17
+ else {
18
+ p.error = '异常';
19
+ }
20
+ } catch (e) {
21
+ p.error = e;
22
+ }
23
+
24
+ }
25
+
26
+ return async function (e) {
27
+ var { data, field } = e;
28
+ var ports = data[field.key].split(/,/).map(p => parseURL(p));
29
+ e.innerHTML = `<a -repeat="p in ports" @click="checkPort(p,ip)" -class="{ok:p.ok,error:p.error}"><span -bind=p></span></a>`;
30
+ render(e, {
31
+ ports,
32
+ ip: data.ip,
33
+ checkPort,
34
+ })
35
+ }
@@ -1,12 +1,22 @@
1
1
  // 激活 自定义的 active 事件
2
2
  function active(target, value, item = value, srcElem) {
3
- var activeEvent = createEvent("active");
4
- activeEvent.item = item;
5
- activeEvent.value = value;
6
- if (srcElem) {
7
- if (Object.defineProperty) Object.defineProperty(activeEvent, 'active', { value: srcElem });
8
- else activeEvent.active = srcElem;
3
+ var dispatchEvent = function (eventname) {
4
+ var activeEvent = createEvent(eventname);
5
+ activeEvent.item = item;
6
+ activeEvent.value = value;
7
+ if (srcElem) {
8
+ if (Object.defineProperty) Object.defineProperty(activeEvent, 'active', { value: srcElem });
9
+ else activeEvent.active = srcElem;
10
+ }
11
+ activeEvent = dispatch(target, activeEvent);
12
+ return activeEvent;
13
+ };
14
+ var activeEvent = dispatchEvent("active");
15
+ var actived = activeEvent && !activeEvent.defaultPrevented;
16
+ if (actived !== false) {
17
+ Promise.resolve().then(function () {
18
+ dispatchEvent("actived");
19
+ });
9
20
  }
10
- activeEvent = dispatch(target, activeEvent);
11
- return activeEvent && !activeEvent.defaultPrevented;
21
+ return actived;
12
22
  }
@@ -3,7 +3,7 @@
3
3
  width: .8em;
4
4
  position: relative;
5
5
  border: .1em solid;
6
- margin: -0.06em .3em -0.06em 0;
6
+ margin: -0.2em .3em -0.2em 0;
7
7
  font-family: sans-serif;
8
8
  display: inline-block;
9
9
  line-height: 1;
@@ -62,7 +62,7 @@ function confirm() {
62
62
  }
63
63
  message = String(body.innerText).replace(/\s+/g, " ");
64
64
  if (conflictReg.test(String(body.innerText).replace(/\s+/g, ""))) {
65
- throw new Error(i18n`您的传达了有歧义的信息:${message}`);
65
+ throw new Error(i18n`您传达了有歧义的信息:${message}`);
66
66
  }
67
67
  if (!options) {
68
68
  for (var k in defaultOptions) {
@@ -18,6 +18,6 @@ if (preventCache && navigator) {
18
18
  } else {
19
19
  search = "=" + mark_time.toString(36);
20
20
  }
21
- if (!/Safari|Firefox|Sciter/.test(navigator.userAgent)) location.replace(location.pathname + "?" + search);
21
+ if (!/Safari|Firefox|Sciter|Baiduspider|PetalBot|Googlebot|Odin/.test(navigator.userAgent)) location.replace(location.pathname + "?" + search);
22
22
  }
23
23
  }
@@ -0,0 +1,55 @@
1
+ var Timer = class {
2
+ startTime = Date.now();
3
+ timeout = 600;
4
+ timer = 0;
5
+ target = null;
6
+ fired = false;
7
+ swap = false;
8
+ constructor(target, callback, swap) {
9
+ this.target = target;
10
+ this.run = callback;
11
+ if (!isHandled(swap) && target) {
12
+ swap = !target.hasAttribute('swapped');
13
+ }
14
+ this.swap = swap;
15
+ }
16
+ fire() {
17
+ if (!isFunction(this.run)) return;
18
+ if (this.run(this.swap) === false) {
19
+ return
20
+ }
21
+ this.fired = true;
22
+ this.end();
23
+ }
24
+ rollback() {
25
+ var target = this.target;
26
+ if (target) {
27
+ if (this.swap) {
28
+ target.removeAttribute('swapped');
29
+ }
30
+ else {
31
+ target.setAttribute('swapped', '');
32
+ }
33
+ }
34
+ }
35
+ start() {
36
+ var target = this.target;
37
+ if (target) {
38
+ if (this.swap) {
39
+ target.setAttribute("swapped", '');
40
+ }
41
+ else {
42
+ target.removeAttribute('swapped');
43
+ }
44
+
45
+ }
46
+ this.timer = setTimeout(() => this.fire(), this.timeout);
47
+ }
48
+ end() {
49
+ clearTimeout(this.timer);
50
+ if (!this.fired) this.rollback();
51
+ }
52
+ };
53
+ function main(target, callback, swap) {
54
+ return new Timer(target, callback, swap);
55
+ }
@@ -0,0 +1,21 @@
1
+ <style>
2
+ :scope {
3
+ position: absolute;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ top: 0;
8
+ border-radius: inherit;
9
+ z-index: 0;
10
+ background-color: #323636;
11
+ }
12
+ </style>
13
+ <script>
14
+ var msk = this;
15
+ onmousewheel(msk, function (event) {
16
+ event.preventDefault();
17
+ });
18
+ ontouchmove(msk, function (event) {
19
+ event.preventDefault();
20
+ });
21
+ </script>
@@ -219,7 +219,7 @@ constructors.gen = constructors.generator;
219
219
  var readonly_types = {
220
220
  "date"({ field }, data) {
221
221
  var string = data[field.key];
222
- return parseDate(string);
222
+ return filterTime(string, "y年M月d日");
223
223
  },
224
224
  "url"({ field }, data) {
225
225
  var href = data[field.key];
@@ -229,6 +229,14 @@ var readonly_types = {
229
229
  return e;
230
230
  }
231
231
  },
232
+ "datetime"(elem) {
233
+ var { data, field } = elem;
234
+ elem.innerHTML = filterTime(data[field.key], "y年M月d日 h:mm");
235
+ },
236
+ "timestamp"(elem) {
237
+ var { data, field } = elem;
238
+ elem.innerHTML = filterTime(data[field.key]);
239
+ },
232
240
  "size"({ field }, data) {
233
241
  var f = data[field.key];
234
242
  return size(f);