efront 4.22.18 → 4.23.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 (74) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +6 -0
  2. package/apps/kugou/search/search.js +4 -3
  3. package/apps/noice/main.js +1 -1
  4. package/apps/pivot/auth/login.js +4 -4
  5. package/apps/pivot/dht/list.js +5 -5
  6. package/apps/pivot/link/chat.js +1 -1
  7. package/apps/pivot/link/index.js +1 -1
  8. package/apps/pivot/link/list.js +5 -4
  9. package/apps/pivot/share/list.js +6 -5
  10. package/apps/pivot/wow/root.js +3 -2
  11. package/coms/basic/LoadingArray.js +1 -0
  12. package/coms/basic/cross_.js +4 -1
  13. package/coms/basic/data.js +16 -13
  14. package/coms/basic_/WeakMap.js +23 -0
  15. package/coms/compile/Javascript.js +2 -1
  16. package/coms/explorer/context.js +10 -7
  17. package/coms/explorer/edit.js +1 -1
  18. package/coms/explorer/fileitem.js +9 -7
  19. package/coms/explorer/main.js +20 -17
  20. package/coms/frame/chat.js +17 -16
  21. package/coms/frame/list.js +6 -5
  22. package/coms/kugou/bindScroll.js +0 -1
  23. package/coms/kugou/buildScroll.js +5 -4
  24. package/coms/kugou/krc.js +2 -2
  25. package/coms/kugou/player.js +2 -2
  26. package/coms/kugou/song.js +1 -1
  27. package/coms/layer/leftCenter.js +5 -5
  28. package/coms/pivot/checkGeo.js +0 -1
  29. package/coms/zimoli/$eval.js +1 -0
  30. package/coms/zimoli/$mounted.js +1 -0
  31. package/coms/zimoli/$parented.js +1 -0
  32. package/coms/zimoli/$renders.js +1 -0
  33. package/coms/zimoli/$scoped.js +1 -0
  34. package/coms/zimoli/$structed.js +1 -0
  35. package/coms/zimoli/HexEditor.js +1 -1
  36. package/coms/zimoli/appendChild.js +12 -20
  37. package/coms/zimoli/autodragchildren_test.js +1 -1
  38. package/coms/zimoli/checkbox.js +1 -1
  39. package/coms/zimoli/container.js +4 -3
  40. package/coms/zimoli/createItemTarget.js +10 -6
  41. package/coms/zimoli/cross.js +1 -1
  42. package/coms/zimoli/field.js +3 -3
  43. package/coms/zimoli/gallery_test.js +4 -3
  44. package/coms/zimoli/getArgsChildren.js +22 -0
  45. package/coms/zimoli/getGenerator.js +36 -28
  46. package/coms/zimoli/grid.js +2 -2
  47. package/coms/zimoli/isMounted.js +6 -3
  48. package/coms/zimoli/lattice.js +2 -4
  49. package/coms/zimoli/maps.js +1 -2
  50. package/coms/zimoli/menu.js +1 -0
  51. package/coms/zimoli/menuItem.js +4 -3
  52. package/coms/zimoli/menuList.js +8 -8
  53. package/coms/zimoli/menu_test.js +4 -3
  54. package/coms/zimoli/model.js +11 -6
  55. package/coms/zimoli/on.js +28 -20
  56. package/coms/zimoli/picture.js +0 -7
  57. package/coms/zimoli/popup.js +33 -2
  58. package/coms/zimoli/radio.js +1 -1
  59. package/coms/zimoli/remove.js +5 -14
  60. package/coms/zimoli/render.js +193 -99
  61. package/coms/zimoli/scrollbar.js +90 -42
  62. package/coms/zimoli/scrollbar.less +5 -3
  63. package/coms/zimoli/select.js +3 -3
  64. package/coms/zimoli/selectList.js +1 -1
  65. package/coms/zimoli/selectListEdit.js +5 -4
  66. package/coms/zimoli/table.html +6 -4
  67. package/coms/zimoli/table.js +82 -41
  68. package/coms/zimoli/table.less +22 -0
  69. package/coms/zimoli/vbox.less +2 -2
  70. package/coms/zimoli/zimoli.js +15 -8
  71. package/docs/version-desc.md +3 -1
  72. package/docs//347/211/210/346/234/254/350/257/264/346/230/216.md +3 -1
  73. package/package.json +1 -1
  74. package/public/efront.js +1 -1
