Created
February 11, 2019 08:12
-
-
Save palikhov/5a952980b8c77a03260a54f3d75f2f25 to your computer and use it in GitHub Desktop.
Jukebox keybind: bind playlists/tracks to keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
const startPlaylist = (playlistName) => { | |
$(`#jukeboxfolderroot div.folder-title:contains("${playlistName}")`).closest(".dd-content").find(".playlistcontrols .play").click(); | |
}; | |
const startTrack = (trackName) => { | |
$(`#jukeboxfolderroot .jukeboxitem .title:contains("${trackName}")`).closest(".dd-content").find(".play").click() | |
}; | |
Mousetrap.unpause(); | |
Mousetrap.bind("g", () => startPlaylist("my playlist name")); | |
Mousetrap.bind("j", () => startPlaylist("my other playlist")); | |
Mousetrap.bind("n", () => startPlaylist("asdf")); | |
Mousetrap.bind("a", () => startTrack("ye")); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment