mirror of https://github.com/calzoneman/sync.git
Add fluid layout option
This commit is contained in:
parent
b00e63b622
commit
c7e63391f6
|
@ -415,6 +415,8 @@ Callbacks = {
|
||||||
|
|
||||||
updateUser: function(data) {
|
updateUser: function(data) {
|
||||||
if(data.name == uname) {
|
if(data.name == uname) {
|
||||||
|
PROFILE.text = data.profile.text;
|
||||||
|
PROFILE.image = data.profile.image;
|
||||||
LEADER = data.leader;
|
LEADER = data.leader;
|
||||||
RANK = data.rank;
|
RANK = data.rank;
|
||||||
handleRankChange();
|
handleRankChange();
|
||||||
|
|
|
@ -27,7 +27,9 @@ var LASTCHATTIME = 0;
|
||||||
var PAGETITLE = "Sync";
|
var PAGETITLE = "Sync";
|
||||||
var TITLE_BLINK;
|
var TITLE_BLINK;
|
||||||
var VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");//670
|
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 IGNORED = [];
|
||||||
var KICKED = false;
|
var KICKED = false;
|
||||||
var CHANNEL = "";
|
var CHANNEL = "";
|
||||||
|
@ -100,7 +102,11 @@ $(window).focus(function() {
|
||||||
|
|
||||||
$(window).resize(function() {
|
$(window).resize(function() {
|
||||||
VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");
|
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("width", VWIDTH);
|
||||||
|
$("#ytapiplayer").attr("height", VHEIGHT);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Match URLs of the form http://site.tld/r/channel
|
// Match URLs of the form http://site.tld/r/channel
|
||||||
|
@ -542,6 +548,22 @@ $("#hugelayout").click(hugeLayout);
|
||||||
$("#narrowlayout").click(narrowLayout);
|
$("#narrowlayout").click(narrowLayout);
|
||||||
$("#stlayout").click(synchtubeLayout);
|
$("#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() {
|
function largeLayout() {
|
||||||
$("#videodiv").removeClass().addClass("span8 offset2");
|
$("#videodiv").removeClass().addClass("span8 offset2");
|
||||||
VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");//770
|
VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");//770
|
||||||
|
|
|
@ -849,6 +849,8 @@ function showUserOpts() {
|
||||||
.appendTo(layoutselect);
|
.appendTo(layoutselect);
|
||||||
$("<option/>").attr("value", "synchtube").text("Synchtube")
|
$("<option/>").attr("value", "synchtube").text("Synchtube")
|
||||||
.appendTo(layoutselect);
|
.appendTo(layoutselect);
|
||||||
|
$("<option/>").attr("value", "fluid").text("Fluid")
|
||||||
|
.appendTo(layoutselect);
|
||||||
layoutselect.val(USEROPTS.layout);
|
layoutselect.val(USEROPTS.layout);
|
||||||
addOption("Layout", layoutselect);
|
addOption("Layout", layoutselect);
|
||||||
var warn = $("<p/>").addClass("text-error")
|
var warn = $("<p/>").addClass("text-error")
|
||||||
|
@ -926,12 +928,12 @@ function showUserOpts() {
|
||||||
USEROPTS.modhat = modhat.prop("checked");
|
USEROPTS.modhat = modhat.prop("checked");
|
||||||
}
|
}
|
||||||
saveOpts();
|
saveOpts();
|
||||||
applyOpts();
|
|
||||||
modal.modal("hide");
|
modal.modal("hide");
|
||||||
});
|
});
|
||||||
|
|
||||||
modal.on("hidden", function() {
|
modal.on("hidden", function() {
|
||||||
vid.appendTo($("#videodiv"));
|
vid.appendTo($("#videodiv"));
|
||||||
|
applyOpts();
|
||||||
modal.remove();
|
modal.remove();
|
||||||
});
|
});
|
||||||
modal.modal();
|
modal.modal();
|
||||||
|
@ -975,6 +977,9 @@ function applyOpts() {
|
||||||
case "synchtube":
|
case "synchtube":
|
||||||
synchtubeLayout();
|
synchtubeLayout();
|
||||||
break;
|
break;
|
||||||
|
case "fluid":
|
||||||
|
fluidLayout();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue