efront 4.29.0 → 4.29.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.
@@ -83,7 +83,7 @@
83
83
  remove(page);
84
84
  } else {
85
85
  user.login({});
86
- go('/main');
86
+ zimoli();
87
87
  }
88
88
  } catch (e) {
89
89
  console.log(e);
@@ -47,6 +47,7 @@ function contextmenu(target, menuItems) {
47
47
  start(event) {
48
48
  if (event.defaultPrevented || event.type === 'mousedown') return;
49
49
  clearTimeout(menuHandle);
50
+ if (tm) remove(tm);
50
51
  menuHandle = setTimeout(function () {
51
52
  var e = createEvent("contextmenu", true);
52
53
  e.clientX = event.clientX;
@@ -77,8 +78,15 @@ function contextmenu(target, menuItems) {
77
78
  if (document.activeElement === this) return;
78
79
  _remove(this);
79
80
  }, 60);
81
+ var lastMenuTime = 0;
80
82
  on("contextmenu")(target, function (event) {
81
83
  if (event.defaultPrevented) return;
84
+ var now = +new Date;
85
+ if (lastMenuTime + 300 > now) {
86
+ event.preventDefault();
87
+ return;
88
+ }
89
+ lastMenuTime = now;
82
90
  event.preventDefault();
83
91
  if (tm) remove(tm), tm = null;
84
92
  tm = showContext(event);
package/coms/zimoli/on.js CHANGED
@@ -491,24 +491,34 @@ var invoke = function (event, type, pointerType) {
491
491
  var onclick = on("click");
492
492
  var onmousedown = on("mousedown");
493
493
  var onmousemove = on("mousemove");
494
- var pointerX, pointerY, lasttime_click;
494
+ var mouseX, mouseY, touchX, touchY, lasttime_click;
495
495
  var needFireClick = false;
496
496
  var isClickWithPointer = false;
497
497
  var touchendFired = false;
498
- function clickstart(event) {
498
+ function clickstart() {
499
499
  needFireClick = true;
500
500
  touchendFired = false;
501
501
  isClickWithPointer = true;
502
502
  onclick.preventClick = false;
503
- pointerX = event.clientX, pointerY = event.clientY;
504
503
  }
505
504
  var dis = (a, b) => a * a + b * b
506
505
  function clickcancel(event) {
507
- if (!event || (event.which || event.touches) && dis(event.clientX - pointerX, event.clientY - pointerY) >= MOVELOCK_DELTA * MOVELOCK_DELTA) {
506
+ if (!event
507
+ || event.touches && dis(event.clientX - touchX, event.clientY - touchY) >= MOVELOCK_DELTA * MOVELOCK_DELTA
508
+ || event.which && dis(event.clientX - mouseX, event.clientY - mouseY) >= MOVELOCK_DELTA * MOVELOCK_DELTA
509
+ ) {
508
510
  onclick.preventClick = true;
509
511
  }
510
512
  }
511
- onmousedown(window, clickstart, true);
513
+ function mousestart(event) {
514
+ clickstart();
515
+ mouseX = event.clientX, mouseY = event.clientY;
516
+ }
517
+ function touchstart(event) {
518
+ clickstart();
519
+ touchX = event.clientX, touchY = event.clientY;
520
+ }
521
+ onmousedown(window, mousestart, true);
512
522
 
513
523
  onmousemove(window, clickcancel, true);
514
524
  if (window.addEventListener) {
@@ -522,7 +532,7 @@ var invoke = function (event, type, pointerType) {
522
532
  return;
523
533
  }
524
534
  extendTouchEvent(event);
525
- clickstart.call(this, event);
535
+ touchstart.call(this, event);
526
536
  }, true);
527
537
  window.addEventListener("touchend", function (event) {
528
538
  if (event.touches.length > 1) return;
@@ -382,11 +382,11 @@ function create(pagepath, args, from, needroles, zimolidata) {
382
382
  _pageback_listener = handler;
383
383
  };
384
384
  var _page = pg.call(state, args, from);
385
- _page.realpath = state.realpath;
386
- _page.basepath = state.basepath;
387
- _page.pagepath = pagepath;
388
385
  if (undefined === args || null === args) args = {};
389
386
  if (_page) {
387
+ _page.realpath = state.realpath;
388
+ _page.basepath = state.basepath;
389
+ _page.pagepath = pagepath;
390
390
  var page_with = _with_elements.splice(_with_length, _with_elements.length - _with_length);
391
391
  if (_page.with && _page.with !== _with_elements) {
392
392
  page_with = page_with.concat(_page.with);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.29.0",
3
+ "version": "4.29.1",
4
4
  "description": "一个开发环境,提供一种自由的前端开发模式,也可作为辅助工具使用。",
5
5
  "main": "public/efront.js",
6
6
  "directories": {
@@ -10,7 +10,7 @@
10
10
  "efront": "public/efront.js"
11
11
  },
12
12
  "scripts": {
13
- "prepack": "node tools/build-efront.js --node --no-target"
13
+ "prepack": "node tools/build-efront.js --node --no-target&node public/efront build 文件系统.html"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",