var openTab = { 'type' : [], // 8 types of tabs, further info. see expressolivre.org/dev/wiki/mail/Documentacao 'content_id' : [], 'imapUid' : [], // Stores the imap email number of current tab 'countFile' : [0,0,0,0,0,0,0,0,0,0], // Stores the number of files attached in current tab 'imapBox' : [], // Stores the folder name 'toPreserve' : [], // Check if the message should be removed from draft after send 'autosave_timer' : [] // The timeout timer for autosave function }; var tabTypes = { 'new':4, 'forward':6, 'reply_with_history':7, 'reply_to_all_with_history':8, 'reply_without_history':9, 'reply_to_all_without_history':10, 'edit':5 }; var currentTab,numBox = 0; // Open Tab and num of mailboxes opened at context function setBorderAttributes(ID) { this.border_id = "border_id_"+ID; this.sequence = ID; } function alternate_border(ID) { if (! Element('border_id_'+ID)) return false; // Not possible to alternate show_hide_span_paging(ID); spanD = Element("span_D"); if (spanD) spanD.style.display = (openTab.type[ID] == 0 ? '' : 'none'); var footer_menu = Element("footer_menu"); if (footer_menu) { footer_menu.style.display = (openTab.type[ID] != 4 ? '' : 'none'); } var len = BordersArray.length; for (var i=0; i < len; i++) { m = document.getElementById(BordersArray[i].border_id); if ((m)&&(m.className == 'menu-sel')) { m.className = 'menu'; c = document.getElementById("content_id_"+BordersArray[i].sequence); c.style.display = 'none'; if(Element("font_border_id_"+BordersArray[i].sequence)) Element("font_border_id_"+BordersArray[i].sequence).className = 'font-menu'; var body = Element('body_'+BordersArray[i].sequence); if (body) { try { if (Element('viewsource_rt_checkbox').checked) { expresso.connector.loadScript("jscode/rich_text_editor"); if(typeof(RichTextEditor) == 'undefined'){ setTimeout('alernate_border(\''+ID+'\');',500); return false; } RichTextEditor.viewsource(false); } } catch(e) { //alert(e.message) } } } } m = Element("border_id_"+ID); if (m) m.className = 'menu-sel'; if(Element("font_border_id_" + ID)) Element("font_border_id_" + ID).className = 'font-menu-sel'; var c = Element("content_id_"+ID); if (c) c.style.display = ''; body = document.getElementById('body_'+ ID); if (body){ try{ if(ID){ expresso.connector.loadScript("jscode/rich_text_editor"); RichTextEditor.loadEditor(ID); } body.contentWindow.document.designMode="on"; } catch(e){ //alert(e.message); }; } // hide the DropDrowContact, if necessary window_DropDownContacts = Element('tipDiv'); if ((window_DropDownContacts)&&(window_DropDownContacts.style.visibility != 'hidden')){ window_DropDownContacts.style.visibility = 'hidden'; } if (typeof(ID) == 'number') { numBox=ID; } else if (ID.match("search_")) numBox=ID.substr(7); currentTab=ID; return ID; } function create_border(borderTitle, id_value) { if ( _dragArea == null ) _dragArea = new DragArea( ); var resize = false; var offWidth = Element('border_blank').offsetWidth ? Element('border_blank').offsetWidth : Element('border_blank').clientWidth; if (offWidth < 200) { resize = resize_borders(); if (!resize){ alert(get_lang('Reached maximum tab limit')); return false; } } if (! id_value) // Is new message? var ID = parseInt(BordersArray[(BordersArray.length-1)].sequence) + 1; else { if (Element("border_id_"+id_value)) // It's opened already! return alternate_border(id_value); var ID = id_value; openTab.imapBox[ID] = current_folder; } td = document.createElement("TD"); td.id="border_id_" + ID; if(resize) { td.setAttribute("width", parseInt(resize)+"px"); td.style.width = parseInt(resize)+"px"; } else td.setAttribute("width", "200px"); td.setAttribute("align", "right"); td.onclick = function(){alternate_border(ID);resizeWindow()}; td.setAttribute("noWrap","true"); td.alt = borderTitle; td.title = borderTitle; borderTitle = borderTitle ? borderTitle : id_value ? get_lang("No Subject") : " " ; td.value = borderTitle; if (borderTitle.length > 21) borderTitle = borderTitle.substring(0,21) + "..."; if (resize) borderTitle = borderTitle.substring(0, resize*0.08); td.innerHTML = "
" + borderTitle + " | ![]() |