mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
if imgur client id is not set but local file uploads are enabled use that
This commit is contained in:
@@ -94,9 +94,8 @@ define(['taskbar'], function(taskbar) {
|
|||||||
|
|
||||||
var postContainer = $(composerTemplate[0]);
|
var postContainer = $(composerTemplate[0]);
|
||||||
|
|
||||||
if(config.imgurClientIDSet) {
|
if(config.allowFileUploads || config.imgurClientIDSet)
|
||||||
initializeFileReader(post_uuid);
|
initializeFileReader(post_uuid);
|
||||||
}
|
|
||||||
|
|
||||||
var postData = composer.posts[post_uuid],
|
var postData = composer.posts[post_uuid],
|
||||||
titleEl = postContainer.find('.title'),
|
titleEl = postContainer.find('.title'),
|
||||||
|
|||||||
10
src/posts.js
10
src/posts.js
@@ -360,10 +360,7 @@ var db = require('./database'),
|
|||||||
|
|
||||||
Posts.uploadPostImage = function(image, callback) {
|
Posts.uploadPostImage = function(image, callback) {
|
||||||
|
|
||||||
if(!meta.config.imgurClientID) {
|
if(meta.config.imgurClientID) {
|
||||||
return callback('imgurClientID not set', null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!image) {
|
if(!image) {
|
||||||
return callback('invalid image', null);
|
return callback('invalid image', null);
|
||||||
}
|
}
|
||||||
@@ -378,6 +375,11 @@ var db = require('./database'),
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else if (meta.config.allowFileUploads) {
|
||||||
|
Posts.uploadPostFile(image, callback);
|
||||||
|
} else {
|
||||||
|
callback('Uploads are disabled!');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Posts.uploadPostFile = function(file, callback) {
|
Posts.uploadPostFile = function(file, callback) {
|
||||||
|
|||||||
Reference in New Issue
Block a user