From e5c1edd5f5e9d0a4a0a34cae0ed864bb9e6d33b8 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 26 Nov 2013 12:25:19 -0500 Subject: [PATCH 1/3] using ajaxifying class for content and footer instead of jquery fadein/out --- public/src/ajaxify.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index d3581e947e..64c55691e2 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -88,7 +88,7 @@ var ajaxify = {}; translator.load(tpl_url); - jQuery('#footer, #content').fadeOut(100); + jQuery('#footer, #content').addClass('ajaxifying'); templates.flush(); templates.load_template(function () { @@ -105,17 +105,17 @@ var ajaxify = {}; app.processPage(); - jQuery('#content, #footer').stop(true, true).fadeIn(200, function () { - if (window.location.hash) { - hash = window.location.hash; - } + jQuery('#content, #footer').stop(true, true).removeClass('ajaxifying'); - if (hash) { - require(['forum/topic'], function(topic) { - topic.scrollToPost(hash.substr(1)); - }); - } - }); + if (window.location.hash) { + hash = window.location.hash; + } + + if (hash) { + require(['forum/topic'], function(topic) { + topic.scrollToPost(hash.substr(1)); + }); + } utils.refreshTitle(url); From e98d05b1a5916e5112f3ff7cd81429bc86d62705 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 26 Nov 2013 13:18:41 -0500 Subject: [PATCH 2/3] closes #556, also removes the newline that was previously inserted --- public/src/templates.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/src/templates.js b/public/src/templates.js index 1be825e469..44083d1589 100644 --- a/public/src/templates.js +++ b/public/src/templates.js @@ -248,9 +248,12 @@ if (self.blocks && block !== undefined) self.blocks[block] = data[0]; + var begin = new RegExp("(\r\n)*(\r\n)*", "g"), + end = new RegExp("(\r\n)*(\r\n)*", "g"), + data = data[0] - .replace("", "") - .replace("", ""); + .replace(begin, "") + .replace(end, ""); return data; } From 529c8acf6c450795048bed8502e0d78bf6164042 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 26 Nov 2013 14:15:40 -0500 Subject: [PATCH 3/3] app.js: added --install alias for --setup --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 374c198bf9..395416adf6 100644 --- a/app.js +++ b/app.js @@ -55,7 +55,7 @@ winston.info(''); - if (!nconf.get('help') && !nconf.get('setup') && !nconf.get('upgrade') && fs.existsSync(__dirname + '/config.json')) { + if (!nconf.get('help') && !nconf.get('setup') && !nconf.get('install') && !nconf.get('upgrade') && fs.existsSync(__dirname + '/config.json')) { // Load server-side configs nconf.file({ file: __dirname + '/config.json' @@ -127,7 +127,7 @@ } }); }); - } else if (nconf.get('setup') || !fs.existsSync(__dirname + '/config.json')) { + } else if (nconf.get('setup') || nconf.get('install') || !fs.existsSync(__dirname + '/config.json')) { // New install, ask setup questions if (nconf.get('setup')) { winston.info('NodeBB Setup Triggered via Command Line');