Autobump system and UI complete. The bulk of this update is now over.
Just a couple of bug fixes and tweaks before release.
This commit is contained in:
parent
c9fb5b0b0e
commit
85fbe6bb5a
9 changed files with 925 additions and 72 deletions
|
|
@ -822,7 +822,7 @@ table td {
|
|||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.queue_entry {
|
||||
.queue_entry, .ab-bumparray-bump{
|
||||
line-height: 22px;
|
||||
padding: 2px;
|
||||
font-size: 8pt;
|
||||
|
|
@ -830,10 +830,53 @@ table td {
|
|||
border-top-width: 0;
|
||||
}
|
||||
|
||||
.ab-bumparray-span{
|
||||
display: grid;
|
||||
grid-template: 2em 2em / 33% 33% auto;
|
||||
grid-auto-flow: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.ab-bumparray-creator{
|
||||
display: inline;
|
||||
}
|
||||
.ab-bumparray-cspan{
|
||||
float: right;
|
||||
}
|
||||
#ab-bumphist-div{
|
||||
overflow: scroll;
|
||||
max-height: 25em;
|
||||
}
|
||||
.ab-bumplist-lbl, .ab-newlist-form{
|
||||
display: inline;
|
||||
}
|
||||
.ab-newlist-form{
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
.ab-newbump-form{
|
||||
display: inline;
|
||||
}
|
||||
.ab-newbump-cancel{
|
||||
display: inline;
|
||||
}
|
||||
.emotelist-table {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#ab-freq-min, #ab-freq-max{
|
||||
width: 2em;
|
||||
}
|
||||
#ab-dur-min{
|
||||
width: 4em;
|
||||
}
|
||||
.ab-bumplists-ltype, .ab-bumplist-listname{
|
||||
display: inline;
|
||||
}
|
||||
.ab-bumplist-bumps{
|
||||
max-height: 30em;
|
||||
overflow: scroll;
|
||||
}
|
||||
.ab-bumplist-delete{
|
||||
float: right;
|
||||
}
|
||||
.emote-preview-container {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
|
|
@ -937,6 +980,9 @@ input#logout[type="submit"]:hover {
|
|||
font-weight: 700;
|
||||
display: inline;
|
||||
}
|
||||
#ab-bumparray-reuserfl{
|
||||
margin: 0px;
|
||||
}
|
||||
body.hd #resize-video-larger, body.hd #resize-video-smaller {
|
||||
display: none;
|
||||
}
|
||||
|
|
@ -944,3 +990,7 @@ body.hd #resize-video-larger, body.hd #resize-video-smaller {
|
|||
.userlist-ignored {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
#bumpi{
|
||||
background-image: url("../img/bumps.png");
|
||||
background-size: 2.2em;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -988,7 +988,7 @@ hr{
|
|||
font-size:16px
|
||||
}
|
||||
p{
|
||||
margin:0 0 10px
|
||||
margin:0;
|
||||
}
|
||||
.lead{
|
||||
margin-bottom:20px;
|
||||
|
|
@ -5396,7 +5396,7 @@ a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{
|
|||
}
|
||||
/* CYTUBE EDIT */
|
||||
body {
|
||||
background-image: url(https://ourfore.st/img/frst.jpg);
|
||||
background-image: url(../../img/frst.jpg);
|
||||
color: #c8c8c8;
|
||||
}
|
||||
|
||||
|
|
@ -5471,11 +5471,34 @@ a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{
|
|||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.queue_entry {
|
||||
.ab-bumparray-bump, .queue_entry {
|
||||
border-color: #949494;
|
||||
background-color: #060606;
|
||||
}
|
||||
.navbar-inverse .navbar-text-nofloat {
|
||||
.ab-bumparray-edit{
|
||||
margin: 0 0.5em 0 0.5em;
|
||||
}
|
||||
.ab-bumplist-list{
|
||||
background-color: #060606;
|
||||
border-bottom: 1px solid #949494;
|
||||
margin: 0;
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
.ab-bumplist-bumps{
|
||||
border-top: 1px solid #949494;
|
||||
}
|
||||
.ab-bumplist-setactive-active{
|
||||
color: #339933;
|
||||
text-shadow: #339933 0 0 10px;
|
||||
}
|
||||
.ab-bumplist-delete{
|
||||
color: #c00;
|
||||
}
|
||||
.ab-bumplist-setactive:hover, .ab-bumplist-setactive-active:hover{
|
||||
color: #ded;
|
||||
text-shadow: #339933 0 0 10px;
|
||||
}
|
||||
.navbar-inverse .navbar-text-nofloat {
|
||||
color: #888;
|
||||
}
|
||||
.queue_entry.queue_active {
|
||||
|
|
|
|||
BIN
www/img/bumps.png
Normal file
BIN
www/img/bumps.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
|
|
@ -743,6 +743,9 @@ Callbacks = {
|
|||
if(data[i].media.type === "fi"){
|
||||
li.attr("id", "filei");
|
||||
}
|
||||
if(data[i].media.isBump){
|
||||
li.attr("id", "bumpi");
|
||||
}
|
||||
li.appendTo(q);
|
||||
}
|
||||
|
||||
|
|
@ -768,10 +771,15 @@ Callbacks = {
|
|||
li.addClass("queue_active");
|
||||
activeItem = data.uid;
|
||||
}
|
||||
|
||||
if(data.item.media.type === "fi"){
|
||||
li.attr("id", "filei");
|
||||
}
|
||||
|
||||
|
||||
if(data.item.media.isBump){
|
||||
li.attr("id", "bumpi");
|
||||
}
|
||||
|
||||
li.hide();
|
||||
var q = $("#queue");
|
||||
li.attr("title", data.item.queueby
|
||||
|
|
@ -1203,8 +1211,85 @@ Callbacks = {
|
|||
},
|
||||
|
||||
sendBumplists: function (data){
|
||||
console.log(data);
|
||||
}
|
||||
data.lists.forEach(function(list){//tattoo listnames, saves bandwith
|
||||
list.bumps.forEach(function(bump){
|
||||
if(bump != null){
|
||||
bump.listname = list.lowername;
|
||||
}
|
||||
});
|
||||
});
|
||||
CHANNEL.bumpdata = data;//the best answer is usually the easy one. Why re-create an object client side when we can just use the one we got handed?
|
||||
if(CURRENTFPANEL == fpbump){
|
||||
fpbump.reloadPanel();
|
||||
}
|
||||
},
|
||||
|
||||
sendBumplist: function (data){
|
||||
var lfound = null;
|
||||
CHANNEL.bumpdata.lists.forEach(function(list, i){
|
||||
if(data.oname == null){
|
||||
if(lfound == null && data.lowername === list.lowername){
|
||||
lfound = i;
|
||||
}
|
||||
}else{
|
||||
if(lfound == null && data.oname === list.lowername){
|
||||
lfound = i;
|
||||
data.oname = undefined;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
data.bumps.forEach(function(bump){
|
||||
if(bump != null){
|
||||
bump.listname = data.lowername;
|
||||
}
|
||||
});
|
||||
|
||||
if(lfound != null){
|
||||
CHANNEL.bumpdata.lists[lfound] = data;
|
||||
}else{
|
||||
CHANNEL.bumpdata.lists.push(data);
|
||||
}
|
||||
|
||||
if(CURRENTFPANEL == fpbump){
|
||||
fpbump.reloadPanel();
|
||||
}
|
||||
},
|
||||
|
||||
rmBumplist: function (data){
|
||||
CHANNEL.bumpdata.lists.forEach(function(list, i){
|
||||
if(data === list.lowername){
|
||||
console.log(data);
|
||||
CHANNEL.bumpdata.lists.splice(i, 1);
|
||||
}
|
||||
});
|
||||
|
||||
if(CURRENTFPANEL == fpbump){
|
||||
fpbump.reloadPanel();
|
||||
}
|
||||
},
|
||||
|
||||
sendBumpconf: function (data){
|
||||
CHANNEL.bumpdata.active = data.active;
|
||||
CHANNEL.bumpdata.agro = data.agro;
|
||||
CHANNEL.bumpdata.bsort = data.bsort;
|
||||
CHANNEL.bumpdata.freq = data.freq;
|
||||
CHANNEL.bumpdata.lsort = data.lsort;
|
||||
CHANNEL.bumpdata.minBump = data.minBump;
|
||||
|
||||
if(CURRENTFPANEL == fpbump){
|
||||
fpbump.reloadPanel();
|
||||
}
|
||||
},
|
||||
|
||||
sendBumphist: function (data){
|
||||
CHANNEL.bumpdata.history = data;
|
||||
|
||||
if(CURRENTFPANEL == fpbump){
|
||||
fpbump.reloadPanel();
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
var SOCKET_DEBUG = localStorage.getItem('cytube_socket_debug') === 'true';
|
||||
|
|
|
|||
|
|
@ -61,7 +61,8 @@ var CHANNEL = {
|
|||
motd: "",
|
||||
name: CHANNELNAME,
|
||||
usercount: 0,
|
||||
emotes: []
|
||||
emotes: [],
|
||||
bumpdata: {}
|
||||
};
|
||||
|
||||
var PLAYER = false;
|
||||
|
|
|
|||
397
www/js/fpanel.js
397
www/js/fpanel.js
|
|
@ -276,9 +276,7 @@ fpset.ocall = function(){
|
|||
|
||||
$("<form>").append(
|
||||
$("<label>").prop("for","qs-sync-threshold").html("Sync Threshold(seconds): "),
|
||||
$("<input>").prop("id","qs-sync-threshold").prop("type","text").addClass("qs-form"),
|
||||
$("<button/>").addClass("btn btn-primary btn-ln").text("Save").prop("type","button").prop("id","qs-sync-threshold-save").click(function() {
|
||||
|
||||
$("<input>").prop("id","qs-sync-threshold").prop("type","text").addClass("qs-form").change(function() {
|
||||
USEROPTS.sync_accuracy = parseFloat($("#qs-sync-threshold").val()) || 2;
|
||||
processOpts();
|
||||
}),
|
||||
|
|
@ -349,7 +347,7 @@ fpset.ocall = function(){
|
|||
}),
|
||||
),
|
||||
])
|
||||
fpset.loadSettings();
|
||||
this.loadSettings();
|
||||
}
|
||||
|
||||
fpset.loadSettings = function(){
|
||||
|
|
@ -370,7 +368,6 @@ fpset.loadSettings = function(){
|
|||
$("#qs-timestamp-second").parent().toggle(USEROPTS.show_timestamps);
|
||||
$("#qs-timestamp-second").prop("checked", USEROPTS.show_seconds);
|
||||
$("#qs-toke-pm").prop("checked", USEROPTS.toke_pm);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -599,7 +596,397 @@ fpbump.elm = [//fpmod element array
|
|||
|
||||
fpbump.ocall = function(){
|
||||
modNested.popMenu();
|
||||
|
||||
var ladd = $("<form>").addClass("ab-newlist-form").append(
|
||||
$("<input>").prop("id","ab-newlist-name").prop("type","text").addClass("qs-form").attr("placeholder", "New Bumplist Title").change(function(){$("#ab-newlist-newbtn").click();}),
|
||||
//$("<button/>").addClass("btn btn-primary btn-ln").text("Add List").prop("type","button").click(function(){
|
||||
$("<span>").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-plus-sign pointer").attr("title","Create Bumplist").attr("id","ab-newlist-newbtn").click(function(){
|
||||
var nlname = $("#ab-newlist-name").val()
|
||||
if(nlname != null && nlname !== ""){
|
||||
socket.emit("newBumplist",nlname);
|
||||
$("#ab-newlist-name").val("");
|
||||
$(this).parent().after(laddbtn.clone(true));
|
||||
$(".ab-newlist-form").remove();
|
||||
}
|
||||
|
||||
}),
|
||||
$("<span>").addClass("qsbtn glyphicon glyphicon-ban-circle pointer").attr("title","Cancel").click(function(){
|
||||
$(this).parent().after(laddbtn.clone(true));
|
||||
$(".ab-newlist-form").remove();
|
||||
}),
|
||||
);
|
||||
|
||||
var laddbtn = $("<span>").prop("id","ab-newlist-btn").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-plus-sign pointer").attr("title","Create Bumplist").click(function(){
|
||||
$(this).replaceWith(ladd.clone(true));
|
||||
});
|
||||
|
||||
var alists = [];
|
||||
CHANNEL.bumpdata.active.forEach(function(bname){
|
||||
CHANNEL.bumpdata.lists.forEach(function(list){
|
||||
if(list.lowername === bname)
|
||||
alists.push(list);
|
||||
});
|
||||
});
|
||||
|
||||
$("#fpcontdiv").append(
|
||||
$("<h4>").html("General Config"),
|
||||
$("<form>").append(
|
||||
$("<label>").prop("for","ab-agro").html("Agression Level: "),
|
||||
$("<select>").prop("id","ab-agro").prop("type","text").addClass("qs-form").change(function() {
|
||||
socket.emit("setAgro", parseInt($("#ab-agro").val()));
|
||||
}).append(
|
||||
$("<option>").val(0).html("0"),
|
||||
$("<option>").val(1).html("1"),
|
||||
$("<option>").val(2).html("2"),
|
||||
$("<option>").val(3).html("3")
|
||||
),
|
||||
),
|
||||
$("<form>").append(
|
||||
$("<label>").prop("for","ab-freq-min").html("Bump Frequency: "),
|
||||
$("<input>").prop("id","ab-freq-min").prop("type","text").addClass("qs-form").change(function() {
|
||||
socket.emit("setBumpFreq", {min: parseInt($("#ab-freq-min").val()), max: parseInt($("#ab-freq-max").val())});
|
||||
}),
|
||||
$("<input>").prop("id","ab-freq-max").prop("type","text").addClass("qs-form").change(function() {
|
||||
socket.emit("setBumpFreq", {min: parseInt($("#ab-freq-min").val()), max: parseInt($("#ab-freq-max").val())});
|
||||
}),
|
||||
),
|
||||
$("<form>").append(
|
||||
$("<label>").prop("for","ab-dur-min").html("Duration Minimum (seconds): "),
|
||||
$("<input>").prop("id","ab-dur-min").prop("type","text").addClass("qs-form").change(function() {
|
||||
socket.emit("setMinBump", parseInt($("#ab-dur-min").val()));
|
||||
})
|
||||
),
|
||||
$("<form>").append(
|
||||
$("<label>").prop("for","ab-bsel").html("Bump Selection Method: "),
|
||||
$("<select>").prop("id","ab-bsel").prop("type","text").addClass("qs-form").change(function() {
|
||||
socket.emit("setSelect", {bump: parseInt($("#ab-bsel").val()), list: parseInt($("#ab-lsel").val())});
|
||||
}).append(
|
||||
$("<option>").val(0).html("Last Half Random"),
|
||||
$("<option>").val(1).html("Queue Random"),
|
||||
$("<option>").val(2).html("Round Robin")
|
||||
),
|
||||
),
|
||||
$("<form>").append(
|
||||
$("<label>").prop("for","ab-lsel").html("List Selection Method: "),
|
||||
$("<select>").prop("id","ab-lsel").prop("type","text").addClass("qs-form").change(function() {
|
||||
socket.emit("setSelect", {bump: parseInt($("#ab-bsel").val()), list: parseInt($("#ab-lsel").val())});
|
||||
}).append(
|
||||
$("<option>").val(0).html("Random List"),
|
||||
$("<option>").val(1).html("Smash List"),
|
||||
),
|
||||
),
|
||||
/*$("<form>").append(
|
||||
$("<label>").prop("for","qs-theme").html("Bump Selection: "),
|
||||
$("<select>").prop("id","qs-theme").addClass("qs-form").change(function() {
|
||||
USEROPTS.theme = $("#qs-theme").val();
|
||||
processOpts();
|
||||
}),
|
||||
),*/
|
||||
$("<h4>").html("Bump Lists").addClass("ab-bumplist-lbl"),
|
||||
laddbtn.clone(true),
|
||||
$("<br>"),
|
||||
$("<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;");
|
||||
}else{
|
||||
$(".ab-activebumplists-div").show("blind"),
|
||||
$(this).attr("style", "rotate: 0;");
|
||||
}
|
||||
}),
|
||||
$("<h5>").addClass("ab-activebumplists-lbl ab-bumplists-ltype").html("Active Lists (" + CHANNEL.bumpdata.active.length + ")").click(function(){$("#ab-activebumplists-exp").click()}),
|
||||
$("<div>").addClass("ab-activebumplists-div").append(
|
||||
this.showLists(alists),
|
||||
),
|
||||
$("<br>"),
|
||||
$("<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;");
|
||||
}else{
|
||||
$(".ab-allbumplists-div").show("blind"),
|
||||
$(this).attr("style", "rotate: 0;");
|
||||
}
|
||||
}),
|
||||
$("<h5>").addClass("ab-allbumplists-lbl ab-bumplists-ltype").html("All Lists (" + CHANNEL.bumpdata.lists.length + ")").click(function(){$("#ab-allbumplists-exp").click()}),
|
||||
$("<br>"),
|
||||
$("<div>").addClass("ab-allbumplists-div").append(
|
||||
this.showLists(),
|
||||
),
|
||||
$("<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;");
|
||||
}else{
|
||||
$("#ab-bumphist-div").show("blind"),
|
||||
$(this).attr("style", "rotate: 0;");
|
||||
}
|
||||
}),
|
||||
$("<h5>").html("Bump History (" + this.getHist().length + ")").attr("style", "display: inline").addClass("ab-bumphist-lbl").click(function(){$("#ab-bumphist-exp").click()}),
|
||||
$("<div>").prop("id", "ab-bumphist-div").append(this.showBumps(this.getHist())),
|
||||
);
|
||||
this.loadSettings();
|
||||
}
|
||||
|
||||
fpbump.loadSettings = function(){
|
||||
$("#ab-agro")[0].value = CHANNEL.bumpdata.agro;
|
||||
$("#ab-freq-min").val(CHANNEL.bumpdata.freq[0]);
|
||||
$("#ab-freq-max").val(CHANNEL.bumpdata.freq[1]);
|
||||
$("#ab-dur-min").val(CHANNEL.bumpdata.minBump);
|
||||
if(CHANNEL.bumpdata.bsort === "queueRandom"){
|
||||
$("#ab-bsel")[0].value = 1;
|
||||
}else if(CHANNEL.bumpdata.bsort === "roundRobin"){
|
||||
$("#ab-bsel")[0].value = 2;
|
||||
}else{
|
||||
$("#ab-bsel")[0].value = 0;
|
||||
}
|
||||
$("#ab-lsel")[0].value = CHANNEL.bumpdata.lsort === "smashList" ? 1 : 0;
|
||||
CHANNEL.bumpdata.lists.forEach(function(blist){
|
||||
$("#ab-newbump-list").append($("<option>").val(blist.lowername).html(blist.name));
|
||||
});
|
||||
}
|
||||
|
||||
fpbump.reloadPanel = function(){
|
||||
this.loadSettings();
|
||||
|
||||
var alists = [];
|
||||
CHANNEL.bumpdata.active.forEach(function(bname){
|
||||
CHANNEL.bumpdata.lists.forEach(function(list){
|
||||
if(list.lowername === bname)
|
||||
alists.push(list);
|
||||
});
|
||||
});
|
||||
|
||||
$(".ab-activebumplists-lbl").html("Active Lists (" + CHANNEL.bumpdata.active.length + ")");
|
||||
$(".ab-allbumplists-lbl").html("All Lists (" + CHANNEL.bumpdata.lists.length + ")");
|
||||
$(".ab-bumphist-lbl").html("Bump History (" + this.getHist().length + ")");
|
||||
|
||||
$(".ab-activebumplists-div").html(this.showLists(alists));
|
||||
$(".ab-allbumplists-div").html(this.showLists());
|
||||
$("#ab-bumphist-div").html(this.showBumps(this.getHist()));
|
||||
}
|
||||
|
||||
fpbump.getHist = function(){
|
||||
var fHist = [];
|
||||
CHANNEL.bumpdata.history.forEach(function(bdata){
|
||||
CHANNEL.bumpdata.lists.forEach(function(list){
|
||||
if(list.lowername === bdata[0]){
|
||||
fHist.push(list.bumps[bdata[1]]);
|
||||
}
|
||||
});
|
||||
});
|
||||
return fHist;
|
||||
}
|
||||
|
||||
fpbump.showLists = function(lists){
|
||||
var lDivs = [];
|
||||
var _this = this;
|
||||
if(lists == null){
|
||||
lists = CHANNEL.bumpdata.lists;
|
||||
}
|
||||
|
||||
function badd(list, ob){
|
||||
return [$("<br>"),
|
||||
$("<form>").addClass("ab-newbump-form").append(
|
||||
$("<input>").prop("id","ab-newbump-url").prop("type","text").addClass("qs-form").attr("placeholder","URL"),
|
||||
$("<input>").prop("id","ab-newbump-title").prop("type","text").addClass("qs-form").attr("placeholder","Title"),
|
||||
$("<input>").prop("id","ab-newbump-user").prop("type","text").addClass("qs-form").attr("placeholder","Bump Creator"),
|
||||
$("<br>"),
|
||||
$("<label>").prop("for","ab-newbump-rtoke").html("Toke Bump: "),
|
||||
$("<input>").prop("id","ab-newbump-rtoke").prop("type","checkbox").addClass("qs-form"),
|
||||
$("<label>").prop("for","ab-newbump-noauto").html("Manual Only: "),
|
||||
$("<input>").prop("id","ab-newbump-noauto").prop("type","checkbox").addClass("qs-form"),
|
||||
$("<span>").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-plus-sign pointer").attr("title","Add Bump").attr("id","ab-newlist-newbtn").click(function(){
|
||||
if($("#ab-newbump-url").val() !== ""){
|
||||
var mdata = parseMediaLink($("#ab-newbump-url").val());
|
||||
|
||||
var bumpObj = {
|
||||
id: mdata.id,
|
||||
type: mdata.type,
|
||||
name: $("#ab-newbump-title").val(),
|
||||
user: $("#ab-newbump-user").val(),
|
||||
rtoke: $("#ab-newbump-rtoke").prop("checked"),
|
||||
bumplist: list,
|
||||
noauto: $("#ab-newbump-noauto").prop("checked")
|
||||
}
|
||||
|
||||
socket.emit("newBump", bumpObj);
|
||||
$("#ab-newbump-url").val("");
|
||||
$("#ab-newbump-title").val("");
|
||||
$("#ab-newbump-user").val("");
|
||||
$("#ab-newbump-cancel").click();
|
||||
}
|
||||
}),
|
||||
).clone(true),
|
||||
$("<span>").prop("id","ab-newbump-cancel").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-ban-circle pointer").click(function(){
|
||||
$(this).prev().prev().remove();//gotta take out that br...
|
||||
$(this).prev().remove();
|
||||
$(this).replaceWith(ob);
|
||||
})];
|
||||
}
|
||||
|
||||
lists.forEach(function(list){
|
||||
var blist = $("<div>").addClass("ab-bumplist-bumps").append(_this.showBumps(list.bumps, true));
|
||||
var active = false;
|
||||
CHANNEL.bumpdata.active.forEach(function(lname){
|
||||
if(!active)
|
||||
active = list.lowername === lname;
|
||||
});
|
||||
lDivs.push(
|
||||
$("<div>").addClass("ab-bumplist-list").attr("id", "ab-bumplist-" + list.lowername).append(
|
||||
$("<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","rotate: 270deg").click(function(){
|
||||
if(blist.is(":visible")){
|
||||
blist.hide("blind"),
|
||||
$(this).attr("style", "rotate: 270deg;");
|
||||
}else{
|
||||
blist.show("blind"),
|
||||
$(this).attr("style", "rotate: 0;");
|
||||
}
|
||||
}),
|
||||
$("<h6>").html(list.name + " (" + list.bumps.length + ")").addClass("ab-bumplist-listname").click(function(){$(this).prev().click()}),
|
||||
$("<span>").prop("id","ab-bumplist-rename").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-pencil pointer").click(function(){
|
||||
var link = $(this).prev().clone(true);
|
||||
var ebtn = $(this).clone(true);
|
||||
|
||||
$(this).prev().replaceWith($("<form>").append(
|
||||
$("<input>").prop("type","text").attr("id", "ab-bumparray-reuserf").addClass("qs-form").attr("placeholder", list.name).keydown(function(ev) {
|
||||
// Enter/return
|
||||
if(ev.keyCode == 13) {
|
||||
socket.emit("renameBumplist", {oldname: list.lowername, newname: this.value});
|
||||
$(this).parent().next().replaceWith(ebtn);
|
||||
$(this).parent().replaceWith(link);
|
||||
}
|
||||
|
||||
})
|
||||
).attr("style", "display: inline"));
|
||||
|
||||
$(this).replaceWith(
|
||||
$("<span>").prop("id","ab-bumparray-reuser").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-ban-circle pointer").click(function(){
|
||||
$(this).prev().replaceWith(link);
|
||||
$(this).replaceWith(ebtn);
|
||||
})
|
||||
);
|
||||
}),
|
||||
$("<span>").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-plus-sign pointer").attr("title","Add Bump").attr("id","ab-newlist-newbtn").click(function(){
|
||||
var abtn = $(this).clone(true);
|
||||
$(this).replaceWith(badd(list.lowername, abtn));
|
||||
}),
|
||||
$("<span>").addClass("ab-bumplist-delete qsbtn glyphicon pointer glyphicon-trash").attr("title","Delete List").click(function(){
|
||||
if(window.confirm("Fuck me, you sure you wanna do that? You're about to nuke " + list.name + " off the face of the planet.")){
|
||||
socket.emit("delBumplist",list.lowername);
|
||||
}
|
||||
}),
|
||||
blist.hide(),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
return lDivs;
|
||||
}
|
||||
|
||||
fpbump.showBumps = function(bumps, controls){
|
||||
var bDivs = [];
|
||||
var bSpan = []
|
||||
bumps.forEach(function(bump){
|
||||
if(bump != null){
|
||||
var bCreator = $("<span>").append(
|
||||
$("<p>Creator: " + (bump.user == null ? "N/A" : bump.user) + "</p>").addClass("ab-bumparray-creator"),
|
||||
(controls ? $("<span>").prop("id","ab-bumparray-reuser").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-pencil pointer").click(function(){
|
||||
var link = $(this).prev().clone(true);
|
||||
var ebtn = $(this).clone(true);
|
||||
|
||||
$(this).prev().replaceWith($("<form>").append(
|
||||
$("<label>").prop("for", "ab-bumparray-reuserf").attr("id", "ab-bumparray-reuserfl").html("Creator: "),//alphanum sort label
|
||||
$("<input>").prop("type","text").attr("id", "ab-bumparray-reuserf").addClass("qs-form").attr("placeholder", (bump.user == null ? "N/A" : bump.user)).keydown(function(ev) {
|
||||
// Enter/return
|
||||
if(ev.keyCode == 13) {
|
||||
socket.emit("changeCreator", {bl: bump.listname, id: bump.id, name: this.value});
|
||||
$(this).parent().next().replaceWith(ebtn);
|
||||
$(this).parent().replaceWith(link);
|
||||
}
|
||||
|
||||
})
|
||||
).attr("style", "display: inline"));
|
||||
|
||||
$(this).replaceWith(
|
||||
$("<span>").prop("id","ab-bumparray-reuser").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-ban-circle pointer").click(function(){
|
||||
$(this).prev().replaceWith(link);
|
||||
$(this).replaceWith(ebtn);
|
||||
})
|
||||
);
|
||||
}):undefined),
|
||||
);
|
||||
|
||||
var bSpan = $("<span>").addClass("ab-bumparray-span").append(
|
||||
$("<span>").append(
|
||||
$('<a href="' + formatURL(bump.media) + '">' + bump.name + "</a>"),
|
||||
(controls ? $("<span>").prop("id","ab-bumparray-rename").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-pencil pointer").click(function(){
|
||||
var link = $(this).prev().clone(true);
|
||||
var ebtn = $(this).clone(true);
|
||||
|
||||
$(this).prev().replaceWith($("<form>").append(
|
||||
$("<input>").prop("type","text").addClass("qs-form").attr("placeholder", bump.name).keydown(function(ev) {
|
||||
// Enter/return
|
||||
if(ev.keyCode == 13) {
|
||||
socket.emit("renameBump", {bl: bump.listname, id: bump.id, name: this.value});
|
||||
$(this).parent().next().replaceWith(ebtn);
|
||||
$(this).parent().replaceWith(link);
|
||||
}
|
||||
|
||||
})
|
||||
).attr("style", "display: inline"));
|
||||
|
||||
$(this).replaceWith(
|
||||
$("<span>").prop("id","ab-bumparray-rename").addClass("ab-bumparray-edit qsbtn glyphicon glyphicon-ban-circle pointer").click(function(){
|
||||
$(this).prev().replaceWith(link);
|
||||
$(this).replaceWith(ebtn);
|
||||
})
|
||||
);
|
||||
}):undefined),
|
||||
),
|
||||
$("<p>" + bump.media.title + "</p>"),
|
||||
|
||||
(controls ? [
|
||||
$('<p>Manual Only: <a class="pointer">' + (bump.noauto ? "Y" : "N") + "</a></p>").click(function(){socket.emit("toggleNoauto", {bl: bump.listname, id: bump.id})}),
|
||||
$('<p>Toke Bump: <a class="pointer">' + (bump.rtoke ? "Y" : "N") + "</a></p>").click(function(){socket.emit("toggleRtoke", {bl: bump.listname, id: bump.id})}),
|
||||
] : [
|
||||
$("<p>Manual Only: " + (bump.noauto ? "Y" : "N") + "</p>"),
|
||||
$("<p>Toke Bump: " + (bump.rtoke ? "Y" : "N") + "</p>"),
|
||||
]),
|
||||
|
||||
$("<p>Dur: " + bump.media.duration + "</p>"),
|
||||
);
|
||||
|
||||
|
||||
var bDiv = $("<div>").addClass("ab-bumparray-bump").attr("id", "ab-bumparray-" + bump.listname + "-" + bump.id).append(bSpan);
|
||||
|
||||
if(controls){
|
||||
bDiv.append(
|
||||
$("<span>").append(
|
||||
$("<button/>").addClass("btn btn-xs btn-default abbtn-next").html("<span class='glyphicon glyphicon-share-alt'></span>Queue Next").click(function() {
|
||||
socket.emit("queueBump",{bl: bump.listname, id: bump.id});
|
||||
}),
|
||||
$("<button/>").addClass("btn btn-xs btn-default abbtn-next").html("<span class='glyphicon glyphicon-trash'></span>Delete").click(function() {
|
||||
socket.emit("deleteBump",{bl: bump.listname, id: bump.id});
|
||||
})
|
||||
),
|
||||
$("<span>").addClass("ab-bumparray-cspan").append(
|
||||
bCreator,
|
||||
)
|
||||
);
|
||||
}else{
|
||||
bDiv.append(bCreator);
|
||||
}
|
||||
|
||||
bDivs.push(bDiv);
|
||||
}
|
||||
});
|
||||
return bDivs;
|
||||
}
|
||||
|
||||
//---Tokebot---
|
||||
var fptoke = new fpmenu("Tokebot");//create new panel fpmod
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue