Begin working on playlists
This commit is contained in:
parent
63e6cf3803
commit
28a960285c
4 changed files with 174 additions and 2 deletions
|
|
@ -573,7 +573,8 @@ Callbacks = {
|
|||
},
|
||||
|
||||
queueFail: function() {
|
||||
alert("Queue failed. Double check your link to make sure the video exists.");
|
||||
makeAlert("Error", "Queue failed. Check your link to make sure it is valid.", "alert-error")
|
||||
.insertAfter($("#playlist_controls"));
|
||||
},
|
||||
|
||||
setTemp: function(data) {
|
||||
|
|
@ -738,7 +739,17 @@ Callbacks = {
|
|||
closePoll: function() {
|
||||
// Not recursive
|
||||
closePoll();
|
||||
}
|
||||
},
|
||||
|
||||
savePlaylist: function(data) {
|
||||
if(data.success) {
|
||||
makeAlert("Success", "Playlist saved.", "alert-success");
|
||||
}
|
||||
else {
|
||||
alert("DBG error " + data.error);
|
||||
makeAlert("Error", data.error, "alert-error");
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
$.getScript(IO_URL+"/socket.io/socket.io.js", function() {
|
||||
|
|
|
|||
|
|
@ -1316,3 +1316,23 @@ function hasPermission(key) {
|
|||
}
|
||||
return RANK >= v;
|
||||
}
|
||||
|
||||
function makeAlert(title, text, klass) {
|
||||
if(!klass) {
|
||||
klass = "alert-info";
|
||||
}
|
||||
|
||||
var al = $("<div/>").addClass("alert")
|
||||
.addClass(klass)
|
||||
.text(text);
|
||||
$("<br/>").prependTo(al);
|
||||
$("<strong/>").text(title).prependTo(al);
|
||||
$("<button/>").addClass("close pull-right").html("×")
|
||||
.click(function() {
|
||||
al.hide("blind", function() {
|
||||
al.remove();
|
||||
});
|
||||
})
|
||||
.prependTo(al);
|
||||
return al;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue