efront 3.24.2 → 3.24.7

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 (113) hide show
  1. package/apps/kugou/main.js +1 -3
  2. package/coms/basic/assert.js +10 -2
  3. package/coms/basic/extends_.js +13 -0
  4. package/coms/basic/loader.js +22 -17
  5. package/coms/basic/mark.js +155 -0
  6. package/coms/basic/queue.js +11 -14
  7. package/coms/basic/rest_.js +27 -0
  8. package/coms/basic/submit_.js +3 -1
  9. package/{apps → coms}/kugou/api.js +2 -0
  10. package/coms/kugou/buildList.js +7 -1
  11. package/coms/kugou/player.js +1 -0
  12. package/coms/kugou/song.html +1 -1
  13. package/coms/kugou/song.js +1 -0
  14. package/coms/kugou/song.less +12 -1
  15. package/coms/zimoli/cloneVisible.js +1 -0
  16. package/coms/zimoli/compile.js +64 -1
  17. package/coms/{compile → zimoli}/compile_test.js +0 -0
  18. package/coms/zimoli/data.js +8 -2
  19. package/coms/zimoli/input.js +6 -4
  20. package/coms/zimoli/render.js +1 -1
  21. package/package.json +1 -1
  22. package/public/efront.js +1 -1
  23. package/readme.md +0 -1
  24. package/apps/zimoli/book/main.js +0 -8
  25. package/apps/zimoli/broadcast/main.js +0 -8
  26. package/apps/zimoli/collection/add.html +0 -13
  27. package/apps/zimoli/collection/add.js +0 -14
  28. package/apps/zimoli/collection/add.less +0 -0
  29. package/apps/zimoli/collection/main.html +0 -0
  30. package/apps/zimoli/collection/main.js +0 -13
  31. package/apps/zimoli/collection/main.less +0 -8
  32. package/apps/zimoli/config.js +0 -14
  33. package/apps/zimoli/extra/pending.html +0 -1
  34. package/apps/zimoli/extra/pending.js +0 -8
  35. package/apps/zimoli/extra/pending.less +0 -15
  36. package/apps/zimoli/files/info.js +0 -7
  37. package/apps/zimoli/files/main.js +0 -108
  38. package/apps/zimoli/files/main.less +0 -26
  39. package/apps/zimoli/images/avatar.png +0 -0
  40. package/apps/zimoli/images/background.jpg +0 -0
  41. package/apps/zimoli/index.html +0 -42
  42. package/apps/zimoli/kugou/font/demo.css +0 -539
  43. package/apps/zimoli/kugou/font/demo_index.html +0 -1159
  44. package/apps/zimoli/kugou/font/iconfont.css +0 -189
  45. package/apps/zimoli/kugou/font/iconfont.eot +0 -0
  46. package/apps/zimoli/kugou/font/iconfont.js +0 -1
  47. package/apps/zimoli/kugou/font/iconfont.svg +0 -155
  48. package/apps/zimoli/kugou/font/iconfont.ttf +0 -0
  49. package/apps/zimoli/kugou/font/iconfont.woff +0 -0
  50. package/apps/zimoli/kugou/font/iconfont.woff2 +0 -0
  51. package/apps/zimoli/kugou/listen.html +0 -15
  52. package/apps/zimoli/kugou/listen.js +0 -37
  53. package/apps/zimoli/kugou/listen.less +0 -114
  54. package/apps/zimoli/kugou/mine.html +0 -53
  55. package/apps/zimoli/kugou/mine.js +0 -21
  56. package/apps/zimoli/kugou/mine.less +0 -106
  57. package/apps/zimoli/kugou/search.js +0 -109
  58. package/apps/zimoli/kugou/search.less +0 -50
  59. package/apps/zimoli/kugou/sing.js +0 -42
  60. package/apps/zimoli/kugou/sing.less +0 -93
  61. package/apps/zimoli/kugou/view.html +0 -39
  62. package/apps/zimoli/kugou/view.js +0 -17
  63. package/apps/zimoli/kugou/view.less +0 -84
  64. package/apps/zimoli/login/qq.js +0 -20
  65. package/apps/zimoli/login/qq_callback.html +0 -15
  66. package/apps/zimoli/main.js +0 -87
  67. package/apps/zimoli/main.less +0 -81
  68. package/apps/zimoli/message/chatList.js +0 -57
  69. package/apps/zimoli/message/chatList.less +0 -52
  70. package/apps/zimoli/message/commentList.js +0 -55
  71. package/apps/zimoli/message/commentList.less +0 -55
  72. package/apps/zimoli/message/informList.js +0 -69
  73. package/apps/zimoli/message/informList.less +0 -51
  74. package/apps/zimoli/message/main.js +0 -59
  75. package/apps/zimoli/message/main.less +0 -51
  76. package/apps/zimoli/message/praiseList.js +0 -3
  77. package/apps/zimoli/message/praiseList.less +0 -7
  78. package/apps/zimoli/nearby/main.js +0 -8
  79. package/apps/zimoli/skin/main.js +0 -47
  80. package/apps/zimoli/skin/main.less +0 -31
  81. package/apps/zimoli/user/getPassword.js +0 -82
  82. package/apps/zimoli/user/getPassword.less +0 -14
  83. package/apps/zimoli/user/login.html +0 -12
  84. package/apps/zimoli/user/login.js +0 -50
  85. package/apps/zimoli/user/login.less +0 -139
  86. package/apps/zimoli/user/profile-bg.jpg +0 -0
  87. package/apps/zimoli/user/profile.html +0 -32
  88. package/apps/zimoli/user/profile.js +0 -63
  89. package/apps/zimoli/user/profile.less +0 -50
  90. package/apps/zimoli/user/register.js +0 -20
  91. package/apps/zimoli/user/register.less +0 -3
  92. package/apps/zimoli/user/setting.js +0 -90
  93. package/apps/zimoli/user/setting.less +0 -11
  94. package/apps/zimoli/user/welcome.js +0 -36
  95. package/apps/zimoli/user/welcome.less +0 -136
  96. package/apps/zimoli/watch/main.html +0 -22
  97. package/apps/zimoli/watch/main.js +0 -76
  98. package/apps/zimoli/watch/main.less +0 -54
  99. package/apps/zimoli/yuanfen/main.js +0 -55
  100. package/apps/zimoli/yuanfen/main.json +0 -0
  101. package/coms/compile/breakcode.js +0 -78
  102. package/coms/compile/common.js +0 -688
  103. package/coms/compile/compile.js +0 -64
  104. package/coms/compile/keywords.js +0 -6
  105. package/coms/compile/namelist.js +0 -142
  106. package/coms/compile/namelist_test.js +0 -7
  107. package/coms/compile/required.js +0 -20
  108. package/coms/compile/scanner.js +0 -653
  109. package/coms/compile/scanner2.js +0 -921
  110. package/coms/compile/scanner2_test.js +0 -85
  111. package/coms/compile/scanner_test.js +0 -10
  112. package/coms/compile/washcode.js +0 -313
  113. package/coms/zimoli/mark.js +0 -70
