Compare commits
4 commits
3ec770ba28
...
8e7121bab5
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e7121bab5 | |||
| 05408bbec4 | |||
| 1521fc83ee | |||
| 0f735c08ed |
3 changed files with 50 additions and 14 deletions
|
|
@ -145,6 +145,12 @@ div.dragging-queue-entry{
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search Results */
|
/* Search Results */
|
||||||
|
#queue-search-prompts-result-div:not(:empty){
|
||||||
|
resize: vertical;
|
||||||
|
overflow: scroll;
|
||||||
|
height: 5em;
|
||||||
|
}
|
||||||
|
|
||||||
.queue-search-prompts-result-entry-div{
|
.queue-search-prompts-result-entry-div{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
@ -152,7 +158,7 @@ div.dragging-queue-entry{
|
||||||
text-wrap: nowrap;
|
text-wrap: nowrap;
|
||||||
margin: 0 0.15em;
|
margin: 0 0.15em;
|
||||||
padding: 0 0.15em;
|
padding: 0 0.15em;
|
||||||
font-size: 0.8em
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.queue-search-prompts-result-entry-div p{
|
.queue-search-prompts-result-entry-div p{
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,7 @@ class chatBox{
|
||||||
* @param {Event} event - Event passed down from Event Handler
|
* @param {Event} event - Event passed down from Event Handler
|
||||||
*/
|
*/
|
||||||
send(event){
|
send(event){
|
||||||
|
//If we don't have an event, or if we do it isn't a keeb event, or if it is we hit enter
|
||||||
if((!event || !event.key || event.key == "Enter") && this.chatPrompt.value){
|
if((!event || !event.key || event.key == "Enter") && this.chatPrompt.value){
|
||||||
//Transmit the chat
|
//Transmit the chat
|
||||||
this.transmit(this.chatPrompt.value);
|
this.transmit(this.chatPrompt.value);
|
||||||
|
|
|
||||||
|
|
@ -148,12 +148,15 @@ class queuePanel extends panelObj{
|
||||||
defineListeners(){
|
defineListeners(){
|
||||||
//Render queue when we receive a new copy of the queue data from the server
|
//Render queue when we receive a new copy of the queue data from the server
|
||||||
//Render queue should be called within an arrow function so that it's called with default parameters, and not handed an event as a date
|
//Render queue should be called within an arrow function so that it's called with default parameters, and not handed an event as a date
|
||||||
this.client.queueBroadcastSocket.on("queue", this.renderQueue.bind(this));
|
//Seems like before we didnt get the message (see 50b1e15a6c -> 05408bbec4)
|
||||||
this.client.socket.on("archive", this.renderQueue.bind(this));
|
//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.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));
|
||||||
this.client.socket.on("error", this.handleQueueError.bind(this));
|
this.client.socket.on("error", this.handleQueueError.bind(this));
|
||||||
|
this.client.socket.on("archiveSearch", this.handleArchiveResults.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -183,6 +186,9 @@ class queuePanel extends panelObj{
|
||||||
//Go Live
|
//Go Live
|
||||||
this.goLiveOverwriteButton.addEventListener('click', this.goLive.bind(this));
|
this.goLiveOverwriteButton.addEventListener('click', this.goLive.bind(this));
|
||||||
this.goLivePushbackButton.addEventListener('click', this.goLive.bind(this));
|
this.goLivePushbackButton.addEventListener('click', this.goLive.bind(this));
|
||||||
|
//search
|
||||||
|
this.searchButton.addEventListener('click', this.search.bind(this));
|
||||||
|
this.searchPrompt.addEventListener("keydown", this.search.bind(this));
|
||||||
//Queue Date
|
//Queue Date
|
||||||
this.queueDateDecrement.addEventListener('click', this.decrementDate.bind(this));
|
this.queueDateDecrement.addEventListener('click', this.decrementDate.bind(this));
|
||||||
this.queueDateIncrement.addEventListener('click', this.incrementDate.bind(this));
|
this.queueDateIncrement.addEventListener('click', this.incrementDate.bind(this));
|
||||||
|
|
@ -304,26 +310,49 @@ class queuePanel extends panelObj{
|
||||||
//Grab query
|
//Grab query
|
||||||
const query = this.searchPrompt.value;
|
const query = this.searchPrompt.value;
|
||||||
|
|
||||||
|
//If we don't have an event, or if we do it isn't a keeb event, or if it is we hit enter and we got a query
|
||||||
|
if((!event || !event.key || event.key == "Enter") && query){
|
||||||
|
//Clear out search result div
|
||||||
|
this.searchResultDiv.innerHTML = '';
|
||||||
|
|
||||||
//If we're searching by URL
|
//If we're searching by URL
|
||||||
if(utils.isURL(query)){
|
if(utils.isURL(query)){
|
||||||
//Render local items matching provided URL
|
//Render local items matching provided URL
|
||||||
this.renderResults(client.searchQueue(undefined, query));
|
this.renderResults(client.searchQueue(undefined, query));
|
||||||
|
//Ask server to search archive by URL
|
||||||
|
client.socket.emit("getArchive", {url: query, search: true});
|
||||||
}else{
|
}else{
|
||||||
//Render local items matching title
|
//Render local items matching title
|
||||||
this.renderResults(client.searchQueue(query));
|
this.renderResults(client.searchQueue(query));
|
||||||
|
//Ask server to search archive by title
|
||||||
|
client.socket.emit("getArchive", {title: query, search: true});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderResults(results){
|
handleArchiveResults(data){
|
||||||
|
//Reverse archive order to show newest first, and render as an array of raw entries
|
||||||
|
this.renderResults(data.archive.reverse(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderResults(results, rawEntry = false){
|
||||||
//Keep track of whether or not we're on the first entry
|
//Keep track of whether or not we're on the first entry
|
||||||
let notFirst = false;
|
let notFirst = this.searchResultDiv.hasChildNodes();
|
||||||
|
|
||||||
|
for(let entry of results){
|
||||||
|
//If we where handed an entry raw from a map
|
||||||
|
if(rawEntry){
|
||||||
|
//Yoink the actual media object
|
||||||
|
entry = entry[1];
|
||||||
|
}
|
||||||
|
|
||||||
for(const entry of results){
|
|
||||||
//Create entry div
|
//Create entry div
|
||||||
const entryDiv = document.createElement('div');
|
const entryDiv = document.createElement('div');
|
||||||
entryDiv.classList.add('queue-search-prompts-result-entry-div');
|
entryDiv.classList.add('queue-search-prompts-result-entry-div');
|
||||||
|
|
||||||
|
//if this shit aint da first one
|
||||||
if(notFirst){
|
if(notFirst){
|
||||||
|
//MAKE IT SO, PILOT -ronin from tf|2 or something
|
||||||
entryDiv.classList.add('not-first');
|
entryDiv.classList.add('not-first');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue