efront 4.24.2 → 4.24.3

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.
@@ -430,7 +430,7 @@ function create(pagepath, args, from, needroles, zimolidata) {
430
430
  isRecover = isR;
431
431
  addGlobal(this, history_name, isRecover);
432
432
  }
433
- _page.$reload = function () {
433
+ _page.$reload = _page.$reload || _page.reload || function () {
434
434
  var _page = create(pagepath, undefined, from, undefined, zimolidata);
435
435
  _page.mount(history_name, isRecover);
436
436
  return _page;
@@ -891,7 +891,7 @@ zimoli.enableTouchBack = function () {
891
891
  }
892
892
  }, 'x')
893
893
  };
894
- zimoli.reload = function () {
894
+ var reloadFully = function () {
895
895
  for (var k in history) {
896
896
  var h = history[k];
897
897
  if (!h) continue;
@@ -913,6 +913,17 @@ zimoli.reload = function () {
913
913
  current_history = default_history;
914
914
  body = document.body;
915
915
  zimoli();
916
+ }
917
+ var reloadMounted = function () {
918
+ for (var k in global) {
919
+ var o = global[k];
920
+ if (!o || !o.$reload) continue;
921
+ if (isMounted(o)) o.$reload();
922
+ }
923
+ }
924
+ zimoli.reload = function (reloadAll = true) {
925
+ if (!reloadAll) reloadMounted();
926
+ else reloadFully();
916
927
  };
917
928
  zimoli.alert = function () {
918
929
  var ae = alert.apply(this, arguments);
package/docs/main.xht CHANGED
@@ -172,8 +172,10 @@
172
172
  <div1 #content></div1>
173
173
  <open #switch @click="switchMenu()" insert></open>
174
174
  <script>
175
- i18n.setReloader(zimoli.reload);
176
- var menus = [
175
+ i18n.setReloader(function () {
176
+ initMenus();
177
+ });
178
+ var menus = () => [
177
179
  {
178
180
  name: i18n`efront简介`,
179
181
  children: [
@@ -214,12 +216,12 @@
214
216
  }
215
217
  ]);
216
218
  });
217
- var initVersionInfo = async function () {
219
+ var initVersionInfo = async function (menus) {
218
220
  var xhr = await cross("get", "version");
219
221
  var version = xhr.response.split(",");
220
222
  menus[0].name += ` <v>${version[0]}</v>`;
221
223
  };
222
- var initCommandsDocs = async function () {
224
+ var initCommandsDocs = async function (menus) {
223
225
  delete modules['docs$helps'];
224
226
  var helps = await init("docs$helps");
225
227
  var m = {
@@ -244,7 +246,7 @@
244
246
  });
245
247
  menus.splice(1, 0, m);
246
248
  };
247
- var initComponentDocs = async function () {
249
+ var initComponentDocs = async function (menus) {
248
250
  var m = await cross("get", "components");
249
251
  m = JSON.parse(m.response);
250
252
  for (var c of m) {
@@ -280,17 +282,19 @@
280
282
  menus[2].children = m;
281
283
  };
282
284
  var initMenus = async function () {
283
- menus[0].children.forEach(c => { c.path = "/mark/" + c.md });
284
- zimoli.switch('', scope.content, menus[0].children[0].path);
285
- await initVersionInfo();
286
- await initCommandsDocs();
287
- await initComponentDocs();
288
- var route = await init("frame$route");
289
- scope.menus = route.update(menus);
285
+ var ms = menus();
286
+ ms[0].children.forEach(c => { c.path = "/mark/" + c.md });
287
+ zimoli.switch('', scope.content, ms[0].children[0].path);
288
+ await initVersionInfo(ms);
289
+ await initCommandsDocs(ms);
290
+ await initComponentDocs(ms);
291
+ var route = frame$route;
292
+ scope.menus = route;
293
+ route.update(ms);
290
294
  route.open(route.active);
291
295
  };
292
296
  var scope = {
293
- menus,
297
+ menus: [],
294
298
  div2(elem, scope) {
295
299
  if (scope.m.data?.mark) elem.setAttribute("mark", '');
296
300
  if (scope.m.data?.test) elem.setAttribute("test", '');
@@ -326,10 +330,10 @@
326
330
  drag.on(close, window);
327
331
  }
328
332
  render(page, scope);
329
- var s = scrollbar();
333
+ var scrbar = scrollbar();
330
334
  on("mounted")(page, initMenus);
331
- s.bindTarget(scope.content);
332
- page.with = s;
335
+ scrbar.bindTarget(scope.content);
336
+ page.with = scrbar;
333
337
  resizingList.set(page, function () {
334
338
  if (page.adapted === true) return;
335
339
  if (calcPixel(page.offsetWidth) < 720) return;
@@ -338,7 +342,7 @@
338
342
  });
339
343
  bind("render")(page, function () {
340
344
  requestAnimationFrame(function () {
341
- s.reshape();
345
+ scrbar.reshape();
342
346
  })
343
347
  });
344
348
  drag.on(scope.switch);
@@ -66,41 +66,42 @@
66
66
  </div>
67
67
  <script>
68
68
  var position = [.2, .2];
69
- var page = view();
70
- page.innerHTML = template;
71
- once("append")(page, function () {
72
- move.setPosition(this, position);
73
- });
74
- var scope = {
75
- help: null,
76
- dict: helps.topics,
77
- cmds(elem, scope) {
78
- var topics = scope.topics = [];
79
- var cmds = scope.c.split(/\s+/).map(a => a.split("|"));
80
- cmds = combine(...cmds).map(a => "<efront></efront>" + a.join("&ensp;")).join("<br/>");
81
- elem.innerHTML = cmds.replace(/[A-Z]+(\_[A-Z]+)*/g, m => {
82
- if (topics.indexOf(m) < 0) topics.push(m);
83
- return `<w>${m}</w>`;
84
- });
85
- },
86
- topic(elem, s) {
87
- var topics = s.topics.filter(a => scope.dict[a]);
88
- if (!topics.length) return;
89
- elem.innerHTML = i18n`其中,` + topics.map(a => {
90
- var d = scope.dict[a];
91
- var t = i18n`${a}是${d[0]}`;
92
- if (d.length > 1) t += i18n`,可取值有${d.slice(1).join('、')}`;
93
- if (d.default) t += i18n`,默认值是${d.default}`;
94
- return t;
95
- }).join(';');
96
- }
97
- }
98
- drag.on(page, page.firstElementChild);
99
- resize.on(page);
100
- render(page, scope);
101
69
  function main(dict) {
70
+ var page = view();
71
+ var helps = init('docs$helps');
72
+ once("append")(page, function () {
73
+ move.setPosition(this, position);
74
+ });
75
+ var scope = {
76
+ help: null,
77
+ dict: helps.topics,
78
+ cmds(elem, scope) {
79
+ var topics = scope.topics = [];
80
+ var cmds = scope.c.split(/\s+/).map(a => a.split("|"));
81
+ cmds = combine(...cmds).map(a => "<efront></efront>" + a.join("&ensp;")).join("<br/>");
82
+ elem.innerHTML = cmds.replace(/[A-Z]+(\_[A-Z]+)*/g, m => {
83
+ if (topics.indexOf(m) < 0) topics.push(m);
84
+ return `<w>${m}</w>`;
85
+ });
86
+ },
87
+ topic(elem, s) {
88
+ var topics = s.topics.filter(a => scope.dict[a]);
89
+ if (!topics.length) return;
90
+ elem.innerHTML = i18n`其中,` + topics.map(a => {
91
+ var d = scope.dict[a];
92
+ var t = i18n`${a}是${d[0]}`;
93
+ if (d.length > 1) t += i18n`,可取值有${d.slice(1).join('、')}`;
94
+ if (d.default) t += i18n`,默认值是${d.default}`;
95
+ return t;
96
+ }).join(';');
97
+ }
98
+ }
102
99
  var [help] = helps.helps.filter(h => dict === h.info);
103
100
  scope.help = help;
101
+ drag.on(page, page.firstElementChild);
102
+ resize.on(page);
103
+ page.innerHTML = template;
104
+ render(page, scope);
104
105
  return page;
105
106
  }
106
107
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.24.2",
3
+ "version": "4.24.3",
4
4
  "description": "一个开发环境,提供一种自由的前端开发模式,也可作为辅助工具使用。",
5
5
  "main": "public/efront.js",
6
6
  "directories": {