Skip to content

Node.js based forum software built for the modern web

fixed conflicts

Baris Usaklice61138351f4
diff --cc public/templates/topic.tpl
index 3cd470c361,a39d1967f2..6eff22f5ee
--- a/public/templates/topic.tpl
+++ b/public/templates/topic.tpl
@@@ -56,8 -56,13 +56,8 @@@
</div>
<div id="content_{main_posts.pid}" class="post-content">{main_posts.content}</div>
- <div id="images_{main_posts.pid}" class="post-images">
- <!-- BEGIN uploadedImages -->
- <i class="icon-picture icon-1"></i><a href="{main_posts.uploadedImages.url}"> {main_posts.uploadedImages.name}</a><br/>
- <!-- END uploadedImages -->
- </div>
<div class="post-signature">{main_posts.signature}</div>
- <div class="profile-block">
+ <div class="post-info">
<span class="pull-right">
posted <span class="relativeTimeAgo">{main_posts.relativeTime} ago</span>
<span class="{main_posts.edited-class}">| last edited by <strong><a href="/users/{main_posts.editorslug}">{main_posts.editorname}</a></strong> {main_posts.relativeEditTime} ago</span>
@@@ -111,8 -116,13 +111,8 @@@
</div>
<div id="content_{posts.pid}" class="post-content">{posts.content}</div>
- <div id="images_{posts.pid}" class="post-images">
- <!-- BEGIN uploadedImages -->
- <i class="icon-picture icon-1"></i><a href="{posts.uploadedImages.url}"> {posts.uploadedImages.name}</a><br/>
- <!-- END uploadedImages -->
- </div>
<div class="post-signature">{posts.signature}</div>
- <div class="profile-block">
+ <div class="post-info">
<span class="pull-right">
posted <span class="relativeTimeAgo">{posts.relativeTime} ago</span>
<span class="{posts.edited-class}">| last edited by <strong><a href="/users/{posts.editorslug}">{posts.editorname}</a></strong> {posts.relativeEditTime} ago</span>
diff --cc src/postTools.js
index f8d89887fb,78e64621fd..c88ca4405b
--- a/src/postTools.js
+++ b/src/postTools.js
@@@ -56,8 -56,8 +56,9 @@@ var RDB = require('./redis.js')
});
}
- PostTools.edit = function(uid, pid, title, content, images) {
- var success = function() {
++
+ PostTools.edit = function(uid, pid, title, content) {
+ var success = function() {
posts.setPostField(pid, 'content', content);
posts.setPostField(pid, 'edited', Date.now());
posts.setPostField(pid, 'editor', uid);
@@@ -85,12 -93,12 +89,12 @@@
PostTools.toHTML(content, next);
}
], function(err, results) {
- console.log("TEEEST");
- io.sockets. in ('topic_' + results[1].tid).emit('event:post_edited', {
+ io.sockets.in('topic_' + results[0].tid).emit('event:post_edited', {
pid: pid,
title: title,
- isMainPost: results[1].isMainPost,
- content: results[2],
- uploadedImages: results[0]
+ isMainPost: results[0].isMainPost,
+ content: results[1]
++
});
});
};
diff --cc src/topics.js
index a92f8dd444,8cb5acaf49..891595c977
--- a/src/topics.js
+++ b/src/topics.js
@@@ -596,15 -605,15 +605,15 @@@ schema = require('./schema.js')
Topics.emitTitleTooShortAlert = function(socket) {
socket.emit('event:alert', {
- type: 'danger',
- timeout: 2000,
- title: 'Title too short',
- message: "Please enter a longer title. At least " + meta.config.minimumTitleLength + " characters.",
- alert_id: 'post_error'
- });
+ type: 'danger',
+ timeout: 2000,
+ title: 'Title too short',
+ message: "Please enter a longer title. At least " + meta.config.minimumTitleLength + " characters.",
+ alert_id: 'post_error'
+ });
}
- Topics.post = function(uid, title, content, category_id, images, callback) {
+ Topics.post = function(uid, title, content, category_id, callback) {
if (!category_id)
throw new Error('Attempted to post without a category_id');
diff --cc src/websockets.js
index c365e416bc,c67046cb28..10bcc67736
--- a/src/websockets.js
+++ b/src/websockets.js
@@@ -379,13 -388,13 +388,13 @@@ var SocketIO = require('socket.io').lis
return;
}
- posts.reply(data.topic_id, uid, data.content, data.images, function(err, result) {
- if (err) {
- if (err.message === 'content-too-short') {
+ posts.reply(data.topic_id, uid, data.content, function(err, result) {
+ if(err) {
+ if(err.message === 'content-too-short') {
posts.emitContentTooShortAlert(socket);
- } else if(err.message === 'too-many-posts') {
+ } else if (err.message === 'too-many-posts') {
posts.emitTooManyPostsAlert(socket);
- } else if(err.message === 'reply-error') {
+ } else if (err.message === 'reply-error') {
socket.emit('event:alert', {
title: 'Reply Unsuccessful',
message: 'Your reply could not be posted at this time. Please try again later.',
@@@ -477,13 -486,11 +486,15 @@@
});
});
+ socket.on('api:posts.uploadImage', function(data, callback) {
+ posts.uploadPostImage(data, callback);
+ });
+
socket.on('api:posts.getRawPost', function(data) {
posts.getPostField(data.pid, 'content', function(raw) {
- socket.emit('api:posts.getRawPost', { post: raw });
+ socket.emit('api:posts.getRawPost', {
+ post: raw
+ });
});
});