Added schedule airtimes, fixed layout issues, locked down fore,st(guest disable), contrast fixes (css)

This commit is contained in:
rainbow napkin 2021-12-26 05:26:59 +00:00
parent b0570f2c15
commit 55a9fcf465
20 changed files with 279 additions and 1238 deletions

View file

@ -19,7 +19,12 @@ body {
}
.nick-highlight {
background-color: #555555;
background-color: #262626;
color: #ffffff;
}
.server-whisper{
color: #ffffff;
}
.nick-hover {
@ -69,7 +74,6 @@ input.form-control[type="email"], textarea.form-control {
#chatheader, #videowrap-header {
border: 1px solid #cccccc;
border-bottom-width: 0;
border-radius: 5px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
@ -96,3 +100,26 @@ input.form-control[type="email"], textarea.form-control {
background-color: #111111C0;
}
.qe_sTime{
float: right;
font-family: Monospace;
}
.aboutText{
background-color: #111111C0;
padding: 10px;
border: 1px solid #aaaaaa;
}
#chatwrap, #videowrap{
padding-right: 0px;
padding-left: 0px;
}
.navbar{
margin-bottom: 0px;
}
#filei{
background-color: #710404;
}

View file

@ -103,14 +103,14 @@ UI_FontsBtn = 0; // button displaying box with clickable chat fonts
// [ REQUIRE: INSTALLATION (see above) ]
UI_UnicodeChars = 0; // [&] additional buttons in the fonts panel with unicode characters
// [ REQUIRE: UI_FontsBtn enabled ]
UI_EmotesBtn = 1; // button displaying box with clickable chat emotes
UI_EmotesBtn = 0; // button displaying box with clickable chat emotes
UI_GroupEmotes = 1; // [&] emotes panel pagination, display limited number of emotes at one time
// [ REQUIRE: UI_EmotesBtn enabled ]
UI_CommandsBtn = 1; // button displaying modal window with chat commands help
UI_CommandsBtn = 0; // button displaying modal window with chat commands help
UI_ModPanel = 0; // [&] panel with messages and help for moderators
UI_CustomCaptions = 0; // [&] custom captions for add, refresh, voteskip buttons, and welcome text
UI_PlayerOptions = 1; // [&] additional player options
UI_TransformationBtns = 1; // player transformation buttons
UI_PlayerOptions = 0; // [&] additional player options
UI_TransformationBtns = 0; // player transformation buttons
UI_ChannelDatabase = 1; // [&] box with embed additional media database
UI_ChannelGalleries = 0; // [&] box with embed galleries
UI_DisplayModeSel = 1; // selector with player display modes
@ -662,48 +662,49 @@ function setLayout() {
refreshPlayer();
}
//-----STOP BREAKIN SHIT!
// fit player height
function fitPlayer() {
VW=$("#videowrap").width()+'';
VH=Math.floor(parseInt(VW)*9/16+1)+'';
$("#ytapiplayer").width(VW).height(VH);
//VW=$("#videowrap").width()+'';
//VH=Math.floor(parseInt(VW)*9/16+1)+'';
//$("#ytapiplayer").width(VW).height(VH);
}
// fit chat height
function fitChat(a) {
if (a=="auto") {
/*if (a=="auto") {
VW=$("#messagebuffer").width();
VH=Math.floor(parseInt(VW)*9/16+1);
} else {
VH=a;
}
$("#messagebuffer").height(VH);
$("#userlist").height(VH);
$("#userlist").height(VH);*/
}
// display mode helper functions
function bigPlayer() {
$("#videowrap").removeClass().addClass("col-lg-12 col-md-12");
fitPlayer();
//$("#videowrap").removeClass().addClass("col-lg-12 col-md-12");
//fitPlayer();
}
function bigChat() {
$("#chatwrap").removeClass().addClass('col-lg-12 col-md-12');
fitChat("auto");
//$("#chatwrap").removeClass().addClass('col-lg-12 col-md-12');
//fitChat("auto");
}
function normalPlayer() {
$("#videowrap").removeClass().addClass("col-lg-7 col-md-7");
fitPlayer();
//$("#videowrap").removeClass().addClass("col-lg-7 col-md-7");
//fitPlayer();
}
function normalChat() {
c = (PINNED && USERCONFIG.qsize=="wide") ? 'col-lg-7 col-md-7' : 'col-lg-5 col-md-5';
/*c = (PINNED && USERCONFIG.qsize=="wide") ? 'col-lg-7 col-md-7' : 'col-lg-5 col-md-5';
$("#chatwrap").removeClass().addClass(c);
fitChat(338);
fitChat(338);*/
}
// set display mode
@ -731,10 +732,10 @@ function setMode(a) {
normalPlayer();
c = (PINNED && USERCONFIG.qsize=="wide") ? 'col-lg-7 col-md-7' : 'col-lg-5 col-md-5';
$("#chatwrap").removeClass().addClass(c);
H=parseInt(VH)-$("#chatline").outerHeight()-1;
$("#messagebuffer").height(H);
$("#userlist").height(H);
//$("#chatwrap").removeClass().addClass(c);
//H=parseInt(VH)-$("#chatline").outerHeight()-1;
//$("#messagebuffer").height(H);
//$("#userlist").height(H);
USERCONFIG.player=="center" ? playerLocation("center") : '';
PINNED ? pinUp() : '';
@ -2147,15 +2148,15 @@ function pinUp() {
$("#videowrap").before($("#rightpane").detach());
}
if (USERCONFIG.queue=="left") {
$("#leftpane").before($("#chatwrap").detach());
//$("#leftpane").before($("#chatwrap").detach());
} else if (USERCONFIG.queue=="right") {
$("#leftpane").after($("#chatwrap").detach());
//$("#leftpane").after($("#chatwrap").detach());
}
$("#rightpane").removeClass().addClass('col-lg-5 col-md-5');
if (USERCONFIG.qsize=="wide") {
$("#chatwrap").removeClass().addClass('col-lg-7 col-md-7');
//$("#chatwrap").removeClass().addClass('col-lg-7 col-md-7');
} else {
$("#chatwrap").removeClass().addClass('col-lg-5 col-md-5');
//$("#chatwrap").removeClass().addClass('col-lg-5 col-md-5');
}
$("#pinup-btn").attr('title', 'Unpin playlist');
$("#config-btn, #configbtnwrap br").hide();
@ -3580,9 +3581,13 @@ $("#chatbtn").on("click", function() {
// fix layout behaviour after resizing
// DEV NOTE: this is extended function from CyTube "util.js" file
//
function resizeStuff() {
VWIDTH = $("#videowrap").width() + "";
console.log("resize stuff called");
VHEIGHT = Math.floor(parseInt(VWIDTH) * 9 / 16 + 1) + "";
$("#ytapiplayer").width(VWIDTH).height(VHEIGHT);
@ -3591,8 +3596,8 @@ function resizeStuff() {
}
var h = parseInt(VHEIGHT) - $("#chatline").outerHeight() - 1;
$("#messagebuffer").height(h);
$("#userlist").height(h);
//$("#messagebuffer").height(h);//fixin shit
//$("#userlist").height(h);
if (UI_DisplayModeSel=="1") {
m=modesel.val();
@ -3605,23 +3610,23 @@ function resizeStuff() {
$("#videowrap div, #videowrap p").hide();
$("#ytapiplayer").width(1).height(1);
}
fitChat("auto");
// fitChat("auto");
} else if (m=="syMode" && USERCONFIG.player=="center") {
fitChat(200);
// fitChat(200);
} else if (m=="sMode") {
// DEV NOTE: current function is called in "changeMedia" callback (condition race)
VW=$("#messagebuffer").width();
VH=Math.floor(parseInt(VW)*9/16+1);
$("#messagebuffer, #userlist").height(VH);
//$("#messagebuffer, #userlist").height(VH);
}
}
}
// bind new resizing function
$(window).unbind("resize");
$(window).resize(resizeStuff);
//$(window).unbind("resize");
//$(window).resize(resizem);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -3646,6 +3651,7 @@ if (FLUID) {
$("#fontspanel, #emotespanel").addClass('fluidpanel');
}
console.log("WTF");
// finishing variable
LOADED=true;
@ -3666,3 +3672,5 @@ if (UI_ExternalScript=="1" && ExternalScript_URL!="") {
}
/* ----- END OF LIBRARY ----- */

View file

@ -446,7 +446,7 @@ var USERCONFIG = {
"modhash":getOrDefault(CHANNEL.name+"_modhash", ""),
}
var USERTHEME = getOrDefault(CHANNEL.name+"_theme", DEFTHEME);
var FLUID = getOrDefault(CHANNEL.name+"_fluid", false);
var FLUID = getOrDefault(CHANNEL.name+"_fluid", true);
var LAYOUTBOX = getOrDefault(CHANNEL.name+"_layoutbox", true);
var SOUNDSLVL = getOrDefault(CHANNEL.name+"_soundslvl", 3);
var EMBEDIMG = getOrDefault(CHANNEL.name+"_embedimg", true);
@ -659,6 +659,7 @@ function setLayout() {
logoInsert(USERCONFIG.logo);
headerMode(USERCONFIG.header);
customCSS(USERCONFIG.css);
refreshPlayer();
}
// fit player height

View file

@ -676,6 +676,9 @@ Callbacks = {
li.attr("title", data[i].queueby
? ("Added by: " + data[i].queueby)
: "Added by: Unknown");
if(data[i].media.type === "fi"){
li.attr("id", "filei");
}
li.appendTo(q);
}
@ -688,14 +691,22 @@ Callbacks = {
c += "s";
$("#plcount").text(c);
$("#pllength").text(data.time);
startTimes = data.sTimes;
dispSTimes();
},
queue: function(data) {
PL_ACTION_QUEUE.queue(function (plq) {
stopQueueSpinner(data.item.media);
var li = makeQueueEntry(data.item, true);
if (data.item.uid === PL_CURRENT)
if (data.item.uid === PL_CURRENT){
li.addClass("queue_active");
activeItem = data.uid;
}
if(data.item.media.type === "fi"){
li.attr("id", "filei");
}
li.hide();
var q = $("#queue");
li.attr("title", data.item.queueby
@ -774,6 +785,7 @@ Callbacks = {
moveVideo: function(data) {
PL_ACTION_QUEUE.queue(function (plq) {
startTimes = data.sTimes;
playlistMove(data.from, data.after, function () {
plq.release();
});
@ -786,6 +798,7 @@ Callbacks = {
var li = $(".pluid-" + uid);
if (li.length !== 0) {
li.addClass("queue_active");
activeItem = uid;
var tmr = setInterval(function () {
if (!PL_WAIT_SCROLL) {
scrollQueue();

38
www/js/fschd.js Normal file
View file

@ -0,0 +1,38 @@
var startTimes = [[],[]]//UID's, StartTimes
var activeItem = 0;//active UID;
var rptime = 0;//reference playlist time
var rltime = 0;//refernce local time(epoch)
var ctime = 0;
const st = new Date();//scratchtime
function dispSTimes(){//update sTimes
var ptimeString, ltimeString;
calcRefs();//iterate and findRefs before calcTime
//iterate and print
for(var i = 0; i < startTimes[0].length; i++){//for every item startTime
var rdif = startTimes[1][i] - rptime;
st.setTime(rltime + (rdif * 1000));
ltimeString = "airdate: " + st.toLocaleTimeString() + " " + st.toLocaleDateString() + "</br>";
ptimeString = "(pref time) " + formatTime(startTimes[1][i]);// create ptimeString
if(document.getElementsByClassName("pluid-" + startTimes[0][i])[0] != null || document.getElementsByClassName("pluid-" + startTimes[0][i])[0] != undefined){//if current item isnt null or undefined
document.getElementsByClassName("pluid-" + startTimes[0][i])[0].getElementsByClassName("qe_sTime")[0].innerHTML = ltimeString + ptimeString;// set current item qe_sTime innerHTML to ptimeString
}
}
}
function calcRefs(){
ld = new Date();//localdate
for(var i = 0; i < startTimes[0].length; i++){//for every item startTime/until activeItem
if(startTimes[0][i] == activeItem){
rptime = startTimes[1][i];
}
}
PLAYER.getTime(function(seek){ctime = seek});
rltime = ld.getTime() - (ctime * 1000);
}

View file

@ -1624,6 +1624,8 @@
window.handleMediaUpdate = function(data) {
var PLAYER, waiting;
PLAYER = window.PLAYER;
handleWindowResize();
dispSTimes();
if (typeof PLAYER.mediaLength === 'number' && PLAYER.mediaLength > 0 && data.currentTime > PLAYER.mediaLength) {
return;
}

File diff suppressed because it is too large Load diff

View file

@ -320,7 +320,8 @@ $("#queue").sortable({
PL_AFTER = $(prev[0]).data("uid");
socket.emit("moveMedia", {
from: PL_FROM,
after: PL_AFTER
after: PL_AFTER,
sTimes: [[],[]]
});
$("#queue").sortable("cancel");
}
@ -938,3 +939,4 @@ $("#resize-video-smaller").click(function () {
console.error(error);
}
});

View file

@ -466,6 +466,7 @@ function scrollQueue() {
function makeQueueEntry(item, addbtns) {
var video = item.media;
var li = $("<li/>");
console.log(item);
li.addClass("queue_entry");
li.addClass("pluid-" + item.uid);
li.data("uid", item.uid);
@ -482,7 +483,11 @@ function makeQueueEntry(item, addbtns) {
.attr("href", formatURL(video))
.attr("target", "_blank");
var time = $("<span/>").addClass("qe_time").appendTo(li);
time.text(video.duration);
time.text("airtime: " + video.duration);
$("<br/>").appendTo(li);
var sTime = $("<span/>").addClass("qe_sTime").appendTo(li);
sTime.text(" \n");
//dispSTimes();
var clear = $("<div/>").addClass("qe_clear").appendTo(li);
if(item.temp) {
li.addClass("queue_temp");
@ -533,7 +538,8 @@ function addQueueButtons(li) {
.click(function() {
socket.emit("moveMedia", {
from: li.data("uid"),
after: PL_CURRENT
after: PL_CURRENT,
sTimes: [[],[]]
});
})
.appendTo(menu);
@ -2890,6 +2896,7 @@ function checkScriptAccess(viewSource, type, cb) {
setOpt("channel_js_pref", JSPREF);
}
cb("ALLOW");
handleVideoResize();
});
$("#chanjs-deny").click(function () {