From bc8ba5d490aff67ed1ff8b036602a6f09fa8438b Mon Sep 17 00:00:00 2001 From: stan Date: Fri, 3 Apr 2009 12:07:45 +0000 Subject: [PATCH] Changed extentsion of Request to mootools v1.2 format git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2842 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/js/mootools.ext.js | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/web/js/mootools.ext.js b/web/js/mootools.ext.js index 27ff914d7..16798e872 100644 --- a/web/js/mootools.ext.js +++ b/web/js/mootools.ext.js @@ -23,34 +23,29 @@ else /* * Ajax class extenstion to allow for request timeouts */ - Request = Request.extend({ - request: function( data ) + Request.implement({ + send: function( data ) { if ( this.options.timeout ) { if ( this.timeoutTimer ) - { this.removeTimer(); - } - this.timeoutTimer = window.setTimeout( this.callTimeout.bindAsEventListener(this), this.options.timeout ); + this.timeoutTimer = this.timedOut.delay( this.options.timeout, this ); this.addEvent( 'onComplete', this.removeTimer ); } - this.parent( data ); + var sender = this.get('send'); + sender.send( data ); + return( this ); }, - - callTimeout: function () + timedOut: function () { - this.transport.abort(); - this.onFailure(); if ( this.options.onTimeout ) - { this.options.onTimeout(); - } + this.cancel(); }, - removeTimer: function() { - window.clearTimeout( this.timeoutTimer ); + $clear( this.timeoutTimer ); this.timeoutTimer = 0; } });