Skip to content

Node.js based forum software built for the modern web

fixed index of newly created posts, matched vanilla search form to lavender

Baris Soner Usakli6140d76f762a
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 564d964c13..dbb1aa3431 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -754,7 +754,6 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
}
socket.emit('topics.markAsRead', {tid: tid, uid: app.uid});
-
createNewPosts(data);
});
diff --git a/public/templates/composer.tpl b/public/templates/composer.tpl
index cf4c4bd83f..6d131019c5 100644
--- a/public/templates/composer.tpl
+++ b/public/templates/composer.tpl
@@ -39,12 +39,12 @@
</div>
</div>
- <div class="imagedrop"><div>Drag and Drop Images Here</div></div>
+ <div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
<div class="text-center">
<span>
- <small>Content is parsed with <a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a>. </small>
- <span class="upload-instructions hide"><small>Upload images by dragging & dropping them.</small></span>
+ <small>[[topic:composer.content_is_parsed_with]] <a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a>. </small>
+ <span class="upload-instructions hide"><small>[[topic:composer.upload_instructions]]</small></span>
</span>
</div>
diff --git a/public/templates/header.tpl b/public/templates/header.tpl
index 650097c4c8..aad9c657ab 100644
--- a/public/templates/header.tpl
+++ b/public/templates/header.tpl
@@ -79,7 +79,7 @@
<!-- ENDIF isAdmin -->
<li class="visible-xs">
- <a id="mobile-search-button" href="{relative_path}/search"><i class="fa fa-search" title="[[global:header.search]]"></i> [[global:header.search]]</a>
+ <a id="mobile-search-button" href="{relative_path}/search"><i class="fa fa-search fa-fw" title="[[global:header.search]]"></i> [[global:header.search]]</a>
</li>
<!-- BEGIN navigation -->
@@ -111,7 +111,7 @@
</ul>
</li>
<li class="visible-xs">
- <a href="{relative_path}/notifications"><i class="fa fa-exclamation-triangle" title="[[notifications:title]]"></i> [[notifications:title]]</a>
+ <a href="{relative_path}/notifications"><i class="fa fa-exclamation-triangle fa-fw" title="[[notifications:title]]"></i> [[notifications:title]]</a>
</li>
<li class="chats dropdown text-center hidden-xs">
@@ -170,20 +170,17 @@
</ul>
<ul id="logged-conditional-menu" class="nav navbar-nav navbar-right">
- <li class="hidden-xs">
- <form id="search-form" class="navbar-form navbar-right" role="search" method="GET" action="">
+ <li>
+ <form id="search-form" class="navbar-form navbar-right hidden-xs" role="search" method="GET" action="">
<div class="hide" id="search-fields">
<div class="form-group">
<input type="text" class="form-control" placeholder="[[global:search]]" name="query" value="">
</div>
<button type="submit" class="btn btn-default hide">[[global:search]]</button>
</div>
+ <button id="search-button" type="button" class="btn btn-link hide"><i class="fa fa-search fa-fw" title="[[global:header.search]]"></i></button>
</form>
</li>
-
- <li class="hidden-xs">
- <a href="#" id="search-button" class="hide"><i class="fa fa-search" title="[[global:header.search]]"></i></a>
- </li>
</ul>
<ul class="nav navbar-nav navbar-right pagination-block hide">
diff --git a/src/categories.js b/src/categories.js
index 82a190c345..09caa7d1f1 100644
--- a/src/categories.js
+++ b/src/categories.js
@@ -214,7 +214,11 @@ var db = require('./database'),
};
Categories.markAsUnreadForAll = function(cid, callback) {
- db.delete('cid:' + cid + ':read_by_uid', callback);
+ db.delete('cid:' + cid + ':read_by_uid', function(err) {
+ if(typeof callback === 'function') {
+ callback(err);
+ }
+ });
};
Categories.hasReadCategories = function(cids, uid, callback) {
diff --git a/src/topics.js b/src/topics.js
index 012a3208aa..f282b5ad4b 100644
--- a/src/topics.js
+++ b/src/topics.js
@@ -125,6 +125,7 @@ var async = require('async'),
Topics.reply = function(tid, uid, content, callback) {
var privileges;
+ var postData;
async.waterfall([
function(next) {
@@ -151,30 +152,29 @@ var async = require('async'),
posts.create(uid, tid, content, next);
},
- function(postData, next) {
-
+ function(data, next) {
+ postData = data;
threadTools.notifyFollowers(tid, postData.pid, uid);
user.sendPostNotificationToFollowers(uid, tid, postData.pid);
- next(null, postData);
+ next();
},
- function(postData, next) {
- Topics.markAsUnreadForAll(tid, function(err) {
- if(err) {
- return next(err);
- }
-
- Topics.markAsRead(tid, uid, function(err) {
- Topics.pushUnreadCount(null);
- next(err, postData);
- });
- });
+ function(next) {
+ Topics.markAsUnreadForAll(tid, next);
},
- function(postData, next) {
+ function(next) {
+ Topics.markAsRead(tid, uid, next);
+ },
+ function(next) {
+ Topics.pushUnreadCount();
posts.addUserInfoToPost(postData, next);
},
- function(postData, next) {
+ function(postData,next) {
+ posts.getPidIndex(postData.pid, next);
+ },
+ function(index, next) {
+ postData.index = index;
postData.favourited = false;
postData.votes = 0;
postData.display_moderator_tools = true;