mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-19 03:17:02 -04:00
UserScript: disable theme ui, instead recommend Stylus
This commit is contained in:
parent
fae15dbdfe
commit
c19827a0e5
7 changed files with 48 additions and 10 deletions
|
@ -20,16 +20,13 @@
|
|||
/// <reference path="../src/globals.d.ts" />
|
||||
|
||||
import monacoHtmlLocal from "file://monacoWin.html?minify";
|
||||
import monacoHtmlCdn from "file://../src/main/monacoWin.html?minify";
|
||||
import * as DataStore from "../src/api/DataStore";
|
||||
import { debounce } from "../src/utils";
|
||||
import { debounce, localStorage } from "../src/utils";
|
||||
import { EXTENSION_BASE_URL } from "../src/utils/web-metadata";
|
||||
import { getTheme, Theme } from "../src/utils/discord";
|
||||
import { getThemeInfo } from "../src/main/themes";
|
||||
import { Settings } from "../src/Vencord";
|
||||
|
||||
// Discord deletes this so need to store in variable
|
||||
const { localStorage } = window;
|
||||
import { getStylusWebStoreUrl } from "@utils/web";
|
||||
|
||||
// listeners for ipc.on
|
||||
const cssListeners = new Set<(css: string) => void>();
|
||||
|
@ -77,6 +74,14 @@ window.VencordNative = {
|
|||
addThemeChangeListener: NOOP,
|
||||
openFile: NOOP_ASYNC,
|
||||
async openEditor() {
|
||||
if (IS_USERSCRIPT) {
|
||||
const shouldOpenWebStore = confirm("QuickCSS is not supported on the Userscript. You can instead use the Stylus extension.\n\nDo you want to open the Stylus web store page?");
|
||||
if (shouldOpenWebStore) {
|
||||
window.open(getStylusWebStoreUrl(), "_blank");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const features = `popup,width=${Math.min(window.innerWidth, 1000)},height=${Math.min(window.innerHeight, 1000)}`;
|
||||
const win = open("about:blank", "VencordQuickCss", features);
|
||||
if (!win) {
|
||||
|
@ -92,7 +97,7 @@ window.VencordNative = {
|
|||
? "vs-light"
|
||||
: "vs-dark";
|
||||
|
||||
win.document.write(IS_EXTENSION ? monacoHtmlLocal : monacoHtmlCdn);
|
||||
win.document.write(monacoHtmlLocal);
|
||||
},
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue