diff --git a/public/src/app.js b/public/src/app.js index b8d2afd710..8139fbdad1 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -212,10 +212,10 @@ var socket, content.value = ''; }; app.post_topic = function(category_id) { - var title = document.getElementById('post_title'), - content = document.getElementById('post_content'); + var title = $('#post_title'), + content = $('#post_content'); - if (title.length < 5 || content.length < 5) { + if (title.val().length < 5 || content.val().length < 5) { app.alert({ title: 'Topic Post Failure', message: 'You need to write more dude.', @@ -227,15 +227,15 @@ var socket, } socket.emit('api:topics.post', { - 'title' : title.value, - 'content' : content.value, + 'title' : title.val(), + 'content' : content.val(), 'category_id' : category_id }); jQuery(post_window).slideUp(250); $(document.body).removeClass('composing'); - title.value = ''; - content.value = ''; + title.val(''); + content.val(''); }; app.edit_post = function(pid) { diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 9b8e203e36..cffea752ff 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -52,7 +52,7 @@ <!-- END main_posts --> <!-- BEGIN posts --> - <li class="row" data-pid="{posts.pid}" data-deleted="{posts.deleted}"> + <li class="row" data-pid="{posts.pid}" data-uid="{posts.uid}" data-deleted="{posts.deleted}"> <div class="span1 profile-image-block visible-desktop"> <!--<i class="icon-spinner icon-spin icon-2x pull-left"></i>--> <a href="/users/{posts.username}"> @@ -415,9 +415,11 @@ jQuery(div + ' .quote').click(function() { if (thread_state.locked !== '1') app.open_post_window('quote', "{topic_id}", "{topic_name}"); + + var pid = $(this).parents('li').attr('data-pid'); + + $('#post_content').val('> ' + $('#content_' + pid).html() + '\n'); - // this needs to be looked at, obviously. only single line quotes work well I think maybe replace all \r\n with > ? - document.getElementById('post_content').innerHTML = '> ' + document.getElementById('content_' + this.id.replace('quote_', '')).innerHTML; }); jQuery(div + ' .edit, ' + div + ' .delete').each(function() { diff --git a/src/templates.js b/src/templates.js index 8d04aacf6d..383a3b4213 100644 --- a/src/templates.js +++ b/src/templates.js @@ -31,7 +31,7 @@ var fs = require('fs'); loadTemplates([ 'header', 'footer', 'register', 'home', 'topic', 'account', 'friends', 'login', 'reset', 'reset_code', - '403', + '403', 'logout', 'admin/header', 'admin/footer', 'admin/index', 'emails/header', 'emails/footer', 'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext'