mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-27 22:34:11 +00:00
Inline plugin support
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Discord Test Client</title>
|
||||
<link rel="stylesheet" href="/assets/fosscord.css"/>
|
||||
<link id="logincss" rel="stylesheet" href="/assets/fosscord-login.css"/>
|
||||
<link id="customcss" rel="stylesheet" href="/assets/user.css"/>
|
||||
<link rel="stylesheet" href="/assets/fosscord.css" />
|
||||
<link id="logincss" rel="stylesheet" href="/assets/fosscord-login.css" />
|
||||
<link id="customcss" rel="stylesheet" href="/assets/user.css" />
|
||||
<!-- preload plugin marker -->
|
||||
</head>
|
||||
|
||||
|
||||
Generated
BIN
Binary file not shown.
@@ -23,10 +23,15 @@ export default function TestClient(app: Application) {
|
||||
if (GATEWAY_ENDPOINT) {
|
||||
html = html.replace(/GATEWAY_ENDPOINT: .+/, `GATEWAY_ENDPOINT: \`${GATEWAY_ENDPOINT}\`,`);
|
||||
}
|
||||
|
||||
//plugins
|
||||
var files = fs.readdirSync(path.join(__dirname, "..", "..", "assets", "plugins"));
|
||||
// inline plugins
|
||||
var files = fs.readdirSync(path.join(__dirname, "..", "..", "assets", "preload-plugins"));
|
||||
var plugins = "";
|
||||
files.forEach(x =>{if(x.endsWith(".js")) plugins += `<script>${fs.readFileSync(path.join(__dirname, "..", "..", "assets", "preload-plugins", x))}</script>\n`; });
|
||||
html = html.replaceAll("<!-- preload plugin marker -->", plugins);
|
||||
|
||||
// plugins
|
||||
files = fs.readdirSync(path.join(__dirname, "..", "..", "assets", "plugins"));
|
||||
plugins = "";
|
||||
files.forEach(x =>{if(x.endsWith(".js")) plugins += `<script src='/assets/plugins/${x}'></script>\n`; });
|
||||
html = html.replaceAll("<!-- plugin marker -->", plugins);
|
||||
//preload plugins
|
||||
|
||||
Reference in New Issue
Block a user