efront 4.21.2 → 4.21.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.
@@ -27,11 +27,6 @@ var {
27
27
  PREVENT_FRAMEWORK_MODE = preventFrame,
28
28
  devicePixelRatio = 1,
29
29
  startPath: efrontPath,
30
- loading_title = {
31
- "en-us": "Loading..",
32
- "en-hk": "Loading..",
33
- "en-ca": "Loading..",
34
- }[navigator.language && navigator.language.toLowerCase()] || '加载中..',
35
30
  pixelDecoder // = d => d / 16 + "rem"
36
31
  } = window;
37
32
  if (PREVENT_FRAMEWORK_MODE !== false) {
@@ -138,8 +133,11 @@ var readFile = function (names, then) {
138
133
 
139
134
  readingCount++;
140
135
  var errorcount = 0;
141
- var ok = function (res) {
142
- responseTree[name] = res;
136
+ var ok = function (text) {
137
+ if (!/\~/.test(name)) {
138
+ "use ./#decrypt_.js";
139
+ }
140
+ responseTree[name] = text;
143
141
  flushTree(loadingTree, key);
144
142
  clearTimeout(flush_to_storage_timer);
145
143
  flush_to_storage_timer = setTimeout(saveResponseTreeToStorage, 200);
@@ -251,6 +249,7 @@ var killCircle = function () {
251
249
  var multiModules = Object.create(null);
252
250
  // -->
253
251
  var hasOwnProperty = {}.hasOwnProperty;
252
+ "use ./#decrypt.js";
254
253
  var loadModule = function (url, then, prebuilds = {}) {
255
254
  var name = url.replace(/[\*~][\s\S]*$/, '');
256
255
  if (/^(?:module|exports|define|import_meta|require|window|global|undefined)$/.test(name)) return then();
@@ -345,11 +344,7 @@ var loadModule = function (url, then, prebuilds = {}) {
345
344
  }
346
345
  };
347
346
  var toRem = text => pixelDecoder && typeof text === 'string' ? text.replace(/(\:\s*)?\b((?:\d*\.)?\d+)px(\s*\))?/ig, (m, h, d, quote) => (h || "") + (d !== '1' ? h && quote ? renderPixelRatio * d + "pt" : pixelDecoder(d) : renderPixelRatio > 1 ? ".78pt" : 0.78 / devicePixelRatio + "pt") + (quote || "")) : text;
348
- "use ./#decrypt.js";
349
347
  var getArgs = function (text, aftfix) {
350
- if (!aftfix || /^\*/.test(aftfix)) {
351
- "use ./#decrypt_.js";
352
- }
353
348
  var args, functionBody;
354
349
  //依赖项名称部分的长度限制为36*36*18=23328
355
350
  var doublecount = parseInt(text.slice(0, 3), 36);
@@ -514,8 +509,6 @@ var createModule = function (exec, originNames, compiledNames, prebuilds = {}) {
514
509
  return exec.apply(_this, args);
515
510
  });
516
511
  };
517
- var loading_count = 0;
518
- var saved_title = document && document.title;
519
512
  var init = function (url, then, prebuilds, keeppage) {
520
513
  // then = bindthen(then);
521
514
  var key = keyprefix + url;
@@ -610,13 +603,7 @@ var init = function (url, then, prebuilds, keeppage) {
610
603
  var report = window.performance || !window.alert ? console.error : window.alert;
611
604
  report(`加载 ${url} 失败,${ed && ed.length ? `${ed.join(', ')} 等 ${ed.length} 个模块` : "没有其他模块"}受到影响。\r\n${track.join("\r\n")}`);
612
605
  };
613
- var loadingid = ++loading_count;
614
- if (document && loading_title !== document.title) {
615
- saved_title = document.title;
616
- document.title = loading_title;
617
- }
618
606
  loadModule(url, function (error) {
619
- if (loadingid === loading_count && document && document.title === loading_title) document.title = saved_title;
620
607
  if (hasOwnProperty.call(modules, url)) {
621
608
  then(modules[url]);
622
609
  return;
@@ -20,7 +20,7 @@
20
20
  <mask></mask>
21
21
  <model -if="!isEmpty(f.key)" :field=f :data=d readonly></model>
22
22
  <template -else>&nbsp;</template>
23
- <a on-click="o.do(d)" -if="isEmpty(f.key)&&f.options&&(!o.when||o.when(d))"
23
+ <a on-click="o.do(d,event)" -if="isEmpty(f.key)&&f.options&&(!o.when||o.when(d))"
24
24
  _type="o.type instanceof Function?o.type(d):o.type" -repeat="o in f.options">
25
25
  <span -text="o.name instanceof Function?o.name(d):o.name"></span>
26
26
  </a>
@@ -136,9 +136,6 @@ function go(pagepath, args, history_name, oldpagepath) {
136
136
  if (realpath.length > 1) var [pgpath, args0] = realpath;
137
137
  else pgpath = pagepath;
138
138
  setZimoliParams(pagepath, { data: args, from: oldpagepath, options, roles, id });
139
- prepare(pgpath, function (res) {
140
- if (!res.roles || res.roles === true) res.roles = !!roles;
141
- });
142
139
  if (!page_generators[pgpath]) {
143
140
  return zimoli(pagepath, args, history_name, oldpagepath);
144
141
  }
@@ -349,36 +346,27 @@ function prepare(pgpath, ok) {
349
346
  }
350
347
  };
351
348
  var emit = function (pg) {
352
- if (pg) {
353
- page_generators[pgpath] = {
354
- pg,
355
- roles,
356
- state,
357
- with: _with_elements,
358
- onback: _pageback_listener,
359
- prepares
360
- };
361
- }
349
+ page_generators[pgpath] = {
350
+ pg,
351
+ roles,
352
+ state,
353
+ with: _with_elements,
354
+ onback: _pageback_listener,
355
+ prepares
356
+ };
362
357
  var res = page_generators[pgpath];
363
358
  var emiters = loading_tree[pgpath];
364
359
  delete loading_tree[pgpath];
365
- if (emiters) {
366
- var noRoles = !res.roles;
367
- if (noRoles && res.roles) {
368
- prepare(user.loginPath, () => emit());
369
- return;
370
- }
371
- while (emiters.length) {
372
- var ok = emiters.shift();
373
- if (isFunction(ok)) {
374
- ok(res);
375
- }
360
+ if (emiters) while (emiters.length) {
361
+ var ok = emiters.shift();
362
+ if (isFunction(ok)) {
363
+ ok(res);
376
364
  }
377
365
  }
366
+
378
367
  };
379
368
  return init(pgpath, function (pg) {
380
- if (!pg) return;
381
- extendIfNeeded(pg, state);
369
+ if (pg) extendIfNeeded(pg, state);
382
370
  if (roles) return prepare(user.loginPath, () => emit(pg));
383
371
  emit(pg);
384
372
  }, state, true);
@@ -402,6 +390,7 @@ function create(pagepath, args, from, needroles) {
402
390
  }
403
391
  return alert(i18n`没有权限!`, 0);
404
392
  }
393
+ if (!pg) return;
405
394
  var _with_length = _with_elements.length;
406
395
  state.onback = function (handler) {
407
396
  _pageback_listener = handler;
@@ -442,7 +431,7 @@ function create(pagepath, args, from, needroles) {
442
431
  var zimoliid = 0, zimoliad = 0;
443
432
  function zimoli(pagepath, args, history_name, oldpagepath) {
444
433
  if (arguments.length === 0) {
445
- if (zimoliid !== zimoliad) return;
434
+ if (zimoliid !== zimoliad && zimoli.caller === go) return;
446
435
  history_name = current_history;
447
436
  var _history = history[history_name] || [];
448
437
  root_path = _history[0] || "/main";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.21.2",
3
+ "version": "4.21.3",
4
4
  "description": "一个开发环境,提供一种自由的前端开发模式,也可作为辅助工具使用。",
5
5
  "main": "public/efront.js",
6
6
  "directories": {