efront 4.23.9 → 4.24.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 (64) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +237 -0
  2. package/apps/pivot/#/345/233/275/351/231/205/345/214/226.yml +2 -0
  3. package/apps/pivot/auth/login.html +2 -1
  4. package/apps/pivot/auth/login.js +1 -0
  5. package/apps/pivot/auth/login.less +1 -0
  6. package/apps/pivot/cert/edit.js +1 -1
  7. package/apps/pivot/cert/list.js +1 -1
  8. package/apps/pivot/cert/main.xht +6 -6
  9. package/apps/pivot/cert/orders.xht +8 -8
  10. package/apps/pivot/cert/update.xht +3 -3
  11. package/apps/pivot/db/config.xht +1 -1
  12. package/apps/pivot/db/edit.xht +2 -2
  13. package/apps/pivot/db/list.xht +4 -4
  14. package/apps/pivot/dht/list.js +4 -4
  15. package/apps/pivot/dict/edit.js +1 -1
  16. package/apps/pivot/dict/list.js +1 -1
  17. package/apps/pivot/home/welcome.html +12 -9
  18. package/apps/pivot/home/welcome.js +3 -3
  19. package/apps/pivot/link/index.js +7 -4
  20. package/apps/pivot/link/list.html +2 -2
  21. package/apps/pivot/link/room.js +2 -2
  22. package/apps/pivot/main.js +2 -0
  23. package/apps/pivot/menu-en.yml +16 -0
  24. package/apps/pivot/proxy/edit.js +1 -1
  25. package/apps/pivot/proxy/list.js +2 -2
  26. package/apps/pivot/share/edit.html +3 -3
  27. package/apps/pivot/share/list.js +3 -3
  28. package/apps/pivot/task/edit.js +1 -1
  29. package/apps/pivot/task/invoke.html +1 -1
  30. package/apps/pivot/task/invoke.js +2 -2
  31. package/apps/pivot/task/list.js +3 -3
  32. package/apps/pivot/task/rsync.html +3 -3
  33. package/apps/pivot/task/rsync.js +1 -1
  34. package/apps/pivot/token/edit.js +1 -1
  35. package/apps/pivot/token/list.js +1 -1
  36. package/apps/pivot/wow/root.js +1 -1
  37. package/apps/pivot//344/270/273/351/241/265.html +1 -1
  38. package/coms/basic/#loader.js +7 -0
  39. package/coms/basic/cross_.js +4 -3
  40. package/coms/basic/i18n-chooser.xht +17 -0
  41. package/coms/basic/i18n-supports.js +30 -0
  42. package/coms/basic/i18n.js +25 -1
  43. package/coms/basic_/Promise.js +21 -18
  44. package/coms/basic_/WeakMap.js +12 -6
  45. package/coms/compile/Program.js +4 -4
  46. package/coms/frame/list.html +1 -1
  47. package/coms/frame/list.js +1 -1
  48. package/coms/frame/route.js +22 -9
  49. package/coms/pivot/left-footer.xht +4 -1
  50. package/coms/zimoli/chooseFile.js +1 -1
  51. package/coms/zimoli/cless.js +2 -2
  52. package/coms/zimoli/createUploadURL.js +1 -1
  53. package/coms/zimoli/field.html +1 -1
  54. package/coms/zimoli/field.js +1 -0
  55. package/coms/zimoli/menuItem.js +3 -1
  56. package/coms/zimoli/render.js +3 -2
  57. package/coms/zimoli/selectList.js +3 -3
  58. package/coms/zimoli/selectListEdit.html +5 -5
  59. package/coms/zimoli/yousure.js +2 -2
  60. package/coms/zimoli/zimoli.js +46 -15
  61. package/docs/main.xht +19 -6
  62. package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +3 -36
  63. package/package.json +1 -1
  64. package/public/efront.js +1 -1
@@ -1,15 +1,15 @@
1
1
  <div head>管理选项</div>
2
2
  <div body>
3
3
  <div>
4
- <input placeholder="搜索或添加" v-model="search" @keydown.enter="add()" /><a @click="add()"
5
- -if="search&&!filtered.hasFullmatch">添加</a>
4
+ <input placeholder="${i18n`搜索或添加`}" v-model="search" @keydown.enter="add()" /><a @click="add()"
5
+ -if="search&&!filtered.hasFullmatch">${i18n`添加`}</a>
6
6
  </div>
7
7
  <div class="item" -repeat="o in (search?filtered:options)">
8
8
  <span -html=o.name||o.innerHTML></span>
9
- <a type="danger" @click="del(o)">删除</a>
9
+ <a type="danger" @click="del(o)">${i18n`删除`}</a>
10
10
  </div>
11
11
  </div>
12
12
  <div foot>
