mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-01-10 04:07:35 +02:00
parent
58e1857c9a
commit
2ca74ef8b4
@ -78,7 +78,15 @@ export class PublicRouter {
|
||||
res.tpl.user.csrfToken = req.csrfToken();
|
||||
}
|
||||
}
|
||||
res.tpl.Config = {Client: Config.Client.toJSON({attachVolatile: true})};
|
||||
const confCopy = {Client: Config.Client.toJSON({attachVolatile: true})};
|
||||
// Escaping html tags, like <script></script>
|
||||
confCopy.Client.Other.customHTMLHead = confCopy.Client.Other.customHTMLHead.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
res.tpl.Config = confCopy;
|
||||
res.tpl.customHTMLHead = Config.Client.Other.customHTMLHead;
|
||||
|
||||
return next();
|
||||
});
|
||||
|
@ -111,6 +111,8 @@ export class NavBarConfig {
|
||||
|
||||
@SubConfigClass()
|
||||
export class ClientOtherConfig {
|
||||
@ConfigProperty()
|
||||
customHTMLHead: string = '';
|
||||
@ConfigProperty()
|
||||
enableCache: boolean = true;
|
||||
@ConfigProperty()
|
||||
|
@ -105,6 +105,14 @@
|
||||
required="true">
|
||||
</app-settings-entry>
|
||||
|
||||
<app-settings-entry
|
||||
name="Custom HTML Head"
|
||||
description="Injects the content of this between the <head></head> HTML tags of the app. (You can use it add analytics or custom code to the app)"
|
||||
[ngModel]="states.Client.customHTMLHead"
|
||||
i18n-name
|
||||
[simplifiedMode]="simplifiedMode">
|
||||
</app-settings-entry>
|
||||
|
||||
|
||||
|
||||
<button class="btn btn-success float-right"
|
||||
|
@ -20,6 +20,7 @@
|
||||
var ServerInject = {user: <%- JSON.stringify(user); %>, ConfigInject: <%- JSON.stringify(Config); %>}
|
||||
</script>
|
||||
|
||||
<%- customHTMLHead %>
|
||||
</head>
|
||||
|
||||
<body style="overflow-y: scroll; padding-right: 0 !important;">
|
||||
|
Loading…
Reference in New Issue
Block a user