Skip to content

Instantly share code, notes, and snippets.

@theabraham
Created May 27, 2011 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theabraham/995932 to your computer and use it in GitHub Desktop.
Save theabraham/995932 to your computer and use it in GitHub Desktop.
sync = function() {
GSplay = {};
GSplay.init = function() {
$("#nav").append("<li id='test'>test</li>");
$("#nav").append("<li id='next'>Next</li>");
console.log("---- GSplay ---- :: Start Playing");
var songs = ["26603895", "27912670", "27470334"];
//GS.player.addSongsToQueueAt(songs, -1, true, "");
$("#test").click(function() {
GS.player.addSongAndPlay("27912670");
});
$("#next").click(function() {
GS.player.nextSong();
});
var toAppend = '<li class="last"> ' +
' <div id="shareStuffs" class="btn btn_style1"> ' +
' <span class="label">Share Songs</span> ' +
' </div> ' +
' <div id="userShareOptions" class="dropdown right" style="display: none; background-color:#fff; color:#000; width:300px; padding:5px; margin-top:-4px; border-top:none; "> ' +
' My uuID: <div id="uuIDspot"></div><br /><br />' +
' Friend uuID: <br /> ' +
' <input type="text" name="firstname" /> ' +
' </div> ' +
'</li>';
$("#userOptions").append(toAppend);
$("#uuIDspot").html(GS.service.uuID);
$("#shareStuffs").click(function() {
$("#userShareOptions").toggle();
$("#shareStuffs").css({"background-color": "#fff"}); $("#shareStuffs span.label").css({"color": "#000"});
});
}
setTimeout("GSplay.init()", 3000);
}
var script = document.createElement('script');
script.textContent = '(' + GSsync + ')(jQuery, window);';
document.body.appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment