efront 4.13.2 → 4.14.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.
- package/#/345/233/275/351/231/205/345/214/226.yml +5 -2
- package/apps/kugou/search/search.js +1 -1
- package/apps/kugou/singer/list.jsp +6 -0
- package/apps/kugou/song/list.js +1 -1
- package/apps/kugou/song/list.jsp +6 -0
- package/coms/basic/data.js +9 -1
- package/coms/kugou/buildList.js +2 -2
- package/coms/kugou/format-singer-names.js +1 -0
- package/coms/kugou/parseSongsList.js +25 -3
- package/coms/kugou/player.js +11 -10
- package/coms/kugou/player.less +3 -2
- package/coms/reptile/colored_console.js +29 -9
- package/coms/zimoli/menuList.less +0 -1
- package/coms/zimoli/vbox.js +4 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/coms/kugou/kugouapi.js +0 -141
- package/coms/kugou/kugouapi_test.js +0 -3
- /package/coms/{basic/analyse.js → /350/214/253/350/214/253/analyse.js"} +0 -0
- /package/coms/{basic/analyse_test.js → /350/214/253/350/214/253/analyse_test.js"} +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
- zh-CN: $1不是有效的色彩信息
|
|
2
|
+
en: $1 is not a valid color
|
|
3
|
+
|
|
1
4
|
- zh-CN: 加载失败
|
|
2
5
|
en: Loading failed
|
|
3
6
|
|
|
@@ -316,8 +319,8 @@
|
|
|
316
319
|
- zh-CN: 检查到两个菜单项使用了相同的快捷键
|
|
317
320
|
en: Checked that two menu items used the same shortcut key
|
|
318
321
|
|
|
319
|
-
- zh-CN: 如您需要使用参数--SCITER或--QUICKJS或--QJS
|
|
320
|
-
en: "If you need to use the parameters --SCITER or --QUICKJS or --QJS, please purchase the authorization
|
|
322
|
+
- zh-CN: 如您需要使用参数--SCITER或--QUICKJS或--QJS,请联系作者购买授权(暂定50元人民币)
|
|
323
|
+
en: "If you need to use the parameters --SCITER or --QUICKJS or --QJS, please concat the author and purchase the authorization, it costs 50 CNY now."
|
|
321
324
|
|
|
322
325
|
- zh-CN: 检测到错误,无法建立代码关联:$1
|
|
323
326
|
en: "Error detected, unable to establish code association: $1"
|
|
@@ -35,7 +35,7 @@ function main(params, from) {
|
|
|
35
35
|
resultMap: null,
|
|
36
36
|
addResult(info) {
|
|
37
37
|
var resultMap = this.resultMap;
|
|
38
|
-
|
|
38
|
+
var singerName = sortname(String(info.singername || '').split(/[\&\,,、]/)).join('、');
|
|
39
39
|
var songName = info.songname;
|
|
40
40
|
var id = `${singerName}:${info.songname}`;
|
|
41
41
|
if (!resultMap[id]) resultMap[id] = Object.assign([], { singer: singerName, song: songName });
|
package/apps/kugou/song/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
buildList('songs-list');
|
|
1
|
+
buildList(['song/list.jsp', 'songs-list']);
|
package/coms/basic/data.js
CHANGED
|
@@ -815,12 +815,20 @@ var data = {
|
|
|
815
815
|
return createApiMap(o);
|
|
816
816
|
}
|
|
817
817
|
},
|
|
818
|
+
fromAll(refs, params, parse) {
|
|
819
|
+
return this.createResponse(Promise.all(refs.map(r => this.from(r, params, parse))).then(datas => {
|
|
820
|
+
return datas.concat.apply([], datas);
|
|
821
|
+
}));
|
|
822
|
+
},
|
|
818
823
|
from(ref, params, parse) {
|
|
819
824
|
if (params instanceof Function) {
|
|
820
825
|
parse = params;
|
|
821
826
|
params = {};
|
|
822
827
|
}
|
|
823
|
-
if (
|
|
828
|
+
if (isArray(ref)) {
|
|
829
|
+
return this.fromAll(ref, params, parse);
|
|
830
|
+
}
|
|
831
|
+
else if (isObject(ref)) {
|
|
824
832
|
return this.fromApi(ref, params, parse);
|
|
825
833
|
}
|
|
826
834
|
else if (/^\.*\/|\.\w+$/.test(ref)) {
|
package/coms/kugou/buildList.js
CHANGED
|
@@ -6,7 +6,7 @@ function main(dataid, datapath) {
|
|
|
6
6
|
padding,
|
|
7
7
|
song,
|
|
8
8
|
loading,
|
|
9
|
-
musicList:kugou$musicList,
|
|
9
|
+
musicList: kugou$musicList,
|
|
10
10
|
async run(s) {
|
|
11
11
|
if (!s.hash && s.hashid) {
|
|
12
12
|
await data.from("song-mix", s, function (a) {
|
|
@@ -14,7 +14,7 @@ function main(dataid, datapath) {
|
|
|
14
14
|
if (m) s.hash = m[3];
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
if (s.hash) {
|
|
17
|
+
if (s.hash || s.url) {
|
|
18
18
|
kugou$player.play(s);
|
|
19
19
|
} else {
|
|
20
20
|
go(datapath, s);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a => a.split(/[\&\,,、]/).join('、');
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
var singerPhotosMap = Object.create(null);
|
|
2
|
+
data.from("singer/list.jsp", function (a) {
|
|
3
|
+
a.forEach(a => {
|
|
4
|
+
var b = a.replace(/\.\w+$/, '');
|
|
5
|
+
singerPhotosMap[b] = a;
|
|
6
|
+
})
|
|
7
|
+
})
|
|
8
|
+
return a => {
|
|
2
9
|
if (isElement(a)) {
|
|
3
10
|
var m = /songsdata\s*=\s*(\[[\s\S]*\])/.exec(a.innerText);
|
|
4
11
|
if (!m) throw new Error(i18n`无法加载数据!`);
|
|
@@ -7,16 +14,31 @@ a => {
|
|
|
7
14
|
}
|
|
8
15
|
if (a) return a.map(b => {
|
|
9
16
|
var data = {};
|
|
17
|
+
|
|
10
18
|
if (b.data) extend(data, {
|
|
11
19
|
name: b.data.filename.replace(/^[\s\S]*?\s*\-\s*/, ''),
|
|
12
20
|
singer: b.data.filename.replace(/\s*\-\s*[\s\S]*?$/, '')
|
|
13
21
|
}, b.data);
|
|
14
|
-
else extend(data, b);
|
|
15
|
-
if (
|
|
22
|
+
else if (isObject(b)) extend(data, b);
|
|
23
|
+
if (typeof b === 'string') {
|
|
24
|
+
var [name, singer] = b.replace(/\.\w+$/, '').split(/\s*-\s*/);
|
|
25
|
+
data.name = name;
|
|
26
|
+
data.singer = singer;
|
|
27
|
+
data.url = "song/" + b;
|
|
28
|
+
|
|
29
|
+
} if (!data.singer) {
|
|
16
30
|
data.singer = data.author_name;
|
|
17
31
|
}
|
|
18
32
|
if (!data.name) data.name = data.audio_name;
|
|
19
33
|
if (data.hash) data.hash = data.hash.replace(/^songs\_/i, '');
|
|
34
|
+
if (data.singer) data.singer = formatSingerNames(data.singer);
|
|
35
|
+
if (!data.avatar && data.singer) {
|
|
36
|
+
var singer0 = data.singer.split("、")[0];
|
|
37
|
+
console.log(singer0)
|
|
38
|
+
if (singer0 in singerPhotosMap) data.avatar = `singer/` + singerPhotosMap[singer0];
|
|
39
|
+
}
|
|
40
|
+
if (!data.singerName) data.singerName = data.singer;
|
|
41
|
+
if (!data.songName) data.songName = data.name;
|
|
20
42
|
return data;
|
|
21
43
|
});
|
|
22
44
|
|
package/coms/kugou/player.js
CHANGED
|
@@ -37,14 +37,15 @@ var patchMusicInfo = async function (info) {
|
|
|
37
37
|
info.songName = info.songname;
|
|
38
38
|
break;
|
|
39
39
|
case "kugo":
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
if (info.hash) {
|
|
41
|
+
res = await data.from("song-info", info);
|
|
42
|
+
krc = await data.from("search-krc", res);
|
|
43
|
+
krc = await data.from("download-krc", krc);
|
|
44
|
+
info.krc = fromBase64(krc);
|
|
45
|
+
if (res.fail_process === 12) res.priced = true;
|
|
46
|
+
if (res.imgUrl) {
|
|
47
|
+
res.avatar = res.imgUrl.replace(/\{size\}/ig, 200);
|
|
48
|
+
}
|
|
48
49
|
}
|
|
49
50
|
break;
|
|
50
51
|
}
|
|
@@ -140,10 +141,10 @@ var $scope = {
|
|
|
140
141
|
activeList: playList,
|
|
141
142
|
index: 0,
|
|
142
143
|
getSongName() {
|
|
143
|
-
return this.info.
|
|
144
|
+
return this.info.songname || this.info.songName;
|
|
144
145
|
},
|
|
145
146
|
getSingerName() {
|
|
146
|
-
return this.info.
|
|
147
|
+
return this.info.singername || this.info.singerName;
|
|
147
148
|
},
|
|
148
149
|
update() {
|
|
149
150
|
if (touching) return;
|
package/coms/kugou/player.less
CHANGED
|
@@ -130,13 +130,14 @@
|
|
|
130
130
|
border-color: @main-color;
|
|
131
131
|
box-shadow: 0 0 6px -3px @main-color;
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
|
|
134
134
|
>.track {
|
|
135
|
+
background: @main-color;
|
|
135
136
|
opacity: .7;
|
|
136
137
|
transition: height .3s, opacity .3s;
|
|
137
138
|
top: 12px;
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
+
|
|
140
141
|
>.avatar {
|
|
141
142
|
opacity: 1;
|
|
142
143
|
top: 0;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var EOL = require("os").EOL;
|
|
2
3
|
var colored = Object.create(null);
|
|
3
4
|
var lazy = require("../basic/lazy");
|
|
4
5
|
var colors = require("./colors");
|
|
@@ -40,12 +41,17 @@ var renderColor = function (obj) {
|
|
|
40
41
|
var write = function (hasNewLine, str) {
|
|
41
42
|
process.stdout.cork();
|
|
42
43
|
var hasNextLine = /[\r\n\u2028\u2029]$/.test(str);
|
|
44
|
+
var width = process.stdout.columns;
|
|
43
45
|
if (process.stdout.isTTY) {
|
|
44
46
|
if (lastLogLength) {
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
var loged = lastLogLength;
|
|
48
|
+
lastLogLength = 0;
|
|
49
|
+
loged.forEach(lastLogLength => {
|
|
50
|
+
var dx = lastLogLength % width;
|
|
51
|
+
var dy = (lastLogLength - 1) / width | 0;
|
|
52
|
+
process.stdout.moveCursor(- dx, -1 - dy);
|
|
53
|
+
});
|
|
54
|
+
process.stdout.moveCursor(0, 1);
|
|
49
55
|
process.stdout.clearScreenDown();
|
|
50
56
|
}
|
|
51
57
|
}
|
|
@@ -67,8 +73,13 @@ var write = function (hasNewLine, str) {
|
|
|
67
73
|
if (hasNewLine) {
|
|
68
74
|
lastLogLength = 0;
|
|
69
75
|
} else {
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
var rs = String(str).split(/\r\n|\r|\n|\u2028|\u2029/);
|
|
77
|
+
var cr = r => {
|
|
78
|
+
if (!r) return r;
|
|
79
|
+
r = r.replace(/\x1b\[\d+m/g, '').replace(/\b/g, '');
|
|
80
|
+
return r.length + r.replace(/[\x20-\xff]/g, "").length;
|
|
81
|
+
};
|
|
82
|
+
lastLogLength = rs.map(cr).reverse();
|
|
72
83
|
}
|
|
73
84
|
process.stdout.uncork();
|
|
74
85
|
};
|
|
@@ -88,7 +99,11 @@ var write = function (hasNewLine, str) {
|
|
|
88
99
|
var logger = function () {
|
|
89
100
|
var label = logger.tip ? fgColor + bgColor + logger.tip + reset : '';
|
|
90
101
|
var time_stamp = '';
|
|
91
|
-
var
|
|
102
|
+
var mark = [time_stamp, label].filter(a => !!a)
|
|
103
|
+
var str = Array.prototype.map.call(arguments, a => renderColor(a)).join(" ").split(/\r\n|\r|\n/).map(a => {
|
|
104
|
+
if (a) return mark.concat(a).join(' ');
|
|
105
|
+
else return a;
|
|
106
|
+
}).join(EOL);
|
|
92
107
|
write1(hasNewLine, str);
|
|
93
108
|
};
|
|
94
109
|
logger.tip = info;
|
|
@@ -121,7 +136,7 @@ var formatRows = function (arg, rows, deep, entry, leave) {
|
|
|
121
136
|
var hasNextLine = false;
|
|
122
137
|
var isArray = arg instanceof Array;
|
|
123
138
|
for (var r of rows) {
|
|
124
|
-
if (/[\r\n\u2028\u2029]
|
|
139
|
+
if (/[\r\n\u2028\u2029]$/.test(r)) {
|
|
125
140
|
itemcount = 1;
|
|
126
141
|
hasNextLine = true;
|
|
127
142
|
break;
|
|
@@ -262,10 +277,15 @@ colored.line = function () {
|
|
|
262
277
|
};
|
|
263
278
|
var _log = console.log;
|
|
264
279
|
colored.log = function () {
|
|
265
|
-
if (lastLogLength
|
|
280
|
+
if (lastLogLength) write1(false, '');
|
|
266
281
|
if (needNextLine) needNextLine = false;
|
|
267
282
|
_log.apply(console, arguments);
|
|
268
283
|
};
|
|
284
|
+
colored.wrap = function (c, content) {
|
|
285
|
+
var c = getColor(c);
|
|
286
|
+
if (!c) throw new Error(i18n`${c}不是有效的色彩信息`);
|
|
287
|
+
return c + content + colors.Reset;
|
|
288
|
+
}
|
|
269
289
|
colored.begin = function (c) {
|
|
270
290
|
return write1(false, getColor(c));
|
|
271
291
|
};
|
package/coms/zimoli/vbox.js
CHANGED
|
@@ -159,6 +159,10 @@ function ybox(generator) {
|
|
|
159
159
|
box = getTargetIn(e => e === _box || /^(?:auto|scroll)$/i.test(getComputedStyle(e).overflowY) && e.scrollHeight - e.scrollTop > e.clientHeight, event.target);
|
|
160
160
|
}
|
|
161
161
|
if (box === _box) {
|
|
162
|
+
var wheelDelta = event.wheelDelta;
|
|
163
|
+
if (wheelDelta && wheelDelta !== deltay) {
|
|
164
|
+
deltay /= 6;
|
|
165
|
+
}
|
|
162
166
|
scrollY.call(_box, -deltay, false);
|
|
163
167
|
stop2();
|
|
164
168
|
}
|