Ignore:
Timestamp:
11/06/13 16:10:50 (10 years ago)
Author:
angelo
Message:

Ticket #3493 - Atualizar bibioteca CKEditor do Expresso

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/library/ckeditor/plugins/expresso/plugin.js

    r8247 r8249  
    3434                    
    3535                    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                        }                        
    4169                    } 
    4270 
Note: See TracChangeset for help on using the changeset viewer.