Merge pull request #75 from SethBurkart123/main

merge from main to typescript-conversion
This commit is contained in:
Seth Burkart
2023-12-06 06:21:41 +11:00
committed by GitHub
3 changed files with 15 additions and 23 deletions
@@ -23,7 +23,6 @@ const ThemeSelector = ({ selectedType, setSelectedType, isEditMode }: ThemeSelec
useEffect(() => { useEffect(() => {
const initializeThemes = async () => { const initializeThemes = async () => {
const downloaded = (await listThemes()); const downloaded = (await listThemes());
const initializedThemes = themesList.map(theme => ({ const initializedThemes = themesList.map(theme => ({
...theme, ...theme,
isDownloaded: downloaded.themes.includes(theme.name), isDownloaded: downloaded.themes.includes(theme.name),
+11 -11
View File
@@ -438,11 +438,13 @@ function CheckiFrameItems() {
'iframe.css', 'iframe.css',
) )
) { ) {
innerHTMLNode.appendChild( innerHTMLNode.append(
fileref, fileref,
); );
} }
added_node.addEventListener('load', function () { node.addEventListener('load', function () {
const childNode = node.contentDocument!.documentElement.childNodes[1] as HTMLElement
const innerHTMLNode = node.contentDocument!.documentElement.firstChild! as HTMLElement
if ( if (
childNode.style childNode.style
.color != 'white' .color != 'white'
@@ -455,7 +457,7 @@ function CheckiFrameItems() {
'iframe.css', 'iframe.css',
) )
) { ) {
innerHTMLNode.appendChild( innerHTMLNode.append(
fileref, fileref,
); );
} }
@@ -638,12 +640,15 @@ function CheckNoticeTextColour(notice: any) {
DarkMode = result.DarkMode; DarkMode = result.DarkMode;
if (node.classList.contains('notice')) { if (node.classList.contains('notice')) {
var hex = node.style.cssText.split(' ')[1]; var hex = node.style.cssText.split(' ')[1];
var threshold = GetThresholdOfColor(hex); if (hex) {
const hex1 = hex.slice(0,-1)
var threshold = GetThresholdOfColor(hex1);
if (DarkMode && threshold < 100) { if (DarkMode && threshold < 100) {
node.style.cssText = '--color: undefined;'; node.style.cssText = '--color: undefined;';
} }
} }
} }
}
result.then(open, onError) result.then(open, onError)
}); });
}); });
@@ -683,7 +688,7 @@ export function tryLoad() {
true, true,
); );
const observer = new MutationObserver(() => { documentTextColor() }) const observer = new MutationObserver(() => { documentTextColor() })
observer.observe(document.getElementById('toolbar')!, { attributes: true, childList: true, subtree: true }) observer.observe(document!, { attributes: true, childList: true, subtree: true, attributeFilter: ['td'], })
} }
function ChangeMenuItemPositions(storage: any) { function ChangeMenuItemPositions(storage: any) {
@@ -773,16 +778,11 @@ function main(storedSetting: any) {
if (onoff) { if (onoff) {
console.log('[BetterSEQTA+] Enabled'); console.log('[BetterSEQTA+] Enabled');
initialize(); initialize();
if (!isChrome || isChrome === 'undefined') {
tryLoad(); tryLoad();
}
window.addEventListener('load', tryLoad); window.addEventListener('load', tryLoad);
} else { } else {
if (!isChrome || isChrome === 'undefined') { handleDisabled()
handleDisabled();
}
window.addEventListener('load', handleDisabled); window.addEventListener('load', handleDisabled);
} }
} }
+3 -10
View File
@@ -59,7 +59,6 @@ html {
border-radius: 10px !important; border-radius: 10px !important;
cursor: pointer; cursor: pointer;
background: var(--text-primary) !important; background: var(--text-primary) !important;
border-radius: 10px;
color: var(--theme-primary) !important; color: var(--theme-primary) !important;
height: 35px; height: 35px;
justify-content: center; justify-content: center;
@@ -132,7 +131,7 @@ html {
min-height: unset !important; min-height: unset !important;
.title { .title {
padding: 1rem 1rem !important; padding: 1rem !important;
} }
} }
} }
@@ -761,7 +760,6 @@ div > ol:has(.uiFileHandlerWrapper) {
} }
.home-container h1 { .home-container h1 {
text-align: center; text-align: center;
font-weight: 400;
font-size: 3em !important; font-size: 3em !important;
font-weight: 300; font-weight: 300;
margin: 0 auto; margin: 0 auto;
@@ -955,12 +953,11 @@ div > ol:has(.uiFileHandlerWrapper) {
font-weight: 200; font-weight: 200;
} }
.notice h6 { .notice h6 {
margin: 0px 0px 40px 0px; margin: 0px 0px 40px;
font-weight: 100; font-weight: 100;
color: #c9c9c9; color: #c9c9c9;
} }
.day { .day {
box-shadow: inset 0px 0px 10px 0.1px var(--better-sub);
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -1051,7 +1048,7 @@ div > ol:has(.uiFileHandlerWrapper) {
width: 20px; width: 20px;
padding: 10px; padding: 10px;
text-align: center; text-align: center;
margin: 20px auto 0px auto; margin: 20px auto 0px;
cursor: pointer; cursor: pointer;
} }
@@ -2126,7 +2123,6 @@ li.MessageList__unread___3imtO {
overflow-y: hidden; overflow-y: hidden;
} }
.upcoming-checkbox-container { .upcoming-checkbox-container {
display: block;
position: relative; position: relative;
padding: none !important; padding: none !important;
padding-left: 25px !important; padding-left: 25px !important;
@@ -2213,7 +2209,6 @@ li.MessageList__unread___3imtO {
cursor: pointer; cursor: pointer;
} }
.day { .day {
box-shadow: inset 0px 0px 10px 0.1px var(--better-sub);
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -2287,7 +2282,6 @@ li.MessageList__unread___3imtO {
} }
.upcoming-items { .upcoming-items {
background: var(--background-primary); background: var(--background-primary);
transition: 200ms;
width: 100%; width: 100%;
max-height: 55em; max-height: 55em;
overflow-y: auto; overflow-y: auto;
@@ -2375,7 +2369,6 @@ li.MessageList__unread___3imtO {
overflow-y: hidden; overflow-y: hidden;
} }
.upcoming-checkbox-container { .upcoming-checkbox-container {
display: block;
position: relative; position: relative;
padding: none !important; padding: none !important;
padding-left: 25px !important; padding-left: 25px !important;