
/* - ++resource++jquery.pyproxy.min.js - */
(function(a){a.pyproxy_form_to_dict=function(c){var b=a(c+" :input");var g={};for(i=0;i<b.length;i++){var d=b[i];var f=false;var e=String(d.name);if(a(d).hasClass("pyproxyIgnore")){continue}if(d.type=="radio"){if(d.checked){f=true}}else{if(d.type=="checkbox"){if(d.checked){if(!(e in g)){g[e]=[]}g[e][g[e].length]=a(d).val()}}else{f=true}}if(f){g[e]=a(d).val()}}return g};a.pyproxy_process_data=function(e,h,g){var f,b,d,c;for(d=0;d<e.length;d++){f=e[d];if(typeof(f.selector.__pyproxy_custom)!="undefined"&&f.selector.is_this){b=a(g)}else{b=a(f.selector)}do{c=b[f.call];b=c.apply(b,f.args);if(typeof(f.next)=="undefined"){break}f=f.next}while(true)}if(typeof(h)=="function"){h(e)}};a.pyproxy_call=function(c,d,f,e){var b="";if(typeof(d)=="undefined"){d={}}else{if(typeof(d)=="string"){b=d;d=a.pyproxy_form_to_dict(b)}else{if(typeof(d)=="function"){f=d;d={}}}}return a.ajax({type:"POST",url:c,data:d,success:function(g){a.pyproxy_process_data(g,f,e)},dataType:"json"})};a.fn.pyproxy=function(c,b,d,e){make_call=function(f){f.preventDefault();a.pyproxy_call(b,d,e,this)};return this.live(c,make_call)}})(jQuery);

