efront 3.35.7 → 3.35.9

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.
@@ -85,8 +85,8 @@ var parse干支 = function (a) {
85
85
  };
86
86
  var compare = function (a, b) {
87
87
  for (var cx1 = a.length - 1, cx2 = b.length - 1; cx1 >= 0 && cx2 >= 0; cx1--, cx2--) {
88
- while (/\s\u00a0/.test(a[cx1])) cx1--;
89
- while (/\s\u00a0/.test(b[cx2])) cx2--;
88
+ while (/[\s\u00a0]/.test(a[cx1])) cx1--;
89
+ while (/[\s\u00a0]/.test(b[cx2])) cx2--;
90
90
  if (a[cx1] !== b[cx2] || a[cx1] in map子丑寅 || a[cx1] in map上中下 || a[cx1] in map一二三 || a in power || /^\d$/.test(a[cx1])) break;
91
91
  }
92
92
  a = a.slice(0, cx1 + 1);
@@ -5,6 +5,7 @@ a: if (!setPrototypeOf) {
5
5
  var getOwnPropertyNames = Object.getOwnPropertyNames;
6
6
  var defineProperty = Object.defineProperty;
7
7
  try {
8
+ if (!getOwnPropertyNames) throw '不支持';
8
9
  defineProperty({}, 'o', { value: 0 });
9
10
  setPrototypeOf = function (obj, proto) {
10
11
  for (var n of getOwnPropertyNames(proto)) {
package/coms/kugou/api.js CHANGED
@@ -3,7 +3,7 @@
3
3
  "song-info;hash": "get app/i/getSongInfo.php?cmd=playInfo&from=mkugou",
4
4
  "slider-src": "get:[].mod-slider>.swipe-wrap>div .#src=img!src&href=a!href",
5
5
  "songs-list": "get:[].panel-songslist%20li .#hash=!id&.panel-songs-item-name>span!innerText",
6
- "songs-list": "get:[]div+.m_cm_item1warp>div .#=a!href\\song-mix&a+a>p:first-child!innerText&singer=a+a>p+p!innerText&imgurl=img!_src",
6
+ "songs-list": "get:[]div:first-child+.m_cm_item1warp>div .#=a!href\\song-mix&a+a>p:first-child!innerText&singer=a+a>p+p!innerText&imgurl=img!_src",
7
7
  "song-mix;": "mget:script+script mixsong/:hashid.html",
8
8
  "rank-list": "get:[].panel-img-list%20li rank/list#href=a!href&=a!href\\rank-info&imgurl=img!_src&name=p|innerText",
9
9
  "rank-info": "get:[].panel-songslist%20li rank/info/:id#src=!id&name=.panel-songs-item-name|innerText&data=.panel-songs-item-download/innerText",
@@ -43,8 +43,10 @@ function bindtouch(target, bindder, lockDirection = false) {
43
43
  var pos = move.call(this, null, event);
44
44
  if (isObject(pos)) {
45
45
  var { x = 0, y = 0 } = pos;
46
- if (isFunction(move)) {
47
- var { x: x1, y: y1 } = move.call(this, { x: x + deltax, y: y + deltay, deltax, deltay }, event);
46
+ a: if (isFunction(move)) {
47
+ pos = move.call(this, { x: x + deltax, y: y + deltay, deltax, deltay }, event);
48
+ if (!pos) break a;
49
+ var { x: x1, y: y1 } = pos;
48
50
  if (x1 !== x) saved_x += x1 - x;
49
51
  if (y1 !== y) saved_y += y1 - y;
50
52
  }
@@ -651,7 +651,7 @@ function list() {
651
651
  if (c.nodeType === 1 && c.$comment && isFinite(c.$comment.index)) return true;
652
652
  return false;
653
653
  });
654
- if (src && old) children = children.filter(c => src[c.index] !== old[c.index]);
654
+ if (src && old) children = Array.prototype.filter.call(children, c => src[c.index] !== old[c.index]);
655
655
  remove(children);
656
656
  };
657
657
 
package/coms/zimoli/on.js CHANGED
@@ -459,37 +459,35 @@ var invoke = function (event, type, pointerType) {
459
459
  var onclick = on("click");
460
460
  var onmousedown = on("mousedown");
461
461
  var onmousemove = on("mousemove");
462
- var mouse_x, mouse_y, lasttime_click;
462
+ var pointerX, pointerY, lasttime_click;
463
463
  var needFireClick = false;
464
464
  var isClickWithPointer = false;
465
465
  var touchendFired = false;
466
- function clickstart() {
466
+ function clickstart(event) {
467
467
  needFireClick = true;
468
468
  touchendFired = false;
469
469
  isClickWithPointer = true;
470
470
  onclick.preventClick = false;
471
+ pointerX = event.clientX, pointerY = event.clientY;
471
472
  }
472
473
  var abs = Math.abs;
473
- function clickcancel() {
474
- onclick.preventClick = true;
474
+ function clickcancel(event) {
475
+ if (!event || abs(event.clientX - pointerX) >= MOVELOCK_DELTA || abs(event.clientY - pointerY) >= MOVELOCK_DELTA) onclick.preventClick = true;
475
476
  }
476
- onmousedown(window, function (event) {
477
- lasttime_click = event.timeStamp;
478
- mouse_x = event.clientX, mouse_y = event.clientY;
479
- clickstart.call(this, event);
480
- });
477
+ onmousedown(window, clickstart);
481
478
 
482
- onmousemove(window, function (event) {
483
- if (abs(event.clientX - mouse_x) >= MOVELOCK_DELTA || abs(event.clientY - mouse_y) >= MOVELOCK_DELTA)
484
- clickcancel.call(this, event);
485
- });
479
+ onmousemove(window, clickcancel);
486
480
  if (window.addEventListener) {
487
- window.addEventListener("touchmove", clickcancel, true);
481
+ window.addEventListener("touchmove", function (event) {
482
+ extendTouchEvent(event);
483
+ clickcancel.call(this, event);
484
+ }, true);
488
485
  window.addEventListener("touchstart", function (event) {
489
486
  if (event.touches.length > 1) {
490
487
  clickcancel();
491
488
  return;
492
489
  }
490
+ extendTouchEvent(event);
493
491
  clickstart.call(this, event);
494
492
  }, true);
495
493
  window.addEventListener("touchend", function (event) {
@@ -105,7 +105,7 @@ var transitionKey = css.transformNodeKey("transition");
105
105
 
106
106
  function transition(target, _isLeave, _initialStyle) {
107
107
  if (!target) return;
108
- if ((isObject(isLeave) || typeof isLeave === "string") && (isFinite(_initialStyle) || !_initialStyle)) {
108
+ if ((isObject(_isLeave) || typeof _isLeave === "string") && (isFinite(_initialStyle) || !_initialStyle)) {
109
109
  var temp = _initialStyle;
110
110
  _initialStyle = _isLeave;
111
111
  _isLeave = temp;
@@ -138,9 +138,6 @@ function transition(target, _isLeave, _initialStyle) {
138
138
  var { recoverStyle, transitionTimerStart, transitionTimerEnd, captureStyle } = target;
139
139
  clearTimeout(transitionTimerStart);
140
140
  clearTimeout(transitionTimerEnd);
141
- if (isString(initialStyle)) {
142
- initialStyle = parseKV(initialStyle, ";", ":");
143
- }
144
141
  var transitionDuration = 100;
145
142
  if (!initialStyle[transitionKey]) {
146
143
  initialStyle[transitionKey] = "all .3s ease";
@@ -189,7 +186,7 @@ function transition(target, _isLeave, _initialStyle) {
189
186
  transitionTimerEnd = setTimeout(function () {
190
187
  if (transitionKey) target.style[transitionKey] = recoverStyle[transitionKey];
191
188
  extend(target.style, recoverStyle);
192
- }, transitionDuration + 2);
189
+ }, transitionDuration + 29);
193
190
  } else {
194
191
  extend(target.style, initialStyle);
195
192
  if (transitionKey) target.style[transitionKey] = "none";
@@ -46,7 +46,7 @@ function tree() {
46
46
  var changed_index, changed_offset;
47
47
  var saved_top, saved_offset, timer = 0, timeout = function (call, time) {
48
48
  clearTimeout(timer);
49
- timer = setTimeout(call, time + 100);
49
+ timer = setTimeout(call, time);
50
50
  };
51
51
  var banner = list(element, function (index) {
52
52
  var coms = dom;
@@ -492,7 +492,7 @@ try {
492
492
  } catch (e) {
493
493
  }
494
494
  var root_path;
495
- var pushstate = function (path_name, history_name, oldpagepath) {
495
+ var pushstate = function (path_name, history_name) {
496
496
  var isDestroy = false;
497
497
  if (history_name === undefined) {
498
498
  history_name = current_history;
@@ -502,10 +502,6 @@ var pushstate = function (path_name, history_name, oldpagepath) {
502
502
  history[history_name] = [path_name];
503
503
  } else {
504
504
  var _history = history[history_name];
505
- if (oldpagepath && [].indexOf.call(_history, oldpagepath, 0) < 0) {
506
- _history.splice(root_path === _history[0], _history.length);
507
- isDestroy = true;
508
- }
509
505
  for (var cx = 0, dx = _history.length; cx < dx; cx++) {
510
506
  if (_history[cx] === path_name) {
511
507
  _history.splice(cx, dx - cx);
@@ -746,7 +742,7 @@ zimoli.enableTouchBack = function () {
746
742
  end() {
747
743
  if (ratio === null || !touchTarget) return;
748
744
  if (deltaX > 0 && ratio > .1 || deltaX < 0 && ratio > .9 || deltaX === 0 && ratio > .4) {
749
- pushstate(historyList[historyList.length - 2]);
745
+ pushstate(historyList[historyList.length - 2], history_name);
750
746
  remove(currentTarget);
751
747
  transition(touchTarget, 1);
752
748
  global[history_name] = touchTarget;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.35.7",
3
+ "version": "3.35.9",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {
@@ -18,10 +18,7 @@
18
18
  "url": "https://github.com/yunxu1019/efront.git"
19
19
  },
20
20
  "keywords": [
21
- "efront",
22
- "前端",
23
- "server",
24
- "webpack"
21
+ "efront"
25
22
  ],
26
23
  "author": "yunxu1019",
27
24
  "license": "MIT"