Add guest login, tweak button visibility
This commit is contained in:
parent
5e5ff5f414
commit
d168c8fff7
|
@ -196,6 +196,19 @@ $("#qlockbtn").click(function() {
|
|||
|
||||
$("#login").click(showLoginFrame);
|
||||
|
||||
function guestLogin() {
|
||||
uname = $("#guestname").val();
|
||||
socket.emit("login", {
|
||||
name: $("#guestname").val()
|
||||
});
|
||||
}
|
||||
$("#guestlogin").click(guestLogin);
|
||||
$("#guestname").keydown(function(ev) {
|
||||
if(ev.keyCode == 13) {
|
||||
guestLogin();
|
||||
}
|
||||
});
|
||||
|
||||
$("#logout").click(function() {
|
||||
eraseCookie("sync_uname");
|
||||
eraseCookie("sync_session");
|
||||
|
|
|
@ -751,7 +751,9 @@ function handleRankChange() {
|
|||
for(var i = 0; i < users.length; i++) {
|
||||
addUserDropdown(users[i], users[i].children[1].innerHTML);
|
||||
}
|
||||
|
||||
$("#getplaylist").css("width", "34%");
|
||||
$("#clearplaylist").css("display", "");
|
||||
$("#shuffleplaylist").css("display", "");
|
||||
$("#modnav").show();
|
||||
$("#chancontrols").show();
|
||||
}
|
||||
|
@ -774,6 +776,11 @@ function handleRankChange() {
|
|||
$(this).find(".btn-danger").remove();
|
||||
});
|
||||
}
|
||||
if(RANK < Rank.Moderator) {
|
||||
$("#getplaylist").css("width", "100%");
|
||||
$("#clearplaylist").css("display", "none");
|
||||
$("#shuffleplaylist").css("display", "none");
|
||||
}
|
||||
}
|
||||
|
||||
function onWindowFocus() {
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
<li><a href="help.html">Help</a></li>
|
||||
</ul>
|
||||
<div class="navbar-form pull-right" id="loginform">
|
||||
<input type="text" id="guestname" placeholder="Name">
|
||||
<button class="btn" id="guestlogin">Guest Login</button>
|
||||
<button class="btn" id="login">Login/Register</button>
|
||||
</div>
|
||||
<div class="navbar-form pull-right" id="logoutform" style="display: none;">
|
||||
|
@ -111,9 +113,9 @@
|
|||
</div>
|
||||
<button class="btn btn-danger btn-block" id="qlockbtn" style="display:none;">Unlock Queue</button>
|
||||
<div class="span12 btn-group" style="margin: 0">
|
||||
<button class="btn" id="getplaylist" style="width: 34%">Get Playlist URLs</button>
|
||||
<button class="btn" id="clearplaylist" style="width: 33%">Clear Playlist</button>
|
||||
<button class="btn" id="shuffleplaylist" style="width: 33%">Shuffle Playlist</button>
|
||||
<button class="btn" id="getplaylist" style="width: 100%">Get Playlist URLs</button>
|
||||
<button class="btn" id="clearplaylist" style="width: 33%; display: none;">Clear Playlist</button>
|
||||
<button class="btn" id="shuffleplaylist" style="width: 33%; display: none;">Shuffle Playlist</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue