Add fluid layout option

This commit is contained in:
calzoneman 2013-05-12 21:15:05 -04:00
parent b00e63b622
commit c7e63391f6
3 changed files with 31 additions and 2 deletions

View File

@ -415,6 +415,8 @@ Callbacks = {
updateUser: function(data) {
if(data.name == uname) {
PROFILE.text = data.profile.text;
PROFILE.image = data.profile.image;
LEADER = data.leader;
RANK = data.rank;
handleRankChange();

View File

@ -27,7 +27,9 @@ var LASTCHATTIME = 0;
var PAGETITLE = "Sync";
var TITLE_BLINK;
var VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");//670
var VHEIGHT = "377";
var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16);
$("#messagebuffer").css("height", (VHEIGHT - 31) + "px");
$("#userlist").css("height", (VHEIGHT - 31) + "px");
var IGNORED = [];
var KICKED = false;
var CHANNEL = "";
@ -100,7 +102,11 @@ $(window).focus(function() {
$(window).resize(function() {
VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");
var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16);
$("#messagebuffer").css("height", (VHEIGHT - 31) + "px");
$("#userlist").css("height", (VHEIGHT - 31) + "px");
$("#ytapiplayer").attr("width", VWIDTH);
$("#ytapiplayer").attr("height", VHEIGHT);
});
// Match URLs of the form http://site.tld/r/channel
@ -542,6 +548,22 @@ $("#hugelayout").click(hugeLayout);
$("#narrowlayout").click(narrowLayout);
$("#stlayout").click(synchtubeLayout);
function fluidLayout() {
$(".row").each(function() {
$(this).removeClass("row").addClass("row-fluid");
});
$(".container").each(function() {
$(this).removeClass("container").addClass("container-fluid");
});
VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");
var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16);
$("#messagebuffer").css("height", (VHEIGHT - 31) + "px");
$("#userlist").css("height", (VHEIGHT - 31) + "px");
$("#ytapiplayer").attr("width", VWIDTH);
$("#ytapiplayer").attr("height", VHEIGHT);
$("#chatline").removeClass().addClass("span12");
}
function largeLayout() {
$("#videodiv").removeClass().addClass("span8 offset2");
VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");//770

View File

@ -849,6 +849,8 @@ function showUserOpts() {
.appendTo(layoutselect);
$("<option/>").attr("value", "synchtube").text("Synchtube")
.appendTo(layoutselect);
$("<option/>").attr("value", "fluid").text("Fluid")
.appendTo(layoutselect);
layoutselect.val(USEROPTS.layout);
addOption("Layout", layoutselect);
var warn = $("<p/>").addClass("text-error")
@ -926,12 +928,12 @@ function showUserOpts() {
USEROPTS.modhat = modhat.prop("checked");
}
saveOpts();
applyOpts();
modal.modal("hide");
});
modal.on("hidden", function() {
vid.appendTo($("#videodiv"));
applyOpts();
modal.remove();
});
modal.modal();
@ -975,6 +977,9 @@ function applyOpts() {
case "synchtube":
synchtubeLayout();
break;
case "fluid":
fluidLayout();
break;
default:
break;
}