Sha256: 9d3c7d6e54121de45c173da11ec14b754fb9639d5641997db9f074ced4b854db

Contents?: true

Size: 853 Bytes

Versions: 13

Compression:

Stored size: 853 Bytes

Contents

if(!window.Jelly) Jelly = new Object();

(Jelly.defineAjaxWithJellyFunctions = function($) {
  $.ajaxWithJelly = function(params) {
    $.ajax($.ajaxWithJelly.params(params));
  };

  if ($.fn.ajaxForm) {
    $.fn.ajaxFormWithJelly = function(params) {
      this.ajaxForm($.ajaxWithJelly.params(params));
    };
  }

  $.ajaxWithJelly.params = function(otherParams) {
    otherParams = otherParams || {};

    if (otherParams.type && otherParams.type != "GET") {
      otherParams['data'] = $.extend(otherParams['data'], {
        authenticity_token: window._token
      });
    }
    var observers = otherParams.observers || Jelly.observers;
    return $.extend({
      dataType: 'json',
      cache: false,
      success : function(callbacks) {
        Jelly.Observers.notify.call(observers, callbacks);
      }
    }, otherParams);
  };
})(jQuery);

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
jelly-0.8.10 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.13 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.12 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.11 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.10 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.9 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.8 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.7 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.6 generators/jelly/templates/javascripts/ajax_with_jelly.js
btakita-jelly-0.8.5 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.4 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.3 generators/jelly/templates/javascripts/ajax_with_jelly.js
honkster-jelly-0.8.2 generators/jelly/templates/javascripts/ajax_with_jelly.js