Ticket #2869: 2869.patch

File 2869.patch, 6.2 KB (added by Garry Yao, 15 years ago)
  • _source/core/config.js

     
    147147         * @example
    148148         * config.plugins = 'elementspath,toolbar,wysiwygarea';
    149149         */
    150         plugins : 'basicstyles,button,dialog,elementspath,horizontalrule,htmldataprocessor,keystrokes,removeformat,smiley,link,sourcearea,tab,toolbar,wysiwygarea,forms,image,find,table,specialchar,flash,print,pagebreak,newpage',
     150        plugins : 'basicstyles,button,dialog,elementspath,horizontalrule,htmldataprocessor,keystrokes,removeformat,smiley,link,sourcearea,tab,toolbar,wysiwygarea,forms,image,find,table,specialchar,flash,print,pagebreak,newpage,blockoutline',
    151151
    152152        /**
    153153         * The theme to be used to build the UI.
  • _source/core/editor.js

     
    185185
    186186                                                                // Call the plugin method (beforeInit and init).
    187187                                                                if ( plugin[ methods[ m ] ] )
    188                                                                         plugin[ methods[ m ] ]( editor );
     188                                                                        plugin[ methods[ m ] ]( editor, plugin.path);
    189189                                                        }
    190190                                                }
    191191
  • _source/core/command.js

     
    1919};
    2020
    2121CKEDITOR.event.implementOn( CKEDITOR.command.prototype );
     22
     23/*
     24 * Toggle the current state of command and refresh. 
     25 */
     26CKEDITOR.command.prototype.toggleState = function(){
     27        this.state = (this.state === CKEDITOR.TRISTATE_ON? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_ON);
     28        this.fire( 'state' );
     29};
  • _source/skins/default/toolbar.css

     
    305305{
    306306        background-position: 0 -880px;
    307307}
     308.cke_skin_default a.cke_button_showblock .cke_icon
     309{
     310        background-position: 0 -1136px;
     311}
  • _source/plugins/toolbar/plugin.js

     
    208208        [ 'Source', '-', 'NewPage', '-', 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'Print', 'Find', 'Replace', '-',
    209209        'SelectAll', 'RemoveFormat', '-',
    210210        'Link', 'Unlink', 'Anchor', 'Image', 'Flash', 'Table', 'Smiley', 'HorizontalRule', 'SpecialChar', 'PageBreak', '-',
    211         'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ]
     211        'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField', '-',
     212        'BlockOutline' ]
    212213];
  • _source/plugins/blockoutline/blockoutline.css

     
     1.cke_block_outline p,
     2.cke_block_outline div,
     3.cke_block_outline pre,
     4.cke_block_outline address,
     5.cke_block_outline blockquote,
     6.cke_block_outline h1,
     7.cke_block_outline h2,
     8.cke_block_outline h3,
     9.cke_block_outline h4,
     10.cke_block_outline h5,
     11.cke_block_outline h6
     12{
     13        background-repeat: no-repeat;
     14        border: 1px dotted gray;
     15        padding-top: 8px;
     16        padding-left: 8px;
     17}
     18
     19.cke_block_outline p
     20{
     21        background-image: url(images/blockoutline.block_p.png);
     22}
     23
     24.cke_block_outline div
     25{
     26        background-image: url(images/blockoutline.block_div.png);
     27}
     28
     29.cke_block_outline pre
     30{
     31        background-image: url(images/blockoutline.block_pre.png);
     32}
     33
     34.cke_block_outline address
     35{
     36        background-image: url(images/blockoutline.block_address.png);
     37}
     38
     39.cke_block_outline blockquote
     40{
     41        background-image: url(images/blockoutline.block_blockquote.png);
     42}
     43
     44.cke_block_outline h1
     45{
     46        background-image: url(images/blockoutline.block_h1.png);
     47}
     48
     49.cke_block_outline h2
     50{
     51        background-image: url(images/blockoutline.block_h2.png);
     52}
     53
     54.cke_block_outline h3
     55{
     56        background-image: url(images/blockoutline.block_h3.png);
     57}
     58
     59.cke_block_outline h4
     60{
     61        background-image: url(images/blockoutline.block_h4.png);
     62}
     63
     64.cke_block_outline h5
     65{
     66        background-image: url(images/blockoutline.block_h5.png);
     67}
     68
     69.cke_block_outline h6
     70{
     71        background-image: url(images/blockoutline.block_h6.png);
     72}
  • _source/plugins/blockoutline/plugin.js

     
     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 "blockoutline" plugin. Enable it will make all block level elements being decorated with a border and the element name displayed on the left-right corner.
     8 */
     9
     10(function()
     11{
     12        BLOCK_OUTLINE_CLASSNAME = 'cke_block_outline';
     13        BLOCK_OUTLINE_CSS_PATH = 'blockoutline.css';
     14
     15        CKEDITOR.plugins.add( 'blockoutline',
     16        {
     17                requires : [ 'wysiwygarea' ],
     18
     19                init : function( editor , pluginPath)
     20                {
     21                        editor.addCommand(
     22                        'showblock' ,
     23                        {
     24                                exec : function ( editor )
     25                                {
     26                                        if ( this.state !== CKEDITOR.TRISTATE_DISABLED )
     27                                        {
     28                                                editor.document
     29                                                                                                .getBody()[ this.state === CKEDITOR.TRISTATE_OFF ? 'addClass'
     30                                                                                                : 'removeClass' ]
     31                                                                                                ( BLOCK_OUTLINE_CLASSNAME );
     32                                                this.toggleState();
     33                                        }
     34                                }
     35                        });
     36
     37                        editor.ui.addButton( 'BlockOutline' , {
     38                                lablel :editor.lang.blockOutline,
     39                                command :'showblock'
     40                        });
     41                       
     42                        //Load content style for every editor instance.
     43                        editor.on( 'contentDom', function(){
     44                                editor.document.appendStyleSheet(
     45                                CKEDITOR.basePath +
     46                                pluginPath + BLOCK_OUTLINE_CSS_PATH );
     47                        });
     48                }
     49        });
     50       
     51})();\ No newline at end of file
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy