source: sandbox/2.3-MailArchiver/filemanager/tp/ckeditor/_source/plugins/basicstyles/plugin.js @ 6779

Revision 6779, 1.9 KB checked in by rafaelraymundo, 12 years ago (diff)

Ticket #2946 - Liberado Expresso(branch 2.3) integrado ao MailArchiver?.

Line 
1/*
2Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
3For licensing, see LICENSE.html or http://ckeditor.com/license
4*/
5
6CKEDITOR.plugins.add( 'basicstyles',
7{
8        requires : [ 'styles', 'button' ],
9
10        init : function( editor )
11        {
12                // All buttons use the same code to register. So, to avoid
13                // duplications, let's use this tool function.
14                var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton )
15                {
16                        var style = new CKEDITOR.style( styleDefiniton );
17
18                        editor.attachStyleStateChange( style, function( state )
19                                {
20                                        editor.getCommand( commandName ).setState( state );
21                                });
22
23                        editor.addCommand( commandName, new CKEDITOR.styleCommand( style ) );
24
25                        editor.ui.addButton( buttonName,
26                                {
27                                        label : buttonLabel,
28                                        command : commandName
29                                });
30                };
31
32                var config = editor.config;
33                var lang = editor.lang;
34
35                addButtonCommand( 'Bold'                , lang.bold                     , 'bold'                , config.coreStyles_bold );
36                addButtonCommand( 'Italic'              , lang.italic           , 'italic'              , config.coreStyles_italic );
37                addButtonCommand( 'Underline'   , lang.underline        , 'underline'   , config.coreStyles_underline );
38                addButtonCommand( 'Strike'              , lang.strike           , 'strike'              , config.coreStyles_strike );
39                addButtonCommand( 'Subscript'   , lang.subscript        , 'subscript'   , config.coreStyles_subscript );
40                addButtonCommand( 'Superscript' , lang.superscript      , 'superscript' , config.coreStyles_superscript );
41        }
42});
43
44// Basic Inline Styles.
45CKEDITOR.config.coreStyles_bold                 = { element : 'strong', overrides : 'b' };
46CKEDITOR.config.coreStyles_italic               = { element : 'em', overrides : 'i' };
47CKEDITOR.config.coreStyles_underline    = { element : 'u' };
48CKEDITOR.config.coreStyles_strike               = { element : 'strike' };
49CKEDITOR.config.coreStyles_subscript    = { element : 'sub' };
50CKEDITOR.config.coreStyles_superscript  = { element : 'sup' };
Note: See TracBrowser for help on using the repository browser.