Add a small toggle for the MOTD

This commit is contained in:
calzoneman 2013-10-02 22:26:28 -05:00
parent abc9c398f4
commit 75ea06ed76
4 changed files with 29 additions and 4 deletions

View File

@ -1,3 +1,7 @@
Wed Oct 02 22:25 2013 CDT
* www/channel.html, www/assets/js/ui.js, www/assets/js/callbacks.js:
Add a small toggle for the MOTD
Wed Oct 02 09:35 2013 CDT
* lib/channel.js: Fix the use of the wrong variable when checking for
maximum video length

View File

@ -173,10 +173,15 @@ Callbacks = {
CHANNEL.motd_text = data.motd;
$("#motd").html(data.html);
$("#motdtext").val(CHANNEL.motd_text);
if(data.motd != "")
if(data.motd != "") {
$("#motdwrap").show();
$("#motd").show();
$("#togglemotd").find(".icon-plus")
.removeClass("icon-plus")
.addClass("icon-minus");
}
else
$("#motd").hide();
$("#motdwrap").hide();
},
chatFilters: function(entries) {

View File

@ -45,6 +45,20 @@ generateToggle("#librarytoggle", "#librarywrap");
generateToggle("#userpltoggle", "#userplaylistwrap");
generateToggle("#playlisttoggle", "#playlist_controls");
$("#togglemotd").click(function () {
var hidden = $("#motd").css("display") === "none";
$("#motd").toggle();
if (hidden) {
$("#togglemotd").find(".icon-plus")
.removeClass("icon-plus")
.addClass("icon-minus");
} else {
$("#togglemotd").find(".icon-minus")
.removeClass("icon-minus")
.addClass("icon-plus");
}
});
/* navbar stuff */
$("#optlink").click(showOptionsMenu);
$("#chatonly").click(chatOnly);

View File

@ -48,9 +48,11 @@
<div class="container" id="mainpage">
<!-- top row (MOTD, drink count) -->
<div class="row-fluid" id="toprow">
<div class="well span12" id="motd">
<div class="well" id="motdwrap">
<button class="close pull-right" id="togglemotd"><i class="icon-minus"></i></button>
<div id="motd"></div>
</div>
<div class="span12" id="drinkbar">
<div id="drinkbar">
<h1 id="drinkcount"></h1>
</div>
</div>