Compare commits
5 commits
315c5340f3
...
5fb2609d62
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fb2609d62 | |||
| 3acf817f8b | |||
| 53f23a5ab4 | |||
| af6332890d | |||
| 86acfa5b7c |
6 changed files with 40 additions and 19 deletions
|
|
@ -111,6 +111,10 @@ div.interactive:active{
|
||||||
background-color: var(--bg1);
|
background-color: var(--bg1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:not(button) > i{
|
||||||
|
color: var(--accent0-alt1);
|
||||||
|
}
|
||||||
|
|
||||||
button i{
|
button i{
|
||||||
margin: 0.05em;
|
margin: 0.05em;
|
||||||
text-wrap: nowrap;
|
text-wrap: nowrap;
|
||||||
|
|
@ -123,6 +127,8 @@ select{
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
button{
|
button{
|
||||||
background-color: var(--bg0);
|
background-color: var(--bg0);
|
||||||
color: var(--accent0);
|
color: var(--accent0);
|
||||||
|
|
@ -153,6 +159,8 @@ input:checked{
|
||||||
}
|
}
|
||||||
|
|
||||||
input:not([type='checkbox']):not(.navbar-item), textarea {
|
input:not([type='checkbox']):not(.navbar-item), textarea {
|
||||||
|
background-color: var(--bg2);
|
||||||
|
color: var(--accent0);
|
||||||
border-radius: 1em;
|
border-radius: 1em;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0.1em 0.5em;
|
padding: 0.1em 0.5em;
|
||||||
|
|
|
||||||
|
|
@ -251,7 +251,6 @@ class channel{
|
||||||
|
|
||||||
//If we're playing a video from Internet Archive
|
//If we're playing a video from Internet Archive
|
||||||
if(nowPlaying != null && nowPlaying.type == 'ia'){
|
if(nowPlaying != null && nowPlaying.type == 'ia'){
|
||||||
console.log("RELOAD");
|
|
||||||
//Hard reload the media, forcing media handler re-creation
|
//Hard reload the media, forcing media handler re-creation
|
||||||
this.player.hardReload();
|
this.player.hardReload();
|
||||||
}
|
}
|
||||||
|
|
@ -319,9 +318,6 @@ class channel{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(value);
|
|
||||||
console.log((value == true || value == "true") ? "none" : "unset");
|
|
||||||
|
|
||||||
//Convert string to bool and use it to set visibility of send button
|
//Convert string to bool and use it to set visibility of send button
|
||||||
this.chatBox.sendButton.style.display = (value == true || value == "true") ? "none" : "unset";
|
this.chatBox.sendButton.style.display = (value == true || value == "true") ? "none" : "unset";
|
||||||
return;
|
return;
|
||||||
|
|
@ -361,7 +357,7 @@ class channel{
|
||||||
["chatWidthMin", 20],
|
["chatWidthMin", 20],
|
||||||
["disablePortrait", false],
|
["disablePortrait", false],
|
||||||
["disableSendButton", false],
|
["disableSendButton", false],
|
||||||
["userlistHidden", false],
|
["userlistHidden", true],
|
||||||
["cinemaMode", false],
|
["cinemaMode", false],
|
||||||
["rxPMSound", 'unread'],
|
["rxPMSound", 'unread'],
|
||||||
["txPMSound", false],
|
["txPMSound", false],
|
||||||
|
|
|
||||||
|
|
@ -406,6 +406,9 @@ class poppedPanel{
|
||||||
* Fills container window with Popped Panel container elements
|
* Fills container window with Popped Panel container elements
|
||||||
*/
|
*/
|
||||||
fillContainer(){
|
fillContainer(){
|
||||||
|
//Apply theme
|
||||||
|
this.window.document.head.appendChild(ThemeManager.genThemeLink());
|
||||||
|
|
||||||
//Set Element Nodes
|
//Set Element Nodes
|
||||||
this.panelDiv = this.window.document.querySelector("#cpanel-div");
|
this.panelDiv = this.window.document.querySelector("#cpanel-div");
|
||||||
this.panelTitle = this.window.document.querySelector("#cpanel-title");
|
this.panelTitle = this.window.document.querySelector("#cpanel-title");
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,16 @@ class settingsPanel extends panelObj{
|
||||||
}
|
}
|
||||||
|
|
||||||
fillThemes(){
|
fillThemes(){
|
||||||
|
//Find theme selector
|
||||||
|
const selector = this.theme.querySelector('select');
|
||||||
|
|
||||||
|
//If the theme selector has already been filled or doesnt exist
|
||||||
|
if(selector == null || selector.childElementCount > 0){
|
||||||
|
//Stop while we're ahead
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//For each theme
|
||||||
for(let themeName of ThemeManager.themes.keys()){
|
for(let themeName of ThemeManager.themes.keys()){
|
||||||
//Create theme option
|
//Create theme option
|
||||||
let option = document.createElement('option');
|
let option = document.createElement('option');
|
||||||
|
|
@ -120,7 +130,7 @@ class settingsPanel extends panelObj{
|
||||||
option.innerText = themeName;
|
option.innerText = themeName;
|
||||||
|
|
||||||
//Add option to theme selector
|
//Add option to theme selector
|
||||||
this.theme.querySelector('select').appendChild(option);
|
selector.appendChild(option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -155,6 +165,7 @@ class settingsPanel extends panelObj{
|
||||||
this.theme.querySelector('select').value = localStorage.getItem("theme");
|
this.theme.querySelector('select').value = localStorage.getItem("theme");
|
||||||
this.chatWidthMinimum.value = localStorage.getItem("chatWidthMin");
|
this.chatWidthMinimum.value = localStorage.getItem("chatWidthMin");
|
||||||
this.disablePortrait.checked = localStorage.getItem("disablePortrait") == 'true';
|
this.disablePortrait.checked = localStorage.getItem("disablePortrait") == 'true';
|
||||||
|
this.disableSendButton.checked = localStorage.getItem("disableSendButton") == 'true';
|
||||||
this.rxPMSound.value = localStorage.getItem('rxPMSound');
|
this.rxPMSound.value = localStorage.getItem('rxPMSound');
|
||||||
this.txPMSound.checked = localStorage.getItem('txPMSound') == 'true';
|
this.txPMSound.checked = localStorage.getItem('txPMSound') == 'true';
|
||||||
this.newSeshSound.checked = localStorage.getItem('newSeshSound') == 'true';
|
this.newSeshSound.checked = localStorage.getItem('newSeshSound') == 'true';
|
||||||
|
|
@ -279,8 +290,6 @@ class settingsPanel extends panelObj{
|
||||||
* Handles change toggle of disable/enable send buttton
|
* Handles change toggle of disable/enable send buttton
|
||||||
*/
|
*/
|
||||||
updateDisableSendButton(){
|
updateDisableSendButton(){
|
||||||
console.log(this.disableSendButton);
|
|
||||||
console.log(this.disableSendButton.checked);
|
|
||||||
localStorage.setItem('disableSendButton', this.disableSendButton.checked);
|
localStorage.setItem('disableSendButton', this.disableSendButton.checked);
|
||||||
client.processConfig("disableSendButton", this.disableSendButton.checked);
|
client.processConfig("disableSendButton", this.disableSendButton.checked);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,6 @@ class migratePrompt{
|
||||||
//Add verification event listener to altcha widget
|
//Add verification event listener to altcha widget
|
||||||
this.altcha.addEventListener("verified", this.verify.bind(this));
|
this.altcha.addEventListener("verified", this.verify.bind(this));
|
||||||
|
|
||||||
console.log(this.button);
|
|
||||||
|
|
||||||
//Add migrate event listener to migrate button
|
//Add migrate event listener to migrate button
|
||||||
this.button.addEventListener("click", this.migrate.bind(this));
|
this.button.addEventListener("click", this.migrate.bind(this));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class themeManager{
|
||||||
* Sets theme by name
|
* Sets theme by name
|
||||||
* @param {String} theme - name of theme to set, keep blank for default theme
|
* @param {String} theme - name of theme to set, keep blank for default theme
|
||||||
*/
|
*/
|
||||||
setTheme(theme){
|
setTheme(theme = localStorage.getItem("theme")){
|
||||||
//If we didnt get a theme to set
|
//If we didnt get a theme to set
|
||||||
if(theme == null){
|
if(theme == null){
|
||||||
//Use the first theme in the list
|
//Use the first theme in the list
|
||||||
|
|
@ -63,14 +63,7 @@ class themeManager{
|
||||||
}
|
}
|
||||||
|
|
||||||
//Create new link element and use it to set themeLink
|
//Create new link element and use it to set themeLink
|
||||||
this.themeLink = document.createElement('link');
|
this.themeLink = this.genThemeLink(theme);
|
||||||
|
|
||||||
//Set themeLink attributes
|
|
||||||
this.themeLink.type = "text/css";
|
|
||||||
this.themeLink.rel = "stylesheet";
|
|
||||||
|
|
||||||
//Set theme href to theme location
|
|
||||||
this.themeLink.href = this.themes.get(theme);
|
|
||||||
|
|
||||||
//Append themeLink to header
|
//Append themeLink to header
|
||||||
document.querySelector('head').appendChild(this.themeLink);
|
document.querySelector('head').appendChild(this.themeLink);
|
||||||
|
|
@ -78,6 +71,20 @@ class themeManager{
|
||||||
//Save theme choice to local storage
|
//Save theme choice to local storage
|
||||||
localStorage.setItem("theme", theme);
|
localStorage.setItem("theme", theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
genThemeLink(theme = localStorage.getItem("theme")){
|
||||||
|
//Create new link element and use it to set themeLink
|
||||||
|
const themeLink = document.createElement('link');
|
||||||
|
|
||||||
|
//Set themeLink attributes
|
||||||
|
themeLink.type = "text/css";
|
||||||
|
themeLink.rel = "stylesheet";
|
||||||
|
|
||||||
|
//Set theme href to theme location
|
||||||
|
themeLink.href = this.themes.get(theme);
|
||||||
|
|
||||||
|
return themeLink;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeManager = new themeManager();
|
ThemeManager = new themeManager();
|
||||||
Loading…
Add table
Add a link
Reference in a new issue