mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
merged
This commit is contained in:
13
src/meta.js
13
src/meta.js
@@ -243,7 +243,7 @@ var fs = require('fs'),
|
|||||||
minFile: path.join(__dirname, '..', 'public/src/nodebb.min.js'),
|
minFile: path.join(__dirname, '..', 'public/src/nodebb.min.js'),
|
||||||
get: function (callback) {
|
get: function (callback) {
|
||||||
plugins.fireHook('filter:scripts.get', this.scripts, function(err, scripts) {
|
plugins.fireHook('filter:scripts.get', this.scripts, function(err, scripts) {
|
||||||
var mtime,
|
var ctime,
|
||||||
jsPaths = scripts.map(function (jsPath) {
|
jsPaths = scripts.map(function (jsPath) {
|
||||||
jsPath = path.normalize(jsPath);
|
jsPath = path.normalize(jsPath);
|
||||||
|
|
||||||
@@ -267,12 +267,12 @@ var fs = require('fs'),
|
|||||||
|
|
||||||
if (process.env.NODE_ENV !== 'development') {
|
if (process.env.NODE_ENV !== 'development') {
|
||||||
async.parallel({
|
async.parallel({
|
||||||
mtime: function (next) {
|
ctime: function (next) {
|
||||||
async.map(jsPaths, fs.stat, function (err, stats) {
|
async.map(jsPaths, fs.stat, function (err, stats) {
|
||||||
async.reduce(stats, 0, function (memo, item, next) {
|
async.reduce(stats, 0, function (memo, item, next) {
|
||||||
if(item) {
|
if(item) {
|
||||||
mtime = +new Date(item.mtime);
|
ctime = +new Date(item.ctime);
|
||||||
next(null, mtime > memo ? mtime : memo);
|
next(null, ctime > memo ? ctime : memo);
|
||||||
} else {
|
} else {
|
||||||
next(null, memo);
|
next(null, memo);
|
||||||
}
|
}
|
||||||
@@ -286,14 +286,15 @@ var fs = require('fs'),
|
|||||||
}
|
}
|
||||||
|
|
||||||
fs.stat(Meta.js.minFile, function (err, stat) {
|
fs.stat(Meta.js.minFile, function (err, stat) {
|
||||||
next(err, +new Date(stat.mtime));
|
next(err, +new Date(stat.ctime));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, function (err, results) {
|
}, function (err, results) {
|
||||||
if (results.minFile > results.mtime) {
|
if (results.minFile > results.ctime) {
|
||||||
winston.info('No changes to client-side libraries -- skipping minification');
|
winston.info('No changes to client-side libraries -- skipping minification');
|
||||||
callback(null, [path.relative(path.join(__dirname, '../public'), Meta.js.minFile)]);
|
callback(null, [path.relative(path.join(__dirname, '../public'), Meta.js.minFile)]);
|
||||||
} else {
|
} else {
|
||||||
|
winston.info('Minifying client-side libraries -- please wait');
|
||||||
Meta.js.minify(function () {
|
Meta.js.minify(function () {
|
||||||
callback(null, [
|
callback(null, [
|
||||||
path.relative(path.join(__dirname, '../public'), Meta.js.minFile)
|
path.relative(path.join(__dirname, '../public'), Meta.js.minFile)
|
||||||
|
|||||||
@@ -71,8 +71,7 @@ var fs = require('fs'),
|
|||||||
plugins.push(meta.config['theme:id']);
|
plugins.push(meta.config['theme:id']);
|
||||||
|
|
||||||
async.each(plugins, function(plugin, next) {
|
async.each(plugins, function(plugin, next) {
|
||||||
|
if (!plugin || typeof plugin !== 'string') {
|
||||||
if (!plugin) {
|
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1136,8 +1136,9 @@ var bcrypt = require('bcryptjs'),
|
|||||||
async.filter(nids, function(nid, next) {
|
async.filter(nids, function(nid, next) {
|
||||||
notifications.get(nid, uid, function(notifObj) {
|
notifications.get(nid, uid, function(notifObj) {
|
||||||
if(!notifObj) {
|
if(!notifObj) {
|
||||||
next(false);
|
return next(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notifObj.uniqueId === uniqueId) {
|
if (notifObj.uniqueId === uniqueId) {
|
||||||
next(true);
|
next(true);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user