Sha256: 48114fe1513a5178aa71c34c33aa0743de79ecc53ab29bf90bf27aae2499b59b

Contents?: true

Size: 667 Bytes

Versions: 11

Compression:

Stored size: 667 Bytes

Contents

//= require action_cable
//= require_self

(function() {
  this.RailsApp || (this.RailsApp = {});

  this.RailsApp.startActionCable = () => {
    // Already started
    if (RailsApp.cable) {
      return false;
    }

    const protocol =
      window.location.protocol.slice(0, 5) === "https" ? "wss" : "ws";

    if (window.location.port === "") {
      RailsApp.cable = ActionCable.createConsumer(
        `${protocol}://${window.location.hostname}/cable`
      );
    } else {
      RailsApp.cable = ActionCable.createConsumer(
        `${protocol}://${window.location.hostname}:${window.location.port}/cable`
      );
    }

    return true;
  };
}.call(this));

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
marty-14.3.0 app/assets/javascripts/marty/cable.js
marty-14.0.0 app/assets/javascripts/marty/cable.js
marty-13.0.2 app/assets/javascripts/marty/cable.js
marty-11.0.0 app/assets/javascripts/marty/cable.js
marty-10.0.3 app/assets/javascripts/marty/cable.js
marty-10.0.2 app/assets/javascripts/marty/cable.js
marty-10.0.0 app/assets/javascripts/marty/cable.js
marty-9.5.1 app/assets/javascripts/marty/cable.js
marty-9.5.0 app/assets/javascripts/marty/cable.js
marty-9.3.3 app/assets/javascripts/marty/cable.js
marty-9.3.2 app/assets/javascripts/marty/cable.js