added serverName to config (#1832)

This commit is contained in:
ArnoldSmith86 2023-09-29 07:50:43 +02:00 committed by GitHub
parent be78e3b05a
commit 02fd09c1da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 7 deletions

View File

@ -552,12 +552,7 @@ onLoad(function() {
if(!checkedOnce)
checkURLproperties(true);
checkedOnce = true;
let tabSuffix;
if (config.customTab) {
tabSuffix = config.customTab;
} else {
tabSuffix = "VirtualTabletop.io"
}
let tabSuffix = config.customTab || config.serverName || 'VirtualTabletop.io';
document.title = `${document.location.pathname.split('/').pop()} - ${tabSuffix}`;
});
});

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>VirtualTabletop.io</title>
<title> /*** TITLE ***/ </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="icon" sizes="any" href="i/branding/favicon-32.png"/>
<link rel="icon" type="image/svg+xml" href="i/branding/favicon.svg"/>

View File

@ -1,4 +1,5 @@
{
"serverName": "VirtualTabletop.io",
"port": 8272,
"externalURL": "http://localhost:8272",
"urlPrefix": "",

View File

@ -161,6 +161,7 @@ async function compressJS(jsFiles) {
async function compress(htmlFile, cssFiles, jsFiles) {
let htmlString = fs.readFileSync(path.resolve() + '/' + htmlFile, {encoding:'utf8'});
htmlString = htmlString.replace(/\ \/\*\*\*\ TITLE\ \*\*\*\/\ /, _=>Config.get('serverName'));
const css = await compressCSS(cssFiles);
htmlString = htmlString.replace(/\ \/\*\*\*\ CSS\ \*\*\*\/\ /, _=>css).replace(/\ \/\/\*\*\*\ CONFIG\ \*\*\*\/\/\ /, _=>`const config = ${JSON.stringify(Config.config)};`);