nconf fixes

v1.18.x
Baris Soner Usakli 12 years ago
parent 4d670006e1
commit f7d27cdef1

@ -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'

@ -102,7 +102,7 @@ var user = require('./../user.js'),
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 });
@ -342,9 +342,6 @@ var user = require('./../user.js'),
});
}
};
}(exports));

Loading…
Cancel
Save