Changeset 313
- Timestamp:
- 06/25/08 19:25:28 (8 weeks ago)
- Location:
- branches/0.5/daemon/orbited
- Files:
-
- 8 modified
-
config.py (modified) (1 diff)
-
static/BinaryTCPSocket.js (modified) (4 diffs)
-
static/TCPSocket.js (modified) (1 diff)
-
static/URL.js (modified) (1 diff)
-
static/WebSocket.js (modified) (1 diff)
-
static/demos/stomp/index.html (modified) (1 diff)
-
static/orbited.js (modified) (1 diff)
-
static/protocols/stomp/stomp.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.5/daemon/orbited/config.py
r311 r313 23 23 '[access]': [ 24 24 ], 25 '[static]': { 26 27 } 28 25 29 } 26 30 -
branches/0.5/daemon/orbited/static/BinaryTCPSocket.js
r308 r313 118 118 } 119 119 var encodeQs = function(o) { 120 output = ""120 var output = "" 121 121 for (key in o) 122 122 output += "&" + key + "=" + o[key] … … 693 693 694 694 // start @include(hex.js) 695 hexChars = '0123456789ABCDEF'696 697 hexToBase10 = { }698 base10ToHex = { }699 for (var i = 0; i < hexChars.length; ++i) {700 hexToBase10[hexChars[i]] = i701 base10ToHex[i] = hexChars[i]702 }703 704 695 hexToBytes = function(str) { 696 // str = str.toUpperCase() 705 697 if (str.length == 0) 706 698 return [] … … 709 701 var output = [] 710 702 for (var i =0; i < str.length; i+=2) { 711 var val = (hexToBase10[str[i]] << 4) + (hexToBase10[str[i+1]])712 output.push( val)703 target = str.charAt(i) + str.charAt(i+1) 704 output.push(parseInt(target, 16)) 713 705 } 714 706 return output … … 727 719 return output.join("") 728 720 } 729 /*730 bytesToHex = function(bytes) {731 var output = []732 for (var i = 0; i < bytes.length; ++i) {733 var byte = bytes[i]734 var hex1 = byte >> 4735 output.push(base10ToHex[hex1])736 output.push(base10ToHex[byte - (hex1 << 4)])737 }738 return output.join("")739 }740 */741 721 // end @include(hex.js) 742 722 -
branches/0.5/daemon/orbited/static/TCPSocket.js
r308 r313 118 118 } 119 119 var encodeQs = function(o) { 120 output = ""120 var output = "" 121 121 for (key in o) 122 122 output += "&" + key + "=" + o[key] -
branches/0.5/daemon/orbited/static/URL.js
r282 r313 103 103 } 104 104 var encodeQs = function(o) { 105 output = ""105 var output = "" 106 106 for (key in o) 107 107 output += "&" + key + "=" + o[key] -
branches/0.5/daemon/orbited/static/WebSocket.js
r302 r313 118 118 } 119 119 var encodeQs = function(o) { 120 output = ""120 var output = "" 121 121 for (key in o) 122 122 output += "&" + key + "=" + o[key] -
branches/0.5/daemon/orbited/static/demos/stomp/index.html
r308 r313 14 14 var output = document.getElementById('output') 15 15 var s = new Shell(output) 16 print = s.print16 shellprint = s.print 17 17 // ORBITED_PORT = 8000 18 18 stomp = new STOMPClient() 19 stomp.onmessage = function(msg) { print(msg.body) }19 stomp.onmessage = function(msg) { shellprint (msg.body) } 20 20 stomp.onerror = function(msg) { alert(msg.body) } 21 stomp.onopen = function() { print("Connected to ActiveMQ as user " + document.getElementById('username').value)}21 stomp.onopen = function() { shellprint ("Connected to ActiveMQ as user " + document.getElementById('username').value) } 22 22 } 23 23 </script> -
branches/0.5/daemon/orbited/static/orbited.js
r304 r313 117 117 } 118 118 var encodeQs = function(o) { 119 output = ""119 var output = "" 120 120 for (key in o) 121 121 output += "&" + key + "=" + o[key] -
branches/0.5/daemon/orbited/static/protocols/stomp/stomp.js
r308 r313 27 27 var parse_buffer = function () { 28 28 var msgs = self.buffer.split('\0\n') 29 self.buffer = msgs.splice(-1)[0] 30 31 for (i=0; i<msgs.length; i++) 29 self.buffer = msgs[msgs.length-1] 30 for (i=0; i<msgs.length-1; i++) 32 31 dispatch(msgs[i]) 33 32 } … … 113 112 buffer = "" // reset buffer state 114 113 self.user = user 115 116 114 var onsockopen = function() { 117 115 send_frame("CONNECT", [["login", user]])