From b9bbbc3ede58c173617ed07c0ae040816a270901 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Mon, 25 Jul 2011 10:59:19 +0100 Subject: [PATCH] [ticket/10291] AJAXified quick reply form. Also changed the show quick reply button to a button, not a submit - it was affecting the behaviour of phpbb.ajaxify. PHPBB3-10291 --- .../prosilver/template/quickreply_editor.html | 4 ++-- phpBB/styles/script.js | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/prosilver/template/quickreply_editor.html b/phpBB/styles/prosilver/template/quickreply_editor.html index f61cc49c0b..3eff2a2bd6 100644 --- a/phpBB/styles/prosilver/template/quickreply_editor.html +++ b/phpBB/styles/prosilver/template/quickreply_editor.html @@ -1,4 +1,4 @@ -
+

{L_QUICKREPLY}

@@ -15,7 +15,7 @@ {S_FORM_TOKEN} {QR_HIDDEN_FIELDS}   -   +  
diff --git a/phpBB/styles/script.js b/phpBB/styles/script.js index b73c392312..889db70f98 100644 --- a/phpBB/styles/script.js +++ b/phpBB/styles/script.js @@ -103,6 +103,11 @@ phpbb.ajaxify = function(options, refresh, callback) { $(selector).click(function() { var act, data, path, that = this; + if ($(this).data('ajax') == false) + { + return true; + } + function return_handler(res) { res = JSON.parse(res); @@ -157,7 +162,11 @@ phpbb.ajaxify = function(options, refresh, callback) { act = act[1] data += '&action=' + act; } - + else + { + data += '&' + this.name + '=' + this.value; + } + if (run_exception && options.exception($(this).parents('form'), act, data)) { return true; @@ -213,6 +222,10 @@ phpbb.add_ajax_callback('post_delete', function(el) { $(el).parents((act === 'approve') ? '.rules' : '.post').fadeOut(function() { $(this).remove(); }); +}).add_ajax_callback('qr-submit', function(el) { + $(el).parents('form').fadeOut(function() { + $(this).remove(); + }); });