aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets/javascript
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-02-15 20:58:00 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-03-31 02:09:26 +0200
commit27199bb50954e22416e64154032e08801d0fbb6d (patch)
treedf63559b61f9b80f7d61c12d1b02926962dfaaa2 /phpBB/assets/javascript
parent2f25173d931d00b31087913b1772b51f12623690 (diff)
downloadforums-27199bb50954e22416e64154032e08801d0fbb6d.tar
forums-27199bb50954e22416e64154032e08801d0fbb6d.tar.gz
forums-27199bb50954e22416e64154032e08801d0fbb6d.tar.bz2
forums-27199bb50954e22416e64154032e08801d0fbb6d.tar.xz
forums-27199bb50954e22416e64154032e08801d0fbb6d.zip
[feature/ajax] Generic error handling with a phpbb.alert box
PHPBB3-10270
Diffstat (limited to 'phpBB/assets/javascript')
-rw-r--r--phpBB/assets/javascript/core.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 488b095b47..1faec27316 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -324,12 +324,28 @@ phpbb.ajaxify = function(options) {
{
phpbb.loading_alert();
data = $('<form>' + res.S_HIDDEN_FIELDS + '</form>').serialize();
- $.post(res.S_CONFIRM_ACTION, data + '&confirm=' + res.YES_VALUE, return_handler);
+ $.ajax({
+ url: res.S_CONFIRM_ACTION,
+ type: 'POST',
+ data: data + '&confirm=' + res.YES_VALUE,
+ success: return_handler
+ });
}
}, false);
}
}
+ function error_handler()
+ {
+ var alert;
+
+ alert = phpbb.alert(dark.attr('data-ajax-error-title'), dark.attr('data-ajax-error-text'));
+
+ dark.fadeOut(phpbb.alert_time, function() {
+ alert.hide();
+ });
+ }
+
// If the element is a form, POST must be used and some extra data must
// be taken from the form.
var run_filter = (typeof options.filter === 'function');