Changeset 8249
- Timestamp:
- 11/06/13 16:10:50 (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/rich_text_editor.js
r8245 r8249 338 338 if( RichTextEditor.editorReady === true && CKEDITOR.instances['body_'+id] !== undefined ){ 339 339 var editor = CKEDITOR.instances['body_'+id]; 340 var selection = editor.getSelection(); 340 341 var selection = editor.getSelection(); 341 342 var fontSize = ''; 342 343 var fontFamily = ''; … … 366 367 } 367 368 selection.selectRanges(selectionRanges); 369 } 370 if (CKEDITOR.env.ie){ 371 var body = editor.document.getBody(); 372 var range = new CKEDITOR.dom.range(body); 373 range.selectNodeContents(body); 374 range.collapse(true); 375 var selection = editor.getSelection(); 376 selection.selectRanges([range]); 368 377 } 369 378 -
trunk/library/ckeditor/plugins/expresso/plugin.js
r8247 r8249 34 34 35 35 onClick : function( value ) 36 { 37 editor.focus(); 38 editor.fire( 'saveSnapshot' ); 39 editor.insertHtml(unescape(value)); 40 editor.fire( 'saveSnapshot' ); 36 { 37 editor.focus(); 38 editor.fire( 'saveSnapshot' ); 39 var fontSize = ''; 40 var fontFamily = ''; 41 if(typeof(preferences.font_size_editor) !== 'undefined') 42 fontSize = 'font-size:' + preferences.font_size_editor; 43 if(fontSize != '') 44 fontFamily = ';' 45 if(typeof(preferences.font_family_editor) !== 'undefined') 46 fontFamily += 'font-family:' + preferences.font_family_editor + ';'; 47 var divBr = '<div style="'+fontSize+fontFamily+'"><br type="_moz"></div>'; 48 editor.insertHtml(divBr + unescape(value)); 49 editor.fire( 'saveSnapshot' ); 50 var selection = editor.getSelection(); 51 if(selection !== undefined && selection !== null){ 52 var selectionRanges = selection.getRanges(); 53 } 54 if(selection !== null){ 55 if(selectionRanges[selectionRanges.length-1] !== undefined){ 56 selectionRanges[selectionRanges.length-1].setStart(selectionRanges[selectionRanges.length-1].getTouchedStartNode().getParents()[1].getChild(0), 0); 57 selectionRanges[selectionRanges.length-1].setEnd(selectionRanges[selectionRanges.length-1].getTouchedStartNode().getParents()[1].getChild(0), 0); 58 } 59 selection.selectRanges(selectionRanges); 60 } 61 if (CKEDITOR.env.ie){ 62 var body = editor.document.getBody(); 63 var range = new CKEDITOR.dom.range(body); 64 range.selectNodeContents(body); 65 range.collapse(true); 66 var selection = editor.getSelection(); 67 selection.selectRanges([range]); 68 } 41 69 } 42 70
Note: See TracChangeset
for help on using the changeset viewer.