aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorCallum Macrae <callum@lynxphp.com>2011-07-25 10:59:19 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-03-31 02:09:12 +0200
commitb9bbbc3ede58c173617ed07c0ae040816a270901 (patch)
tree4045b88c2765a3febca55eb8592cb53ef3188c7d /phpBB
parent57fa45b0c43ba732886ada24dbd6a590fd55d717 (diff)
downloadforums-b9bbbc3ede58c173617ed07c0ae040816a270901.tar
forums-b9bbbc3ede58c173617ed07c0ae040816a270901.tar.gz
forums-b9bbbc3ede58c173617ed07c0ae040816a270901.tar.bz2
forums-b9bbbc3ede58c173617ed07c0ae040816a270901.tar.xz
forums-b9bbbc3ede58c173617ed07c0ae040816a270901.zip
[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
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/styles/prosilver/template/quickreply_editor.html4
-rw-r--r--phpBB/styles/script.js15
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 @@
-<form method="post" action="{U_QR_ACTION}">
+<form method="post" action="{U_QR_ACTION}" data-ajax="qr-submit" data-refresh="true">
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<h2>{L_QUICKREPLY}</h2>
@@ -15,7 +15,7 @@
{S_FORM_TOKEN}
{QR_HIDDEN_FIELDS}
<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
- <input type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" class="button2" />&nbsp;
+ <input type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" class="button2" data-ajax="false" />&nbsp;
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>
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();
+ });
});