moving welcome banner change to index

remove extra lines
moved welcome banner to index
moved set defaults inside main of index
This commit is contained in:
wompmacho
2020-11-01 23:35:22 -05:00
parent 5661778850
commit cf52afc0ba
3 changed files with 21 additions and 37 deletions

View File

@@ -6,8 +6,6 @@ import PersistentSyncStorage from 'src/helpers/PersistentSyncStorage';
class ChatWatcher {
constructor() {
this.watchChat = this.watchChat.bind(this);
this._chatContainer = null;
@@ -26,7 +24,6 @@ class ChatWatcher {
});
}
getChatContainer() {
// Parent of actual chat (children are messages)
const checkForContainer = (res, rej) => {

View File

@@ -102,16 +102,6 @@ class Message {
///////////////////////////////////////////////////////////////////
// Welcome Banner
var welcomBanner = document.querySelector("yt-live-chat-viewer-engagement-message-renderer");
// Set Hide Welcome Banner
if (PersistentSyncStorage.data.options.hideWelcomBanner) {
welcomBanner.classList.add("hideElement");
}
///////////////////////////////////////////////////////////////////
// Checks for kappa and replaces emoji element with kappa
if(PersistentSyncStorage.data.options.kappaFix) {
@@ -168,7 +158,6 @@ class Message {
inputAreaLabel.innerText = "";
});
///////////////////////////////////////////////////////////////////
// Set Font Size
@@ -245,6 +234,4 @@ class Message {
}// end Message
export default Message;

View File

@@ -3,7 +3,6 @@ import ChatScroller from "./ChatScroller";
import ChatWatcher from "./ChatWatcher";
import RouteWatcher from "./RouteWatcher";
import {
isLivestream, isYoutubeGaming,
isYoutubeEmbed, isYoutubeVanilla,
@@ -34,7 +33,6 @@ class Main {
// chatframe id - chatframe
// movieframe id - movie_player_fix
// dono ticker id - ticker
// player-theater-container
}
@@ -58,22 +56,17 @@ class Main {
}
}// end onRouteChange
init() {
setDefaults() {
this.chatWatcher = new ChatWatcher();
this.chatWatcher.init();
this.chatScroller = new ChatScroller();
this.chatScroller.init();
///////////////////////////////////////////////////////////////////
setDefaults();
console.log("INIT");
// Welcome Banner
var welcomBanner = document.querySelector("yt-live-chat-viewer-engagement-message-renderer");
}// end init
}// end main
function setDefaults() {
// Set Hide Welcome Banner
if (PersistentSyncStorage.data.options.hideWelcomBanner) {
welcomBanner.classList.add("hideElement");
}
///////////////////////////////////////////////////////////////////
@@ -85,15 +78,26 @@ class Main {
}
///////////////////////////////////////////////////////////////////
}
init() {
this.chatWatcher = new ChatWatcher();
this.chatWatcher.init();
this.chatScroller = new ChatScroller();
this.chatScroller.init();
this.setDefaults();
console.log("INIT");
}// end init
}// end main
// --- Every Frame Loaded
PersistentSyncStorage.on("ready", () => {
MAIN = new Main();
});
function checkMode(){
if(alreadyTheater){
@@ -120,7 +124,6 @@ function enterTheaterMode() {
const masthead_container = document.getElementById('masthead-container');
masthead_container.hidden = true;
theater_wrapper.classList.add('theater_wrapper_fix');
@@ -128,7 +131,6 @@ function enterTheaterMode() {
chat_frame.classList.add('chat_frame_fix');
info_frame.classList.add('info_contents_fix');
theater_wrapper.append(info_frame);
theater_wrapper.append(movie_player);
theater_wrapper.append(chat_frame);
@@ -152,7 +154,6 @@ function exitTheaterMode(){
const masthead_container = document.getElementById('masthead-container');
masthead_container.hidden = false;
theater_wrapper.classList.remove('theater_wrapper_fix');
@@ -174,7 +175,6 @@ function theaterMode(){
if(theaterButton){
if(document.getElementById('player-theater-container').contains(document.getElementById('player-container'))){
// for when page loads first time - check is reversed after this