efront 4.3.4 → 4.3.6

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,9 @@
1
+ - zh-CN: 服务异常
2
+ en: Service exception
3
+
4
+ - zh-CN: 自动识别环境并启动测试环境服务器
5
+ en: Automatically recognize the environment and start the testing environment server
6
+
1
7
  - zh-CN: 返回
2
8
  en: back
3
9
 
@@ -56,7 +62,7 @@
56
62
  en: "The server is busy, please try again later!"
57
63
 
58
64
  - zh-CN: 重试
59
- en: retry
65
+ en: retry
60
66
 
61
67
  - zh-CN: $1秒后再试
62
68
  en: Try again in $1 second
@@ -1,6 +1,9 @@
1
1
  var mark = require("./mark");
2
+ var gray = console.format('<gray>;</gray>').split(';');
3
+ var green = console.format('<green>;</green>').split(';');
4
+ var crack = console.format('<red2>;</red2>').split(';');
2
5
  var dump = function (a, msg) {
3
- if (a instanceof Object) console.error('对象的属性不符合'), console.log(msg ? msg + " " : " ", a);
6
+ if (a instanceof Object) console.error('属性错误'), console.log(msg ? msg + " " : " {\r\n", Object.keys(a).map(k => ` ${k}${gray.join(':')}\r\n ${a[k]}`).join('\r\n') + "\r\n }");
4
7
  else if (msg) console.log(msg + ":", a);
5
8
  else console.log(a);
6
9
  };
@@ -38,9 +41,12 @@ var assert = function (result, expect, log = dump) {
38
41
  };
39
42
  return function (error) {
40
43
  if (error instanceof Object) {
41
- errors[k] = Object.keys(error).map(k => `${k} >> ${error[k]}`).join("\r\n");
44
+ Object.keys(error).forEach(y => {
45
+ var e = y;
46
+ errors[`${gray.join('[')}${green.join(k)}${gray.join("]->")}` + e] = error[y];
47
+ })
42
48
  } else {
43
- errors[k] = error;
49
+ errors[gray.join("[") + crack.join(k) + gray.join("]")] = error;
44
50
  }
45
51
  };
46
52
  };
@@ -78,7 +78,7 @@ var scan = function (text) {
78
78
  continue;
79
79
  }
80
80
  data += row.slice(0, index + +!!jsonlikes.length);
81
- row = row.slice(index + 1)
81
+ row = row.slice(index + 1);
82
82
  if (!row) push();
83
83
  else unshift(spacesize, row);
84
84
  rowtype = 0;
@@ -110,6 +110,7 @@ var scan = function (text) {
110
110
  continue;
111
111
  }
