Changeset 5962
- Timestamp:
- 04/18/12 11:28:26 (12 years ago)
- Location:
- trunk/expressoMail1_2/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/main.js
r5949 r5962 1639 1639 block_quoted_body = make_body_reply(data.body, data.to, data.date_day, data.date_hour); 1640 1640 // Insert the signature automaticaly at message body if use_signature preference is set 1641 if (preferences.use_signature == "1") 1642 RichTextEditor.setInitData(new_border_ID, '<div><br type="_moz"></div>' + signature + '<div><br type="_moz"></div>' + block_quoted_body,true); 1643 else1641 if (preferences.use_signature == "1"){ 1642 RichTextEditor.setInitData(new_border_ID, '<div><br type="_moz"></div>' + signature + '<div><br type="_moz"></div>' + block_quoted_body,true); 1643 }else{ 1644 1644 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>'+ block_quoted_body,true); 1645 } 1645 1646 break; 1646 1647 case "reply_to_all_without_history": … … 1681 1682 1682 1683 useOriginalAttachments(new_border_ID,border_ID); 1683 if (preferences.use_signature == "1") 1684 if (preferences.use_signature == "1"){ 1684 1685 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature,true); 1686 } 1685 1687 1686 1688 break; … … 1723 1725 block_quoted_body = make_body_reply(data.body, data.to, data.date_day, data.date_hour); 1724 1726 1725 if (preferences.use_signature == "1") 1727 if (preferences.use_signature == "1"){ 1726 1728 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature + '<div><br type="_moz"></div>'+ block_quoted_body,true); 1727 else1729 }else{ 1728 1730 RichTextEditor.setInitData(new_border_ID,block_quoted_body,true); 1731 } 1729 1732 1730 1733 break; … … 1739 1742 1740 1743 // Insert the signature automaticaly at message body if use_signature preference is set 1741 if (preferences.use_signature == "1") 1742 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature + '<div><br type="_moz"></div>'+ make_forward_body(data.body, data.to, data.date, data.subject, data.to_all, data.cc)); 1743 else 1744 RichTextEditor.setInitData(new_border_ID,make_forward_body(data.body, data.to, data.date, data.subject, data.to_all, data.cc)); 1744 if (preferences.use_signature == "1"){ 1745 $("#body_"+new_border_ID).val('<div><br type="_moz"></div>' + signature + '<div><br type="_moz"></div>'+ make_forward_body(data.body, data.to, data.date, data.subject, data.to_all, data.cc)); 1746 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature + '<div><br type="_moz"></div>'+ make_forward_body(data.body, data.to, data.date, data.subject, data.to_all, data.cc)); 1747 content.find(".to").focus(); 1748 } 1749 else{ 1750 $("#body_"+new_border_ID).val(make_forward_body(data.body, data.to, data.date, data.subject, data.to_all, data.cc)); 1751 RichTextEditor.setInitData(new_border_ID,make_forward_body(data.body, data.to, data.date, data.subject, data.to_all, data.cc)); 1752 content.find(".to").focus(); 1753 } 1745 1754 1746 1755 break; … … 1765 1774 1766 1775 // Insert the signature automaticaly at message body if use_signature preference is set 1767 if (preferences.use_signature == "1") 1776 if (preferences.use_signature == "1"){ 1777 $("#body_"+new_border_ID).val('<div><br type="_moz"></div>' + signature); 1768 1778 RichTextEditor.setInitData(new_border_ID, '<div><br type="_moz"></div>' + signature); 1779 content.find(".to").focus(); 1780 } 1769 1781 else 1770 1782 content.find('[name="input_to"]').focus(); … … 1823 1835 if (Element("attachments_" + border_ID)) 1824 1836 addOriginalAttachments(new_border_ID,border_ID); 1825 1826 1837 RichTextEditor.setInitData(new_border_ID, data.body, 'edit'); 1827 1828 1838 break; 1829 1839 default: -
trunk/expressoMail1_2/js/rich_text_editor.js
r5924 r5962 241 241 } 242 242 cRichTextEditor.prototype.setInitData = function (id,data,reply,recursion){ 243 244 if(recursion === undefined) recursion = 1; 245 else recursion++; 246 247 if(this.plain[id] === true) 248 { 249 data = data.replace( new RegExp('<pre>((.\n*)*)</pre>'),'$1'); 250 251 243 var content = $("#content_id_"+id); 244 if(recursion === undefined){ 245 recursion = 1; 246 }else{ 247 recursion++; 248 } 249 if(this.plain[id] === true){ 250 data = data.replace( new RegExp('<pre>((.\n*)*)</pre>'),'$1'); 251 if($('#'+id) !== undefined){ 252 252 $('#'+id).val(data); 253 if (reply === undefined) 254 $('#to_'+id).focus(); 255 } 256 else 257 setTimeout(function() {RichTextEditor.setInitData(id,data,reply,recursion); }, 500); 258 } 259 else 260 { 261 if( RichTextEditor.editorReady === true && CKEDITOR.instances['body_'+id] !== undefined ) 262 { 263 var editor = CKEDITOR.instances['body_'+id]; 264 editor.insertHtml(''); 265 var selection = editor.getSelection(); 266 if(selection !== undefined && selection !== null) var selectionRanges = selection.getRanges(); 267 268 var fontSize = ''; 269 var fontFamily = ''; 270 271 if(typeof(preferences.font_size_editor) !== 'undefined') 272 fontSize = 'font-size:' + preferences.font_size_editor; 273 274 if(fontSize != '') 275 fontFamily = ';' 276 277 if(typeof(preferences.font_family_editor) !== 'undefined') 278 fontFamily += 'font-family:' + preferences.font_family_editor + ';'; 279 280 var divBr = '<div style="'+fontSize+fontFamily+'"><br type="_moz"></div>'; 281 282 if(reply === undefined){ 283 editor.on('insertHtml',function setFocus(e){ 284 setTimeout("$('#to_"+id+"').focus()",100); 285 editor.removeListener('insertHtml', setFocus); 286 } 287 ); 288 editor.insertHtml(divBr+divBr+data); 253 if (reply === undefined){ 254 $('#to_'+id).focus(); 289 255 } 290 else if(reply == 'edit') 291 editor.insertHtml(data); 292 else 293 editor.insertHtml(divBr+data); 294 295 if(selection !== null) selection.selectRanges(selectionRanges); 296 297 //Coloca o scroll do editor no inicio 298 if (is_webkit){ 256 } 257 else{ 258 setTimeout(function() {RichTextEditor.setInitData(id,data,reply,recursion); }, 500); 259 } 260 } 261 else{ 262 if( RichTextEditor.editorReady === true && CKEDITOR.instances['body_'+id] !== undefined ){ 263 var editor = CKEDITOR.instances['body_'+id]; 264 var selection = editor.getSelection(); 265 var fontSize = ''; 266 var fontFamily = ''; 267 if(typeof(preferences.font_size_editor) !== 'undefined') 268 fontSize = 'font-size:' + preferences.font_size_editor; 269 if(fontSize != '') 270 fontFamily = ';' 271 if(typeof(preferences.font_family_editor) !== 'undefined') 272 fontFamily += 'font-family:' + preferences.font_family_editor + ';'; 273 var divBr = '<div style="'+fontSize+fontFamily+'"><br type="_moz"></div>'; 274 275 if(selection !== undefined && selection !== null){ 276 var selectionRanges = selection.getRanges(); 277 } 278 if(reply !== undefined){ 279 if(reply == 'edit') 280 editor.insertHtml(data); 281 else 282 editor.insertHtml(divBr+data); 283 editor.focus(); 284 } 285 286 if(selection !== null){ 287 selection.selectRanges(selectionRanges); 288 } 289 if (is_webkit){ 299 290 $('#cke_contents_body_'+id+'>iframe').scrollTo(':first'); 300 } 301 //Caso não for uma resposta votla o foco para o input to 302 //if(reply === undefined) 303 // setTimeout("$('#to_"+id+"').focus()",100); 304 305 } 306 else if(recursion < 20) 307 setTimeout(function() {RichTextEditor.setInitData(id,data,reply,recursion); }, 500); 308 } 291 } 292 293 } 294 else if(recursion < 20){ 295 setTimeout(function() {RichTextEditor.setInitData(id,data,reply,recursion); }, 500); 296 } 297 } 309 298 } 310 299
Note: See TracChangeset
for help on using the changeset viewer.