Ticket #2869: 2869_5.patch

File 2869_5.patch, 10.2 KB (added by Martin Kou, 15 years ago)
  • _source/lang/en.js

     
    429429                insertOption: 'Replace actual contents',
    430430                selectPromptMsg: 'Please select the template to open in the editor',
    431431                emptyListMsg : '(No templates defined)'
    432         }
     432        },
     433
     434        showBlocks : 'Show Blocks'
    433435};
  • _source/plugins/toolbar/plugin.js

     
    219219                'SelectAll', 'RemoveFormat', '-',
    220220                'Link', 'Unlink', 'Anchor', '-',
    221221                'Image', '-',
    222                 'Table', 'Smiley', 'HorizontalRule', 'SpecialChar', 'PageBreak'
     222                'Table', 'Smiley', 'HorizontalRule', 'SpecialChar', 'PageBreak', '-',
     223                'ShowBlocks'
    223224        ]
    224225];
  • _source/plugins/showblocks/plugin.js

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_div.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_address.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_pre.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_blockquote.png
    ___________________________________________________________________
    Added: svn:executable
       + *
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_h1.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_h2.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_h3.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_h4.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_h5.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_h6.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/plugins/showblocks/images/block_p.png
    ___________________________________________________________________
    Added: svn:mime-type
       + application/octet-stream
    
     
     1/*
     2Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6/**
     7 * @fileOverview The "showblocks" plugin. Enable it will make all block level
     8 *               elements being decorated with a border and the element name
     9 *               displayed on the left-right corner.
     10 */
     11
     12(function()
     13{
     14        var cssTemplate = '.%2 p,'+
     15                '.%2 div,'+
     16                '.%2 pre,'+
     17                '.%2 address,'+
     18                '.%2 blockquote,'+
     19                '.%2 h1,'+
     20                '.%2 h2,'+
     21                '.%2 h3,'+
     22                '.%2 h4,'+
     23                '.%2 h5,'+
     24                '.%2 h6'+
     25                '{'+
     26                        'background-repeat: no-repeat;'+
     27                        'border: 1px dotted gray;'+
     28                        'padding-top: 8px;'+
     29                        'padding-left: 8px;'+
     30                '}'+
     31
     32                '.%2 p'+
     33                '{'+
     34                        '%1p.png);'+
     35                '}'+
     36
     37                '.%2 div'+
     38                '{'+
     39                        '%1div.png);'+
     40                '}'+
     41
     42                '.%2 pre'+
     43                '{'+
     44                        '%1pre.png);'+
     45                '}'+
     46
     47                '.%2 address'+
     48                '{'+
     49                        '%1address.png);'+
     50                '}'+
     51
     52                '.%2 blockquote'+
     53                '{'+
     54                        '%1blockquote.png);'+
     55                '}'+
     56
     57                '.%2 h1'+
     58                '{'+
     59                        '%1h1.png);'+
     60                '}'+
     61
     62                '.%2 h2'+
     63                '{'+
     64                        '%1h2.png);'+
     65                '}'+
     66
     67                '.%2 h3'+
     68                '{'+
     69                        '%1h3.png);'+
     70                '}'+
     71
     72                '.%2 h4'+
     73                '{'+
     74                        '%1h4.png);'+
     75                '}'+
     76
     77                '.%2 h5'+
     78                '{'+
     79                        '%1h5.png);'+
     80                '}'+
     81
     82                '.%2 h6'+
     83                '{'+
     84                        '%1h6.png);'+
     85                '}';
     86
     87        var cssTemplateRegex = /%1/g, cssClassRegex = /%2/g;
     88
     89        var commandDefinition =
     90        {
     91                exec : function ( editor )
     92                {
     93                        var isOn = ( this.state == CKEDITOR.TRISTATE_ON );
     94                        var funcName = isOn ? 'removeClass' : 'addClass';
     95                        editor.document.getBody()[funcName]( 'cke_show_blocks' );
     96                        this.toggleState();
     97                        editor._.showBlocks = isOn;
     98                }
     99        };
     100
     101        CKEDITOR.plugins.add( 'showblocks',
     102        {
     103                requires : [ 'wysiwygarea' ],
     104
     105                init : function( editor )
     106                {
     107                        var command = editor.addCommand( 'showblocks', commandDefinition );
     108
     109                        editor.addCss( cssTemplate
     110                                .replace( cssTemplateRegex, 'background-image: url(' + CKEDITOR.getUrl( this.path ) + 'images/block_' )
     111                                   .replace( cssClassRegex, 'cke_show_blocks ' ) );
     112
     113                        // Set a flag in the editor object for remembering the show block state on
     114                        // mode switches.
     115                        editor._.showBlocks = editor.config.startupOutlineBlocks;
     116
     117                        editor.ui.addButton( 'ShowBlocks',
     118                                {
     119                                        label : editor.lang.showBlocks,
     120                                        command : 'showblocks'
     121                                } );
     122                       
     123                        editor.on( 'contentDom', function()
     124                        {
     125                                // Restore show blocks state after mode switches.
     126                                command.setState( CKEDITOR.TRISTATE_OFF );
     127                                if ( this._.showBlocks )
     128                                        command.exec();
     129                        } );
     130                }
     131        });
     132} )();
     133
     134CKEDITOR.config.startupOutlineBlocks = false;
  • _source/skins/default/toolbar.css

    Property changes on: _source/plugins/showblocks/plugin.js
    ___________________________________________________________________
    Added: svn:executable
       + *
    
     
    310310{
    311311        background-position: 0 -816px;
    312312}
     313.cke_skin_default a.cke_button_showblocks .cke_icon
     314{
     315        background-position: 0 -1136px;
     316}
    313317
    314318.cke_skin_default a.cke_button_select .cke_icon
    315319{
  • _source/core/config.js

     
    147147         * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
    148148         */
    149149
    150         plugins : 'basicstyles,blockquote,button,clipboard,elementspath,find,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,smiley,sourcearea,table,specialchar,tab,templates,toolbar,undo,wysiwygarea',
     150        plugins : 'basicstyles,blockquote,button,clipboard,elementspath,find,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,smiley,showblocks,sourcearea,table,specialchar,tab,templates,toolbar,undo,wysiwygarea',
    151151
    152152        /**
    153153         * The theme to be used to build the UI.
  • _source/core/command.js

     
    3737                this.fire( 'state' );
    3838
    3939                return true;
     40        },
     41
     42        toggleState : function()
     43        {
     44                if ( this.state == CKEDITOR.TRISTATE_OFF )
     45                        this.setState( CKEDITOR.TRISTATE_ON );
     46                else if ( this.state == CKEDITOR.TRISTATE_ON )
     47                        this.setState( CKEDITOR.TRISTATE_OFF );
    4048        }
    4149}
    4250
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy