Index: sandbox/2.4.2-expresso2/prototype/modules/mail/templates/attachment_add_itemlist.ejs
===================================================================
--- sandbox/2.4.2-expresso2/prototype/modules/mail/templates/attachment_add_itemlist.ejs (revision 6752)
+++ sandbox/2.4.2-expresso2/prototype/modules/mail/templates/attachment_add_itemlist.ejs (revision 6760)
@@ -1,5 +1,7 @@
-
+
<%=data.file.fileName%> (<%=data.file.fileSize%>)
- <% if(data.file.error == ''){ %>
+ <%=data.file.fullFileName%>
+ <%=data.file.fileSize%>
+ <% if(typeof(data.file.error) == 'boolean'){ %>
<% } %>
Index: sandbox/2.4.2-expresso2/prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs
===================================================================
--- sandbox/2.4.2-expresso2/prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs (revision 6752)
+++ sandbox/2.4.2-expresso2/prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs (revision 6760)
@@ -11,9 +11,8 @@
Status:
- <%=(data.attach.error == "" ? "Success " : data.attach.error)%>
-
+ <%if(typeof(data.attach.error) == "boolean"){%>
+ <%=(data.attach.error ? "Loading... " : "Success")%>
+ <%}else{%>
+ <%=data.attach.error%>
+ <%}%>
-<% if(data.attach.error == ''){ %>
-
-
-<% } %>
Index: sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js
===================================================================
--- sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js (revision 6752)
+++ sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js (revision 6760)
@@ -4384,7 +4384,7 @@
attach.fileSize = formatBytes(file.size);
if(maxAttachmentSize && file.size > maxAttachmentSize)
- attach.error = 'Tamanho de arquivo nao permitido!!'
+ attach.error = 'Tamanho de arquivo nao permitido'
else
- attach.error = 'Loading...';
+ attach.error = true;
var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
upload.find('.att-box-delete').click(function(){
@@ -4423,8 +4423,8 @@
radius: 5
},
- padding: 5,
- textAlign: 'center',
+ padding: 3,
+ textAlign: 'left',
tip: true, // Give it a speech bubble tip with automatic corner detection
- name: 'blue' // Style it according to the preset 'cream' style
+ name: (typeof(attach.error) == 'boolean' ? 'light' : 'red') // Style it according to the preset 'cream' style
}
});
@@ -4440,21 +4440,52 @@
},
done: function(e, data){
+ var attach_box = fileUploadMSG.find('.att-box-loading:first').parents('.att-box');
+ var attach = {
+ fullFileName : attach_box.find(".att-box-fullfilename").text(),
+ fileSize : attach_box.find(".att-box-filesize").text(),
+ OK : true,
+ error : false
+ };
if(!!data.result && data.result != "[]" ){
var newAttach = data.result;
- if(!newAttach.mailAttachment.error){
- if(newAttach.rollback !== false)
- {
- fileUploadMSG.find('.att-box-loading:first').parents('div:first').append('');
- addAttachment(ID,newAttach['mailAttachment'][0][0].id);
- }
- else
- fileUploadMSG.find('.att-box-loading:first').parents('div:first').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');
- }else{
- fileUploadMSG.find('.att-box-loading:first').parents('div:first').find('.status-upload').append(newAttach.mailAttachment.error).addClass('message-attach-error');
- }
-
+ if(!newAttach.mailAttachment.error || newAttach.rollback !== false){
+ attach_box.append('');
+ addAttachment(ID,newAttach['mailAttachment'][0][0].id);
+ }else {
+ attach_box.addClass('invalid-email-box');
+ attach.error = newAttach.mailAttachment.error ? newAttach.mailAttachment.error : 'Erro ao anexar...';//.append(newAttach.mailAttachment.error).addClass('message-attach-error');
+ }
}else {
- fileUploadMSG.find(' .progress.on-complete:first').parents('div:first').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');
- }
+ attach_box.addClass('invalid-email-box');//.qtip("api").updateContent("oi", true);
+ attach.error = 'Erro ao anexar...';
+ }
+ attach_box.qtip("destroy").qtip({
+ content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}),
+ position: {
+ corner: {
+ tooltip: 'bottomMiddle',
+ target: 'topMiddle'
+ },
+ adjust: {
+ resize: true,
+ scroll: true
+ }
+ },
+ show: {
+ when: 'mouseover', // Don't specify a show event
+ ready: false // Show the tooltip when ready
+ },
+ hide: 'mouseout', // Don't specify a hide event
+ style: {
+ border: {
+ width: 1,
+ radius: 5
+ },
+ padding: 3,
+ textAlign: 'left',
+ tip: true, // Give it a speech bubble tip with automatic corner detection
+ name: (attach.error == false ? 'blue' : 'red')// Style it according to the preset 'cream' style
+ }
+ });
fileUploadMSG.find(' .att-box-loading:first').remove();
}