13
- <btn @click="save()">确定</btn>
14
- <btn type="white" @click="remove()">取消</btn>
13
+ <btn @click="save()">${i18n`确定`}</btn>
14
+ <btn type="white" @click="remove()">${i18n`取消`}</btn>
15
15
  </div>
@@ -2,8 +2,8 @@
2
2
  /**
3
3
  * 确定就继续,取消就中断
4
4
  */
5
- function yousure(title = "您确定要这么做吗?", content = "当前操作需要您再次确认") {
6
- var options = [button("确定(Y)"), button("取消(N)", "white")];
5
+ function yousure(title = i18n`您确定要这么做吗?`, content = i18n`当前操作需要您再次确认`) {
6
+ var options = [button(i18n`确定` + "(Y)"), button(i18n`取消` + "(N)", "white")];
7
7
  options[0].tabindex = -1;
8
8
  options[1].tabindex = -1;
9
9
  var changeFocus = function (event) {
@@ -128,7 +128,6 @@ function go(pagepath, args, history_name, oldpagepath) {
128
128
  return zimoli(pagepath, args, history_name, oldpagepath);
129
129
  }
130
130
  var page = create(pagepath, args, oldpagepath, roles, params, history_name);
131
- if (!page) return;
132
131
  zimoliad = zimoliid;
133
132
  var isRecover = pushstate(pagepath, history_name, oldpagepath);
134
133
  if (isNode(history_name)) {
@@ -137,7 +136,11 @@ function go(pagepath, args, history_name, oldpagepath) {
137
136
  history_name.activate = pgpath;
138
137
  history_name.activateNode = page;
139
138
  }
140
- else if (isString(pgpath)) {
139
+ if (!page) {
140
+ addGlobal(null, history_name, isRecover);
141
+ return;
142
+ }
143
+ if (isString(pgpath)) {
141
144
  page.disptch();
142
145
  }
143
146
  if (isRecover) setWithStyle(page, false);
@@ -152,6 +155,7 @@ var page_generators = {};
152
155
  */
153
156
  var loading_tree = {};
154
157
  var pathmaped = Object.create(null);
158
+ var realmaped = Object.create(null);
155
159
  var getpgpath = function (pagepath) {
156
160
  pagepath = /^[@#!]/.test(pagepath) ? pagepath.slice(1) : pagepath;
157
161
  if (pagepath === 'main') pagepath = modules.efrontPath || "/main";
@@ -167,8 +171,10 @@ var getpgpath = function (pagepath) {
167
171
  for (var m of mparams) argobj[m] = params.pop();
168
172
  if (params.length) argobj[m] += "/" + params.reverse().join("/");
169
173
  }
174
+ pagepath = realmaped[pagepath] || pagepath;
170
175
  return [pagepath, argobj];
171
176
  }
177
+ pagepath = realmaped[pagepath] || pagepath;
172
178
  return [pagepath];
173
179
  };
174
180
  function createState(pgpath) {
@@ -480,12 +486,19 @@ var history = {};
480
486
  var current_history, default_history = current_history = "";
481
487
  history[current_history] = createEmptyHistory('/main', false);
482
488
  var history_session_object_key = `紫茉莉:${location_pathname}`;
483
- try {
484
- history = JSAM.parse(historyStorage.getItem(history_session_object_key)) || history;
485
- } catch (e) {
486
- }
489
+ var setStorage = function (storage) {
490
+ historyStorage = storage;
491
+ try {
492
+ var history1 = JSAM.parse(historyStorage.getItem(history_session_object_key));
493
+ if (history1 && history1.wlength === window_history.length) history = history1;
494
+ else savestate();
495
+ } catch (e) {
496
+ }
497
+ };
498
+ setStorage(historyStorage);
487
499
  var root_path;
488
500
  var savestate = function () {
501
+ history.wlength = window_history.length;
489
502
  historyStorage.setItem(history_session_object_key, JSAM.stringify(history) || null);
490
503
  };
491
504
  var pushstate = function (path_name, history_name) {
@@ -673,7 +686,7 @@ function addGlobal(element, name = null, isBack) {
673
686
  if (oldElement) {
674
687
  var oldPrev = oldElement.previousSibling, oldPare = oldElement.parentNode;
675
688
  remove(oldElement);
676
- oldElement = oldPrev || oldPare.firstChild;
689
+ oldElement = oldPrev || oldPare?.firstChild;
677
690
  }
678
691
  if (isBack || !oldElement) appendChild.insert(body, element);
679
692
  else appendChild.after(oldElement, element);
@@ -752,20 +765,15 @@ remove.transition = transition;
752
765
  zimoli.prepare = prepare;
753
766
  var upwith = [];
754
767
  zimoli.upwith = popup.upwith(upwith);
755
- zimoli.setStorage = function (storage) {
756
- historyStorage = storage;
757
- try {
758
- history = JSAM.parse(historyStorage.getItem(history_session_object_key)) || history;
759
- } catch (e) {
760
- }
761
- };
762
- zimoli.register = function (pathlike) {
768
+ zimoli.setStorage = setStorage;
769
+ zimoli.register = function (pathlike, realpath) {
763
770
  var params = [];
764
771
  pathlike = pathlike.replace(/\/\:([^\/\:\-]+)/g, function (_, id) {
765
772
  params.push(id);
766
773
  return '';
767
774
  });
768
775
  pathmaped[pathlike] = params;
776
+ if (realpath) realmaped[pathlike] = realpath;
769
777
  };
770
778
  zimoli.clearHistory = function () {
771
779
  historyStorage.removeItem(history_session_object_key);
@@ -883,6 +891,29 @@ zimoli.enableTouchBack = function () {
883
891
  }
884
892
  }, 'x')
885
893
  };
894
+ zimoli.reload = function () {
895
+ for (var k in history) {
896
+ var h = history[k];
897
+ if (!h) continue;
898
+ if (h instanceof Array) h.forEach(a => {
899
+ [a] = getpgpath(a);
900
+ delete modules[a];
901
+ delete page_generators[a];
902
+ })
903
+ var g = global[k];
904
+ if (g) remove(g);
905
+ delete global[k];
906
+
907
+ }
908
+ var loginpath = user.loginPath;
909
+ if (loginpath) {
910
+ delete modules[loginpath];
911
+ delete page_generators[loginpath];
912
+ }
913
+ current_history = default_history;
914
+ body = document.body;
915
+ zimoli();
916
+ };
886
917
  zimoli.alert = function () {
887
918
  var ae = alert.apply(this, arguments);
888
919
  zimoli.upwith(ae.parentNode);
package/docs/main.xht CHANGED
@@ -154,22 +154,33 @@
154
154
  padding: 0px !important;
155
155
  }
156
156
  }
157
+
158
+ &>menu {
159
+ >i18n-chooser {
160
+ display: block;
161
+ z-index: 2;
162
+ position: relative;
163
+ background: inherit;
164
+ }
165
+ }
157
166
  </style>
158
167
 
159
168
  <menu #mulu open@="menued" inline -src="m in menus" @active="openMenu(m)">
169
+ <i18n-chooser insert></i18n-chooser>
160
170
  <div2></div2>
161
171
  </menu>
162
172
  <div1 #content></div1>
163
173
  <open #switch @click="switchMenu()" insert></open>
164
174
  <script>
175
+ i18n.setReloader(zimoli.reload);
165
176
  var menus = [
166
177
  {
167
178
  name: i18n`efront简介`,
168
179
  children: [
169
- { name: i18n`使用说明`, md: i18n`readme.md` },
170
- { name: i18n`兼容性说明`, md: i18n`coms/basic_/readme.md` },
171
- { name: i18n`版本说明`, md: i18n`docs/版本说明.md` },
172
- { name: i18n`与前端框架对比`, md: i18n`docs/compare.md` },
180
+ { name: i18n`使用说明`, id: 'readme', md: i18n`readme.md` },
181
+ { name: i18n`兼容性说明`, id: 'adaption', md: i18n`coms/basic_/readme.md` },
182
+ { name: i18n`版本说明`, id: 'version', md: i18n`docs/版本说明.md` },
183
+ { name: i18n`与前端框架对比`, id: 'compare', md: i18n`docs/compare.md` },
173
184
  // { name: i18n`notive`, md: "docs/notive.md" },
174
185
  ]
175
186
  },
@@ -209,6 +220,7 @@
209
220
  menus[0].name += ` <v>${version[0]}</v>`;
210
221
  };
211
222
  var initCommandsDocs = async function () {
223
+ delete modules['docs$helps'];
212
224
  var helps = await init("docs$helps");
213
225
  var m = {
214
226
  name: i18n`命令参考`,
@@ -225,6 +237,7 @@
225
237
  a.children = helps.helps.filter(h => h.type === a.a);
226
238
  a.children.forEach(c => {
227
239
  c.name = c.info;
240
+ c.id = c.cmds[0];
228
241
  c.path = `/命令/${c.name}`;
229
242
  });
230
243
  a.closed = true;
@@ -274,8 +287,7 @@
274
287
  await initComponentDocs();
275
288
  var route = await init("frame$route");
276
289
  scope.menus = route.update(menus);
277
- zimoli();
278
- render.refresh();
290
+ route.open(route.active);
279
291
  };
280
292
  var scope = {
281
293
  menus,
@@ -286,6 +298,7 @@
286
298
  },
287
299
  grid,
288
300
  menu,
301
+ i18nChooser,
289
302
  menued: false,
290
303
  switchMenu() {
291
304
  scope.menued = !scope.menued;
@@ -371,47 +371,14 @@
371
371
  // "庄,庄": ["za", "Zhuang, Chuang"],
372
372
  // 祖鲁语: ["zu", "Zulu"]
373
373
  // };
374
- var supports = [
375
- { name: `汉语`/*中文简体*/, id: "zh", lang: "zh-CN" },
376
- { name: `漢語`/*中文繁体*/, id: "cht", lang: "zh-TW" },
377
- { name: `English`/*英文*/, id: "en", lang: "en" },
378
- // { name: i18n`文言文`, id: "wyw" },
379
- // { name: i18n`粤语`, id: "yue" },
380
- { name: `日本語`/*日语*/, id: "jp", lang: "ja" },
381
- { name: `Français`/*法语*/, id: "fra", lang: 'fr' },
382
- { name: `Русский язык`/*俄语*/, id: "ru", lang: 'ru' },
383
- { name: `한국어`/*韩语*/, id: "kor", lang: "ko" },
384
- { name: `Deutsch`/*德语*/, id: "de", lang: "de" },
385
- { name: `Italiano`/*意大利语*/, id: "it", lang: 'it' },
386
- { name: `ภาษาไทย`/*泰语*/, id: "th", lang: "th" },
387
- { name: `Tiếng Việt`/*越南语*/, id: "vie", lang: 'vi' },
388
- { name: `بالعربية`/*阿拉伯语*/, id: "ara", lang: "ar" },
389
- { name: `Nederlands`/*荷兰语*/, id: "nl", lang: "nl" },
390
- { name: `suomi`/*芬兰语*/, id: "fin", lang: "fi" },
391
- { name: `Ελληνικά`/*希腊语*/, id: "el", lang: "el" },
392
- { name: `Español`/*西班牙语*/, id: "spa", lang: "es" },
393
- { name: `Português`/*葡萄牙语*/, id: "pt", lang: /pt\-(BR|PT)/ },
394
- { name: `Húngaro`/*匈牙利语*/, id: "hu", lang: 'hu' },
395
- { name: `Svenska`/*瑞典语*/, id: "swe", lang: 'sv' },
396
- { name: `Dansk`/*丹麦语*/, id: "dan", lang: 'da' },
397
- { name: `Čeština`/*捷克语*/, id: "cs", lang: 'cs' },
398
- { name: `Polski`/*波兰语*/, id: "pl" },
399
- { name: `Български`/*保加利亚语*/, id: "bul", lang: "bg" },
400
- { name: `Eesti keel`/*爱沙尼亚语*/, id: "est", lang: 'et' },
401
- { name: `Română`/*罗马尼亚语*/, id: "rom", lang: 'ro' },
402
- { name: `slovenski jezik`/*斯洛文尼亚语*/, id: "slo", lang: 'sl' },
403
- ];
404
- supports.forEach(s => s.key = s.id);
374
+ var supports = i18nSupports;
405
375
  var getAllText = function (data, f) {
406
376
  try {
407
377
  if (/^\s*(\<\!--[\s\S]*?--\>\s*)*<!doctype\s/i.test(data)) return [];
408
- if (/\.(xht|vue)$/i.test(f.name)) {
378
+ if (/\.(xht|html?|jsp|asp|php|vue)$/i.test(f.name)) {
409
379
  var { scripts, innerHTML, outerHTML: htmltext = innerHTML, attributes = '', tagName, styles } = compile$scanner2(data, 'html').scoped;
410
380
  data = compile$wraphtml(htmltext) + ";\r\n" + scripts.join("\r\n");
411
381
  }
412
- else if (/\.html?$/i.test(f.name)) {
413
- data = compile$wraphtml(data);
414
- }
415
382
  var code = compile$scanner2(String(data));
416
383
  return compile$translate.getI18nPrefixed(code);
417
384
  }
@@ -598,7 +565,7 @@
598
565
  }
599
566
  else {
600
567
  if (/^[\.]|^node_modules|_test\.js$/i.test(name)) continue;
601
- if (e.kind === "file" && !/\.([mc]?[tj]sx?|xht|vue|html?)$/i.test(name)) continue;
568
+ if (e.kind === "file" && !/\.([mc]?[tj]sx?|xht|html?|jsp|asp|php|vue)$/i.test(name)) continue;
602
569
  }
603
570
  e.path = path + e.name;
604
571
  if (e.kind === 'directory') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.23.9",
3
+ "version": "4.24.0",
4
4
  "description": "一个开发环境,提供一种自由的前端开发模式,也可作为辅助工具使用。",
5
5
  "main": "public/efront.js",
6
6
  "directories": {