efront 3.24.3 → 3.25.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 (103) hide show
  1. package/apps/{index.html → _index.html} +1 -1
  2. package/apps/{zimoli/index.html → index.jsp} +22 -6
  3. package/apps/kugou/main.js +1 -3
  4. package/coms/basic/bdecode.js +38 -0
  5. package/coms/basic/bdecode_test.js +13 -0
  6. package/coms/basic/bencode.js +14 -0
  7. package/coms/basic/bencode_test.js +20 -0
  8. package/coms/basic/combine.js +21 -0
  9. package/coms/basic/cross_.js +11 -4
  10. package/coms/basic/queue.js +2 -2
  11. package/coms/basic/submit_.js +3 -1
  12. package/{apps → coms}/kugou/api.js +2 -0
  13. package/coms/kugou/buildList.js +7 -1
  14. package/coms/kugou/player.js +1 -0
  15. package/coms/kugou/song.html +1 -1
  16. package/coms/kugou/song.js +1 -0
  17. package/coms/kugou/song.less +12 -1
  18. package/coms/zimoli/button.less +49 -0
  19. package/coms/zimoli/cloneVisible.js +1 -0
  20. package/coms/zimoli/data.js +8 -2
  21. package/coms/zimoli/input.js +6 -4
  22. package/coms/zimoli/picture.js +6 -5
  23. package/coms/zimoli/picture_.js +4 -2
  24. package/coms/zimoli/render.js +2 -1
  25. package/package.json +1 -1
  26. package/public/efront.js +1 -1
  27. package/readme.md +0 -1
  28. package/apps/zimoli/book/main.js +0 -8
  29. package/apps/zimoli/broadcast/main.js +0 -8
  30. package/apps/zimoli/collection/add.html +0 -13
  31. package/apps/zimoli/collection/add.js +0 -14
  32. package/apps/zimoli/collection/add.less +0 -0
  33. package/apps/zimoli/collection/main.html +0 -0
  34. package/apps/zimoli/collection/main.js +0 -13
  35. package/apps/zimoli/collection/main.less +0 -8
  36. package/apps/zimoli/config.js +0 -14
  37. package/apps/zimoli/extra/pending.html +0 -1
  38. package/apps/zimoli/extra/pending.js +0 -8
  39. package/apps/zimoli/extra/pending.less +0 -15
  40. package/apps/zimoli/files/info.js +0 -7
  41. package/apps/zimoli/files/main.js +0 -108
  42. package/apps/zimoli/files/main.less +0 -26
  43. package/apps/zimoli/images/avatar.png +0 -0
  44. package/apps/zimoli/images/background.jpg +0 -0
  45. package/apps/zimoli/kugou/font/demo.css +0 -539
  46. package/apps/zimoli/kugou/font/demo_index.html +0 -1159
  47. package/apps/zimoli/kugou/font/iconfont.css +0 -189
  48. package/apps/zimoli/kugou/font/iconfont.eot +0 -0
  49. package/apps/zimoli/kugou/font/iconfont.js +0 -1
  50. package/apps/zimoli/kugou/font/iconfont.svg +0 -155
  51. package/apps/zimoli/kugou/font/iconfont.ttf +0 -0
  52. package/apps/zimoli/kugou/font/iconfont.woff +0 -0
  53. package/apps/zimoli/kugou/font/iconfont.woff2 +0 -0
  54. package/apps/zimoli/kugou/listen.html +0 -15
  55. package/apps/zimoli/kugou/listen.js +0 -37
  56. package/apps/zimoli/kugou/listen.less +0 -114
  57. package/apps/zimoli/kugou/mine.html +0 -53
  58. package/apps/zimoli/kugou/mine.js +0 -21
  59. package/apps/zimoli/kugou/mine.less +0 -106
  60. package/apps/zimoli/kugou/search.js +0 -109
  61. package/apps/zimoli/kugou/search.less +0 -50
  62. package/apps/zimoli/kugou/sing.js +0 -42
  63. package/apps/zimoli/kugou/sing.less +0 -93
  64. package/apps/zimoli/kugou/view.html +0 -39
  65. package/apps/zimoli/kugou/view.js +0 -17
  66. package/apps/zimoli/kugou/view.less +0 -84
  67. package/apps/zimoli/login/qq.js +0 -20
  68. package/apps/zimoli/login/qq_callback.html +0 -15
  69. package/apps/zimoli/main.js +0 -87
  70. package/apps/zimoli/main.less +0 -81
  71. package/apps/zimoli/message/chatList.js +0 -57
  72. package/apps/zimoli/message/chatList.less +0 -52
  73. package/apps/zimoli/message/commentList.js +0 -55
  74. package/apps/zimoli/message/commentList.less +0 -55
  75. package/apps/zimoli/message/informList.js +0 -69
  76. package/apps/zimoli/message/informList.less +0 -51
  77. package/apps/zimoli/message/main.js +0 -59
  78. package/apps/zimoli/message/main.less +0 -51
  79. package/apps/zimoli/message/praiseList.js +0 -3
  80. package/apps/zimoli/message/praiseList.less +0 -7
  81. package/apps/zimoli/nearby/main.js +0 -8
  82. package/apps/zimoli/skin/main.js +0 -47
  83. package/apps/zimoli/skin/main.less +0 -31
  84. package/apps/zimoli/user/getPassword.js +0 -82
  85. package/apps/zimoli/user/getPassword.less +0 -14
  86. package/apps/zimoli/user/login.html +0 -12
  87. package/apps/zimoli/user/login.js +0 -50
  88. package/apps/zimoli/user/login.less +0 -139
  89. package/apps/zimoli/user/profile-bg.jpg +0 -0
  90. package/apps/zimoli/user/profile.html +0 -32
  91. package/apps/zimoli/user/profile.js +0 -63
  92. package/apps/zimoli/user/profile.less +0 -50
  93. package/apps/zimoli/user/register.js +0 -20
  94. package/apps/zimoli/user/register.less +0 -3
  95. package/apps/zimoli/user/setting.js +0 -90
  96. package/apps/zimoli/user/setting.less +0 -11
  97. package/apps/zimoli/user/welcome.js +0 -36
  98. package/apps/zimoli/user/welcome.less +0 -136
  99. package/apps/zimoli/watch/main.html +0 -22
  100. package/apps/zimoli/watch/main.js +0 -76
  101. package/apps/zimoli/watch/main.less +0 -54
  102. package/apps/zimoli/yuanfen/main.js +0 -55
  103. package/apps/zimoli/yuanfen/main.json +0 -0