@@ -1,3 +1,9 @@
1
+ - zh-CN: $1仅在开发环境存在,供开发者调试查看,$2
2
+ en: "$1 only exists in the development environment for developers to debug and view, $2"
3
+
4
+ - zh-CN: 项目发布后将没有这个属性!
5
+ en: "After the project is released, this attribute will no longer exist!"
6
+
1
7
  - zh-CN: 无法存入数据到$1
2
8
  en: Unable to deposit data to $1
3
9
 
@@ -9,7 +9,7 @@ function main(params, from) {
9
9
  page.initialStyle = 'margin-left:100%';
10
10
  page.innerHTML = search;
11
11
  document.title = "搜索";
12
- var $scope = render(page, {
12
+ var $scope = {
13
13
  titlebar,
14
14
  back,
15
15
  btn: button,
@@ -35,7 +35,7 @@ function main(params, from) {
35
35
  resultMap: null,
36
36
  addResult(info) {
37
37
  var resultMap = this.resultMap;
38
- var singerName = sortname(String(info.singername || '').split(/[\&\,,、]/)).join('、');
38
+ var singerName = sortname(String(info.singername || '').split(/[\&\,,、]/)).join('、');
39
39
  var songName = info.songname;
40
40
  var id = `${singerName}:${info.songname}`;
41
41
  if (!resultMap[id]) resultMap[id] = Object.assign([], { singer: singerName, song: songName });
@@ -92,7 +92,8 @@ function main(params, from) {
92
92
  this.search(void 0, 0);
93
93
  },
94
94
  keyword: state().keyword,
95
- }).$scope;
95
+ };
96
+ render(page, $scope);
96
97
  $scope.keyword && $scope.search();
97
98
  return page;
98
99
  }
@@ -86,7 +86,7 @@ function init() {
86
86
  render.refresh();
87
87
  };
88
88
  onmounted(_block, function () {
89
- _block.$scope.start();
89
+ recoder.start();
90
90
  })
91
91
  return _block;
92
92
 
@@ -19,11 +19,11 @@ function main(host) {
19
19
  });
20
20
  on("submit")(page, async function () {
21
21
  data.setInstance("hosts", hosts, true);
22
- var { password } = submit(fields, this.$scope.data);
23
- this.$scope.pending = true;
22
+ var { password } = submit(fields, $scoped.get(this).data);
23
+ $scoped.get(this).pending = true;
24
24
  page.disabled = true;
25
25
  try {
26
- var base = location.protocol + "//" + parseURL(this.$scope.data.host).host + "/";
26
+ var base = location.protocol + "//" + parseURL($scoped.get(this).data.host).host + "/";
27
27
  if (!host) data.setInstance("base", { base, host: parseURL(base).host });
28
28
  var api = Object.assign({}, await data.getApi("login"));
29
29
  api.base = base;
@@ -42,7 +42,7 @@ function main(host) {
42
42
  } catch (e) {
43
43
  console.log(e);
44
44
  }
45
- this.$scope.pending = false;
45
+ $scoped.get(this).pending = false;
46
46
  })
47
47
  return page;
48
48
  }
@@ -17,9 +17,10 @@ return plist.bind({
17
17
  name: "从文件读取", async do() {
18
18
  var FileReader = window.FileReader;
19
19
  if (!FileReader) return alert('当前浏览器无法读取文件', 'warn')
20
- var f = await chooseFile(".torrent",true);
20
+ var f = await chooseFile(".torrent", true);
21
21
  var pg = await popup("/dht/rent");
22
- pg.$scope.pending = true;
22
+ var scope = $scoped.get(pg);
23
+ scope.pending = true;
23
24
  for (var f of f) await new Promise(function (ok, oh) {
24
25
  var r = new FileReader;
25
26
  r.onload = function () {
@@ -28,8 +29,8 @@ return plist.bind({
28
29
  } catch (e) {
29
30
  return;
30
31
  }
31
- pg.$scope.load(t);
32
- pg.$scope.pending = false;
32
+ scope.load(t);
33
+ scope.pending = false;
33
34
  ok();
34
35
  };
35
36
  r.onerror = function () {
@@ -38,7 +39,6 @@ return plist.bind({
38
39
  };
39
40
  r.readAsArrayBuffer(f);
40
41
  });
41
- console.log(pg.$scope.pending)
42
42
  }
43
43
  }]
44
44
  })
@@ -2,7 +2,7 @@ async function link(id, page) {
2
2
  if (!id) {
3
3
  id = await data.from("link");
4
4
  }
5
- if (!page.name) page.$scope.title = `会话窗口(<span nodrag>${id}</span>)`;
5
+ if (!page.name) $scoped.get(page).title = `会话窗口(<span nodrag>${id}</span>)`;
6
6
  page.roomid = id;
7
7
  var removed = false;
8
8
  on("remove")(page, function () {
@@ -11,6 +11,6 @@ function index() {
11
11
  },
12
12
  menu,
13
13
  });
14
- page.$scope.menus[+data.getInstance("link-index")].actived = true;
14
+ $scoped.get(page).menus[+data.getInstance("link-index")].actived = true;
15
15
  return page;
16
16
  }
@@ -2,7 +2,7 @@ var autoreload = true;
2
2
  function main() {
3
3
  var page = div();
4
4
  page.innerHTML = template;
5
- renderWithDefaults(page, {
5
+ var scope = {
6
6
  load: lazy(async function () {
7
7
  this.clusters = data.lazyInstance("cluster");
8
8
  await this.clusters;
@@ -32,16 +32,17 @@ function main() {
32
32
  if (c) this.clients = [];
33
33
  this.clients = await data.asyncInstance("clients", { id: clusters[index] });
34
34
  },
35
- });
35
+ };
36
+ renderWithDefaults(page, scope);
36
37
  var loadid = 0;
37
38
  on("append")(page, function () {
38
39
  if (autoreload) loadid = setInterval(function () {
39
- page.$scope.load();
40
+ scope.load();
40
41
  }, 30);
41
42
  });
42
43
  on('remove')(page, function () {
43
44
  clearInterval(loadid);
44
45
  });
45
- page.$scope.load();
46
+ scope.load();
46
47
  return page;
47
48
  }
@@ -18,13 +18,13 @@ function main() {
18
18
  return;
19
19
  }
20
20
  await data.from('share', { opt: 'delete', path: e.path }).loading_promise;
21
- page.$scope.load();
21
+ scope.load();
22
22
  }
23
23
  }
24
24
  ];
25
25
  var page = div();
26
26
  page.innerHTML = list;
27
- renderWithDefaults(page, {
27
+ var scope = {
28
28
  data: [],
29
29
  load() {
30
30
  this.data = data.from("share", { opt: 'list' }, a => {
@@ -37,8 +37,9 @@ function main() {
37
37
  type: 'button',
38
38
  options,
39
39
  }),
40
- });
41
- page.$scope.load();
40
+ };
41
+ renderWithDefaults(page, scope);
42
+ scope.load();
42
43
  contextmenu(page, [
43
44
  {
44
45
  name: "添加",
@@ -46,7 +47,7 @@ function main() {
46
47
  zimoli.prepare("/share/edit", function () {
47
48
  var p = popup("/share/edit", { fields });
48
49
  on('submited')(p, function () {
49
- page.$scope.load();
50
+ scope.load();
50
51
  })
51
52
  })
52
53
  }
@@ -75,7 +75,8 @@ class File {
75
75
  }
76
76
  function main(path) {
77
77
  var page = explorer$main();
78
- extend(page.$scope, {
78
+ var ps = $scoped.get(page);
79
+ extend(ps, {
79
80
  pathlist: path ? path.split('/') : [],
80
81
  read(from, start, size) {
81
82
  var authorization = data.getSource(data.getInstance("base").base);
@@ -131,6 +132,6 @@ function main(path) {
131
132
  await data.from("folder", { opt: 'mov', path: from, to: distpath }).loading_promise;
132
133
  }
133
134
  });
134
- page.$scope.open();
135
+ ps.open();
135
136
  return page;
136
137
  }
@@ -5,5 +5,6 @@ class LoadingArray extends Array {
5
5
  is_loaded = false;
6
6
  is_readonly = null;
7
7
  loading = null;
8
+ rw_storage = 0;
8
9
  loading_promise = null;
9
10
  }
@@ -385,7 +385,10 @@ function cross_(jsonp, digest = noop, method, url, headers) {
385
385
  }
386
386
  if (is_gb2312) xhr.overrideMimeType("text/plain; charset=gb2312");
387
387
  if (location_href) delete realHeaders.Cookie;
388
- Object.keys(realHeaders).forEach(key => setRequestHeader.call(xhr, key, realHeaders[key]));
388
+ Object.keys(realHeaders).forEach(key => {
389
+ var value = realHeaders[key];
390
+ if (isHandled(value)) setRequestHeader.call(xhr, key, value);
391
+ });
389
392
  if (!isEmpty(datas)) send.call(xhr, !isencrypt ? datas : encode62.safeencode(datas, code));
390
393
  else send.call(xhr);
391
394
  digest();
@@ -50,7 +50,7 @@ function encodeStructure(array) {
50
50
  var { location, navigator, window, document } = this;
51
51
  const pagePathName = location ? location.pathname : '';
52
52
  const dataSourceMap = {};
53
- const sourceDataId = 'datasource' + pagePathName;
53
+ const sourceDataId = '波泼摸佛';
54
54
  const userPrefix = ';';
55
55
  const instanceDataMap = {};
56
56
  const cachedLoadingPromise = {};
@@ -1022,19 +1022,14 @@ var data = {
1022
1022
  setSource(sourceid, value) {
1023
1023
  var rememberWithStorage;
1024
1024
  if (isObject(sourceid)) {
1025
-
1026
1025
  this.rebuildInstance(dataSourceMap, sourceid);
1027
1026
  rememberWithStorage = value;
1028
1027
  } else {
1029
1028
  dataSourceMap[sourceid] = value;
1030
1029
  rememberWithStorage = arguments[2];
1031
1030
  }
1032
- if (rememberWithStorage !== false) {
1033
- sessionStorage.setItem(sourceDataId, JSAM.stringify(dataSourceMap));
1034
- }
1035
- if (rememberWithStorage) {
1036
- localStorage.setItem(sourceDataId, JSAM.stringify(dataSourceMap));
1037
- }
1031
+ if (rememberWithStorage === undefined) rememberWithStorage = 0;
1032
+ setItem(sourceDataId, dataSourceMap, rememberWithStorage);
1038
1033
  },
1039
1034
  getSource(sourceid) {
1040
1035
  if (sourceid) return dataSourceMap[sourceid];
@@ -1057,18 +1052,21 @@ var data = {
1057
1052
  } else {
1058
1053
  instanceDataMap[instanceId] = data;
1059
1054
  }
1055
+ instance.rw_storage = rememberWithStorage;
1060
1056
  setItem(instanceId, data, rememberWithStorage);
1061
1057
  fireListener(instanceId, data);
1062
1058
  return instanceDataMap[instanceId];
1063
1059
  },
1064
- wetInstance(instanceId, data, rememberWithStorage) {
1060
+ // rememberWithStorage =null 生产环境不存储,开发环境存到sessionStorage
1061
+ wetInstance(instanceId, data, rememberWithStorage = null) {
1065
1062
  instanceHasDulpData = false;
1066
1063
  var res = this.setInstance(instanceId, data, rememberWithStorage);
1067
1064
  instanceHasDulpData = true;
1068
1065
  return res;
1069
1066
  },
1070
- patchInstance(instanceId, data, rememberWithStorage = 0) {
1067
+ patchInstance(instanceId, data, rememberWithStorage) {
1071
1068
  var instance = this.getInstance(instanceId);
1069
+ if (rememberWithStorage === undefined) rememberWithStorage = instance.rw_storage;
1072
1070
  extend(instance, data);
1073
1071
  return this.setInstance(instanceId, instance, rememberWithStorage);
1074
1072
  },
@@ -1143,9 +1141,15 @@ var data = {
1143
1141
  }
1144
1142
  };
1145
1143
  var instanceHasDulpData = true;
1146
- function setItem(instanceId, data, rememberWithStorage = 0) {
1144
+ function setItem(instanceId, data, rememberWithStorage) {
1147
1145
  const storageId = userPrefix + instanceId + pagePathName;
1148
1146
  var buff = null;
1147
+ if (rememberWithStorage === null) {
1148
+ rememberWithStorage = false;
1149
+ // <!--
1150
+ rememberWithStorage = 0;
1151
+ // -->
1152
+ }
1149
1153
  if (rememberWithStorage !== false) {
1150
1154
  try {
1151
1155
  sessionStorage.setItem(storageId, buff = JSAM.stringify(data, instanceHasDulpData));
@@ -1184,5 +1188,4 @@ data.setItem = data.setInstance;
1184
1188
  data.getItem = data.getInstance;
1185
1189
  data.seekResponse = seekResponse;
1186
1190
  data.removeItem = data.removeInstance;
1187
- extend(dataSourceMap, loadInstance(localStorage, sourceDataId));
1188
- extend(dataSourceMap, loadInstance(sessionStorage, sourceDataId));
1191
+ extend(dataSourceMap, getItem(sourceDataId));
@@ -0,0 +1,23 @@
1
+ var WeakMap = this.WeakMap;
2
+ if (WeakMap) return WeakMap;
3
+ var id = 0;
4
+ WeakMap = class WeakMap {
5
+ id = "#" + ++id;
6
+ get(o) {
7
+ return o[this.id];
8
+ }
9
+ set(o, v) {
10
+ Object.defineProperty(o, this.id, {
11
+ value: v,
12
+ enumerable: false,
13
+ configurable: true
14
+ });
15
+ }
16
+ has(o) {
17
+ return this.id in o;
18
+ }
19
+ delete(o) {
20
+ delete o[this.id];
21
+ }
22
+ }
23
+ return WeakMap;
@@ -65,7 +65,8 @@ var isProperty = function (o) {
65
65
  }
66
66
  if (prev.type === STAMP) {
67
67
  if (prev.isprop) return true;
68
- return /^(\+\+|\-\-|[,;])$/.test(prev.text) && (o.type !== STAMP || !/^[,;\=\:]$/.test(o.text));
68
+ if (/^[,;]$/.test(prev.text) || !prev.unary && /^(\+\+|\-\-)$/.test(prev.text)) return o.type !== STAMP || !/^[,;\=\:]$/.test(o.text);
69
+ return false;
69
70
  }
70
71
  if (prev.type === EXPRESS && !/\.$/.test(prev.text)) {
71
72
  return prev.text !== 'async' || o.text !== 'function';
@@ -1,34 +1,37 @@
1
1
  var getActive = e => {
2
- var s = e.currentTarget.$scope;
2
+ var s = $scoped.get(e.currentTarget);
3
3
  return s.toActive(e);
4
4
  };
5
5
  var notGetActive = e => !getActive(e);
6
6
  var getStable = e => {
7
7
  var a = getActive(e);
8
8
  if (!a) return;
9
- return !a.$scope.d.pending;
9
+ return !$scoped.get(a).d.pending;
10
10
  };
11
11
  var getSelected = function (d) {
12
12
  var p = getPageScope(d);
13
13
  return p.selected;
14
14
  }
15
15
  var getPageScope = function (d) {
16
- var $scope = d.$scope.d ? d.$parentScopes[d.$parentScopes.length - 1] : d.$scope;
17
- return $scope;
16
+ var scopes = render.getScopes(d);
17
+ var s = scopes[scopes.length - 1];
18
+ if (s.d) return scopes[scopes.length - 2];
19
+ return s;
18
20
  };
19
21
  var never = function () { return false };
20
22
  var popupRen = function (d) {
21
23
  var $scope = getPageScope(d);
22
24
  var selected = $scope.selected;
23
25
  var active;
24
- if (d.$scope === $scope) {
26
+ var ds = $scoped.get(d);
27
+ if (ds === $scope) {
25
28
  if (selected.length !== 1) return;
26
29
  active = selected[0];
27
30
  }
28
31
  else {
29
- active = d.$scope.d;
32
+ active = ds.d;
30
33
  }
31
- if (d.$scope.pending) return;
34
+ if (ds.pending) return;
32
35
  popupEdit($scope, active);
33
36
  };
34
37
  var popupAdd = function (d) {
@@ -30,7 +30,7 @@ function main({ path: root, rename, isfolder, add, name, hasName }) {
30
30
  });
31
31
  on('submit')(a, async function (e) {
32
32
  e.preventDefault();
33
- var path = root + "/" + a.$scope.data.name;
33
+ var path = root + "/" + $scoped.get(a).data.name;
34
34
  if (origin) {
35
35
  var to = path;
36
36
  path = root + '/' + origin;
@@ -28,11 +28,13 @@ e.stopMarquee = function (sp) {
28
28
 
29
29
  function fileitem(elem) {
30
30
  elem.innerHTML = template;
31
- var e = elem.children[0];
32
- e.$scope = new Fileitem;
33
- var ext = /\.([^\.]+)$/.exec(elem.$scope.d.name);
34
- if (ext) e.$scope.ext = ext[1];
35
- else e.$scope.ext = '';
36
- extend(e.$scope, elem.$scope);
37
- return e;
31
+ var c = elem.children[0];
32
+ var cs = new Fileitem;
33
+ $scoped.set(c, cs);
34
+ var es = $scoped.get(elem);
35
+ var ext = /\.([^\.]+)$/.exec(es.d.name);
36
+ if (ext) cs.ext = ext[1];
37
+ else cs.ext = '';
38
+ extend(cs, es);
39
+ return c;
38
40
  }
@@ -6,11 +6,11 @@ var selectRected = on("resize")(rect, function () {
6
6
  if (!lattice) return;
7
7
  var selected = [];
8
8
  if (touchitems) for (var m of touchitems) {
9
- var file = m.$scope.d;
9
+ var file = $scoped.get(m).d;
10
10
  file.selected = overlap(m, rect);
11
11
  if (file.selected) selected.push(file);
12
12
  }
13
- lattice.$scope.selected = selected;
13
+ $scoped.get(lattice).selected = selected;
14
14
  render.refresh();
15
15
  });
16
16
  var dragger = null;
@@ -21,11 +21,13 @@ var touch = {
21
21
  */
22
22
  var t = this;
23
23
  var start = () => {
24
- var a = t.$scope.toActive(e);
24
+ var ts = $scoped.get(t);
25
+ var a = ts.toActive(e);
26
+ var as = $scoped.get(a);
25
27
  touchitems = t.querySelectorAll("fileitem");
26
- if (a && t.$scope.selected.indexOf(a.$scope.d) >= 0) {
28
+ if (a && ts.selected.indexOf(as.d) >= 0) {
27
29
  dragger = e;
28
- if (!drag.target) drag(t.$scope.selected.length === 1 ? a : t.querySelectorAll(".focused"), e);
30
+ if (!drag.target) drag(ts.selected.length === 1 ? a : t.querySelectorAll(".focused"), e);
29
31
  return;
30
32
  }
31
33
  var pos = getScreenPosition(t.parentNode);
@@ -52,7 +54,7 @@ var touch = {
52
54
  if (dragger) {
53
55
  var tiped = null;
54
56
  for (var c of touchitems) {
55
- var d = c.$scope.d;
57
+ var d = $scoped.get(c).d;
56
58
  if (d.isfolder && !d.selected && overpos(c, e)) {
57
59
  if (!c.hasAttribute('dropping')) {
58
60
  if (!drag.tip) {
@@ -74,7 +76,7 @@ var touch = {
74
76
  });
75
77
  }
76
78
  css(drag.tip, 'display:block');
77
- drag.tip.innerHTML = `<b style="color:#169;font-weight:400">移动到</b> ${c.$scope.d.name}`;
79
+ drag.tip.innerHTML = `<b style="color:#169;font-weight:400">移动到</b> ${d.name}`;
78
80
  c.setAttribute('dropping', '');
79
81
  }
80
82
  tiped = c;
@@ -103,8 +105,9 @@ var touch = {
103
105
  var p = this.querySelector("[dropping]");
104
106
  if (p) {
105
107
  p.removeAttribute("dropping");
106
- var $scope = this.$scope;
107
- var base = $scope.pathlist.concat(p.$scope.d.name).join("/");
108
+ var $scope = $scoped.get(this);
109
+ var ps = $scoped.get(p);
110
+ var base = $scope.pathlist.concat(ps.d.name).join("/");
108
111
  for (var s of $scope.selected) {
109
112
  await $scope.mov(s, base + "/" + s.name);
110
113
  }
@@ -115,7 +118,7 @@ var touch = {
115
118
  },
116
119
  };
117
120
  var moveFocus = function (delta) {
118
- var { selected, data } = this.$scope;
121
+ var { selected, data } = $scoped.get(this);
119
122
  var index, targetIndex;
120
123
  var boxCount = this.group;
121
124
  if (delta === 'home') targetIndex = 0;
@@ -127,7 +130,7 @@ var moveFocus = function (delta) {
127
130
  else {
128
131
  index = data.indexOf(selected[selected.length - 1]);
129
132
  var e = this.getLastVisibleElement(0);
130
- if (e) targetIndex = data.indexOf(e.$scope.d);
133
+ if (e) targetIndex = data.indexOf($scoped.get(e).d);
131
134
  else targetIndex = data.length - 1;
132
135
  targetIndex = (targetIndex / boxCount | 0) * boxCount + index % boxCount;
133
136
  if (targetIndex >= data.length) targetIndex = data.length - 1;
@@ -141,13 +144,13 @@ var moveFocus = function (delta) {
141
144
  var f = this.getFirstVisibleElement();
142
145
  var index = data.indexOf(selected[0]);
143
146
  if (!f) targetIndex = 0;
144
- else if (f.$scope.d !== selected[0]) {
145
- targetIndex = index + ((data.indexOf(f.$scope.d) - index) / boxCount | 0) * boxCount;
147
+ else if ($scoped.get(f).d !== selected[0]) {
148
+ targetIndex = index + ((data.indexOf($scoped.get(f).d) - index) / boxCount | 0) * boxCount;
146
149
  }
147
150
  else {
148
151
  var e = this.getLastVisibleElement(0);
149
- var fi = data.indexOf(f.$scope.d);
150
- var ei = data.indexOf(e.$scope.d)
152
+ var fi = data.indexOf($scoped.get(f).d);
153
+ var ei = data.indexOf($scoped.get(e).d);
151
154
  targetIndex = fi - ((ei - fi) / boxCount | 0) * boxCount;
152
155
 
153
156
  }
@@ -194,7 +197,7 @@ var moveFocus = function (delta) {
194
197
  s.selected = false;
195
198
  }
196
199
  var d = data[targetIndex];
197
- if (d) d.selected = true, this.$scope.selected = [d];
200
+ if (d) d.selected = true, $scoped.get(this).selected = [d];
198
201
  this.setFocus(targetIndex);
199
202
  render.refresh();
200
203
  };
@@ -207,7 +210,7 @@ var bindkey = function (lattice) {
207
210
  async function ondrop(event) {
208
211
  event.preventDefault();
209
212
  var files = event.dataTransfer.files;
210
- this.$scope.uploadAll(files);
213
+ $scoped.get(this).uploadAll(files);
211
214
  }
212
215
  function main() {
213
216
  var page = document.createElement('explorer');
@@ -7,7 +7,7 @@ function clickfile(event) {
7
7
  break;
8
8
  }
9
9
  }
10
- this.$eval(`pullFile(m.content[${cx}])`);
10
+ $eval.call(this, `pullFile(m.content[${cx}])`);
11
11
  }
12
12
 
13
13
  function msg(elem, { m }, parentScopes) {
@@ -50,7 +50,7 @@ var dragpage = {
50
50
  moving = null;
51
51
  saved_event = null;
52
52
  if (getTargetIn(a => /^(msg)$/i.test(a.tagName), event.target)) return;
53
- if (!this.$scope.users.length) return;
53
+ if (!$scoped.get(this).users.length) return;
54
54
  saved_event = event;
55
55
  },
56
56
  move(event) {
@@ -91,11 +91,11 @@ var dragpage = {
91
91
  var menuWidth = target.children[1].offsetWidth;
92
92
  target.style.paddingLeft = '';
93
93
  if (moving.deltaX < 0 && left > menuWidth * .1 || moving.deltaX > 0 && left > menuWidth * .9 || !moving.deltaX && left > menuWidth >> 1) {
94
- target.$scope.showList = true;
94
+ $scoped.get(target).showList = true;
95
95
  addClass(target, "showList")
96
96
  }
97
97
  else {
98
- target.$scope.showList = false;
98
+ $scoped.get(target).showList = false;
99
99
  removeClass(target, "showList")
100
100
  }
101
101
  render.refresh();
@@ -110,20 +110,20 @@ function chat(title = '会话窗口') {
110
110
  var users = [];
111
111
  var addToMsgList = function (list, msgs) {
112
112
  list.push.apply(list, msgs);
113
- if (list === page.$scope.msglist) {
113
+ if (list === ps.msglist) {
114
114
  var chat = page.querySelector("chat");
115
115
  var lastmsg = chat.getLastVisibleElement();
116
116
  if (msgs.length && (!lastmsg || lastmsg.offsetTop + lastmsg.offsetHeight === chat.scrollHeight)) {
117
117
  chat.go(list.length ? list.length - 1 : 0);
118
118
  }
119
- if (page.$scope.user) page.$scope.user.msgread = list.length;
119
+ if (ps.user) ps.user.msgread = list.length;
120
120
  }
121
121
  else {
122
- page.$scope.totalunread += msgs.length;
122
+ ps.totalunread += msgs.length;
123
123
  }
124
124
  }
125
125
  page.push = function (msgs) {
126
- var { msglist } = this.$scope;
126
+ var { msglist } = ps;
127
127
  var userMap = null;
128
128
  msgs = msgs.filter(m => {
129
129
  if (!m) return false;
@@ -138,15 +138,15 @@ function chat(title = '会话窗口') {
138
138
  return false;
139
139
  }).map(m => JSAM.parse(encode62.packdecode(m))).filter(m => {
140
140
  if (m.type === 'accept') {
141
- page.$scope.pushFile(m.content);
141
+ ps.pushFile(m.content);
142
142
  return false;
143
143
  }
144
144
  return true;
145
145
  });
146
146
  if (userMap) {
147
147
  userManager(users, userMap);
148
- if (users.indexOf(page.$scope.user) < 0) page.$scope.user = users[0];
149
- if (users.length > 0 && page.$scope.showList === 0) page.$scope.showList = true;
148
+ if (users.indexOf(ps.user) < 0) ps.user = users[0];
149
+ if (users.length > 0 && ps.showList === 0) ps.showList = true;
150
150
  }
151
151
  if (msgs.length) {
152
152
  var msgMap = Object.create(null);
@@ -169,19 +169,19 @@ function chat(title = '会话窗口') {
169
169
  }
170
170
  };
171
171
  page.$renders = [function () {
172
- this.$scope.resize(this.$scope.body);
172
+ ps.resize(ps.body);
173
173
  }];
174
174
  page.localid = localid;
175
175
  Object.defineProperty(page, 'userid', {
176
176
  get() {
177
- var user = this.$scope.user;
177
+ var user = ps.user;
178
178
  if (user) return user.id;
179
179
  }
180
180
  });
181
181
  page.setAttribute('ng-class', "{showList:showList}");
182
182
  var fid = 0;
183
183
  var filesMap = Object.create(null);
184
- renderWithDefaults(page, {
184
+ var ps = {
185
185
  chat: zimoli$list,
186
186
  title,
187
187
  msglist: [],
@@ -271,14 +271,15 @@ function chat(title = '会话窗口') {
271
271
  this.body.lastElementChild.focus();
272
272
  this.text = '';
273
273
  }
274
- });
274
+ };
275
+ renderWithDefaults(page, ps);
275
276
  var headHeight = 0;
276
277
  resizingList.set(page, function () {
277
278
  var height = page.firstElementChild.offsetHeight;
278
279
  if (height !== headHeight) {
279
280
  headHeight = height;
280
281
  css(page.firstElementChild, { marginBottom: fromOffset(-headHeight) });
281
- css(page.$scope.body.firstElementChild, { paddingTop: fromOffset(headHeight) });
282
+ css(ps.body.firstElementChild, { paddingTop: fromOffset(headHeight) });
282
283
  }
283
284
  });
284
285
  moveupon(page, dragpage);