Created
June 16, 2013 20:30
-
-
Save bonhag/5793309 to your computer and use it in GitHub Desktop.
Shuffle your Turntable playlist
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
| var shuffle = function() { | |
| var playlistLength = $('#playlist .song').length; | |
| for (var i = 1; i < playlistLength; i = i + 1) { | |
| setTimeout(function() { | |
| var s = Math.floor(Math.random() * playlistLength); | |
| console.log('moving song ' + s + ' to bottom'); | |
| $($('#playlist .song .playlist-open-options')[s]).click(); | |
| $('.move-bottom').click(); | |
| }, 500 * i); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, so a little longer code-wise, but much faster... here's the problem though, it's very picky and I don't know why. Maybe you can check it out. If it doesn't work for you, try picking the playlist from the dropdown menu again. Paste this into Web Console and then call shufflePL();