@@ -10,7 +10,7 @@
10
10
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
11
11
  <link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" />
12
12
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,width=device-width" />
13
- <title>Efront 项目</title>
13
+ <title>efront 项目</title>
14
14
  <script deleteoncompile efrontloader>
15
15
  // 若要在开发环境使用内置组件,请保留此script标签中的代码,在编译发布时,这里的代码会自动删除
16
16
  </script>
@@ -1,3 +1,18 @@
1
+ <script serverside>
2
+ var fs = require("fs");
3
+ var path = require("path");
4
+ return new Promise(function (ok, oh) {
5
+ fs.readdir(__dirname, { withFileTypes: true }, function (error, names) {
6
+ if (error) oh(error);
7
+ names = names.filter(a => a.isDirectory()).map(a => a.name);
8
+ context.names = [];
9
+ for (var n of names) {
10
+ if (fs.existsSync(path.join(__dirname, n, 'index.html'))) context.names.push(n);
11
+ }
12
+ ok();
13
+ });
14
+ });
15
+ </script>
1
16
  <!DOCTYPE html>
2
17
  <!--
3
18
  http://efront.cc
@@ -10,10 +25,7 @@
10
25
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
11
26
  <link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" />
12
27
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,width=device-width" />
13
- <title>紫茉莉 项目</title>
14
- <script deleteoncompile efrontloader>
15
- // 若要在开发环境使用内置组件,请保留此script标签中的代码,在编译发布时,这里的代码会自动删除
16
- </script>
28
+ <title>efront 项目</title>
17
29
  <style>
