Changeset 1445
- Timestamp:
- 09/23/09 16:58:54 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/InfoContact.js
r1440 r1445 30 30 this.td = td; 31 31 clearTimeout(this.timeout); 32 this.timeout = setTimeout("InfoContact.search('"+email+"')",1000);33 }32 } 33 this.timeout = setTimeout("InfoContact.search('"+email+"')",1000); 34 34 } 35 35 … … 69 69 var _this = this; 70 70 var card = Element("card_cc"); 71 card.style.left = findPosX(this.td) + 20; 72 var y = findPosY(this.td) + 20 - Element("divScrollMain_"+numBox).scrollTop; 73 var w_height = is_ie ? document.body.clientHeight + document.body.scrollTop : window.innerHeight + window.pageYOffset; 74 if(y + 160 > w_height) 75 card.style.top = y - 160; 76 else 77 card.style.top = y; 78 card.style.display = ''; 79 var cn = data.cn; 80 if(cn && cn.toString().length > 35) 81 cn = cn.toString().substring(0,30) + "..."; 82 83 var phoneUser = data.telefone; 84 if(preferences.voip_enabled && phoneUser) { 85 phoneUser = "<a title=\""+get_lang("Call to Comercial Number")+"\" href=\"#\" onclick=\"InfoContact.connectVoip('"+phoneUser+"', 'com')\">"+phoneUser+"</a>"; 86 if(data.mobile){ 87 phoneUser += " / <a title=\""+get_lang("Call to Mobile Number")+"\" href=\"#\" onclick=\"InfoContact.connectVoip('"+data.mobile+"', 'mob')\">"+data.mobile+"</a>"; 88 } 89 } 71 90 72 //if(card.style.display != '') 73 { 74 card.style.left = findPosX(this.td) + 20; 75 var y = findPosY(this.td) + 20 - Element("divScrollMain_"+numBox).scrollTop; 76 var w_height = is_ie ? document.body.clientHeight + document.body.scrollTop : window.innerHeight + window.pageYOffset; 77 if(y + 160 > w_height) 78 card.style.top = y - 160; 79 else 80 card.style.top = y; 81 card.style.display = ''; 82 var cn = data.cn; 83 if(cn && cn.toString().length > 35) 84 cn = cn.toString().substring(0,30) + "..."; 85 86 var phoneUser = data.telefone; 87 if(preferences.voip_enabled && phoneUser) { 88 phoneUser = "<a title=\""+get_lang("Call to Comercial Number")+"\" href=\"#\" onclick=\"InfoContact.connectVoip('"+phoneUser+"', 'com')\">"+phoneUser+"</a>"; 89 if(data.mobile){ 90 phoneUser += " / <a title=\""+get_lang("Call to Mobile Number")+"\" href=\"#\" onclick=\"InfoContact.connectVoip('"+data.mobile+"', 'mob')\">"+data.mobile+"</a>"; 91 } 92 } 93 94 Element("card_cc_td").innerHTML = "<table cellpadding=0 cellspacing=0 border=0 height='100%' width='100%'><tr><td width='70' height='93' style='padding-top:5px;padding-left:6px' align='center' valign='center'>"+ 95 "<img src='./inc/show_img.php?email="+data.email+"'></td><td style='padding-left:2px' align='left' valign='top'>"+ 96 "<br><img align='center' src='templates/"+template+"/images/"+(data.type)+"_catalog.png'><font size=1 color=BLACK> <b>"+get_lang("Sender's Information")+"</b></font>"+ 97 _this.verifyIM(data.uid,data.email)+ 98 "<br><img align='center' src='templates/"+template+"/images/phone.gif'> <font size=1 color=BLACK>"+(phoneUser ? phoneUser : get_lang("None") )+"</font>"+ 99 "</td></tr><tr><td valign='top' align='center' colspan='2'>"+ 100 "<font size=1 color=BLACK>"+cn+"</font>"+ 101 "<br><span title='"+get_lang("Write message")+"' style='cursor:pointer' onclick='InfoContact.sendMail(\""+cn+"\",\""+data.email+"\")'><font size=1 color=DARKBLUE><u>"+data.email+"</u></font></span>"+ 102 "</td></tr></table>"; 91 Element("card_cc_td").innerHTML = "<table cellpadding=0 cellspacing=0 border=0 height='100%' width='100%'><tr><td width='70' height='93' style='padding-top:5px;padding-left:6px' align='center' valign='center'>"+ 92 "<img src='./inc/show_img.php?email="+data.email+"'></td><td style='padding-left:2px' align='left' valign='top'>"+ 93 "<br><img align='center' src='templates/"+template+"/images/"+(data.type)+"_catalog.png'><font size=1 color=BLACK> <b>"+get_lang("Sender's Information")+"</b></font>"+ 94 _this.verifyIM(data.uid,data.email)+ 95 "<br><img align='center' src='templates/"+template+"/images/phone.gif'> <font size=1 color=BLACK>"+(phoneUser ? phoneUser : get_lang("None") )+"</font>"+ 96 "</td></tr><tr><td valign='top' align='center' colspan='2'>"+ 97 "<font size=1 color=BLACK>"+cn+"</font>"+ 98 "<br><span title='"+get_lang("Write message")+"' style='cursor:pointer' onclick='InfoContact.sendMail(\""+cn+"\",\""+data.email+"\")'><font size=1 color=DARKBLUE><u>"+data.email+"</u></font></span>"+ 99 "</td></tr></table>"; 103 100 104 101 105 this.timeout_hide = setTimeout("InfoContact.hide()",1000); 106 } 102 this.timeout_hide = setTimeout("InfoContact.hide()",1000); 107 103 } 108 104 109 105 emInfoContact.prototype.search = function (email){ 110 106 var _this = this; 111 var ldapSearched = false; 107 var trustedDomain = false; 108 // If "preferences.notification_domains" was setted, then verify if "mail" has a trusted domain. 109 if (preferences.notification_domains != undefined && preferences.notification_domains != "") { 110 var domains = preferences.notification_domains.split(','); 111 for (var i = 0; i < domains.length; i++) { 112 if (email.toString().match(domains[i])) 113 trustedDomain = true; 114 } 115 } 116 else 117 trustedDomain = true; 118 112 119 var handler_search = function(data){ 113 if(data != null){ 120 if(data != null){ 114 121 _this.show(data); 115 122 } 116 else if(!ldapSearched) {117 ldapSearched = true;118 var domains = '';119 var blocked = true;120 if (preferences.notification_domains != undefined && preferences.notification_domains != "")121 domains = preferences.notification_domains.split(',');122 for (var i = 0; i < domains.length; i++)123 {124 if (email.toString().match(domains[i]))125 blocked=false;126 }127 if (!blocked)128 cExecute ("$this.ldap_functions.getUserByEmail&email="+email, handler_search);129 else130 _this.label(email);131 }132 123 else 133 _this.label(email); 134 124 _this.label(email); 135 125 } 136 137 if(findPosX(_this.td) == 0) { 138 _this.hide(); 139 return; 140 } 141 142 handler_search(); 143 //cExecute ("$this.db_functions.getUserByEmail&email="+email, handler_search); 126 127 if (trustedDomain) 128 cExecute ("$this.ldap_functions.getUserByEmail&email="+email, handler_search); 129 else 130 _this.label(email); 144 131 } 145 132 146 133 emInfoContact.prototype.hide = function(){ 147 134 this.email = ""; 148 clearTimeout(this.timeout);149 135 if(Element("div_label")) 150 136 Element("div_label").style.display = 'none';
Note: See TracChangeset
for help on using the changeset viewer.