Файл: public/assets/js/ajax/ajax_form.js
Строк: 48
<?php
function number_format(a,b,d,c){var e,f,g;isNaN(b=Math.abs(b))&&(b=2);void 0==d&&(d=",");void 0==c&&(c=".");e=parseInt(a=(+a||0).toFixed(b))+"";g=(f=3<(f=e.length)?f%3:0)?e.substr(0,f)+c:"";c=e.substr(f).replace(/(d{3})(?=d)/g,"$1"+c);a=b?d+Math.abs(a-e).toFixed(b).replace(/-/,0).slice(2):"";return g+c+a}
function bytes(a){return 1024>a?a+" b":1024>(kb=a/1024)?number_format(kb,1)+" Kb":1024>(mb=kb/1024)?number_format(mb,2)+" Mb":1024>(gb=mb/1024)?number_format(gb,2)+" Gb":number_format(gb/1024,2)+"Tb"}
$(document).ready(function(){if(exists("form[rel]"))return!0;$(document).on("submit","form",function(b){b.preventDefault();var f = $('form > input[type="submit"]').get(0); $(f).attr("value","u041fu043eu0434u043eu0436u0434u0438u0442u0435...");b=$(this);var c=new FormData(b.get(0));$.ajax({url:$(b).attr("action"),type:$(b).attr("method"),contentType:!1,processData:!1,data:c,xhr:function(){var a=new XMLHttpRequest;if(!exists('form > input[name="file"]'))return a;a.upload.addEventListener("progress",
function(a){a.lengthComputable&&(a=Math.ceil(a.loaded/a.total*100),$("#progressbar").css("display","block"),$("#progressbar > span").css("width",a+"%"))},!1);return a},success:function(a){$("body").html(a);document.title=$("#box_loader").attr("data-title");$(document).scrollTop(0)},error:function(a){errorMsg[a.status]&&alert("u041eu0448u0438u0431u043au0430 "+a.status+": "+errorMsg[a.status])}});return!1})});
?>