Changeset 4283


Ignore:
Timestamp:
05/09/11 14:42:38 (13 years ago)
Author:
airton
Message:

Ticket #1820 - revertendo alteracao dos arquivos js que eram utilizados e foram sobrescrevidos na revisao 4281

Location:
sandbox/2.2.0.2/expressoMail1_2/js
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.2.0.2/expressoMail1_2/js/draw_api.js

    r4281 r4283  
    25922592                //var option_send = '<span class="message_options" onclick=send_message("'+ID+'","null","null");>'+get_lang("Send")+'</span> | '; 
    25932593                var option_send   = '<input type="button" id="send_button_'+ID+'" class="em_button_like_span" tabindex="1" value="'+get_lang("Send and not file")+'" onclick=send_message("'+ID+'","null","null");>' + ' | '; 
    2594  
    25952594                if(!expresso_offline) 
    25962595                        var option_send_and_file= '<span class="message_options" onclick=wfolders.makeWindow("'+ID+'","send_and_file");>'+get_lang("Send and file")+'</span> | '; 
    2597                 else 
     2596                else                     
    25982597                        var option_send_and_file=''; 
    25992598        } 
     
    26162615 
    26172616        tr_menu_new_message.appendChild(td_menu_new_message); 
    2618  
    26192617        tbody_menu_new_message.appendChild(tr_menu_new_message); 
    26202618        table_menu_new_message.appendChild(tbody_menu_new_message); 
     
    31443142        tr5.appendChild(td5); 
    31453143        tr5.appendChild(td_return_receipt); 
    3146  
    3147         if ( ! expresso_offline ) 
    3148         { 
    3149                 var text_plain = td_return_receipt.appendChild( 
    3150                         document.createElement( 'span' ) 
    3151                 ).appendChild( 
    3152                         document.createTextNode( ' | ' ) 
    3153                 ).parentNode.appendChild( 
    3154                         document.createTextNode( get_lang('Send this mail as text plain') + '.') 
    3155                 ).parentNode.appendChild( 
    3156                         document.createElement( 'input' ) 
    3157                 ); 
    3158                 text_plain.setAttribute( 'tabIndex', '-1' ); 
    3159                 text_plain.id = 'textplain_rt_checkbox_' + ID ; 
    3160                 text_plain.type = "checkbox"; 
    3161                 text_plain.onclick = function () 
    3162                 { 
    3163                         RichTextEditor.plain( this.checked ); 
    3164                         document.getElementById( 'viewsource_rt_checkbox_' + ID ).parentNode.style.display = ( this.checked ) ? 'none' : ''; 
    3165                 }; 
    3166         } 
    3167  
    31683144        tbody_message.appendChild(tr5); 
    31693145        if (parseInt(preferences.use_important_flag)) 
     
    32453221                draw_from_field(sel_from,tr1_1); 
    32463222        resizeWindow(); 
    3247  
    3248         if ( ! expresso_offline ) 
    3249         { 
    3250                 if ( mobile_device ) 
    3251                 { 
    3252                         text_plain.click( ); 
    3253                         text_plain.parentNode.style.display = 'none'; 
    3254                 } 
    3255         } 
    3256          
    32573223        return ID; 
    32583224} 
  • sandbox/2.2.0.2/expressoMail1_2/js/main.js

    r4282 r4283  
    55var autosave_time = 20000; 
    66 
     7var cabecalho = '<h4>ExpressoLivre - ExpressoMail</h4>';  
     8 
    79function init(){ 
    810        if (!is_ie) 
     
    2022 
    2123                preferences = data; 
     24                 
     25                if(preferences.show_name_print_messages == "1") {  
     26                        var getUserName = document.getElementById("user_info");  
     27                        var userName = getUserName.innerHTML;  
     28                        var position = userName.indexOf("-");  
     29                        var userName = userName.substring(3, position);  
     30                        cabecalho = '<h4>' + userName;  
     31                }   
     32                 
    2233                current_folder="INBOX"; 
    2334                 
     
    7990 
    8091        cExecute ("$this.functions.get_preferences", save_preferences); 
    81         cExecute ("phpgwapi.browser.isMobile", function( data ) 
    82         { 
    83                 mobile_device = ( ( data.constructor == Boolean ) ? data : ( data === 'true' ) ); 
    84         } ); 
    8592        setTimeout('auto_refresh()', time_refresh); 
    8693 
     
    890897                } 
    891898        var new_border_ID = draw_new_message(parseInt(border_ID)); 
     899 
    892900        if(typeof(openTab.type[new_border_ID]) != "undefined") { 
    893901                if(tabTypes[type] == openTab.type[new_border_ID]) { 
     
    910918                } 
    911919        } 
     920 
    912921        if (new_border_ID == false) 
    913922        { 
     
    16391648        } 
    16401649 
    1641         if ( document.getElementById('viewsource_rt_checkbox_' + ID).checked == true ) 
    1642                 document.getElementById('viewsource_rt_checkbox_' + ID).click(); 
     1650        if ( document.getElementById('viewsource_rt_checkbox').checked == true ) 
     1651                document.getElementById('viewsource_rt_checkbox').click(); 
    16431652 
    16441653        var save_link = Element("save_message_options_"+ID); 
     
    16511660                send_message_return(data, this.ID_tmp); // this is a hack to escape quotation form connector bug 
    16521661        }; 
    1653  
    1654         var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + ID ); 
    1655         mail_as_plain = ( mail_as_plain ) ? mail_as_plain.checked : false; 
    16561662 
    16571663        var textArea = document.createElement("TEXTAREA"); 
     
    16591665        textArea.name = "body"; 
    16601666        body = document.getElementById("body_"+ID); 
    1661         textArea.value = ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) ); 
     1667        textArea.value += '<body>\r\n'; 
     1668        textArea.value += body.contentWindow.document.body.innerHTML; 
     1669        textArea.value += '\r\n</body>'; 
    16621670        var input_folder = document.createElement("INPUT"); 
    16631671        input_folder.style.display='none'; 
     
    16931701        form.appendChild(input_folder); 
    16941702        form.appendChild(msg_id); 
    1695  
    1696         var mail_type = form.appendChild( document.createElement( 'input' ) ); 
    1697         mail_type.name = 'type'; 
    1698         mail_type.type = 'hidden'; 
    1699         mail_type.value = ( mail_as_plain ) ? 'plain' : 'html'; 
    17001703 
    17011704        var _subject = trim(Element("subject_"+ID).value); 
     
    19031906                withImage = false; 
    19041907 
    1905         var rt_checkbox = Element('viewsource_rt_checkbox_' + border_id); 
     1908        var rt_checkbox = Element('viewsource_rt_checkbox'); 
    19061909        if (rt_checkbox == null) 
    19071910                return false; 
     
    19291932        message_id = openTab.imapUid[border_id]; 
    19301933        var handler_save_msg = function(data){ return_save(data,this.tmp_border_id,this.tmp_folder_name,this.tmp_folder_id,this.message_id); } 
    1931          
    1932         var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + border_id );  
    1933         mail_as_plain = ( mail_as_plain ) ? mail_as_plain.checked : false;  
    19341934 
    19351935        var textArea = document.createElement("TEXTAREA"); 
     
    19391939        if (! body) 
    19401940                return; 
    1941          
    1942         textArea.value = ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) );  
     1941        textArea.value += '<body>\r\n'; 
     1942        textArea.value += body.contentWindow.document.body.innerHTML; 
     1943        textArea.value += '\r\n</body>'; 
    19431944        var input_folder = document.createElement("INPUT"); 
    19441945        input_folder.style.display='none'; 
     
    19671968        form.appendChild(input_insertImg); 
    19681969 
    1969         var mail_type = form.appendChild( document.createElement( 'input' ) );  
    1970         mail_type.name = 'type';  
    1971         mail_type.type = 'hidden';  
    1972         mail_type.value = ( mail_as_plain ) ? 'plain' : 'html';  
    1973          
    19741970        cExecuteForm ("$this.imap_functions.save_msg", form, handler_save_msg,border_id); 
    19751971} 
     
    21652161                try{ 
    21662162                        var html = '<br>'; 
    2167                         html += "<h4>ExpressoLivre - ExpressoMail</h4>"; 
     2163                        html += cabecalho + "</h4><hr>"; 
    21682164                        html += folder+"<hr>"; 
    21692165 
     
    22432239        } else{ 
    22442240                show_attachs = ""; 
    2245         }        
     2241        } 
     2242         
    22462243        var current_path = window.location.href.substr(0,window.location.href.lastIndexOf("/")); 
    2247         var window_print_head  = window_print.document.getElementsByTagName("head")[0]; 
    2248         // For IE 
    2249         if(typeof(window_print_head) == 'undefined'){ 
    2250                 window_print_head = window_print.document.createElement("head"); 
    2251                 window_print.document.appendChild(window_print_head); 
    2252         } 
    2253         var window_print_style = window_print.document.createElement("LINK"); 
    2254         window_print_style.href = current_path+'/templates/default/main.css'; 
    2255         window_print_style.type = "text/css"; 
    2256         window_print_style.rel = "stylesheet"; 
    2257         window_print_head.appendChild(window_print_style);       
    2258  
     2244 
     2245        var head = '<head><title></title><link href="'+current_path+'/templates/default/main.css" type="text/css" rel="stylesheet"></head>';  
     2246        window_print.document.write(head);  
     2247         
    22592248        while (1){ 
    22602249                try{ 
    22612250                        var html ='<body>'; 
    2262                         html += "<h4>ExpressoLivre - ExpressoMail</h4><hr>"; 
     2251                        html += cabecalho + "</h4><hr>"; 
    22632252                        html += '<table><tbody>'; 
    22642253                        if(sender) 
     
    22862275                        html += show_attachs; //to show the names of the attachments 
    22872276                        html += "</tbody></table><hr>"; 
    2288                         window_print.document.body.innerHTML = html + body.innerHTML; 
     2277                        window_print.document.write(html + body.innerHTML);  
    22892278                        if(!is_ie){ 
    22902279                                var tab_tags = window_print.document.getElementsByTagName("IMG"); 
     
    25142503        } 
    25152504        form_upload.innerHTML = '<form method="POST" name="form_import" enctype="multipart/form-data">'+get_lang('zip mails to import')+':<br>'+ 
    2516         '<input name="file_1" maxlength="255" size="50" id="file_1" type="file"><br>' + 
     2505        '<input name="file_1" maxlength="255" size="40" id="file_1" type="file"><br>' + 
    25172506        '<input title="'+get_lang('Select a folder')+'"  value="' + get_lang('Select a folder') + '"' + 'type="button" onclick="javascript:select_import_folder()">&nbsp;' + 
    25182507        '<input title="' + get_lang('Close') + '"  value="' + get_lang('Close') + '"' + 
  • sandbox/2.2.0.2/expressoMail1_2/js/rich_text_editor.js

    r4281 r4283  
    2525                parentDiv.appendChild(this.table); 
    2626 
    27         var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + this.id ); 
    28         this.table.style.visibility = ( mail_as_plain && mail_as_plain.checked ) ? 'hidden' : 'visible'; 
    29  
    3027        if(!Element(this.editor)) 
    3128        { 
     
    3431        else 
    3532        { 
    36                 Element( 'viewsource_rt_checkbox_' + this.id ).checked=false; 
     33                Element("viewsource_rt_checkbox").checked=false; 
    3734        } 
    3835 
     
    5350                config_events( iframe, 'onload', function( ) 
    5451                { 
    55                         if ( iframe.contentWindow.document.body && iframe.contentWindow.document.body.contentEditable ) 
    56                                 iframe.contentWindow.document.body.contentEditable = true; 
    57  
     52                        iframe.contentWindow.document.designMode = "on"; 
    5853                        if ( iframe.contentWindow.document.documentElement ){ 
    5954                                iframe.contentWindow.document.documentElement.style.background = '#fff'; 
     
    6257                }); 
    6358 
     59                var checkbox = document.createElement("INPUT"); 
     60                checkbox.id = 'viewsource_rt_checkbox'; 
     61                checkbox.type = "checkbox"; 
     62                checkbox.setAttribute("tabIndex","-1"); 
     63                checkbox.onclick = function () {RichTextEditor.viewsource(this.checked)}; 
     64                var text = document.createTextNode(get_lang('View HTML source') + '.'); 
    6465                parentDiv.appendChild(iframe); 
    65  
    66                 var source = document.createElement( 'input' ); 
    67                 source.id = 'viewsource_rt_checkbox_' + this.id; 
    68                 source.type = "checkbox"; 
    69                 source.setAttribute("tabIndex","-1"); 
    70                 source.onclick = function( ) 
    71                 { 
    72                         RichTextEditor.viewsource(this.checked); 
    73                 }; 
    74                 source = parentDiv.appendChild( 
    75                         document.createElement( 'span' ).appendChild( source ).parentNode 
    76                 ).appendChild( 
    77                         document.createTextNode( get_lang( 'View HTML source' ) + '.' ) 
    78                 ).parentNode; 
     66                parentDiv.appendChild(checkbox); 
     67                parentDiv.appendChild(text); 
    7968} 
    8069 
     
    149138                        document.getElementById(this.editor).contentWindow.document.body.innerHTML = html.toString(); 
    150139                        document.getElementById("table_richtext_toolbar").style.visibility="visible";   
    151                 } 
    152         } 
    153 } 
    154  
    155 cRichTextEditor.prototype.plain = function(source) { 
    156         var html; 
    157         var editor = document.getElementById( this.editor ); 
    158  
    159         if (source) { 
    160                 if (is_ie){ 
    161                         connector.loadScript('html2xhtml'); 
    162                         html = frames[this.editor].document.body; 
    163                         var xhtml = get_xhtml(html, 'en', 'iso-8859-1'); 
    164                         frames[this.editor].document.body.innerText = xhtml; 
    165                         document.getElementById("table_richtext_toolbar").style.visibility="hidden"; 
    166                 } 
    167                 else{ 
    168                         var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + this.id ); 
    169  
    170                         html = document.createTextNode( editor.contentWindow.document.body.innerHTML ); 
    171                         html = html.nodeValue.replace( /<br\s*\/?>/mg, "\n" ).replace( /(<([^>]+)>)/ig, '' ).replace( /^[\n ]+|[\n ]+$/g, '' ); 
    172  
    173                         if ( ! mobile_device && html != '' && ! ( mail_as_plain.checked = confirm( 'The text format will be lost.' ) ) ) 
    174                                 return false; 
    175  
    176                         this.table.style.visibility="hidden"; 
    177                         editor.contentWindow.document.body.innerHTML = ''; 
    178  
    179                         var textarea = document.createElement( 'textarea' ); 
    180                         textarea.style.width = '99%'; 
    181                         textarea.style.height = '300px'; 
    182                         textarea.style.fontSize = '12pt'; 
    183                         textarea.innerHTML = html; 
    184  
    185                         editor.style.width = '0px'; 
    186                         editor.style.height = '0px'; 
    187                         editor.style.visibility = 'hidden'; 
    188  
    189                         editor.parentNode.insertBefore( textarea, editor ); 
    190                         textarea.focus( ); 
    191                 } 
    192         } else { 
    193                 if (is_ie){ 
    194                         var output = escape(frames[this.editor].document.body.innerText); 
    195                         output = output.replace("%3CP%3E%0D%0A%3CHR%3E", "%3CHR%3E"); 
    196                         output = output.replace("%3CHR%3E%0D%0A%3C/P%3E", "%3CHR%3E"); 
    197                         frames[this.editor].document.body.innerHTML = unescape(output); 
    198                         document.getElementById("table_richtext_toolbar").style.visibility="visible"; 
    199                 } 
    200                 else{ 
    201                         editor.contentWindow.document.body.innerHTML = editor.previousSibling.value.replace( /\n/g, '<br/>' ); 
    202                         editor.parentNode.removeChild( editor.previousSibling ); 
    203  
    204                         editor.style.width = '99%'; 
    205                         editor.style.height = '300px'; 
    206                         editor.style.visibility = 'visible'; 
    207  
    208                         this.loadEditor( this.id ); 
    209140                } 
    210141        } 
     
    566497                form_upload.style.height = "75px"; 
    567498                form_upload.innerHTML = get_lang('Select the desired image file')+':<br>'+ 
    568                                                                 '<input name="image_at" maxlength="255" size="50" id="inputFile_img" type="file"><br>' + 
     499                                                                '<input name="image_at" maxlength="255" size="40" id="inputFile_img" type="file"><br>' + 
    569500                                                                '<input title="' + get_lang('Include') + '"  value="' + get_lang('Include') + '"' + 'type="button" onclick="RichTextEditor.addInputFile();">&nbsp;' + 
    570501                                                                '<input title="' + get_lang('Close') + '"  value="' + get_lang('Close') + '"' + 
Note: See TracChangeset for help on using the changeset viewer.