Dotclear

Changeset 379:fb925235a866 for admin


Ignore:
Timestamp:
06/17/11 08:41:21 (14 years ago)
Author:
Tomtom33 <tbouron@…>
Branch:
wysiwyg
Message:

Added i18n support for TinyMCE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/js/dcToolBar.js

    r326 r379  
    1616                    $.data(this,'toolbar',new tinymce.Editor($(this).attr('id'),dcToolBar.getConfig(settings.formatter))); 
    1717                    $(this).data('toolbar').activeFormatter = settings.formatter; 
     18                    $(this).data('toolbar').onPreInit.add(function(ed) { 
     19                         tinymce.addI18n(dcToolBar.getI18n()); 
     20                    }); 
    1821               }); 
    1922           
     
    3235                         throw 'Toolbar should be initialize before show it'; 
    3336                    } 
    34                     $(this).data('toolbar').show(); 
     37                    var t = $(this).data('toolbar'); 
     38 
     39                    tinymce.dom.show(t.getContainer()); 
     40                    t.load(); 
    3541               }); 
    3642          }, 
     
    4046                         throw 'Toolbar should be initialize before hide it'; 
    4147                    } 
    42                     $(this).data('toolbar').hide(); 
     48                    var t = $(this).data('toolbar'); 
     49 
     50                    tinymce.dom.hide(t.getContainer()); 
     51                    t.load(); 
    4352               }); 
    4453          }, 
     
    4857                         throw 'Toolbar should be initialize before toogle it'; 
    4958                    } 
    50                     if ($(this).data('toolbar').isHidden()) { 
    51                          $(this).data('toolbar').show(); 
    52                     } else { 
    53                          $(this).data('toolbar').hide(); 
     59                    var t = $(this).data('toolbar'); 
     60                    if (t.isHidden()) { 
     61                         t.show(); 
     62                         t.load(); 
     63                    } 
     64                    else { 
     65                         t.save(); 
     66                         $(t.getContainer()).hide(); 
    5467                    } 
    5568               }); 
     
    97110     }; 
    98111      
     112     this.setI18n = function(i18n) { 
     113          this.i18n = i18n; 
     114     }; 
     115      
    99116     this.getConfig = function(formatter) { 
    100117          if (this.configurations.hasOwnProperty(formatter)) { 
     
    104121          } 
    105122     }; 
     123      
     124     this.getI18n = function() { 
     125          return this.i18n == null ? {} : this.i18n; 
     126     }; 
    106127} 
    107128 
    108129dcToolBar.prototype = { 
    109      configurations: {} 
     130     configurations: {}, 
     131     i18n: null 
    110132} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map