summaryrefslogtreecommitdiff
path: root/misc/upload.js
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-02-05 19:04:58 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-02-05 19:04:58 +0000
commitd38429248ee2cbaa442e396f251b1781acbc0d66 (patch)
treefb04fcaf6c118752902bc8d4a18ec763e3d9c4da /misc/upload.js
parentafde65151c2e3807f8879fd0fe2ecd1cdda9f050 (diff)
downloadbrdo-d38429248ee2cbaa442e396f251b1781acbc0d66.tar.gz
brdo-d38429248ee2cbaa442e396f251b1781acbc0d66.tar.bz2
- #47510: Show JavaScript alert when PHP errors occur
Diffstat (limited to 'misc/upload.js')
-rw-r--r--misc/upload.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/misc/upload.js b/misc/upload.js
index 9945803f6..dcf246dfb 100644
--- a/misc/upload.js
+++ b/misc/upload.js
@@ -54,9 +54,22 @@ jsUpload.prototype.onsubmit = function () {
*/
jsUpload.prototype.oncomplete = function (data) {
// Remove progressbar
- removeNode(this.progress);
+ removeNode(this.progress.element);
this.progress = null;
// Replace form and re-attach behaviour
$(this.wrapper).innerHTML = data;
uploadAutoAttach();
}
+
+/**
+ * Handler for the form redirection error.
+ */
+jsUpload.prototype.onerror = function (error) {
+ alert('An error occurred:\n\n'+ error);
+ // Remove progressbar
+ removeNode(this.progress.element);
+ this.progress = null;
+ // Undo hide
+ $(this.hide).style.position = 'static';
+ $(this.hide).style.left = '0px';
+}