Merge branch 'master' of github.com:designcreateplay/NodeBB

v1.18.x
Julian Lam 11 years ago
commit 88fe989fa2

@ -603,6 +603,7 @@ define(['taskbar'], function(taskbar) {
textarea.val(currentText.replace(imgText, linkStart + '[' + data.name + '](' + data.url + ')')); textarea.val(currentText.replace(imgText, linkStart + '[' + data.name + '](' + data.url + ')'));
composer.posts[post_uuid].uploadsInProgress.pop(); composer.posts[post_uuid].uploadsInProgress.pop();
textarea.focus();
}); });
} }

@ -397,7 +397,7 @@ var db = require('./database'),
Posts.uploadPostImage = function(image, callback) { Posts.uploadPostImage = function(image, callback) {
if(plugins.hasListeners('filter:uploadImage')) { if(plugins.hasListeners('filter:uploadImage')) {
plugins.fireHook('filter:uploadImage', image, callback); plugins.fireHook('filter:uploadImage', {base64: image.data, name: image.name}, callback);
} else { } else {
if (meta.config.allowFileUploads) { if (meta.config.allowFileUploads) {
@ -411,7 +411,7 @@ var db = require('./database'),
Posts.uploadPostFile = function(file, callback) { Posts.uploadPostFile = function(file, callback) {
if(plugins.hasListeners('filter:uploadFile')) { if(plugins.hasListeners('filter:uploadFile')) {
plugins.fireHook('filter:uploadFile', file, callback); plugins.fireHook('filter:uploadFile', {base64: file.data, name: file.name}, callback);
} else { } else {
if(!meta.config.allowFileUploads) { if(!meta.config.allowFileUploads) {

@ -195,13 +195,7 @@ var nconf = require('nconf'),
} }
if(plugins.hasListeners('filter:uploadImage')) { if(plugins.hasListeners('filter:uploadImage')) {
image.convertImageToBase64(req.files.userPhoto.path, function(err, image64) { plugins.fireHook('filter:uploadImage', {file: req.files.userPhoto.path, name:filename}, done);
if(err) {
return done(err);
}
plugins.fireHook('filter:uploadImage', {data:image64, name:filename}, done);
});
} else { } else {
saveFileToLocal(filename, req, done); saveFileToLocal(filename, req, done);
} }

@ -172,9 +172,7 @@ var fs = require('fs'),
} }
if(plugins.hasListeners('filter:uploadImage')) { if(plugins.hasListeners('filter:uploadImage')) {
image.convertImageToBase64(req.files.userPhoto.path, function(err, image64) { plugins.fireHook('filter:uploadImage', {file: req.files.userPhoto.path, name: filename}, done);
plugins.fireHook('filter:uploadImage', {data:image64, name:filename}, done);
});
} else { } else {
user.getUserField(req.user.uid, 'uploadedpicture', function (err, oldpicture) { user.getUserField(req.user.uid, 'uploadedpicture', function (err, oldpicture) {

Loading…
Cancel
Save