Sha256: a630fc698510a6e7348b12ea8106a49e1c41265a4d6a24ca0b8c715f8845020e

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

jQuery.ajaxSetup({
  'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")},
});

$(document).ajaxSend(function(event, request, settings) {
	if (typeof(AUTH_TOKEN) == "undefined") return;
	settings.data = settings.data || "";
	settings.data += (settings.data ? "&" : "") + "authenticity_token=" + encodeURIComponent(AUTH_TOKEN);
});
           

$(document).ready(function() {

  $('.table :checkbox.toggle').each(function(i, toggle) {
    $(toggle).change(function(e) {
      $(toggle).parents('table:first').find(':checkbox:not(.toggle)').each(function(j, checkbox) {
        checkbox.checked = !checkbox.checked;            
      })          
    });
  });

  $(".form input.delete").live("click", function () { 
    
    if (confirm('Are you sure?'))
    {
      var cbs = $("input:checkbox[name='ids[]']:checked");
      if (cbs.length > 0 )
      {
          $.post($("form.form").attr("action"), $("form.form").serialize(), null, "script");            
      }
      else
      {
          alert("At least choose one item!");
      }
    }
    return false;
  });

});



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
genkiwow-nitro-generator-0.0.2 generators/nitro_layout/templates/javascripts/application.js