' +
'
' +
'' +
@@ -153,12 +164,14 @@ define(['taskbar'], function(taskbar) {
// Post Window events
var jPostContainer = $(composer.postContainer),
- postContentEl = composer.postContainer.querySelector('textarea')
+ postContentEl = composer.postContainer.querySelector('textarea');
+
jPostContainer.on('change', 'input, textarea', function() {
var uuid = $(this).parents('.post-window')[0].getAttribute('data-uuid');
if (this.nodeName === 'INPUT') composer.posts[uuid].title = this.value;
else if (this.nodeName === 'TEXTAREA') composer.posts[uuid].body = this.value;
});
+
jPostContainer.on('click', '.action-bar button', function() {
var action = this.getAttribute('data-action'),
uuid = $(this).parents('.post-window').attr('data-uuid');
@@ -168,6 +181,7 @@ define(['taskbar'], function(taskbar) {
case 'discard': composer.discard(uuid); break;
}
});
+
jPostContainer.on('click', '.formatting-bar span', function() {
var iconClass = this.querySelector('i').className,
cursorEnd = postContentEl.value.length,
@@ -240,13 +254,22 @@ define(['taskbar'], function(taskbar) {
});
}
+ function createPostImages(images) {
+ var imagelist = $(composer.postContainer).find('.imagelist');
+ imagelist.empty();
+
+ if(images && images.length) {
+ for(var i=0; i 0) {
@@ -291,7 +316,7 @@ define(['taskbar'], function(taskbar) {
composer.post = function(post_uuid) {
// Check title and post length
- var postData = composer.posts[post_uuid],
+ var postData = composer.posts[post_uuid],
titleEl = composer.postContainer.querySelector('input'),
bodyEl = composer.postContainer.querySelector('textarea');
@@ -346,7 +371,8 @@ define(['taskbar'], function(taskbar) {
composer.discard = function(post_uuid) {
if (composer.posts[post_uuid]) {
- $(composer.postContainer).find('#imagedrop').html('');
+ $(composer.postContainer).find('.imagedrop').html('');
+ $(composer.postContainer).find('.imagelist').empty();
delete composer.posts[post_uuid];
composer.minimize();
taskbar.discard('composer', post_uuid);
diff --git a/public/templates/admin/settings.tpl b/public/templates/admin/settings.tpl
index ed83c89141..ca92b0faf3 100644
--- a/public/templates/admin/settings.tpl
+++ b/public/templates/admin/settings.tpl
@@ -8,6 +8,8 @@
+
+
diff --git a/src/imgur.js b/src/imgur.js
index d8178bc332..72ca1b7b6c 100644
--- a/src/imgur.js
+++ b/src/imgur.js
@@ -14,7 +14,7 @@ var request = require('request');
}
};
- var post = request.post(options, function(err, req, body){
+ var post = request.post(options, function(err, req, body) {
try{
callback(err, JSON.parse(body));
} catch(e) {
diff --git a/src/install.js b/src/install.js
index b6b83798d7..5312350d7e 100644
--- a/src/install.js
+++ b/src/install.js
@@ -84,11 +84,11 @@ var async = require('async'),
server_conf.base_url = protocol + '//' + host;
server_conf.relative_path = relative_path;
- server_conf.imgurClientID = '';
meta.config.set('postDelay', 10000);
meta.config.set('minimumPostLength', 8);
meta.config.set('minimumTitleLength', 3);
+ meta.config.set('imgurClientID', '');
install.save(server_conf, client_conf, callback);
});
diff --git a/src/posts.js b/src/posts.js
index 12d6d95c49..30902161ad 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -230,6 +230,7 @@ var RDB = require('./redis.js'),
postData.relativeTime = utils.relativeTime(postData.timestamp)
postData.fav_star_class = 'icon-star-empty';
postData['edited-class'] = 'none';
+ postData.show_banned = 'hide';
postData.uploadedImages = JSON.parse(postData.uploadedImages);
var socketData = {
@@ -327,8 +328,8 @@ var RDB = require('./redis.js'),
function uploadPostImages(postData, images, callback) {
var imgur = require('./imgur');
- imgur.setClientID(global.nconf.get('imgurClientID'));
-
+ imgur.setClientID(config.imgurClientID);
+
var uploadedImages = [];
function uploadImage(image, callback) {
@@ -341,6 +342,7 @@ var RDB = require('./redis.js'),
uploadedImages.push(img);
callback(null);
} else {
+ winston.error('Can\'t upload image, did you set imgurClientID?');
callback(data);
}
}
diff --git a/src/websockets.js b/src/websockets.js
index 1003e45a06..664215fc98 100644
--- a/src/websockets.js
+++ b/src/websockets.js
@@ -362,7 +362,7 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
});
return;
}
-
+
posts.reply(data.topic_id, uid, data.content, data.images, function(err, result) {
if(err) {
if(err.message === 'content-too-short') {