-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstyle.js
148 lines (128 loc) · 4.36 KB
/
style.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
$().ready(function(){
var cname = $(".cname");
var chl_name = $('.chl_name');
jk('#ad-click-area').remove() || '';
jk('.send-song-to-phone').remove() || '';
jk('#fm-section-app-entry').remove() || '';
var oldNode_A = jk('.chl_section').css({'display':'none'});//.remove();
var oldNode_A_U = jk('.channel_list').css({'display': 'none'});//.remove(); //私人赫兹
//
// lrc box style
jk('.bd').css({'display':'none'});//.remove() || '';
jk('#fm-bg').css({'display':'none'});//.remove() || '';
jk('#logo').css({'display':'none'});//.remove() || '';
// menu event
$(".po-current-play").mouseover(function() {
$(".po-other-hz").show();
});
$(".po-menu").mouseleave(function() {
$(".po-other-hz").hide();
});
$(".po-other-hz li").click(function(){
var current_play_text = $(".po-current-play").text();
$(".po-current-play").text($(this).text());
$(this).text(current_play_text);
})
var targetNode = document.getElementById("fm-section");
var menuNode = document.createElement("div");
menuNode.className = "po-hz-menu";
var menuNodeText = document.createTextNode("hello po");
menuNode.appendChild(menuNodeText);
var firstNode = document.getElementById("fm-header");
targetNode.insertBefore(menuNode, firstNode);
$(".po-hz-menu").css({
"margin-left": -190,
'display': 'inline-block'
});
var cnameBtn = "<li >" + cname.eq(1).text().substring(2, cname.eq(0).text().length) + "</li>";
var cnameBtn1 = "<div class='po-current-play'>" + cname.eq(0).text().substring(2, cname.eq(0).text().length) + "</div>";
for(var i = 2; i < cname.length - 2; i++){
var str = cname.eq(i).text();
str = str.indexOf("MHz") !== -1 ? str.substring(0, str.length-3) : str.substring(2, str.length);
cnameBtn += "<li >" +
str + "</li>";
}
menuNode.innerHTML = "<div class='po-menu' >" + cnameBtn1 + "<ul class='po-other-hz'>" + cnameBtn + "</ul> + <button class='clearCanvas'>clearCanvas</button> ";
jk('.hidden_list').remove();
jk('.chl_name').css({
'width':'100px'
});
jk('.channel ').css({
'marginBottom': '0px'
});
jk('.channel_list').css({
'width': '100px',
});
jk(".ch-list").css({'width': 0, 'margin': 0});
jk(".ch-list-wrapper").css({'width': 0, 'margin': 0, 'padding': 0, 'min-height': 0});
$('#fm-section').css('min-height', '0');
$(".po-hz-menu").css({"margin-left": "-190"});
$("#fm-channel-list").css('z-index', -999);
$("#user_info").css('margin-top','-35px');
$(document).on('click', '.po-other-hz li', function() {
var index = $(this).index();
chl_name[index].click();//trigger('click');
})
$(".pro-promo, #fm-section2").remove();
// menu style
$('.po-menu').css({
'display': 'inline-block'
});
$('.po-current-play').css({
'width': '100px',
'height': '30px',
'cursor': 'pointer',
'border': '1px solid gray',
'text-align': 'center',
'line-height': '30px',
'background': 'green'
});
$('.po-other-hz').css({
'display': 'none'
});
$('.po-other-hz li').css({
'width': '100px',
'height': '30px',
'cursor': 'pointer',
'border': '1px solid gray',
'margin-top': '3px',
'text-align': 'center',
'line-height': '30px',
// 'background': 'blue',
'list-style-type': 'none'
});
// menu event
$(document).on('mouseover', '.po-current-play', function(){
$(".po-other-hz").show();
$("#user_info").css('margin-top','-545px')
})
$(".po-menu").mouseleave(function() {
$(".po-other-hz").hide();
$("#user_info").css('margin-top','-35px');
});
$(".po-other-hz li").click(function(){
var current_play_text = $(".po-current-play").text();
console.log(current_play_text);
$(".po-current-play").text($(this).text());
$(this).text(current_play_text);
})
//get mp4 file
function downloadMusicFile() {
var MusicloaclData = window.localStorage.getItem('bubbler_song_info');
MusicloaclData = JSON.parse(MusicloaclData);
var songId = MusicloaclData.id;
var downloadUrl = 'http://mr3.douban.com/201412172352/0d27ab769a9c90d3ea60de30b45aa001/view/song/small/p' + id + '.mp4'
}
downloadMusicFile();
//insert style
function addStyle(stylePath) {
var container = document.getElementsByTagName("head")[0];
var addStyle = document.createElement("link");
addStyle.rel = "stylesheet";
addStyle.type = "text/css";
addStyle.media = "screen";
addStyle.href = stylePath;
container.appendChild(addStyle);
}
addStyle('style.css');
});