From e6dfc749f6448cb6f2cbab02e459c7ce86e8a106 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sun, 23 Oct 2016 22:42:47 +0800 Subject: [PATCH] Fix config.js use cdn option not parse properly and add missing cdn resources --- lib/config.js | 2 +- public/views/foot.ejs | 1 + public/views/pretty.ejs | 1 + public/views/slide.ejs | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index 0aa154bc9..76b21f0d3 100644 --- a/lib/config.js +++ b/lib/config.js @@ -17,7 +17,7 @@ var protocolusessl = (usessl === true && typeof process.env.HMD_PROTOCOL_USESSL ? true : (process.env.HMD_PROTOCOL_USESSL ? (process.env.HMD_PROTOCOL_USESSL === 'true') : !!config.protocolusessl); var urladdport = process.env.HMD_URL_ADDPORT ? (process.env.HMD_URL_ADDPORT === 'true') : !!config.urladdport; -var usecdn = process.env.HMD_USECDN ? (process.env.HMD_USECDN === 'true') : !!!config.usecdn; +var usecdn = process.env.HMD_USECDN ? (process.env.HMD_USECDN === 'true') : ((typeof config.usecdn === 'boolean') ? config.usecdn : true); // db var db = config.db || { diff --git a/public/views/foot.ejs b/public/views/foot.ejs index 863cae3ff..8990bdae7 100644 --- a/public/views/foot.ejs +++ b/public/views/foot.ejs @@ -9,6 +9,7 @@ + <% } else { %> diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index a2123fb4f..1f171d129 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -93,6 +93,7 @@ + <% } else { %> diff --git a/public/views/slide.ejs b/public/views/slide.ejs index e401fa47e..73f5d718d 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -87,11 +87,14 @@ MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }}); <% if(useCDN) { %> + + + <% } else { %>