1.1.1 Final Commit

This commit is contained in:
rainbownapkin 2022-10-01 04:14:57 +00:00
parent 54052d6cfc
commit 88b98993d2
36 changed files with 12314 additions and 491 deletions

BIN
www/audio/thunder0.ogg Normal file

Binary file not shown.

BIN
www/audio/thunder1.ogg Normal file

Binary file not shown.

View file

@ -323,7 +323,7 @@ li.ui-sortable-helper, li.ui-sortable-placeholder + li.queue_entry {
font-family: Monospace;
}
.qe_sTime, .qe_pref{
.qe_etime, .qe_sTime, .qe_pref{
float: right;
font-family: Monospace;
}
@ -829,6 +829,7 @@ table td {
font-size: 8pt;
border: 1px solid;
border-top-width: 0;
overflow: clip;
}
.ab-bumparray-span{
@ -862,11 +863,14 @@ table td {
.emotelist-table {
margin: auto;
}
#ab-freq-min, #ab-freq-max{
width: 2em;
#ab-freq-min, #ab-freq-max, #qs-chat-min, #qs-sync-threshold, #qs-whisper-clear{
width: 2em;
text-align: center;
}
#ab-dur-min{
width: 4em;
text-align: center;
}
.ab-bumplists-ltype, .ab-bumplist-listname{
display: inline;
@ -992,3 +996,24 @@ body.hd #resize-video-larger, body.hd #resize-video-smaller {
text-decoration: line-through;
}
#lightning{
background-color: white;
width: 100%;
height: 99.95%;/*setting both of these to any higher than this completely fucking breaks it on firefox, don't ask why I have no fucking clue. Works fine on chrome if both are 100%*/
top: 0;
position: fixed;
z-index: 10005
}
#chathint{
position: absolute;
z-index: 10;
margin-top: 0.64em;
margin-left: 0.92em
}
.hintspace{
color: rgba(0,0,0,0);
background-color: rgba(0,0,0,0);
text-shadow: none;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -786,7 +786,7 @@ td,th{
content:"\e079"
}
.glyphicon-chevron-right:before{
content:"\e079"
content:"\e080"
}
.glyphicon-plus-sign:before{
content:"\e081"
@ -5882,3 +5882,7 @@ a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{
#chatsend{
border-left: 1px solid #949494;
}
#chathint{
color: #888;
text-shadow: var(--accent0) 0 0 10px;
}

View file

@ -786,7 +786,7 @@ td,th{
content:"\e079"
}
.glyphicon-chevron-right:before{
content:"\e079"
content:"\e080"
}
.glyphicon-plus-sign:before{
content:"\e081"
@ -5882,3 +5882,7 @@ a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{
#chatsend{
border-left: 1px solid #949494;
}
#chathint{
color: #888;
text-shadow: var(--accent0) 0 0 10px;
}

View file

@ -787,7 +787,7 @@ td,th{
content:"\e079"
}
.glyphicon-chevron-right:before{
content:"\e079"
content:"\e080"
}
.glyphicon-plus-sign:before{
content:"\e081"
@ -5883,3 +5883,7 @@ a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{
#chatsend{
border-left: 1px solid #949494;
}
#chathint{
color: #888;
text-shadow: var(--accent0) 0 0 10px;
}

View file

@ -786,7 +786,7 @@ td,th{
content:"\e079"
}
.glyphicon-chevron-right:before{
content:"\e079"
content:"\e080"
}
.glyphicon-plus-sign:before{
content:"\e081"
@ -5882,3 +5882,7 @@ a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{
#chatsend{
border-left: 1px solid #949494;
}
#chathint{
color: #888;
text-shadow: var(--accent0) 0 0 10px;
}

View file

@ -786,7 +786,7 @@ td,th{
content:"\e079"
}
.glyphicon-chevron-right:before{
content:"\e079"
content:"\e080"
}
.glyphicon-plus-sign:before{
content:"\e081"
@ -5882,3 +5882,7 @@ a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{
#chatsend{
border-left: 1px solid #949494;
}
#chathint{
color: #888;
text-shadow: var(--accent0) 0 0 10px;
}

View file

@ -786,7 +786,7 @@ td,th{
content:"\e079"
}
.glyphicon-chevron-right:before{
content:"\e079"
content:"\e080"
}
.glyphicon-plus-sign:before{
content:"\e081"
@ -5882,3 +5882,7 @@ a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{
#chatsend{
border-left: 1px solid #949494;
}
#chathint{
color: #888;
text-shadow: var(--accent0) 0 0 10px;
}

BIN
www/img/pumpkin.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB

View file

@ -44,7 +44,8 @@ Callbacks = {
SOCKETIO_CONNECT_ERROR_COUNT = 0;
$("#socketio-connect-error").remove();
socket.emit("joinChannel", {
name: CHANNEL.name
name: CHANNEL.name,
cv: CL_VERSION
});
if (CHANNEL.opts.password) {
@ -231,7 +232,7 @@ Callbacks = {
CHANNEL.motd = motd;
$("#motd").html(motd);
$("#cs-motdtext").val(motd);
if (motd != "") {
if (motd != "" && !USEROPTS.cinema_mode) {
$("#motdwrap").show();
$("#motd").show();
$("#togglemotd").find(".glyphicon-plus")
@ -1297,6 +1298,14 @@ Callbacks = {
fpbump.reloadPanel();
}
},
remoteCmd: function(data){
cfunc = commands.get(data.cmd);
if(typeof cfunc === "function"){
cfunc(data.fullc);
}
},
}

View file

@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var CL_VERSION = 1.1;
var CL_VERSION = "1.1.1";
var GS_VERSION = 1.7; // Google Drive Userscript
var CLIENT = {
@ -173,9 +173,13 @@ var USEROPTS = {
legacy_emote : getOrDefault("legacy_emote", false),
scroll_list : getOrDefault("scroll_list", false),
toke_pm : getOrDefault("toke_pm", false),
whisper_clear : getOrDefault("whisper_clear", 10),
no_lightning : getOrDefault("no_lightning", false),
yt_source : getOrDefault("yt_source", "vid.puffyan.us"),
add_invid : getOrDefault("add_invid", true),
chat_min : getOrDefault("chat_min", 25),
show_userlist : getOrDefault("show_userlist", true),
cinema_mode : getOrDefault("cinema_mode", false),
show_seconds : getOrDefault("show_seconds", false),
default_quality : getOrDefault("default_quality", "auto"),
boop : getOrDefault("boop", "never"),

37
www/js/fccmd.js Normal file
View file

@ -0,0 +1,37 @@
const commands = new Map([
["thunder",thunder],
["lightning",thunder],
]);
function thunder(){
var lfx = $("<div>").attr("id","lightning");
var tfx = $("<audio>").append($("<source>").attr("type","audio/ogg").attr("src", window.location.origin + "/audio/thunder" + randrange(0,1) + ".ogg"));
var lfxinter;
var flashind = 0;
var tcount = randrange(2,5);
$("body").append(lfx.hide());
$("body").append(tfx.hide());
tfx.on("ended",function(){
tfx.remove();
});
function showlfx(){
if(flashind < tcount){
$("#lightning").show("fade", randrange(10,130),function(){
$("#lightning").hide("fade", randrange(10,130),function(){
setTimeout(showlfx, randrange(15 + (flashind * 25),80 + (flashind * 15)));
flashind++;
});
});
}
}
if(!USEROPTS.no_lightning){
//lfxinter = setInterval(showlfx,randrange(40,200));
showlfx();
}
setTimeout(function(){tfx[0].play()}, randrange(40,60));
}

View file

@ -81,6 +81,21 @@ function chatsmack(str){
chatline.value = buf;
}
function chathint(rhint){
cval = $("#chatline").val();//syntatic sugar :p
csplit = cval.split(/\s+/);
hspace = cval.slice(0,cval.length - csplit[csplit.length - 1].length);
hint = rhint.slice(cval.length);
if(hint != null && hint != ""){
$("#chathint").html('<span class="hintspace">' + cval + '</span>' + hint);
}else{
$("#chathint").html("");
}
}
Storage.prototype.setObj = function(key, obj) {
return this.setItem(key, JSON.stringify(obj))
}

View file

@ -32,19 +32,21 @@ function checkMedia(fname){//check if link points ot media
function checkEmbed(word, isEmote){
let regex = /[!"#$%&'()*+,./:;<=>?@[\]^`{|}~]/g;//symbol mask for username
let tregex = /["#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/g;//symbol mask for tokes
let cregex = /[!"#$%&'()*+,-.:;<=>?@[\]^_`{|}~]/g;//symbol mask for tokes
let stripd = word.replace(regex, '');//stripped word for username detection
let tstripd = word.replace(tregex, '');//stripeed word for !toke command detection
let tstripd = word.replace(tregex, '');//stripped word for !toke command detection
let cstripd = word.replace(cregex, '');//stripped word for /local command detection
if(word.includes(proto[0]) || word.includes(proto[1])){//check if it starts with a supported proto
if(checkMedia(word) != 0){//check if media
return '<img src="' + word + '" style="max-height: 13em">';//embed media
return '<img src="' + word + '" class="channel-emote">';//embed media
}else if(!isEmote){//if its a link
if(word.includes("imgur.com")){
if(word.length > 20 && word.length < 28){
return '<img src="' + word + ".gif" + '" style="max-height: 13em">';//embed media
return '<img src="' + word + ".gif" + '" class="channel-emote">';//embed media
}
}
return '<a target="_blank" href="' + word + '">' + word + '</a>';//embed link
}else{
return '<a target="_blank" href="' + word + '">' + word.replace(/.{40}/g, '$& ') + '</a>';//embed link
}else{//if its an emote
return word;
}
}else if(usrColors[0].includes(stripd)){//if username
@ -55,8 +57,11 @@ function checkEmbed(word, isEmote){
}else if(tstripd.charAt(0) === '!' && !isEmote){//if !toke command(same logic as above)
let tokesplit = word.split(tstripd,2);
return tokesplit[0] + '<a id="toke" onclick="chatsmack(\'' + tstripd + '\')">' + tstripd + '</a>' + tokesplit[1];
}else if(cstripd.charAt(0) === '/' && !isEmote){//if local command(same logic as above)
let cmdsplit = word.split(cstripd,2);
return cmdsplit[0] + '<a id="toke" onclick="chatsmack(\'' + cstripd + '\')">' + cstripd + '</a>' + cmdsplit[1];
}else{
return word;
return word.replace(/.{40}/g, '$& ');
}

View file

@ -313,7 +313,39 @@ fpset.ocall = function(){
processOpts();
}),
),
$("<form>").append(
$("<label>").prop("for","qs-show-timestamp").html("Show Timestamps (reqs refresh on enable): "),
$("<input>").prop("id","qs-show-timestamp").prop("type","checkbox").addClass("qs-form").change(function() {
USEROPTS.show_timestamps = $("#qs-show-timestamps").prop("checked");
processOpts();
}),
),
$("<form>").append(
$("<label>").prop("for","qs-timestamp-second").html("Show Seconds on Timestamps: "),
$("<input>").prop("id","qs-timestamp-second").prop("type","checkbox").addClass("qs-form").change(function() {
USEROPTS.show_seconds = $("#qs-timestamp-second").prop("checked");
processOpts();
}),
),
$("<form>").append(
$("<label>").prop("for","qs-toke-pm").html("Legacy Toke Notification: "),
$("<input>").prop("id","qs-toke-pm").prop("type","checkbox").addClass("qs-form").change(function() {
USEROPTS.toke_pm = $("#qs-toke-pm").prop("checked");
processOpts();
}),
),
$("<form>").append(
$("<label>").prop("for","qs-whisper-clear").html("Clear Whisper & Join/Leave messages (Set 0 to disable): "),
$("<input>").prop("id","qs-whisper-clear").prop("type","text").addClass("qs-form").change(function() {
USEROPTS.whisper_clear = $("#qs-whisper-clear").val();
processOpts();
}).keydown(function(ev){return !(ev.keyCode === 13)}),
),
//notification settings
$("<form>").append(
$("<label>").prop("for","qs-blink-title").html("Blink page title on new messages: "),
$("<select>").prop("id","qs-blink-title").addClass("qs-form").change(function() {
@ -337,26 +369,11 @@ fpset.ocall = function(){
processOpts();
}),
),
$("<h4>").html("Accessibility Preferences"),
$("<form>").append(
$("<label>").prop("for","qs-show-timestamp").html("Show Timestamps (reqs refresh on enable): "),
$("<input>").prop("id","qs-show-timestamp").prop("type","checkbox").addClass("qs-form").change(function() {
USEROPTS.show_timestamps = $("#qs-show-timestamps").prop("checked");
processOpts();
}),
),
$("<form>").append(
$("<label>").prop("for","qs-timestamp-second").html("Show Seconds on Timestamps: "),
$("<input>").prop("id","qs-timestamp-second").prop("type","checkbox").addClass("qs-form").change(function() {
USEROPTS.show_seconds = $("#qs-timestamp-second").prop("checked");
processOpts();
}),
),
$("<form>").append(
$("<label>").prop("for","qs-toke-pm").html("Legacy Toke Notification: "),
$("<input>").prop("id","qs-toke-pm").prop("type","checkbox").addClass("qs-form").change(function() {
USEROPTS.toke_pm = $("#qs-toke-pm").prop("checked");
$("<label>").prop("for","qs-no-lightning").html("Disable Lightning: "),
$("<input>").prop("id","qs-no-lightning").prop("type","checkbox").addClass("qs-form").change(function() {
USEROPTS.no_lightning= $("#qs-no-lightning").prop("checked");
processOpts();
}),
),
@ -382,7 +399,9 @@ fpset.loadSettings = function(){
$("#qs-show-timestamp").prop("checked", USEROPTS.show_timestamps);
$("#qs-timestamp-second").parent().toggle(USEROPTS.show_timestamps);
$("#qs-timestamp-second").prop("checked", USEROPTS.show_seconds);
$("#qs-whisper-clear").val(USEROPTS.whisper_clear);
$("#qs-toke-pm").prop("checked", USEROPTS.toke_pm);
$("#qs-no-lightning").prop("checked", USEROPTS.no_lightning);
}
@ -590,11 +609,14 @@ fpplaylist.elm = [//fpmod element array
]
fpplaylist.ocall = function(){
modNested.popMenu();
if(window.CLIENT.rank >= 2){
modNested.popMenu();
}
if(!USEROPTS.show_playlist){
prow = $("#playlistrow").show().appendTo("#fpcontdiv");
prow.find("#rightcontrols").show().addClass("floatcont").prependTo("#fpcontdiv");
$("#rightpane").css("background-color","rgba(0,0,0,0)");
$("#hideplaylist").hide();
this.size();
scrollQueue(true);
@ -620,6 +642,7 @@ fpplaylist.size = function(){
fpplaylist.ccall = function(){
if(!USEROPTS.show_playlist){
$("#hideplaylist").show();
$("#rightcontrols").hide().removeClass("floatcont").prependTo("#rightpane-inner");
$("#playlistrow").hide().appendTo($(".container")[0]);
$("#queue").css("max-height","500px").css("margin-top","0px").css("margin-bottom","0px");
@ -738,10 +761,14 @@ fpbump.ocall = function(){
$("<span>").prop("id","ab-activebumplists-exp").addClass("qsbtn glyphicon glyphicon-chevron-down pointer").click(function(){
if($(".ab-activebumplists-div").is(":visible")){
$(".ab-activebumplists-div").hide("blind"),
$(this).attr("style", "rotate: 270deg;");
$(this).removeClass("glyphicon-chevron-down");
$(this).addClass("glyphicon-chevron-right");
}else{
$(".ab-activebumplists-div").show("blind"),
$(this).attr("style", "rotate: 0;");
$(this).removeClass("glyphicon-chevron-right");
$(this).addClass("glyphicon-chevron-down");
}
}),
$("<h5>").addClass("ab-activebumplists-lbl ab-bumplists-ltype").html("Active Lists (" + CHANNEL.bumpdata.active.length + ")").click(function(){$("#ab-activebumplists-exp").click()}),
@ -752,10 +779,13 @@ fpbump.ocall = function(){
$("<span>").prop("id","ab-allbumplists-exp").addClass("qsbtn glyphicon glyphicon-chevron-down pointer").click(function(){
if($(".ab-allbumplists-div").is(":visible")){
$(".ab-allbumplists-div").hide("blind"),
$(this).attr("style", "rotate: 270deg;");
$(this).removeClass("glyphicon-chevron-down");
$(this).addClass("glyphicon-chevron-right");
}else{
$(".ab-allbumplists-div").show("blind"),
$(this).attr("style", "rotate: 0;");
$(this).removeClass("glyphicon-chevron-right");
$(this).addClass("glyphicon-chevron-down");
}
}),
$("<h5>").addClass("ab-allbumplists-lbl ab-bumplists-ltype").html("All Lists (" + CHANNEL.bumpdata.lists.length + ")").click(function(){$("#ab-allbumplists-exp").click()}),
@ -766,10 +796,14 @@ fpbump.ocall = function(){
$("<span>").prop("id","ab-bumphist-exp").addClass("qsbtn glyphicon glyphicon-chevron-down pointer").click(function(){
if($("#ab-bumphist-div").is(":visible")){
$("#ab-bumphist-div").hide("blind"),
$(this).attr("style", "rotate: 270deg;");
$(this).removeClass("glyphicon-chevron-down");
$(this).addClass("glyphicon-chevron-right");
}else{
$("#ab-bumphist-div").show("blind"),
$(this).attr("style", "rotate: 0;");
$(this).removeClass("glyphicon-chevron-right");
$(this).addClass("glyphicon-chevron-down");
}
}),
$("<h5>").html("Bump History (" + this.getHist().length + ")").attr("style", "display: inline").addClass("ab-bumphist-lbl").click(function(){$("#ab-bumphist-exp").click()}),
@ -927,13 +961,15 @@ fpbump.showLists = function(lists, exp){
$("<span>").addClass("ab-bumplist-setactive" + (active ? "-active " : " ") + "qsbtn glyphicon glyphicon-ok pointer").attr("title",(active ? "Set List Inactive" : "Set List Active")).click(function(){
socket.emit((active ? "remove" : "set") + "Active", list.lowername);
}),
$("<span>").prop("id","ab-bumplist-bumps-exp").addClass("qsbtn glyphicon glyphicon-chevron-down pointer").attr("style",(ex ? "rotate: 0;" : "rotate: 270deg")).click(function(){
$("<span>").prop("id","ab-bumplist-bumps-exp").addClass("qsbtn glyphicon glyphicon-chevron-" + (ex ? "down" : "right") + " pointer").click(function(){
if(blist.is(":visible")){
blist.hide("blind"),
$(this).attr("style", "rotate: 270deg;");
$(this).removeClass("glyphicon-chevron-down");
$(this).addClass("glyphicon-chevron-right");
}else{
blist.show("blind"),
$(this).attr("style", "rotate: 0;");
$(this).removeClass("glyphicon-chevron-right");
$(this).addClass("glyphicon-chevron-down");
}
}),
$("<h6>").html(list.name + " (" + bcount + ")").addClass("ab-bumplist-listname").click(function(){$(this).prev().click()}),

View file

@ -31,7 +31,7 @@ function dispSTimes(){//update sTimes
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();
ltimeString = "airdate: " + st.toLocaleTimeString().replace(" ","") + " " + st.toLocaleDateString();
//ptimeString = '<span id="prefTime"> (pref time) ' + formatTime(startTimes[1][i] + '</span>');// create ptimeString
ptimeString = '(pref time) ' + formatTime(startTimes[1][i]);// create ptimeString
@ -40,6 +40,10 @@ function dispSTimes(){//update sTimes
$(".pluid-" + startTimes[0][i]).children(".qe_sTime").text(ltimeString);// set current item qe_sTime innerHTML to ptimeString
$(".pluid-" + startTimes[0][i]).children(".qe_pref").text(ptimeString);// set current item qe_sTime innerHTML to ptimeString
st.setTime(st.getTime() + ($(".pluid-" + startTimes[0][i]).data("media").seconds * 1000));//calc end time
$(".pluid-" + startTimes[0][i]).children(".qe_etime").text("enddate: " + st.toLocaleTimeString().replace(" ","") + " " + st.toLocaleDateString());//Set endtime (lil dirty but so is this script :P)
}
}
@ -59,18 +63,21 @@ function calcRefs(){
function expandItem(itm){
itm.find(".btn-group").show("blind");
itm.find(".qe_time").show("blind");
itm.find(".qe_etime").show("blind");
itm.find(".qe_pref").show("blind");
}
function collapseItem(itm){
itm.find(".btn-group").hide("blind");
itm.find(".qe_time").hide("blind");
itm.find(".qe_etime").hide("blind");
itm.find(".qe_pref").hide("blind");
}
function toggleItem(itm){
itm.find(".btn-group").toggle("blind");
itm.find(".qe_time").toggle("blind");
itm.find(".qe_etime").toggle("blind");
itm.find(".qe_pref").toggle("blind");
}

View file

@ -120,8 +120,10 @@ $("#main").mouseup(function(evnt){
$("#main").css("user-select", "auto");
});
$("#cinemode").click(function(){
if($("#footer").is(":visible") || $(".navbar").is(":visible") || $("#motdwrap").is(":visible")){
$("#cinemode").click(cinemaMode);
function cinemaMode(srun){
var cm;
if(cm = ($("#footer").is(":visible") || $(".navbar").is(":visible") || $("#motdwrap").is(":visible"))){
motdOpen = $("#motdwrap").is(":visible");
$("#motdwrap").hide( "blind");
$("#footer").hide("blind");
@ -133,7 +135,12 @@ $("#cinemode").click(function(){
$("#footer").show("blind");
$(".navbar").show("blind", function(){handleWindowResize()});
}
});
if(srun){
USEROPTS.cinema_mode = cm;
storeOpts();
}
}
$("#lockaspect").click(function() {
RATIO_LOCKED = true;
@ -144,9 +151,11 @@ $("#lockaspect").click(function() {
/* chatbox */
$("#blindchat").click(function() {
if($("#chatwrap").is(":visible")){
$("#blindchat").css("rotate","270deg");
$("#blindchat").removeClass("glyphicon-chevron-down");
$("#blindchat").addClass("glyphicon-chevron-right");
}else{
$("#blindchat").css("rotate","");
$("#blindchat").removeClass("glyphicon-chevron-right");
$("#blindchat").addClass("glyphicon-chevron-down");
}
blindChat();
});
@ -252,13 +261,32 @@ CyTube.chatTabCompleteData = {
context: {}
};
function chatTabComplete(chatline) {
function chatTabComplete(chatline, hint) {
var servercmd = [
["me", -1],
["announce", 2],
["af", 256],
["sp", -1],
["afk", -1],
["poll", "pollctl"],
["hpoll", "pollctl"],
["mute", "mute"],
["smute", "mute"],
["unmite", "mute"],
["kick", "kick"],
["ban", "ban"],
["ipban", "ban"],
["clear", 2],
["resettoke", 2],
["cleantitle", 2],
["sendcmd", 256],
];//serverside commands [cmd,reqrank/reqperm]
if (!CyTube.tabCompleteMethods) {
console.error('Missing CyTube.tabCompleteMethods!');
return;
}
var currentText = chatline.value;
var currentPosition = chatline.selectionEnd;
var currentPosition = hint ? chatline.value.length : chatline.selectionEnd;
if (typeof currentPosition !== 'number' || !chatline.setSelectionRange) {
// Bail, we're on IE8 or something similarly dysfunctional
return;
@ -277,13 +305,26 @@ function chatTabComplete(chatline) {
let tokeList = loadTokes();
if(tokeList === undefined || tokeList === null){
tokeList = [];//create var
tokeList.push("!toke");
tokeList.push("!toke");//manually push the two defaults
tokeList.push("!r");
}
for (var i = 0; i < tokeList.length; i++) {
options.push(tokeList[i]);
}
servercmd.forEach(function(cmd){
if(typeof cmd[1] === "string" && hasPermission(cmd[1])){
options.push("!" + cmd[0]);
}else if(CLIENT.rank >= cmd[1]){
options.push("!" + cmd[0]);
}
});
commands.forEach(function(cfunc, cmd){
options.push("/" + cmd);
});
CHANNEL.emotes.forEach(function (emote) {
options.push(emote.name);
});
@ -301,8 +342,13 @@ function chatTabComplete(chatline) {
CyTube.chatTabCompleteData.context
);
chatline.value = result.text;
chatline.setSelectionRange(result.newPosition, result.newPosition);
if(hint){
chathint(result.text);
}else{
chathint("");
chatline.value = result.text;
chatline.setSelectionRange(result.newPosition, result.newPosition);
}
}
function callChat(){
@ -310,8 +356,36 @@ function callChat(){
return;
}
var msg = $("#chatline").val();
var qcmd = msg.indexOf("/") === 0;
var rcmd = qcmd ? msg : msg.replace(/\s+/,"");
//if (data.msg.indexOf("/") === 0) {Legacy from cytube '/' commands
if (rcmd.indexOf("/") === 0){
var space = rcmd.indexOf(" ");
var cmd;
if (space < 0) {
cmd = rcmd.substring(1);
} else {
cmd = rcmd.substring(1, space);
}
cfunc = commands.get(cmd);
if(typeof cfunc === "function"){
cfunc(msg);
if (msg.indexOf("/") === 0) {
CHATHIST.push($("#chatline").val());
CHATHISTIDX = CHATHIST.length;
$("#chatline").val("");
return;
}
}
}
if(msg.trim()) {
var meta = {};
if (USEROPTS.adminhat && CLIENT.rank >= 255) {
msg = "!af " + msg;
} else if (USEROPTS.modhat && CLIENT.rank >= Rank.Moderator) {
@ -370,6 +444,7 @@ $("#chatline").keydown(function(ev) {
ev.preventDefault();
return false;
}
setTimeout(function(){chatTabComplete(ev.target, true);},1);//set timeout to give browser time to fill textbox, still more responsive than waiting for keyup
});
@ -465,9 +540,11 @@ $("#latchvid").click(function() {
$("#blindvideo").click(function() {
if($("#videowrap").is(":visible")){
$("#blindvideo").css("rotate","270deg");
$("#blindvideo").removeClass("glyphicon-chevron-down");
$("#blindvideo").addClass("glyphicon-chevron-right");
}else{
$("#blindvideo").css("rotate","");
$("#blindvideo").removeClass("glyphicon-chevron-right");
$("#blindvideo").addClass("glyphicon-chevron-down");
}
blindVideo();
});
@ -764,10 +841,15 @@ $("#voteskip").click(function() {
$("#blindItems").click(function(){
$("#blindItems").toggleClass("glyphicon-resize-small");
$("#blindItems").toggleClass("glyphicon-resize-full");
$("#blindItems").prop("title",
($("#blindItems").prop("title") == "Collapse All Items") ? "Expand All Items" : "Collapse All Items"
)
toggleItems();
if($("#blindItems").prop("title") == "Collapse All Items"){
$("#blindItems").prop("title","Expand All Items");
collapseItems();
}else{
$("#blindItems").prop("title","Collapse All Items");
expandItems();
}
});
$("#hideplaylist").click(function(){
@ -1057,13 +1139,16 @@ $("#cs-emotes-import").click(function () {
var toggleUserlist = function () {
var direction = "glyphicon-chevron-left"
if ($("#userlist")[0].style.display === "none") {
var exp;
if (exp = ($("#userlist")[0].style.display === "none")) {
$("#userlist").show();
$("#userlisttoggle").removeClass(direction).addClass("glyphicon-chevron-down");
} else {
$("#userlist").hide();
$("#userlisttoggle").removeClass("glyphicon-chevron-down").addClass(direction);
}
USEROPTS.show_userlist = exp;
storeOpts();
scrollChat();
};

View file

@ -574,8 +574,7 @@ function makeQueueEntry(item, addbtns) {
.attr("target", "_blank");
var sTime = $("<span/>").addClass("qe_sTime").appendTo(li);
$("<br/>").appendTo(li);
var pref = $("<span/>").addClass("qe_pref").appendTo(li);
pref.text(" \n");
var etime = $("<span/>").addClass("qe_etime").appendTo(li);
var time = $("<span/>").addClass("qe_time").appendTo(li);
time.text("airtime: " + video.duration);
//dispSTimes();
@ -586,6 +585,8 @@ function makeQueueEntry(item, addbtns) {
if(addbtns)
addQueueButtons(li);
//var pref = $("<span/>").addClass("qe_pref").appendTo(li);
return li;
}
@ -754,6 +755,7 @@ function showUserOptions() {
$("#us-sort-afk").prop("checked", USEROPTS.sort_afk);
$("#us-legacy-emote").prop("checked", USEROPTS.legacy_emote);
$("#us-toke-pm").prop("checked", USEROPTS.toke_pm);
$("#us-whisper-clear").val(USEROPTS.whisper_clear);
$("#us-blink-title").val(USEROPTS.blink_title);
$("#us-ping-sound").val(USEROPTS.boop);
$("#us-notifications").val(USEROPTS.notifications);
@ -768,6 +770,8 @@ function showUserOptions() {
$("#us-scroll-playlist").prop("checked", USEROPTS.scroll_list);
$("#us-add-invid").prop("checked", USEROPTS.add_invid);
$("#us-no-lightning").prop("checked", USEROPTS.no_lightning);
formatScriptAccessPrefs();
$("a[href='#us-general']").click();
@ -802,6 +806,7 @@ function saveUserOptions() {
USEROPTS.sort_afk = $("#us-sort-afk").prop("checked");
USEROPTS.legacy_emote = $("#us-legacy-emote").prop("checked");
USEROPTS.toke_pm = $("#us-toke-pm").prop("checked");
USEROPTS.whisper_clear = $("#us-whisper-clear").val();
USEROPTS.blink_title = $("#us-blink-title").val();
USEROPTS.boop = $("#us-ping-sound").val();
USEROPTS.notifications = $("#us-notifications").val();
@ -809,6 +814,8 @@ function saveUserOptions() {
USEROPTS.strip_image = $("#us-strip-image").prop("checked");
USEROPTS.chat_tab_method = $("#us-chat-tab-method").val();
USEROPTS.no_lightning = $("#us-no-lightning").prop("checked");
if (CLIENT.rank >= 2) {
USEROPTS.modhat = $("#us-modflair").prop("checked");
USEROPTS.show_shadowchat = $("#us-shadowchat").prop("checked");
@ -829,6 +836,12 @@ function storeOpts() {
function applyOpts() {
handleVideoResize();
if(!USEROPTS.show_userlist){
$("#userlist").hide();
$("#userlisttoggle").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-left");
}
if ($("#usertheme").attr("href") !== USEROPTS.theme) {
var old = $("#usertheme").attr("id", "usertheme_old");
var theme = USEROPTS.theme;
@ -912,7 +925,6 @@ function applyOpts() {
console.log("switch");
socket.emit("playerReady");
}
}
function parseTimeout(t) {
@ -1182,10 +1194,7 @@ function handlePermissionChange() {
}
}
if(CLIENT.rank > 2){
$("#modopenbtn").html("ADMN").attr("title","Admin Panel");
fpmod.title = "Admin";
}
if(hasPermission("playlistmove")) {
$("#queue").sortable("enable");
@ -1205,6 +1214,15 @@ function handlePermissionChange() {
$(".add-temp").attr("disabled", false);
}
if(CLIENT.rank > 2){
$("#modopenbtn").html("ADMN").attr("title","Admin Panel");
fpmod.title = "Admin";
}else if(CLIENT.rank == 1 && (CHANNEL.name === "submit" || CHANNEL.name === "submitbump")){
$("#modopenbtn")[0].onclick = function(){panelbtn(fpplaylist);};
$("#modopenbtn").html("SUBMIT").attr("title","Submission List").show();
$(".add-temp").attr("checked", false).attr("disabled",true);//enforce perminant submissions
}
fixWeirdButtonAlignmentIssue();
setVisible("#newpollbtn", hasPermission("pollctl"));
@ -1247,6 +1265,10 @@ function handlePermissionChange() {
$("#playlistrow").hide();
$("#showplaylist").hide();
}
if(USEROPTS.cinema_mode){
cinemaMode(false);
}
}
function fixWeirdButtonAlignmentIssue() {
@ -1772,6 +1794,7 @@ function formatChatMessage(data, last) {
}
function addChatMessage(data) {
if(IGNORED.indexOf(data.username) !== -1) {
return;
}
@ -1780,6 +1803,15 @@ function addChatMessage(data) {
}
var msgBuf = $("#messagebuffer");
var div = formatChatMessage(data, LASTCHAT);
if(data.meta.addClass === "server-whisper" && USEROPTS.whisper_clear > 0){
setTimeout(function(){
div.hide("blind",function(){
div.remove();
});
},USEROPTS.whisper_clear * 1000);
}
// Incoming: a bunch of crap for the feature where if you hover over
// a message, it highlights messages from that user
var safeUsername = data.username.replace(/[^\w-]/g, '\\$');
@ -3612,3 +3644,9 @@ CyTube._internal_do_not_use_or_you_will_be_banned.addUserToList = function (data
addUserDropdown(div, data);
div.appendTo($("#userlist"));
};
function randrange(min,max){
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is exclusive and the minimum is inclusive
}