Sha256: c07358eee1f4963bd151c09b7c4846721f610971f416a4a70cba8f32858e3e6a

Contents?: true

Size: 772 Bytes

Versions: 62

Compression:

Stored size: 772 Bytes

Contents

sp_to_sockio = {}

function if_sockio_init(url, sp) {
  sp_to_sockio[sp] = io(url, {
    "forceNew": true
  });
}

function if_sockio_fwd(sp, event_name, bp) {
  //Grab socket
  var socket = sp_to_sockio[sp];

  if (socket) {
    //Forward events
    socket.on(event_name, function(info) {
      int_dispatch([3, "int_event", bp, event_name, info]);
    });
  } else {
    <% if @debug %>
      console.error("Couldnt fwd sockio with sp: " + sp + " (It dspn't exist)");
    <% end %>
  }
}

function if_sockio_send(sp, event_name, info) {
  //Grab socket
  var socket = sp_to_sockio[sp];

  if (socket) {
    socket.emit(event_name, info);
  } else {
    <% if @debug %>
      console.error("Couldnt fwd sockio with sp: " + sp + " (It dspn't exist)");
    <% end %>
  }
}

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
flok-0.0.62 app/drivers/CHROME/src/sockio.js
flok-0.0.61 app/drivers/CHROME/src/sockio.js
flok-0.0.60 app/drivers/CHROME/src/sockio.js
flok-0.0.57 app/drivers/CHROME/src/sockio.js
flok-0.0.56 app/drivers/CHROME/src/sockio.js
flok-0.0.55 app/drivers/CHROME/src/sockio.js
flok-0.0.54 app/drivers/CHROME/src/sockio.js
flok-0.0.53 app/drivers/CHROME/src/sockio.js
flok-0.0.52 app/drivers/CHROME/src/sockio.js
flok-0.0.51 app/drivers/CHROME/src/sockio.js
flok-0.0.50 app/drivers/CHROME/src/sockio.js
flok-0.0.49 app/drivers/chrome/src/sockio.js
flok-0.0.48 app/drivers/chrome/src/sockio.js
flok-0.0.47 app/drivers/chrome/src/sockio.js
flok-0.0.45 app/drivers/chrome/src/sockio.js
flok-0.0.44 app/drivers/chrome/src/sockio.js
flok-0.0.43 app/drivers/chrome/src/sockio.js
flok-0.0.42 app/drivers/chrome/src/sockio.js
flok-0.0.41 app/drivers/chrome/src/sockio.js
flok-0.0.40 app/drivers/chrome/src/sockio.js