Add ability to add custom html to bottom of body (for analytics, etc.)
This commit is contained in:
parent
86e6bcee61
commit
fd085cc820
|
@ -8,3 +8,4 @@ public/history/*.json
|
|||
.well-known/
|
||||
|
||||
settings.json
|
||||
customHtmlAfterFooter.html
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<script>
|
||||
$(document).ready(function() {
|
||||
console.log('This runs after everything else is loaded.');
|
||||
});
|
||||
</script>
|
|
@ -26,6 +26,11 @@ module.exports = class {
|
|||
.replace(/\{\{allowedFormats\}\}/g, settings.allowedFormats.join(','))
|
||||
.replace(/\{\{maxFileSize\}\}/g, (settings.maxFileSize > 0 ? settings.maxFileSize + 'MB' : 'no'));
|
||||
|
||||
if (fs.existsSync(path.resolve('./customHtmlAfterFooter.html'))) {
|
||||
const customHtmlAfterFooter = fs.readFileSync(path.resolve('./customHtmlAfterFooter.html'));
|
||||
filledTemplate = filledTemplate.replace(/\{\{customHtmlAfterFooter\}\}/g, customHtmlAfterFooter);
|
||||
}
|
||||
|
||||
for (let templateVar in templateVars) {
|
||||
const regExp = new RegExp('\{\{' + templateVar + '\}\}', 'g')
|
||||
filledTemplate = filledTemplate.replace(regExp, templateVars[templateVar]);
|
||||
|
|
|
@ -86,6 +86,8 @@
|
|||
|
||||
{{modal}}
|
||||
<script src="{{resourcePath}}js/little-library.js"></script>
|
||||
|
||||
{{customHtmlAfterFooter}}
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue