mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 01:15:47 +01:00
nconf fixes
This commit is contained in:
@@ -52,14 +52,14 @@
|
||||
if(data['userslug'])
|
||||
userLabel.attr('href','/users/' + data['userslug']);
|
||||
if(data['picture'])
|
||||
userLabel.find('img').attr('src',data['picture']+"?s=24&default=identicon");
|
||||
userLabel.find('img').attr('src',data['picture']);
|
||||
if(data['username'])
|
||||
userLabel.find('span').html(data['username']);
|
||||
}
|
||||
else {
|
||||
var userli = $('<li> \
|
||||
<a id="user_label" href="/users/'+data['userslug']+'"> \
|
||||
<img src="'+data['picture']+"?s=24&default=identicon"+'"/> \
|
||||
<img src="'+data['picture']+'"/> \
|
||||
<span>'+data['username']+'</span> \
|
||||
</a> \
|
||||
</li>');
|
||||
|
||||
@@ -191,20 +191,20 @@ define(['taskbar'], function(taskbar) {
|
||||
var postData = composer.posts[post_uuid],
|
||||
titleEl = composer.postContainer.querySelector('input'),
|
||||
bodyEl = composer.postContainer.querySelector('textarea');
|
||||
if (titleEl.value.length <= 3) {
|
||||
if (titleEl.value.length < 3) {
|
||||
return app.alert({
|
||||
type: 'error',
|
||||
timeout: 5000,
|
||||
timeout: 2000,
|
||||
title: 'Title too short',
|
||||
message: "Please enter a longer title.",
|
||||
alert_id: 'post_error'
|
||||
});
|
||||
}
|
||||
|
||||
if (bodyEl.value.length <= 9) {
|
||||
if (bodyEl.value.length < 8) {
|
||||
return app.alert({
|
||||
type: 'error',
|
||||
timeout: 5000,
|
||||
timeout: 2000,
|
||||
title: 'Content too short',
|
||||
message: "Please enter a longer post.",
|
||||
alert_id: 'post_error'
|
||||
|
||||
@@ -101,8 +101,8 @@ var user = require('./../user.js'),
|
||||
uploadUserPicture(req.user.uid, req.files.userPhoto.name, req.files.userPhoto.path, res);
|
||||
return;
|
||||
}
|
||||
|
||||
var absolutePath = path.join(global.configuration['ROOT_DIRECTORY'], config.upload_path, path.basename(oldpicture));
|
||||
|
||||
var absolutePath = path.join(global.configuration['ROOT_DIRECTORY'], global.nconf.get('upload_path'), path.basename(oldpicture));
|
||||
|
||||
fs.unlink(absolutePath, function(err) {
|
||||
if(err) {
|
||||
@@ -124,7 +124,7 @@ var user = require('./../user.js'),
|
||||
}
|
||||
|
||||
var filename = uid + '-profileimg' + extension;
|
||||
var uploadPath = path.join(global.configuration['ROOT_DIRECTORY'], config.upload_path, filename);
|
||||
var uploadPath = path.join(global.configuration['ROOT_DIRECTORY'], global.nconf.get('upload_path'), filename);
|
||||
|
||||
// @todo move to proper logging code - this should only be temporary
|
||||
console.log('Info: Attempting upload to: '+ uploadPath);
|
||||
@@ -135,7 +135,7 @@ var user = require('./../user.js'),
|
||||
is.on('end', function() {
|
||||
fs.unlinkSync(tempPath);
|
||||
|
||||
var imageUrl = config.upload_url + filename;
|
||||
var imageUrl = global.nconf.get('upload_url') + filename;
|
||||
|
||||
res.json({ path: imageUrl });
|
||||
|
||||
@@ -341,10 +341,7 @@ var user = require('./../user.js'),
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}(exports));
|
||||
|
||||
Reference in New Issue
Block a user