[2] | 1 | // BEGIN: FUNCTION RESIZE WINDOW |
---|
[1121] | 2 | if (!expresso_offline) { |
---|
| 3 | var _showBar = showBar; |
---|
| 4 | var _hideBar = hideBar; |
---|
| 5 | } |
---|
[2] | 6 | |
---|
| 7 | function __showBar(){ |
---|
| 8 | _showBar(); |
---|
| 9 | resizeWindow(); |
---|
| 10 | } |
---|
| 11 | |
---|
| 12 | function __hideBar(){ |
---|
| 13 | _hideBar(); |
---|
| 14 | resizeWindow(); |
---|
| 15 | } |
---|
| 16 | showBar = __showBar; |
---|
| 17 | hideBar = __hideBar; |
---|
| 18 | |
---|
| 19 | window.onresize = resizeWindow; |
---|
| 20 | |
---|
[5134] | 21 | var message = "Não Informado"; |
---|
| 22 | |
---|
[320] | 23 | function config_events(pObj, pEvent, pHandler) |
---|
| 24 | { |
---|
| 25 | if( typeof pObj == 'object') |
---|
| 26 | { |
---|
| 27 | if( pEvent.substring(0, 2) == 'on') |
---|
| 28 | pEvent = pEvent.substring(2, pEvent.length); |
---|
| 29 | |
---|
| 30 | if ( pObj.addEventListener ) |
---|
| 31 | pObj.addEventListener(pEvent, pHandler, false); |
---|
| 32 | else if( pObj.attachEvent ) |
---|
| 33 | pObj.attachEvent('on' + pEvent, pHandler ); |
---|
| 34 | } |
---|
| 35 | } |
---|
| 36 | |
---|
[2] | 37 | function resizeWindow(){ |
---|
| 38 | |
---|
[3369] | 39 | var divScrollMain = Element("divScrollMain_"+numBox); |
---|
| 40 | var table_message = Element("table_message"); |
---|
| 41 | var content_folders = Element("content_folders"); |
---|
[5848] | 42 | |
---|
[5849] | 43 | var clientWidth = 0, clientHeight = 0; |
---|
| 44 | if( typeof( window.innerWidth ) == 'number' ) { |
---|
[5848] | 45 | //Non-IE |
---|
| 46 | clientWidth = window.innerWidth; |
---|
| 47 | clientHeight = window.innerHeight; |
---|
[5849] | 48 | } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { |
---|
[5848] | 49 | //IE 6+ in 'standards compliant mode' |
---|
| 50 | clientWidth = document.documentElement.clientWidth; |
---|
| 51 | clientHeight = document.documentElement.clientHeight; |
---|
[5849] | 52 | } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { |
---|
[5848] | 53 | //IE 4 compatible |
---|
| 54 | clientWidth = document.body.clientWidth; |
---|
| 55 | clientHeight = document.body.clientHeight; |
---|
[5849] | 56 | } |
---|
[5848] | 57 | clientHeight = clientHeight - 8; |
---|
[2] | 58 | |
---|
[3369] | 59 | if(divScrollMain){ |
---|
| 60 | divScrollMain.style.height = (clientHeight - (findPosY(divScrollMain) + (table_message.clientHeight ? table_message.clientHeight : table_message.offsetHeight))) + "px"; |
---|
| 61 | } |
---|
[66] | 62 | |
---|
[813] | 63 | if(typeof(BordersArray) != 'undefined') { |
---|
[65] | 64 | for(var i = 1; BordersArray.length > 1 && i < BordersArray.length;i++) { |
---|
| 65 | var div_scroll = Element("div_message_scroll_"+BordersArray[i].sequence); |
---|
| 66 | var div = Element("content_id_"+BordersArray[i].sequence); |
---|
[813] | 67 | |
---|
[3369] | 68 | if(div){ |
---|
| 69 | div.style.height = (clientHeight - (findPosY(div) + (table_message.clientHeight ? table_message.clientHeight : table_message.offsetHeight)+2)) + "px"; |
---|
| 70 | div.style.width = (clientWidth - (findPosX(div)+10)) + "px"; |
---|
| 71 | } |
---|
| 72 | if(div_scroll){ |
---|
| 73 | div_scroll.style.height = (clientHeight - (findPosY(div_scroll) + (table_message.clientHeight ? table_message.clientHeight : table_message.offsetHeight)+5)) + "px"; |
---|
| 74 | div_scroll.style.width = (clientWidth - (findPosX(div_scroll)+15)) + "px"; |
---|
| 75 | } |
---|
| 76 | } |
---|
| 77 | } |
---|
[812] | 78 | |
---|
[3369] | 79 | if(content_folders){ |
---|
| 80 | var search_div = Element("search_div"); |
---|
| 81 | var contentFoldersY = findPosY(content_folders); |
---|
| 82 | content_folders.style.height = (clientHeight - (contentFoldersY + (contentFoldersY > findPosY(search_div) ? 0 : (search_div.clientHeight ? search_div.clientHeight : search_div.offsetHeight) + 5))) + "px"; |
---|
| 83 | } |
---|
[3336] | 84 | redim_borders(count_borders()); |
---|
[4062] | 85 | resizeMailList(); |
---|
[2] | 86 | } |
---|
| 87 | // END: FUNCTION RESIZE WINDOW |
---|
| 88 | |
---|
[320] | 89 | var _beforeunload_ = window.onbeforeunload; |
---|
| 90 | |
---|
[5785] | 91 | window.onbeforeunload = unloadMess; |
---|
[271] | 92 | |
---|
[2] | 93 | function unloadMess(){ |
---|
[3904] | 94 | if (typeof BordersArray == 'undefined') return; // We're not on expressoMail |
---|
[1657] | 95 | if (typeof(expresso_mail_sync) != "undefined" && expresso_mail_sync.working) { |
---|
[1518] | 96 | var mess = get_lang("You're about archiving your e-mails from server. Do you really want to stop this action?"); |
---|
| 97 | return mess; |
---|
| 98 | } |
---|
| 99 | else { |
---|
[5785] | 100 | for (var i = 0; i < BordersArray.length; i++) |
---|
| 101 | if(BordersArray[i].sequence > 0 && (!isNaN(BordersArray[i].sequence)&&parseInt(BordersArray[i].sequence) == BordersArray[i].sequence) ) |
---|
| 102 | return get_lang('There are still editing posts, really want to leave the page')+'?'; |
---|
[2] | 103 | } |
---|
| 104 | } |
---|
[320] | 105 | |
---|
[2] | 106 | // Translate words and phrases using user language from eGroupware. |
---|
[812] | 107 | function get_lang(_key) { |
---|
[3369] | 108 | if (typeof(_key) == 'undefined') |
---|
| 109 | return false; |
---|
[566] | 110 | var key = _key.toLowerCase(); |
---|
[812] | 111 | if(array_lang[key]) |
---|
| 112 | var _value = array_lang[key]; |
---|
| 113 | else |
---|
| 114 | var _value = _key+"*"; |
---|
[566] | 115 | |
---|
[812] | 116 | if(arguments.length > 1) |
---|
| 117 | for(j = 1; typeof(arguments[j]) != 'undefined'; j++) |
---|
| 118 | _value = _value.replace("%"+j,arguments[j]); |
---|
[2] | 119 | return _value; |
---|
[812] | 120 | } |
---|
| 121 | |
---|
[2] | 122 | // Make decimal round, using in size message |
---|
| 123 | function round(value, decimal){ |
---|
| 124 | var return_value = Math.round( value * Math.pow( 10 , decimal ) ) / Math.pow( 10 , decimal ); |
---|
| 125 | return( return_value ); |
---|
| 126 | } |
---|
| 127 | |
---|
| 128 | // Change the class of message. |
---|
[3369] | 129 | // In refresh, the flags UnRead and UnSeen don't exist anymore. |
---|
[163] | 130 | function set_msg_as_read(msg_number, selected){ |
---|
[2] | 131 | tr_message = Element(msg_number); |
---|
[163] | 132 | if (exist_className(tr_message, 'tr_msg_unread')) |
---|
| 133 | decrement_folder_unseen(); |
---|
| 134 | remove_className(tr_message, 'tr_msg_unread'); |
---|
| 135 | remove_className(tr_message, 'selected_msg'); |
---|
[3840] | 136 | |
---|
| 137 | if( document.getElementById("td_message_unseen_"+msg_number) != null ) |
---|
| 138 | Element("td_message_unseen_"+msg_number).innerHTML = "<img src ='templates/"+template+"/images/seen.gif' title='"+get_lang('Seen')+"'>"; |
---|
| 139 | |
---|
[1443] | 140 | connector.purgeCache(); |
---|
[163] | 141 | return true; |
---|
[2] | 142 | } |
---|
| 143 | |
---|
[605] | 144 | function msg_is_read(msg_number, selected){ |
---|
| 145 | tr_message = Element(msg_number); |
---|
[814] | 146 | return !(tr_message && LTrim(tr_message.className).match('tr_msg_unread')) |
---|
[605] | 147 | } |
---|
| 148 | |
---|
[5264] | 149 | function set_msg_as_unread(msg_number, isSearch){ |
---|
[2] | 150 | tr_message = Element(msg_number); |
---|
[1412] | 151 | if ((exist_className(tr_message, 'tr_msg_read') || exist_className(tr_message, 'tr_msg_read2')) && (!exist_className(tr_message, 'tr_msg_unread'))) |
---|
[3369] | 152 | increment_folder_unseen(); |
---|
[163] | 153 | remove_className(tr_message, 'selected_msg'); |
---|
| 154 | add_className(tr_message, 'tr_msg_unread'); |
---|
[5264] | 155 | if(!isSearch) |
---|
| 156 | Element("td_message_unseen_"+msg_number).innerHTML = "<img src ='templates/"+template+"/images/unseen.gif' title='"+get_lang('Unseen')+"'>"; |
---|
[2] | 157 | } |
---|
| 158 | |
---|
[5264] | 159 | function set_msg_as_flagged(msg_number, isSearch){ |
---|
[163] | 160 | var msg = Element(msg_number); |
---|
| 161 | remove_className(msg, 'selected_msg'); |
---|
| 162 | add_className(msg, 'flagged_msg'); |
---|
[5264] | 163 | if(isSearch) |
---|
[5582] | 164 | Element("td_message_important_"+msg_number.substr(0,msg_number.indexOf('_'))).innerHTML = "<img src ='templates/"+template+"/images/important.png' title='"+get_lang('Important')+"'>"; |
---|
[5264] | 165 | else |
---|
[5582] | 166 | Element("td_message_important_"+msg_number).innerHTML = "<img src ='templates/"+template+"/images/important.png' title='"+get_lang('Important')+"'>"; |
---|
[2] | 167 | } |
---|
| 168 | |
---|
[5264] | 169 | function set_msg_as_unflagged(msg_number, isSearch){ |
---|
[163] | 170 | var msg = Element(msg_number); |
---|
| 171 | remove_className(msg, 'selected_msg'); |
---|
| 172 | remove_className(msg, 'flagged_msg'); |
---|
[5264] | 173 | if(isSearch) |
---|
| 174 | Element("td_message_important_"+msg_number.substr(0,msg_number.indexOf('_'))).innerHTML = " "; |
---|
| 175 | else |
---|
| 176 | Element("td_message_important_"+msg_number).innerHTML = " "; |
---|
[2] | 177 | } |
---|
| 178 | |
---|
[845] | 179 | function removeAll(id){ |
---|
| 180 | do |
---|
| 181 | { |
---|
| 182 | if (typeof(Element(id)) == 'undefined') |
---|
| 183 | break; |
---|
| 184 | Element(id).parentNode.removeChild(Element(id)); |
---|
| 185 | } |
---|
| 186 | while(Element(id)); |
---|
| 187 | } |
---|
| 188 | |
---|
[2] | 189 | function get_current_folder(){ |
---|
| 190 | return current_folder; |
---|
| 191 | } |
---|
| 192 | |
---|
| 193 | // Kill current box (folder or page). |
---|
| 194 | function kill_current_box(){ |
---|
| 195 | var box = document.getElementById("table_box"); |
---|
| 196 | if (box != null) |
---|
| 197 | box.parentNode.removeChild(box); |
---|
[320] | 198 | else |
---|
| 199 | return false; |
---|
[2] | 200 | } |
---|
| 201 | |
---|
[5134] | 202 | //Remove as linhas da tabela sem deletar o corrent_box |
---|
| 203 | function remove_rows(el){ |
---|
| 204 | while (el.rows.length > 0) { |
---|
| 205 | el.deleteRow(0); |
---|
| 206 | } |
---|
| 207 | Element("tot_m").innerHTML = 0 |
---|
| 208 | Element("new_m").innerHTML = 0 |
---|
| 209 | } |
---|
| 210 | |
---|
[2] | 211 | // Kill current paging. |
---|
| 212 | function kill_current_paging(){ |
---|
| 213 | var paging = Element("span_paging"); |
---|
| 214 | if (paging != null) |
---|
| 215 | paging.parentNode.removeChild(paging); |
---|
| 216 | } |
---|
| 217 | |
---|
[412] | 218 | function show_hide_span_paging(ID){ |
---|
[3380] | 219 | if ((ID != "0") && Element("span_paging")) |
---|
| 220 | Element("span_paging").style.display = 'none'; |
---|
| 221 | else |
---|
| 222 | if (Element("span_paging")) |
---|
| 223 | Element("span_paging").style.display = ''; |
---|
[412] | 224 | } |
---|
| 225 | |
---|
[2] | 226 | //Get the current number of messages in a page. |
---|
| 227 | function get_messages_number_in_page(){ |
---|
| 228 | //Get element tBody. |
---|
| 229 | main = document.getElementById("tbody_box"); |
---|
[3369] | 230 | |
---|
[2] | 231 | // Get all TR (messages) in tBody. |
---|
| 232 | main_list = main.childNodes; |
---|
[3369] | 233 | |
---|
[2] | 234 | return main_list.length; |
---|
| 235 | } |
---|
| 236 | |
---|
[689] | 237 | function download_local_attachment(url) { |
---|
[3270] | 238 | url=encodeURI(url); |
---|
| 239 | url=url.replace("%25","%"); |
---|
[689] | 240 | if (div_attachment == null){ |
---|
| 241 | var div_attachment = document.createElement("DIV"); |
---|
| 242 | div_attachment.id="id_div_attachment"; |
---|
| 243 | document.body.appendChild(div_attachment); |
---|
| 244 | } |
---|
| 245 | div_attachment.innerHTML="<iframe style='display:none;width:0;height:0' name='attachment' src='"+url+"'></iframe>"; |
---|
| 246 | } |
---|
| 247 | |
---|
[271] | 248 | function download_attachments(msg_folder, msg_number, idx_file, msg_part, encoding, new_file_name, show_iframe){ |
---|
[2] | 249 | div_attachment = document.getElementById("id_div_attachment"); |
---|
| 250 | var params = ''; |
---|
[4820] | 251 | |
---|
[2] | 252 | if (div_attachment == null){ |
---|
| 253 | var div_attachment = document.createElement("DIV"); |
---|
| 254 | div_attachment.id="id_div_attachment"; |
---|
| 255 | document.body.appendChild(div_attachment); |
---|
| 256 | } |
---|
[4416] | 257 | if(new_file_name) { |
---|
[5134] | 258 | var extension = /\.[^.]*$/.exec(new_file_name); |
---|
| 259 | if (extension == ".eml") |
---|
[4416] | 260 | params = "&newFilename="+new_file_name; //name_of_message.eml |
---|
| 261 | else // when more than one message |
---|
| 262 | params = "&newFilename="+escape(new_file_name); //mensagens.zip |
---|
| 263 | } |
---|
[2] | 264 | if(encoding) |
---|
| 265 | params += "&encoding="+encoding; |
---|
[271] | 266 | |
---|
[4416] | 267 | div_attachment.innerHTML="<iframe style='display:none;width:0;height:0' name='attachment' src='inc/get_archive.php?msgFolder="+msg_folder+"&msgNumber="+msg_number+"&idx_file="+idx_file+"&indexPart="+msg_part+params+"'></iframe>"; |
---|
| 268 | |
---|
[2] | 269 | } |
---|
[271] | 270 | |
---|
[2] | 271 | function download_all_attachments(msg_folder, msg_number){ |
---|
[3369] | 272 | var handler_source = function(data){ |
---|
[2] | 273 | download_attachments(null, null, data, null,null,'anexos.zip'); |
---|
| 274 | } |
---|
| 275 | cExecute("$this.exporteml.download_all_attachments",handler_source,"folder="+msg_folder+"&num_msg="+msg_number); |
---|
| 276 | } |
---|
[689] | 277 | //ADD forwarded files |
---|
[3387] | 278 | function addForwardedFile(id_border,file_name,link,divFiles){ |
---|
| 279 | if(!divFiles) |
---|
[5134] | 280 | var divFiles = document.getElementById("divFiles_"+id_border); |
---|
[689] | 281 | |
---|
| 282 | if (! divFiles) |
---|
| 283 | return false; |
---|
[3369] | 284 | |
---|
[689] | 285 | if (divFiles.lastChild) |
---|
| 286 | var countDivFiles = parseInt(divFiles.lastChild.id.split('_')[2]) + 1; |
---|
| 287 | |
---|
| 288 | if (! countDivFiles) |
---|
| 289 | var countDivFiles = 1; |
---|
[3369] | 290 | |
---|
[5134] | 291 | var divFile = document.createElement('DIV'); |
---|
[689] | 292 | |
---|
[5134] | 293 | var inputFile = document.createElement("INPUT"); |
---|
[1121] | 294 | if (!expresso_offline) { |
---|
| 295 | if (!is_ie) { |
---|
| 296 | var tmp_id_border = document.createAttribute('id_border'); |
---|
| 297 | tmp_id_border.value = id_border; |
---|
[3369] | 298 | |
---|
[1121] | 299 | inputFile.setAttributeNode(tmp_id_border); |
---|
| 300 | inputFile.id = "inputFile_" + id_border + "_" + countDivFiles; |
---|
| 301 | inputFile.type = 'file'; |
---|
| 302 | inputFile.size = 50; |
---|
| 303 | inputFile.maxLength = 255; |
---|
| 304 | inputFile.name = 'file_' + countDivFiles; |
---|
| 305 | inputFile.style.display = "none"; |
---|
| 306 | } |
---|
| 307 | else { |
---|
[5134] | 308 | inputFile = document.createElement("link"); |
---|
[3369] | 309 | |
---|
[1121] | 310 | var tmp_id_border = document.createAttribute('id_border'); |
---|
| 311 | tmp_id_border.value = id_border; |
---|
[3369] | 312 | |
---|
[1121] | 313 | inputFile.setAttributeNode(tmp_id_border); |
---|
| 314 | inputFile.id = "inputFile_" + id_border + "_" + countDivFiles; |
---|
| 315 | inputFile.name = 'file_' + countDivFiles; |
---|
[3369] | 316 | |
---|
| 317 | |
---|
[1121] | 318 | } |
---|
[3369] | 319 | |
---|
[689] | 320 | } |
---|
| 321 | else { |
---|
[1121] | 322 | inputFile.type = 'hidden'; |
---|
| 323 | inputFile.name = 'offline_forward_' + countDivFiles; |
---|
[3369] | 324 | } |
---|
[1121] | 325 | divFile.appendChild(inputFile); |
---|
[689] | 326 | |
---|
| 327 | var a_tmp = new Array(); |
---|
| 328 | a_tmp[0] = "local_"; |
---|
| 329 | a_tmp[1] = 'file_' + countDivFiles; |
---|
| 330 | a_tmp[2] = file_name; |
---|
| 331 | s_tmp = escape(connector.serialize(a_tmp)); |
---|
| 332 | var checkbox = document.createElement("INPUT"); |
---|
| 333 | checkbox.type = "checkbox"; |
---|
| 334 | checkbox.id = "checkbox_"+id_border+"_"+countDivFiles; |
---|
| 335 | checkbox.name = "local_attachments[]"; |
---|
[5134] | 336 | checkbox.setAttribute("checked", "checked"); |
---|
[3369] | 337 | |
---|
[689] | 338 | checkbox.value = s_tmp; |
---|
| 339 | divFile.appendChild(checkbox); |
---|
[3369] | 340 | |
---|
[689] | 341 | var link_attachment = document.createElement("A"); |
---|
| 342 | link_attachment.setAttribute("href", link); |
---|
[3369] | 343 | |
---|
[689] | 344 | link_attachment.innerHTML = file_name; |
---|
| 345 | divFile.appendChild(link_attachment); |
---|
[3369] | 346 | |
---|
[689] | 347 | countDivFiles++; |
---|
[3369] | 348 | divFile.id = "divFile_"+id_border+"_"+countDivFiles; |
---|
[689] | 349 | divFiles.appendChild(divFile); |
---|
| 350 | |
---|
| 351 | return inputFile; |
---|
| 352 | } |
---|
| 353 | |
---|
[2] | 354 | // Add Input File Dynamically. |
---|
| 355 | function addFile(id_border){ |
---|
| 356 | divFiles = document.getElementById("divFiles_"+id_border); |
---|
[320] | 357 | if (! divFiles) |
---|
| 358 | return false; |
---|
[3369] | 359 | |
---|
[271] | 360 | if (divFiles.lastChild) |
---|
| 361 | var countDivFiles = parseInt(divFiles.lastChild.id.split('_')[2]) + 1; |
---|
| 362 | |
---|
| 363 | if (! countDivFiles) |
---|
| 364 | var countDivFiles = 1; |
---|
[3369] | 365 | |
---|
[4457] | 366 | divFile = document.createElement('div'); |
---|
[689] | 367 | |
---|
[4820] | 368 | var inputFile = document.createElement("input"); |
---|
| 369 | inputFile.id = "inputFile_"+id_border+"_"+countDivFiles; |
---|
| 370 | inputFile.name = "file_"+countDivFiles; |
---|
| 371 | inputFile.type = "file"; |
---|
| 372 | inputFile.size = 50; |
---|
| 373 | inputFile.maxlength = 255; |
---|
| 374 | inputFile.onchange = function () { |
---|
| 375 | validateFileExtension(this.value, this.id.replace('input','div'), this.getAttribute('id_border')); |
---|
| 376 | }; |
---|
| 377 | |
---|
| 378 | divFile.appendChild(inputFile); |
---|
| 379 | |
---|
| 380 | var linkFile = document.createElement("a"); |
---|
| 381 | linkFile.id = "linkFile_"+id_border+"_"+countDivFiles; |
---|
| 382 | linkFile.href = 'javascript:void(0)'; |
---|
| 383 | linkFile.onclick = function () {removeFile("divFile_"+id_border+"_"+countDivFiles); return false;}; |
---|
| 384 | linkFile.innerHTML = get_lang("Remove"); |
---|
| 385 | |
---|
| 386 | divFile.appendChild(linkFile); |
---|
| 387 | divFile.id = "divFile_"+id_border+"_"+countDivFiles; |
---|
| 388 | divFiles.appendChild(divFile); |
---|
| 389 | |
---|
[4413] | 390 | return inputFile; |
---|
[2] | 391 | } |
---|
| 392 | // Remove Input File Dynamically. |
---|
| 393 | function removeFile(id){ |
---|
| 394 | var el = Element(id); |
---|
| 395 | el.parentNode.removeChild(el); |
---|
| 396 | } |
---|
| 397 | |
---|
| 398 | function validateFileExtension(fileName, id, id_border){ |
---|
[3369] | 399 | |
---|
[271] | 400 | var error_flag = false; |
---|
[320] | 401 | |
---|
| 402 | if ( fileName.indexOf('/') != -1 ) |
---|
| 403 | { |
---|
| 404 | if (fileName[0] != '/'){ // file name is windows format? |
---|
| 405 | var file = fileName.substr(fileName.lastIndexOf('\\') + 1, fileName.length); |
---|
| 406 | if ((fileName.indexOf(':\\') != 1) && (fileName.indexOf('\\\\') != 0)) // Is stored in partition or a network file? |
---|
[3369] | 407 | error_flag = true; |
---|
[320] | 408 | } |
---|
| 409 | else // is Unix |
---|
[3369] | 410 | var file = fileName.substr(fileName.lastIndexOf('/') + 1, fileName.length); |
---|
[271] | 411 | } |
---|
[320] | 412 | else // is Firefox 3 |
---|
| 413 | var file = fileName; |
---|
[271] | 414 | |
---|
| 415 | var fileExtension = file.split("."); |
---|
[2] | 416 | fileExtension = fileExtension[(fileExtension.length-1)]; |
---|
| 417 | for(var i=0; i<denyFileExtensions.length; i++) |
---|
| 418 | { |
---|
| 419 | if(denyFileExtensions[i] == fileExtension) |
---|
| 420 | { |
---|
[271] | 421 | error_flag = true; |
---|
| 422 | break; |
---|
[2] | 423 | } |
---|
[3369] | 424 | |
---|
[2] | 425 | } |
---|
[271] | 426 | |
---|
[320] | 427 | if ( error_flag == true ) |
---|
| 428 | { |
---|
[271] | 429 | alert(get_lang('File extension forbidden or invalid file') + '.'); |
---|
| 430 | removeFile(id); |
---|
| 431 | addFile(id_border); |
---|
| 432 | return false; |
---|
| 433 | } |
---|
| 434 | return true; |
---|
[2] | 435 | } |
---|
| 436 | |
---|
| 437 | var setTimeout_write_msg = 0; |
---|
[3742] | 438 | var old_msg = false; |
---|
[197] | 439 | // Funcao usada para escrever mensagem |
---|
| 440 | // notimeout = True : mensagem nao apaga |
---|
[3369] | 441 | function write_msg(msg, notimeout){ |
---|
| 442 | |
---|
[2] | 443 | if (setTimeout_write_msg) |
---|
| 444 | clearTimeout(setTimeout_write_msg); |
---|
[3369] | 445 | |
---|
[80] | 446 | var msg_div = Element('em_div_write_msg'); |
---|
[5436] | 447 | var old_divStatusBar = Element("divStatusBar"); |
---|
[2] | 448 | |
---|
[80] | 449 | if(!msg_div) { |
---|
| 450 | msg_div = document.createElement('DIV'); |
---|
| 451 | msg_div.id = 'em_div_write_msg'; |
---|
[831] | 452 | msg_div.className = 'em_div_write_msg'; |
---|
[5436] | 453 | old_divStatusBar.parentNode.insertBefore(msg_div,old_divStatusBar); |
---|
[447] | 454 | } |
---|
[3369] | 455 | |
---|
[447] | 456 | if( document.getElementById('JabberMessenger')) |
---|
[651] | 457 | loadscript.adIcon(); |
---|
[447] | 458 | |
---|
[831] | 459 | 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] | 460 | |
---|
[5436] | 461 | old_divStatusBar.style.display = 'none'; |
---|
| 462 | msg_div.style.display = ''; |
---|
[2] | 463 | // Nao ponha var na frente!! jakjr |
---|
| 464 | handle_write_msg = function(){ |
---|
| 465 | try{ |
---|
[197] | 466 | if(!old_msg) |
---|
[5436] | 467 | clean_msg(); |
---|
[197] | 468 | else |
---|
[3369] | 469 | write_msg(old_msg, true); |
---|
[2] | 470 | } |
---|
| 471 | catch(e){} |
---|
| 472 | } |
---|
[197] | 473 | if(notimeout) |
---|
| 474 | old_msg = msg; |
---|
| 475 | else |
---|
| 476 | setTimeout_write_msg = setTimeout("handle_write_msg();", 5000); |
---|
[2] | 477 | } |
---|
[197] | 478 | // Funcao usada para apagar mensagem sem timeout |
---|
| 479 | function clean_msg(){ |
---|
| 480 | old_msg = false; |
---|
| 481 | var msg_div = Element('em_div_write_msg'); |
---|
| 482 | var old_divStatusBar = Element("divStatusBar"); |
---|
| 483 | if(msg_div) |
---|
| 484 | msg_div.style.display = 'none'; |
---|
[3369] | 485 | old_divStatusBar.style.display = ''; |
---|
[197] | 486 | } |
---|
[2] | 487 | |
---|
| 488 | function make_body_reply(body, to, date_day, date_hour){ |
---|
| 489 | to = to.replace("<","<"); |
---|
| 490 | to = to.replace(">",">"); |
---|
[5134] | 491 | block_quoted_body ='<div>'; |
---|
| 492 | block_quoted_body += get_lang('At %1, %2 hours, %3 wrote:', date_day, date_hour, to) + '<br type="_moz"></div>'; |
---|
[2] | 493 | block_quoted_body += "<blockquote style=\"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;\">"; |
---|
| 494 | block_quoted_body += body; |
---|
| 495 | block_quoted_body += "</blockquote>"; |
---|
| 496 | return block_quoted_body; |
---|
| 497 | } |
---|
| 498 | |
---|
| 499 | function make_forward_body(body, from, date, subject, to, cc){ |
---|
| 500 | from = from.replace(/</g,"<"); |
---|
| 501 | from = from.replace(/>/g,">"); |
---|
| 502 | to = to.replace(/</g,"<"); |
---|
| 503 | to = to.replace(/>/g,">"); |
---|
[5134] | 504 | var forward_body = '<div>---------- ' + get_lang('Forwarded message') + ' ----------<br type="_moz"></div><div>'; |
---|
| 505 | forward_body += get_lang('From') + ': ' + from + '<br type="_moz"></div><div>'; |
---|
| 506 | forward_body += get_lang('Date') + ': ' + date + '<br type="_moz"></div><div>'; |
---|
| 507 | forward_body += get_lang('Subject') + ': ' + subject + '<br type="_moz"></div><div>'; |
---|
| 508 | forward_body += get_lang('To') + ': ' + to+ '<br type="_moz"></div><div>'; |
---|
[2] | 509 | if(cc != undefined){ |
---|
| 510 | cc = cc.replace(/</g,"<"); |
---|
| 511 | cc = cc.replace(/>/g,">"); |
---|
[5464] | 512 | forward_body += get_lang('CC') + ': ' + cc+ '<div><br type="_moz"></div><div><br type="_moz"></div><div><br type="_moz"></div>'; |
---|
[2] | 513 | } |
---|
| 514 | forward_body += body; |
---|
| 515 | return forward_body; |
---|
| 516 | } |
---|
| 517 | |
---|
| 518 | function emMessageSearch(e,value){ |
---|
| 519 | var e = is_ie ? window.event : e; |
---|
| 520 | if(e.keyCode == 13) { |
---|
| 521 | search_emails(value); |
---|
| 522 | } |
---|
| 523 | } |
---|
| 524 | |
---|
[3227] | 525 | function validateEmail(email){ |
---|
| 526 | if (typeof(email) != 'string') |
---|
| 527 | return false; |
---|
[5695] | 528 | var validName = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/i; |
---|
| 529 | //emailParts = email.split('@'); |
---|
[5696] | 530 | return validName.test(email); |
---|
[3227] | 531 | } |
---|
| 532 | function validateDomain(domain){ |
---|
| 533 | var domainReg = /^(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/i; |
---|
| 534 | return (domainReg.test(domain)); |
---|
| 535 | } |
---|
| 536 | |
---|
| 537 | function validateUrl(url){ |
---|
| 538 | var urlReg = /([A-Za-z]{2,7}:\/\/)(.*)/i; |
---|
| 539 | urlParts = url.split(urlReg); |
---|
| 540 | return (urlParts[1].length > 4 && validateDomain(urlParts[2])); |
---|
| 541 | } |
---|
[3581] | 542 | |
---|
| 543 | function performQuickSearch(keyword){ |
---|
| 544 | if (preferences.quick_search_default=='1') |
---|
[5198] | 545 | emQuickSearch(keyword, 'null', 'null', 'expressoMail'); |
---|
[3581] | 546 | else |
---|
| 547 | search_emails(keyword); |
---|
| 548 | } |
---|
| 549 | |
---|
[5417] | 550 | function emQuickSearch(emailList, field, ID, Type, force){ |
---|
[2] | 551 | var quickSearchKeyBegin; |
---|
| 552 | var quickSearchKeyEnd; |
---|
[5941] | 553 | var content = $("#content_id_"+ID); |
---|
| 554 | |
---|
[1121] | 555 | if(expresso_offline) { |
---|
| 556 | alert(get_lang('Not allowed in offline mode')); |
---|
| 557 | return; |
---|
| 558 | } |
---|
[3871] | 559 | if ((field != 'null') && (ID != 'null')) |
---|
| 560 | { |
---|
| 561 | connector.loadScript("QuickCatalogSearch"); |
---|
| 562 | if (typeof(QuickCatalogSearch) == 'undefined'){ |
---|
[5456] | 563 | setTimeout('emQuickSearch("'+emailList+'", "'+field+'", "'+ID+'", "'+Type+'", "'+force+'")',500); |
---|
[3871] | 564 | return false; |
---|
| 565 | } |
---|
| 566 | } |
---|
| 567 | else |
---|
| 568 | { |
---|
| 569 | connector.loadScript("QuickSearchUser"); |
---|
| 570 | if (typeof(QuickSearchUser) == 'undefined'){ |
---|
[5456] | 571 | setTimeout('emQuickSearch("'+emailList+'", "'+field+'", "'+ID+'", "'+Type+'", "'+force+'")',500); |
---|
[3871] | 572 | return false; |
---|
| 573 | } |
---|
| 574 | } |
---|
[3369] | 575 | |
---|
[37] | 576 | var handler_emQuickSearch = function(data) |
---|
| 577 | { |
---|
[3369] | 578 | |
---|
[2] | 579 | if ((!data.status) && (data.error == "many results")){ |
---|
[4457] | 580 | alert(get_lang('More than %1 results. Please, try to refine your search.',data.maxResult)); |
---|
[2] | 581 | return false; |
---|
| 582 | } |
---|
[3369] | 583 | |
---|
[2] | 584 | if (data.length > 0){ |
---|
[37] | 585 | if ((field != 'null') && (ID != 'null')) |
---|
| 586 | { |
---|
[5075] | 587 | QuickCatalogSearch.showList(data, quickSearchKeyBegin, quickSearchKeyEnd, ID, field); |
---|
[37] | 588 | } |
---|
| 589 | else |
---|
| 590 | { |
---|
| 591 | QuickSearchUser.showList(data); |
---|
| 592 | } |
---|
[2] | 593 | } |
---|
| 594 | else |
---|
| 595 | alert(get_lang('None result was found.')); |
---|
| 596 | return true; |
---|
| 597 | } |
---|
[37] | 598 | if ((field != 'null') && (ID != 'null')) |
---|
| 599 | { |
---|
[5941] | 600 | content.find(field).focus(); |
---|
| 601 | var i = getPosition(content.find(field)[0]); //inputBox.selectionStart; |
---|
[37] | 602 | var j = --i; |
---|
[2] | 603 | |
---|
[37] | 604 | // Acha o inicio |
---|
| 605 | while ((j >= 0) && (emailList.charAt(j) != ',')){j--}; |
---|
| 606 | quickSearchKeyBegin = ++j; |
---|
[2] | 607 | |
---|
[37] | 608 | // Acha o final |
---|
| 609 | while ((i <= emailList.length) && (emailList.charAt(i) != ',')){i++}; |
---|
| 610 | quickSearchKeyEnd = i; |
---|
[2] | 611 | |
---|
[37] | 612 | // A Chave da Pesquisa |
---|
| 613 | var search_for = trim(emailList.substring(quickSearchKeyBegin, quickSearchKeyEnd)); |
---|
| 614 | } |
---|
| 615 | else |
---|
| 616 | var search_for = emailList; |
---|
[6053] | 617 | if(preferences.search_characters_number == 'x') |
---|
| 618 | preferences.search_characters_number = 0; |
---|
| 619 | |
---|
[1610] | 620 | if (search_for.length < preferences.search_characters_number){ |
---|
[5852] | 621 | alert(get_lang('Your search argument must be longer than %1 characters.', preferences.search_characters_number)); |
---|
| 622 | return false; |
---|
[2] | 623 | } |
---|
[5209] | 624 | if(Type == undefined) |
---|
[5196] | 625 | cExecute ("$this.ldap_functions.quicksearchcontact&search_for="+search_for+"&field="+field+"&ID="+ID, handler_emQuickSearch); |
---|
| 626 | else |
---|
| 627 | cExecute ("$this.ldap_functions.quicksearchcontact&search_for="+search_for+"&field="+field+"&ID="+ID+"&Type="+Type, handler_emQuickSearch); |
---|
[2] | 628 | } |
---|
| 629 | |
---|
| 630 | function filterbox(){ |
---|
| 631 | connector.loadScript("filter"); |
---|
| 632 | connector.loadScript("filters"); |
---|
[3068] | 633 | if (typeof(filters) == 'undefined') |
---|
| 634 | { |
---|
| 635 | setTimeout('filterbox()',500); |
---|
| 636 | return false; |
---|
| 637 | } |
---|
[2] | 638 | filters.Forms(); |
---|
| 639 | } |
---|
| 640 | |
---|
[5539] | 641 | |
---|
| 642 | function filterbox2(){ |
---|
[5782] | 643 | init_filters(); |
---|
[5539] | 644 | jQuery('.expresso-window-container').dialog('open'); |
---|
| 645 | } |
---|
| 646 | |
---|
| 647 | |
---|
[2] | 648 | function sharebox(){ |
---|
| 649 | var handler_imap_getacl = function(data) |
---|
| 650 | { |
---|
[4476] | 651 | connector.loadScript("finder", "../services/"); |
---|
[2] | 652 | connector.loadScript("sharemailbox"); |
---|
[5458] | 653 | |
---|
[3068] | 654 | if (typeof(sharemailbox) == 'undefined') |
---|
| 655 | { |
---|
| 656 | setTimeout('sharebox()',500); |
---|
| 657 | return false; |
---|
| 658 | } |
---|
[5458] | 659 | |
---|
| 660 | sharemailbox.makeWindow(data); |
---|
[2] | 661 | } |
---|
| 662 | cExecute ("$this.imap_functions.getacl", handler_imap_getacl); |
---|
| 663 | } |
---|
| 664 | |
---|
[5533] | 665 | function configureLabels(data){ |
---|
| 666 | |
---|
| 667 | dialogElement = $('.label-configure-win').html(DataLayer.render("../prototype/modules/mail/templates/label_configure.ejs", {})) |
---|
| 668 | |
---|
| 669 | dialogElement.dialog({ |
---|
[5704] | 670 | width:815, |
---|
[5533] | 671 | height:410, |
---|
| 672 | title:' Configuração do Marcador', |
---|
| 673 | resizable:false, |
---|
| 674 | modal: true, |
---|
| 675 | closeOnEscape:true, |
---|
[5554] | 676 | close:function(event, ui) { |
---|
[6930] | 677 | //select_all_search_messages(false, 'content_id_'+currentTab); |
---|
[5554] | 678 | event.stopPropagation(); |
---|
[6910] | 679 | if(typeof(shortcut) != 'undefined') shortcut.disabled = false; |
---|
[5554] | 680 | }, |
---|
[6910] | 681 | open: function(event, ui) |
---|
| 682 | { |
---|
| 683 | if(typeof(shortcut) != 'undefined') shortcut.disabled = true; |
---|
| 684 | }, |
---|
[5533] | 685 | autoOpen:false, |
---|
| 686 | dialogClass: 'dialog-configure-label' |
---|
| 687 | }); |
---|
[5640] | 688 | init_label({window:dialogElement, selectedItem:data.selectedItem, applyToSelectedMessages:data.applyToSelectedMessages}); |
---|
[5533] | 689 | dialogElement.dialog("open"); |
---|
| 690 | } |
---|
| 691 | |
---|
| 692 | function configureFollowupflag(){ |
---|
| 693 | |
---|
| 694 | var messages = new Array(); |
---|
| 695 | var selectedMessageIds = new Array(); |
---|
| 696 | var folder_name; |
---|
| 697 | if (currentTab == 0) { |
---|
| 698 | selectedMessageIds = get_selected_messages().split(","); |
---|
| 699 | } else { |
---|
| 700 | selectedMessageIds = get_selected_messages_search().split(","); |
---|
| 701 | var id_border = currentTab.replace(/[a-zA-Z_]+/, ""); |
---|
| 702 | } |
---|
| 703 | |
---|
[5588] | 704 | var roles = get_selected_messages_search_role().split(','); |
---|
[5533] | 705 | for (var i=0; i<selectedMessageIds.length; i++) { |
---|
| 706 | if (currentTab == 0) { |
---|
| 707 | folder_name = current_folder; |
---|
[5588] | 708 | var number = selectedMessageIds[i]; |
---|
[5533] | 709 | }else{ |
---|
[5588] | 710 | var tr = $('[role="'+roles[i]+'"]'); |
---|
| 711 | folder_name = $(tr).attr('name'); |
---|
| 712 | var id = $(tr).attr('id'); |
---|
| 713 | var number = id.replace(/_[a-zA-Z0-9]+/,""); |
---|
[5533] | 714 | } |
---|
[5588] | 715 | messages.push(onceOpenedHeadersMessages[folder_name][number]); |
---|
[5533] | 716 | } |
---|
| 717 | |
---|
| 718 | if(!User.followupflags) |
---|
[5640] | 719 | DataLayer.remove('followupflag', false); |
---|
[5571] | 720 | User.followupflags = DataLayer.get('followupflag', true); |
---|
[5533] | 721 | var data = { |
---|
| 722 | followupflags: User.followupflags, |
---|
| 723 | messages: messages |
---|
| 724 | }; |
---|
| 725 | dialogElement = $('.followupflag-configure-win').html(DataLayer.render("../prototype/modules/mail/templates/followupflag_configure.ejs", data)) |
---|
| 726 | |
---|
| 727 | dialogElement.dialog({ |
---|
[5713] | 728 | width:532, |
---|
[5533] | 729 | height:420, |
---|
[5571] | 730 | title:get_lang('Follow up'), |
---|
[5533] | 731 | resizable:false, |
---|
| 732 | modal: true, |
---|
| 733 | closeOnEscape:true, |
---|
| 734 | close:function(event, ui) { |
---|
[6930] | 735 | //select_all_search_messages(false, 'content_id_'+currentTab); |
---|
[5533] | 736 | event.stopPropagation(); |
---|
[6910] | 737 | if(typeof(shortcut) != 'undefined') shortcut.disabled = false; |
---|
[5533] | 738 | }, |
---|
[6910] | 739 | open: function(event, ui) |
---|
| 740 | { |
---|
| 741 | if(typeof(shortcut) != 'undefined') shortcut.disabled = true; |
---|
| 742 | }, |
---|
[5533] | 743 | autoOpen:false |
---|
| 744 | }); |
---|
| 745 | init_followup({window:dialogElement, selectedMessages:selectedMessageIds}); |
---|
| 746 | dialogElement.dialog("open"); |
---|
| 747 | } |
---|
| 748 | |
---|
[3178] | 749 | function open_rss(param){ |
---|
| 750 | connector.loadScript("news_edit"); |
---|
| 751 | if (typeof(news_edit) == 'undefined') |
---|
| 752 | { |
---|
| 753 | setTimeout('open_rss(\''+param+'\')',500); |
---|
| 754 | return false; |
---|
| 755 | } |
---|
| 756 | news_edit.read_rss(param); |
---|
| 757 | return true; |
---|
| 758 | } |
---|
| 759 | |
---|
| 760 | function editrss(){ |
---|
| 761 | connector.loadScript("news_edit"); |
---|
| 762 | if (typeof(news_edit) == 'undefined') |
---|
| 763 | { |
---|
| 764 | setTimeout('editrss()',500); |
---|
| 765 | return false; |
---|
| 766 | } |
---|
| 767 | news_edit.makeWindow(); |
---|
| 768 | } |
---|
| 769 | |
---|
| 770 | |
---|
| 771 | |
---|
| 772 | |
---|
[2] | 773 | function preferences_mail(){ |
---|
[1186] | 774 | location.href="../preferences/preferences.php?appname=expressoMail1_2"; |
---|
[2] | 775 | } |
---|
| 776 | |
---|
[6528] | 777 | function search_emails(value, data){ |
---|
[5172] | 778 | var resize = false; |
---|
| 779 | resize = resize_borders(); |
---|
| 780 | if (!resize){ |
---|
| 781 | var str_continue = ''; |
---|
| 782 | var bolContinue = true; |
---|
| 783 | str_continue = '\n' + get_lang('You must manually close one of your tabs before opening a new one'); |
---|
| 784 | if (preferences.auto_close_first_tab == 1){ |
---|
| 785 | var children = Element('border_tr').childNodes; |
---|
| 786 | var bolDelete = true; |
---|
| 787 | for (var i=0; i<children.length; i++) { |
---|
| 788 | if ((children[i].nodeName === 'TD') && (children[i].id!=='border_id_0') && (children[i].id!=='border_blank')) |
---|
| 789 | { |
---|
| 790 | bolDelete = true; |
---|
| 791 | var num_child = children[i].id.toString().substr(10); |
---|
| 792 | alternate_border(num_child); |
---|
| 793 | if (editTest(num_child)){ |
---|
| 794 | bolDelete = false; |
---|
| 795 | } |
---|
| 796 | if (bolDelete || bolContinue){ |
---|
| 797 | str_fechar = '\n' + get_lang('Reached maximum tab limit. Want to close this tab'); |
---|
| 798 | var confirmacao = confirm(str_fechar); |
---|
| 799 | if(confirmacao){ |
---|
| 800 | bolContinue = false; |
---|
| 801 | delete_border(num_child, 'false'); |
---|
[6204] | 802 | break; |
---|
[5172] | 803 | }else{ |
---|
| 804 | return; |
---|
| 805 | } |
---|
| 806 | } |
---|
| 807 | } |
---|
| 808 | } |
---|
| 809 | }else{ |
---|
| 810 | alert(get_lang('Reached maximum tab limit') + str_continue ); |
---|
| 811 | return; |
---|
| 812 | } |
---|
| 813 | } |
---|
[3068] | 814 | connector.loadScript("TreeS"); |
---|
[2] | 815 | connector.loadScript("search"); |
---|
[3068] | 816 | if (typeof(EsearchE) == 'undefined' || typeof(ttree) == 'undefined'){ |
---|
[6528] | 817 | setTimeout("search_emails('"+value+"', '"+data+"')",500); |
---|
[3068] | 818 | return false; |
---|
| 819 | } |
---|
[6528] | 820 | EsearchE.showForms(value, data); |
---|
[6291] | 821 | $("#em_message_search").val(""); |
---|
[5172] | 822 | } |
---|
[2] | 823 | |
---|
| 824 | function source_msg(id_msg,folder){ |
---|
| 825 | var num_msg = id_msg.substr(0,(id_msg.length - 2)); |
---|
| 826 | var handler_source = function(data){ |
---|
[6860] | 827 | download_attachments(null, null, data[0], null,null,data[1]+'.eml'); |
---|
[2] | 828 | } |
---|
| 829 | cExecute("$this.exporteml.export_msg",handler_source,"folder="+url_decode(folder)+"&msgs_to_export="+num_msg); |
---|
| 830 | } |
---|
| 831 | |
---|
| 832 | function url_encode(str){ |
---|
[5134] | 833 | if(str === null) return false; |
---|
[3068] | 834 | var hex_chars = "0123456789ABCDEF"; |
---|
| 835 | var noEncode = /^([a-zA-Z0-9\_\-\.])$/; |
---|
| 836 | var n, strCode, hex1, hex2, strEncode = ""; |
---|
[2] | 837 | |
---|
[3068] | 838 | for(n = 0; n < str.length; n++) { |
---|
| 839 | if (noEncode.test(str.charAt(n))) { |
---|
| 840 | strEncode += str.charAt(n); |
---|
| 841 | } else { |
---|
| 842 | strCode = str.charCodeAt(n); |
---|
| 843 | hex1 = hex_chars.charAt(Math.floor(strCode / 16)); |
---|
| 844 | hex2 = hex_chars.charAt(strCode % 16); |
---|
| 845 | strEncode += "%" + (hex1 + hex2); |
---|
| 846 | } |
---|
| 847 | } |
---|
[4855] | 848 | |
---|
[3068] | 849 | return strEncode; |
---|
| 850 | } |
---|
[2] | 851 | |
---|
[3068] | 852 | function url_decode(str) { |
---|
| 853 | var n, strCode, strDecode = ""; |
---|
| 854 | for (n = 0; n < str.length; n++) { |
---|
[3369] | 855 | strDecode += str.charAt(n); |
---|
| 856 | //if (str.charAt(n) == "%") { |
---|
| 857 | // strCode = str.charAt(n + 1) + str.charAt(n + 2); |
---|
| 858 | // strDecode += String.fromCharCode(parseInt(strCode, 16)); |
---|
| 859 | // n += 2; |
---|
| 860 | //} else { |
---|
| 861 | // strDecode += str.charAt(n); |
---|
| 862 | //} |
---|
[3068] | 863 | } |
---|
| 864 | return strDecode; |
---|
| 865 | } |
---|
[5134] | 866 | //Método que remove os hexadecimais criados no enconde |
---|
| 867 | //e retorna string corretamente |
---|
| 868 | function url_decode_s(str) { |
---|
| 869 | var result = ""; |
---|
[2] | 870 | |
---|
[5134] | 871 | for (var i = 0; i < str.length; i++) { |
---|
| 872 | if (str.charAt(i) == "+") result += " "; |
---|
| 873 | else result += str.charAt(i); |
---|
[4855] | 874 | } |
---|
[5134] | 875 | return unescape(result); |
---|
| 876 | |
---|
[4855] | 877 | } |
---|
| 878 | |
---|
[569] | 879 | function Element (el) { |
---|
| 880 | return document.getElementById(el); |
---|
[2] | 881 | } |
---|
| 882 | |
---|
| 883 | function getPosition(obj) |
---|
| 884 | { |
---|
| 885 | if(typeof obj.selectionStart != "undefined") |
---|
| 886 | { |
---|
| 887 | return obj.selectionStart; |
---|
| 888 | } |
---|
| 889 | else if(document.selection && document.selection.createRange) |
---|
| 890 | { |
---|
| 891 | var M = document.selection.createRange(); |
---|
| 892 | try |
---|
| 893 | { |
---|
| 894 | var Lp = M.duplicate(); |
---|
| 895 | Lp.moveToElementText(obj); |
---|
| 896 | } |
---|
| 897 | catch(e) |
---|
| 898 | { |
---|
| 899 | var Lp=obj.createTextRange(); |
---|
| 900 | } |
---|
[3369] | 901 | |
---|
[2] | 902 | Lp.setEndPoint("EndToStart",M); |
---|
| 903 | var rb=Lp.text.length; |
---|
[3369] | 904 | |
---|
[2] | 905 | if(rb > obj.value.length) |
---|
| 906 | { |
---|
| 907 | return -1; |
---|
| 908 | } |
---|
| 909 | return rb; |
---|
| 910 | } |
---|
| 911 | } |
---|
| 912 | |
---|
| 913 | function trim(inputString) { |
---|
[3369] | 914 | if (typeof inputString != "string") |
---|
[2] | 915 | return inputString; |
---|
[3369] | 916 | |
---|
[2] | 917 | var retValue = inputString; |
---|
| 918 | var ch = retValue.substring(0, 1); |
---|
[3369] | 919 | while (ch == " ") { |
---|
[2] | 920 | retValue = retValue.substring(1, retValue.length); |
---|
| 921 | ch = retValue.substring(0, 1); |
---|
| 922 | } |
---|
| 923 | ch = retValue.substring(retValue.length-1, retValue.length); |
---|
[3369] | 924 | while (ch == " ") { |
---|
[2] | 925 | retValue = retValue.substring(0, retValue.length-1); |
---|
| 926 | ch = retValue.substring(retValue.length-1, retValue.length); |
---|
| 927 | } |
---|
[3369] | 928 | while (retValue.indexOf(" ") != -1) { |
---|
| 929 | retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); |
---|
[2] | 930 | } |
---|
[3369] | 931 | return retValue; |
---|
[2] | 932 | } |
---|
| 933 | |
---|
| 934 | function increment_folder_unseen(){ |
---|
| 935 | var folder_id = get_current_folder(); |
---|
[812] | 936 | |
---|
[2] | 937 | var folder_unseen = Element('dftree_'+folder_id+'_unseen'); |
---|
[406] | 938 | var abas_unseen = Element('new_m').innerHTML; |
---|
[3742] | 939 | abas_unseen = abas_unseen.match(/(<font.*?>){0,1} *([0-9]+) *(<\/font>){0,1}/)[2]; |
---|
[406] | 940 | |
---|
[2] | 941 | if (folder_unseen) |
---|
| 942 | folder_unseen.innerHTML = (parseInt(folder_unseen.innerHTML) + 1); |
---|
| 943 | else |
---|
| 944 | { |
---|
[823] | 945 | 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] | 946 | tree_folders.getNodeById(folder_id)._refresh(); |
---|
| 947 | } |
---|
[3742] | 948 | |
---|
| 949 | if( abas_unseen == NaN || abas_unseen == undefined ) |
---|
| 950 | abas_unseen = 1; |
---|
| 951 | else |
---|
[812] | 952 | abas_unseen = parseInt(abas_unseen) + 1; |
---|
[3742] | 953 | |
---|
| 954 | Element('new_m').innerHTML = '<font style="color:red">' + abas_unseen + '</font>'; |
---|
| 955 | |
---|
[1000] | 956 | if ( current_folder.indexOf( 'INBOX' ) !== 0 && current_folder.indexOf( 'local_' ) !== 0 ) |
---|
[823] | 957 | { |
---|
| 958 | var display_unseen_in_shared_folders = Element('dftree_user_unseen'); |
---|
| 959 | if ( display_unseen_in_shared_folders ) |
---|
| 960 | 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")}); |
---|
| 961 | else |
---|
| 962 | 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")}); |
---|
| 963 | tree_folders.getNodeById( 'user' )._refresh(); |
---|
| 964 | } |
---|
| 965 | var display_unseen_in_mailbox = Element('dftree_root_unseen'); |
---|
[1121] | 966 | if(!expresso_offline) |
---|
| 967 | var node_to_refresh = 'root'; |
---|
| 968 | else |
---|
| 969 | var node_to_refresh = 'local_root'; |
---|
| 970 | tree_folders.getNodeById( node_to_refresh )._refresh(); |
---|
[2] | 971 | } |
---|
[3742] | 972 | |
---|
[2] | 973 | function decrement_folder_unseen(){ |
---|
| 974 | var folder_id = get_current_folder(); |
---|
[812] | 975 | |
---|
[2] | 976 | var folder_unseen = Element('dftree_'+folder_id+'_unseen'); |
---|
[406] | 977 | var abas_unseen = Element('new_m').innerHTML; |
---|
[3742] | 978 | abas_unseen = abas_unseen.match( /(<font.*?>){0,1} *([0-9]+) *(<\/font>){0,1}/)[2]; |
---|
[406] | 979 | |
---|
| 980 | if(!folder_unseen || !abas_unseen) |
---|
[2] | 981 | return; |
---|
| 982 | |
---|
| 983 | if ((folder_unseen) && (parseInt(folder_unseen.innerHTML) > 1)) |
---|
| 984 | { |
---|
| 985 | folder_unseen.innerHTML = (parseInt(folder_unseen.innerHTML) - 1); |
---|
| 986 | } |
---|
| 987 | else if (parseInt(folder_unseen.innerHTML) <= 1) |
---|
| 988 | { |
---|
| 989 | var tmp_folder_name = tree_folders.getNodeById(folder_id).caption.split('<'); |
---|
| 990 | var folder_name = tmp_folder_name[0]; |
---|
| 991 | tree_folders.getNodeById(folder_id).alter({caption: folder_name}); |
---|
| 992 | tree_folders.getNodeById(folder_id)._refresh(); |
---|
| 993 | } |
---|
[3742] | 994 | if (parseInt(abas_unseen) > 1) { |
---|
| 995 | Element('new_m').innerHTML = '<font style="color:red">' + (parseInt(abas_unseen) - 1) + '</font>'; |
---|
| 996 | } else { |
---|
[470] | 997 | Element('new_m').innerHTML = '0'; |
---|
[5495] | 998 | $(folder_unseen).parent().empty(); |
---|
[406] | 999 | } |
---|
[823] | 1000 | if ( current_folder.indexOf( 'INBOX' ) !== 0 ) |
---|
| 1001 | { |
---|
| 1002 | var display_unseen_in_shared_folders = Element('dftree_user_unseen'); |
---|
| 1003 | if ( display_unseen_in_shared_folders ) |
---|
| 1004 | { |
---|
| 1005 | var unseen_in_shared_folders = parseInt( display_unseen_in_shared_folders.innerHTML ); |
---|
| 1006 | unseen_in_shared_folders--; |
---|
| 1007 | if ( unseen_in_shared_folders > 0 ) |
---|
| 1008 | 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")}); |
---|
| 1009 | else |
---|
| 1010 | tree_folders.getNodeById( 'user' ).alter({caption:get_lang("Shared folders")}); |
---|
| 1011 | tree_folders.getNodeById( 'user' )._refresh(); |
---|
| 1012 | } |
---|
| 1013 | } |
---|
| 1014 | var display_unseen_in_mailbox = Element('dftree_root_unseen'); |
---|
| 1015 | if ( display_unseen_in_mailbox ) |
---|
| 1016 | { |
---|
| 1017 | var unseen_in_mailbox = parseInt( display_unseen_in_mailbox.innerHTML ); |
---|
| 1018 | unseen_in_mailbox--; |
---|
| 1019 | //if ( unseen_in_mailbox > 0 ) |
---|
| 1020 | // 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")}); |
---|
| 1021 | //else |
---|
[1121] | 1022 | if(!expresso_offline) |
---|
| 1023 | var node_to_refresh = 'root'; |
---|
| 1024 | else |
---|
| 1025 | var node_to_refresh = 'local_root'; |
---|
| 1026 | tree_folders.getNodeById( node_to_refresh ).alter({caption:get_lang("My Folders")}); |
---|
| 1027 | tree_folders.getNodeById( node_to_refresh )._refresh(); |
---|
[823] | 1028 | } |
---|
[2] | 1029 | } |
---|
| 1030 | |
---|
| 1031 | function LTrim(value){ |
---|
| 1032 | var w_space = String.fromCharCode(32); |
---|
| 1033 | var strTemp = ""; |
---|
| 1034 | var iTemp = 0; |
---|
[812] | 1035 | |
---|
[814] | 1036 | var v_length = value ? value.length : 0; |
---|
[2] | 1037 | if(v_length < 1) |
---|
| 1038 | return ""; |
---|
| 1039 | |
---|
| 1040 | while(iTemp < v_length){ |
---|
| 1041 | if(value && value.charAt(iTemp) != w_space){ |
---|
| 1042 | strTemp = value.substring(iTemp,v_length); |
---|
| 1043 | break; |
---|
| 1044 | } |
---|
| 1045 | iTemp++; |
---|
[812] | 1046 | } |
---|
[2] | 1047 | return strTemp; |
---|
| 1048 | } |
---|
| 1049 | |
---|
| 1050 | //changes MENU background color. |
---|
| 1051 | function set_menu_bg(menu) |
---|
| 1052 | { |
---|
[5497] | 1053 | // TODO - remover esta função, por hora, apenas um retrun true para preservar menor impacto |
---|
| 1054 | return true; |
---|
[2] | 1055 | menu.style.backgroundColor = 'white'; |
---|
| 1056 | menu.style.border = '1px solid black'; |
---|
[814] | 1057 | menu.style.padding = '0px 0px'; |
---|
[2] | 1058 | } |
---|
| 1059 | //changes MENU background color. |
---|
| 1060 | function unset_menu_bg(menu) |
---|
| 1061 | { |
---|
[5497] | 1062 | // TODO - remover esta função, por hora, apenas um retrun true para preservar menor impacto |
---|
| 1063 | return true; |
---|
[2] | 1064 | menu.style.backgroundColor = ''; |
---|
[814] | 1065 | menu.style.border = '0px'; |
---|
| 1066 | menu.style.padding = '1px 0px'; |
---|
[2] | 1067 | } |
---|
| 1068 | |
---|
[46] | 1069 | function array_search(needle, haystack) { |
---|
| 1070 | var n = haystack.length; |
---|
| 1071 | for (var i=0; i<n; i++) { |
---|
| 1072 | if (haystack[i]==needle) { |
---|
| 1073 | return true; |
---|
| 1074 | } |
---|
| 1075 | } |
---|
| 1076 | return false; |
---|
[96] | 1077 | } |
---|
| 1078 | |
---|
[812] | 1079 | function lang_folder(fn) { |
---|
[689] | 1080 | if (fn.toUpperCase() == "INBOX") return get_lang("Inbox"); |
---|
[365] | 1081 | if (special_folders[fn] && typeof(special_folders[fn]) == 'string') { |
---|
[96] | 1082 | return get_lang(special_folders[fn]); |
---|
[673] | 1083 | } |
---|
[96] | 1084 | return fn; |
---|
[812] | 1085 | } |
---|
[163] | 1086 | |
---|
| 1087 | function add_className(obj, className){ |
---|
[651] | 1088 | if (obj && !exist_className(obj, className)) |
---|
[163] | 1089 | obj.className = obj.className + ' ' + className; |
---|
| 1090 | } |
---|
| 1091 | |
---|
| 1092 | function remove_className(obj, className){ |
---|
| 1093 | var re = new RegExp("\\s*"+className); |
---|
[320] | 1094 | if (obj) |
---|
[976] | 1095 | obj.className = obj.className.replace(re, ' '); |
---|
[163] | 1096 | } |
---|
| 1097 | |
---|
| 1098 | function exist_className(obj, className){ |
---|
[651] | 1099 | return ( obj && obj.className.indexOf(className) != -1 ) |
---|
[163] | 1100 | } |
---|
| 1101 | |
---|
[5134] | 1102 | //Verifica se ainda existem mensagens marcadas, se não desmarca |
---|
| 1103 | //o selecionar todas. |
---|
| 1104 | function remove_chk_box_select_all_messages(){ |
---|
| 1105 | var main = Element("tbody_box"); |
---|
| 1106 | var main_list = main.childNodes; |
---|
| 1107 | var len_main_list = main_list.length; |
---|
| 1108 | for (i=0; i<len_main_list; i++) |
---|
| 1109 | { |
---|
| 1110 | if (Element("check_box_message_"+main_list[i].id).checked){ |
---|
| 1111 | return; |
---|
| 1112 | } |
---|
| 1113 | } |
---|
| 1114 | document.getElementById("chk_box_select_all_messages").checked = false; |
---|
| 1115 | } |
---|
| 1116 | |
---|
[163] | 1117 | function select_all_messages(select) |
---|
| 1118 | { |
---|
| 1119 | var main = Element("tbody_box"); |
---|
| 1120 | var main_list = main.childNodes; |
---|
| 1121 | var len_main_list = main_list.length; |
---|
[6930] | 1122 | var folder = $('#content_folders .folder.selected').attr('title'); |
---|
| 1123 | folder = folder ? folder : get_lang('INBOX'); |
---|
| 1124 | folder = folder.length > 70 ? '"'+folder.substr(0,70) + "..." +'"': '"'+folder+'"' ; |
---|
| 1125 | var filterFlag = search_box_type != "ALL" ? '"'+get_lang(search_box_type) + "s" +'"': ""; |
---|
| 1126 | var div = $('.select-all-messages'); |
---|
[163] | 1127 | if (select) |
---|
| 1128 | { |
---|
| 1129 | for (i=0; i<len_main_list; i++) |
---|
| 1130 | { |
---|
| 1131 | Element("check_box_message_"+main_list[i].id).checked = true; |
---|
[5134] | 1132 | remove_className(Element(main_list[i].id), 'selected_msg'); |
---|
[6707] | 1133 | if(!$("#"+main_list[i].id).hasClass("selected_shortcut_msg")){ |
---|
| 1134 | //add_className(Element(main_list[i].id), 'selected_msg selected_shortcut_msg current_selected'); |
---|
[6930] | 1135 | add_className(Element(main_list[i].id), 'selected_msg'); |
---|
[6707] | 1136 | } else { |
---|
| 1137 | $("#"+main_list[i].id).addClass("selected_msg"); |
---|
[6930] | 1138 | //$("#"+main_list[i].id).addClass("selected_shortcut_msg"); |
---|
| 1139 | //$("#"+main_list[i].id).addClass("current_selected"); |
---|
| 1140 | } |
---|
| 1141 | selectedPagingMsgs[main_list[i].id] = true; |
---|
| 1142 | } |
---|
| 1143 | if (totalSelected() == totalFolderMsgs && totalSelected() > 0){ |
---|
| 1144 | allMsgsSelected = true; |
---|
| 1145 | if (total_pages > 1){ |
---|
| 1146 | var link = "<a class='select-link' href='#'>Limpar seleção?</a>"; |
---|
| 1147 | var info = "Todas as <b>"+totalFolderMsgs+"</b> mensagens "+filterFlag+" em "+folder+" foram selecionadas. "+link; |
---|
| 1148 | div.html("<span>"+info+"<span>"); |
---|
| 1149 | div.show(); |
---|
| 1150 | $('.select-link').bind('click',function(){ |
---|
| 1151 | selectAllFolderMsgs(); |
---|
| 1152 | //$('.select-link').unbind('click'); |
---|
| 1153 | }); |
---|
| 1154 | } |
---|
[163] | 1155 | } |
---|
[6930] | 1156 | else if (!allMsgsSelected && total_pages > 1){ |
---|
| 1157 | var link = "<a class='select-link' href='#'>Selecionar todas as <b>"+totalFolderMsgs+"</b> mensagens "+filterFlag+" em "+folder+"?</a>"; |
---|
| 1158 | var info = "Todas as <b>"+$('#table_box tr').length+"</b> mensagens desta página foram selecionadas. "+link; |
---|
| 1159 | div.html("<span>"+info+"<span>"); |
---|
| 1160 | div.show(); |
---|
| 1161 | $('.select-link').bind('click',function(){ |
---|
| 1162 | selectAllFolderMsgs(true); |
---|
| 1163 | //$('.select-link').unbind('click'); |
---|
| 1164 | }); |
---|
| 1165 | } |
---|
[163] | 1166 | } |
---|
| 1167 | else |
---|
| 1168 | { |
---|
| 1169 | for (i=0; i<len_main_list; i++) |
---|
| 1170 | { |
---|
| 1171 | Element("check_box_message_"+main_list[i].id).checked = false; |
---|
[5134] | 1172 | remove_className(Element(main_list[i].id), 'selected_msg selected_shortcut_msg'); |
---|
[6689] | 1173 | $("#"+main_list[i].id).removeClass("selected_msg"); |
---|
[6707] | 1174 | $("#"+main_list[i].id).removeClass("current_selected"); |
---|
[6930] | 1175 | selectedPagingMsgs[main_list[i].id] = false; |
---|
[163] | 1176 | } |
---|
[6930] | 1177 | if (allMsgsSelected){ |
---|
| 1178 | allMsgsSelected = false; |
---|
| 1179 | updateSelectedMsgs(); |
---|
| 1180 | } |
---|
| 1181 | else if (totalSelected() > 0 && total_pages > 1){ |
---|
| 1182 | var link = "<a class='select-link' href='#'>Limpar seleção?</a>"; |
---|
| 1183 | var info = "Foram selecionadas <b>"+totalSelected()+"</b> mensagens "+filterFlag+" em "+folder+". "+link; |
---|
| 1184 | div.html("<span>"+info+"<span>"); |
---|
| 1185 | div.show(); |
---|
| 1186 | $('.select-link').bind('click',function(){ |
---|
| 1187 | selectAllFolderMsgs(false); |
---|
| 1188 | //$('.select-link').unbind('click'); |
---|
| 1189 | }); |
---|
| 1190 | } |
---|
| 1191 | else div.hide(); |
---|
| 1192 | |
---|
[163] | 1193 | } |
---|
[6930] | 1194 | resizeWindow(); |
---|
[163] | 1195 | } |
---|
[1622] | 1196 | |
---|
[3064] | 1197 | function borkb(size){ |
---|
| 1198 | kbyte = 1024; |
---|
| 1199 | mbyte = kbyte*1024; |
---|
| 1200 | gbyte = mbyte*1024; |
---|
| 1201 | if (!size) |
---|
| 1202 | size = 0; |
---|
| 1203 | if (size < kbyte) |
---|
| 1204 | return size + ' B'; |
---|
| 1205 | else if (size < mbyte) |
---|
| 1206 | return parseInt(size/kbyte) + ' KB'; |
---|
| 1207 | else if (size < gbyte) |
---|
| 1208 | if (size/mbyte > 100) |
---|
| 1209 | return (size/mbyte).toFixed(0) + ' MB'; |
---|
| 1210 | else |
---|
| 1211 | return (size/mbyte).toFixed(1) + ' MB'; |
---|
| 1212 | else |
---|
| 1213 | return (size/gbyte).toFixed(1) + ' GB'; |
---|
| 1214 | } |
---|
[3018] | 1215 | |
---|
[5134] | 1216 | //valida se a primeira data é menor que a segunda data |
---|
| 1217 | function validate_date_order(dateStart, dateEnd){ |
---|
| 1218 | if ( parseInt( dateEnd.split( "/" )[2].toString() + dateEnd.split( "/" )[1].toString() + dateEnd.split( "/" )[0].toString() ) >= parseInt( dateStart.split( "/" )[2].toString() + dateStart.split( "/" )[1].toString() + dateStart.split( "/" )[0].toString() ) ){ |
---|
| 1219 | return true; |
---|
| 1220 | }else{ |
---|
| 1221 | return false; |
---|
| 1222 | } |
---|
| 1223 | } |
---|
| 1224 | |
---|
[1622] | 1225 | function validate_date(date){ |
---|
| 1226 | if (date.match(/^[0-3][0-9]\/[0-1][0-9]\/\d{4,4}$/)) |
---|
| 1227 | { |
---|
| 1228 | tmp = date.split('/'); |
---|
| 1229 | |
---|
| 1230 | day = new Number(tmp[0]); |
---|
| 1231 | month = new Number(tmp[1]); |
---|
| 1232 | year = new Number(tmp[2]); |
---|
| 1233 | if (month >= 1 && month <= 12 && day >= 1 && day <= 31) |
---|
| 1234 | { |
---|
| 1235 | if (month == 02 && day <= 29) |
---|
| 1236 | { |
---|
| 1237 | return true; |
---|
| 1238 | } |
---|
| 1239 | return true; |
---|
| 1240 | } |
---|
| 1241 | else |
---|
| 1242 | { |
---|
| 1243 | return false; |
---|
| 1244 | } |
---|
| 1245 | } |
---|
| 1246 | else |
---|
| 1247 | { |
---|
| 1248 | return false; |
---|
| 1249 | } |
---|
| 1250 | } |
---|
[3834] | 1251 | |
---|
| 1252 | function dateMask(inputData, e){ |
---|
| 1253 | if(document.all) // Internet Explorer |
---|
| 1254 | var tecla = event.keyCode; |
---|
| 1255 | else //Outros Browsers |
---|
| 1256 | var tecla = e.which; |
---|
| 1257 | |
---|
| 1258 | if(tecla >= 47 && tecla < 58){ // numeros de 0 a 9 e "/" |
---|
| 1259 | var data = inputData.value; |
---|
| 1260 | if (data.length == 2 || data.length == 5){ |
---|
| 1261 | data += '/'; |
---|
| 1262 | inputData.value = data; |
---|
| 1263 | } |
---|
| 1264 | } else { |
---|
| 1265 | if(tecla == 8 || tecla == 0) // Backspace, Delete e setas direcionais(para mover o cursor, apenas para FF) |
---|
| 1266 | return true; |
---|
| 1267 | else |
---|
| 1268 | return false; |
---|
| 1269 | } |
---|
[4749] | 1270 | } |
---|
| 1271 | |
---|
| 1272 | function translateFolder(folderName){ |
---|
| 1273 | |
---|
| 1274 | for (var i = 0; i < folders.length; i++) |
---|
| 1275 | { |
---|
| 1276 | if (folders[i].folder_parent == 'user' |
---|
| 1277 | && folderName == folders[i].folder_id.split(cyrus_delimiter).pop()) |
---|
| 1278 | { |
---|
| 1279 | if (folders[i].folder_id.split(cyrus_delimiter).pop() != folders[i].folder_name) |
---|
| 1280 | { |
---|
| 1281 | return folders[i].folder_name; |
---|
| 1282 | } |
---|
| 1283 | } |
---|
| 1284 | } |
---|
| 1285 | |
---|
| 1286 | return folderName; |
---|
[6291] | 1287 | } |
---|