diff --git a/public/src/app.js b/public/src/app.js index 9068042fa4..bcdb98540d 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -245,12 +245,24 @@ var socket, }; app.edit_post = function(pid) { - var content = document.getElementById('post_content'); - socket.emit('api:posts.edit', { pid: pid, content: content.value }); + var content = $('#post_content'); + + if (content.val().length < 5) { + app.alert({ + title: 'Topic Post Failure', + message: 'You need to write more dude.', + type: 'error', + timeout: 2000 + }); + + return; + } + + socket.emit('api:posts.edit', { pid: pid, content: content.val() }); jQuery(post_window).slideUp(250); $(document.body).removeClass('composing'); - content.value = ''; + content.val(''); } diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 4ac89dcfdc..091fac6c54 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -57,7 +57,7 @@ - {posts.user_rep} + {posts.user_rep}
@@ -124,12 +124,16 @@ pinned: '{pinned}' }; - jQuery('document').ready(function() { - - $('.user_reputation_text').each(function(index, element) { + function addCommasToNumbers() { + $('.formatted-number').each(function(index, element) { $(element).html(app.addCommas($(element).html())); }); + } + + jQuery('document').ready(function() { + addCommasToNumbers(); + var room = 'topic_' + '{topic_id}', adminTools = document.getElementById('thread-tools');