Compare commits
4 Commits
24a2991292
...
2f7668efa7
Author | SHA1 | Date |
---|---|---|
Robbie Antenesse | 2f7668efa7 | |
Robbie Antenesse | 0ab8bbb6e4 | |
Robbie Antenesse | fd085cc820 | |
Robbie Antenesse | 86e6bcee61 |
|
@ -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>
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "little-library",
|
||||
"version": "0.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "A digital give-a-book, take-a-book library for ebooks",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -30,7 +30,7 @@ module.exports = function (app) {
|
|||
}),
|
||||
footer: '<a class="button close">Close</a>',
|
||||
});
|
||||
return app.templater.fill('./templates/elements/book.html', {
|
||||
return app.templater.fill('./templates/elements/book_readable.html', {
|
||||
id,
|
||||
title: bookData.title,
|
||||
author: bookData.author,
|
||||
|
|
|
@ -181,8 +181,8 @@ Server.prototype.start = function () {
|
|||
console.log('Started server on port ' + (process.env.PORT || settings.port));
|
||||
});
|
||||
if (this.https) {
|
||||
this.https.listen(443, () => {
|
||||
console.log('Started SSL server on port 443');
|
||||
this.https.listen(settings.sslPort, () => {
|
||||
console.log('Started SSL server on port ' + settings.sslPort);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"allowedFormats": [".epub", ".mobi", ".pdf"],
|
||||
"toolsPassword": "password",
|
||||
"hideVisitors": false,
|
||||
"sslPort": 443,
|
||||
"sslPrivateKey": null,
|
||||
"sslCertificate": null,
|
||||
"sslCertificateAuthority": null,
|
||||
|
|
|
@ -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