Compare commits
No commits in common. "17e256e038024792b668ac747b77b90a4f43da7b" and "8e7121bab5718a6b28cce467a4612f62e85324a0" have entirely different histories.
17e256e038
...
8e7121bab5
2 changed files with 3 additions and 50 deletions
|
|
@ -275,7 +275,7 @@ span.user-entry{
|
||||||
|
|
||||||
#cpanel-active-div{
|
#cpanel-active-div{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 5;
|
z-index: 4;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ class queuePanel extends panelObj{
|
||||||
//Seems like before we didnt get the message (see 50b1e15a6c -> 05408bbec4)
|
//Seems like before we didnt get the message (see 50b1e15a6c -> 05408bbec4)
|
||||||
//so just to reiterate: DON'T FUCKING REMOVE THE ARROW FUNCTIONS BELOW, NO MATTER HOW FUGLY YOU FUCKING THINK THEY ARE
|
//so just to reiterate: DON'T FUCKING REMOVE THE ARROW FUNCTIONS BELOW, NO MATTER HOW FUGLY YOU FUCKING THINK THEY ARE
|
||||||
this.client.queueBroadcastSocket.on("queue", ()=>{this.renderQueue()}); //YEAH ASSHOLE I MEAN THIS ONE
|
this.client.queueBroadcastSocket.on("queue", ()=>{this.renderQueue()}); //YEAH ASSHOLE I MEAN THIS ONE
|
||||||
this.client.socket.on("archive", ()=>{this.renderQueue()}); //THIS ONE TOO, FOR FUCK SAKES YOU BAKED CUNT
|
this.client.socket.on("archive", ()=>{this.renderQueue.bind(this)}); //THIS ONE TOO, FOR FUCK SAKES YOU BAKED CUNT
|
||||||
this.client.socket.on("start", this.handleStart.bind(this));
|
this.client.socket.on("start", this.handleStart.bind(this));
|
||||||
this.client.socket.on("end", this.handleEnd.bind(this));
|
this.client.socket.on("end", this.handleEnd.bind(this));
|
||||||
this.client.socket.on("lock", this.handleScheduleLock.bind(this));
|
this.client.socket.on("lock", this.handleScheduleLock.bind(this));
|
||||||
|
|
@ -331,9 +331,6 @@ class queuePanel extends panelObj{
|
||||||
}
|
}
|
||||||
|
|
||||||
handleArchiveResults(data){
|
handleArchiveResults(data){
|
||||||
//Hand over the data to the client to sort into the queue (why waste a good pile of archived items?)
|
|
||||||
//client.sortQueue(data.archive);
|
|
||||||
|
|
||||||
//Reverse archive order to show newest first, and render as an array of raw entries
|
//Reverse archive order to show newest first, and render as an array of raw entries
|
||||||
this.renderResults(data.archive.reverse(), true);
|
this.renderResults(data.archive.reverse(), true);
|
||||||
}
|
}
|
||||||
|
|
@ -386,22 +383,6 @@ class queuePanel extends panelObj{
|
||||||
queueEntry.classList.add('bi-play-circle')
|
queueEntry.classList.add('bi-play-circle')
|
||||||
controlDiv.appendChild(queueEntry);
|
controlDiv.appendChild(queueEntry);
|
||||||
|
|
||||||
//Handle button event listeners
|
|
||||||
goToEntry.addEventListener('click', ()=>{this.goToEntry(entry)});
|
|
||||||
|
|
||||||
//If this is a live-stream
|
|
||||||
if(entry.type == "livehls" || entry.type == "webrtc"){
|
|
||||||
//Toggle live stream menu open
|
|
||||||
queueEntry.addEventListener('click', (event)=>{if(!this.goLiveDiv.checkVisibility()){this.toggleGoLive(event)}})
|
|
||||||
//Otherwise
|
|
||||||
}else{
|
|
||||||
//Add event listener for play button
|
|
||||||
queueEntry.addEventListener('click', (event)=>{
|
|
||||||
//When clicked, re-queue the selected item at the end of the current schedule
|
|
||||||
this.client.socket.emit("queue",{url:entry.url, title:entry.title});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//Append control div to entry div
|
//Append control div to entry div
|
||||||
entryDiv.appendChild(controlDiv);
|
entryDiv.appendChild(controlDiv);
|
||||||
|
|
||||||
|
|
@ -1273,7 +1254,7 @@ class queuePanel extends panelObj{
|
||||||
//Get height difference between window and queue layout controller
|
//Get height difference between window and queue layout controller
|
||||||
const docDifference = this.ownerDoc.defaultView.innerHeight - this.queueLayoutController.getBoundingClientRect().height;
|
const docDifference = this.ownerDoc.defaultView.innerHeight - this.queueLayoutController.getBoundingClientRect().height;
|
||||||
//Calculate scroll target by body difference and marker position
|
//Calculate scroll target by body difference and marker position
|
||||||
const scrollTarget = (markerPosition - (this.queueLayoutController.getBoundingClientRect().height - docDifference) / 2);
|
const scrollTarget = (markerPosition - (this.queueLayoutController.getBoundingClientRect().height - docDifference) / 2) + docDifference;
|
||||||
//Calculate scroll behavior by distance
|
//Calculate scroll behavior by distance
|
||||||
const scrollBehavior = Math.abs(scrollTarget - this.queueLayoutController.scrollTop) > 10 ? "smooth" : "instant";
|
const scrollBehavior = Math.abs(scrollTarget - this.queueLayoutController.scrollTop) > 10 ? "smooth" : "instant";
|
||||||
|
|
||||||
|
|
@ -1546,34 +1527,6 @@ class queuePanel extends panelObj{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
goToEntry(entry){
|
|
||||||
//Calculate the time it would've been smack in the middle of the entry
|
|
||||||
const middle = new Date(entry.startTime + ((entry.duration * 1000) / 2));
|
|
||||||
|
|
||||||
//If we're moving to another day
|
|
||||||
if(!utils.isSameDate(this.day, middle)){
|
|
||||||
//If the date controls are hidden
|
|
||||||
if(!this.queueDateDiv.checkVisibility()){
|
|
||||||
//Make em' visible
|
|
||||||
this.toggleDateControl();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Move scheduler to correct day, using a clone of the date object to avoid fucking with it
|
|
||||||
this.setDay(new Date(middle.getTime()));
|
|
||||||
}
|
|
||||||
|
|
||||||
//This was shamelessy stolen from our autoscroll functionality, I should probably make it its own function lmao
|
|
||||||
const docDifference = this.ownerDoc.defaultView.innerHeight - this.queueLayoutController.getBoundingClientRect().height;
|
|
||||||
const scrollTarget = (this.offsetByDate(middle) - (this.queueLayoutController.getBoundingClientRect().height - docDifference) / 2);
|
|
||||||
|
|
||||||
//Scroll to the selected item
|
|
||||||
this.queueLayoutController.scroll({
|
|
||||||
left: 0,
|
|
||||||
top: scrollTarget,
|
|
||||||
behavior: 'smooth'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate schedule offset from top or bottom of div from date
|
* Calculate schedule offset from top or bottom of div from date
|
||||||
* @param {Date} date - Date to calculate from, defaults to now
|
* @param {Date} date - Date to calculate from, defaults to now
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue