efront 3.15.7 → 3.17.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 (41) hide show
  1. package/apps/pivot/log/boot.js +36 -4
  2. package/apps/pivot/main.less +1 -0
  3. package/coms/basic/JSAM.js +72 -19
  4. package/coms/basic/Speed.js +2 -2
  5. package/coms/basic/cross_.js +1 -1
  6. package/coms/basic/lazy.js +6 -2
  7. package/coms/basic/loader.js +2 -2
  8. package/coms/basic/parseYML.js +1 -1
  9. package/coms/basic/renderExpress.js +3 -3
  10. package/coms/frame/route.js +54 -17
  11. package/coms/kugou/song.js +3 -3
  12. package/coms/zimoli/Item.js +40 -25
  13. package/coms/zimoli/appendChild.js +6 -8
  14. package/coms/zimoli/container.js +10 -0
  15. package/coms/zimoli/data.js +1 -6
  16. package/coms/zimoli/dispatch.js +13 -1
  17. package/coms/zimoli/drag.js +4 -2
  18. package/coms/zimoli/getGenerator.js +4 -4
  19. package/coms/zimoli/getTreeFromData.js +3 -0
  20. package/coms/zimoli/getValue.js +1 -1
  21. package/coms/zimoli/list.js +1 -1
  22. package/coms/zimoli/menu.js +36 -2
  23. package/coms/zimoli/menuItem.html +4 -1
  24. package/coms/zimoli/menuItem.js +9 -2
  25. package/coms/zimoli/menuItem.less +23 -2
  26. package/coms/zimoli/menuList.html +1 -1
  27. package/coms/zimoli/menuList.js +37 -31
  28. package/coms/zimoli/menuList.less +1 -1
  29. package/coms/zimoli/moveupon.js +6 -4
  30. package/coms/zimoli/on.js +173 -162
  31. package/coms/zimoli/once.js +6 -5
  32. package/coms/zimoli/onmounted.js +1 -1
  33. package/coms/zimoli/render.js +19 -6
  34. package/coms/zimoli/renderDefaults.js +1 -0
  35. package/coms/zimoli/resize.js +18 -0
  36. package/coms/zimoli/scrollbar.js +20 -8
  37. package/coms/zimoli/scrollbar.less +22 -1
  38. package/coms/zimoli/vbox.js +7 -3
  39. package/coms/zimoli/zimoli.js +1 -1
  40. package/package.json +1 -1
  41. package/public/efront.js +1 -1
@@ -1,3 +1,4 @@
1
+ cross.addDirect(/^https?\:\/\/([[a-z\.\d\:\/%]+\]|[\d\.]+)(\:\d+)?\//);
1
2
  var fields = refilm`
2
3
  地址/ip
3
4
  地理位置/ip ${function (e) {
@@ -10,9 +11,9 @@ var fields = refilm`
10
11
  appendChild(e, l);
11
12
  };
12
13
  if (e.data.address) setAddress(e.data.address);
