aboutsummaryrefslogtreecommitdiff
path: root/src/main/monacoWin.html
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-09-19 04:07:24 +0200
committerV <vendicated@riseup.net>2023-09-19 04:11:27 +0200
commit41f5d71e38f785786656e111cf2ea1200e45886d (patch)
tree564a0300485de18a0b8d396118f09c6f756105ed /src/main/monacoWin.html
parentefb88a4df8037fc1394a9e2053c49e75d340f401 (diff)
downloadVencord-41f5d71e38f785786656e111cf2ea1200e45886d.tar.gz
Vencord-41f5d71e38f785786656e111cf2ea1200e45886d.tar.bz2
Vencord-41f5d71e38f785786656e111cf2ea1200e45886d.zip
Bundle dependencies with extensions for webstore rule compliance (#1740)
Diffstat (limited to 'src/main/monacoWin.html')
-rw-r--r--src/main/monacoWin.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/main/monacoWin.html b/src/main/monacoWin.html
new file mode 100644
index 0000000..61d075f
--- /dev/null
+++ b/src/main/monacoWin.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Vencord QuickCSS Editor</title>
+ <link
+ rel="stylesheet"
+ href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.40.0/min/vs/editor/editor.main.min.css"
+ integrity="sha512-MOoQ02h80hklccfLrXFYkCzG+WVjORflOp9Zp8dltiaRP+35LYnO4LKOklR64oMGfGgJDLO8WJpkM1o5gZXYZQ=="
+ crossorigin="anonymous"
+ referrerpolicy="no-referrer"
+ />
+ <style>
+ html,
+ body,
+ #container {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ }
+ </style>
+ </head>
+
+ <body>
+ <div id="container"></div>
+ <script
+ src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.40.0/min/vs/loader.min.js"
+ integrity="sha512-QzMpXeCPciAHP4wbYlV2PYgrQcaEkDQUjzkPU4xnjyVSD9T36/udamxtNBqb4qK4/bMQMPZ8ayrBe9hrGdBFjQ=="
+ crossorigin="anonymous"
+ referrerpolicy="no-referrer"
+ ></script>
+
+ <script>
+ require.config({
+ paths: {
+ vs: "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.40.0/min/vs",
+ },
+ });
+
+ require(["vs/editor/editor.main"], () => {
+ getCurrentCss().then((css) => {
+ var editor = monaco.editor.create(
+ document.getElementById("container"),
+ {
+ value: css,
+ language: "css",
+ theme: getTheme(),
+ }
+ );
+ editor.onDidChangeModelContent(() =>
+ setCss(editor.getValue())
+ );
+ window.addEventListener("resize", () => {
+ // make monaco re-layout
+ editor.layout();
+ });
+ });
+ });
+ </script>
+ </body>
+</html>