Changeset 6752 for sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js
- Timestamp:
- 07/10/12 14:45:02 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js
r6717 r6752 896 896 var _mouse_out; 897 897 var _cell; 898 var colGroupMain = document.getElementById("colgroup_main_"+numBox);899 var colGroupHead = document.getElementById("colgroup_head_"+numBox);900 898 for (var r=0;r<trM.length;r++) { 901 899 for (var c=0;c<trM[r].cells.length;c++) { … … 904 902 if (is_mozilla && !is_webkit) { 905 903 if (!emptyBody) { 906 colGroupMain.childNodes[c].setAttribute("width",colSizes[tbl][c]);904 document.getElementById("colgroup_main_"+numBox).childNodes[c].setAttribute("width",colSizes[tbl][c]); 907 905 } 908 colGroupHead.childNodes[c].setAttribute("width",colSizes[tbl][c]);906 document.getElementById("colgroup_head_"+numBox).childNodes[c].setAttribute("width",colSizes[tbl][c]); 909 907 if (tbH.rows[0].cells[c].className=="th_resizable") { 910 908 // lots of stupid fixes for FF to redraw cell content … … 921 919 } 922 920 } 923 /*924 921 else { 925 922 tbH.rows[0].cells[c].setAttribute("width",_cell.offsetWidth); 926 } */923 } 927 924 } 928 925 } … … 4337 4334 var maxAttachmentSize = (preferences.max_attachment_size !== "" && preferences.max_attachment_size != 0) ? (parseInt(preferences.max_attachment_size.replace('M', '')) * 1048576 ) : false; 4338 4335 4336 content.find(".new-msg-head-data").scroll(function(){ 4337 $.each(fileUploadMSG.find(".attachments-list .att-box"), function(index, value){ 4338 $(this).qtip("api").updatePosition(); 4339 }); 4340 }); 4341 $("#fileupload_msg"+ID+"_droopzone").click(function(){ 4342 $(this).removeClass('in hover'); 4343 $(this).hide(); 4344 $(this).prev().show(); 4345 }); 4339 4346 fileUploadMSG.find(".button").button().filter(".fileinput-button").find(".ui-button-text").css("margin-top", "2px").find("input:file").fileupload({ 4340 //singleFileUploads : true, 4347 //singleFileUploads : true,fileUploadMSG 4341 4348 sequentialUploads: true, 4342 4349 type: 'post', … … 4344 4351 url: "../prototype/post.php", 4345 4352 forceIframeTransport: false, 4346 dropZone : fileUploadMSG,4353 dropZone : $("#fileupload_msg"+ID+"_droopzone"), 4347 4354 formData: function(form) { 4348 4355 return [ … … 4368 4375 }, 3000); 4369 4376 } 4377 fileUploadMSG.find(' .attachments-list').show(); 4370 4378 $.each(data.files, function (index, file) { 4371 4379 var attach = {}; 4372 4380 attach.fullFileName = file.name; 4373 4381 attach.fileName = file.name; 4374 if(file.name.length > 50)4375 attach.fileName = file.name.substr(0, 32) + " ... " + file.name.substr(file.name.length-9, file.name.length);4382 if(file.name.length > 20) 4383 attach.fileName = file.name.substr(0, 17) + " ... " + file.name.substr(file.name.length-6, file.name.length); 4376 4384 attach.fileSize = formatBytes(file.size); 4377 4385 if(maxAttachmentSize && file.size > maxAttachmentSize) 4378 4386 attach.error = 'Tamanho de arquivo nao permitido!!' 4379 4380 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 4381 upload.find('.button.close').button({ 4382 icons: { 4383 primary: "ui-icon-close" 4384 }, 4385 text: false 4386 }).click(function(){ 4387 else 4388 attach.error = 'Loading...'; 4389 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 4390 upload.find('.att-box-delete').click(function(){ 4387 4391 var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 4388 4392 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 4389 delAttachment(ID, idAttach) 4393 delAttachment(ID, idAttach); 4394 $(this).parent().qtip("destroy"); 4390 4395 $(this).parent().remove(); 4396 if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){ 4397 fileUploadMSG.find(' .attachments-list').hide(); 4398 } 4391 4399 }); 4392 4393 fileUploadMSG.find('.attachments-list').append(upload); 4400 4401 fileUploadMSG.find('.attachments-list').append(upload); 4402 4403 fileUploadMSG.find('.attachments-list .att-box:last').qtip({ 4404 content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}), 4405 position: { 4406 corner: { 4407 tooltip: 'bottomMiddle', 4408 target: 'topMiddle' 4409 }, 4410 adjust: { 4411 resize: true, 4412 scroll: true 4413 } 4414 }, 4415 show: { 4416 when: 'mouseover', // Don't specify a show event 4417 ready: false // Show the tooltip when ready 4418 }, 4419 hide: 'mouseout', // Don't specify a hide event 4420 style: { 4421 border: { 4422 width: 1, 4423 radius: 5 4424 }, 4425 padding: 5, 4426 textAlign: 'center', 4427 tip: true, // Give it a speech bubble tip with automatic corner detection 4428 name: 'blue' // Style it according to the preset 'cream' style 4429 } 4430 }); 4394 4431 4395 4432 if(!maxAttachmentSize || file.size < maxAttachmentSize){ … … 4408 4445 if(newAttach.rollback !== false) 4409 4446 { 4410 fileUploadMSG.find('. in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>').find('.status-upload').addClass('ui-icon ui-icon-check');4447 fileUploadMSG.find('.att-box-loading:first').parents('div:first').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>'); 4411 4448 addAttachment(ID,newAttach['mailAttachment'][0][0].id); 4412 4449 } 4413 4450 else 4414 fileUploadMSG.find('. in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');4451 fileUploadMSG.find('.att-box-loading:first').parents('div:first').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error'); 4415 4452 }else{ 4416 fileUploadMSG.find('. in-progress:first').parents('p').find('.status-upload').append(newAttach.mailAttachment.error).addClass('message-attach-error');4453 fileUploadMSG.find('.att-box-loading:first').parents('div:first').find('.status-upload').append(newAttach.mailAttachment.error).addClass('message-attach-error'); 4417 4454 } 4418 4455 4419 4456 }else { 4420 fileUploadMSG.find(' .progress.on-complete:first').parents(' p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');4421 } 4422 fileUploadMSG.find(' . in-progress:first').remove();4457 fileUploadMSG.find(' .progress.on-complete:first').parents('div:first').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error'); 4458 } 4459 fileUploadMSG.find(' .att-box-loading:first').remove(); 4423 4460 } 4424 4461 }).css({ … … 4449 4486 jQuery.each(selectedMessages[folder_name], function(message_number, message) { 4450 4487 if (message) { 4488 fileUploadMSG.find(' .attachments-list').show(); 4451 4489 var att = new Object(); 4452 4490 att.folder = folder_name; … … 4458 4496 var attach = {}; 4459 4497 attach.fileName = onceOpenedMessages[folder_name][message_number].subject + '.eml'; 4460 if(attach.fileName.length > 45) 4461 attach.fileName = attach.fileName.substr(0, 32) + " ... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length); 4462 4498 attach.fullFileName = onceOpenedMessages[folder_name][message_number].subject + '.eml'; 4499 if(attach.fileName.length > 20) 4500 attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length); 4501 4502 attach.error = ""; 4463 4503 attach.fileSize = formatBytes(onceOpenedMessages[folder_name][message_number].size); 4464 4504 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 4465 upload.find('.status-upload').addClass('ui-icon ui-icon-check'); 4466 upload.find('.in-progress').remove(); 4505 upload.find('.att-box-loading').remove(); 4467 4506 upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>'); 4468 4507 4469 upload.find('.button.close').button({ 4470 icons: { 4471 primary: "ui-icon-close" 4472 }, 4473 text: false 4474 }).click(function(){ 4475 var idAttach = $(this).parents("li:first").find('input[name="fileId[]"]').val(); 4476 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]'); 4477 delAttachment(ID,idAttach); 4478 $(this).parent().remove(); 4508 upload.find('.att-box-delete').click(function(){ 4509 var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 4510 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 4511 delAttachment(ID,idAttach); 4512 $(this).parent().qtip("destroy"); 4513 $(this).parent().remove(); 4514 if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){ 4515 fileUploadMSG.find(' .attachments-list').hide(); 4516 } 4479 4517 }); 4480 4518 4481 fileUploadMSG.find('.attachments-list').append(upload); 4519 fileUploadMSG.find('.attachments-list').append(upload); 4520 4521 upload.find('.att-box-loading').remove(); 4522 4523 fileUploadMSG.find('.attachments-list .att-box:last').qtip({ 4524 content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}), 4525 position: { 4526 corner: { 4527 tooltip: 'bottomMiddle', 4528 target: 'topMiddle' 4529 }, 4530 adjust: { 4531 resize: true, 4532 scroll: true 4533 } 4534 }, 4535 show: { 4536 when: 'mouseover', // Don't specify a show event 4537 ready: false // Show the tooltip when ready 4538 }, 4539 hide: 'mouseout', // Don't specify a hide event 4540 style: { 4541 border: { 4542 width: 1, 4543 radius: 5 4544 }, 4545 padding: 5, 4546 textAlign: 'center', 4547 tip: true, // Give it a speech bubble tip with automatic corner detection 4548 name: 'blue' // Style it according to the preset 'cream' style 4549 } 4550 }); 4482 4551 } 4483 4552 }); … … 4492 4561 }); 4493 4562 }); 4563 $(document).bind('drop dragover', function (e) { 4564 e.preventDefault(); 4565 }); 4566 //DRAG and DROP DE ARQUIVOS NÃO FUNCIONA NO IE 4567 if(!is_ie){ 4568 $("body").bind('dragenter', function (e) { 4569 var dropZone = $("#fileupload_msg"+ID+"_droopzone"); 4570 var timeout = window.dropZoneTimeout; 4571 dropZone.show(); 4572 dropZone.prev().hide(); 4573 if (!timeout) { 4574 dropZone.addClass('in'); 4575 } else { 4576 clearTimeout(timeout); 4577 } 4578 if (e.target === dropZone[0]) { 4579 dropZone.addClass('hover'); 4580 } else { 4581 dropZone.removeClass('hover'); 4582 } 4583 $(window).unbind('dragleave'); 4584 window.dropZoneTimeout = setTimeout(function () { 4585 $(window).bind('dragleave', function (e) { 4586 window.dropZoneTimeout = null; 4587 dropZone.removeClass('in hover'); 4588 dropZone.hide(); 4589 dropZone.prev().show(); 4590 }); 4591 }, 1); 4592 }).bind('dragleave', function (e) { 4593 var dropZone = $("#fileupload_msg"+ID+"_droopzone"); 4594 window.dropZoneTimeout = setTimeout(function () { 4595 $(window).bind('dragleave', function (e) { 4596 window.dropZoneTimeout = null; 4597 dropZone.removeClass('in hover'); 4598 dropZone.hide(); 4599 dropZone.prev().show(); 4600 }); 4601 }, 1); 4602 }).bind('drop', function(e){ 4603 var dropZone = $("#fileupload_msg"+ID+"_droopzone"); 4604 window.dropZoneTimeout = null; 4605 dropZone.removeClass('in hover'); 4606 dropZone.hide(); 4607 dropZone.prev().show(); 4608 }); 4609 } 4494 4610 return ID; 4495 4611 }
Note: See TracChangeset
for help on using the changeset viewer.