Compare commits
	
		
			4 commits
		
	
	
		
			24a2991292
			...
			2f7668efa7
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2f7668efa7 | |||
| 0ab8bbb6e4 | |||
| fd085cc820 | |||
| 86e6bcee61 | 
					 9 changed files with 18 additions and 4 deletions
				
			
		
							
								
								
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -8,3 +8,4 @@ public/history/*.json
 | 
			
		|||
.well-known/
 | 
			
		||||
 | 
			
		||||
settings.json
 | 
			
		||||
customHtmlAfterFooter.html
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										
											BIN
										
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								README.md
									
										
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										5
									
								
								customHtmlAfterFooter.example.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								customHtmlAfterFooter.example.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -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…
	
	Add table
		
		Reference in a new issue