2012-12-17 60 views
3

我使用TinyMCE的style_formats這樣的:微小的MCE style_formats標題

style_formats : [ 
       {title : '20px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '20px'}}, 
       {title : '25px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '25px'}}, 
       {title : '30px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '30px'}}, 
       {title : '35px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '35px'}}, 
       {title : '40px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '40px'}}, 
       {title : '45px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '45px'}}, 
       {title : '50px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '50px'}}, 
       {title : '55px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '55px'}}, 
       {title : '60px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '60px'}}, 
       {title : '65px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '65px'}}, 
       {title : '70px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '70px'}}, 
       {title : '75px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '75px'}} 
     ] 
    }); 

列表框的標題是「樣式」我想改變爲「行高」。

我需要改變的地方?我無法在lang文件中找到它。

感謝

回答

0

開放TinyMCE的 - >主題 - >高級 - >郎 - > en.js

更改「style_select」: 「樣式」「style_select」 :「線條高度」

希望它有幫助!

注意:您必須牢記這一變化無論您更新TinyMCE的一個新版本

1

要更改標題可以修改tiny_mce/themes/advanced/langs/en.js 像描述的「顯示名稱」下的郎文件。

但爲了避免有修改這個文件,每次你更新到新版本的TinyMCE您可以使用tinymce.init的的OnInit和設置TinyMCE的配置參數更改標題:

tinymce.EditorManager.i18n['en.advanced.style_select'] = 'Line Height'; 

所以,你可以用途:

tinyMCE.init({ 
    ... 
    setup : function(ed) { 
    ed.onBeforeRenderUI.add(function(ed, cm) { 
     tinymce.EditorManager.i18n['en.advanced.style_select'] = 'Line Height'; 
    }); 
    } 
});