Changeset 4291
- Timestamp:
- 05/09/11 17:55:51 (13 years ago)
- Location:
- sandbox/2.2.0.2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.2.0.2/expressoMail1_2/inc/class.imap_functions.inc.php
r4169 r4291 2068 2068 { 2069 2069 if($certificado->dados['EXPIRADO']) $erros_acumulados .='Certificado expirado.'; 2070 if($certificado->dados['CPF'] != $this->username) $erros_acumulados .=' CPF no certificado diferente do logado no expresso.'; 2070 $this->cpf = isset($GLOBALS['phpgw_info']['server']['certificado_atributo_cpf'])&&$GLOBALS['phpgw_info']['server']['certificado_atributo_cpf']!=''?$_SESSION['phpgw_info']['expressomail']['user'][$GLOBALS['phpgw_info']['server']['certificado_atributo_cpf']]:$this->username; 2071 if($certificado->dados['CPF'] != $this->cpf) $erros_acumulados .=' CPF no certificado diferente do logado no expresso.'; 2071 2072 if(!($certificado->dados['KEYUSAGE']['digitalSignature'] && $certificado->dados['EXTKEYUSAGE']['emailProtection'])) $erros_acumulados .=' Certificado nao permite assinar mensagens.'; 2072 2073 } … … 2139 2140 $mail->AddReplyTo($replytoaddress); 2140 2141 $mail->Subject = $subject; 2141 $mail->IsHTML( $params['type'] != 'textplain');2142 $mail->IsHTML( ( array_key_exists( 'type', $params ) && in_array( strtolower( $params[ 'type' ] ), array( 'html', 'plain' ) ) ) ? strtolower( $params[ 'type' ] ) != 'plain' : true ); 2142 2143 $mail->Body = $body; 2143 2144 -
sandbox/2.2.0.2/expressoMail1_2/js/abas.js
r4139 r4291 56 56 try 57 57 { 58 if (Element('viewsource_rt_checkbox ').checked)58 if (Element('viewsource_rt_checkbox_' + ID).checked) 59 59 { 60 60 connector.loadScript("rich_text_editor"); -
sandbox/2.2.0.2/expressoMail1_2/js/color_palette.js
r320 r4291 24 24 cColorPalette.prototype.repos = function (intElemScrollTop) 25 25 { 26 var new_pos = findPosY(Element("forecolor")) - intElemScrollTop + 20; 27 this.div.style.top = new_pos; 26 if ( Element("forecolor") ) 27 { 28 var new_pos = findPosY(Element("forecolor")) - intElemScrollTop + 20; 29 this.div.style.top = new_pos; 30 } 28 31 } 29 32 -
sandbox/2.2.0.2/expressoMail1_2/js/draw_api.js
r4283 r4291 2615 2615 2616 2616 tr_menu_new_message.appendChild(td_menu_new_message); 2617 2618 if ( ! expresso_offline ) 2619 { 2620 var text_plain = td_menu_new_message.appendChild( 2621 document.createElement( 'span' ) 2622 ).appendChild( 2623 document.createTextNode( ' | ' ) 2624 ).parentNode.appendChild( 2625 document.createElement( 'input' ) 2626 ).parentNode.appendChild( 2627 document.createTextNode( get_lang('Send this mail as text plain') + '.') 2628 ).previousSibling; 2629 text_plain.setAttribute( 'tabIndex', '-1' ); 2630 text_plain.id = 'textplain_rt_checkbox_' + ID ; 2631 text_plain.type = "checkbox"; 2632 text_plain.onclick = function () 2633 { 2634 RichTextEditor.plain( ( ! this.checked ) ? this.checked : mobile_device || ( this.checked = confirm( 'The text format will be lost.' ) ) ); 2635 document.getElementById( 'viewsource_rt_checkbox_' + ID ).parentNode.style.display = ( this.checked ) ? 'none' : ''; 2636 }; 2637 } 2638 2617 2639 tbody_menu_new_message.appendChild(tr_menu_new_message); 2618 2640 table_menu_new_message.appendChild(tbody_menu_new_message); … … 3221 3243 draw_from_field(sel_from,tr1_1); 3222 3244 resizeWindow(); 3245 3246 if ( ! expresso_offline ) 3247 { 3248 if ( mobile_device ) 3249 { 3250 text_plain.click( ); 3251 text_plain.parentNode.style.display = 'none'; 3252 } 3253 } 3254 3255 3223 3256 return ID; 3224 3257 } -
sandbox/2.2.0.2/expressoMail1_2/js/globals.js
r3384 r4291 45 45 var divStatusBar = document.getElementById("divStatusBar"); 46 46 var denyFileExtensions = new Array('exe','com','reg','chm','cnf','hta','ins','jse','job','lnk','pif','src','scf','sct','shb','vbe','vbs','wsc','wsf','wsh','cer','its','mau','','mda','mar','mdz','prf','pst'); 47 var mobile_device = false; 47 48 -
sandbox/2.2.0.2/expressoMail1_2/js/main.js
r4283 r4291 90 90 91 91 cExecute ("$this.functions.get_preferences", save_preferences); 92 cExecute ("phpgwapi.browser.isMobile", function( data ) 93 { 94 mobile_device = ( ( data.constructor == Boolean ) ? data : ( data === 'true' ) ); 95 } ); 96 92 97 setTimeout('auto_refresh()', time_refresh); 93 98 … … 1648 1653 } 1649 1654 1650 if ( document.getElementById('viewsource_rt_checkbox ').checked == true )1651 document.getElementById('viewsource_rt_checkbox ').click();1655 if ( document.getElementById('viewsource_rt_checkbox_' + ID).checked == true ) 1656 document.getElementById('viewsource_rt_checkbox_' + ID).click(); 1652 1657 1653 1658 var save_link = Element("save_message_options_"+ID); … … 1661 1666 }; 1662 1667 1668 var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + ID ); 1669 mail_as_plain = ( mail_as_plain ) ? mail_as_plain.checked : false; 1670 1663 1671 var textArea = document.createElement("TEXTAREA"); 1664 1672 textArea.style.display='none'; 1665 1673 textArea.name = "body"; 1666 1674 body = document.getElementById("body_"+ID); 1667 textArea.value += '<body>\r\n'; 1668 textArea.value += body.contentWindow.document.body.innerHTML;1669 textArea.value += '\r\n</body>';1675 1676 textArea.value += ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) ); 1677 1670 1678 var input_folder = document.createElement("INPUT"); 1671 1679 input_folder.style.display='none'; … … 1702 1710 form.appendChild(msg_id); 1703 1711 1712 var mail_type = form.appendChild( document.createElement( 'input' ) ); 1713 mail_type.name = 'type'; 1714 mail_type.type = 'hidden'; 1715 mail_type.value = ( mail_as_plain ) ? 'plain' : 'html'; 1716 1717 1704 1718 var _subject = trim(Element("subject_"+ID).value); 1705 1719 if((_subject.length == 0) && !confirm(get_lang("Send this message without a subject?"))) { … … 1906 1920 withImage = false; 1907 1921 1908 var rt_checkbox = Element('viewsource_rt_checkbox ');1922 var rt_checkbox = Element('viewsource_rt_checkbox_' + ID); 1909 1923 if (rt_checkbox == null) 1910 1924 return false; -
sandbox/2.2.0.2/expressoMail1_2/js/rich_text_editor.js
r4283 r4291 25 25 parentDiv.appendChild(this.table); 26 26 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'; 27 29 if(!Element(this.editor)) 28 30 { … … 31 33 else 32 34 { 33 Element("viewsource_rt_checkbox ").checked=false;35 Element("viewsource_rt_checkbox_" + this.id).checked=false; 34 36 } 35 37 … … 50 52 config_events( iframe, 'onload', function( ) 51 53 { 52 iframe.contentWindow.document.designMode = "on"; 54 if ( iframe.contentWindow.document.body && iframe.contentWindow.document.body.contentEditable ) 55 iframe.contentWindow.document.body.contentEditable = true; 56 53 57 if ( iframe.contentWindow.document.documentElement ){ 54 58 iframe.contentWindow.document.documentElement.style.background = '#fff'; … … 57 61 }); 58 62 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') + '.'); 63 65 64 parentDiv.appendChild(iframe); 66 parentDiv.appendChild(checkbox); 67 parentDiv.appendChild(text); 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; 79 68 80 } 69 81 … … 141 153 } 142 154 } 155 156 157 cRichTextEditor.prototype.plain = function(source) { 158 var html; 159 var editor = document.getElementById( this.editor ); 160 161 if (source) { 162 if (is_ie){ 163 connector.loadScript('html2xhtml'); 164 html = frames[this.editor].document.body; 165 var xhtml = get_xhtml(html, 'en', 'iso-8859-1'); 166 frames[this.editor].document.body.innerText = xhtml; 167 document.getElementById("table_richtext_toolbar").style.visibility="hidden"; 168 } 169 else{ 170 html = document.createTextNode( editor.contentWindow.document.body.innerHTML ); 171 this.table.style.visibility="hidden"; 172 editor.contentWindow.document.body.innerHTML = ''; 173 174 var textarea = document.createElement( 'textarea' ); 175 textarea.style.width = '99%'; 176 textarea.style.height = '300px'; 177 textarea.style.fontSize = '12pt'; 178 textarea.innerHTML = html.nodeValue.replace( /<br\s*\/?>/mg, "\n" ).replace( /(<([^>]+)>)/ig, '' ); 179 180 editor.style.width = '0px'; 181 editor.style.height = '0px'; 182 editor.style.visibility = 'hidden'; 183 184 editor.parentNode.insertBefore( textarea, editor ); 185 textarea.focus( ); 186 } 187 } else { 188 if (is_ie){ 189 var output = escape(frames[this.editor].document.body.innerText); 190 output = output.replace("%3CP%3E%0D%0A%3CHR%3E", "%3CHR%3E"); 191 output = output.replace("%3CHR%3E%0D%0A%3C/P%3E", "%3CHR%3E"); 192 frames[this.editor].document.body.innerHTML = unescape(output); 193 document.getElementById("table_richtext_toolbar").style.visibility="visible"; 194 } 195 else{ 196 editor.contentWindow.document.body.innerHTML = editor.previousSibling.value.replace( /\n/g, '<br/>' ); 197 editor.parentNode.removeChild( editor.previousSibling ); 198 199 editor.style.width = '99%'; 200 editor.style.height = '300px'; 201 editor.style.visibility = 'visible'; 202 this.loadEditor( this.id ); 203 } 204 } 205 } 206 207 208 143 209 144 210 cRichTextEditor.prototype.buildEditor = function() { -
sandbox/2.2.0.2/phpgwapi/inc/class.browser.inc.php
r3621 r4291 199 199 } 200 200 201 function isMobile( ) 202 { 203 return $this -> is_ipad( ) 204 || $this -> is_iphone( ) 205 || $this -> is_nokia( ) 206 || $this -> is_ipod( ) 207 || $this -> is_blackberry( ) 208 || $this -> is_android( ); 209 } 210 201 211 function is_beos() 202 212 {
Note: See TracChangeset
for help on using the changeset viewer.