[Pkg-javascript-commits] [sockjs-client] 32/434: Start of the work on xhr polling transport

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:46:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit a5130696b7f97781bc0af244ba7f6524feee773b
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Mon Aug 1 11:44:31 2011 +0100

    Start of the work on xhr polling transport
---
 lib/trans-xhr.js | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/lib/trans-xhr.js b/lib/trans-xhr.js
new file mode 100644
index 0000000..453a9d7
--- /dev/null
+++ b/lib/trans-xhr.js
@@ -0,0 +1,24 @@
+
+
+var XhrTransport = SockJS.xhrpolling = function(ri, trans_url){
+    var that = this;
+    that.ri = ri;
+    that.trans_url = trans_url;
+    that.send_constructor(xhrSender);
+    that._schedule_recv();
+};
+
+XhrTransport.prototype = new BufferedSender();
+
+XhrTransport.prototype._schedule_recv = function() {
+    var that = this;
+};
+
+
+// According to:
+//   http://stackoverflow.com/questions/1641507/detect-browser-support-for-cross-domain-xmlhttprequests
+//   http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/
+XhrTransport.enabled = function() {
+    if ('XMLHttpRequest' in window) return false;
+    return ('withCredentials' in new XMLHttpRequest());
+};
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list