diff --git a/bin/Editor.js b/bin/Editor.js index 7f26be5d2d59b00fd3c91f8c074c06cb839464c7..42d18ecdfd177d2870f3f676340e54c93241a653 100644 --- a/bin/Editor.js +++ b/bin/Editor.js @@ -92,7 +92,7 @@ define('package/quiqqer/ckeditor4/bin/Editor', [ ev = self.$linkDialog( ev ); }); - Editor.getManager().getToolbar(function(buttons) + this.getButtons(function(buttons) { // parse the buttons for the ckeditor var b, g, i, len, blen, glen, group, items, @@ -262,6 +262,72 @@ define('package/quiqqer/ckeditor4/bin/Editor', [ } }, + /** + * Set the focus to the editor + */ + focus : function() + { + if ( this.getInstance() ) { + this.getInstance().focus(); + } + }, + + /** + * Switch to source mode + */ + switchToSource : function() + { + if ( this.getInstance() ) { + this.getInstance().setMode( 'source' ); + } + }, + + /** + * Switch to wysiwyg editor + */ + switchToWYSIWYG : function() + { + if ( this.getInstance() ) { + this.getInstance().setMode( 'wysiwyg' ); + } + }, + + /** + * Hide the toolbar + */ + hideToolbar : function() + { + var Toolbar = this.getElm().getElement( '.cke_top' ); + + if ( Toolbar ) { + Toolbar.setStyle( 'display', 'none' ); + } + }, + + /** + * show the toolbar + */ + showToolbar : function() + { + var Toolbar = this.getElm().getElement( '.cke_top' ); + + if ( Toolbar ) { + Toolbar.setStyle( 'display', null ); + } + }, + + /** + * Set the height of the instance + * + * @param {Integer} height + */ + setHeight : function(height) + { + if ( this.getInstance() ) { + this.getInstance().resize( false, height ); + } + }, + /** * * @param {Object} params