@@ -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();
@@ -1,3 +1,4 @@
1
+ var mark = require("./mark");
1
2
  var dump = function (a, msg) {
2
3
  if (a instanceof Object) console.error('对象的属性不符合'), console.log(msg ? msg + " " : " ", a);
3
4
  else if (msg) console.error(msg + ":", a);
@@ -8,10 +9,17 @@ var assert = function (result, expect, log = dump) {
8
9
  var collect = function (k, args) {
9
10
  hasCollect = true;
10
11
  if (args) return function () {
11
- errors = `Except (${args}) to be ${JSON.stringify(k)}`;
12
+ errors = `结果 (${args}) 应为 ${JSON.stringify(k)}`;
12
13
  }
13
14
  if (k === undefined) return function () {
14
- errors = `Except ${result} to be ${expect}`;
15
+ var color1 = "bgred";
16
+ var color2 = "bgblue";
17
+ mark.setTag1(` </${color1}>`, `<${color1}>`);
18
+ mark.setTag2(` </${color2}>`, `<${color2}>`);
19
+ var [r, e] = mark.pair(result, expect);
20
+ r = String(r).trim();
21
+ e = String(e).trim();
22
+ errors = `<cyan>结果 </cyan><${color1}>${r}</${color1}>\r\n <cyan>应为 </cyan><${color2}>${e}</${color2}>\r\n`;
15
23
  };
16
24
  return function (error) {
17
25
  if (error instanceof Object) {
@@ -0,0 +1,13 @@
1
+ var __static = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
2
+ d.__proto__ = b;
3
+ } || extend;
4
+ var setConstructor = Object.defineProperty ? function (a, c) {
5
+ Object.defineProperty(a, "constructor", { value: c });
6
+ } : function (a, c) {
7
+ a.constructor = c;
8
+ };
9
+ // class A extends B {}
10
+ function extends_(A, B) {
11
+ __static(A, B);
12
+ A.prototype = B === null ? Object.create(null) : new (_ = function () { setConstructor(this, A) }, _.prototype = B.prototype, _);
13
+ }
@@ -59,7 +59,9 @@ var request = window.request || function (url, onload, onerror, version) {
59
59
  var loadingTree = {};
60
60
  var responseTree = {};
61
61
  var versionTree = {};
62
-
62
+ var isThenable = function (a) {
63
+ return a && a.then instanceof Function;
64
+ };
63
65
  var keyprefix = "";
64
66
  var flushTree = function (tree, key, res) {
65
67
  var response = tree[key];
@@ -138,7 +140,7 @@ var readFile = function (names, then) {
138
140
  }
139
141
  };
140
142
  var oh = function (e) {
141
- if (!isProduction) {
143
+ if (isProduction) {
142
144
  if (errorcount < 2) {
143
145
  errorcount++;
144
146
  setTimeout(tryload, 200 + 1000 * errorcount);
@@ -166,6 +168,7 @@ var killCircle = function () {
166
168
  if (k.slice(0, keyprefix.length) === keyprefix && loadedModules[k] instanceof Array) {
167
169
  var key = k.slice(keyprefix.length);
168
170
  var args = loadedModules[k].args;
171
+ if (loadedModules[k] instanceof Array) continue;
169
172
  args.forEach(arg => {
170
173
  if (!penddings[arg]) {
171
174
  penddings[arg] = [];
@@ -239,6 +242,7 @@ var loadModule = function (name, then, prebuilds = {}) {
239
242
  return;
240
243
  }
241
244
  if (loadedModules[key] instanceof Array) {
245
+ if (loadedModules[key].error) return then(key);
242
246
  loadedModules[key].push(then);
243
247
  return;
244
248
  }
@@ -286,16 +290,19 @@ var loadModule = function (name, then, prebuilds = {}) {
286
290
  mod.required = required;
287
291
  mod.file = name;
288
292
  args = args.concat(required);
289
- var errored = 0;
290
- // console.log(args);
293
+ var _errored = 0;
291
294
  var response = function (error) {
292
295
  loadingCount++;
293
296
  if (error) {
294
- errored += error;
297
+ if (!errored[error]) {
298
+ errored[error] = [];
299
+ }
300
+ errored[error].push(key);
301
+ _errored++;
295
302
  }
296
303
  if (loadingCount === args.length) {
297
- if (errored) {
298
- loadedModules[key].error = errored;
304
+ if (_errored.length) {
305
+ loadedModules[key].error = true;
299
306
  }
300
307
  flushTree(loadedModules, key, mod);
301
308
  }
@@ -507,10 +514,7 @@ var createModule = function (exec, originNames, compiledNames, prebuilds = {}) {
507
514
  }
508
515
  return exec.apply(_this, requires.map(a => init(a)));
509
516
  };
510
- var _ok, result, created;
511
- var promise = new Promise(function (ok) {
512
- _ok = ok;
513
- });
517
+ var result, created;
514
518
  if (prebuilds.init) {
515
519
  var prebuilds2 = Object.create(null);
516
520
  for (var k in prebuilds) prebuilds2[k] = prebuilds[k];
@@ -519,17 +523,16 @@ var createModule = function (exec, originNames, compiledNames, prebuilds = {}) {
519
523
  delete prebuilds.action;
520
524
  delete prebuilds.init;
521
525
  }
522
- init(argName, function (res) {
526
+ var promise = init(argName, function (res) {
523
527
  result = res;
524
528
  created = true;
525
- _ok(res);
526
529
  }, prebuilds);
527
530
  if (created) return result;
528
531
  return promise;
529
532
  });
530
533
 
531
534
  var _this = isModuleInit ? exports : window;
532
- var argsPromises = argsList.filter(a => a instanceof Promise);
535
+ var argsPromises = argsList.filter(isThenable);
533
536
  argsList = argsList.concat(exec.strs);
534
537
  argsList.push(compiledNames || []);
535
538
  if (!argsPromises.length) {
@@ -584,13 +587,15 @@ var init = function (name, then, prebuilds) {
584
587
  };
585
588
  then = function (created) {
586
589
  if (res.resolved || res.errored) return;
587
- if (Promise && created instanceof Promise) return created.then(then, crack);
590
+ if (isThenable(created)) return created.then(then, crack);
588
591
  res.resolved = true;
589
592
  res.result = created;
590
593
  res.fire();
591
594
  };
592
595
  var crack = function (error) {
593
596
  if (res.resolved || res.errored) return;
597
+ var ed = errored[name];
598
+ console.error(`加载${name}失败,${ed && ed.length ? `${ed.join(', ')} 等${ed.length}个模块` : "没有其他模块"}受到影响`);
594
599
  res.errored = true;
595
600
  res.error = error;
596
601
  res.fire();
@@ -627,7 +632,7 @@ var init = function (name, then, prebuilds) {
627
632
  }
628
633
  }
629
634
  var created = createModule(module, args, module.argNames, prebuilds);
630
- if (created instanceof Promise) {
635
+ if (isThenable(created)) {
631
636
  if (saveAsModule) {
632
637
  penddings[key] = created;
633
638
  created.then(function (res) {
@@ -829,7 +834,7 @@ var loadResponseTreeFromStorage = function () {
829
834
  var preLoad = function () { };
830
835
 
831
836
  var start_time = +new Date / 1000 | 0;
832
-
837
+ var errored = {};
833
838
  var modules = {
834
839
  isProduction,
835
840
  undefined: void 0,
@@ -0,0 +1,155 @@
1
+ var couple = function (source, marker) {
2
+ var len1 = source.length;
3
+ var len2 = marker.length;
4
+ var match = "", begin1 = len1, begin2 = len2;
5
+ for (var cx = -len1, dx = len2; cx < dx; cx++) {
6
+ var c1 = cx >= 0 ? 0 : -cx;
7
+ var c2 = cx >= 0 ? cx : 0;
8
+ var d1 = len1 - c1;
9
+ var d2 = len2 - c2;
10
+ var start = 0, end = 0;
11
+ for (var ct = 0, dt = d1 > d2 ? d2 : d1; ct < dt; ct++) {
12
+ if (source[c1 + ct] === marker[c2 + ct]) {
13
+ end = ct + 1;
14
+ if (end === dt && end - start > match.length) {
15
+ match = source.slice(c1 + start, c1 + end);
16
+ begin1 = c1 + start;
17
+ begin2 = c2 + start;
18
+ }
19
+ } else {
20
+ if (end - start > match.length) {
21
+ match = source.slice(c1 + start, c1 + end);
22
+ begin1 = c1 + start;
23
+ begin2 = c2 + start;
24
+ }
25
+ start = ct + 1;
26
+ }
27
+ }
28
+ }
29
+ return [match, begin1, begin2];
30
+ };
31
+ var MARK_PRE1, MARK_PRE2, _PRE1, _PRE2 = _PRE1 = "<b>";
32
+ var MARK_AFT1, MARK_AFT2, _AFT1, _AFT2 = _AFT1 = "</b>";
33
+ var mark = function (source, search) {
34
+ return power(source, search)[1];
35
+ };
36
+ var pair = function (source, search, t1, t2, t3, t4) {
37
+ switch (arguments.length) {
38
+ case 2:
39
+ break;
40
+ case 4:
41
+ setTag1(t1, t2);
42
+ setTag2(t1, t2);
43
+ break;
44
+ case 6:
45
+ setTag1(t1, t2);
46
+ setTag2(t3, t4);
47
+ break;
48
+ }
49
+ return power2(source, search);
50
+ }
51
+ var power = function (source, search) {
52
+ if (!search || !source) {
53
+ return [0, source];
54
+ }
55
+ var matchers = couple(source, search);
56
+ var match_text = matchers[0];
57
+ var match_start2 = matchers[1];
58
+ if (search.length === 1) {
59
+ var p = 0;
60
+ var res = source.replace(new RegExp(search.replace(/[\\\*\?\+\(\)\[]/g, "\\$&"), "g"), () => {
61
+ if (!p) p = 1;
62
+ return MARK_PRE1 + search + MARK_AFT1;
63
+ });
64
+ return [p, res];
65
+ }
66
+ if (match_text.length > 1) {
67
+ var match_text_pre = source.slice(0, match_start2);
68
+ var match_text_aft = source.slice(match_start2 + match_text.length);
69
+ var pp = 0, ap = 0;
70
+ var p = match_text.length;
71
+ if (match_text_pre.length) p += .1 / match_text_pre.length - .2;
72
+ if (match_text_aft.length) p += .1 / match_text_aft.length - .1;
73
+ if (match_text_pre.length > 1) {
74
+ [pp, match_text_pre] = power(match_text_pre, search);
75
+ }
76
+ if (match_text_aft.length > 1) {
77
+ [ap, match_text_aft] = power(match_text_aft, search);
78
+ }
79
+ p += (pp + ap) * .01;
80
+ return [p, match_text_pre.concat(MARK_PRE1, match_text, MARK_AFT1, match_text_aft)];
81
+ }
82
+ return [0, source];
83
+ };
84
+
85
+
86
+ var power2 = function (src1, src2) {
87
+
88
+ if (!src2 || !src1) {
89
+ return [src1, src2, 0];
90
+ }
91
+ var matchers = couple(src1, src2);
92
+ var [match_text, match_start1, match_start2] = matchers;
93
+ if (match_text.length > 0) {
94
+ var src1_pre = src1.slice(0, match_start1);
95
+ var src1_aft = src1.slice(match_start1 + match_text.length);
96
+ var src2_pre = src2.slice(0, match_start2);
97
+ var src2_aft = src2.slice(match_start2 + match_text.length);
98
+ var pp = 0, ap = 0;
99
+ var p = match_text.length;
100
+ if (src1_pre.length) p += .1 / src1_pre.length - .2;
101
+ if (src1_aft.length) p += .1 / src1_aft.length - .1;
102
+ if (src1_pre.length > 0 && src2_pre.length > 0) {
103
+ [src1_pre, src2_pre, pp] = power2(src1_pre, src2_pre);
104
+ }
105
+ if (src1_aft.length > 0 && src2_aft.length > 0) {
106
+ [src1_aft, src2_aft, ap] = power2(src1_aft, src2_aft);
107
+ }
108
+ p += (pp + ap) * .01;
109
+ return [
110
+ src1_pre.concat(MARK_PRE1, match_text, MARK_AFT1, src1_aft),
111
+ src2_pre.concat(MARK_PRE2, match_text, MARK_AFT2, src2_aft),
112
+ p
113
+ ];
114
+ }
115
+ return [src1, src2, 0];
116
+
117
+ };
118
+
119
+
120
+ var setTag1 = function (pre, aft) {
121
+ if (arguments.length === 1) {
122
+ if (pre instanceof Array) {
123
+ [pre, aft] = pre;
124
+ }
125
+ else {
126
+ pre.replace(/^<|>$/g, '');
127
+ pre = `<${pre}>`;
128
+ aft = `</${pre}>`;
129
+ }
130
+ }
131
+ MARK_PRE1 = pre;
132
+ MARK_AFT1 = aft;
133
+ };
134
+ var setTag2 = function (pre = _PRE2, aft = _AFT2) {
135
+ if (arguments.length === 1) {
136
+ if (pre instanceof Array) {
137
+ [pre, aft] = pre;
138
+ }
139
+ else {
140
+ pre.replace(/^<|>$/g, '');
141
+ pre = `<${pre}>;`
142
+ aft = `</${pre}>`;
143
+ }
144
+ }
145
+ MARK_PRE2 = pre;
146
+ MARK_AFT2 = aft;
147
+ };
148
+ setTag1(_PRE1, _AFT1);
149
+ setTag2(_PRE2, _AFT2);
150
+ mark.setTag1 = setTag1;
151
+ mark.setTag2 = setTag2;
152
+ mark.power = power;
153
+ mark.power2 = power2;
154
+ mark.pair = pair;
155
+ mark.couple = couple;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  function queue(list, count = 1, context = null) {
3
3
  var f = this;
4
- if (list instanceof Function) {
4
+ if (isFunction(list)) {
5
5
  f = list;
6
6
  list = this;
7
7
  }
8
- if (count instanceof Object) {
8
+ if (isObject(count)) {
9
9
  let temp = count;
10
10
  count = context || temp;
11
11
  context = temp;
@@ -13,39 +13,36 @@ function queue(list, count = 1, context = null) {
13
13
  return new Promise(function (ok, oh) {
14
14
  var cx = 0;
15
15
  var result = [];
16
- var loaded_count = 0;
16
+ var promised = false;
17
17
  var error_count = 0;
18
18
  var reject = function (e) {
19
19
  error_count++;
20
20
  oh(e);
21
21
  };
22
22
  var next = function () {
23
- loaded_count++;
24
23
  run();
25
24
  };
26
25
  var run = function () {
27
- if (error_count && count === 1) return;
28
- if (cx >= list.length) return Promise.all(result).then(ok, oh);
26
+ if (error_count && count === 1) return promised = null;
27
+ if (cx >= list.length) return promised = null, count = 0, Promise.all(result).then(ok, oh);
29
28
  var saved_cx = cx;
30
29
  var args = list[cx];
31
30
  try {
32
31
  result[saved_cx] = f.call(context, args, cx++, list);
33
32
  } catch (e) {
34
33
  oh(e);
35
- return;
34
+ return promised = null;
36
35
  }
37
- Promise.resolve(result[saved_cx]).then(next, reject);
36
+ if (promised === false && (!result[saved_cx] || !isFunction(result[saved_cx].then))) count++;
37
+ else Promise.resolve(result[saved_cx]).then(next, reject), promised = true;
38
38
  };
39
- if (count > list.length >> 1) {
40
- count = list.length >> 1;
39
+ if (count > list.length) {
40
+ count = list.length;
41
41
  }
42
42
  if (!(count >= 1)) {
43
43
  count = 1;
44
44
  }
45
- if (list.length === 0) run();
46
- else while (cx < count) {
47
- run();
48
- }
45
+ while (count-- > 0) run();
49
46
  });
50
47
  }
51
48
  module.exports = queue;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * {a:b,c:d, ...z} = o;
3
+ * params (o , [a,c])
4
+ * return z
5
+ */
6
+ function rest_(o, keys) {
7
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
8
+ var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
9
+ var map = Object.create(null);
10
+ for (var k of keys) map[k] = true;
11
+ var res = Object.create(null);
12
+ for (var k in o) {
13
+ if (hasOwnProperty.call(o, k)) {
14
+ if (k in map) continue;
15
+ res[k] = o[k];
16
+ }
17
+ }
18
+ if (typeof Object.getOwnPropertySymbols === 'function') {
19
+ for (var k of Object.getOwnPropertySymbols(o)) {
20
+ if (propertyIsEnumerable.call(o, k)) {
21
+ if (k in map) continue;
22
+ res[k] = o[k];
23
+ }
24
+ }
25
+ }
26
+ return res;
27
+ }
@@ -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 {
@@ -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 ||
@@ -1 +1,64 @@
1
- "use ../compile/compile.js"
1
+ "use strict";
2
+ var Scanner = function (dataString, syntax) {
3
+ this.source = dataString;
4
+ this.syntax = syntax.syntax;
5
+ this.entry = syntax.entry;
6
+ var Token = this.token = syntax.token;
7
+ var block = this.block = new Token(syntax.entry, 0);
8
+ block.scanner = this;
9
+ this.blocks = this.block.children = [];
10
+ this.source = dataString;
11
+ }
12
+ Scanner.prototype = {
13
+ scan(index = 0, type = this.entry, collection = this.blocks, parent = this.block) {
14
+ var regInfo = this.syntax[type];
15
+ var dataString = this.source;
16
+ var Block = this.token;
17
+ if (!regInfo) return index;
18
+ if (!(regInfo instanceof Array)) {
19
+ regInfo = [regInfo];
20
+ }
21
+ var reg = regInfo[0];
22
+ loop: while (index < dataString.length) {
23
+ reg.lastIndex = index;
24
+ var res = reg.exec(dataString, collection);
25
+ if (res) {
26
+ index = reg.lastIndex;
27
+ var inc = 0;
28
+ while (res[++inc] === undefined) {
29
+ if (inc >= regInfo.length) break loop;
30
+ }
31
+ var matchType = regInfo[inc];
32
+ if (!matchType) continue;
33
+ var savedIndex = reg.lastIndex - res[inc].length;
34
+ var children = [];
35
+ var block = new Block(matchType, savedIndex);
36
+ block.parent = parent;
37
+ block.children = children;
38
+ block.root = this.block;
39
+ block.scanner = this;
40
+ index = this.scan(index, matchType, children, block);
41
+ if (collection && savedIndex < index) {
42
+ if (collection.length) {
43
+ var lastChild = collection[collection.length - 1];
44
+ block.prev = lastChild;
45
+ lastChild.next = block;
46
+ }
47
+ collection.push(block);
48
+ }
49
+ block.end = index;
50
+ } else if (/y/.test(reg.flags)) {
51
+ throw new Error(`unexcepted token ${dataString[index]}`);
52
+ } else {
53
+ index = dataString.length;
54
+ }
55
+ }
56
+ return index;
57
+ }
58
+ }
59
+ var scan = function (data, syntax) {
60
+ var scanner = new Scanner(data, syntax);
61
+ scanner.scan();
62
+ return scanner.blocks;
63
+ };
64
+ module.exports = scan;
File without changes
@@ -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;
@@ -631,7 +631,7 @@ function getFromScopes(key, scope, parentScopes) {
631
631
 
632
632
  function renderElement(element, scope = element.$scope, parentScopes = element.$parentScopes, once) {
633
633
  if (!isNode(element) && element.length) {
634
- return Array.prototype.map.call(element, function (element) {
634
+ return Array.prototype.concat.apply([], element).map(function (element) {
635
635
  return renderElement(element, scope, parentScopes, once);
636
636
  });
637
637
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.24.2",
3
+ "version": "3.24.7",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {