not happening

change name - wompchat
overlay attempt was made. turns out cant link obs to chrome extension web page. added greenscreen option instead. best i can do until chat bot is made. need a web page hosted that can be manipulated and can be linked into obs.
some other unrelated fixes - minor bugs
added escape key for popup
expanded pupup window to full width of chat
This commit is contained in:
wompmacho
2020-11-13 05:16:24 -05:00
parent fb13e2f056
commit 1826dce523
15 changed files with 59648 additions and 14509 deletions

View File

@@ -29,7 +29,7 @@ class ChatScroller {
}
scroll() {
this.scroller.scrollTop = 9999;
this.scroller.scrollIntoView({block: 'end'});
}
getScroller() {

View File

@@ -41,6 +41,10 @@ class ChatWatcher {
const node = messages[i];
if(this.isMessageNode(node)) {
const message = new Message(node);
// chrome.runtime.sendMessage({message: "preloadMessages", node: node.outerHTML}, function(response) {
// // dont need to do anything
// });
}
}
}
@@ -59,6 +63,11 @@ class ChatWatcher {
const node = addedNodes[i];
if(this.isMessageNode(node)) {
this.onNewMessage(node);
// send message
// chrome.runtime.sendMessage({message: "newMessage", node: node.outerHTML}, function(response) {
// // dont need to do anything
// });
}
}
}
@@ -190,6 +199,14 @@ class ChatWatcher {
console.log('emote popup button clicked');
});
// escape for popup div
document.onkeydown = function(evt) {
if (evt.key === "Escape" && !popUpDiv.classList.contains('hideElement')) {
popUpDiv.classList.toggle('hideElement');
return;
}
};
// get input area
var inputArea = document.querySelector('#input.yt-live-chat-text-input-field-renderer');
var inputAreaLabel = document.querySelector('#label.yt-live-chat-text-input-field-renderer');
@@ -211,6 +228,7 @@ class ChatWatcher {
}
console.log((keysITer.length+1) + " Emotes Added");
}// end addEmotePopup
///////////////////////////////////////////////////////////////////

View File

@@ -105,6 +105,10 @@ class Emotes {
url = urls[1];
}
// fix for overlay, remove "//" at start of url
var protocol = "https:";
url = protocol.concat(url);
this.dictionary.set(name, new Emote({ code: name, url }));
this.franker_Dictionary.set(name, new Emote({ code: name, url }));
}

View File

@@ -1,9 +1,6 @@
import Emotes from './Emotes';
import PersistentSyncStorage from 'src/helpers/PersistentSyncStorage';
let chat_overlay_enabled = false;
class Message {
constructor(messageNode) {
this.node = messageNode;
@@ -20,10 +17,6 @@ class Message {
this.setHtml();
this.watch();
}
chrome.runtime.sendMessage({message: "messageNode", node: messageNode.outerHTML}, function(response) {
// dont need to do anything
});
}
get textNode() {

View File

@@ -74,6 +74,14 @@ class Main {
}
///////////////////////////////////////////////////////////////////
//Live Chat Default Option
if (PersistentSyncStorage.data.options.setGreenScreen) {
var chat = document.querySelector('yt-live-chat-item-list-renderer');
chat.classList.add('green_sceen');
} else {
// do nothing, let user pick option if not set as default in options menu
}
}
init() {