-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathHotNewHipHop.bsstrategy
35 lines (35 loc) · 1.11 KB
/
HotNewHipHop.bsstrategy
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
//
// HotNewHipHop.plist
// BeardedSpice
//
// Created by Ivan Doroshenko on 11/7/15.
// Copyright © 2015 GPL v3 http://www.gnu.org/licenses/gpl.html
//
BSStrategy = {
version:1,
displayName:"HotNewHipHop",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*hotnewhiphop.com*'",
args: ["URL"]
},
isPlaying: function () { return document.getElementById('jp_audio_0').paused; },
toggle: function () {
var player = document.getElementById('jp_audio_0');
if (player.paused) { player.play() }
else { player.pause() }
},
next: function () {$(".jp-next").click();},
previous: function () {$(".jp-previous").click();},
pause: function () {$("#jquery_jplayer_playlist").jPlayer("pause");},
trackInfo: function () {
var album = $('.mixtape-info-title')[0].innerText;
var artist = $('.mixtape-info-artist')[0].innerText;
return {
'track': $('.jp-playlist-current .mixtape-trackTitle .display')[0].innerText,
'album': album.replace(/\s+/, ''),
'artist': artist.replace(/\s+/, ''),
'image': $('.mixtape-cover-img img')[0].getAttribute('src')
}
}
}