efront 3.35.6 → 3.35.8

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.
@@ -1,5 +1,5 @@
1
1
  var page = document.createElement("page");
2
- page.initialStyle = 'transform:scale(.9);opacity:0;';
2
+ page.initialStyle = 'transform:scale(1.1);opacity:0;';
3
3
  var tags = "新歌:song/list:音乐总有新玩法,排行:rank/list:排行榜 - 酷狗音乐,歌单:plist/list:歌单 - 酷狗音乐,歌手:singer/keywords:歌手分类 - 酷狗音乐".split(",").map(function (tag, cx) {
4
4
  var [str, url, title] = tag.split(":");
5
5
  var label = {
@@ -4,5 +4,6 @@ data.getApi("kuwo-token").then(function (api) {
4
4
  if (!token) cross("get", api.base);
5
5
  });
6
6
  zimoli.switch("", null, "/home");
7
+ zimoli.enableTouchBack();
7
8
  css("body", "background-color:#323336;");
8
9
  zimoli();
@@ -36,6 +36,7 @@ var fields = refilm`
36
36
  if (p) p = ":" + p;
37
37
  try {
38
38
  var ip = data.ip;
39
+ if (!ip) return;
39
40
  if (/^::ffff:\d+\.\d+\.\d+\.\d+$/i.test(ip)) {
40
41
  ip = ip.slice(7);
41
42
  }
@@ -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",
@@ -11,7 +11,7 @@
11
11
  "plist-index": "get:[].panel-img-list%20li plist/index#href=a!href&=a!href\\plist-info&imgurl=img!_src&name=.panel-img-content-first|innerText&count=.panel-img-content-sub|innerText",
12
12
  "plist-info": "mget:[].panel-songslist%20li plist/list/:id/#name=.panel-songs-item-name|innerText&data=.panel-songs-item-download/innerText",
13
13
  "search-hot": "get api/v3/search/hot?format=json&plat=0&count=30",
14
- "singer-class": "get:[].bd%20li singer/class#href=a!href&=a!href\\singer-list&name=a|innerText&group=?parentNode",
14
+ "singer-class": "get:[].bd%20.tab singer/list#href=!href&=!href\\singer-list&name=|innerText&group=?parentNode",
15
15
  "singer-list": "get:[].singer-img-list>li singer/list/:id#href=a!href&=a!href\\singer-info0&imgurl=img!_src&name=p|innerText",
16
16
  "singer-info0": "mget:[].singer-songs-list>li singer/info/:id#hash=!id&singer=.singer-name|innerText&name=.song-name|innerText&data=em/innerText"
17
17
  },
@@ -23,11 +23,12 @@ function Main(dataid, datapath, titleid) {
23
23
  datas: []
24
24
  });
25
25
  bindScroll(_titlebar, page);
26
- var loadedId;
26
+ var loadedId, requested = false;
27
27
  function main(params) {
28
28
  var { _text, title = "", name = _text || title, id } = params;
29
- if (loadedId !== id) {
29
+ if (!requested || loadedId !== id) {
30
30
  loadedId = id;
31
+ requested = true;
31
32
  var ranklist = data.from(dataid, {
32
33
  id
33
34
  }, parseSongsList);
@@ -6,6 +6,7 @@
6
6
  bottom: -60px;
7
7
  top: 0;
8
8
  height: auto;
9
+ background: #323336;
9
10
  }
10
11
  &+.titlebar>back{
11
12
  height: 44px;
@@ -14,7 +14,7 @@ var change = async function (data) {
14
14
  }
15
15
  zimoli.global(data, this);
16
16
  }
17
- else zimoli.go(data, this.params, this);
17
+ else if (isString(data) || +data < 0) zimoli.go(data, this.params, this);
18
18
  };
19
19
  var gosrc = function () {
20
20
  var { src } = this;
@@ -181,4 +181,7 @@ var css = function (target, oStyle, oValue) {
181
181
  }
182
182
  }
183
183
  else if (isString(target)) cssTargetSelector(target, oStyle, oValue);
184
- };
184
+ };
185
+ css.transformCssKey = transformCssKey;
186
+ css.transformNodeKey = transformNodeKey;
187
+ css.transformValue = transformValue;
@@ -300,7 +300,6 @@ function parseConfig(api) {
300
300
  p = p.slice(1);
301
301
  if (!required[p] && p !== ':') {
302
302
  required.push(p);
303
- required[p] = p;
304
303
  }
305
304
  });
306
305
  return {
@@ -502,7 +501,7 @@ var privates = {
502
501
  if (!required.length && !prepared.length && !autotrim) return params;
503
502
  var params1 = {};
504
503
  required.forEach(k => {
505
- var v = seekResponse(params, required[k]);
504
+ var v = seekResponse(params, required[k] || k);
506
505
  params1[k] = v;
507
506
  });
508
507
  prepared.forEach(k => {
@@ -528,6 +527,7 @@ var privates = {
528
527
  var lacks = required;
529
528
  if (params) {
530
529
  lacks = lacks.filter(k => {
530
+ if (!required[k]) return false;
531
531
  var v = seekResponse(params, required[k]);
532
532
  if (isEmpty(v)) return true;
533
533
  });
@@ -197,7 +197,8 @@ function ylist(container, generator, $Y) {
197
197
  }
198
198
  var indexed_item = getIndexedElement(index) || bottom_item;
199
199
  if (indexed_item) {
200
- list.scrollTop = -getFirstElement(1).offsetTop + indexed_item.offsetTop + indexed_item.offsetHeight * ratio;
200
+ var firstElement = getFirstElement(1) || indexed_item;
201
+ list.scrollTop = -firstElement.offsetTop + indexed_item.offsetTop + indexed_item.offsetHeight * ratio;
201
202
  }
202
203
  };
203
204
  //计算当前高度
@@ -615,9 +616,13 @@ function list() {
615
616
  generator = function () { }
616
617
  }
617
618
  }
618
- if (bindSrc === true) care(container, function () {
619
+ var savedSrc = [];
620
+ if (bindSrc === true) care(container, function (src, old) {
619
621
  var index = container.index();
620
- container.clean();
622
+ if (src !== old) container.clean(), index = 0;
623
+ else container.clean(src, savedSrc);
624
+ savedSrc = src.slice();
625
+ if (index > 0 && index >= src.length) index = src.length - 1;
621
626
  container.go(index || 0);
622
627
  });
623
628
 
@@ -639,13 +644,14 @@ function list() {
639
644
  } else if (bindSrc === true) {
640
645
  container.go(container.index() || 0);
641
646
  }
642
- list.clean = function () {
647
+ list.clean = function (src, old) {
643
648
  var children = (container || list).childNodes;
644
649
  children = Array.prototype.filter.call(children, c => {
645
650
  if (isFinite(c.index)) return true;
646
651
  if (c.nodeType === 1 && c.$comment && isFinite(c.$comment.index)) return true;
647
652
  return false;
648
653
  });
654
+ if (src && old) children = Array.prototype.filter.call(children, c => src[c.index] !== old[c.index]);
649
655
  remove(children);
650
656
  };
651
657
 
@@ -472,8 +472,10 @@ function table(elem) {
472
472
  if (_vbox) _vbox(), _vbox = null;
473
473
  watch(table, {
474
474
  find(text) {
475
- $scope.data.searchText = text;
476
- $scope.data.update();
475
+ if ($scope.data.constructor === Table){
476
+ $scope.data.searchText = text;
477
+ $scope.data.update();
478
+ }
477
479
  }
478
480
  })
479
481
  thead = null;
@@ -1,96 +1,218 @@
1
- var transitionKey = 'transition';
2
- var bodyStyle = document.documentElement.style;
3
- if (!(transitionKey in bodyStyle)) {
4
- if ('mozTransition' in bodyStyle) transitionKey = 'mozTransition';
5
- else if ('webkitTransition' in bodyStyle) {
6
- transitionKey = 'webkitTransition';
7
- }
8
- else if ('msTransition' in bodyStyle) {
9
- transitionKey = 'msTransition';
10
- } else {
11
- transitionKey = '';
1
+ function 颜色帧(c1, c2, point) {
2
+ c1 = color.parse(c1);
3
+ c2 = color.parse(c2);
4
+ var hsl1 = color.rgb2hsl(c1);
5
+ var hsl2 = color.rgb2hsl(c2);
6
+ var h = 浮点帧(hsl1[0], hsl2[0], point);
7
+ var s = 浮点帧(hsl1[1], hsl2[1], point);
8
+ var l = 浮点帧(hsl1[2], hsl2[2], point);
9
+ var rgb = color.hsl2rgb([h, s, l]);
10
+ if (c1.length > 3) {
11
+ var a = 浮点帧(c1[3], c2[3], point);
12
+ rgb.push(a);
12
13
  }
14
+ return color.stringify(rgb);
13
15
  }
14
- function transition(target, isLeave, _initialStyle = target.initialStyle || target.enterStyle || target.leavingStyle || target.leaveStyle) {
15
- if (!target) return;
16
- if (typeof isLeave === "string") {
17
- isLeave = parseKV(isLeave, ';', ":");
16
+ function 浮点帧(f1, f2, point) {
17
+ return f1 * point + f2 * (1 - point);
18
+ }
19
+ function 参数帧(a1, a2, point) {
20
+ return a1.map((a, i) => {
21
+ return 单位帧(a.trim(), (a2[i] || '0').trim(), point);
22
+ });
23
+ }
24
+ function 函数帧(p1, p2, point) {
25
+ var r = /([^\(\)]+?)\(([^\)]*)\)/g;
26
+ var o2 = Object.create(null);
27
+ p2.replace(r, function (_, n, p) {
28
+ o2[n] = p;
29
+ });
30
+ return p1.replace(r, function (_, n, p) {
31
+ var v = o2[n];
32
+ if (!v) {
33
+ switch (n) {
34
+ case 'translate':
35
+ v = '0,0';
36
+ break;
37
+ case "scale":
38
+ v = '1,1';
39
+ break;
40
+ default:
41
+ v = '1,0,0,0,1,0';
42
+ }
43
+ }
44
+ return `${n}(${参数帧(p.split(','), v.split(','), point).join(',')})`;
45
+ });
46
+ }
47
+ var targetWidth = innerWidth;
48
+ var unitFloatReg = /^(\d+(?:\.\d+)?|\.\d+)([^\d]*)$/;
49
+ function 单位帧(u1, u2, point) {
50
+ var m1 = unitFloatReg.exec(u1);
51
+ if (!m1) return u1;
52
+ var [, v1, p1] = m1;
53
+ var m2 = unitFloatReg.exec(u2);
54
+ if (m2) {
55
+ if (m1[1] === m2[1]) return 浮点帧(m1[0], m2[2], point) + m1[1];
56
+ var [, v2, p2] = m2;
57
+ if (p2 === "%") {
58
+ v2 = targetWidth * v2;
59
+ }
60
+ if (p1 === "%") {
61
+ v2 = v2 / targetWidth;
62
+ }
18
63
  }
19
- if (isObject(isLeave) && (_initialStyle === true || !_initialStyle)) {
20
- var temp = _initialStyle;
21
- _initialStyle = isLeave;
22
- isLeave = temp;
64
+ else v2 = 0;
65
+ return 浮点帧(v1, v2, point) + p1;
66
+ }
67
+ function 值帧(k, v1, v2, point) {
68
+ if (/color|background/.test(k)) {
69
+ return 颜色帧(v1, v2, point);
70
+ }
71
+ if (/\(/.test(v1)) {
72
+ return 函数帧(v1, v2, point);
73
+ }
74
+ else {
75
+ v1 = v1.trim().split(/\s+/);
76
+ v2 = v2.trim().split(/\s+/);
77
+ if (v2.length < v1.length) {
78
+ switch (v2.length) {
79
+ case 1:
80
+ v2[1] = v1[0];
81
+ case 2:
82
+ v2[2] = v1[0];
83
+ case 3:
84
+ v2[3] = v1[1];
85
+ }
86
+ }
87
+ return 参数帧(v1, v2, point).join(' ');
23
88
  }
24
- if (isLeave) {
25
- _initialStyle = target.leavingStyle || target.leaveStyle || _initialStyle;
89
+ }
90
+ function 帧样式(style, captureStyle, point) {
91
+ var newStyle = new InnerStyle;
92
+ for (var k in style) {
93
+ newStyle[k] = 值帧(k, style[k], captureStyle[k], point);
94
+ }
95
+ return newStyle;
96
+ }
97
+ function InnerStyle(o) {
98
+ for (var k in o) {
99
+ var v = o[k];
100
+ this[css.transformNodeKey(k)] = css.transformValue(v);
101
+ }
102
+ }
103
+
104
+ var transitionKey = css.transformNodeKey("transition");
105
+
106
+ function transition(target, _isLeave, _initialStyle) {
107
+ if (!target) return;
108
+ if ((isObject(_isLeave) || typeof _isLeave === "string") && (isFinite(_initialStyle) || !_initialStyle)) {
109
+ var temp = _initialStyle;
110
+ _initialStyle = _isLeave;
111
+ _isLeave = temp;
26
112
  }
27
113
  if (target instanceof Array) {
28
114
  target.forEach(function (target) {
29
- transition(target, isLeave, _initialStyle);
115
+ transition(target, _isLeave, _initialStyle);
30
116
  });
31
117
  return;
32
118
  }
33
119
  if (!target.style) return;
34
- var initialStyle = _initialStyle || target.initialStyle;
35
- var { recoverStyle, transitionTimerStart, transitionTimerEnd } = target;
120
+ var isLeave = _isLeave;
121
+ var point = null;
122
+ if (isNumber(isLeave)) {
123
+ point = isLeave;
124
+ }
125
+ var hasInitialStyle = !!_initialStyle;
126
+ if (!_initialStyle) {
127
+ _initialStyle = target.initialStyle || target.enterStyle || target.leavingStyle || target.leaveStyle;
128
+ if (isLeave) {
129
+ _initialStyle = target.leavingStyle || target.leaveStyle || _initialStyle;
130
+ }
131
+ }
132
+ var initialStyle = _initialStyle;
133
+ if (typeof initialStyle === "string") {
134
+ initialStyle = parseKV(initialStyle, ';', ":");
135
+ }
136
+ if (!(initialStyle instanceof InnerStyle)) initialStyle = new InnerStyle(initialStyle);
137
+ if (hasInitialStyle) _initialStyle = initialStyle;
138
+ var { recoverStyle, transitionTimerStart, transitionTimerEnd, captureStyle } = target;
36
139
  clearTimeout(transitionTimerStart);
37
140
  clearTimeout(transitionTimerEnd);
38
- if (isString(initialStyle)) {
39
- initialStyle = parseKV(initialStyle, ";", ":");
141
+ var transitionDuration = 100;
142
+ if (!initialStyle[transitionKey]) {
143
+ initialStyle[transitionKey] = "all .3s ease";
144
+ transitionDuration = 300;
40
145
  }
41
- if (isObject(initialStyle)) {
42
- var transitionDuration = 100;
43
- if (!initialStyle.transition) {
44
- initialStyle.transition = "all .3s ease";
146
+ String(initialStyle[transitionKey]).replace(/([\.\d]+)(m?)s/gi, function (m, d, t) {
147
+ if (t) transitionDuration = Math.max(+d, transitionDuration);
148
+ else transitionDuration = Math.max(d * 1000, transitionDuration);
149
+ return m;
150
+ });
151
+ transitionDuration = transitionDuration || 260;
152
+ if (!recoverStyle) recoverStyle = {};
153
+ if (!captureStyle) captureStyle = {};
154
+ var savedStyle = Object.create(null);
155
+ {
156
+ let originalStyle = target.style;
157
+ for (let k in initialStyle) {
158
+ savedStyle[k] = originalStyle[k];
45
159
  }
46
- if (transitionKey.length > 10) initialStyle[transitionKey] = initialStyle.transition;
47
- String(initialStyle.transition).replace(/([\.\d]+)(m?)s/gi, function (m, d, t) {
48
- if (t) transitionDuration = Math.max(+d, transitionDuration);
49
- else transitionDuration = Math.max(d * 1000, transitionDuration);
50
- return m;
51
- });
52
- transitionDuration = transitionKey ? transitionDuration || 260 : 0;
53
- if (!recoverStyle) {
54
- recoverStyle = {};
55
- }
56
- var savedStyle = Object.create(null);
57
- {
58
- let originalStyle = target.style;
59
- for (let k in initialStyle) {
60
- savedStyle[k] = originalStyle[k];
61
- }
160
+ let computedStyle = getComputedStyle(target);
161
+ for (let k in initialStyle) {
162
+ if (!(k in captureStyle)) captureStyle[k] = computedStyle[k];
62
163
  }
63
- extendIfNeeded(recoverStyle, savedStyle);
64
- if (isLeave) {
65
- transitionTimerStart = setTimeout(function () {
66
- extend(target.style, initialStyle);
67
- });
68
- transitionTimerEnd = setTimeout(function () {
69
- if (transitionKey) target.style[transitionKey] = recoverStyle.transition;
70
- }, transitionDuration + 2);
71
- } else {
164
+ }
165
+ extendIfNeeded(recoverStyle, savedStyle);
166
+ if (point === 0 || point === 1) {
167
+ isLeave = point === 1;
168
+ point = null;
169
+ var transitionValue = initialStyle[transitionKey];
170
+ delete initialStyle[transitionKey];
171
+ initialStyle = 帧样式(initialStyle, captureStyle, point);
172
+ initialStyle[transitionKey] = transitionValue;
173
+ }
174
+ if (point !== null) {
175
+ delete initialStyle[transitionKey];
176
+ target.style[transitionKey] = 'none';
177
+ initialStyle = 帧样式(initialStyle, captureStyle, point);
178
+ extend(target.style, initialStyle);
179
+ }
180
+ else if (isLeave) {
181
+ transitionTimerStart = setTimeout(function () {
72
182
  extend(target.style, initialStyle);
73
- if (transitionKey) target.style[transitionKey] = "none";
74
- var waitPaint = 20;
75
- transitionTimerStart = setTimeout(function () {
76
- delete recoverStyle.transition;
77
- if (transitionKey) target.style[transitionKey] = initialStyle.transition;
78
- target.transitionTimerStart = setTimeout(function () {
79
- extend(target.style, recoverStyle);
80
- }, waitPaint);
81
- });
82
- transitionTimerEnd = setTimeout(function (transition) {
83
- return function () {
84
- if (transitionKey) target.style[transitionKey] = transition;
85
- };
86
- }(recoverStyle.transition || ''), transitionDuration + waitPaint);
87
- }
88
- target.transitionTimerStart = transitionTimerStart;
89
- target.transitionTimerEnd = transitionTimerEnd;
90
- target.recoverStyle = recoverStyle;
91
- if (target.with) {
92
- transition(target.with, isLeave, _initialStyle);
93
- }
94
- return transitionDuration;
183
+ delete target.recoverStyle;
184
+ delete target.captureStyle;
185
+ });
186
+ transitionTimerEnd = setTimeout(function () {
187
+ if (transitionKey) target.style[transitionKey] = recoverStyle[transitionKey];
188
+ extend(target.style, recoverStyle);
189
+ }, transitionDuration + 29);
190
+ } else {
191
+ extend(target.style, initialStyle);
192
+ if (transitionKey) target.style[transitionKey] = "none";
193
+ var waitPaint = 20;
194
+ transitionTimerStart = setTimeout(function () {
195
+ delete recoverStyle[transitionKey];
196
+ if (transitionKey) target.style[transitionKey] = initialStyle[transitionKey];
197
+ target.transitionTimerStart = setTimeout(function () {
198
+ extend(target.style, recoverStyle);
199
+ delete target.recoverStyle;
200
+ delete target.captureStyle;
201
+ }, waitPaint);
202
+ });
203
+ transitionTimerEnd = setTimeout(function (transition) {
204
+ return function () {
205
+ if (transitionKey) target.style[transitionKey] = transition;
206
+ };
207
+ }(recoverStyle[transitionKey] || ''), transitionDuration + waitPaint);
208
+ }
209
+ target.transitionTimerStart = transitionTimerStart;
210
+ target.transitionTimerEnd = transitionTimerEnd;
211
+ target.recoverStyle = recoverStyle;
212
+ target.captureStyle = captureStyle;
213
+ if (target.with) {
214
+ transition(target.with, _isLeave, _initialStyle);
95
215
  }
216
+ return transitionDuration;
96
217
  }
218
+
@@ -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;
@@ -620,9 +620,9 @@ function addGlobal(element, name = null, isDestroy) {
620
620
  if (isFunction(body.layer)) {
621
621
  body.layer(element, oldElement, history);
622
622
  } else {
623
+ if (isDestroy || !oldElement) appendChild.insert(body, element);
624
+ else appendChild.after(oldElement, element);
623
625
  remove(oldElement);
624
- if (isDestroy) appendChild.insert(body, element);
625
- else appendChild(body, element);
626
626
  }
627
627
  global[name] = element;
628
628
  } else if (isNode(name)) {
@@ -704,4 +704,61 @@ zimoli.getCurrentHistory = function () {
704
704
  return history[current_history];
705
705
  };
706
706
  zimoli.inithash = locationInitHash;
707
- zimoli.createState = createState;
707
+ zimoli.createState = createState;
708
+ zimoli.enableTouchBack = function () {
709
+ var touchTarget, currentTarget, history_name, historyList;
710
+ var touchId = 0;
711
+ var ratio = 0;
712
+ var deltaX = 0;
713
+ bindtouch(body, {
714
+ start(event) {
715
+ event.preventDefault();
716
+ ratio = null;
717
+ },
718
+ move(a, event) {
719
+ event.preventDefault();
720
+ if (a !== null) {
721
+ if (!currentTarget) {
722
+ var id = ++touchId;
723
+ history_name = current_history;
724
+ historyList = history[history_name];
725
+ if (historyList.length < 2) return;
726
+ var path1 = historyList[historyList.length - 1];
727
+ var path0 = historyList[historyList.length - 2];
728
+ currentTarget = global[history_name];
729
+ prepare(path0, function () {
730
+ if (id !== touchId) return;
731
+ var args = getZimoliParams(path0).data;
732
+ touchTarget = create(path0, args, path1);
733
+ setWithStyle(touchTarget, true);
734
+ appendChild.insert(body, touchTarget);
735
+ });
736
+ }
737
+ ratio = a.x / body.clientWidth;
738
+ if (ratio <= 0) ratio = 0.001;
739
+ if (ratio >= 1) ratio = 0.999;
740
+ deltaX = a.deltax;
741
+ transition(currentTarget, ratio);
742
+ transition(touchTarget, ratio - 1);
743
+ }
744
+ return { x: ratio * body.clientWidth };
745
+ },
746
+ end() {
747
+ if (ratio === null || !touchTarget) return;
748
+ if (deltaX > 0 && ratio > .1 || deltaX < 0 && ratio > .9 || deltaX === 0 && ratio > .4) {
749
+ pushstate(historyList[historyList.length - 2]);
750
+ remove(currentTarget);
751
+ transition(touchTarget, 1);
752
+ global[history_name] = touchTarget;
753
+ }
754
+ else {
755
+ setWithStyle(touchTarget, false);
756
+ remove(touchTarget);
757
+ transition(currentTarget, 1);
758
+ }
759
+ currentTarget = null;
760
+ touchTarget = null;
761
+ ratio = null;
762
+ }
763
+ }, 'x')
764
+ };
@@ -4,4 +4,5 @@
4
4
  zimoli() // 切换历史后初始化
5
5
  zimoli.clearHistory() // 清空历史
6
6
  zimoli.register(pathname) // 注册通用路由
7
+ zimoli.enableTouchBack() // 开启滑动后退
7
8
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.35.6",
3
+ "version": "3.35.8",
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"