From 5333869aac2dbd71c91727dbca6aee1a46b3cdb1 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Wed, 13 Jan 2010 00:21:23 +0100 Subject: Starting to work on the offline capabilities. --- bugzillaBugTriage.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bugzillaBugTriage.js') diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index 06af057..041ed05 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -1670,6 +1670,27 @@ var callback = function (doc) { var curPage = new BzPage(doc); }; +/* FIXME + - consider offline status + function newsubmit(event) { + var target = event ? event.target : this; + + // do anything you like here + alert('Submitting form to ' + target.action); + + // call real submit function + this._submit(); +} + +// capture the onsubmit event on all forms +window.addEventListener('submit', newsubmit, true); + +// If a script calls someForm.submit(), the onsubmit event does not fire, +// so we need to redefine the submit method of the HTMLFormElement class. +HTMLFormElement.prototype._submit = HTMLFormElement.prototype.submit; +HTMLFormElement.prototype.submit = newsubmit; + */ + var options = {}; options.matches = [ "https://bugzilla.redhat.com/show_bug.cgi" -- cgit