18
30
  html {
19
31
  height: 100%;
@@ -34,9 +46,13 @@
34
46
  overflow: hidden;
35
47
  }
36
48
  </style>
37
- <script>window.e=0</script>
38
49
  </head>
39
50
 
40
- <body scroll=no max-render=1440></body>
51
+ <body scroll=no max-render=1440>
52
+ 欢迎使用efront开发套件
53
+ <script serverside>
54
+ return context.names.map(n => `<a href="${n}">${n}</a>`)
55
+ </script>
56
+ </body>
41
57
 
42
58
  </html>
@@ -1,6 +1,4 @@
1
- init('/api',function(jsondata){
2
- data.setConfig(jsondata);
3
- });
1
+ data.setConfig(api);
4
2
  zimoli.switch("", null, "/home");
5
3
  css("body", "background-color:#f2f4f6;");
6
4
  zimoli();
@@ -0,0 +1,38 @@
1
+ var reg = /([a-z]?)(\d*)/g;
2
+ function decode(str, i) {
3
+ reg.lastIndex = i;
4
+ var a = reg.exec(str);
5
+ if (!a) return [, str.length];
6
+ var [m, t, l] = a;
7
+ var e = a.index + m.length;
8
+ switch (t) {
9
+ case "":
10
+ e++;
11
+ return [str.slice(e, e += +l), e];
12
+ case "i":
13
+ e = str.indexOf("e", a.index + +m.length);
14
+ if (e < 0) e = str.length;
15
+ return [+str.slice(a.index + 1, e), e + 1];
16
+ case "d":
17
+ var res = {};
18
+ i++;
19
+ while (i < str.length && str.charAt(i) !== 'e') {
20
+ var [k, i] = decode(str, i);
21
+ var [v, i] = decode(str, i);
22
+ res[k] = v;
23
+ }
24
+ return [res, i + 1];
25
+ case "l":
26
+ var res = [];
27
+ i++;
28
+ while (i < str.length && str.charAt(i) !== 'e') {
29
+ var [o, i] = decode(str, i);
30
+ res.push(o);
31
+ }
32
+ return [res, i + 1];
33
+ }
34
+ return [, str.length]
35
+ }
36
+ function bdecode(str) {
37
+ return decode(str, 0)[0];
38
+ }
@@ -0,0 +1,13 @@
1
+ var test = function (data, res) {
2
+ var d = bdecode(res);
3
+ assert(d, data);
4
+ };
5
+ test({ "t": "aa", "y": "e", "e": [201, "A Generic Error Ocurred"] }, 'd1:eli201e23:A Generic Error Ocurrede1:t2:aa1:y1:ee')
6
+ test({ "t": "aa", "y": "q", "q": "ping", "a": { "id": "abcdefghij0123456789" } }, 'd1:ad2:id20:abcdefghij0123456789e1:q4:ping1:t2:aa1:y1:qe')
7
+ test({ "t": "aa", "y": "r", "r": { "id": "mnopqrstuvwxyz123456" } }, 'd1:rd2:id20:mnopqrstuvwxyz123456e1:t2:aa1:y1:re')
8
+ test({ "t": "aa", "y": "q", "q": "find_node", "a": { "id": "abcdefghij0123456789", "target": "mnopqrstuvwxyz123456" } }, 'd1:ad2:id20:abcdefghij01234567896:target20:mnopqrstuvwxyz123456e1:q9:find_node1:t2:aa1:y1:qe')
9
+ test({ "t": "aa", "y": "r", "r": { "id": "0123456789abcdefghij", "nodes": "def456..." } }, 'd1:rd2:id20:0123456789abcdefghij5:nodes9:def456...e1:t2:aa1:y1:re')
10
+ test({ "t": "aa", "y": "q", "q": "get_peers", "a": { "id": "abcdefghij0123456789", "info_hash": "mnopqrstuvwxyz123456" } }, 'd1:ad2:id20:abcdefghij01234567899:info_hash20:mnopqrstuvwxyz123456e1:q9:get_peers1:t2:aa1:y1:qe')
11
+ test({ "t": "aa", "y": "r", "r": { "id": "abcdefghij0123456789", "token": "aoeusnth", "nodes": "def456..." } }, 'd1:rd2:id20:abcdefghij01234567895:nodes9:def456...5:token8:aoeusnthe1:t2:aa1:y1:re')
12
+ test({ "t": "aa", "y": "q", "q": "announce_peer", "a": { "id": "abcdefghij0123456789", "implied_port": 1, "info_hash": "mnopqrstuvwxyz123456", "port": 6881, "token": "aoeusnth" } }, 'd1:ad2:id20:abcdefghij012345678912:implied_porti1e9:info_hash20:mnopqrstuvwxyz1234564:porti6881e5:token8:aoeusnthe1:q13:announce_peer1:t2:aa1:y1:qe')
13
+ test({ "t": "aa", "y": "r", "r": { "id": "mnopqrstuvwxyz123456" } }, 'd1:rd2:id20:mnopqrstuvwxyz123456e1:t2:aa1:y1:re')
@@ -0,0 +1,14 @@
1
+ function bencode(object) {
2
+ if (isString(object)) return `${object.length}:${object}`;
3
+ if (isNumber(object)) return `i${object}e`;
4
+ if (isArray(object)) return `l${object.map(bencode).join('')}e`;
5
+ if (isEmpty(object)) return ``;
6
+ if (!isObject(object)) return ``;
7
+ var res = [];
8
+ for (var k in object) {
9
+ var o = object[k];
10
+ if (isEmpty(o)) continue;
11
+ res.push(bencode(k), bencode(o));
12
+ }
13
+ return `d${res.join('')}e`;
14
+ }
@@ -0,0 +1,20 @@
1
+ var format = function (data) {
2
+ if (!isObject(data)) return data;
3
+ if (isArray(data)) return data.map(format);
4
+ var d = {};
5
+ Object.keys(data).sort().map(k => d[k] = format(data[k]));
6
+ return d;
7
+ }
8
+ var test = function (data, res) {
9
+ var d = format(data);
10
+ assert(bencode(d), res);
11
+ };
12
+ test({ "t": "aa", "y": "e", "e": [201, "A Generic Error Ocurred"] }, 'd1:eli201e23:A Generic Error Ocurrede1:t2:aa1:y1:ee')
13
+ test({ "t": "aa", "y": "q", "q": "ping", "a": { "id": "abcdefghij0123456789" } }, 'd1:ad2:id20:abcdefghij0123456789e1:q4:ping1:t2:aa1:y1:qe')
14
+ test({ "t": "aa", "y": "r", "r": { "id": "mnopqrstuvwxyz123456" } }, 'd1:rd2:id20:mnopqrstuvwxyz123456e1:t2:aa1:y1:re')
15
+ test({ "t": "aa", "y": "q", "q": "find_node", "a": { "id": "abcdefghij0123456789", "target": "mnopqrstuvwxyz123456" } }, 'd1:ad2:id20:abcdefghij01234567896:target20:mnopqrstuvwxyz123456e1:q9:find_node1:t2:aa1:y1:qe')
16
+ test({ "t": "aa", "y": "r", "r": { "id": "0123456789abcdefghij", "nodes": "def456..." } }, 'd1:rd2:id20:0123456789abcdefghij5:nodes9:def456...e1:t2:aa1:y1:re')
17
+ test({ "t": "aa", "y": "q", "q": "get_peers", "a": { "id": "abcdefghij0123456789", "info_hash": "mnopqrstuvwxyz123456" } }, 'd1:ad2:id20:abcdefghij01234567899:info_hash20:mnopqrstuvwxyz123456e1:q9:get_peers1:t2:aa1:y1:qe')
18
+ test({ "t": "aa", "y": "r", "r": { "id": "abcdefghij0123456789", "token": "aoeusnth", "nodes": "def456..." } }, 'd1:rd2:id20:abcdefghij01234567895:nodes9:def456...5:token8:aoeusnthe1:t2:aa1:y1:re')
19
+ test({ "t": "aa", "y": "q", "q": "announce_peer", "a": { "id": "abcdefghij0123456789", "implied_port": 1, "info_hash": "mnopqrstuvwxyz123456", "port": 6881, "token": "aoeusnth" } }, 'd1:ad2:id20:abcdefghij012345678912:implied_porti1e9:info_hash20:mnopqrstuvwxyz1234564:porti6881e5:token8:aoeusnthe1:q13:announce_peer1:t2:aa1:y1:qe')
20
+ test({ "t": "aa", "y": "r", "r": { "id": "mnopqrstuvwxyz123456" } }, 'd1:rd2:id20:mnopqrstuvwxyz123456e1:t2:aa1:y1:re')
@@ -0,0 +1,21 @@
1
+ function combine() {
2
+ var total = 1;
3
+ var argsList = Array.prototype.map.call(arguments, a => {
4
+ total *= a.length;
5
+ return a;
6
+ });
7
+
8
+ var temp = total;
9
+ var ratioList = argsList.map(a => temp = temp / a.length);
10
+ var dist = new Array(total);
11
+ for (var cx = 0, dx = total; cx < dx; cx++) {
12
+ var temp = cx;
13
+ dist[cx] = argsList.map(function (a, cx) {
14
+ var index = temp / ratioList[cx] | 0;
15
+ temp = temp - index * ratioList[cx];
16
+ return a[index];
17
+ });
18
+ }
19
+ return dist;
20
+ }
21
+ module.exports = combine;
@@ -118,8 +118,12 @@ function cross_(jsonp, digest = noop, method, url, headers) {
118
118
  var flush = function () {
119
119
  var then = xhr.then;
120
120
  delete xhr.then;
121
- if (loaded) onloads.splice(0, onloads.length).map(e => e instanceof Function && e(xhr));
122
- if (errored) onerrors.splice(0, onerrors.length).map(e => e instanceof Function && e(errored));
121
+ if (loaded) onloads.forEach(e => e instanceof Function && e(xhr));
122
+ if (errored) onerrors.forEach(e => e instanceof Function && e(errored));
123
+ if (loaded || errored) {
124
+ onloads.splice(0, onloads.length);
125
+ onerrors.splice(0, onerrors.length);
126
+ }
123
127
  xhr.then = then;
124
128
  };
125
129
  if (/^jsonp/i.test(method)) {
@@ -198,9 +202,11 @@ function cross_(jsonp, digest = noop, method, url, headers) {
198
202
  case 304:
199
203
  onload(xhr);
200
204
  break;
201
- case 307:
202
205
  case 302:
203
206
  case 301:
207
+ method = 'get';
208
+ datas = null;
209
+ case 307:
204
210
  if (xhr.isRedirected > 2) break;
205
211
  var exposekey = nocross ? "location" : "efront-location";
206
212
  var location = exposeMap[exposekey] && xhr.getResponseHeader(exposekey);
@@ -212,10 +218,11 @@ function cross_(jsonp, digest = noop, method, url, headers) {
212
218
  }
213
219
  location = getRequestProtocol(url) + "//" + location;
214
220
  }
215
- var crs = cross_("get", location, _headers);
221
+ var crs = cross_.call(cross, jsonp, digest, method, location, _headers);
216
222
  crs.isRedirected = (xhr.isRedirected || 0) + 1;
217
223
  crs.done(onload, false);
218
224
  crs.error(onerror, false);
225
+ if (!isEmpty(datas)) crs.send(datas);
219
226
  break;
220
227
  default:
221
228
  onerror(xhr);
@@ -33,7 +33,7 @@ function queue(list, count = 1, context = null) {
33
33
  oh(e);
34
34
  return promised = null;
35
35
  }
36
- if (!promised && (!result[saved_cx] || !isFunction(result[saved_cx].then)));
36
+ if (promised === false && (!result[saved_cx] || !isFunction(result[saved_cx].then))) count++;
37
37
  else Promise.resolve(result[saved_cx]).then(next, reject), promised = true;
38
38
  };
39
39
  if (count > list.length) {
@@ -42,7 +42,7 @@ function queue(list, count = 1, context = null) {
42
42
  if (!(count >= 1)) {
43
43
  count = 1;
44
44
  }
45
- while (promised === false || count-- > 0) run();
45
+ while (count-- > 0) run();
46
46
  });
47
47
  }