112
112
  if (/^["']/.test(row)) {
113
+ if (data) push();
113
114
  rowtype = row[0];
114
115
  if (jsonlikes.length) {
115
116
  data += row[0];
@@ -192,7 +193,8 @@ var scan = function (text) {
192
193
  continue;
193
194
  }
194
195
  else {
195
- var match = /^([\s\S]+)?\:(|\s+[\s\S]*)$/.exec(row);
196
+ var match = /^([\s\S]*?)\:(|\s+[\s\S]*)$/.exec(row);
197
+ if (data && !match) match = /^()\:([\s\S]*)$/.exec(row);
196
198
  if (match) {
197
199
  if (data && !!match[1] || prop && span >= spacesize) push();
198
200
  if (prop) {
@@ -3,46 +3,74 @@ var path = require("path");
3
3
  var fullpath = path.join(__dirname, "../../.github/workflows/npmpublish.yml");
4
4
  var text = fs.readFileSync(fullpath).toString();
5
5
  var parseYML = require("./parseYML");
6
- var text = [
7
- `true`,
8
- `- true`,
9
- ` true true`,
10
- ` a: true `,
11
- `false`,
12
- `null`,
13
- `a`,
14
- `"a"`,
15
- `'a'`,
16
- `[0,12]`,
17
- `[0,12,a,b]`,
18
- `[0,12,a,b,"c","d"]`,
19
- `{}`,
20
- `{a: b}`,
21
- `{"a":b}`,
22
- `{"a":[b,c,d]}`,
23
- `{"a":[b,{a},[c],[{}],c,d]}`,
24
- `{"a":{a: b},c: {},d: [c],e: [{j}]}`,
25
- `{"a":"[b,c,d]"}`,
26
- `{"a":false}`,
27
- `{"a":13e1}`,
28
- `{"a":1.21}`,
29
- `{"a":0x1a}`,
30
- `{"a":null}`,
31
- `{"a":true}`,
32
- `{"a":-12e71}`,
33
- `{"a":-12e+71}`,
34
- `{"a":-12}`,
35
- `{"a":-12.0}`,
36
- `{"a":-12.e-61}`,
37
- `{"a":+12.e-61}`,
38
- `{"a":12.e-61}`,
39
- `{"a":"[b,c,\r\n\\"d]"}`,
40
- ` - zh-CN: "跳过了缺少参数的请求:$1 $2 $3\\r\\n缺少参数:$4"
41
- en: "Skipped request with missing parameters: $1 $2 $3"`,
42
- text
43
- ];
44
- var test = function (text) {
45
- var data = parseYML(text);
46
- console.log(data);
47
- };
48
- text.forEach(test);
6
+ var test = function (source, expect) {
7
+ var result = parseYML(source);
8
+ var same = assert(result, expect);
9
+ if (!same) console.log(result);
10
+ }
11
+ test('true', true);
12
+ test('- true', [true]);
13
+ test('true true', "true true");
14
+ test('a: true', { a: true });
15
+ test('false', false);
16
+ test('null', null);
17
+ test('a', "a");
18
+ test('"a"', "a");
19
+ test(`'a'`, "a");
20
+ test("[0,12]", [0, 12]);
21
+ test("[0,12,a,b]", [0, 12, 'a', 'b']);
22
+ test("[0,12,a,b,'c','d']", [0, 12, 'a', 'b', 'c', 'd']);
23
+ test(`[0,12,a,b,"c","d"]`, [0, 12, 'a', 'b', "c", "d"]);
24
+ test(`{}`, {});
25
+ test(`{a: b}`, { a: 'b' });
26
+ test(`{"a":b}`, { a: 'b' });
27
+ test(`{a:[b,c,d]}`, { a: ['b', 'c', 'd'] });
28
+ test(`{a:[b,{a},[c],[{}],c,d]}`, { a: ['b', { a: null }, ["c"], [{}], "c", 'd'] });
29
+ test(`{"a":{a: b},c:{},d:[c],e:[{j}]}`, { a: { a: 'b' }, c: {}, d: ["c"], e: [{ j: null }] });
30
+ test(`{"a":"[b,c,d]"}`, { a: "[b,c,d]" });
31
+ test(`{"a":false}`, { a: false });
32
+ test(`{"a":13e1}`, { a: 13e1 });
33
+ test(`{"a":13e+1}`, { a: 13e1 });
34
+ test(`{"a":13e-1}`, { a: 13e-1 });
35
+ test(`{"a":1.21}`, { a: 1.21 });
36
+ test(`{"a":-1.21}`, { a: -1.21 });
37
+ test(`{"a":0x1a}`, { a: 0x1a });
38
+ test(`{"a":null}`, { a: null });
39
+ test(`{"a":true}`, { a: true });
40
+ test(`{"a":-12e71}`, { a: -12e71 });
41
+ test(`{"a":12e+71}`, { a: 12e+71 });
42
+ test(`12e+71`, 12e+71);
43
+ test(`-12e+71`, -12e+71);
44
+ test(`-12e-71`, -12e-71);
45
+ test(`-12.0`, -12.0);
46
+ test(`-12.e-61`, -12.e-61);
47
+ test(`+12.e-61`, 12.e-61);
48
+ test(`12.e-61`, 12.e-61);
49
+ test(`{"a":"[b,c,\r\n\\"d]"}`, { a: "[b,c,\r\n\"d]" });
50
+ test(`
51
+ - zh-CN: "跳过了缺少参数的请求:$1 $2 $3\\r\\n缺少参数:$4"
52
+ en: "Skipped request with missing parameters: $1 $2 $3"`,
53
+ [{
54
+ "zh-CN": "跳过了缺少参数的请求:$1 $2 $3\r\n缺少参数:$4",
55
+ "en": "Skipped request with missing parameters: $1 $2 $3"
56
+ }]);
57
+ test(`
58
+ - zh-CN: 未没找到匹配的资源:$1
59
+ en: "No matching resources found: $1"
60
+ `, [{
61
+ "zh-CN": "未没找到匹配的资源:$1",
62
+ "en": "No matching resources found: $1"
63
+ }]);
64
+ test(`- a:: b`, [{ "a:": "b" }]);
65
+ test(`- a::b`, ["a::b"]);
66
+ test(`a::b`, "a::b");
67
+ test(`a:":b`, `a:":b`);
68
+ test(`a:": b`, { 'a:"': "b" });
69
+ test(`a: :b`, { "a": ":b" });
70
+ test(`a:: b`, { "a:": "b" });
71
+ test(`"a:": b`, { "a:": "b" });
72
+ test(`"a:":b`, { "a:": "b" });
73
+ test(`
74
+ c: d
75
+ "a:": b
76
+ `, { c: "d", "a:": "b" });
@@ -420,19 +420,6 @@ var snapExpressFoot = function (o) {
420
420
  }
421
421
  return o;
422
422
  };
423
- var mustBeYield = function (o) {
424
- if (!o.next) return;
425
- var mustyield = false;
426
- if (o.next.type === STRAP && !/^(?:instanceof|in|of|from|as)$/.test(o.next.text)
427
- || o.next.type === STAMP && /[!~]/.test(o.next.text)
428
- || o.next.type === EXPRESS && !/^[\.\[]/.test(o.next.text)
429
- || o.next.type & (VALUE | QUOTED | SCOPED)
430
- ) {
431
- mustyield = true;
432
- }
433
- return mustyield;
434
-
435
- }
436
423
  var createScoped = function (parsed, wash) {
437
424
  var used = Object.create(null); var vars = Object.create(null), lets = vars;
438
425
  var scoped = [], funcbody = scoped, argscope = scoped, thisscope = scoped;
@@ -1332,14 +1319,40 @@ var canbeTemp = function (body, strip = false) {
1332
1319
  if (!o) return false;
1333
1320
  return o.type === EXPRESS && (strip || !/[\.\[]/.test(o.text)) || o.type === VALUE || o.type === QUOTED && !o.length;
1334
1321
  };
1335
-
1322
+ var pickArgument = function (o) {
1323
+ var res = [];
1324
+ var t = o && o.prev, p = o;
1325
+ while (t && (t.type !== STAMP || !/^[,;]$/.test(t.text))) {
1326
+ if (p.isprop) {
1327
+ p = t.prev;
1328
+ if (!p || !p.isprop) break;
1329
+ }
1330
+ res.push(t);
1331
+ p = t;
1332
+ t = t.prev;
1333
+ }
1334
+ while (o && (o.type !== STAMP || !/^[,;]$/.test(o.text))) {
1335
+ res.push(o);
1336
+ var n = o;
1337
+ o = o.next;
1338
+ if (o && o.isprop) {
1339
+ if (!n.isprop) break;
1340
+ }
1341
+ }
1342
+ return res;
1343
+ };
1336
1344
  var pickSentence = function (o) {
1337
1345
  if (!o) return [];
1338
1346
  if (o && o.type & (SPACE | COMMENT) && o.prev) o = o.prev;
1339
1347
  if (o && o.type === STAMP && o.prev) o = o.prev;
1340
1348
  if (o.type === STRAP && /^(in|instanceof|as|of)$/.test(o.text) && o.prev) o = o.prev;
1341
1349
  var h = snapSentenceHead(o);
1342
- var e = skipAssignment(h);
1350
+ var e = h;
1351
+ do {
1352
+ e = skipAssignment(e);
1353
+ if (!e || e.type !== STAMP || e.text !== ',') break;
1354
+ e = e.next;
1355
+ } while (e);
1343
1356
  var q = o.queue;
1344
1357
  if (q) {
1345
1358
  var qh = q.indexOf(h);
@@ -1375,6 +1388,7 @@ module.exports = {
1375
1388
  createScoped,
1376
1389
  createExpressList,
1377
1390
  snapSentenceHead,
1391
+ pickArgument,
1378
1392
  pickSentence,
1379
1393
  snapExpressHead,
1380
1394
  snapExpressFoot,
@@ -34,3 +34,6 @@ testPickSentence(`a+b\r\n++c`, 5, "++c")
34
34
  testPickSentence(`a+b++\r\nc`, 5, "c")
35
35
  testPickSentence(`a+b++\r\nc`, 5, "c")
36
36
  testPickSentence(`a+b++\r\n+c`, 6, "a + b++\r\n+ c")
37
+ assert(common.createString(common.pickArgument(scanner2(`a={a:1,c:d}`)[2][4])), 'c: d')
38
+ assert(common.createString(common.pickArgument(scanner2(`a=class{a=1\r\nc=d}`)[3][4])), 'c = d')
39
+ assert(common.createString(common.pickArgument(scanner2(`(a=1,c=d)`)[0][4])), 'c = d')
@@ -1535,6 +1535,7 @@ var down = function (scoped) {
1535
1535
  var inAsync = scoped.async;
1536
1536
  var inAster = scoped.yield;
1537
1537
  var funcMark = [, "aster_", "async_", "asyncAster_"][inAsync << 1 | inAster];
1538
+ if (funcMark) funcMark = patchMark + funcMark;
1538
1539
  if (funcMark) rootenvs[funcMark] = true;
1539
1540
  var vars = Object.assign(Object.create(null), scoped.vars);
1540
1541
  var envs = Object.assign(Object.create(null), scoped.envs);
@@ -1720,7 +1721,7 @@ var down = function (scoped) {
1720
1721
  if (funcMark) {
1721
1722
  var argname = _letname("_");
1722
1723
  unstruct.debug = downLevel.debug;
1723
- var body = scanner2(`return ${patchMark + funcMark}()`);
1724
+ var body = scanner2(`return ${funcMark}()`);
1724
1725
  var code = unawait(scoped.body, _getname, argname);
1725
1726
  code.forEach(function (c) {
1726
1727
  revar(c);
@@ -1361,7 +1361,7 @@ var patchMark = '';
1361
1361
  module.exports = function (body, newname, ret) {
1362
1362
  strip = body.strip;
1363
1363
  var patchMark_ = patchMark;
1364
- patchMark = body.patchMark;
1364
+ if (body.patchMark) patchMark = body.patchMark;
1365
1365
  if (ret) ret = isString(ret) ? ret : newname();
1366
1366
  var ret0 = ret_;
1367
1367
  var ret1 = null;
@@ -40,7 +40,7 @@ var dragview = function (dragview) {
40
40
  page.style.transition = '';
41
41
  if (moving && moving !== -1) {
42
42
  var left = freeOffset(page.style.left || 0);
43
- if (moving.deltaX < 0 && left > offsetWidth * 0.3 || moving.deltaX > 0 && left > offsetWidth * 0.7 || !moving.deltaX && left > offsetWidth >> 1) {
43
+ if (moving.deltaX < 0 && left > calcPixel(14) || moving.deltaX > 0 && left > calcPixel(14) || !moving.deltaX && left > offsetWidth >> 1) {
44
44
  page.style.left = 0;
45
45
  dragview.toRight();
46
46
  } else {
@@ -64,8 +64,8 @@ var filterKey = function (event) {
64
64
  else if (keyCode > 95 && keyCode < 106) {
65
65
  char = keyCode - 96;
66
66
  }
67
- else if (keyCode > 46 && keyCode < 57) {
68
- char = keyCode - 47;
67
+ else if (keyCode > 47 && keyCode < 58) {
68
+ char = keyCode - 48;
69
69
  }
70
70
  else {
71
71
  return;
@@ -547,9 +547,9 @@ var grid_prototype = {
547
547
  } else {
548
548
  var _div = point.target;
549
549
  if (!_div) {
550
- point.target = _div = document.createElement('cell');
550
+ // point.target = _div = document.createElement('cell');
551
551
  }
552
- if (_div.parentNode !== grid) appendChild(grid, _div);
552
+ if (_div && _div.parentNode !== grid) appendChild(grid, _div);
553
553
  var current_value;
554
554
  if (current_d === "x") {
555
555
  if (next_point) {
@@ -563,15 +563,17 @@ var grid_prototype = {
563
563
  point.top = current_t;
564
564
  point.bottom = current_b;
565
565
  if (point.origin !== point.value || current_t && current_t.origin !== current_t.value) {
566
- if (getComputedStyle(_div).position === 'absolute') {
567
- css(_div, {
568
- left: point.value / grid.width * 100 + "%",
569
- top: current_t ? current_t.value / grid.height * 100 + "%" : 0,
570
- width: current_value / grid.width * 100 + "%",
571
- height: (current_h / grid.height || 0) * 100 + "%"
572
- });
573
- } else {
574
- setRelativeDiv(_div, current_value, current_h, point.value, current_t ? current_t.value : 0);
566
+ if (_div) {
567
+ if (getComputedStyle(_div).position === 'absolute') {
568
+ css(_div, {
569
+ left: point.value / grid.width * 100 + "%",
570
+ top: current_t ? current_t.value / grid.height * 100 + "%" : 0,
571
+ width: current_value / grid.width * 100 + "%",
572
+ height: (current_h / grid.height || 0) * 100 + "%"
573
+ });
574
+ } else {
575
+ setRelativeDiv(_div, current_value, current_h, point.value, current_t ? current_t.value : 0);
576
+ }
575
577
  }
576
578
  point.width = current_value / grid.width;
577
579
  point.height = current_h / grid.height;
@@ -588,15 +590,17 @@ var grid_prototype = {
588
590
  point.left = current_l;
589
591
  point.right = current_r;
590
592
  if (point.origin !== point.value || current_l && current_l.origin !== current_l.value) {
591
- if (getComputedStyle(_div).position === 'absolute') {
592
- css(_div, {
593
- left: current_l ? current_l.value / grid.width * 100 + "%" : 0,
594
- top: point.value / grid.height * 100 + "%",
595
- width: (current_w / grid.width || 0) * 100 + "%",
596
- height: current_value / grid.height * 100 + "%"
597
- });
598
- } else {
599
- setRelativeDiv(_div, current_w, current_value, current_l ? current_l.value : 0, point.value);
593
+ if (_div) {
594
+ if (getComputedStyle(_div).position === 'absolute') {
595
+ css(_div, {
596
+ left: current_l ? current_l.value / grid.width * 100 + "%" : 0,
597
+ top: point.value / grid.height * 100 + "%",
598
+ width: (current_w / grid.width || 0) * 100 + "%",
599
+ height: current_value / grid.height * 100 + "%"
600
+ });
601
+ } else {
602
+ setRelativeDiv(_div, current_w, current_value, current_l ? current_l.value : 0, point.value);
603
+ }
600
604
  }
601
605
  point.width = current_w / grid.width;
602
606
  point.height = current_value / grid.height;
@@ -733,7 +737,14 @@ var createBoundsFromComputed = function (grid) {
733
737
  };
734
738
  var createPointsWithChildren = function () {
735
739
  var grid = this;
736
- if (!grid.children.length) return;
740
+ var children = [];
741
+ for (var c of grid.children) {
742
+ var s = getComputedStyle(c);
743
+ if (s.display === 'none' || /^(fixed|absolute)$/i.test(s.position)) continue;
744
+ children.push(c);
745
+ }
746
+ if (children.length < 2 || grid.adapted) return;
747
+ grid.adapted = true;
737
748
  var getRange = function (e) {
738
749
  var range = [0, 0, Infinity, Infinity];
739
750
  var computed = getComputedStyle(e);
@@ -747,7 +758,7 @@ var createPointsWithChildren = function () {
747
758
  range[3] = Math.floor(range[3]);
748
759
  return range;
749
760
  };
750
- var elements = Array.apply(null, grid.children).map(a => [a,
761
+ var elements = children.map(a => [a,
751
762
  +Math.max(0, a.offsetLeft * grid.width / grid.clientWidth).toFixed(0),
752
763
  +(Math.min(a.offsetLeft + a.offsetWidth, grid.clientWidth) * grid.width / grid.clientWidth).toFixed(0),
753
764
  +Math.max(0, a.offsetTop * grid.height / grid.clientHeight).toFixed(0),
@@ -764,6 +775,7 @@ var createPointsWithChildren = function () {
764
775
  function main(elem) {
765
776
  if (isElement(elem)) {
766
777
  elem = grid.call(elem);
778
+ elem.adapt = createPointsWithChildren;
767
779
  care(elem, elem.setData);
768
780
  care(elem, elem.reshape);
769
781
  } else {
@@ -154,7 +154,12 @@ body:active & {
154
154
  padding-bottom: 6px;
155
155
  line-height: 20px;
156
156
  font-size: 14px;
157
-
157
+ border-radius: 0;
158
+ /*
159
+ 狗物业弄了电子门禁还嫌不够,连人行道也弄个一人一杆。
160
+ 住在这里就像住在监狱,随时都可能被限制人身自由。
161
+ 狗日的共产党还和狗物业尿到一个壶里。
162
+ */
158
163
  >b {
159
164
  font-weight: normal;
160
165
  }
package/docs/main.xht CHANGED
@@ -42,11 +42,14 @@
42
42
  content: "样";
43
43
  }
44
44
 
45
- :root>menu {
45
+ :root>menu[inline] {
46
+ height: 100%;
47
+ }
48
+
49
+ :root>menu[inline] {
46
50
  margin: 0;
47
51
  width: var(--leftwidth);
48
52
  margin-left: -var(--leftwidth);
49
- height: 100%;
50
53
  display: inline-block;
51
54
  min-width: 200px;
52
55
  max-width: 600px;
@@ -84,11 +87,80 @@
84
87
  color: #79a;
85
88
  margin-left: 12px;
86
89
  }
90
+
91
+ open {
92
+ display: none;
93
+ }
94
+
95
+ @media screen and (max-width:599px) {
96
+ form {
97
+ width: 100% !important;
98
+ height: 100% !important;
99
+ z-index: 0 !important;
100
+ }
101
+
102
+ :root>open:after {
103
+ content: "≡";
104
+ }
105
+
106
+ :root>open {
107
+
108
+ display: block;
109
+ position: absolute;
110
+ height: 42px;
111
+ width: 42px;
112
+ line-height: 42px;
113
+ text-align: center;
114
+ color: #fff;
115
+ background: #1e282c;
116
+ font-family: 'Times New Roman', Times, serif;
117
+ font-size: 26px;
118
+ z-index: 2147483647 !important;
119
+ right: 20px;
120
+ bottom: 20px;
121
+ border-radius: 50%;
122
+ }
123
+
124
+ :root>menu {
125
+
126
+ position: absolute;
127
+ z-index: -1;
128
+
129
+ &[open] {
130
+ left: 0 !important;
131
+ right: 0 !important;
132
+ top: 0 !important;
133
+ bottom: 0 !important;
134
+ width: 100% !important;
135
+ height: 100% !important;
136
+ margin: 0 !important;
137
+ z-index: 3;
138
+
139
+ ~open {
140
+ background-color: #fff;
141
+ color: #1e282c;
142
+
143
+ &:after {
144
+ content: "⨉";
145
+ vertical-align: top;
146
+ font-size: 18px;
147
+ }
148
+ }
149
+ }
150
+
151
+ }
152
+
153
+ :root {
154
+ padding: 0px !important;
155
+ }
156
+ }
87
157
  </style>
88
- <menu #mulu inline -src="m in menus" @active="openMenu(m)">
158
+
159
+ <menu #mulu open@="menued" inline -src="m in menus" @active="openMenu(m)">
89
160
  <div2></div2>
90
161
  </menu>
91
162
  <div1 #content></div1>
163
+ <open #switch @click="switchMenu()" insert></open>
92
164
  <script>
93
165
  var menus = [
94
166
  {
@@ -130,12 +202,12 @@
130
202
  }
131
203
  }
132
204
  ]);
133
- })
205
+ });
134
206
  var initVersionInfo = async function () {
135
207
  var xhr = await cross("get", "version");
136
208
  var version = xhr.response.split(",");
137
209
  menus[0].name += ` <v>${version[0]}</v>`;
138
- }
210
+ };
139
211
  var initCommandsDocs = async function () {
140
212
  var helps = await init("docs$helps");
141
213
  var m = {
@@ -204,7 +276,7 @@
204
276
  scope.menus = route.update(menus);
205
277
  zimoli();
206
278
  render.refresh();
207
- }
279
+ };
208
280
  var scope = {
209
281
  menus,
210
282
  div2(elem, scope) {
@@ -214,11 +286,17 @@
214
286
  },
215
287
  grid,
216
288
  menu,
289
+ menued: false,
290
+ switchMenu() {
291
+ scope.menued = !scope.menued;
292
+ },
217
293
  openMenu(m) {
218
294
  this.menus.open(m);
295
+ if (!m.children) this.menued = false;
219
296
  }
220
297
  };
221
298
  var page = document.createElement('grid');
299
+ page.adapted = screen.width < 720 && -1;
222
300
  page.innerHTML = template;
223
301
  if (window.require) {
224
302
  var title = document.createElement('titlebar');
@@ -239,11 +317,23 @@
239
317
  on("mounted")(page, initMenus);
240
318
  s.bindTarget(scope.content);
241
319
  page.with = s;
320
+ resizingList.set(page, function () {
321
+ if (page.adapted === true) return;
322
+ if (calcPixel(page.offsetWidth) < 720) return;
323
+ page.adapted = false;
324
+ page.adapt();
325
+ });
242
326
  bind("render")(page, function () {
243
327
  requestAnimationFrame(function () {
244
328
  s.reshape();
245
329
  })
246
330
  });
331
+ drag.on(scope.switch);
332
+ css(scope.switch, data.getInstance('switch-position'));
333
+ on('dragend')(scope.switch, function () {
334
+ var s = this.style;
335
+ data.setInstance('switch-position', { left: s.left, top: s.top, marginLeft: s.marginLeft, marginTop: s.marginTop }, true);
336
+ })
247
337
  function main() {
248
338
  return page;
249
339
  }
package/docs/mark.xht CHANGED
@@ -1,18 +1,19 @@
1
1
  <style>
2
- :scope {
3
- line-height: 1.8;
4
- display: block;
5
- font-family: Times, "宋体", sans-serif;
6
-
7
- @media screen and (max-width:830px) {
2
+ @media screen and (max-width: 830px) {
3
+ :scope {
8
4
  padding: 20px 40px;
9
5
  }
6
+ }
10
7
 
11
- @media screen and (min-width:1160px) {
8
+ @media screen and (min-width: 1160px) {
9
+ :scope {
12
10
  margin: 20px auto;
13
11
  }
12
+ }
13
+
14
+ @media screen and (min-width: 830px) {
15
+ :scope {
14
16
 
15
- @media screen and (min-width:830px) {
16
17
  max-width: 890px;
17
18
  border: 1px solid #000;
18
19
  padding: 60px 80px;
@@ -20,6 +21,12 @@
20
21
  }
21
22
  }
22
23
 
24
+ :scope {
25
+ line-height: 1.8;
26
+ display: block;
27
+ font-family: Times, "宋体", sans-serif;
28
+ }
29
+
23
30
  code {
24
31
  width: 100%;
25
32
  }
@@ -89,7 +89,7 @@
89
89
  fields: [
90
90
  { name: i18n`提示`, readonly: true, key: 'apply_info', type: 'text' },
91
91
  { name: i18n`appid及密钥申请地址`, readonly: true, key: 'apply_url', type: 'anchor' },
92
- { name: i18n`appid`, key: 'appid', type: 'input' },
92
+ { name: `appid`, key: 'appid', type: 'input' },
93
93
  { name: i18n`密钥`, key: 'sign', type: "input" },
94
94
  { name: i18n`目标语言`, type: 'checkbox', options: supports }
95
95
  ], data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.3.4",
3
+ "version": "4.3.6",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {