From 6a5ebdb1ef1a4d9f946b379cb15654e233fdb0db Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 29 Aug 2013 05:06:22 +0800 Subject: [PATCH 1/2] fixed edit/delete/favourite buttons not working on subposts / topics --- public/src/forum/topic.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 0b39c690de..500cab3e84 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -207,7 +207,7 @@ } }); - $('.post-container').on('click', '.deleted', function(ev) { + $('#post-container').on('click', '.deleted', function(ev) { $(this).toggleClass('deleted-expanded'); }); }); @@ -227,10 +227,10 @@ }); } }; - $('.post-container').on('click', '.post_reply', reply_fn); + $('#post-container').on('click', '.post_reply', reply_fn); $('#post_reply').on('click', reply_fn); - $('.post-container').on('click', '.quote', function() { + $('#post-container').on('click', '.quote', function() { if (thread_state.locked !== '1') { var pid = $(this).parents('li').attr('data-pid'); @@ -245,7 +245,7 @@ } }); - $('.post-container').on('click', '.favourite', function() { + $('#post-container').on('click', '.favourite', function() { var pid = $(this).parents('li').attr('data-pid'); var uid = $(this).parents('li').attr('data-uid'); @@ -258,7 +258,7 @@ } }); - $('.post-container').delegate('.edit', 'click', function(e) { + $('#post-container').delegate('.edit', 'click', function(e) { var pid = $(this).parents('li').attr('data-pid'), main = $(this).parents('.main-post'); @@ -267,7 +267,7 @@ }); }); - $('.post-container').delegate('.delete', 'click', function(e) { + $('#post-container').delegate('.delete', 'click', function(e) { var pid = $(this).parents('li').attr('data-pid'), postEl = $(document.querySelector('#post-container li[data-pid="' + pid + '"]')), deleteAction = !postEl.hasClass('deleted') ? true : false, @@ -487,7 +487,7 @@ function set_delete_state(deleted) { var deleteThreadEl = document.getElementById('delete_thread'), deleteTextEl = deleteThreadEl.getElementsByTagName('span')[0], - threadEl = document.querySelector('.post-container'), + threadEl = document.querySelector('#post-container'), deleteNotice = document.getElementById('thread-deleted') || document.createElement('div'); if (deleted) { From a69140faa9980c8e10b8b457598540ddb6a3826f Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Wed, 28 Aug 2013 17:22:48 -0400 Subject: [PATCH 2/2] show error message on failed login --- public/src/forum/login.js | 7 ++++++- public/templates/login.tpl | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/src/forum/login.js b/public/src/forum/login.js index 74bedd54ba..7b475c566b 100644 --- a/public/src/forum/login.js +++ b/public/src/forum/login.js @@ -27,7 +27,7 @@ data: loginData, success: function(data, textStatus, jqXHR) { if(!data.success) { - $('#login-error-notify').html(data.message).show(); + $('#login-error-notify').show(); } else { $('#login-error-notify').hide(); window.location.replace(RELATIVE_PATH + "/?loggedin"); @@ -44,5 +44,10 @@ return false; }); + $('#login-error-notify button').on('click', function() { + $('#login-error-notify').hide(); + return false; + }); + document.querySelector('#content input').focus(); }()); diff --git a/public/templates/login.tpl b/public/templates/login.tpl index e8e85b9235..4298194ee5 100644 --- a/public/templates/login.tpl +++ b/public/templates/login.tpl @@ -11,7 +11,7 @@
- - -
Invalid username/password
+