//HİSTORY------------------- var htr = new Array(); window.jsPDF = window.jspdf.jsPDF; function addHistory(_data){ htr.push(_data); } function removeHistory(){ htr.pop(); } function clearHistory(){ htr = new Array(); } function getHistory(){ if(htr.length>1){ url = htr[htr.length-2] return url; }else{ return "" } } //HİSTORY------------------- //BOARCODE FOCUS------------- var base_focus = null var active_focus = null var focus_timeout = null function focus_set(_base, _active){ focus_remove() if (_base!=null){ base_focus = $("#"+_base) } if (_active!=null){ active_focus = $("#"+_active) }else{ active_focus = null } focus_element() } function focus_element(){ focus_reset() if (active_focus!=null){ active_focus.val('') active_focus.focus() active_focus.on("blur", function() { clearTimeout(focus_timeout); focus_timeout = setTimeout(function() { focus_element() }, 2000); }) $("input").not(active_focus).on( "keypress", function() { clearTimeout(focus_timeout); focus_timeout = setTimeout(function() { focus_element() }, 2000); }); }else if(base_focus!=null){ base_focus.val('') base_focus.focus() base_focus.on("blur", function() { clearTimeout(focus_timeout); focus_timeout = setTimeout(function() { focus_element() }, 2000); }) $("input").not(base_focus).on( "keypress", function() { clearTimeout(focus_timeout); focus_timeout = setTimeout(function() { focus_element() }, 2000); }); } } function focus_remove(){ focus_reset() active_focus = null } function focus_reset(){ clearTimeout(focus_timeout) if (active_focus != null){ active_focus.off('blur') } if (base_focus != null){ base_focus.off('blur') } $("input").off('keypress') } //BOARCODE FOCUS------------- function show_file(_bt, _title, _name, _path) { var l = Ladda.create(_bt); l.start(); $.ajax({ method: "POST", url: "/user/file/show/", contentType: "application/json; charset=utf-8", data: JSON.stringify({ title: _title, name: _name, path: _path }) }).done(function( data ) { mod = $('#ajax-modal') mod.html(data); mod.modal({backdrop: 'static', keyboard: false}, 'show'); l.stop(); }).fail(function() { l.stop(); }); } //SIZE CALCULATE window.mobileCheck = function() { let check = false; (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); return check; }; window.mobileAndTabletCheck = function() { let check = false; (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); return check; }; // Minimalize menu when screen is less than 768px function repair_menu(){ $('body').addClass('body-small') if ($(this).width() < 768) { $('body').removeClass('mini-navbar') } else { $('body').addClass('mini-navbar') } if(this.mobileCheck()) { $('body').removeClass('mini-navbar') } $($.fn.dataTable.tables(true)).DataTable().columns.adjust().responsive.recalc(); } // Minimalize menu when screen is less than 768px $(window).bind("resize", function () { repair_menu(); }); repair_menu(); //SIZE CALCULATE // BARCODE READER cameras = []; codeReader = new ZXing.BrowserMultiFormatReader() cameras = codeReader.listVideoInputDevices().then((videoInputDevices) => { cameras = videoInputDevices console.log(cameras) }).catch((err) => { console.error(err) }) console.log(cameras) // BARCODE READER // BARCODE PRINT function chunkArrayInGroups(arr, size) { var myArray = []; for(var i = 0; i < arr.length; i += size) { myArray.push(arr.slice(i, i+size)); } return myArray; } function textToBase64Barcode(text, display_value, _width, _height, bar_width, bar_height){ var canvas = document.createElement("canvas"); canvas.width = _width; canvas.height = _height; JsBarcode(canvas, text, { format: "CODE128", displayValue: display_value, height: bar_height, width: bar_width, margin: 0, textAlign: "center", font: "sans-serif", fontSize: 14, fontOptions: "bold", }); return canvas.toDataURL('image/png', 1.0) } function print_barcode(typ, obj){ var doc = new jsPDF("p", "mm", [100, 100]); doc.setFont("sans-serif"); doc.setFontSize(8) var width = doc.internal.pageSize.getWidth(); var height = doc.internal.pageSize.getHeight(); if(typ=="koli"){ head = [ [ {content: 'Palet', styles: {halign: 'center', textColor: [0,0,0], fillColor: [255, 255, 255]}}, {content: 'Barcode', rowSpan: 2, styles: {halign: 'center', textColor: [0,0,0], fillColor: [255, 255, 255]}}, ], [ {content: 'Data2', styles: {halign: 'center', textColor: [0,0,0], fillColor: [255, 255, 255]}}, ], [ {content: '3M0SG4E-28MA20CT0-LA4', colSpan: 3, styles: {halign: 'center', textColor: [0,0,0], fillColor: [255, 255, 255]}}, ] ] body = [ [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], [ { content: '16000000001', styles: { halign: 'left' } }, { content: 'Text', styles: { halign: 'right' } }, ], ] totalPagesExp = "{total_pages_count_string}"; doc.autoTable({ margin: {top: 2, bottom: 0, left: 2, right: 2}, columnStyles: { 0: {cellWidth: 40}, 1: {cellWidth: "auto"} }, head: head, body: body, theme: 'grid', addPageContent: data => { let footerStr = doc.internal.getNumberOfPages(); if (typeof doc.putTotalPages === 'function') { footerStr = footerStr + "/" + totalPagesExp; } doc.setFontSize(8); xOffset = (doc.internal.pageSize.getWidth() / 2) - (doc.getStringUnitWidth(footerStr) / 2); console.log(xOffset) doc.text(footerStr, xOffset, doc.internal.pageSize.height - 5); } }) if (typeof doc.putTotalPages === 'function') { doc.putTotalPages(totalPagesExp); } doc.autoPrint(); }else if(typ=="palet"){ obj = { name: "Palet Numarası", value: "874345223", items: [ "1600000000", "1600000001", "1600000002", "1600000003", "1600000004", "1600000005", "1600000000", "1600000001", "1600000002", "1600000003", "1600000004", "1600000005", "1600000000", "1600000001", "1600000002", "1600000003", "1600000004", "1600000005", ] } doc.text(obj.name, 5, 7); doc.text(obj.value, 5, 10); doc.addImage(textToBase64Barcode(obj.value, false, 70, 15), 'PNG', 47, 0, 50, 15) doc.autoPrint(); }else if(typ=="lot"){ } rm = document.getElementById("print-frame") if(rm!=null) rm.remove(); hiddFrame = document.createElement("iframe"); hiddFrame.id = "print-frame"; hiddFrame.style.position = 'fixed'; hiddFrame.style.width = '1px'; hiddFrame.style.height = '1px'; hiddFrame.style.opacity = '0.01'; const isSafari = /^((?!chrome|android).)*safari/i.test(window.navigator.userAgent); if (isSafari) { // fallback in safari hiddFrame.onload = () => { try { hiddFrame.contentWindow.document.execCommand('print', false, null); } catch (e) { hiddFrame.contentWindow.print(); } }; } hiddFrame.src = doc.output('bloburl'); document.body.appendChild(hiddFrame) } function isIsoDate(str) { if (str.includes('T')) { // this is datetime if (/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(str)) return true; else return false } else { // this is date only if (/\d{4}-\d{2}-\d{2}/.test(str)) return true; else return false } // const d = new Date(str); // return d instanceof Date && !isNaN(d.getTime()) && d.toISOString().startsWith(str); // valid date } function equalDictionary(d1,d2){ if((d1==null||d1==undefined) && (d2==null||d2==undefined)) return true if((d1==null||d1==undefined) && (d2!=null||d2!=undefined)) return false if((d1!=null||d1!=undefined) && (d1==null||d1==undefined)) return false if(Object.entries(d1).length!=Object.entries(d2).length) return false for (const [key, value] of Object.entries(d1)) { if(!(key in d2)) return false if(value!=d2[key]) return false } return true } // BARCODE PRINT $.fn.dataTable.render.ellipsis = function (size) { return function ( data, type, row ) { return type === 'display' && data.length > size ? data.substr( 0, size ) +'…' : data; } }; function on_form_response(state) { var evt = $.Event('formresponse'); evt.state = state; $(window).trigger(evt); } function redirect(url) { var ua = navigator.userAgent.toLowerCase(); var isIE = ua.indexOf('msie') !== -1; var version = parseInt(ua.substr(4, 2), 10); // Internet Explorer 8 and lower if (isIE && version < 9) { var link = document.createElement('a'); link.href = url; document.body.appendChild(link); link.click(); } else { window.location.href = url; } } function oparation_click(bt, _data=null, evnt=null) { var l = null if(bt!=null){ l = Ladda.create(bt); l.start(); } if(_data==null){ _data = $(bt).data() delete _data['chosen']; delete _data['style']; delete _data['loading']; } if(_data.redirect!=null && _data.redirect==true){ window.location.href = _data.href; if(l!=null) l.stop(); return false; } if(_data.confirm!=null && _data.confirm==true){ swal({ title: 'Emin misin?', text: _data.confirm_text, type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: 'Evet', cancelButtonText: 'Vazgeç', closeOnConfirm: false }, function (e) { if(e == false){ if(l!=null) l.stop(); return } var lc = Ladda.create($(".confirm")[0]); lc.start(); $.ajax({ method: "POST", url: _data.href, contentType: "application/json; charset=utf-8", data: JSON.stringify(_data) }).done(function( data ) { swal.close(); data = JSON.parse(data); if(data.status=="error"){ swal({ title: data.notify.title, text: data.notify.description, type: data.status }); return }else if(data.status=="redirect"){ redirect(data.url) return } if(data.html != null){ if(_data.back == true) { removeHistory() }else{ addHistory(_data) } mod = $('#ajax-modal') mod.off('hidden.bs.modal'); focus_set(null, null) mod.on('hidden.bs.modal', function (e) { clearHistory(); rt = mod.attr("data-refresh_table") if(rt!=null && rt!=""){ $("#"+rt).DataTable().ajax.reload(); } mod.attr('data-refresh_table', ""); codeReader.reset() focus_set(null, null) }); if(_data.refresh_table != null){ mod.attr('data-refresh_table', _data.refresh_table); } if(mod.hasClass('show')){ mod.html(data.html); }else{ mod.html(data.html); mod.modal({backdrop: 'static', keyboard: false}, 'show'); } fcs = mod.children().attr("data-focus") console.log("fcs:" + fcs) if(fcs!=null && fcs!=""){ focus_set(null, fcs) } focus_element(); }else if(data.ret != null){ if(evnt!=null) evnt(data.ret) mod = $('#ajax-modal') fcs = mod.children().attr("data-focus") console.log("fcs:" + fcs) if(fcs!=null && fcs!=""){ focus_set(null, fcs) } focus_element(); }else{ if(data.notify!=null) { swal({ title: data.notify.title, text: data.notify.description, type: data.status, timer: 3000 }); } if(_data.refresh_table!=null) { $("#"+_data.refresh_table).DataTable().ajax.reload(); } } lc.stop(); if(l!=null) l.stop(); }).fail(function() { swal.close(); lc.stop(); if(l!=null) l.stop(); mod = $('#ajax-modal') fcs = mod.children().attr("data-focus") console.log("fcs:" + fcs) if(fcs!=null && fcs!=""){ focus_set(null, fcs) } focus_element(); }); }); }else{ $.ajax({ method: "POST", url: _data.href, contentType: "application/json; charset=utf-8", data: JSON.stringify(_data) }).done(function( data ) { if(l!=null) l.stop(); data = JSON.parse(data); if(data.status=="error"){ swal({ title: data.notify.title, text: data.notify.description, type: data.status }); return }else if(data.status=="redirect"){ redirect(data.url) return }else if(data.status=="download"){ $.fileDownload(data.file); return } if(data.html != null){ if(_data.back == true) { removeHistory() }else{ addHistory(_data) } mod = $('#ajax-modal'); mod.off('hidden.bs.modal'); focus_set(null, null) mod.on('hidden.bs.modal', function (e) { clearHistory(); rt = mod.attr("data-refresh_table") if(rt!=null && rt!=""){ $("#"+rt).DataTable().ajax.reload(); } mod.attr('data-refresh_table', ""); codeReader.reset() focus_set(null, null) }); if(_data.refresh_table != null){ mod.attr('data-refresh_table', _data.refresh_table); } if(mod.hasClass('show')){ mod.html(data.html); }else{ mod.html(data.html); mod.modal({backdrop: 'static', keyboard: false}, 'show'); } fcs = mod.children().attr("data-focus") console.log("fcs:" + fcs) if(fcs!=null && fcs!=""){ focus_set(null, fcs) } focus_element(); }else if(data.ret != null){ if(evnt!=null) evnt(data.ret) mod = $('#ajax-modal') fcs = mod.children().attr("data-focus") console.log("fcs:" + fcs) if(fcs!=null && fcs!=""){ focus_set(null, fcs) } focus_element(); }else{ if(data.notify!=null) { swal({ title: data.notify.title, text: data.notify.description, type: data.status, timer: 3000 }); } if(_data.refresh_table!=null) { $("#"+_data.refresh_table).DataTable().ajax.reload(); } } }).fail(function() { if(l!=null) l.stop(); mod = $('#ajax-modal') fcs = mod.children().attr("data-focus") console.log("fcs:" + fcs) if(fcs!=null && fcs!=""){ focus_set(null, fcs) } focus_element(); }); } return false; } function on_form_submit(frm){ form = $(frm) if(form.valid()==false) return false; _data = Object.assign({}, form.data()); delete _data['chosen']; delete _data['style']; delete _data['loading']; delete _data['validator']; var button = form.find("button[type=submit]:first")[0] var l = Ladda.create(button); l.start(); var object = {}; var disabled = form.find("[disabled]").removeAttr('disabled'); var unindexed_array = form.serializeArray(); disabled.attr('disabled','disabled'); $.map(unindexed_array, function(n, i){ multiple = $("[name='"+n['name']+"']").attr("multiple") if (n['name'] in object){ if(multiple==null) object[n['name']] = n['value']; else object[n['name']].push(n['value']); }else{ if(multiple==null){ object[n['name']] = n['value']; }else{ object[n['name']] = [] object[n['name']].push(n['value']); } } }); var json = JSON.stringify(object); $.ajax({ method: "POST", url: _data.href, contentType: "application/json; charset=utf-8", data: json }).done(function( data ) { l.stop(); data = JSON.parse(data); on_form_response(data) if(data.status=="error"){ swal({ title: data.notify.title, text: data.notify.description, type: data.status, }); return }else if(data.status=="redirect"){ redirect(data.url); return; } if(data.notify!=null) { swal({ title: data.notify.title, text: data.notify.description, type: data.status, timer: 3000 }); } if(_data.refresh_table!=null) $("#"+_data.refresh_table).DataTable().ajax.reload(); $('#ajax-modal').modal('hide'); }).fail(function() { l.stop(); }); return false; } function export_click(bt) { var l = null if(bt!=null){ l = Ladda.create(bt); l.start(); } _data = $(bt).data() delete _data['chosen']; delete _data['style']; delete _data['loading']; $('#export-panel #un-pros').text("Data Okunuyor: 0"); $('#export-panel #up-pros').text('0%') $('#export-panel #pb-pros').css('width', '0%'); $("#export-panel").show() $.ajax({ method: "POST", url: _data.href, contentType: "application/json; charset=utf-8", data: JSON.stringify(_data), processData: false, timeout: 1800000, xhrFields: { onprogress: function(e) { var response = e.currentTarget.response; var mtch = response.split('|'); var lmtch = mtch[mtch.length-2] var parsedResponse = JSON.parse(lmtch); download = parsedResponse.path $('#export-panel #un-pros').text("Data Okunuyor: " + parsedResponse.row); $('#export-panel #up-pros').text(parsedResponse.progress + '%') $('#export-panel #pb-pros').css('width', parsedResponse.progress + '%'); if(parsedResponse.status == 1) { $('#export-panel #un-pros').text("file_prepared: " + parsedResponse.path); $('#export-panel #up-pros').text(parsedResponse.progress + '%') $('#export-panel #pb-pros').css('width', parsedResponse.progress + '%'); } else if(parsedResponse.status == 2) { redirect(parsedResponse.path) $("#export-panel").hide() //$("#export #prossess").html('
') } } } }).fail(function() { if(l!=null) l.stop(); $("#export-panel").hide() }); return false; }