So much work

This commit is contained in:
calzoneman 2013-06-11 19:51:00 -04:00
parent 1850f009ff
commit de2294d3ab
5 changed files with 1045 additions and 1039 deletions

View File

@ -466,9 +466,10 @@ Callbacks = {
},
drinkCount: function(count) {
console.log(count);
if(count != 0) {
var text = count + " drink";
if(data.count != 1) {
if(count != 1) {
text += "s";
}
$("#drinkcount").text(text);

View File

@ -501,6 +501,10 @@ Player.prototype.update = function(data) {
data.currentTime = 0;
}
this.load(data);
this.play();
}
if(CLIENT.leader) {
return;
}
if(!USEROPTS.synch) {
return;
@ -512,9 +516,6 @@ Player.prototype.update = function(data) {
else {
this.play();
}
if(CLIENT.leader) {
return;
}
this.getTime(function(seconds) {
var time = data.currentTime;
var diff = time - seconds || time;

View File

@ -24,6 +24,7 @@ generateToggle("#playlisttoggle", "#playlist_controls");
/* navbar stuff */
$("#optlink").click(showOptionsMenu);
$("#chatonly").click(chatOnly);
function guestLogin() {
socket.emit("login", {

View File

@ -103,7 +103,7 @@ function getNameColor(rank) {
return "";
}
function addUserDropdown(entry, name, aliases) {
function addUserDropdown(entry, name) {
entry.find(".user-dropdown").remove();
var menu = $("<div/>").addClass("user-dropdown")
.appendTo(entry);
@ -111,53 +111,61 @@ function addUserDropdown(entry, name, aliases) {
$("<strong/>").text(name).appendTo(menu);
$("<br/>").appendTo(menu);
$("<span/>").text("Aliases: " + aliases)
.appendTo(menu);
$("<button/>").addClass("btn btn-mini btn-block")
.text("Kick")
.click(function() {
socket.emit("chatMsg", {
msg: "/kick " + name
});
})
.appendTo(menu);
$("<button/>").addClass("btn btn-mini btn-block")
.text("Give Leader")
.click(function() {
socket.emit("assignLeader", {
name: name
});
})
.appendTo(menu);
$("<button/>").addClass("btn btn-mini btn-block")
.text("Take Leader")
.click(function() {
socket.emit("assignLeader", {
name: ""
});
})
.appendTo(menu);
$("<button/>").addClass("btn btn-mini btn-block")
.text("Name Ban")
.click(function() {
socket.emit("chatMsg", {
msg: "/ban " + name
});
})
.appendTo(menu);
$("<button/>").addClass("btn btn-mini btn-block")
.text("IP Ban")
.click(function() {
socket.emit("chatMsg", {
msg: "/ipban " + name
});
})
.appendTo(menu);
if(CLIENT.rank >= 2)
$("<span/>").addClass("user-aliases").appendTo(menu);
if(hasPermission("kick")) {
$("<button/>").addClass("btn btn-mini btn-block")
.text("Kick")
.click(function() {
socket.emit("chatMsg", {
msg: "/kick " + name
});
})
.appendTo(menu);
}
if(CLIENT.rank >= 2) {
$("<button/>").addClass("btn btn-mini btn-block")
.text("Give Leader")
.click(function() {
socket.emit("assignLeader", {
name: name
});
})
.appendTo(menu);
$("<button/>").addClass("btn btn-mini btn-block")
.text("Take Leader")
.click(function() {
socket.emit("assignLeader", {
name: ""
});
})
.appendTo(menu);
}
if(hasPermission("ban")) {
$("<button/>").addClass("btn btn-mini btn-block")
.text("Name Ban")
.click(function() {
socket.emit("chatMsg", {
msg: "/ban " + name
});
})
.appendTo(menu);
$("<button/>").addClass("btn btn-mini btn-block")
.text("IP Ban")
.click(function() {
socket.emit("chatMsg", {
msg: "/ipban " + name
});
})
.appendTo(menu);
}
entry.contextmenu(function(ev) {
ev.preventDefault();
if(menu.css("display") == "none") {
menu.find(".user-aliases")
.text("Aliases: " + entry.data("aliases"));
menu.show();
}
else {
@ -302,13 +310,7 @@ function showOptionsMenu() {
addOption("User CSS", usercss);
var layoutselect = $("<select/>");
$("<option/>").attr("value", "default").text("Default")
.appendTo(layoutselect);
$("<option/>").attr("value", "large").text("Large")
.appendTo(layoutselect);
$("<option/>").attr("value", "huge").text("Huge")
.appendTo(layoutselect);
$("<option/>").attr("value", "single").text("Single Column")
$("<option/>").attr("value", "default").text("Compact")
.appendTo(layoutselect);
$("<option/>").attr("value", "synchtube").text("Synchtube")
.appendTo(layoutselect);
@ -436,15 +438,6 @@ function applyOpts() {
}
switch(USEROPTS.layout) {
case "large":
largeLayout();
break;
case "huge":
hugeLayout();
break;
case "single":
singleColumnLayout();
break;
case "synchtube":
synchtubeLayout();
break;
@ -1033,3 +1026,12 @@ function synchtubeLayout() {
$("#videowrap").detach().insertBefore($("#chatwrap"));
$("#rightpane-outer").detach().insertBefore($("#leftpane-outer"));
}
function chatOnly() {
fluidLayout();
$("#toprow").remove()
$("#announcements").remove();
$("#playlistrow").remove();
$("#videowrap").remove();
$("#chatwrap").removeClass("span5").addClass("span12");
}

View File

@ -29,6 +29,7 @@
<li><a href="help.html">Help</a></li>
<li><a href="account.html">Account</a></li>
<li><a href="javascript:void(0)" id="optlink">Options</a></li>
<li><a href="javascript:void(0)" id="chatonly">Chat Only</a></li>
</ul>
<div class="navbar-form pull-right" id="loginform">
<input type="text" id="guestname" placeholder="Name">