Sha256: 863e22314cf4de73711ec6f917c99911e338b0f9e5d167fd791faa7832ee33fa

Contents?: true

Size: 825 Bytes

Versions: 10

Compression:

Stored size: 825 Bytes

Contents

<% unless @_vanity_experiments.empty? %>
  var httpRequest;
  <%
    @_vanity_experiments.each do |name, alternative| 
  %>
    var params = "e=<%= name %>&a=<%= alternative.id %>&authenticity_token=" + encodeURIComponent("<%= form_authenticity_token %>");
    if (window.XMLHttpRequest) { // Mozilla, Safari, ...
      httpRequest = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE
      try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); }
      catch (e) { }
    }
    if (httpRequest) {
      httpRequest.open('POST', "<%= Vanity.playground.add_participant_path %>", true);
      httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      httpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
      httpRequest.send(params);
    }
  <% end %>
<% end %>

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
lookout-vanity-1.8.2 lib/vanity/templates/_vanity.js.erb
moses-vanity-1.8.1 lib/vanity/templates/_vanity.js.erb
moses-vanity-1.8.0 lib/vanity/templates/_vanity.js.erb
vanity-1.8.0 lib/vanity/templates/_vanity.js.erb
moses-vanity-1.7.1 lib/vanity/templates/_vanity.js.erb
fiverr-vanity-1.7.2 lib/vanity/templates/_vanity.js.erb
vanity-1.7.1 lib/vanity/templates/_vanity.js.erb
vanity-1.7.0 lib/vanity/templates/_vanity.js.erb
vanity-1.6.1 lib/vanity/templates/_vanity.js.erb
vanity-1.6.0 lib/vanity/templates/_vanity.js.erb