13
- else data.from("iplocation", { ip: m[0] }, function (a) {
14
- e.data.address = a.address;
14
+ else e.data.address = data.from("iplocation", { ip: m[0] }, function (a) {
15
15
  setAddress(a.address);
16
+ return a.address;
16
17
  });
17
18
  }
18
19
  return e;
@@ -20,8 +21,39 @@ var fields = refilm`
20
21
  启动时间/time ${function (e) {
21
22
  e.innerHTML = filterTime(e.data[e.field.key]);
22
23
  }}
23
- 端口/port input
24
- 版本/version
24
+ 端口/port ${async function (e) {
25
+ var { data, field } = e;
26
+ var ports = data[field.key].split(/,/);
27
+ var loaded = data.loaded || ports;
28
+ data.loaded = loaded;
29
+ e.innerHTML = loaded.join(' ');
30
+ if (data.loaded === ports) for (let cx = 0, dx = ports.length; cx < dx; cx++) {
31
+ var p = ports[cx];
32
+ var p0 = p;
33
+ var protocol = /^https/.test(p) ? "https://" : "http://";
34
+ p = p.replace(/[^\d]+/g, '');
35
+ if (p) p = ":" + p;
36
+ try {
37
+ var ip = data.ip;
38
+ if (/^::ffff:\d+\.\d+\.\d+\.\d+$/i.test(ip)) {
39
+ ip = ip.slice(7);
40
+ }
41
+ else {
42
+ ip = `[${ip}]`;
43
+ }
44
+ var xhr = await cross("options", `${protocol}${ip}${p}/:version`);
45
+ if (xhr.responseText === 'efront ' + data.version) {
46
+ loaded[cx] = (`<span style="color:green">${p0}</span>`);
47
+ } else {
48
+ loaded[cx] = (`<span style="color:red">${p0}</span>`);
49
+ }
50
+ } catch (e) {
51
+ loaded[cx] = (`<span style="color:gray">${p0}</span>`);
52
+ }
53
+ e.innerHTML = loaded.join(' ');
54
+ }
55
+ }}
56
+ 版本/version input
25
57
  进程/pid
26
58
  `;
27
59
  function main() {
@@ -1,4 +1,5 @@
1
1
  >:not([layer]) {
2
2
  padding: 50px 10px 0;
3
3
  min-height: 100%;
4
+ display: block;
4
5
  }
@@ -1,3 +1,4 @@
1
+ var isEmpty = require("./isEmpty");
1
2
  var convertReg = /^(?:object|function)$/;
2
3
  var check = function (o) {
3
4
  return o === null || typeof o === 'bigint' || o instanceof BigInt || typeof o === 'number' || typeof o === "boolean";
@@ -24,16 +25,28 @@ var join = function (o) {
24
25
  if (o instanceof RegExp) return regexp(o);
25
26
  var arr = o[""];
26
27
  delete o[""];
28
+ var typeid = o._;
29
+ delete o._;
27
30
  var pairs = [].concat(arr);
28
31
  for (var k in o) {
29
32
  pairs.push(k + ':' + o[k]);
30
33
  }
34
+ var s;
31
35
  if (o instanceof Array) {
32
- return `[${pairs.join(',')}]`;
36
+ s = `[${pairs.join(',')}]`;
37
+ }
38
+ else {
39
+ s = `{${pairs.join(',')}}`;
40
+ }
41
+ if (typeid > 0) s = typeid + s;
42
+ return s;
43
+ };
44
+ function stringify(memery, preload) {
45
+ if (!isEmpty(preload)) {
46
+ preload = [].concat(preload);
47
+ var i = preload.indexOf(memery) + 1;
48
+ if (i > 0) return i + ',';
33
49
  }
34
- return `{${pairs.join(',')}}`;
35
- }
36
- function stringify(memery) {
37
50
  if (memery === undefined) return '';
38
51
  if (check(memery)) return String(memery);
39
52
  if (typeof memery === 'symbol') return symbol(memery);
@@ -48,15 +61,23 @@ function stringify(memery) {
48
61
  var rest = [memery];
49
62
  var trimed = [memery instanceof Array ? [] : {}];
50
63
  var objects = [trimed[0]];
64
+ if (!isEmpty(preload)) dist = dist.concat(preload);
65
+ var preload_used = false;
51
66
  while (rest.length) {
52
67
  var memery = rest.shift();
53
68
  var o = objects.shift();
54
69
  var inc = 0, arr = [];
55
70
  o[""] = arr;
71
+ o._ = dist.indexOf(memery.constructor);
72
+ if (o._ > 0) preload_used = true;
56
73
  for (var k in memery) {
57
74
  var m = memery[k];
58
75
  f: if (typeof m === 'function') {
59
76
  for (var k in m) break f;
77
+ if (dist.indexOf(m) >= 0) {
78
+ preload_used = true;
79
+ break f;
80
+ }
60
81
  continue;
61
82
  }
62
83
  if (inc === +k && k !== '') {
@@ -101,7 +122,9 @@ function stringify(memery) {
101
122
  }
102
123
  }
103
124
  }
104
- return trimed.map(join).join(',');
125
+ var result = trimed.map(join).join(',');
126
+ if (trimed.length === 1 && preload_used) result += ',';
127
+ return result;
105
128
  }
106
129
  var create = function (a, dst) {
107
130
  if (!a) return;
@@ -117,9 +140,10 @@ var create = function (a, dst) {
117
140
  }
118
141
  dst[""] = rest;
119
142
  };
120
- function parse(string) {
143
+ function parse(string, preload) {
121
144
  string = String(string);
122
145
  var trimed = [];
146
+ var reg0 = /\d+/g;
123
147
  var reg1 = /\}/g;
124
148
  var reg2 = /\]/g;
125
149
  var reg3 = /\\[\s\S]|"/g;
@@ -130,6 +154,18 @@ function parse(string) {
130
154
  for (var cx = 0, dx = string.length; cx < dx; cx++) {
131
155
  var s = string.charAt(cx);
132
156
  var reg = null, o = null;
157
+ reg0.lastIndex = 0;
158
+ var typeid = 0;
159
+ var m = reg0.test(string.charAt(cx));
160
+ if (m) {
161
+ reg0.lastIndex = cx;
162
+ var m = reg0.exec(string);
163
+ if (/^[\[\{]$/.test(string.charAt(reg0.lastIndex))) {
164
+ typeid = +m[0];
165
+ cx = reg0.lastIndex;
166
+ s = string.charAt(reg0.lastIndex);
167
+ }
168
+ }
133
169
  switch (s) {
134
170
  case ",":
135
171
  trimed.push(undefined);
@@ -148,6 +184,15 @@ function parse(string) {
148
184
  marked.push(trimed.length);
149
185
  trimed.push(o);
150
186
  cx = reg.lastIndex;
187
+ if (typeid) {
188
+ o._ = typeid;
189
+ }
190
+ if (/\d/.test(string.charAt(cx))) {
191
+ reg4.lastIndex = cx;
192
+ var m = reg4.exec(string);
193
+ o._ = typeid || string.slice(cx, m.index);
194
+ cx = m.index;
195
+ }
151
196
  break;
152
197
  case "/":
153
198
  reg = reg5;
@@ -176,15 +221,11 @@ function parse(string) {
176
221
  }
177
222
  trimed.push(s);
178
223
  break;
179
- case "/":
180
- break;
181
224
  default:
182
- reg4.lastIndex = cx + 1;
225
+ reg4.lastIndex = cx;
183
226
  var match = reg4.exec(string);
184
227
  var index = match.index;
185
-
186
228
  var s = string.slice(cx, index);
187
- cx = index;
188
229
  switch (s) {
189
230
  case "null":
190
231
  s = null;
@@ -211,21 +252,30 @@ function parse(string) {
211
252
 
212
253
  }
213
254
  trimed.push(s);
255
+ cx = index;
214
256
  }
215
257
  }
216
- var dist = trimed.slice(0, trimed.length);
258
+ if (string.charAt(string.length - 1) === ',') trimed.push(undefined);
259
+ var dist = [trimed[0]];
260
+ if (!isEmpty(preload)) dist = dist.concat(preload);
261
+ var preloads_length = dist.length - 1;
262
+ dist = dist.concat(trimed.slice(1, trimed.length));
217
263
  for (var cx = 0, dx = marked.length; cx < dx; cx++) {
218
264
  var index = marked[cx];
219
265
  var o = trimed[index];
220
- dist[index] = o instanceof Array ? [] : {};
266
+ if (index > 0) index += preloads_length;
267
+ if (o._ > 0) dist[index] = Object.create(dist[o._].prototype);
268
+ else dist[index] = o instanceof Array ? [] : {};
221
269
  }
222
270
  for (var cx = 0, dx = marked.length; cx < dx; cx++) {
223
271
  var index = marked[cx];
224
272
  var o = trimed[index];
273
+ if (index > 0) index += preloads_length;
225
274
  var t = dist[index];
226
275
  var arr = o[""];
227
276
  delete o[""];
228
- for (var k in arr) {
277
+ delete o._;
278
+ if (arr) for (var k in arr) {
229
279
  t[k] = dist[arr[k]];
230
280
  }
231
281
  for (var k in o) {
@@ -233,14 +283,17 @@ function parse(string) {
233
283
  t[dist[k]] = dist[v];
234
284
  }
235
285
  }
286
+ if (trimed.length > 1 && typeof trimed[0] === 'number') {
287
+ return dist[trimed[0]];
288
+ }
236
289
  return dist[0];
237
290
  }
238
291
  module.exports = {
239
292
  stringify,
240
- parse(data) {
241
- if (!/^\s*([\[\{]|\[\s*\]|\{\s*\})/.test(data)) return parse(data);
242
- if (/^\s*\{[\d\,\:\s]*\}\s*,/.test(data)) return parse(data);
243
- if (/^\s*\[[\d\,\:\s]*\]\s*,/.test(data)) return parse(data);
244
- return JSON.parse(data);
293
+ parse(data, preload) {
294
+ if (!/^\s*([\[\{]|\[\s*\]|\{\s*\})$/.test(data)) return parse(data, preload);
295
+ if (/^\s*\{[\d\,\:\s]*\}\s*,/.test(data)) return parse(data, preload);
296
+ if (/^\s*\[[\d\,\:\s]*\]\s*,/.test(data)) return parse(data, preload);
297
+ return JSON.parse(data, preload);
245
298
  }
246
299
  };
@@ -22,12 +22,12 @@ function inertia(gun) {
22
22
  }
23
23
  var smooth = function () {
24
24
  var args = spd.read();
25
- if (decrease && args.filter(a => Math.abs(a) > .5).length === 0) {
25
+ if (decrease && args.filter(a => Math.abs(a) > 2).length === 0) {
26
26
  spd.reset();
27
27
  _decrease();
28
28
  return;
29
29
  }
30
- if (args.filter(a => Math.abs(a) > .1).length === 0) {
30
+ if (args.filter(a => Math.abs(a) > .5).length === 0) {
31
31
  spd.reset();
32
32
  return;
33
33
  }
@@ -114,7 +114,7 @@ function cross_(jsonp, digest = noop, method, url, headers) {
114
114
  else {
115
115
  var nocross = notCross(url);
116
116
  var callback = function () {
117
- var exposeHeaders = xhr.getResponseHeader("access-control-expose-headers");
117
+ var exposeHeaders = !nocross && xhr.getResponseHeader("access-control-expose-headers");
118
118
  var exposeMap = {};
119
119
  if (exposeHeaders) exposeHeaders.split(",").forEach(h => exposeMap[h.toLowerCase()] = true);
120
120
  if (xhr.getResponseHeader) {
@@ -8,9 +8,13 @@ function lazy(run, time = false) {
8
8
  var fire = function () {
9
9
  if (time >= 0) {
10
10
  if (ing === true) {
11
- ing = wait(fire, +time);
11
+ ing = wait(fire, +time / 2);
12
12
  }
13
- else if (isFinite(ing)) {
13
+ else if (isFinite(ing) && ing !== 0) {
14
+ wait(fire, +time);
15
+ ing = 0;
16
+ }
17
+ else if (ing === 0) {
14
18
  ing = run.apply(that, args);
15
19
  }
16
20
  else {
@@ -230,7 +230,7 @@ var killCircle = function () {
230
230
  var hasOwnProperty = {}.hasOwnProperty;
231
231
  var loadModule = function (name, then, prebuilds = {}) {
232
232
  if (/^(?:module|exports|define|require|window|global|undefined|__dirname|__filename)$/.test(name)) return then();
233
- if ((name in prebuilds) || hasOwnProperty.call(modules, name) || (window[name] !== null && window[name] !== void 0 && !hasOwnProperty.call(forceRequest, name))
233
+ if ((name in prebuilds) || hasOwnProperty.call(modules, name) || (!/^on/.test(name) && window[name] !== null && window[name] !== void 0 && !hasOwnProperty.call(forceRequest, name))
234
234
  ) return then();
235
235
  preLoad(name);
236
236
  var key = keyprefix + name;
@@ -545,7 +545,7 @@ var init = function (name, then, prebuilds) {
545
545
  if (then) then(modules[name]);
546
546
  return modules[name];
547
547
  }
548
- if (window[name] !== null && window[name] !== void 0 && !hasOwnProperty.call(forceRequest, name)) {
548
+ if (!/^on/.test(name) && window[name] !== null && window[name] !== void 0 && !hasOwnProperty.call(forceRequest, name)) {
549
549
  modules[name] = window[name]
550
550
  if (then) then(modules[name]);
551
551
  return modules[name];
@@ -119,7 +119,7 @@ var scan = function (text) {
119
119
  }
120
120
 
121
121
  if (/^\-(\s|$)/.test(row)) {
122
- if (data || span >= spacesize) push();
122
+ if (data || span && span >= spacesize) push();
123
123
  if (!parents[spacesize]) {
124
124
  var obj = [];
125
125
  push(obj);
@@ -11,8 +11,8 @@ function createSeek(express) {
11
11
  return dist;
12
12
  }
13
13
  function main(express) {
14
- if (!/\?\s*\.(?=[^\d])/.test(express)) return express;
15
- var reg = /\\[\s\S]|\?\s*(\.(?!\d))|[\:\,\+\=\-\!%\^\|\/\&\*\!\;\?\>\<~\{\}\[\]\(\)'"`\s]/g;
14
+ if (!/\?\s*\.(?=[^\d])|\?$/.test(express)) return express;
15
+ var reg = /\\[\s\S]|\?\s*(\.(?!\d)|\s*$)|[\:\,\+\=\-\!%\^\|\/\&\*\!\;\?\>\<~\{\}\[\]\(\)'"`\s]/g;
16
16
  var cache = [], queue = [];
17
17
  var exp = [];
18
18
  var instr = false;
@@ -81,7 +81,7 @@ function main(express) {
81
81
  add_exp(str);
82
82
  }
83
83
  lastIndex = match.index + m.length;
84
- if (match[1]) {
84
+ if (match[1] !== undefined) {
85
85
  exp.push(match[1]);
86
86
  }
87
87
  else if (/[\[\{\(]/.test(m)) {
@@ -3,6 +3,50 @@
3
3
  var menuid = 0;
4
4
  var savedChildren = Object.create(null);
5
5
  var savedMenus = Object.create(null);
6
+ var keymap = {};
7
+ var parseName = function (k) {
8
+ var icon, name, hotkey;
9
+ if (/(^|\s+)\./.test(k)) {
10
+ k = k.replace(/(?:^|\s+)\.([^\s,"'`]+)/, (_, m) => {
11
+ icon = m;
12
+ return '';
13
+ });
14
+ }
15
+ if (/(^|\s+)[\/\\]/.test(k)) {
16
+ k = k.replace(/(?:^|\s+)[\/\\]([\s\S]+)$/, (_, m) => {
17
+ hotkey = m;
18
+ return '';
19
+ });
20
+ }
21
+ if (/^(["'`])[\s\S]*\1/.test(k)) {
22
+ k = k.replace(/(['"`])[\s\S]\1/, (m) => {
23
+ name = strings.decode(m);
24
+ return '';
25
+ });
26
+ }
27
+ if (/,/.test(k)) {
28
+ var [k, ...roles] = k.split(',');
29
+ }
30
+ if (!icon && /\s+|\./.test(k)) {
31
+ [icon] = k.split(/\s+/);
32
+ k = k.slice(icon.length).trim();
33
+ }
34
+ if (!name) name = k;
35
+ var item = {};
36
+ if (icon) item.icon = icon.replace(/\./g, ' ');
37
+ if (name) item.name = name;
38
+ if (hotkey) {
39
+ hotkey = hotkey.split(',');
40
+ for (var k of hotkey) {
41
+ k = k.trim().toLowerCase().replace(/[\+\_\s]+/g, '.');
42
+ if (keymap[k]) console.warn("检查到两个项菜单使用了相同的快捷键", item, keymap[k]);
43
+ keymap[k] = item;
44
+ }
45
+ item.hotkey = hotkey;
46
+ }
47
+ if (roles) item.roles = roles;
48
+ return item;
49
+ }
6
50
  var getChildren = function (menu) {
7
51
  if (!menu.id) {
8
52
  menu.id = ++menuid;
@@ -52,29 +96,17 @@
52
96
 
53
97
  items = keys.map(k => {
54
98
  var c = items[k];
55
- var item = {};
99
+ var item = parseName(k);
56
100
  if (c instanceof Object) {
57
101
  item.children = parseMenuList(c);
58
102
  }
59
103
  else if (typeof c === 'string') {
60
104
  var [path, data] = c.split(/\?/);
105
+ if (data) data = data.trim();
61
106
  }
62
- var [icon] = k.split(/\s+/);
63
- if (icon.length < k.length) {
64
- item.icon = icon;
65
- var name = k.slice(icon.length).trim();
66
- } else name = k;
67
- if (/,/.test(name)) {
68
- var [name, ...roles] = name.split(',');
69
- }
70
- if (/^\-+$/.test(name)) item.line = true;
71
- else item.name = name;
72
- if (roles) item.roles = roles;
107
+ if (/^\-+$/.test(item.name)) item.line = true;
73
108
  if (path) item.path = path;
74
109
  if (data) item.params = parseKV(data);
75
- if (/,/.test(name)) {
76
-
77
- }
78
110
  item.closed = true;
79
111
  return item;
80
112
  });
@@ -85,7 +117,7 @@
85
117
  result.update = function (items) {
86
118
  delete result.loading_promise;
87
119
  delete result.then;
88
- items = parseMenuList(items);
120
+ items = result.parse(items);
89
121
  items.map(getChildren);
90
122
  var opened = data.getInstance("menu-opened");
91
123
  var historys = zimoli.getCurrentHistory();
@@ -198,7 +230,12 @@
198
230
  result.then = then;
199
231
  return result;
200
232
  };
201
- result.parse = parseMenuList;
233
+ result.parse = function (items) {
234
+ keymap = {};
235
+ items = parseMenuList(items);
236
+ items.keymap = keymap;
237
+ return items;
238
+ };
202
239
  var then = function (ok, oh) {
203
240
  if (this.loading_promise) {
204
241
  return this.loading_promise.then(ok, oh);
@@ -1,15 +1,14 @@
1
1
  function main(elem) {
2
2
  elem = elem || document.createElement("song");
3
- if (!elem.innerHTML) elem.innerHTML = song;
4
3
  var $scope = {
5
4
  filterTime,
6
5
  png: img,
7
6
  playState: kugou$playState,
8
7
  song: {},
9
- musicList:kugou$musicList,
8
+ musicList: kugou$musicList,
10
9
  };
11
- render(elem, $scope);
12
10
  care(elem, function (item) {
11
+ if (!elem.innerHTML) elem.innerHTML = song;
13
12
  var songName = String(item.name || item.songName || item.songname_original || '');
14
13
  var singerName = String(item.singer || item.singerName || item.singername || '');
15
14
  if (~songName.indexOf(singerName)) {
@@ -24,6 +23,7 @@ function main(elem) {
24
23
  songMarked: mark(songName, elem.mark),
25
24
  singerMarked: mark(singerName, elem.mark)
26
25
  };
26
+ render(elem.children, $scope);
27
27
  });
28
28
  return block(elem);
29
29
  }
@@ -1,32 +1,39 @@
1
1
  var id = 0;
2
2
  function Item(value) {
3
- this.value = isObject(value) ? value : Object.create(value);
4
- this.valueOf = function () {
5
- return value;
6
- };
7
- this.toString = function () {
8
- return String(value);
9
- };
10
3
  this.children = this;
11
- if (value.children instanceof Array) {
12
- var children = value.children.map(item => new Item(item));
13
- children.forEach(item => item.parent = item);
14
- this.push.apply(this, children);
15
- }
16
- if (isObject(value)) {
17
- this.name = value.name;
18
- this.tab = value.tab;
19
- this.icon = value.icon;
20
- this.color = value.color;
21
- this.test = value.test;
22
- this.line = value.line;
23
- }
24
4
  this.count = 0;//子项中的叶子节点数
25
5
  this.total = 0;//子项中的节点数
26
6
  this.crack = 0;
27
7
  this.id = ++id;
8
+ this.extends(value);
28
9
  }
29
10
  Item.prototype = extend([], {
11
+ extends(value) {
12
+ this.value = value;
13
+ if (value.children instanceof Array) {
14
+ var children = value.children.map(item => new Item(item));
15
+ children.forEach(item => item.parent = item);
16
+ this.push.apply(this, children);
17
+ }
18
+ if (isObject(value)) {
19
+ this.name = value.name;
20
+ this.tab = value.tab;
21
+ this.icon = value.icon;
22
+ this.color = value.color;
23
+ this.test = value.test;
24
+ this.line = value.line;
25
+ }
26
+ else {
27
+ this.name = value;
28
+ }
29
+ },
30
+
31
+ valueOf() {
32
+ return this.value;
33
+ },
34
+ toString() {
35
+ return String(this.value);
36
+ },
30
37
  isClosed() {
31
38
  return !!this.value.closed;
32
39
  },
@@ -34,14 +41,21 @@ Item.prototype = extend([], {
34
41
  this.value.closed = value;
35
42
  },
36
43
  isActive() {
37
- return !!(this.value.active || this.value.actived);
44
+ if (isObject(this.value)) {
45
+ if ("active" in this.value) return this.value.active;
46
+ if ('actived' in this.value) return this.value.actived;
47
+ }
48
+ return !!this.actived;
38
49
  },
39
50
  setActive(value) {
40
- if ('active' in this.value) {
41
- this.value.active = value;
42
- } else {
43
- this.value.actived = value;
51
+ if (isObject(this.value)) {
52
+ if ('active' in this.value) {
53
+ this.value.active = value;
54
+ } else {
55
+ this.value.actived = value;
56
+ }
44
57
  }
58
+ this.actived = value;
45
59
  },
46
60
  isSelected() {
47
61
  return !!this.value.selected;
@@ -53,3 +67,4 @@ Item.prototype = extend([], {
53
67
  return !!this.value.class;
54
68
  }
55
69
  });
70
+ Item.prototype.isActived = Item.prototype.isActive;
@@ -11,26 +11,24 @@ function hasEnterStyle(e) {
11
11
  return e.initialStyle || e.enterStyle || e.leavingStyle || e.leaveStyle;
12
12
  }
13
13
 
14
- function _onappend(node, event) {
14
+ function _onappend(node, append = createEvent("append"), mount = createEvent("mounted")) {
15
15
  if (node.isMounted) return;
16
16
  if (node.nodeType === 1 || node.nodeType === 8) node.isMounted = true;
17
- if (!event) {
18
- event = createEvent("append");
19
- }
20
- dispatch(node, event);
17
+ dispatch(node, append);
21
18
  var onappend = node.onappend;
22
19
  if (isArray(onappend)) {
23
20
  onappend.map(function (append_handler) {
24
- append_handler.call(this, event);
21
+ append_handler.call(this, append);
25
22
  }, node);
26
23
  }
27
24
  if (isFunction(onappend)) {
28
- onappend.call(node, event);
25
+ onappend.call(node, append);
29
26
  }
30
27
  var children = [].concat.apply([], node.childNodes);
31
28
  if (children) for (var cx = 0, dx = children.length; cx < dx; cx++) {
32
- _onappend(children[cx], event);
29
+ _onappend(children[cx], append, mount);
33
30
  }
31
+ dispatch(node, mount);
34
32
  }
35
33
  function appendChild(parent, obj, transition) {
36
34
  if (transition === false) {
@@ -1,7 +1,17 @@
1
1
  var change = function (data) {
2
2
  zimoli.go(data, this.params, this);
3
3
  };
4
+ var gosrc = function () {
5
+ if (this.hasAttribute('src')) {
6
+ var src = this.getAttribute('src');
7
+ if (src !== this.src) {
8
+ this.src = src;
9
+ if (src) cast(this, this.getAttribute('src'));
10
+ }
11
+ }
12
+ };
4
13
  function container(element) {
5
14
  care(element, change);
15
+ element.renders = [gosrc];
6
16
  return element;
7
17
  }
@@ -571,10 +571,8 @@ var privates = {
571
571
  headers = seekFromSource(headers, api.base);
572
572
  }
573
573
  cross(realmethod, uri, headers).send(params).done(e => {
574
- updateLoadingCount();
575
574
  ok(e.response || e.responseText);
576
575
  }).error(xhr => {
577
- updateLoadingCount();
578
576
  try {
579
577
  var e = getErrorMessage(parseData(xhr.response || xhr.responseText || xhr.statusText || xhr.status));
580
578
  oh({ status: xhr.status, api, params: params1, error: e, toString: getErrorMessage })
@@ -582,7 +580,6 @@ var privates = {
582
580
  oh(error);
583
581
  }
584
582
  });
585
- updateLoadingCount();
586
583
  });
587
584
  promise.search = search;
588
585
  promise.params = temp;
@@ -652,6 +649,7 @@ var getData = function () { return this.data };
652
649
  var updateLoadingCount = function () {
653
650
  data.loading_count = cross.requests.length;
654
651
  };
652
+ on('render')(window, updateLoadingCount, true);
655
653
  var data = {
656
654
  decodeStructure,
657
655
  encodeStructure,
@@ -883,12 +881,10 @@ var data = {
883
881
  headers = seekFromSource(headers, api.base);
884
882
  }
885
883
  instance.loading = cross(method, uri, headers).send(params).done(xhr => {
886
- updateLoadingCount();
887
884
  if (instance.loading !== xhr) return oh(aborted);
888
885
  instance.loading = null;
889
886
  ok(xhr.responseText || xhr.response);
890
887
  }).error(xhr => {
891
- updateLoadingCount();
892
888
  if (instance.loading !== xhr) return oh(aborted);
893
889
  instance.loading = null;
894
890
  try {
@@ -898,7 +894,6 @@ var data = {
898
894
  oh(error);
899
895
  }
900
896
  });
901
- updateLoadingCount();
902
897
  }).then(function (response) {
903
898
  return transpile(seekResponse(parseData(response), selector), api.transpile, api.root);
904
899
  });