Changeset 313

Show
Ignore:
Timestamp:
06/25/08 19:25:28 (8 weeks ago)
Author:
heyadayo
Message:

Fixed STOMP for IE

Location:
branches/0.5/daemon/orbited
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • branches/0.5/daemon/orbited/config.py

    r311 r313  
    2323    '[access]': [ 
    2424    ], 
     25    '[static]': { 
     26     
     27    } 
     28     
    2529} 
    2630 
  • branches/0.5/daemon/orbited/static/BinaryTCPSocket.js

    r308 r313  
    118118    } 
    119119    var encodeQs = function(o) { 
    120             output = "" 
     120            var output = "" 
    121121            for (key in o) 
    122122                output += "&" + key + "=" + o[key] 
     
    693693 
    694694// 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]] = i 
    701     base10ToHex[i] = hexChars[i] 
    702 } 
    703  
    704695hexToBytes = function(str) { 
     696//  str = str.toUpperCase() 
    705697    if (str.length == 0) 
    706698        return [] 
     
    709701    var output = [] 
    710702    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)) 
    713705    } 
    714706    return output 
     
    727719    return output.join("") 
    728720} 
    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 >> 4 
    735         output.push(base10ToHex[hex1]) 
    736         output.push(base10ToHex[byte - (hex1 << 4)]) 
    737     } 
    738     return output.join("") 
    739 } 
    740 */ 
    741721// end @include(hex.js) 
    742722 
  • branches/0.5/daemon/orbited/static/TCPSocket.js

    r308 r313  
    118118    } 
    119119    var encodeQs = function(o) { 
    120             output = "" 
     120            var output = "" 
    121121            for (key in o) 
    122122                output += "&" + key + "=" + o[key] 
  • branches/0.5/daemon/orbited/static/URL.js

    r282 r313  
    103103    } 
    104104    var encodeQs = function(o) { 
    105             output = "" 
     105            var output = "" 
    106106            for (key in o) 
    107107                output += "&" + key + "=" + o[key] 
  • branches/0.5/daemon/orbited/static/WebSocket.js

    r302 r313  
    118118    } 
    119119    var encodeQs = function(o) { 
    120             output = "" 
     120            var output = "" 
    121121            for (key in o) 
    122122                output += "&" + key + "=" + o[key] 
  • branches/0.5/daemon/orbited/static/demos/stomp/index.html

    r308 r313  
    1414            var output = document.getElementById('output') 
    1515            var s = new Shell(output) 
    16             print = s.print 
     16            shellprint = s.print 
    1717//            ORBITED_PORT = 8000 
    1818            stomp = new STOMPClient() 
    19             stomp.onmessage = function(msg) { print(msg.body) } 
     19            stomp.onmessage = function(msg) { shellprint (msg.body) } 
    2020            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) } 
    2222        } 
    2323    </script> 
  • branches/0.5/daemon/orbited/static/orbited.js

    r304 r313  
    117117    } 
    118118    var encodeQs = function(o) { 
    119             output = "" 
     119            var output = "" 
    120120            for (key in o) 
    121121                output += "&" + key + "=" + o[key] 
  • branches/0.5/daemon/orbited/static/protocols/stomp/stomp.js

    r308 r313  
    2727    var parse_buffer = function () { 
    2828        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++) 
    3231            dispatch(msgs[i]) 
    3332    } 
     
    113112        buffer = ""                     // reset buffer state 
    114113        self.user = user 
    115          
    116114        var onsockopen = function() { 
    117115            send_frame("CONNECT", [["login", user]])