// N2O CORE var active = false, debug = true, session = "site-sid", protocol = window.location.protocol == 'https:' ? "wss://" : "ws://", querystring = window.location.pathname + window.location.search, host = null == transition.host ? window.location.hostname : transition.host, port = null == transition.port ? window.location.port : transition.port; function N2O_start() { var s = protocol + host + (port==""?"":":"+port) + querystring; ws = new bullet(s); ws.onmessage = function (evt) { // formatters loop for (var i=0;i 0 || evt.data.size > 0)) { var r = new FileReader(); r.addEventListener("loadend", function() { try { erlang = dec(r.result); if (debug) console.log(JSON.stringify(erlang)); if (typeof cb == 'function') cb(erlang); for (var i=0;i<$bert.protos.length;i++) { p = $bert.protos[i]; if (p.on(erlang, p.do).status == "ok") return; } } catch (e) { console.log(e); } }); r.readAsArrayBuffer(evt.data); return { status: "ok" }; } else return { status: "error", desc: "data" }; } var protos = [ $bert ];