Sha256: 67bcdfb552ca11e4e082ea5385666e3efd59aac88c2008c303cee2d4c7358ff7

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

$(document).ready(function(){

  // Use fancy box on all images that link to an image
  // $("a[href$=jpg], a[href$=png], a[href$=gif]").fancybox({  
  //     'zoomOpacity'     : true,
  //     'overlayShow'     : true,
  //     'zoomSpeedIn'     : 500,
  //     'zoomSpeedOut'      : 500,
  //     'overlayOpacity'    : 0.9
  // });
  
  $("a[href^=http]").attr('target', '_blank');
  
});

// Set a form to send vie ajax and remove current errors
// usage:
//   ajaxifyForms('#new_subscriber')
function ajaxifyForms(selector) {
  $(selector).submit(function() {
    $(this).find('#errorExplanation, .success').slideUp('fast', function() { $(this).remove();});
    $.post($(this).attr('action'), $(this).serialize(), null, 'script' );
    return false; 
  }); 
}

// Set value in the field which is removed on submit
// usage:
//   labelInputValue('input#subscriber_email', 'Enter your email...')
function labelInputValue(selector, label) {
  $(selector + ':input:not([value])').val(label); 

  $(selector + ':input').closest('form').submit(function() {
    if ($(selector + ':input').val() == label)
      $(selector + ':input').val('');
    return true;
  });
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
beef-layout-0.2.0 generators/layout_files/templates/public/javascripts/application.js
beef-layout-0.2.4 generators/layout_files/templates/public/javascripts/application.js
beef-layout-0.2.2 generators/layout_files/templates/public/javascripts/application.js