efront 4.11.5 → 4.11.8

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.
@@ -46,6 +46,11 @@
46
46
  border: none;
47
47
  }
48
48
 
49
+ [foot]>a.button {
50
+ float: left;
51
+ }
52
+
53
+
49
54
  loading {
50
55
  z-index: 3;
51
56
  }
@@ -64,6 +69,7 @@
64
69
  </div>
65
70
  <scrollbar y #bar></scrollbar>
66
71
  <div foot>
72
+ <a -repeat="(f,k) in actived.options" -click="f(actived)" -bind="k"></a>
67
73
  <span -bind="actived.message"></span>
68
74
  <button -repeat="(f,k) in actived.actions" -click="f(actived)"><span -bind="k"></span></button>
69
75
  </div>
@@ -166,6 +172,12 @@
166
172
  $账户/kid input
167
173
  *当前服务器的域名/domain/每行一个,不支持泛域名 text
168
174
  `,
175
+ options: {
176
+ async 从证书列表同步() {
177
+ var a = await plist.load('cert', 'hostname');
178
+ formdata.domain = a.map(a => a.hostname).join('\r\n');
179
+ }
180
+ },
169
181
  actions: {
170
182
  async 创建订单(actived) {
171
183
  var params = submit(actived.fields, formdata);
@@ -8,7 +8,7 @@
8
8
  <field -repeat="f in fields" -src="[f,data]"></field>
9
9
  </div>
10
10
  <div class="left">
11
- <pre -text="task.code"></pre>
11
+ <jscode -value="task.code" type="js"></jscode>
12
12
  </div>
13
13
  <div class="right" :class="{error:error}">
14
14
  <pre -text="output"></pre>
@@ -16,6 +16,7 @@ function main(a) {
16
16
  task: a,
17
17
  output: '',
18
18
  error: false,
19
+ jscode: 茨菰$编辑框,
19
20
  async run() {
20
21
  var id = ++taskid;
21
22
  this.output = "正在执行..";
@@ -2,16 +2,19 @@
2
2
  position: absolute;
3
3
  width: 800px;
4
4
  }
5
- >[body]{
6
- border-top: 50px solid transparent;
7
- border-bottom: 50px solid transparent;
8
- }
5
+
6
+
9
7
  >[body]>div {
10
8
  display: inline-block;
11
9
  vertical-align: top;
12
10
  overflow: auto;
13
11
  font-size: 12px;
14
12
 
13
+ >jscode,
14
+ >pre {
15
+ height: 100%;
16
+ }
17
+
15
18
  &.top {
16
19
  left: 0;
17
20
  top: 0;
@@ -1,23 +1,30 @@
1
- plist.bind(null, '任务管理', "task", refilm`
1
+ model.setEditor('jscode', function (element) {
2
+ element = 茨菰$编辑框(null);
3
+ element.contentEditable = !element.readonly;
4
+ element.type = 'js';
5
+ return element;
6
+ });
7
+ model.setReader('jscode', "text");
8
+ return plist.bind(null, '任务管理', "task", refilm`
2
9
  *任务ID/key 100
3
10
  *任务名/name 100
4
11
  *是否启用/status radio 不启用,启用
5
- 任务代码/code text
12
+ 任务代码/code jscode
6
13
  / $ ${[
7
- {
8
- when(o) {
9
- return o.status === 1;
14
+ {
15
+ when(o) {
16
+ return o.status === 1;
17
+ },
18
+ name: "执行", do(o) {
19
+ popup("/task/invoke", o);
20
+ }
10
21
  },
11
- name: "执行", do(o) {
12
- popup("/task/invoke", o);
13
- }
14
- },
15
- {
16
- when(o) {
17
- return o.status === 1;
22
+ {
23
+ when(o) {
24
+ return o.status === 1;
25
+ },
26
+ name: "同步", do(o) {
27
+ popup("/task/rsync", o);
28
+ }
18
29
  },
19
- name: "同步", do(o) {
20
- popup("/task/rsync", o);
21
- }
22
- },
23
- ]}`, '/task/edit');
30
+ ]}`, '/task/edit');
@@ -133,4 +133,6 @@ testStar(`var a=class {a=1\r\nasync * a(){
133
133
  for(var n of names) {
134
134
  yield n;
135
135
  }
136
- }}`, {});
136
+ }}`, {});
137
+
138
+ assert(scanner2(`#`)[0].type, common.STAMP)
@@ -94,6 +94,7 @@ class Program {
94
94
  scriptTags = [];
95
95
  ignoreTags = ["STYLE", "SCRIPT"];
96
96
  comments = [
97
+ ["#!", /(?=[\r\n\u2028\u2029])/],
97
98
  ["//", /(?=[\r\n\u2028\u2029])/],
98
99
  ["/*", "*/"],
99
100
  [/<!--/, /--!?>/],
@@ -808,7 +809,7 @@ class Program {
808
809
  save(VALUE);
809
810
  continue;
810
811
  }
811
- if (express_reg.test(m)) {
812
+ if (!stamp_reg.test(m) && express_reg.test(m)) {
812
813
  if (last && last.type === STRAP && funcstrap_reg.test(last.text));
813
814
  else queue.inExpress = true;
814
815
  save(EXPRESS);
@@ -942,7 +943,7 @@ class Program {
942
943
  this.comment_entry = this.createRegExp(this.comments.map(m => m[0]));
943
944
  var stamps = this.stamps.join("");
944
945
  stamps = this.compile(stamps);
945
- this.stamp_reg = new RegExp(`^[${stamps}]+$`);
946
+ var stamp_reg = new RegExp(`^[${stamps}]+$`);
946
947
  var tokens = {};
947
948
  var quote_map = {};
948
949
  this.quote_map = quote_map;
@@ -1013,7 +1014,7 @@ class Program {
1013
1014
  this.space_reg = new RegExp(`^[${spaces}]+$`, flagUnicode);
1014
1015
  this.space_exp = new RegExp(`[${spaces}]+`, flagUnicode);
1015
1016
  var quotes_entries = this.createRegExp(this.comments.concat(this.quotes).map(q => q[0]), true).source;
1016
- var powers = Object.keys(this.powermap).filter(k => k.length > 1 && this.stamp_reg.test(k));
1017
+ var powers = Object.keys(this.powermap).filter(k => k.length > 1 && stamp_reg.test(k));
1017
1018
  var powers_entries = this.createRegExp(this.tags.map(t => t[0]).concat(powers), true).source;
1018
1019
  var entries_reg = new RegExp(`^(${powers_entries}|${quotes_entries}|${scopes})$`, this.nocase ? 'iu' : '');
1019
1020
  stamps = this.compile(this.stamps.filter(s => !entries_reg.test(s)).join(''));
@@ -1021,6 +1022,10 @@ class Program {
1021
1022
  var numbers = number_reg.source.replace(/^\^|\$$/g, "");
1022
1023
  this.digit_reg = new RegExp(/^[+\-]?/.source + numbers, number_reg.flags);
1023
1024
  this.entry_reg = new RegExp([`[${spaces}]+|${quotes_entries}|[${scopes}]|${numbers}[^${tokens}]*|${express}|${powers_entries}|[${stamps}]`], "gi" + flagUnicode);
1025
+ var stamps = this.stamps.slice();
1026
+ for (var k in this.powermap) if (k.length === 1 && stamps.indexOf(k) < 0) stamps.push(k);
1027
+ stamps.push.apply(stamps, powers);
1028
+ this.stamp_reg = new RegExp(`^(${stamps.map(this.compile).join('|')})$`);
1024
1029
  }
1025
1030
  }
1026
1031
  module.exports = Program;
@@ -8,7 +8,7 @@ var powermap = {
8
8
  '>>,>>>,<<'/* 7 */, '+,-'/* 8 */, '*,/,%'/* 9 */, '**'/* 10 */,
9
9
  '++,--'/* 11 */,
10
10
  "typeof,await,yield,new,delete,void,..."/*12*/,
11
- '!,~'/* 13 */,
11
+ '!,~,#'/* 13 */,
12
12
  "::,?.,->,."/*14*/,
13
13
  ].forEach((pp, i) => {
14
14
  pp.split(",").forEach(p => {
@@ -403,7 +403,7 @@ var patchstep = function (r, nextindex, h) {
403
403
  x = rescan`if (${name}) return [${nextindex}, 0]`;
404
404
  }
405
405
  else if (o === RD) {
406
- x = rescan`if (${name}!= null) return [${nextindex}, 0]`;
406
+ x = rescan`if (${name}!=null) return [${nextindex}, 0]`;
407
407
  }
408
408
  else continue;
409
409
  changed = true;
@@ -941,6 +941,13 @@ var _express = function (body, getname, ret) {
941
941
  q.name = cloneNode(body);
942
942
  return [q];
943
943
  }
944
+ if (isFunctionOnly(body)) {
945
+ result = [body];
946
+ return result;
947
+ }
948
+ else {
949
+ result = [];
950
+ }
944
951
  var result = [];
945
952
  var q = [];
946
953
  var bx = 0;
@@ -949,6 +956,7 @@ var _express = function (body, getname, ret) {
949
956
  var nameindex = 0;
950
957
  var maxindex = 0;
951
958
  var hasor = false;
959
+ var xorcount = 0;
952
960
  var getdeepname = function (deep = 0) {
953
961
  return getname(maxindex + deep);
954
962
  };
@@ -1007,12 +1015,20 @@ var _express = function (body, getname, ret) {
1007
1015
  q.name = cloneNode(name);
1008
1016
  if (isor) {
1009
1017
  if (o.text === '||') {
1018
+ if (xorcount) {
1019
+ result.push(..._invoke(q, getdeepname));
1020
+ result[result.length - 1].ret_ = true;
1021
+ q = [];
1022
+ q.name = cloneNode(name);
1023
+ }
1010
1024
  q.push(RE);
1011
1025
  }
1012
1026
  else if (o.text === '&&') {
1013
1027
  q.push(RZ);
1028
+ xorcount++;
1014
1029
  }
1015
1030
  else if (o.text === '??') {
1031
+ xorcount++;
1016
1032
  q.push(RD);
1017
1033
  }
1018
1034
  hasor = true;
@@ -1065,12 +1081,9 @@ var _express = function (body, getname, ret) {
1065
1081
  }
1066
1082
  }
1067
1083
  if (needname) q.name = [{ text: getname(nameindex), type: EXPRESS }];
1068
- relink(q);
1069
- if (isFunctionOnly(q, 2)) {
1070
- result = [q];
1071
- }
1072
- else {
1073
- result = _invoke(q, getdeepname);
1084
+ if (q.length) {
1085
+ relink(q);
1086
+ result.push(..._invoke(q, getdeepname));
1074
1087
  }
1075
1088
  if (hasor) result[result.length - 1].ret_ = true;
1076
1089
  return result;
@@ -158,4 +158,5 @@ unstruct.debug = true; r++;
158
158
  r++// test("if(a)else {}",'')
159
159
  test("if(a){if(b){c}d}else{e}", `if (!a) return [2, 0]; if (!b) return [1, 0]; c; return [1, 0];\r\n d; return [2, 0];\r\n e; return [1, 0]`)
160
160
  test("if(a){if(b){c}else{d}}else{e}", `if (!a) return [3, 0]; if (!b) return [1, 0]; c; return [2, 0];\r\n d; return [1, 0];\r\n return [2, 0];\r\n e; return [1, 0]`)
161
+ test("if(a&&b||c){d}", `_ = a; if (!_) return [1, 0]; _ = b;\r\n if (_) return [1, 0]; _ = c;\r\n if (!_) return [1, 0]; d; return [1, 0]`, true);
161
162
  test("if(a)switch(b){case c:d;break;} else{h}", `if (!a) return [3, 0]; if (b === c) return [1, 0]; return [2, 0];\r\n d; return [1, 0];\r\n return [2, 0];\r\n h; return [1, 0]`)
@@ -1,21 +1,63 @@
1
- function main() {
2
- var elem = optionbar.apply(null, arguments);
3
- var scope = {};
4
- if (!elem.childNodes.length) care(elem, function (p) {
5
- var [f, data] = p;
6
- elem.innerHTML = field;
7
- render(elem, scope = {
8
- model,
9
- data,
10
- error: null,
11
- field: f,
12
- container,
13
- readonly: !!this.readonly
14
- });
15
- elem.oldValue = data[f.key];
16
- elem.setAttribute("field", f.key);
17
- }, false);
1
+ var reshape = function () {
2
+ var [head, body, foot] = getTypedChildren(this, ['head', 'body', 'foot']);
3
+ var isInlineBlock = body && /^inline/i.test(getComputedStyle(body).display);
4
+ if (head && body) {
5
+ var left = head.offsetWidth + 1;
6
+ if (isInlineBlock && left < body.offsetWidth >> 2) {
7
+ css(head, {
8
+ marginRight: fromOffset(-left),
9
+ marginBottom: ''
10
+ });
11
+ css(body, {
12
+ paddingLeft: left,
13
+ paddingTop: ""
14
+ });
15
+ }
16
+ else {
17
+ var top = head.offsetHeight + 1;
18
+ css(head, {
19
+ marginRight: '',
20
+ marginBottom: fromOffset(-top),
21
+ });
22
+ css(body, {
23
+ paddingLeft: '',
24
+ paddingTop: top
25
+ })
26
+ }
27
+ }
28
+ if (!body) body = head;
29
+ if (foot && body) {
30
+ var right = foot.offsetWidth + 1;
31
+ if (isInlineBlock && right < body.offsetWidth >> 2) {
32
+ css(foot, {
33
+ marginTop: '',
34
+ marginLeft: fromOffset(-right)
35
+ });
36
+ css(body, {
37
+ paddingBottom: '',
38
+ paddingRight: fromOffset(right),
39
+ })
40
+ }
41
+ else {
42
+ var bottom = foot.offsetHeight + 1;
43
+ css(foot, {
44
+ marginTop: fromOffset(-bottom),
45
+ marginLeft: '',
46
+ });
47
+ css(body, {
48
+ paddingRight: '',
49
+ paddingBottom: fromOffset(bottom)
50
+ });
51
+ }
52
+ }
53
+ };
54
+
55
+ function main(elem) {
56
+ if (!isElement(elem)) elem = document.createElement('field');
57
+ elem.reshape = reshape;
58
+ resizingList.set(elem, () => elem.reshape());
18
59
  elem.setAttribute("field", '');
60
+ var scope = {};
19
61
  elem.$renders = [function () {
20
62
  if (!(this.src instanceof Array)) return;
21
63
  var [f, data] = this.src;
@@ -48,5 +90,28 @@ function main() {
48
90
  this.oldValue = data[f.key];
49
91
  }]
50
92
  elem.removeAttribute("tabindex");
93
+
94
+ if (!elem.childNodes.length) care(elem, function (p) {
95
+ var [f, data] = p;
96
+ elem.innerHTML = field;
97
+ render(elem, scope = {
98
+ model,
99
+ data,
100
+ error: null,
101
+ field: f,
102
+ container,
103
+ readonly: !!this.readonly
104
+ });
105
+ elem.oldValue = data[f.key];
106
+ elem.setAttribute("field", f.key);
107
+ elem.reshape();
108
+ }, false);
109
+ else {
110
+ var [head, body, foot] = getTypedChildren(elem, ["head", 'body', 'foot']);
111
+ if (head) addClass(head, "head");
112
+ if (body) addClass(body, "body");
113
+ if (foot) addClass(foot, "foot");
114
+ elem.$renders.push(reshape);
115
+ }
51
116
  return elem;
52
117
  }
@@ -1,44 +1,68 @@
1
1
  & {
2
2
  height: auto;
3
3
  box-shadow: none !important;
4
+ display: block;
5
+ line-height: 22px;
6
+ padding: 8px 0;
7
+ border-bottom: 1px solid #0001;
8
+ }
4
9
 
5
- >model:first-child {
6
- padding: 6px 10px;
7
- display: block;
8
- }
10
+ >.head,
11
+ >.foot {
12
+ padding: 2px 16px;
13
+ vertical-align: top;
14
+ display: inline-block;
15
+ position: absolute;
16
+ }
9
17
 
10
- model {
11
- display: inline;
12
- }
18
+ >model:first-child {
19
+ padding: 6px 10px;
20
+ display: block;
21
+ }
22
+
23
+ model {
24
+ display: inline;
25
+ }
13
26
 
14
- >.head {
15
- vertical-align: top;
27
+ >.head {
28
+ font-weight: 600;
29
+ font-family: "宋体";
16
30
 
17
- .image {
18
- margin: 10px 0;
19
- }
31
+ &:after {
32
+ content: ":";
20
33
  }
21
34
 
22
- >.body {
23
- .image {
24
- margin: 10px 0;
25
- }
26
-
27
- text-align: left;
35
+ .image {
36
+ margin: 10px 0;
28
37
  }
38
+ }
29
39
 
30
- >.track {
31
- display: none;
32
- box-shadow: none;
40
+ >.body {
41
+ .image {
42
+ margin: 10px 0;
33
43
  }
34
44
 
35
- >.foot {
36
- span {
37
- vertical-align: middle;
38
- }
45
+ min-height: 30px;
46
+ vertical-align: top;
47
+ padding: 2px 16px;
48
+ height: 100%;
49
+ display: inline-block;
50
+ width: 100%;
51
+ text-align: left;
52
+ }
53
+
54
+ >.track {
55
+ display: none;
56
+ box-shadow: none;
57
+ }
58
+
59
+ >.foot {
60
+ span {
61
+ vertical-align: middle;
39
62
  }
40
63
  }
41
64
 
65
+
42
66
  .input {
43
67
  width: 100%;
44
68
  }
@@ -0,0 +1,26 @@
1
+ function hasType(target, type) {
2
+ // 记得小时候,不论是苍蝇还是蚊子,飞起来都是有声音的。最近看到的一种像蚊子一样小的飞虫,喜欢像苍蝇一样趴在食物上,飞起来却听不到声音。
3
+ // 是我的听力下降了?还是外界太过嘈杂?还是飞虫拍打翅膀的频率超出了我的听觉范围?还是飞行可以不产生声音?
4
+ return target.hasAttribute(type) || hasClass(target, type);
5
+ }
6
+
7
+ return function (element, types) {
8
+ var marked = 0;
9
+ for (var k in types) {
10
+ for (var c of element.children) {
11
+ if (hasType(c, types[k])) {
12
+ types[k] = c;
13
+ marked++;
14
+ }
15
+ }
16
+ }
17
+ if (!marked && isArray(types)) {
18
+ var children = element.children;
19
+ if (children.length) {
20
+ for (var cx = 0, dx = types.length; cx < dx; cx++) {
21
+ types[cx] = children[cx];
22
+ }
23
+ }
24
+ }
25
+ return types;
26
+ }
@@ -409,6 +409,14 @@ function main(elem) {
409
409
  }
410
410
  markEditer(constructors);
411
411
  markReader(readonly_types);
412
+ var pick = function (constructors, f) {
413
+ var path = [];
414
+ while (typeof f === 'string' && path.indexOf(f) < 0) {
415
+ path.push(f);
416
+ f = constructors[f];
417
+ }
418
+ return f;
419
+ };
412
420
  extend(main, {
413
421
  setEditors(map) {
414
422
  extend(constructors, map);
@@ -423,12 +431,14 @@ extend(main, {
423
431
  this.setReadors(map);
424
432
  },
425
433
  setEditor(key, func) {
434
+ if (typeof func === 'function') func.isediter = true;
435
+ else func = pick(constructors, func);
426
436
  constructors[key] = func;
427
- func.isediter = true;
428
437
  },
429
438
  setReador(key, func) {
439
+ if (typeof func === 'function') func.isreader = true;
440
+ else func = pick(readonly_types, func);
430
441
  readonly_types[key] = func;
431
- func.isreader = true;
432
442
  },
433
443
  setModel(key, func) {
434
444
  this.setEditor(key, func);
@@ -543,7 +543,7 @@ var directives = {
543
543
  var parsedSrc = this.$src;
544
544
  return src2.call(this, parsedSrc && /[\{\[\s]/.test(src) ? parsedSrc.srcName : src);
545
545
  },
546
- model(search, target) {
546
+ model(search, target, change) {
547
547
  var getter = createGetter(this, search);
548
548
  var oldValue;
549
549
  var getstr = target.getValue instanceof Function ? "this.getValue()" : "";
@@ -561,12 +561,12 @@ var directives = {
561
561
  oldValue = value;
562
562
  this[key] = value;
563
563
  };
564
- if (/^input$/i.test(target.tagName) && /^checkbox$/i.test(target.type) || /^checkbox$/i.test(target.tagName)) {
565
- this.$renders.push(setter || setter2.bind(target, 'checked'));
566
- var change = getstr || "this.checked";
567
- } else if (("value" in target || target.getValue instanceof Function) && target.setValue instanceof Function) {
564
+ if (("value" in target || target.getValue instanceof Function) && target.setValue instanceof Function) {
568
565
  this.$renders.push(setter);
569
566
  var change = getstr || "this.value";
567
+ } else if (/^input$/i.test(target.tagName) && /^checkbox$/i.test(target.type) || /^checkbox$/i.test(target.tagName)) {
568
+ this.$renders.push(setter || setter2.bind(target, 'checked'));
569
+ var change = getstr || "this.checked";
570
570
  } else if (/^(select|input|textarea)$/i.test(target.tagName) || "value" in target) {
571
571
  this.$renders.push(setter || setter2.bind(target, 'value'));
572
572
  var change = getstr || "this.value";
@@ -580,6 +580,7 @@ var directives = {
580
580
  });
581
581
  var change = getstr || "'value' in this?this.value:this.innerHTML";
582
582
  }
583
+ if (change === false) return;
583
584
  setter2 = null;
584
585
  var changeme = $$eval.bind(this, search + "=" + change, getScopeList(this));
585
586
  var onchange = function () {
@@ -593,6 +594,9 @@ var directives = {
593
594
  };
594
595
  eventsBinders.forEach(on => on(target, onchange, true));
595
596
  },
597
+ value(search, target) {
598
+ directives.model.call(this, search, target, false);
599
+ },
596
600
 
597
601
  };
598
602
  // property binder
@@ -711,6 +715,11 @@ function getFromScopes(key, scope, parentScopes) {
711
715
 
712
716
  function renderRest(element, struct, replacer = element) {
713
717
  var renders = element.$renders;
718
+ if (element.renders) {
719
+ if (!renders) renders = [];
720
+ renders.push.apply(renders, element.renders);
721
+ delete element.renders;
722
+ }
714
723
  element.$renders = [];
715
724
  var { binds, attrs, props } = struct;
716
725
  for (var k in binds) {
@@ -988,7 +997,7 @@ function createStructure(element, useExists) {
988
997
  }
989
998
  // ng-html,ng-src,ng-text,ng-model,ng-style,ng-class,...
990
999
  var key = name.replace(/^(ng|v|[^\_\:\.]*?)\-|^[\:\_\.]|^v\-bind\:/i, "").toLowerCase();
991
- if (directives.hasOwnProperty(key) || /^([\_\:\.]|v\-bind\:)/.test(name)) {
1000
+ if (key.length !== name.length && directives.hasOwnProperty(key) || /^([\_\:\.]|v\-bind\:)/.test(name)) {
992
1001
  if (value) binds[key] = value;
993
1002
  element.removeAttribute(name);
994
1003
  }
@@ -90,20 +90,14 @@ var init = function () {
90
90
  marginRight: -getScrollbarWidth() + "px"
91
91
  });
92
92
  };
93
- var isType = function (target, type) {
94
- // 记得小时候,不论是苍蝇还是蚊子,飞起来都是有声音的。最近看到的一种像蚊子一样小的飞虫,喜欢像苍蝇一样趴在食物上,飞起来却听不到声音。
95
- // 是我的听力下降了?还是外界太过嘈杂?还是飞虫拍打翅膀的频率超出了我的听觉范围?还是飞行可以不产生声音?
96
- return target.hasAttribute(type) || hasClass(target, type);
97
- }
98
93
  var resize2 = function () {
99
- var head, body, foot;
100
- for (var c of this.children) {
101
- if (isType(c, "head")) head = c;
102
- else if (isType(c, "body")) body = c;
103
- else if (isType(c, "foot")) foot = c;
104
- }
105
- if (head && body) {
94
+ var [head, body, foot] = getTypedChildren(this, ["head", "body", "foot"]);
95
+ var changed = false;
96
+ a: if (head && body) {
106
97
  var height = head.offsetHeight + head.offsetTop;
98
+ if (head.$height === height) break a;
99
+ head.$height = height;
100
+ changed = true;
107
101
  css(head, {
108
102
  marginBottom: fromOffset(-height),
109
103
  })
@@ -111,8 +105,11 @@ var resize2 = function () {
111
105
  paddingTop: fromOffset(height - body.clientTop)
112
106
  });
113
107
  }
114
- if (foot && body) {
108
+ a: if (foot && body) {
115
109
  var height = foot.offsetHeight;
110
+ if (foot.$height === height) break a;
111
+ foot.$height = height;
112
+ changed = true;
116
113
  css(body, {
117
114
  paddingBottom: fromOffset(height)
118
115
  });
@@ -120,13 +117,11 @@ var resize2 = function () {
120
117
  marginTop: fromOffset(-height)
121
118
  })
122
119
  }
123
- if (body) {
124
- if (body.scrollHeight + body.offsetTop > this.clientHeight) {
120
+ if (changed) {
121
+ css(body, { height: '' });
122
+ if (body.scrollHeight + body.offsetTop > this.clientHeight + 1) {
125
123
  css(body, { height: fromOffset(this.clientHeight) });
126
124
  }
127
- else {
128
- css(body, { height: '' });
129
- }
130
125
  }
131
126
  };
132
127
  function view(element) {
@@ -95,5 +95,5 @@
95
95
  }
96
96
  </style>
97
97
  <script>
98
- 茨菰$渲染;
98
+ 渲染;
99
99
  </script>
@@ -9,7 +9,7 @@ var rows = function (type, text) {
9
9
  console.log(text)
10
10
  return [];
11
11
  }
12
- type = type.toLowerCase();
12
+ type = String(type).toLowerCase();
13
13
  if (type in 语言) {
14
14
  var c = 语言[type](text);
15
15
  标签化(c, encode);