"+oldname+"
oraz wszystkie podfoldery oraz pliki znajdujące się w tym folderze?
", function(result) { if (result){ if(itemType==2){ ur='deleteWynikFolder'; } else{ ur='deletePrzetargFolder'; } $.post('/functions/'+ur+'/'+id+item,{newname:''} , function (data){ $('#row_files_'+id).find('a[rel]').each(function (data){ if($(this).attr('rel')==item){ $(this).parent().remove(); } } ); } ); } } ); } function createCompanyFolder(item, id, type, itemType){ var splited = item.split("/"); var splited2 = splited[splited.length-1].split("."); var oldname = ""; var oldext = splited2[splited2.length-1]; for(i=0;i0){ puste = 0; } if(puste==1){ uploadsAttempts[i]['status'] = 1; var test = $(uploadsAttempts[i]['obj']).attr('id'); var expTest = test.split("_"); var newF = 0; itemType = 0; if(expTest.length>1){ if(expTest[0]=="newFolder"){ newF = 1; } if(expTest.length>2){ itemType = 2; expTest[2] = "_"+expTest[2]; } else{ itemType = 1; expTest[2] = ""; } } if(newF==1){ $('#row_files_'+expTest[1]+expTest[2]).html(""); $('#row_files_'+expTest[1]+expTest[2]).fileTree({ root: '/', cmp: expTest[1]+expTest[2], type:itemType } , function(file) { var firma=expTest[1]+expTest[2]; var clicks=checkFileTreeClick(firma+file,itemType); if(clicks==1){ closeAllFileMenus(); openFileMenu(firma+file,itemType); } else if(clicks==2){ closeAllFileMenus(); downloadCompanyFile(firma,file,itemType);} } ); } else{ $(uploadsAttempts[i]['obj']).click(); $(uploadsAttempts[i]['obj']).click(); } } } } } function createStatusbar(obj) { var l = uploadsAttempts.length; var juzjest = 0; for(i=0;i"); this.filename = $("").appendTo(this.statusbar); this.size = $("").appendTo(this.statusbar); this.progressBar = $("").appendTo(this.statusbar); this.abort = $("Abort
").appendTo(this.statusbar); obj.after(this.statusbar); this.setFileNameSize = function(name,size) { var sizeStr=""; var sizeKB = size/1024; if(parseInt(sizeKB) > 1024) { var sizeMB = sizeKB/1024; sizeStr = sizeMB.toFixed(2)+" MB"; } else { sizeStr = sizeKB.toFixed(2)+" KB"; } ; this.filename.html(name); this.size.html(sizeStr); } ; this.setProgress = function(progress) { var progressBarWidth =progress*this.progressBar.width()/ 100; this.progressBar.find('div').animate({ width: progressBarWidth } , 10).html(progress + "% "); if(parseInt(progress) >= 100) { this.abort.hide(); var sb = this.statusbar; sb.remove(); } }; this.setAbort = function(jqxhr) { var sb = this.statusbar; this.abort.click(function() { jqxhr.abort(); sb.hide(); } ); } } function sendFileToServer(formData,status, dest, cid,itemType) { if(itemType==2){ var uploadURL ="/functions/uploadDocsToWynik/"; } else{ var uploadURL ="/functions/uploadDocsToPrzetarg/"; } var extraData ={} ; var jqXHR=$.ajax({ xhr: function() { var xhrobj = $.ajaxSettings.xhr(); if (xhrobj.upload) { xhrobj.upload.addEventListener('progress', function(event) { var percent = 0; var position = event.loaded || event.position; var total = event.total; if (event.lengthComputable) { percent = Math.ceil(position / total * 100); } status.setProgress(percent); } , false); } return xhrobj; } , url: uploadURL, type: "POST", contentType:false, processData: false, cache: false, data: formData, success: function(data){ status.setProgress(100); } } ); status.setAbort(jqXHR); } function getPosition(element) { var xPosition = 0; var yPosition = 0; while(element) { xPosition += (element.offsetLeft - element.scrollLeft + element.clientLeft); yPosition += (element.offsetTop - element.scrollTop + element.clientTop); element = element.offsetParent; } return { x: xPosition, y: yPosition } ; } function checkFileTreeClick(item, itemType){ if(fileTreeClicks.length==0){ fileTreeClicks[0] = new Array(); fileTreeClicks[0][0] = item; fileTreeClicks[0][1] = 0; } var bylo = 0; returner = 0; for(i=0;i