[1121] | 1 | if (!expresso_offline) { |
---|
| 2 | var _showBar = showBar; |
---|
| 3 | var _hideBar = hideBar; |
---|
| 4 | } |
---|
[2] | 5 | |
---|
| 6 | function __showBar(){ |
---|
| 7 | _showBar(); |
---|
| 8 | resizeWindow(); |
---|
| 9 | } |
---|
| 10 | |
---|
| 11 | function __hideBar(){ |
---|
| 12 | _hideBar(); |
---|
| 13 | resizeWindow(); |
---|
| 14 | } |
---|
| 15 | showBar = __showBar; |
---|
| 16 | hideBar = __hideBar; |
---|
| 17 | |
---|
| 18 | window.onresize = resizeWindow; |
---|
| 19 | |
---|
[320] | 20 | function config_events(pObj, pEvent, pHandler) |
---|
| 21 | { |
---|
| 22 | if( typeof pObj == 'object') |
---|
| 23 | { |
---|
| 24 | if( pEvent.substring(0, 2) == 'on') |
---|
| 25 | pEvent = pEvent.substring(2, pEvent.length); |
---|
| 26 | |
---|
| 27 | if ( pObj.addEventListener ) |
---|
| 28 | pObj.addEventListener(pEvent, pHandler, false); |
---|
| 29 | else if( pObj.attachEvent ) |
---|
| 30 | pObj.attachEvent('on' + pEvent, pHandler ); |
---|
| 31 | } |
---|
| 32 | } |
---|
[2605] | 33 | // BEGIN: FUNCTION RESIZE WINDOW |
---|
[2] | 34 | function resizeWindow(){ |
---|
[2605] | 35 | var divScrollMain = Element("divScrollMain_"+numBox); |
---|
| 36 | var table_message = Element("table_message"); |
---|
| 37 | var content_folders = Element("content_folders"); |
---|
[2606] | 38 | var clientHeight = ((window.innerHeight ? window.innerHeight : document.body.offsetHeight) - 8); |
---|
[2813] | 39 | var clientWidth = window.innerWidth ? window.innerWidth : document.body.offsetWidth; |
---|
[2605] | 40 | if(divScrollMain){ |
---|
| 41 | divScrollMain.style.height = (clientHeight - (findPosY(divScrollMain) + (table_message.clientHeight ? table_message.clientHeight : table_message.offsetHeight))) + "px"; |
---|
| 42 | } |
---|
[2] | 43 | |
---|
[813] | 44 | if(typeof(BordersArray) != 'undefined') { |
---|
[65] | 45 | for(var i = 1; BordersArray.length > 1 && i < BordersArray.length;i++) { |
---|
| 46 | var div_scroll = Element("div_message_scroll_"+BordersArray[i].sequence); |
---|
| 47 | var div = Element("content_id_"+BordersArray[i].sequence); |
---|
[2605] | 48 | if(div){ |
---|
| 49 | div.style.height = (clientHeight - (findPosY(div) + (table_message.clientHeight ? table_message.clientHeight : table_message.offsetHeight)+2)) + "px"; |
---|
[2606] | 50 | div.style.width = (clientWidth - (findPosX(div)+10)) + "px"; |
---|
[2605] | 51 | } |
---|
| 52 | if(div_scroll){ |
---|
| 53 | div_scroll.style.height = (clientHeight - (findPosY(div_scroll) + (table_message.clientHeight ? table_message.clientHeight : table_message.offsetHeight)+5)) + "px"; |
---|
[2813] | 54 | div_scroll.style.width = (clientWidth - (findPosX(div_scroll)+15)) + "px"; |
---|
[2605] | 55 | } |
---|
[65] | 56 | } |
---|
[2] | 57 | } |
---|
[812] | 58 | |
---|
[2605] | 59 | if(content_folders){ |
---|
| 60 | var search_div = Element("search_div"); |
---|
| 61 | var contentFoldersY = findPosY(content_folders); |
---|
| 62 | content_folders.style.height = (clientHeight - (contentFoldersY + (contentFoldersY > findPosY(search_div) ? 0 : (search_div.clientHeight ? search_div.clientHeight : search_div.offsetHeight) + 5))) + "px"; |
---|
| 63 | } |
---|
[2] | 64 | } |
---|
| 65 | // END: FUNCTION RESIZE WINDOW |
---|
| 66 | |
---|
[320] | 67 | var _beforeunload_ = window.onbeforeunload; |
---|
| 68 | |
---|
| 69 | window.onbeforeunload = function() |
---|
[271] | 70 | { |
---|
[320] | 71 | return unloadMess(); |
---|
| 72 | } |
---|
[271] | 73 | |
---|
[2] | 74 | function unloadMess(){ |
---|
[53] | 75 | var mess = get_lang("Your message has not been sent and will be discarted."); |
---|
[2] | 76 | for(var i = 0; i < BordersArray.length;i++) { |
---|
| 77 | var body = Element('body_'+BordersArray[i].sequence); |
---|
| 78 | if (body && body.contentWindow && body.contentWindow.document.designMode.toLowerCase() == 'on') { |
---|
| 79 | return mess; |
---|
| 80 | } |
---|
| 81 | } |
---|
| 82 | } |
---|
[320] | 83 | |
---|
[2] | 84 | // Translate words and phrases using user language from eGroupware. |
---|
[812] | 85 | function get_lang(_key) { |
---|
[2666] | 86 | if (typeof(_key) == 'undefined') |
---|
| 87 | return false; |
---|
[566] | 88 | var key = _key.toLowerCase(); |
---|
[812] | 89 | if(array_lang[key]) |
---|
| 90 | var _value = array_lang[key]; |
---|
| 91 | else |
---|
| 92 | var _value = _key+"*"; |
---|
[566] | 93 | |
---|
[812] | 94 | if(arguments.length > 1) |
---|
| 95 | for(j = 1; typeof(arguments[j]) != 'undefined'; j++) |
---|
| 96 | _value = _value.replace("%"+j,arguments[j]); |
---|
[2] | 97 | return _value; |
---|
[812] | 98 | } |
---|
| 99 | |
---|
[2] | 100 | // Make decimal round, using in size message |
---|
| 101 | function round(value, decimal){ |
---|
| 102 | var return_value = Math.round( value * Math.pow( 10 , decimal ) ) / Math.pow( 10 , decimal ); |
---|
| 103 | return( return_value ); |
---|
| 104 | } |
---|
| 105 | |
---|
| 106 | // Change the class of message. |
---|
[341] | 107 | // In refresh, the flags UnRead and UnSeen don't exist anymore. |
---|
[163] | 108 | function set_msg_as_read(msg_number, selected){ |
---|
[2] | 109 | tr_message = Element(msg_number); |
---|
[163] | 110 | if (exist_className(tr_message, 'tr_msg_unread')) |
---|
| 111 | decrement_folder_unseen(); |
---|
| 112 | remove_className(tr_message, 'tr_msg_unread'); |
---|
| 113 | remove_className(tr_message, 'selected_msg'); |
---|
[2693] | 114 | Element("td_message_unseen_"+msg_number).innerHTML = "<img src ='templates/"+template+"/images/seen.gif' title='"+get_lang('Seen')+"'>"; |
---|
[569] | 115 | purgeCache(); |
---|
[163] | 116 | return true; |
---|
[2] | 117 | } |
---|
| 118 | |
---|
[605] | 119 | function msg_is_read(msg_number, selected){ |
---|
| 120 | tr_message = Element(msg_number); |
---|
[814] | 121 | return !(tr_message && LTrim(tr_message.className).match('tr_msg_unread')) |
---|
[605] | 122 | } |
---|
| 123 | |
---|
[163] | 124 | function set_msg_as_unread(msg_number){ |
---|
[2] | 125 | tr_message = Element(msg_number); |
---|
[1412] | 126 | if ((exist_className(tr_message, 'tr_msg_read') || exist_className(tr_message, 'tr_msg_read2')) && (!exist_className(tr_message, 'tr_msg_unread'))) |
---|
| 127 | increment_folder_unseen(); |
---|
[163] | 128 | remove_className(tr_message, 'selected_msg'); |
---|
| 129 | add_className(tr_message, 'tr_msg_unread'); |
---|
[2693] | 130 | Element("td_message_unseen_"+msg_number).innerHTML = "<img src ='templates/"+template+"/images/unseen.gif' title='"+get_lang('Unseen')+"'>"; |
---|
[2] | 131 | } |
---|
| 132 | |
---|
[163] | 133 | function set_msg_as_flagged(msg_number){ |
---|
| 134 | var msg = Element(msg_number); |
---|
| 135 | remove_className(msg, 'selected_msg'); |
---|
| 136 | add_className(msg, 'flagged_msg'); |
---|
[994] | 137 | Element("td_message_important_"+msg_number).innerHTML = "<img src ='templates/"+template+"/images/important.gif' title='"+get_lang('Important')+"'>"; |
---|
[2] | 138 | } |
---|
| 139 | |
---|
[163] | 140 | function set_msg_as_unflagged(msg_number){ |
---|
| 141 | var msg = Element(msg_number); |
---|
| 142 | remove_className(msg, 'selected_msg'); |
---|
| 143 | remove_className(msg, 'flagged_msg'); |
---|
[994] | 144 | Element("td_message_important_"+msg_number).innerHTML = " "; |
---|
[2] | 145 | } |
---|
| 146 | |
---|
[845] | 147 | function removeAll(id){ |
---|
| 148 | do |
---|
| 149 | { |
---|
| 150 | if (typeof(Element(id)) == 'undefined') |
---|
| 151 | break; |
---|
| 152 | Element(id).parentNode.removeChild(Element(id)); |
---|
| 153 | } |
---|
| 154 | while(Element(id)); |
---|
| 155 | } |
---|
| 156 | |
---|
[2] | 157 | function get_current_folder(){ |
---|
| 158 | return current_folder; |
---|
| 159 | } |
---|
| 160 | |
---|
| 161 | // Kill current box (folder or page). |
---|
| 162 | function kill_current_box(){ |
---|
| 163 | var box = document.getElementById("table_box"); |
---|
| 164 | if (box != null) |
---|
| 165 | box.parentNode.removeChild(box); |
---|
[320] | 166 | else |
---|
| 167 | return false; |
---|
[2] | 168 | } |
---|
| 169 | |
---|
| 170 | // Kill current paging. |
---|
| 171 | function kill_current_paging(){ |
---|
| 172 | var paging = Element("span_paging"); |
---|
| 173 | if (paging != null) |
---|
| 174 | paging.parentNode.removeChild(paging); |
---|
| 175 | } |
---|
| 176 | |
---|
[412] | 177 | function show_hide_span_paging(ID){ |
---|
| 178 | if ((ID != "0") && Element("span_paging")) |
---|
| 179 | Element("span_paging").style.display = 'none'; |
---|
| 180 | else |
---|
| 181 | if (Element("span_paging")) |
---|
| 182 | Element("span_paging").style.display = ''; |
---|
| 183 | } |
---|
| 184 | |
---|
[2] | 185 | //Get the current number of messages in a page. |
---|
| 186 | function get_messages_number_in_page(){ |
---|
| 187 | //Get element tBody. |
---|
| 188 | main = document.getElementById("tbody_box"); |
---|
[341] | 189 | |
---|
[2] | 190 | // Get all TR (messages) in tBody. |
---|
| 191 | main_list = main.childNodes; |
---|
[341] | 192 | |
---|
[2] | 193 | return main_list.length; |
---|
| 194 | } |
---|
| 195 | |
---|
[689] | 196 | function download_local_attachment(url) { |
---|
| 197 | if (div_attachment == null){ |
---|
| 198 | var div_attachment = document.createElement("DIV"); |
---|
| 199 | div_attachment.id="id_div_attachment"; |
---|
| 200 | document.body.appendChild(div_attachment); |
---|
| 201 | } |
---|
| 202 | div_attachment.innerHTML="<iframe style='display:none;width:0;height:0' name='attachment' src='"+url+"'></iframe>"; |
---|
| 203 | } |
---|
| 204 | |
---|
[271] | 205 | function download_attachments(msg_folder, msg_number, idx_file, msg_part, encoding, new_file_name, show_iframe){ |
---|
[2] | 206 | div_attachment = document.getElementById("id_div_attachment"); |
---|
| 207 | var params = ''; |
---|
[341] | 208 | |
---|
[2] | 209 | if (div_attachment == null){ |
---|
| 210 | var div_attachment = document.createElement("DIV"); |
---|
| 211 | div_attachment.id="id_div_attachment"; |
---|
| 212 | document.body.appendChild(div_attachment); |
---|
| 213 | } |
---|
| 214 | if(new_file_name) |
---|
[2133] | 215 | params = "&newfilename="+escape(new_file_name); |
---|
[2] | 216 | if(encoding) |
---|
| 217 | params += "&encoding="+encoding; |
---|
[271] | 218 | |
---|
[5] | 219 | div_attachment.innerHTML="<iframe style='display:none;width:0;height:0' name='attachment' src='inc/gotodownload.php?msg_folder="+msg_folder+"&msg_number="+msg_number+"&idx_file="+idx_file+"&msg_part="+msg_part+params+"'></iframe>"; |
---|
[2] | 220 | } |
---|
[271] | 221 | |
---|
[2] | 222 | function download_all_attachments(msg_folder, msg_number){ |
---|
[341] | 223 | var handler_source = function(data){ |
---|
[2] | 224 | download_attachments(null, null, data, null,null,'anexos.zip'); |
---|
| 225 | } |
---|
| 226 | cExecute("$this.exporteml.download_all_attachments",handler_source,"folder="+msg_folder+"&num_msg="+msg_number); |
---|
| 227 | } |
---|
[689] | 228 | //ADD forwarded files |
---|
| 229 | function addForwardedFile(id_border,file_name,link){ |
---|
| 230 | divFiles = document.getElementById("divFiles_"+id_border); |
---|
| 231 | |
---|
| 232 | if (! divFiles) |
---|
| 233 | return false; |
---|
| 234 | |
---|
| 235 | if (divFiles.lastChild) |
---|
| 236 | var countDivFiles = parseInt(divFiles.lastChild.id.split('_')[2]) + 1; |
---|
| 237 | |
---|
| 238 | if (! countDivFiles) |
---|
| 239 | var countDivFiles = 1; |
---|
| 240 | |
---|
| 241 | divFile = document.createElement('DIV'); |
---|
| 242 | |
---|
| 243 | |
---|
[1121] | 244 | if (!expresso_offline) { |
---|
| 245 | if (!is_ie) { |
---|
| 246 | var inputFile = document.createElement("INPUT"); |
---|
| 247 | |
---|
| 248 | var tmp_id_border = document.createAttribute('id_border'); |
---|
| 249 | tmp_id_border.value = id_border; |
---|
| 250 | |
---|
| 251 | inputFile.setAttributeNode(tmp_id_border); |
---|
| 252 | inputFile.id = "inputFile_" + id_border + "_" + countDivFiles; |
---|
| 253 | inputFile.type = 'file'; |
---|
| 254 | inputFile.size = 50; |
---|
| 255 | inputFile.maxLength = 255; |
---|
| 256 | inputFile.name = 'file_' + countDivFiles; |
---|
| 257 | inputFile.style.display = "none"; |
---|
| 258 | } |
---|
| 259 | else { |
---|
| 260 | var inputFile = document.createElement("link"); |
---|
| 261 | |
---|
| 262 | var tmp_id_border = document.createAttribute('id_border'); |
---|
| 263 | tmp_id_border.value = id_border; |
---|
| 264 | |
---|
| 265 | inputFile.setAttributeNode(tmp_id_border); |
---|
| 266 | inputFile.id = "inputFile_" + id_border + "_" + countDivFiles; |
---|
| 267 | inputFile.name = 'file_' + countDivFiles; |
---|
| 268 | |
---|
| 269 | |
---|
| 270 | } |
---|
[689] | 271 | |
---|
| 272 | } |
---|
| 273 | else { |
---|
[1121] | 274 | var inputFile = document.createElement("input"); |
---|
| 275 | inputFile.type = 'hidden'; |
---|
| 276 | inputFile.name = 'offline_forward_' + countDivFiles; |
---|
| 277 | } |
---|
| 278 | divFile.appendChild(inputFile); |
---|
[689] | 279 | |
---|
| 280 | var a_tmp = new Array(); |
---|
| 281 | a_tmp[0] = "local_"; |
---|
| 282 | a_tmp[1] = 'file_' + countDivFiles; |
---|
| 283 | a_tmp[2] = file_name; |
---|
| 284 | s_tmp = escape(connector.serialize(a_tmp)); |
---|
| 285 | var checkbox = document.createElement("INPUT"); |
---|
| 286 | checkbox.type = "checkbox"; |
---|
| 287 | checkbox.id = "checkbox_"+id_border+"_"+countDivFiles; |
---|
| 288 | checkbox.name = "local_attachments[]"; |
---|
| 289 | |
---|
| 290 | checkbox.value = s_tmp; |
---|
| 291 | divFile.appendChild(checkbox); |
---|
| 292 | |
---|
| 293 | var link_attachment = document.createElement("A"); |
---|
| 294 | link_attachment.setAttribute("href", link); |
---|
| 295 | |
---|
| 296 | link_attachment.innerHTML = file_name; |
---|
| 297 | divFile.appendChild(link_attachment); |
---|
| 298 | |
---|
| 299 | countDivFiles++; |
---|
| 300 | divFile.id = "divFile_"+id_border+"_"+countDivFiles; |
---|
| 301 | divFiles.appendChild(divFile); |
---|
| 302 | |
---|
| 303 | checkbox.checked = true; //IncrÃvel, mas no Internet Explorer o checked só funciona efetivamente se o elemente já estiver renderizado... por isso só aqui eu seleciono ele... |
---|
| 304 | return inputFile; |
---|
| 305 | } |
---|
| 306 | |
---|
[2] | 307 | // Add Input File Dynamically. |
---|
| 308 | function addFile(id_border){ |
---|
| 309 | divFiles = document.getElementById("divFiles_"+id_border); |
---|
[320] | 310 | if (! divFiles) |
---|
| 311 | return false; |
---|
[341] | 312 | |
---|
[271] | 313 | if (divFiles.lastChild) |
---|
| 314 | var countDivFiles = parseInt(divFiles.lastChild.id.split('_')[2]) + 1; |
---|
| 315 | |
---|
| 316 | if (! countDivFiles) |
---|
| 317 | var countDivFiles = 1; |
---|
[341] | 318 | |
---|
[2] | 319 | divFile = document.createElement('DIV'); |
---|
[341] | 320 | |
---|
| 321 | |
---|
[1121] | 322 | divFile.innerHTML = "<input type='file' id_border='"+id_border+"' size='50' maxLength='255' onchange=\"function () {validateFileExtension(this.value, this.id.replace('input','div'), this.getAttribute('id_border'));};\" id='"+"inputFile_"+id_border+"_"+countDivFiles+"' name='file_"+countDivFiles+"'>"; |
---|
| 323 | |
---|
[341] | 324 | |
---|
[271] | 325 | var linkFile = document.createElement("A"); |
---|
| 326 | linkFile.id = "linkFile_"+id_border+"_"+countDivFiles; |
---|
[2] | 327 | linkFile.href='javascript:void(0)'; |
---|
[320] | 328 | linkFile.onclick=function () {removeFile(this.id.replace("link","div")); return false;}; |
---|
[341] | 329 | linkFile.innerHTML=get_lang("Remove"); |
---|
[2] | 330 | //divFile.innerHTML += " "; |
---|
| 331 | divFile.appendChild(linkFile); |
---|
[341] | 332 | divFile.id = "divFile_"+id_border+"_"+countDivFiles; |
---|
[2] | 333 | divFiles.appendChild(divFile); |
---|
[689] | 334 | |
---|
[1121] | 335 | |
---|
| 336 | |
---|
| 337 | return document.getElementById("inputFile_"+id_border+"_"+countDivFiles); |
---|
[2] | 338 | } |
---|
| 339 | // Remove Input File Dynamically. |
---|
| 340 | function removeFile(id){ |
---|
[271] | 341 | var border_id = id.substr(8,1); |
---|
[2] | 342 | var el = Element(id); |
---|
| 343 | el.parentNode.removeChild(el); |
---|
| 344 | } |
---|
| 345 | |
---|
| 346 | function validateFileExtension(fileName, id, id_border){ |
---|
[320] | 347 | |
---|
[271] | 348 | var error_flag = false; |
---|
[320] | 349 | |
---|
| 350 | if ( fileName.indexOf('/') != -1 ) |
---|
| 351 | { |
---|
| 352 | if (fileName[0] != '/'){ // file name is windows format? |
---|
| 353 | var file = fileName.substr(fileName.lastIndexOf('\\') + 1, fileName.length); |
---|
| 354 | if ((fileName.indexOf(':\\') != 1) && (fileName.indexOf('\\\\') != 0)) // Is stored in partition or a network file? |
---|
| 355 | error_flag = true; |
---|
| 356 | } |
---|
| 357 | else // is Unix |
---|
| 358 | var file = fileName.substr(fileName.lastIndexOf('/') + 1, fileName.length); |
---|
[271] | 359 | } |
---|
[320] | 360 | else // is Firefox 3 |
---|
| 361 | var file = fileName; |
---|
[271] | 362 | |
---|
| 363 | var fileExtension = file.split("."); |
---|
[2] | 364 | fileExtension = fileExtension[(fileExtension.length-1)]; |
---|
| 365 | for(var i=0; i<denyFileExtensions.length; i++) |
---|
| 366 | { |
---|
| 367 | if(denyFileExtensions[i] == fileExtension) |
---|
| 368 | { |
---|
[271] | 369 | error_flag = true; |
---|
| 370 | break; |
---|
[2] | 371 | } |
---|
[271] | 372 | |
---|
[2] | 373 | } |
---|
[271] | 374 | |
---|
[320] | 375 | if ( error_flag == true ) |
---|
| 376 | { |
---|
[271] | 377 | alert(get_lang('File extension forbidden or invalid file') + '.'); |
---|
| 378 | removeFile(id); |
---|
| 379 | addFile(id_border); |
---|
| 380 | return false; |
---|
| 381 | } |
---|
| 382 | return true; |
---|
[2] | 383 | } |
---|
| 384 | |
---|
| 385 | var setTimeout_write_msg = 0; |
---|
[197] | 386 | var old_msg = false; |
---|
| 387 | // Funcao usada para escrever mensagem |
---|
| 388 | // notimeout = True : mensagem nao apaga |
---|
[341] | 389 | function write_msg(msg, notimeout){ |
---|
| 390 | |
---|
[2] | 391 | if (setTimeout_write_msg) |
---|
| 392 | clearTimeout(setTimeout_write_msg); |
---|
[341] | 393 | |
---|
[80] | 394 | var msg_div = Element('em_div_write_msg'); |
---|
[2] | 395 | var old_divStatusBar = Element("divStatusBar"); |
---|
| 396 | |
---|
[80] | 397 | if(!msg_div) { |
---|
| 398 | msg_div = document.createElement('DIV'); |
---|
| 399 | msg_div.id = 'em_div_write_msg'; |
---|
[831] | 400 | msg_div.className = 'em_div_write_msg'; |
---|
[80] | 401 | old_divStatusBar.parentNode.insertBefore(msg_div,old_divStatusBar); |
---|
[447] | 402 | } |
---|
| 403 | |
---|
| 404 | if( document.getElementById('JabberMessenger')) |
---|
[651] | 405 | loadscript.adIcon(); |
---|
[447] | 406 | |
---|
[831] | 407 | msg_div.innerHTML = '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><th width="40%"></th><th noWrap class="action_info_th">'+msg+'</th><th width="40%"></th></tr></tbody></table>'; |
---|
[651] | 408 | |
---|
[80] | 409 | old_divStatusBar.style.display = 'none'; |
---|
[341] | 410 | msg_div.style.display = ''; |
---|
[2] | 411 | // Nao ponha var na frente!! jakjr |
---|
| 412 | handle_write_msg = function(){ |
---|
| 413 | try{ |
---|
[197] | 414 | if(!old_msg) |
---|
| 415 | clean_msg(); |
---|
| 416 | else |
---|
[341] | 417 | write_msg(old_msg, true); |
---|
[2] | 418 | } |
---|
| 419 | catch(e){} |
---|
| 420 | } |
---|
[197] | 421 | if(notimeout) |
---|
| 422 | old_msg = msg; |
---|
| 423 | else |
---|
| 424 | setTimeout_write_msg = setTimeout("handle_write_msg();", 5000); |
---|
[2] | 425 | } |
---|
[197] | 426 | // Funcao usada para apagar mensagem sem timeout |
---|
| 427 | function clean_msg(){ |
---|
| 428 | old_msg = false; |
---|
| 429 | var msg_div = Element('em_div_write_msg'); |
---|
| 430 | var old_divStatusBar = Element("divStatusBar"); |
---|
| 431 | if(msg_div) |
---|
| 432 | msg_div.style.display = 'none'; |
---|
[341] | 433 | old_divStatusBar.style.display = ''; |
---|
[197] | 434 | } |
---|
[2] | 435 | |
---|
| 436 | function make_body_reply(body, to, date_day, date_hour){ |
---|
| 437 | to = to.replace("<","<"); |
---|
| 438 | to = to.replace(">",">"); |
---|
| 439 | block_quoted_body ="<br><br>"; |
---|
[197] | 440 | block_quoted_body += get_lang('At %1, %2 hours, %3 wrote:', date_day, date_hour, to); |
---|
[2] | 441 | block_quoted_body += "<blockquote style=\"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;\">"; |
---|
| 442 | block_quoted_body += body; |
---|
| 443 | block_quoted_body += "</blockquote>"; |
---|
| 444 | return block_quoted_body; |
---|
| 445 | } |
---|
| 446 | |
---|
| 447 | function make_forward_body(body, from, date, subject, to, cc){ |
---|
| 448 | from = from.replace(/</g,"<"); |
---|
| 449 | from = from.replace(/>/g,">"); |
---|
| 450 | to = to.replace(/</g,"<"); |
---|
| 451 | to = to.replace(/>/g,">"); |
---|
| 452 | var forward_body = '<BR><BR>---------- ' + get_lang('Forwarded message') + ' ----------<BR>'; |
---|
| 453 | forward_body += get_lang('From') + ': ' + from + '<BR>'; |
---|
| 454 | forward_body += get_lang('Date') + ': ' + date + '<BR>'; |
---|
| 455 | forward_body += get_lang('Subject') + ': ' + subject + '<BR>'; |
---|
| 456 | forward_body += get_lang('To') + ': ' + to+ '<BR>'; |
---|
| 457 | if(cc != undefined){ |
---|
| 458 | cc = cc.replace(/</g,"<"); |
---|
| 459 | cc = cc.replace(/>/g,">"); |
---|
| 460 | forward_body += get_lang('CC') + ': ' + cc+ '<BR><BR>'; |
---|
| 461 | } |
---|
| 462 | forward_body += body; |
---|
| 463 | return forward_body; |
---|
| 464 | } |
---|
| 465 | |
---|
| 466 | function emMessageSearch(e,value){ |
---|
| 467 | var e = is_ie ? window.event : e; |
---|
| 468 | if(e.keyCode == 13) { |
---|
| 469 | search_emails(value); |
---|
| 470 | } |
---|
| 471 | } |
---|
| 472 | |
---|
| 473 | function emQuickSearch(emailList, field, ID){ |
---|
| 474 | var quickSearchKeyBegin; |
---|
| 475 | var quickSearchKeyEnd; |
---|
[1121] | 476 | if(expresso_offline) { |
---|
| 477 | alert(get_lang('Not allowed in offline mode')); |
---|
| 478 | return; |
---|
| 479 | } |
---|
| 480 | |
---|
[37] | 481 | var handler_emQuickSearch = function(data) |
---|
| 482 | { |
---|
[2] | 483 | window_DropDownContacts = Element('tipDiv'); |
---|
| 484 | if (window_DropDownContacts.style.visibility != 'hidden'){ |
---|
| 485 | window_DropDownContacts.style.visibility = 'hidden'; |
---|
| 486 | } |
---|
[341] | 487 | |
---|
[2] | 488 | if ((!data.status) && (data.error == "many results")){ |
---|
| 489 | alert(get_lang('More than %1 results. Please, try to refine your search.',200)); |
---|
| 490 | return false; |
---|
| 491 | } |
---|
[341] | 492 | |
---|
[2] | 493 | if (data.length > 0){ |
---|
[37] | 494 | if ((field != 'null') && (ID != 'null')) |
---|
| 495 | { |
---|
| 496 | connector.loadScript("QuickCatalogSearch"); |
---|
| 497 | QuickCatalogSearch.showList(data, quickSearchKeyBegin, quickSearchKeyEnd); |
---|
| 498 | } |
---|
| 499 | else |
---|
| 500 | { |
---|
| 501 | connector.loadScript("QuickSearchUser"); |
---|
| 502 | QuickSearchUser.showList(data); |
---|
| 503 | } |
---|
[2] | 504 | } |
---|
| 505 | else |
---|
| 506 | alert(get_lang('None result was found.')); |
---|
| 507 | return true; |
---|
| 508 | } |
---|
[341] | 509 | |
---|
[37] | 510 | if ((field != 'null') && (ID != 'null')) |
---|
| 511 | { |
---|
[341] | 512 | Element(field +'_'+ ID).focus(); //It requires for IE. |
---|
[37] | 513 | var i = getPosition(Element(field +'_'+ ID)); //inputBox.selectionStart; |
---|
| 514 | var j = --i; |
---|
[2] | 515 | |
---|
[37] | 516 | // Acha o inicio |
---|
| 517 | while ((j >= 0) && (emailList.charAt(j) != ',')){j--}; |
---|
| 518 | quickSearchKeyBegin = ++j; |
---|
[2] | 519 | |
---|
[37] | 520 | // Acha o final |
---|
| 521 | while ((i <= emailList.length) && (emailList.charAt(i) != ',')){i++}; |
---|
| 522 | quickSearchKeyEnd = i; |
---|
[2] | 523 | |
---|
[37] | 524 | // A Chave da Pesquisa |
---|
| 525 | var search_for = trim(emailList.substring(quickSearchKeyBegin, quickSearchKeyEnd)); |
---|
| 526 | } |
---|
| 527 | else |
---|
| 528 | var search_for = emailList; |
---|
[341] | 529 | |
---|
[2] | 530 | if (search_for.length < 4){ |
---|
| 531 | alert(get_lang('Your search argument must be longer than 4 characters.')); |
---|
| 532 | return false; |
---|
| 533 | } |
---|
[341] | 534 | |
---|
[2] | 535 | cExecute ("$this.ldap_functions.quicksearch&search_for="+search_for+"&field="+field+"&ID="+ID, handler_emQuickSearch); |
---|
| 536 | } |
---|
| 537 | |
---|
| 538 | function folderbox(){ |
---|
| 539 | connector.loadScript("TreeS"); |
---|
| 540 | ttree.make_Window(); |
---|
| 541 | } |
---|
| 542 | |
---|
| 543 | function filterbox(){ |
---|
| 544 | connector.loadScript("filter"); |
---|
| 545 | connector.loadScript("filters"); |
---|
| 546 | filters.Forms(); |
---|
| 547 | } |
---|
| 548 | |
---|
| 549 | function sharebox(){ |
---|
| 550 | var handler_imap_getacl = function(data) |
---|
| 551 | { |
---|
| 552 | var options = ''; |
---|
| 553 | for (var x in data) |
---|
| 554 | { |
---|
| 555 | options += "<option value='"+data[x].uid+"'>"+data[x].cn+"</option>"; |
---|
| 556 | } |
---|
| 557 | connector.loadScript("sharemailbox"); |
---|
| 558 | sharemailbox.makeWindow(options); |
---|
| 559 | } |
---|
| 560 | cExecute ("$this.imap_functions.getacl", handler_imap_getacl); |
---|
| 561 | } |
---|
| 562 | |
---|
| 563 | function preferences_mail(){ |
---|
[1186] | 564 | location.href="../preferences/preferences.php?appname=expressoMail1_2"; |
---|
[2] | 565 | } |
---|
| 566 | |
---|
| 567 | function search_emails(value){ |
---|
| 568 | connector.loadScript("search"); |
---|
| 569 | EsearchE.showForms(value); |
---|
| 570 | } |
---|
| 571 | |
---|
| 572 | function source_msg(id_msg,folder){ |
---|
| 573 | var num_msg = id_msg.substr(0,(id_msg.length - 2)); |
---|
| 574 | var handler_source = function(data){ |
---|
| 575 | download_attachments(null, null, data, null,null,'fonte_da_mensagem.txt'); |
---|
| 576 | } |
---|
| 577 | cExecute("$this.exporteml.export_msg",handler_source,"folder="+url_decode(folder)+"&msgs_to_export="+num_msg); |
---|
| 578 | } |
---|
| 579 | |
---|
| 580 | function url_encode(str){ |
---|
[341] | 581 | var hex_chars = "0123456789ABCDEF"; |
---|
| 582 | var noEncode = /^([a-zA-Z0-9\_\-\.])$/; |
---|
| 583 | var n, strCode, hex1, hex2, strEncode = ""; |
---|
[2] | 584 | |
---|
[341] | 585 | for(n = 0; n < str.length; n++) { |
---|
| 586 | if (noEncode.test(str.charAt(n))) { |
---|
| 587 | strEncode += str.charAt(n); |
---|
| 588 | } else { |
---|
| 589 | strCode = str.charCodeAt(n); |
---|
| 590 | hex1 = hex_chars.charAt(Math.floor(strCode / 16)); |
---|
| 591 | hex2 = hex_chars.charAt(strCode % 16); |
---|
| 592 | strEncode += "%" + (hex1 + hex2); |
---|
| 593 | } |
---|
| 594 | } |
---|
| 595 | return strEncode; |
---|
| 596 | } |
---|
[2] | 597 | |
---|
[341] | 598 | function url_decode(str) { |
---|
[2] | 599 | |
---|
[341] | 600 | var n, strCode, strDecode = ""; |
---|
| 601 | for (n = 0; n < str.length; n++) { |
---|
| 602 | if (str.charAt(n) == "%") { |
---|
| 603 | strCode = str.charAt(n + 1) + str.charAt(n + 2); |
---|
| 604 | strDecode += String.fromCharCode(parseInt(strCode, 16)); |
---|
| 605 | n += 2; |
---|
| 606 | } else { |
---|
| 607 | strDecode += str.charAt(n); |
---|
| 608 | } |
---|
| 609 | } |
---|
| 610 | return strDecode; |
---|
| 611 | } |
---|
[2] | 612 | |
---|
[569] | 613 | function Element (el) { |
---|
| 614 | return document.getElementById(el); |
---|
[2] | 615 | } |
---|
| 616 | |
---|
| 617 | function getPosition(obj) |
---|
| 618 | { |
---|
| 619 | if(typeof obj.selectionStart != "undefined") |
---|
| 620 | { |
---|
| 621 | return obj.selectionStart; |
---|
| 622 | } |
---|
| 623 | else if(document.selection && document.selection.createRange) |
---|
| 624 | { |
---|
| 625 | var M = document.selection.createRange(); |
---|
| 626 | try |
---|
| 627 | { |
---|
| 628 | var Lp = M.duplicate(); |
---|
| 629 | Lp.moveToElementText(obj); |
---|
| 630 | } |
---|
| 631 | catch(e) |
---|
| 632 | { |
---|
| 633 | var Lp=obj.createTextRange(); |
---|
| 634 | } |
---|
[341] | 635 | |
---|
[2] | 636 | Lp.setEndPoint("EndToStart",M); |
---|
| 637 | var rb=Lp.text.length; |
---|
[341] | 638 | |
---|
[2] | 639 | if(rb > obj.value.length) |
---|
| 640 | { |
---|
| 641 | return -1; |
---|
| 642 | } |
---|
| 643 | return rb; |
---|
| 644 | } |
---|
| 645 | } |
---|
| 646 | |
---|
| 647 | function trim(inputString) { |
---|
[341] | 648 | if (typeof inputString != "string") |
---|
[2] | 649 | return inputString; |
---|
[341] | 650 | |
---|
[2] | 651 | var retValue = inputString; |
---|
| 652 | var ch = retValue.substring(0, 1); |
---|
[341] | 653 | while (ch == " ") { |
---|
[2] | 654 | retValue = retValue.substring(1, retValue.length); |
---|
| 655 | ch = retValue.substring(0, 1); |
---|
| 656 | } |
---|
| 657 | ch = retValue.substring(retValue.length-1, retValue.length); |
---|
[341] | 658 | while (ch == " ") { |
---|
[2] | 659 | retValue = retValue.substring(0, retValue.length-1); |
---|
| 660 | ch = retValue.substring(retValue.length-1, retValue.length); |
---|
| 661 | } |
---|
[341] | 662 | while (retValue.indexOf(" ") != -1) { |
---|
| 663 | retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); |
---|
[2] | 664 | } |
---|
[341] | 665 | return retValue; |
---|
[2] | 666 | } |
---|
| 667 | |
---|
| 668 | function increment_folder_unseen(){ |
---|
| 669 | var folder_id = get_current_folder(); |
---|
[812] | 670 | |
---|
[2] | 671 | var folder_unseen = Element('dftree_'+folder_id+'_unseen'); |
---|
[406] | 672 | var abas_unseen = Element('new_m').innerHTML; |
---|
| 673 | abas_unseen = abas_unseen.match( /[0-9]+/); |
---|
| 674 | |
---|
[2] | 675 | if (folder_unseen) |
---|
| 676 | { |
---|
| 677 | folder_unseen.innerHTML = (parseInt(folder_unseen.innerHTML) + 1); |
---|
| 678 | } |
---|
| 679 | else |
---|
| 680 | { |
---|
[823] | 681 | tree_folders.getNodeById(folder_id).alter({caption: tree_folders.getNodeById(current_folder).caption + '<font style=color:red> (</font><span id="dftree_'+current_folder+'_unseen" style=color:red>1</span><font style=color:red>)</font>'}); |
---|
[2] | 682 | tree_folders.getNodeById(folder_id)._refresh(); |
---|
| 683 | } |
---|
[406] | 684 | if (abas_unseen) |
---|
[812] | 685 | { |
---|
| 686 | abas_unseen = parseInt(abas_unseen) + 1; |
---|
| 687 | Element('new_m').innerHTML = '<font style="color:red">' + abas_unseen + '</font>'; |
---|
[406] | 688 | } |
---|
[812] | 689 | else{ |
---|
| 690 | abas_unseen = Element('new_m').innerHTML; |
---|
| 691 | abas_unseen = abas_unseen.match( /[0-9]+/); |
---|
| 692 | abas_unseen = parseInt(abas_unseen) + 1; |
---|
| 693 | Element('new_m').innerHTML = '<font style="color:red">' + abas_unseen + '</font>'; |
---|
| 694 | } |
---|
[1000] | 695 | if ( current_folder.indexOf( 'INBOX' ) !== 0 && current_folder.indexOf( 'local_' ) !== 0 ) |
---|
[823] | 696 | { |
---|
| 697 | var display_unseen_in_shared_folders = Element('dftree_user_unseen'); |
---|
| 698 | if ( display_unseen_in_shared_folders ) |
---|
| 699 | tree_folders.getNodeById( 'user' ).alter({caption:'<font style=color:red>[</font><span id="dftree_user_unseen" style="color:red">' + ( parseInt( display_unseen_in_shared_folders.innerHTML) + 1 ) + '</span><font style=color:red>]</font>' + get_lang("Shared folders")}); |
---|
| 700 | else |
---|
| 701 | tree_folders.getNodeById( 'user' ).alter({caption:'<font style=color:red>[</font><span id="dftree_user_unseen" style="color:red">1</span><font style=color:red>]</font>' + get_lang("Shared folders")}); |
---|
| 702 | tree_folders.getNodeById( 'user' )._refresh(); |
---|
| 703 | } |
---|
| 704 | var display_unseen_in_mailbox = Element('dftree_root_unseen'); |
---|
[1121] | 705 | if(!expresso_offline) |
---|
| 706 | var node_to_refresh = 'root'; |
---|
| 707 | else |
---|
| 708 | var node_to_refresh = 'local_root'; |
---|
| 709 | tree_folders.getNodeById( node_to_refresh )._refresh(); |
---|
[2] | 710 | } |
---|
| 711 | function decrement_folder_unseen(){ |
---|
| 712 | var folder_id = get_current_folder(); |
---|
[812] | 713 | |
---|
[2] | 714 | var folder_unseen = Element('dftree_'+folder_id+'_unseen'); |
---|
[406] | 715 | var abas_unseen = Element('new_m').innerHTML; |
---|
| 716 | abas_unseen = abas_unseen.match( /[0-9]+/); |
---|
| 717 | |
---|
| 718 | if(!folder_unseen || !abas_unseen) |
---|
[2] | 719 | return; |
---|
| 720 | |
---|
| 721 | if ((folder_unseen) && (parseInt(folder_unseen.innerHTML) > 1)) |
---|
| 722 | { |
---|
| 723 | folder_unseen.innerHTML = (parseInt(folder_unseen.innerHTML) - 1); |
---|
| 724 | } |
---|
| 725 | else if (parseInt(folder_unseen.innerHTML) <= 1) |
---|
| 726 | { |
---|
| 727 | var tmp_folder_name = tree_folders.getNodeById(folder_id).caption.split('<'); |
---|
| 728 | var folder_name = tmp_folder_name[0]; |
---|
| 729 | tree_folders.getNodeById(folder_id).alter({caption: folder_name}); |
---|
| 730 | tree_folders.getNodeById(folder_id)._refresh(); |
---|
| 731 | } |
---|
[406] | 732 | if ((abas_unseen) && (parseInt(abas_unseen) > 1)) |
---|
| 733 | { |
---|
| 734 | abas_unseen = (parseInt(abas_unseen) - 1); |
---|
| 735 | Element('new_m').innerHTML = '<font style="color:red">' + abas_unseen + '</font>'; |
---|
[812] | 736 | } |
---|
[406] | 737 | else if (parseInt(abas_unseen) <= 1) |
---|
| 738 | { |
---|
[470] | 739 | Element('new_m').innerHTML = '0'; |
---|
[406] | 740 | } |
---|
[823] | 741 | if ( current_folder.indexOf( 'INBOX' ) !== 0 ) |
---|
| 742 | { |
---|
| 743 | var display_unseen_in_shared_folders = Element('dftree_user_unseen'); |
---|
| 744 | if ( display_unseen_in_shared_folders ) |
---|
| 745 | { |
---|
| 746 | var unseen_in_shared_folders = parseInt( display_unseen_in_shared_folders.innerHTML ); |
---|
| 747 | unseen_in_shared_folders--; |
---|
| 748 | if ( unseen_in_shared_folders > 0 ) |
---|
| 749 | tree_folders.getNodeById( 'user' ).alter({caption:'<font style=color:red>[</font><span id="dftree_root_unseen" style="color:red">' + unseen_in_shared_folders + '</span><font style=color:red>]</font>' + get_lang("My Folders")}); |
---|
| 750 | else |
---|
| 751 | tree_folders.getNodeById( 'user' ).alter({caption:get_lang("Shared folders")}); |
---|
| 752 | tree_folders.getNodeById( 'user' )._refresh(); |
---|
| 753 | } |
---|
| 754 | } |
---|
| 755 | var display_unseen_in_mailbox = Element('dftree_root_unseen'); |
---|
| 756 | if ( display_unseen_in_mailbox ) |
---|
| 757 | { |
---|
| 758 | var unseen_in_mailbox = parseInt( display_unseen_in_mailbox.innerHTML ); |
---|
| 759 | unseen_in_mailbox--; |
---|
| 760 | //if ( unseen_in_mailbox > 0 ) |
---|
| 761 | // tree_folders.getNodeById( 'root' ).alter({caption:'<font style=color:red>[</font><span id="dftree_root_unseen" style="color:red">' + unseen_in_mailbox + '</span><font style=color:red>]</font>' + get_lang("My Folders")}); |
---|
| 762 | //else |
---|
[1121] | 763 | if(!expresso_offline) |
---|
| 764 | var node_to_refresh = 'root'; |
---|
| 765 | else |
---|
| 766 | var node_to_refresh = 'local_root'; |
---|
| 767 | tree_folders.getNodeById( node_to_refresh ).alter({caption:get_lang("My Folders")}); |
---|
| 768 | tree_folders.getNodeById( node_to_refresh )._refresh(); |
---|
[823] | 769 | } |
---|
[2] | 770 | } |
---|
| 771 | |
---|
| 772 | function LTrim(value){ |
---|
| 773 | var w_space = String.fromCharCode(32); |
---|
| 774 | var strTemp = ""; |
---|
| 775 | var iTemp = 0; |
---|
[812] | 776 | |
---|
[814] | 777 | var v_length = value ? value.length : 0; |
---|
[2] | 778 | if(v_length < 1) |
---|
| 779 | return ""; |
---|
| 780 | |
---|
| 781 | while(iTemp < v_length){ |
---|
| 782 | if(value && value.charAt(iTemp) != w_space){ |
---|
| 783 | strTemp = value.substring(iTemp,v_length); |
---|
| 784 | break; |
---|
| 785 | } |
---|
| 786 | iTemp++; |
---|
[812] | 787 | } |
---|
[2] | 788 | return strTemp; |
---|
| 789 | } |
---|
| 790 | |
---|
| 791 | //changes MENU background color. |
---|
| 792 | function set_menu_bg(menu) |
---|
| 793 | { |
---|
| 794 | menu.style.backgroundColor = 'white'; |
---|
| 795 | menu.style.border = '1px solid black'; |
---|
[814] | 796 | menu.style.padding = '0px 0px'; |
---|
[2] | 797 | } |
---|
| 798 | //changes MENU background color. |
---|
| 799 | function unset_menu_bg(menu) |
---|
| 800 | { |
---|
| 801 | menu.style.backgroundColor = ''; |
---|
[814] | 802 | menu.style.border = '0px'; |
---|
| 803 | menu.style.padding = '1px 0px'; |
---|
[2] | 804 | } |
---|
| 805 | |
---|
[46] | 806 | function array_search(needle, haystack) { |
---|
| 807 | var n = haystack.length; |
---|
| 808 | for (var i=0; i<n; i++) { |
---|
| 809 | if (haystack[i]==needle) { |
---|
| 810 | return true; |
---|
| 811 | } |
---|
| 812 | } |
---|
| 813 | return false; |
---|
[96] | 814 | } |
---|
| 815 | |
---|
[812] | 816 | function lang_folder(fn) { |
---|
[689] | 817 | if (fn.toUpperCase() == "INBOX") return get_lang("Inbox"); |
---|
[365] | 818 | if (special_folders[fn] && typeof(special_folders[fn]) == 'string') { |
---|
[96] | 819 | return get_lang(special_folders[fn]); |
---|
[673] | 820 | } |
---|
[96] | 821 | return fn; |
---|
[812] | 822 | } |
---|
[163] | 823 | |
---|
| 824 | function add_className(obj, className){ |
---|
[651] | 825 | if (obj && !exist_className(obj, className)) |
---|
[163] | 826 | obj.className = obj.className + ' ' + className; |
---|
| 827 | } |
---|
| 828 | |
---|
| 829 | function remove_className(obj, className){ |
---|
| 830 | var re = new RegExp("\\s*"+className); |
---|
[320] | 831 | if (obj) |
---|
[976] | 832 | obj.className = obj.className.replace(re, ' '); |
---|
[163] | 833 | } |
---|
| 834 | |
---|
| 835 | function exist_className(obj, className){ |
---|
[651] | 836 | return ( obj && obj.className.indexOf(className) != -1 ) |
---|
[163] | 837 | } |
---|
| 838 | |
---|
| 839 | function select_all_messages(select) |
---|
| 840 | { |
---|
| 841 | var main = Element("tbody_box"); |
---|
| 842 | var main_list = main.childNodes; |
---|
| 843 | var len_main_list = main_list.length; |
---|
[341] | 844 | |
---|
[163] | 845 | if (select) |
---|
| 846 | { |
---|
| 847 | for (i=0; i<len_main_list; i++) |
---|
| 848 | { |
---|
| 849 | Element("check_box_message_"+main_list[i].id).checked = true; |
---|
| 850 | add_className(Element(main_list[i].id), 'selected_msg'); |
---|
| 851 | } |
---|
| 852 | } |
---|
| 853 | else |
---|
| 854 | { |
---|
| 855 | for (i=0; i<len_main_list; i++) |
---|
| 856 | { |
---|
| 857 | Element("check_box_message_"+main_list[i].id).checked = false; |
---|
| 858 | remove_className(Element(main_list[i].id), 'selected_msg'); |
---|
| 859 | } |
---|
| 860 | } |
---|
[2758] | 861 | } |
---|
| 862 | |
---|
| 863 | function borkb(size){ |
---|
| 864 | kbyte = 1024; |
---|
| 865 | mbyte = kbyte*1024; |
---|
| 866 | gbyte = mbyte*1024; |
---|
| 867 | if (!size) |
---|
| 868 | size = 0; |
---|
| 869 | if (size < kbyte) |
---|
| 870 | return size + ' B'; |
---|
| 871 | else if (size < mbyte) |
---|
| 872 | return parseInt(size/kbyte) + ' KB'; |
---|
| 873 | else if (size < gbyte) |
---|
| 874 | if (size/mbyte > 100) |
---|
| 875 | return (size/mbyte).toFixed(0) + ' MB'; |
---|
| 876 | else |
---|
| 877 | return (size/mbyte).toFixed(1) + ' MB'; |
---|
| 878 | else |
---|
| 879 | return parseInt(size/gbyte).toFixed(1) + ' GB'; |
---|
| 880 | } |
---|
| 881 | |
---|
| 882 | |
---|