efront 3.33.2 → 3.34.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/apps/kugou/icons/kugo.ico +0 -0
- package/apps/kugou/icons/kuwo.png +0 -0
- package/apps/kugou/index.html +1 -1
- package/apps/kugou/main.js +4 -0
- package/apps/kugou/search/search.html +3 -4
- package/apps/kugou/search/search.js +37 -5
- package/apps/kugou/search/search.less +3 -0
- package/coms/basic/cookie.js +17 -15
- package/coms/basic/cross_.js +31 -26
- package/coms/kugou/api.js +15 -1
- package/coms/kugou/buildList.html +1 -1
- package/coms/kugou/buildList.js +2 -2
- package/coms/kugou/buildScroll.js +1 -1
- package/coms/kugou/getSandbox.js +1 -1
- package/coms/kugou/krc.js +8 -4
- package/coms/kugou/musicList.js +37 -2
- package/coms/kugou/page.js +6 -6
- package/coms/kugou/playList.html +1 -1
- package/coms/kugou/playList.js +0 -1
- package/coms/kugou/playList.less +9 -2
- package/coms/kugou/player.js +42 -30
- package/coms/kugou/song.html +8 -3
- package/coms/kugou/song.js +26 -3
- package/coms/kugou/song.less +72 -16
- package/coms/reptile/colored_console.js +1 -1
- package/coms/reptile/cross.js +6 -2
- package/coms/zimoli/Canvas.js +7 -7
- package/coms/zimoli/anchor.js +2 -2
- package/coms/zimoli/anniu.js +6 -6
- package/coms/zimoli/button.js +9 -6
- package/coms/zimoli/cloneVisible.js +2 -3
- package/coms/zimoli/createElement.js +1 -1
- package/coms/zimoli/cross.js +12 -0
- package/coms/zimoli/data.js +1 -1
- package/coms/zimoli/dateslider.js +8 -8
- package/coms/zimoli/download.js +1 -1
- package/coms/zimoli/editor.js +2 -2
- package/coms/zimoli/gallery.js +2 -2
- package/coms/zimoli/gallery.less +1 -1
- package/coms/zimoli/getGenerator.js +1 -6
- package/coms/zimoli/group.js +2 -2
- package/coms/zimoli/hline.js +1 -1
- package/coms/zimoli/icon.js +3 -3
- package/coms/zimoli/input.js +2 -2
- package/coms/zimoli/label.js +3 -3
- package/coms/zimoli/list.js +17 -28
- package/coms/zimoli/mask.js +2 -2
- package/coms/zimoli/option.js +7 -7
- package/coms/zimoli/render.js +1 -0
- package/coms/zimoli/selectDate.js +2 -2
- package/coms/zimoli/space.js +1 -1
- package/coms/zimoli/swap.js +1 -1
- package/coms/zimoli/titlebar.js +4 -4
- package/coms/zimoli/vbox.js +1 -1
- package/coms/zimoli/video.js +1 -1
- package/coms/zimoli/zimoli.js +1 -1
- package/package.json +1 -1
- package/public/efront.js +1 -1
|
Binary file
|
|
Binary file
|
package/apps/kugou/index.html
CHANGED
|
@@ -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
|
|
13
|
+
<title>酷狗酷你尊享版</title><!-- 这个名字怎么听怎么像骂狗的,你和狗怎么可以放在相同的位置,真是太抬举你了 -->
|
|
14
14
|
<script deleteoncompile efrontloader>
|
|
15
15
|
// 若要在开发环境使用内置组件,请保留此script标签中的代码,在编译发布时,这里的代码会自动删除
|
|
16
16
|
</script>
|
package/apps/kugou/main.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<titlebar>
|
|
2
2
|
<back></back>
|
|
3
|
-
<input placeholder="请输入关键字搜索" ng-model=keyword
|
|
4
|
-
ng-keyup="event.which===13?confirm():search(this.value)" />
|
|
3
|
+
<input placeholder="请输入关键字搜索" ng-model=keyword ng-keyup="event.which===13?confirm():search(this.value)" />
|
|
5
4
|
<icon class="loading" ng-if="result?.loading"></icon>
|
|
6
5
|
<btn ng-click="keyword='';search()">清空</btn>
|
|
7
6
|
</titlebar>
|
|
@@ -13,8 +12,8 @@
|
|
|
13
12
|
<btn ng-click="search(s,0)"><span ng-bind="s"></span></btn>
|
|
14
13
|
</padding>
|
|
15
14
|
</div>
|
|
16
|
-
<list
|
|
15
|
+
<list -else ng-src="s in result" min-width=260 >
|
|
17
16
|
<padding>
|
|
18
|
-
<song _mark=keyword
|
|
17
|
+
<song _mark=keyword @play="play(event.value)" ng-src=s></song>
|
|
19
18
|
</padding>
|
|
20
19
|
</list>
|
|
@@ -19,8 +19,9 @@ function main(params, from) {
|
|
|
19
19
|
searchHistory,
|
|
20
20
|
player: kugou$player,
|
|
21
21
|
padding,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
list: gallery,
|
|
23
|
+
play(info) {
|
|
24
|
+
this.player.play(info);
|
|
24
25
|
var words = searchHistory.slice(0);
|
|
25
26
|
var { keyword } = this;
|
|
26
27
|
for (var cx = words.length - 1; cx >= 0; cx--) {
|
|
@@ -30,10 +31,41 @@ function main(params, from) {
|
|
|
30
31
|
words = words.slice(0, 20);
|
|
31
32
|
data.setInstance("searchHistory", words, true);
|
|
32
33
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
resultMap: null,
|
|
35
|
+
addResult(info) {
|
|
36
|
+
var resultMap = this.resultMap;
|
|
37
|
+
var singerName = sortname(String(info.singername || '').split(/[\&\,,、]/)).join('、');
|
|
38
|
+
var songName = info.songname;
|
|
39
|
+
var id = `${singerName}:${info.songname}`;
|
|
40
|
+
if (!resultMap[id]) resultMap[id] = Object.assign([], { singer: singerName, song: songName });
|
|
41
|
+
resultMap[id].push(info);
|
|
42
|
+
},
|
|
43
|
+
async requestSearch(type, id, params, mp, timeout) {
|
|
44
|
+
var res = await data.from(id, params, timeout);
|
|
45
|
+
if (mp !== this.resultMap) return;
|
|
46
|
+
res.forEach(a => a.type = type);
|
|
47
|
+
res.forEach(this.addResult, this);
|
|
48
|
+
this.result = Object.keys(this.resultMap).map(k => this.resultMap[k]);
|
|
49
|
+
for (var r of this.result) r.sort((a, b) => a.priced - b.priced);
|
|
50
|
+
return res;
|
|
51
|
+
},
|
|
52
|
+
searched: null,
|
|
53
|
+
async search(keyword = this.keyword, timeout = 600) {
|
|
54
|
+
if (keyword === this.searched) return;
|
|
55
|
+
this.keyword = keyword;
|
|
56
|
+
this.searched = keyword;
|
|
57
|
+
this.resultMap = Object.create(null);
|
|
58
|
+
this.result = [];
|
|
59
|
+
var s1 = this.requestSearch("kugo", 'search', { keyword }, this.resultMap, timeout);
|
|
60
|
+
var s2 = this.requestSearch("kuwo", "search-kuwo", { key: keyword }, this.resultMap, timeout);
|
|
36
61
|
state({ keyword });
|
|
62
|
+
s1.then(function (s1) {
|
|
63
|
+
s1.forEach(a => {
|
|
64
|
+
a.priced = a.privilege === 10 && (a.price_sq > 0);
|
|
65
|
+
});
|
|
66
|
+
})
|
|
67
|
+
await Promise.all([s1, s2]);
|
|
68
|
+
|
|
37
69
|
},
|
|
38
70
|
confirm() {
|
|
39
71
|
this.search(void 0, 0);
|
package/coms/basic/cookie.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var cookiesMap = {};
|
|
2
1
|
var parseCookieFromText = function (cookie) {
|
|
3
2
|
var pairs = cookie.split(/;\s*/);
|
|
4
3
|
var info = {};
|
|
@@ -22,7 +21,12 @@ var parseCookieFromText = function (cookie) {
|
|
|
22
21
|
return [pair, info];
|
|
23
22
|
};
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
class Cookie {
|
|
25
|
+
cookiesMap = {};
|
|
26
|
+
}
|
|
27
|
+
var CookieProto = Cookie.prototype;
|
|
28
|
+
CookieProto.addCookie = function addCookie(cookie_text, originDomain = "") {
|
|
29
|
+
var { cookiesMap } = this;
|
|
26
30
|
originDomain = getDomainPath(originDomain);
|
|
27
31
|
if (!cookie_text) return;
|
|
28
32
|
if (cookie_text instanceof Array) cookie_text = cookie_text.join(",");
|
|
@@ -57,7 +61,8 @@ function addCookie(cookie_text, originDomain = "") {
|
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
|
|
60
|
-
function getCookies(domainPath) {
|
|
64
|
+
CookieProto.getCookies = function getCookies(domainPath) {
|
|
65
|
+
var { cookiesMap } = this;
|
|
61
66
|
domainPath = getDomainPath(domainPath);
|
|
62
67
|
var cookieObject = {};
|
|
63
68
|
var splited = domainPath.split("/");
|
|
@@ -88,7 +93,8 @@ function getCookies(domainPath) {
|
|
|
88
93
|
return serialize(cookieObject, ";");
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
function delCookies(domainPath) {
|
|
96
|
+
CookieProto.delCookies = function delCookies(domainPath) {
|
|
97
|
+
var { cookiesMap } = this;
|
|
92
98
|
domainPath = getDomainPath(domainPath);
|
|
93
99
|
var splited = domainPath.split("/");
|
|
94
100
|
var domain = splited[0];
|
|
@@ -100,7 +106,8 @@ function getDomainPath(url) {
|
|
|
100
106
|
return host;
|
|
101
107
|
}
|
|
102
108
|
|
|
103
|
-
function linkCookie(from, to) {
|
|
109
|
+
CookieProto.linkCookie = function linkCookie(from, to) {
|
|
110
|
+
var { cookiesMap } = this;
|
|
104
111
|
from = getDomainPath(from).replace(/\/$/, '');
|
|
105
112
|
to = getDomainPath(to).replace(/\/$/, '');
|
|
106
113
|
if (cookiesMap[from]) {
|
|
@@ -109,7 +116,8 @@ function linkCookie(from, to) {
|
|
|
109
116
|
cookiesMap[to] = cookiesMap[from] = extend({}, cookiesMap[to], cookiesMap[from]);
|
|
110
117
|
return to;
|
|
111
118
|
}
|
|
112
|
-
function copyCookie(from, to) {
|
|
119
|
+
CookieProto.copyCookie = function copyCookie(from, to) {
|
|
120
|
+
var { cookiesMap } = this;
|
|
113
121
|
from = getDomainPath(from).replace(/\/$,'/, '');
|
|
114
122
|
to = getDomainPath(to).replace(/\/$/, '');
|
|
115
123
|
if (from in cookiesMap) {
|
|
@@ -119,12 +127,6 @@ function copyCookie(from, to) {
|
|
|
119
127
|
delete cookiesMap[to];
|
|
120
128
|
}
|
|
121
129
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
addCookie,
|
|
126
|
-
getCookies,
|
|
127
|
-
delCookies,
|
|
128
|
-
linkCookie,
|
|
129
|
-
copyCookie
|
|
130
|
-
}
|
|
130
|
+
var defaultCookie = new Cookie;
|
|
131
|
+
defaultCookie.new = () => new Cookie;
|
|
132
|
+
return defaultCookie;
|
package/coms/basic/cross_.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var { getCookies, addCookie, delCookies } = cookie;
|
|
2
1
|
var { File } = this;
|
|
3
2
|
function hasFile(o) {
|
|
4
3
|
if (!File) return false;
|
|
@@ -43,14 +42,7 @@ var getCrossUrl = function (domain, headers, encrypt) {
|
|
|
43
42
|
if (!encrypt) return domain;
|
|
44
43
|
domain = domain.replace(domainReg, "/$3$4");
|
|
45
44
|
}
|
|
46
|
-
var
|
|
47
|
-
var _cookies = getCookies(originDomain);
|
|
48
|
-
var _headers = {};
|
|
49
|
-
if (_cookies) {
|
|
50
|
-
_headers.Cookie = _cookies;
|
|
51
|
-
}
|
|
52
|
-
extend(_headers, headers);
|
|
53
|
-
_headers = serialize(_headers);
|
|
45
|
+
var _headers = serialize(headers);
|
|
54
46
|
if (_headers) _headers = "," + _headers;
|
|
55
47
|
var b = encrypt ? "!" : `*`;
|
|
56
48
|
var ishttps = /^(https\:|s\/\/)/i.test(domain);
|
|
@@ -137,18 +129,6 @@ function createResponse(response, status = 0) {
|
|
|
137
129
|
function cross_(jsonp, digest = noop, method, url, headers) {
|
|
138
130
|
var originDomain = getDomainPath(url);
|
|
139
131
|
if (!originDomain) throw new Error("路径格式错误!");
|
|
140
|
-
var _cookies = getCookies(originDomain);
|
|
141
|
-
var _headers = {};
|
|
142
|
-
if (_cookies) {
|
|
143
|
-
_headers.Cookie = _cookies;
|
|
144
|
-
}
|
|
145
|
-
extend(_headers, headers);
|
|
146
|
-
if (/^[mc]/i.test(method)) {
|
|
147
|
-
_headers["User-Agent"] = /^m/i.test(method)
|
|
148
|
-
? "efront/3.25 (iPhone) Safari/602.1"
|
|
149
|
-
: "efront/3.25 (Windows) Chrome/77.0.3865.90";
|
|
150
|
-
method = method.slice(1);
|
|
151
|
-
}
|
|
152
132
|
var loaded, errored;
|
|
153
133
|
var onload = function (data) {
|
|
154
134
|
if (!~requests.indexOf(_xhr)) return;
|
|
@@ -232,7 +212,7 @@ function cross_(jsonp, digest = noop, method, url, headers) {
|
|
|
232
212
|
onerror({ status: xhr.status, response: "Cookie解析异常!", toString: toResponse });
|
|
233
213
|
return;
|
|
234
214
|
}
|
|
235
|
-
addCookie(cookie, originDomain);
|
|
215
|
+
cookie_.addCookie(cookie, originDomain);
|
|
236
216
|
}
|
|
237
217
|
|
|
238
218
|
}
|
|
@@ -385,6 +365,32 @@ function cross_(jsonp, digest = noop, method, url, headers) {
|
|
|
385
365
|
}
|
|
386
366
|
var setRequestHeader = xhr.setRequestHeader;
|
|
387
367
|
var realHeaders = Object.create(null);
|
|
368
|
+
var cookie_ = this.hostCookie(xhr);
|
|
369
|
+
var _cookies = cookie_.getCookies(originDomain);
|
|
370
|
+
var _headers = {};
|
|
371
|
+
if (_cookies) {
|
|
372
|
+
_headers.Cookie = _cookies;
|
|
373
|
+
}
|
|
374
|
+
var cookobj = null;
|
|
375
|
+
for (var k in headers) {
|
|
376
|
+
if (/^\$/.test(headers[k])) {
|
|
377
|
+
var k2 = headers[k].slice(1);
|
|
378
|
+
if (!cookobj) cookobj = _cookies ? parseKV(_cookies, ';') : {};
|
|
379
|
+
if (k2 in cookobj) {
|
|
380
|
+
_headers[k] = cookobj[k2];
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
_headers[k] = headers[k];
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (/^[mc]/i.test(method)) {
|
|
388
|
+
_headers["User-Agent"] = /^m/i.test(method)
|
|
389
|
+
? "efront/3.25 (iPhone) Safari/602.1"
|
|
390
|
+
: "efront/3.25 (Windows) Chrome/77.0.3865.90";
|
|
391
|
+
method = method.slice(1);
|
|
392
|
+
}
|
|
393
|
+
|
|
388
394
|
xhr.setRequestHeader = function (key, value) {
|
|
389
395
|
realHeaders[key] = value;
|
|
390
396
|
};
|
|
@@ -412,12 +418,12 @@ function cross_(jsonp, digest = noop, method, url, headers) {
|
|
|
412
418
|
};
|
|
413
419
|
xhr.abort = XMLHttpRequest_abort;
|
|
414
420
|
xhr.delCookies = function () {
|
|
415
|
-
delCookies(originDomain);
|
|
421
|
+
cookie_.delCookies(originDomain);
|
|
416
422
|
xhr.nocookie = true;
|
|
417
423
|
return xhr;
|
|
418
424
|
};
|
|
419
425
|
xhr.getCookies = function () {
|
|
420
|
-
return getCookies(originDomain);
|
|
426
|
+
return cookie_.getCookies(originDomain);
|
|
421
427
|
};
|
|
422
428
|
requests.push(xhr);
|
|
423
429
|
var _xhr = xhr;
|
|
@@ -471,6 +477,7 @@ var bind = cross_.bind;
|
|
|
471
477
|
cross_.bind = function () {
|
|
472
478
|
var cross_ = bind.apply(this, arguments);
|
|
473
479
|
arguments[0].getCode = getCode.bind(cross_);
|
|
480
|
+
arguments[0].hostCookie = function () { return cross_.hostCookie.apply(this, arguments) };
|
|
474
481
|
extend(cross_, {
|
|
475
482
|
requests,
|
|
476
483
|
abortAll() {
|
|
@@ -478,8 +485,6 @@ cross_.bind = function () {
|
|
|
478
485
|
},
|
|
479
486
|
setHost,
|
|
480
487
|
addReform,
|
|
481
|
-
getCookies,
|
|
482
|
-
addCookie,
|
|
483
488
|
addDirect,
|
|
484
489
|
getCrossUrl
|
|
485
490
|
});
|
package/coms/kugou/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
({
|
|
2
2
|
"https://m.kugou.com/": {
|
|
3
|
-
"song-info": "get app/i/getSongInfo.php?cmd=playInfo&from=mkugou
|
|
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
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",
|
|
@@ -20,5 +20,19 @@
|
|
|
20
20
|
},
|
|
21
21
|
"http://mobilecdn.kugou.com/": {
|
|
22
22
|
"search?keyword": "get:data.info api/v3/search/song?format=json&page=1&pagesize=30&showtype=1"
|
|
23
|
+
},
|
|
24
|
+
"http://www.kuwo.cn/": {
|
|
25
|
+
"kuwo-token"/*主要用于初始化kw_token*/: "get",
|
|
26
|
+
},
|
|
27
|
+
"http://www.kuwo.cn/api/www/ csrf=$kw_token": {
|
|
28
|
+
"search-kuwo;key": "get:data.list search/searchMusicBykeyWord?&pn=1&rn=30#singername=artist&songname=name&priced=isListenFee",
|
|
29
|
+
"music-info;mid": "get:data music/musicInfo",
|
|
30
|
+
},
|
|
31
|
+
"http://www.kuwo.cn/api/v1/www/": {
|
|
32
|
+
"play-url;mid=rid": "get:data music/playUrl?type=music",
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"http://newlyric.kuwo.cn/": {
|
|
36
|
+
"kuwo-lrc;rid": "get:data newlyric.lrc",
|
|
23
37
|
}
|
|
24
38
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<list ng-src="s in datas" min-width:=datas[0]?.name?320:120>
|
|
2
2
|
<padding>
|
|
3
|
-
<song ng-click="run(s)" ng-class="{activate:
|
|
3
|
+
<song ng-click="run(s)" ng-class="{activate:musicList.isActived(s),imgonly:!datas[0]?.name}" ng-src="s"></song>
|
|
4
4
|
</padding>
|
|
5
5
|
</list>
|
|
6
6
|
<loading ng-if="datas.is_loading"></loading>
|
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,
|
|
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) {
|
|
@@ -15,7 +15,7 @@ function main(dataid, datapath) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
if (s.hash) {
|
|
18
|
-
kugou$player.play(s
|
|
18
|
+
kugou$player.play(s);
|
|
19
19
|
} else {
|
|
20
20
|
go(datapath, s);
|
|
21
21
|
}
|
package/coms/kugou/getSandbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var getSandbox = function (xhr) {
|
|
2
2
|
var bodyHTML = String(xhr.responseText || xhr.response || "").replace(RegBodyExp, "$1").replace(RegScriptExp, "").replace(/\son/ig, " no").replace(/\s(src|href)/g, " s$1");
|
|
3
|
-
var sandbox = createElement(div);
|
|
3
|
+
var sandbox = document.createElement("div");
|
|
4
4
|
sandbox.innerHTML = bodyHTML;
|
|
5
5
|
return sandbox;
|
|
6
6
|
}
|
package/coms/kugou/krc.js
CHANGED
|
@@ -2,7 +2,11 @@ var secret = [64, 71, 97, 119, 94, 50, 116, 71, 81, 54, 49, 45, 206, 210, 110, 1
|
|
|
2
2
|
var isTrident = /Trident/i.test(navigator.userAgent);
|
|
3
3
|
function krc(list = div()) {
|
|
4
4
|
care(list, function (info) {
|
|
5
|
-
|
|
5
|
+
console.log(info)
|
|
6
|
+
if (info.type !== "kugo") {
|
|
7
|
+
remove(list.children);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
6
10
|
cross("get", `http://lyrics.kugou.com/search?ver=1&man=yes&client=pc&keyword=${info.songName}&duration=${info.time}&hash=${info.hash}`).done(function (response) {
|
|
7
11
|
if (!response.response) return;
|
|
8
12
|
var liric = JSON.parse(response.response);
|
|
@@ -109,17 +113,17 @@ function createKRC(krc) {
|
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
};
|
|
112
|
-
var markerLabel = createElement(div);
|
|
116
|
+
var markerLabel = document.createElement("div");
|
|
113
117
|
return krcList;
|
|
114
118
|
}
|
|
115
119
|
function createCell(word) {
|
|
116
120
|
var label = word.label;
|
|
117
|
-
var cell = createElement("span");
|
|
121
|
+
var cell = document.createElement("span");
|
|
118
122
|
text(cell, label);
|
|
119
123
|
return cell;
|
|
120
124
|
}
|
|
121
125
|
function createRow(data) {
|
|
122
|
-
var row = createElement(div);
|
|
126
|
+
var row = document.createElement("div");
|
|
123
127
|
var cells = data.words.map(createCell);
|
|
124
128
|
appendChild(row, cells);
|
|
125
129
|
return row;
|
package/coms/kugou/musicList.js
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
var musicList = data.getInstance("musicList");
|
|
2
|
+
var actived = null;
|
|
2
3
|
musicList.forEach(function (music) {
|
|
3
|
-
if (music.activate)
|
|
4
|
-
|
|
4
|
+
if (music.activate) actived = music;
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var isSameSong = function (m1, m2) {
|
|
8
|
+
return m1 === m2 || m1.mid && m1.mid === m2.mid || m1.hash && m1.hash === m2.hash;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function addMethod(name, func) {
|
|
12
|
+
Object.defineProperty(musicList, name, {
|
|
13
|
+
value: func,
|
|
14
|
+
enumerable: false
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
addMethod("setActive", function (m) {
|
|
18
|
+
if (actived !== m) {
|
|
19
|
+
if (actived && actived !== m) {
|
|
20
|
+
actived.activate = false;
|
|
21
|
+
}
|
|
22
|
+
actived = m;
|
|
5
23
|
}
|
|
24
|
+
});
|
|
25
|
+
addMethod("remove", function (music) {
|
|
26
|
+
for (var cx = this.length - 1; cx >= 0; cx--) {
|
|
27
|
+
if (isSameSong(this[cx], music)) musicList.splice(cx, 1);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
addMethod('indexOf', function (music, i) {
|
|
32
|
+
for (var cx = i || 0, dx = this.length; cx < dx; cx++) {
|
|
33
|
+
if (isSameSong(this[cx], music)) return cx;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
addMethod('getActived', function () {
|
|
37
|
+
return actived;
|
|
38
|
+
});
|
|
39
|
+
addMethod('isActived', function (m) {
|
|
40
|
+
return actived && m && isSameSong(m, actived);
|
|
6
41
|
});
|
package/coms/kugou/page.js
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
// var document=this.document;
|
|
5
5
|
// document["body"].appendChild(this.document.createElement("input"));
|
|
6
6
|
var createBottomBar = function (buttonsConfig) {
|
|
7
|
-
var bar = createElement(div);
|
|
7
|
+
var bar = document.createElement("div");
|
|
8
8
|
addClass(bar, "bottom-bar");
|
|
9
9
|
var button_count = 0;
|
|
10
10
|
for (var k in buttonsConfig) button_count++;
|
|
11
|
-
var btnArea = createElement(div);
|
|
11
|
+
var btnArea = document.createElement("div");
|
|
12
12
|
css(btnArea, "width:" + (100 / button_count) + "%;");
|
|
13
13
|
maxWidth(btnArea, 100);
|
|
14
|
-
var line =
|
|
14
|
+
var line = btnArea.cloneNode();
|
|
15
15
|
inlineBlock(btnArea);
|
|
16
16
|
var active = function (ratio) {
|
|
17
17
|
if (ratio >= .6) {
|
|
@@ -29,11 +29,11 @@ var createBottomBar = function (buttonsConfig) {
|
|
|
29
29
|
var index = 0;
|
|
30
30
|
for (var k in buttonsConfig) {
|
|
31
31
|
var [url, info] = buttonsConfig[k].split(":");
|
|
32
|
-
var btn =
|
|
32
|
+
var btn = btnArea.cloneNode();
|
|
33
33
|
btn.url = url;
|
|
34
34
|
btn.searchInfo = info;
|
|
35
35
|
btn.active = active;
|
|
36
|
-
btn.container = createElement(div);
|
|
36
|
+
btn.container = document.createElement("div");
|
|
37
37
|
btn.index = index++;
|
|
38
38
|
btn.innerHTML = k;
|
|
39
39
|
onclick(btn, function () {
|
|
@@ -83,7 +83,7 @@ onappend(pages, function () {
|
|
|
83
83
|
if (!isFinite(index)) index = 1;
|
|
84
84
|
pages.go(index);
|
|
85
85
|
});
|
|
86
|
-
var page = createElement(div);
|
|
86
|
+
var page = document.createElement("div");
|
|
87
87
|
appendChild(page, pages, bar);
|
|
88
88
|
ontouchstart(page, kugou$dragview);
|
|
89
89
|
onmousedown(page, kugou$dragview);
|
package/coms/kugou/playList.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
</div>
|
|
5
5
|
<list class="body" ng-src="(p,i) in musicList" min-width=480>
|
|
6
6
|
<padding ng-delete="remove(i)">
|
|
7
|
-
<song ng-click="play(i)" ng-class="{activate:
|
|
7
|
+
<song ng-click="play(i)" ng-class="{activate:musicList.isActived(p)}" ng-src=p></song>
|
|
8
8
|
</padding>
|
|
9
9
|
</list>
|
|
10
10
|
<div foot>
|
package/coms/kugou/playList.js
CHANGED
package/coms/kugou/playList.less
CHANGED
|
@@ -12,13 +12,20 @@
|
|
|
12
12
|
margin-top: 0;
|
|
13
13
|
transition: margin .2s ease-out;
|
|
14
14
|
color: #fff;
|
|
15
|
+
border: 1px solid;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
>.head {
|
|
17
19
|
background: inherit;
|
|
20
|
+
border-bottom: 1px solid;
|
|
18
21
|
}
|
|
19
|
-
|
|
22
|
+
|
|
23
|
+
>[foot] {
|
|
20
24
|
background: inherit;
|
|
25
|
+
border-top: 1px solid;
|
|
26
|
+
padding-bottom: 6px;
|
|
21
27
|
}
|
|
28
|
+
|
|
22
29
|
>list.body {
|
|
23
30
|
overflow-x: hidden;
|
|
24
31
|
overflow-y: scroll;
|