Sha256: 563294fa70de6f0902ac04b13c5d8b89980d8b6446340b54da8e5df9a635b4c5
Contents?: true
Size: 831 Bytes
Versions: 13
Compression:
Stored size: 831 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 }); } return $.extend({ dataType: 'json', cache: false, success : $.ajaxWithJelly.onSuccess }, otherParams); }; $.ajaxWithJelly.onSuccess = function(json) { Jelly.notifyObservers(json); return true; }; })(jQuery);
Version data entries
13 entries across 13 versions & 3 rubygems