Browse Source

Updated blog renderer engine to lazy load youtube videos.

pull/46/head
jrtechs 6 years ago
parent
commit
2a7a623e43
4 changed files with 7 additions and 10 deletions
  1. +0
    -4
      admin/admin.js
  2. +1
    -1
      admin/login/login.js
  3. +1
    -1
      includes/css/bootstrap.css
  4. +5
    -4
      sites/admin.js

+ 0
- 4
admin/admin.js View File

@ -27,22 +27,18 @@ module.exports=
*/ */
main: function(request, clientAddress, templateContext, filename) main: function(request, clientAddress, templateContext, filename)
{ {
console.log("admin main called");
return new Promise(function(resolve, reject) return new Promise(function(resolve, reject)
{ {
//if logged in //if logged in
if(request.session && request.session.user) if(request.session && request.session.user)
{ {
console.log(filename);
templateContext.loggedIn = true; templateContext.loggedIn = true;
utils.getPostData(request).then(function (postData) utils.getPostData(request).then(function (postData)
{ {
console.log("temp 1");
var page = "./adminHome.js"; var page = "./adminHome.js";
if(filename.includes('/downloads')) if(filename.includes('/downloads'))
{ {
page = "./adminDownloads.js"; page = "./adminDownloads.js";
console.log("downloads time")
} }
else if(filename.includes("/posts")) else if(filename.includes("/posts"))
{ {

+ 1
- 1
admin/login/login.js View File

@ -23,7 +23,7 @@ const processLogin = function(request, clientAddress, templateContext)
{ {
if(DEBUG) if(DEBUG)
{ {
//what actually logs in the user
//logs in as first user in DB
request.session.user = 1; request.session.user = 1;
console.log("user has logged in"); console.log("user has logged in");
templateContext.goodLoginAttempt = true; templateContext.goodLoginAttempt = true;

+ 1
- 1
includes/css/bootstrap.css View File

@ -9706,5 +9706,5 @@ footer .footer-col
footer .footer-below footer .footer-below
{ {
padding: 25px 0; padding: 25px 0;
background-color: #2C3E50;
background-color: #1a252f;
} }

+ 5
- 4
sites/admin.js View File

@ -40,12 +40,13 @@ module.exports=
const file = "../admin/admin.js"; const file = "../admin/admin.js";
var templateContext = Object(); var templateContext = Object();
Promise.all([includes.printAdminHeader(templateContext),
Promise.all([includes.fetchTemplate("admin/adminMain.html")],
includes.printAdminHeader(templateContext),
require(file).main(request, clientAddress, templateContext, filename), require(file).main(request, clientAddress, templateContext, filename),
includes.printFooter(templateContext),
includes.fetchTemplate("admin/adminMain.html")]).then(function(content)
includes.printFooter(templateContext)
).then(function(content)
{ {
result.write(whiskers.render(content.join(''), templateContext));
result.write(whiskers.render(content[0], templateContext));
result.end(); result.end();
}).catch(function(err) }).catch(function(err)

Loading…
Cancel
Save