[Xmpp4js-commit] SF.net SVN: xmpp4js:[760] trunk/src/main/javascript
Status: Beta
Brought to you by:
h-iverson
|
From: <h-i...@us...> - 2008-07-28 16:08:45
|
Revision: 760
http://xmpp4js.svn.sourceforge.net/xmpp4js/?rev=760&view=rev
Author: h-iverson
Date: 2008-07-28 16:08:54 +0000 (Mon, 28 Jul 2008)
Log Message:
-----------
added beforepause event to transports and connection
Modified Paths:
--------------
trunk/src/main/javascript/XmppConnection.js
trunk/src/main/javascript/transport/Base.js
trunk/src/main/javascript/transport/Script.js
Modified: trunk/src/main/javascript/XmppConnection.js
===================================================================
--- trunk/src/main/javascript/XmppConnection.js 2008-07-28 14:52:17 UTC (rev 759)
+++ trunk/src/main/javascript/XmppConnection.js 2008-07-28 16:08:54 UTC (rev 760)
@@ -117,6 +117,7 @@
streamerror: this.onStreamError,
beginsession: this.onBeginSession,
endsession: this.onEndSession,
+ beforepause: this.onBeforePause,
pause: this.onPause,
resume: this.onResume
// recv will be added in beginSession.
@@ -276,6 +277,10 @@
this.fireEvent( "close" );
},
+ onBeforePause: function(time) {
+ this.fireEvent( "beforepause", time );
+ },
+
/**
* Event handler for when the transport session is paused. Bubbles the event
* through to listeners on this connection.
Modified: trunk/src/main/javascript/transport/Base.js
===================================================================
--- trunk/src/main/javascript/transport/Base.js 2008-07-28 14:52:17 UTC (rev 759)
+++ trunk/src/main/javascript/transport/Base.js 2008-07-28 16:08:54 UTC (rev 760)
@@ -207,6 +207,8 @@
*/
endsession: true,
+ beforepause: true,
+
pause: true,
resume: true
@@ -236,8 +238,8 @@
packetNode.setAttribute( "xml:lang", "en");
packetNode.setAttribute( "xmlns:xmpp", "urn:xmpp:xbosh");
packetNode.setAttribute( "xmpp:version", "1.0" );
+
-
this.on("recv", this.onBeginSessionResponse, this, {single:true});
this.write( packetNode );
@@ -503,6 +505,8 @@
pause: function(time) {
;;; Xmpp4Js.Transport.Base.logger.info( "Pausing session." );
+
+ this.fireEvent( "beforepause", time );
var pauseNode = this.createPacketNode();
pauseNode.setAttribute( "pause", time );
Modified: trunk/src/main/javascript/transport/Script.js
===================================================================
--- trunk/src/main/javascript/transport/Script.js 2008-07-28 14:52:17 UTC (rev 759)
+++ trunk/src/main/javascript/transport/Script.js 2008-07-28 16:08:54 UTC (rev 760)
@@ -94,9 +94,10 @@
* @param {DomElement} packetNode
*/
write: function(packetNode) {
-;;; Xmpp4Js.Transport.Script.logger.debug( "Writing packet." );
+
this.prepareWrite( packetNode );
-
+;;; Xmpp4Js.Transport.Script.logger.debug( "Writing packet. rid="+packetNode.getAttribute("rid") );
+
var xml = packetNode.toString();
// TODO check for max length constraints in browsers
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|