48
48
  module.exports = queue;
@@ -24,10 +24,12 @@ function submit(fields, data) {
24
24
  var tmp = /\:(\d+)?(?:\.(\d+))?$/.exec(f.type);
25
25
  if (tmp) var [, , fixed] = tmp;
26
26
  else if (/^(money|price)$/i.test(f.type)) fixed = 2;
27
+ else fixed = undefined;
27
28
  fixed = +fixed;
28
29
  if (fixed) {
29
30
  var v = params[f.key];
30
- if (v) {
31
+ if (!isEmpty(v)) {
32
+ v = String(v);
31
33
  var d = v.replace(/^[^\.]*\.?/, '').length;
32
34
  if (d === v.length - 1) v = "0" + v;
33
35
  if (d > 0 && d < fixed) {
@@ -3,6 +3,8 @@
3
3
  "song-info": "get app/i/getSongInfo.php?cmd=playInfo&from=mkugou&hash",
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:[].m_cm_item1warp:nth-child(2)>div .#=a!href\\song-mix&a:nth-child(2)>p:first-child!innerText&singer=a:nth-child(2)>p:nth-child(2)!innerText&imgurl=img!_src",
7
+ "song-mix;": "mget:script:nth-last-child(2) mixsong/:hashid.html",
6
8
  "rank-list": "get:[].panel-img-list%20li rank/list#href=a!href&=a!href\\rank-info&imgurl=img!_src&name=p|innerText",
7
9
  "rank-info": "get:[].panel-songslist%20li rank/info/:id#src=!id&name=.panel-songs-item-name|innerText&data=.panel-songs-item-download/innerText",
8
10
  "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",
@@ -7,7 +7,13 @@ function main(dataid, datapath) {
7
7
  song,
8
8
  loading,
9
9
  musicList,
10
- run(s) {
10
+ async run(s) {
11
+ if (!s.hash && s.hashid) {
12
+ await data.from("song-mix", s, function (a) {
13
+ var m = a.innerText.match(/(['"`]?)hash\1\s*:\s*(["'`])(.*?)\2/);
14
+ if (m) s.hash = m[3];
15
+ });
16
+ }
11
17
  if (s.hash) {
12
18
  kugou$player.play(s.hash);
13
19
  } else {
@@ -179,6 +179,7 @@ var $scope = {
179
179
  cast($scope.dance, buf);
180
180
  }
181
181
  },
182
+ playid: 0,
182
183
  play(hash = musicList.active_hash) {
183
184
  render.refresh();
184
185
  var isPlayback = typeof hash === "number";
@@ -1,7 +1,7 @@
1
1
  <div class="bg"></div>
2
2
  <png class="logo" ng-if="song.imgurl" ng-src=song.imgurl></png>
3
+ <div class="singer" ng-if="song.singer" ng-model=song.singerMarked></div>
3
4
  <div class="song" ng-model=song.songMarked></div>
4
- <div class="singer" ng-model=song.singerMarked></div>
5
5
  <div class="filterTime(song.timeLength)"></div>
6
6
  <div refresh class="play-state" ng-if="song.hash===musicList.active_hash" ng-class={error:playState.error}>
7
7
  <div ng-style="{width:playState.width}"></div>
@@ -21,6 +21,7 @@ function main(elem) {
21
21
  $scope.song = {
22
22
  hash: item.hash,
23
23
  imgurl: item.imgurl,
24
+ singer: singerName,
24
25
  songMarked: mark(songName, elem.mark),
25
26
  singerMarked: mark(singerName, elem.mark)
26
27
  };
@@ -24,16 +24,23 @@
24
24
  width: 40px;
25
25
  margin: -6px -4px;
26
26
 
27
+ &+.singer+.song,
27
28
  &+.song {
28
29
  margin-left: -38px;
29
30
  padding-left: 46px;
30
- line-height: 30px;
31
31
  display: inline-block;
32
32
  vertical-align: top;
33
+
34
+ }
35
+
36
+ &+.singer {
37
+ padding-left: 46px;
33
38
  }
39
+
34
40
  }
35
41
 
36
42
  >.song {
43
+ line-height: 30px;
37
44
  width: 100%;
38
45
  overflow: hidden;
39
46
  text-overflow: ellipsis;
@@ -56,6 +63,10 @@ b {
56
63
  line-height: 12px;
57
64
  font-size: 12px;
58
65
  color: #888;
66
+
67
+ &+.song {
68
+ padding-top: 8px;
69
+ }
59
70
  }
60
71
 
61
72
  >.play-state {
@@ -41,6 +41,20 @@
41
41
  }
42
42
  }
43
43
 
44
+ @keyframes busy-pending {
45
+ 0% {
46
+ transform: rotate(0);
47
+ }
48
+
49
+ 70% {
50
+ transform: rotate(180deg);
51
+ }
52
+
53
+ 100% {
54
+ transform: rotate(360deg);
55
+ }
56
+ }
57
+
44
58
  &>input {
45
59
  position: absolute;
46
60
  opacity: 0;
@@ -149,6 +163,29 @@
149
163
  animation: ltr 2s linear 0s infinite;
150
164
  }
151
165
 
166
+ a&,
167
+ &[type=anchor] {
168
+ &:before {
169
+ display: none;
170
+ }
171
+
172
+ overflow: visible;
173
+
174
+ &.track {
175
+ display: none;
176
+ }
177
+
178
+ &:after {
179
+ content: "↻";
180
+ font-family: 'Times New Roman', Times, serif;
181
+ display: inline-block;
182
+ vertical-align: middle;
183
+ position: absolute;
184
+ animation: busy-pending 2s linear 0s infinite;
185
+ }
186
+ }
187
+
188
+
152
189
  }
153
190
 
154
191
  &:focus {
@@ -174,6 +211,13 @@
174
211
  background: #fff;
175
212
  animation: busy-loading 3s linear 0s infinite;
176
213
  }
214
+
215
+ a&,
216
+ &[type=anchor] {
217
+ &:before {
218
+ animation: busy-pending 3s linear 0s infinite;
219
+ }
220
+ }
177
221
  }
178
222
 
179
223
  a&,
@@ -198,6 +242,10 @@ a&,
198
242
  }
199
243
  }
200
244
 
245
+ &[loading],
246
+ &[pending] {
247
+ .clear();
248
+ }
201
249
 
202
250
  &.hover {
203
251
  color: lighten(@default-color, 10%);
@@ -265,5 +313,6 @@ a&,
265
313
  &:before {
266
314
  content: "确认";
267
315
  }
316
+
268
317
  background: #333;
269
318
  }
@@ -88,6 +88,7 @@ var isMaybeVisible = function (node) {
88
88
  }
89
89
  if (node.offsetParent) {
90
90
  var parent = node.offsetParent;
91
+ if (!isMaybeVisible(parent)) return false;
91
92
  if (getComputedStyle(parent).overflow === 'visible') return true;
92
93
  return !(node.offsetLeft + node.offsetWidth - parent.scrollLeft <= parent.clientLeft ||
93
94
  node.offsetTop + node.offsetHeight - parent.scrollTop <= parent.clientTop ||
@@ -268,8 +268,7 @@ function parseConfig(api) {
268
268
  var required = [];
269
269
  var prepared = [];
270
270
  var autotrim = false;
271
-
272
- id = id.replace(/[\?\|\:;](.+?)$/, function (m, s) {
271
+ id = id.replace(/[\?\|\:;](.*?)$/, function (m, s) {
273
272
  autotrim = /^[\|;]/.test(m);
274
273
  if (/^[\|\/]/.test(s)) autotrim = true, s = s.slice(1);
275
274
  s = s.split('&');
@@ -709,6 +708,13 @@ var data = {
709
708
  data = this.parseConfig(data);
710
709
  configPormise = Promise.resolve(data);
711
710
  },
711
+ async addConfig(data) {
712
+ var p = configPormise;
713
+ var c = await p;
714
+ if (p !== configPormise) return;
715
+ data = this.parseConfig(data);
716
+ extend(c, data);
717
+ },
712
718
  getConfig() {
713
719
  return privates.getConfigPromise();
714
720
  },
@@ -67,10 +67,12 @@ var number = function (event) {
67
67
  }
68
68
  };
69
69
  var toFixed = function () {
70
- if (this.value && this.fixed) var fixed = BigNumber.fix(this.value, this.fixed);
71
- if (this.value !== fixed) {
72
- this.value = fixed;
73
- dispatch(this, 'change');
70
+ if (this.value && this.fixed) {
71
+ var fixed = BigNumber.fix(this.value, this.fixed);
72
+ if (this.value !== fixed) {
73
+ this.value = fixed;
74
+ dispatch(this, 'change');
75
+ }
74
76
  }
75
77
  };
76
78
  var positiveReg = /^\+|^positive\-?|\-?positive$|\+$/i;
@@ -1,6 +1,6 @@
1
1
 
2
2
  var coordIn = move.coordIn;
3
- var _createImage = function (url, callback) {
3
+ var _createImage = function (url, callback, iscurrent) {
4
4
  var imgpic;
5
5
  if (url instanceof Image) {
6
6
  imgpic = new Image;
@@ -18,10 +18,11 @@ var _createImage = function (url, callback) {
18
18
  onload.call(imgpic);
19
19
  } else {
20
20
  imgpic.onload = onload;
21
+ if (iscurrent) imgpic.onerror = () => alert("打开失败!");
21
22
  }
22
23
  return imgpic;
23
24
  };
24
- var create = function (url, key) {
25
+ var create = function (url, key, report_error) {
25
26
  if (!url) return;
26
27
 
27
28
  var image = picture_();
@@ -90,7 +91,7 @@ var create = function (url, key) {
90
91
  }
91
92
  };
92
93
 
93
- createImage(url, image.setImage);
94
+ createImage(url, image.setImage, report_error);
94
95
 
95
96
 
96
97
  var get_style = function (x, y, scaled, rotate) {
@@ -127,10 +128,10 @@ function picture(url, to = 0, key) {
127
128
  delete images[index];
128
129
  }
129
130
  if (!images[index]) {
130
- images[index] = create.call(p, urls[index], key);
131
+ images[index] = create.call(p, urls[index], key, p.index === index);
131
132
  }
132
133
  if (!images[index + 1] && index + 1 < urls.length) {
133
- images[index + 1] = create.call(p, urls[index + 1], key);
134
+ images[index + 1] = create.call(p, urls[index + 1], key, p.index === index);
134
135
  }
135
136
  if (index >= 5) delete images[index - 5];
136
137
  if (index + 5 < urls.length) {
@@ -85,8 +85,10 @@ function picture_(image = document.createElement("div")) {
85
85
  cover_scale = isxrelex ? x_scale : y_scale;
86
86
  loaded_scale = contain_scale = isxrelex ? y_scale : x_scale;
87
87
  if (loaded_scale >= 1) {
88
- click_scale = 4;
89
- loaded_scale = 1;
88
+ if (loaded_scale > devicePixelRatio) {
89
+ loaded_scale = devicePixelRatio;
90
+ }
91
+ click_scale = loaded_scale * 2;
90
92
  }
91
93
  else if (loaded_scale > .5) {
92
94
  click_scale = 2;
@@ -554,6 +554,7 @@ var binders = {
554
554
  });
555
555
  }
556
556
  };
557
+ var reject = function (e) { digest(); throw e };
557
558
  var createEmiter = function (on) {
558
559
  return function (key, search) {
559
560
  var parsedSrc = this.$src;
@@ -603,7 +604,7 @@ var createEmiter = function (on) {
603
604
  else {
604
605
  res = getter0.call(this, e);
605
606
  }
606
- if (res && isFunction(res.then)) res.then(digest, digest);
607
+ if (res && isFunction(res.then)) res.then(digest, reject);
607
608
  return res;
608
609
  });
609
610
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.24.3",
3
+ "version": "3.25.0",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {