Ticket #2885: 2885_6.patch

File 2885_6.patch, 23.0 KB (added by Garry Yao, 15 years ago)
  • _source/lang/en.js

     
    549549                tag_div : 'Normal (DIV)'
    550550        },
    551551
     552        div :
     553        {
     554                title                           : 'Create Div Container',
     555                toolbar                         : 'Create Div Container',
     556                cssClassInputLabel      : 'Stylesheet Classes',
     557                styleSelectLabel        : 'Style',
     558                IdInputLabel            : 'Id',
     559                languageCodeInputLabel  : ' Language Code',
     560                inlineStyleInputLabel   : 'Inline Style',
     561                advisoryTitleInputLabel : 'Advisory Title',
     562                langDirLabel            : 'Language Direction',
     563                langDirLTRLabel         : 'Left to Right (LTR)',
     564                langDirRTLLabel         : 'Right to Left (RTL)',
     565                edit                            : 'Edit Div Container',
     566                remove                          : 'Remove Div Container'
     567        },
     568
    552569        font :
    553570        {
    554571                label : 'Font',
  • _source/plugins/menu/plugin.js

     
    328328        'form,' +
    329329        'tablecell,tablecellproperties,tablerow,tablecolumn,table,'+
    330330        'anchor,link,image,flash,' +
    331         'checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea';
     331        'checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';
  • _source/plugins/div/dialogs/div.js

     
     1/*
     2 * Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     3 * For licensing, see LICENSE.html or http://ckeditor.com/license
     4 */
     5
     6(function()
     7{
     8       
     9        /**
     10         * Add to collection with DUP examination.
     11         * @param {Object} collection
     12         * @param {Object} element
     13         * @param {Object} database
     14         */
     15        function addSafely( collection, element, database )
     16        {
     17                // avoid duplicate
     18                if ( !element.getCustomData( 'block_processed' ) )
     19                {
     20                        CKEDITOR.dom.element.setMarker( database, element,
     21                                'block_processed', true );
     22                        collection.push( element );
     23                }
     24        }
     25       
     26        function getNonEmptyChildren( element )
     27        {
     28                var retval = [];
     29                var children = element.getChildren();
     30                for( var i = 0 ; i < children.count() ; i++ )
     31                {
     32                        var child = children.getItem( i );
     33                        if( ! ( child.type === CKEDITOR.NODE_TEXT
     34                                && /^[ \t\n\r]+$/.test( child.getText() ) ) )
     35                                retval.push( child );
     36                }
     37                return retval;
     38        }
     39
     40
     41        /**
     42         * Dialog reused by both 'creatediv' and 'editdiv' commands.
     43         * @param {Object} editor
     44         * @param {String} command      The command name which indicate what the current command is.
     45         */
     46        function divDialog( editor, command )
     47        {
     48                // Definition of elements at which div operation should stopped.
     49                var divLimitDefinition = ( function(){
     50                       
     51                        // Customzie from specialize blockLimit elements
     52                        var definition = CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$blockLimit );
     53
     54                        // Exclude 'div' itself.
     55                        delete definition.div;
     56
     57                        // Exclude 'td' and 'th' when 'wrapping table'
     58                        if( editor.config.div_wrapTable )
     59                        {
     60                                delete definition.td;
     61                                delete definition.th;
     62                        }
     63                        return definition;
     64                })();
     65               
     66                // DTD of 'div' element
     67                var dtd = CKEDITOR.dtd.div;
     68               
     69                /**
     70                 * Get the first div limit element on the element's path.
     71                 * @param {Object} element
     72                 */
     73                function getDivLimitElement( element )
     74                {
     75                        var pathElements = new CKEDITOR.dom.elementPath( element ).elements;
     76                        var divLimit;
     77                        for ( var i = 0; i < pathElements.length ; i++ )
     78                        {
     79                                if ( pathElements[ i ].getName() in divLimitDefinition )
     80                                {
     81                                        divLimit = pathElements[ i ];
     82                                        break;
     83                                }
     84                        }
     85                        return divLimit;
     86                }
     87               
     88                /**
     89                 * Init all fields' setup/commit function.
     90                 * @memberof divDialog
     91                 */
     92                function setupFields()
     93                {
     94                        this.foreach( function( field )
     95                        {
     96                                // Exclude layout container elements
     97                                if( /^(?!vbox|hbox)/.test( field.type ) )
     98                                {
     99                                        if ( !field.setup )
     100                                        {
     101                                                // Read the dialog fields values from the specified
     102                                                // element attributes.
     103                                                field.setup = function( element )
     104                                                {
     105                                                        field.setValue( element.getAttribute( field.id ) || '' );
     106                                                };
     107                                        }
     108                                        if ( !field.commit )
     109                                        {
     110                                                // Set element attributes assigned by the dialog
     111                                                // fields.
     112                                                field.commit = function( element )
     113                                                {
     114                                                        var fieldValue = this.getValue();
     115                                                        // ignore default element attribute values
     116                                                        if ( 'dir' == field.id && element.getComputedStyle( 'direction' ) == fieldValue )
     117                                                                return true;
     118                                                        if ( fieldValue )
     119                                                                element.setAttribute( field.id, fieldValue );
     120                                                        else
     121                                                                element.removeAttribute( field.id );
     122                                                };
     123                                        }
     124                                }
     125                        } );
     126                }
     127               
     128                /**
     129                 * Either create or detect the desired block containers among the selected ranges.
     130                 * @param {Object} editor
     131                 * @param {Object} containerTagName The tagName of the container.
     132                 * @param {Object} isCreate Whether it's a creation process OR a detection process.
     133                 */     
     134                function applyDiv( editor, isCreate )
     135                {
     136                        // new adding containers OR detected pre-existed containers.
     137                        var containers = [];
     138                        // node markers store.
     139                        var database = {};
     140                        // All block level elements which contained by the ranges.
     141                        var containedBlocks = [], block;
     142       
     143                        // Get all ranges from the selection.
     144                        var selection = editor.document.getSelection();
     145                        var ranges = selection.getRanges();
     146                        var i, iterator;
     147       
     148                        // collect all included elements from dom-iterator
     149                        for( i = 0 ; i < ranges.length ; i++ )
     150                        {
     151                                iterator = ranges[ i ].createIterator();
     152                                while( ( block = iterator.getNextParagraph() ) )
     153                                {
     154                                        // include contents of blockLimit elements.
     155                                        if( block.getName() in divLimitDefinition )
     156                                        {
     157                                                var j, childNodes = block.getChildren();
     158                                                for ( j = 0 ; j < childNodes.count() ; j++ )
     159                                                        addSafely( containedBlocks, childNodes.getItem( j ) , database );
     160                                        }
     161                                        else
     162                                        {
     163                                                // Bypass dtd disallowed elements.     
     164                                                while( !dtd[ block.getName() ] && block.getName() != 'body' )
     165                                                        block = block.getParent();
     166                                                addSafely( containedBlocks, block, database );
     167                                        }
     168                                }
     169                        }
     170                       
     171                        CKEDITOR.dom.element.clearAllMarkers( database );
     172                       
     173                        var blockGroups = groupByDivLimit( containedBlocks );
     174                        var ancestor, blockEl, divElement;
     175
     176                        for( i = 0 ; i < blockGroups.length ; i++ )
     177                        {
     178                                var currentBlock = blockGroups[ i ][ 0 ];
     179                               
     180                                // Calculate the common parent node of all contained elements.
     181                                ancestor = currentBlock.getParent();
     182                                for ( var j = 1 ; j < blockGroups[ i ].length; j++ )
     183                                        ancestor = ancestor.getCommonAncestor( blockGroups[ i ][ j ] );
     184                               
     185                                if( isCreate )
     186                                        divElement = new CKEDITOR.dom.element( 'div', editor.document );
     187                               
     188                                // Normalize the blocks in each group to a common parent.
     189                                for( var j = 0; j < blockGroups[ i ].length ; j++ )
     190                                {
     191                                        currentBlock = blockGroups[ i ][ j ];
     192       
     193                                        while( !currentBlock.getParent().equals( ancestor ) )
     194                                                currentBlock = currentBlock.getParent();
     195
     196                                        blockGroups[ i ][ j ] = currentBlock;
     197                                }
     198
     199                                // Wrapped blocks counting
     200                                var childCount = 0;
     201                                for ( var j = 0 ; j < blockGroups[ i ].length ; j++ )
     202                                {
     203                                        currentBlock = blockGroups[ i ][ j ];
     204                                        // Avoid DUP
     205                                        if ( !currentBlock.getCustomData( 'block_processed' ) )
     206                                        {
     207                                                CKEDITOR.dom.element.setMarker( database, currentBlock, 'block_processed', true );
     208
     209                                                if( isCreate )
     210                                                {
     211                                                        // Establish new container, wrapping all elements in this group.
     212                                                        if( j == 0 )
     213                                                                divElement.insertBefore( currentBlock );
     214                                                        divElement.append( currentBlock );
     215                                                }
     216                                                else
     217                                                        childCount++;
     218                                        }
     219                                }
     220
     221                                CKEDITOR.dom.element.clearAllMarkers( database );
     222       
     223                                if( isCreate )
     224                                {
     225                                        // Drop pre-existed container, since new container already
     226                                        // established.
     227                                        if ( command == 'editdiv' &&
     228                                                        ancestor.getName() == 'div'
     229                                                        && 1 == getNonEmptyChildren( ancestor ).length )
     230                                                        ancestor.remove( true );
     231                                        containers.push( divElement );
     232                                }
     233                                else
     234                                {
     235                                        // discover existed container
     236                                        if ( ancestor.getName() == 'div'
     237                                                && childCount == getNonEmptyChildren( ancestor ).length )
     238                                                containers.push( ancestor );
     239                                }
     240                        }
     241       
     242                        return containers;
     243                }
     244               
     245                /**
     246                 * Divide a set of nodes to different groups by their path's blocklimit element.
     247                 * Note: the specified nodes should be in source order naturally, which mean they are supposed to producea by following class:
     248                 *  * CKEDITOR.dom.range.Iterator
     249                 *  * CKEDITOR.dom.domWalker
     250                 *  @return {Array []} the grouped nodes
     251                 */
     252                function groupByDivLimit( nodes )
     253                {
     254                        var groups = [],
     255                                lastDivLimit = null,
     256                                path, block;
     257                        for ( var i = 0 ; i < nodes.length ; i++ )
     258                        {
     259                                block = nodes[i];
     260                                console.log( block.$ );
     261                                var limit = getDivLimitElement( block );
     262                                if ( !limit.equals( lastDivLimit ) )
     263                                {
     264                                        lastDivLimit = limit ;
     265                                        groups.push( [] ) ;
     266                                }
     267                                groups[ groups.length - 1 ].push( block ) ;
     268                        }
     269                        return groups;
     270                }
     271               
     272                function compareNodes()
     273                {
     274                        return arguments[ 0 ].equals( arguments[ 1 ] );
     275                }
     276               
     277                /**
     278                 * Hold a collection of created block container elements. 
     279                 */
     280                var containers = [];
     281                /**
     282                 * @type divDialog
     283                 */
     284                return {
     285                        title : editor.lang.div.title,
     286                        minWidth : 400,
     287                        minHeight : 180,
     288                        contents :
     289                        [
     290                        {
     291                                id :'info',
     292                                label :editor.lang.common.generalTab,
     293                                title :editor.lang.common.generalTab,
     294                                elements :
     295                                [
     296                                        {
     297                                                type :'hbox',
     298                                                widths : [ '50%', '50%' ],
     299                                                children :
     300                                                [
     301                                                        {
     302                                                                id :'elementStyle',
     303                                                                type :'select',
     304                                                                style :'width: 100%;',
     305                                                                label :editor.lang.div.styleSelectLabel,
     306                                                                'default' : '',
     307                                                                items : [],
     308                                                                setup : function( element )
     309                                                                {
     310                                                                        this.setValue( element.$.style.cssText || '' );
     311                                                                },
     312                                                                commit: function( element )
     313                                                                {
     314                                                                        if ( this.getValue() )
     315                                                                                element.$.style.cssText = this.getValue();
     316                                                                        else
     317                                                                                element.removeAttribute( 'style' );
     318                                                                }
     319                                                        },
     320                                                        {
     321                                                                id :'class',
     322                                                                type :'text',
     323                                                                label :editor.lang.common.cssClass,
     324                                                                'default' : ''
     325                                                        }
     326                                                ]
     327                                        }
     328                                ]
     329                        },
     330                        {
     331                                        id :'advanced',
     332                                        label :editor.lang.common.advancedTab,
     333                                        title :editor.lang.common.advancedTab,
     334                                        elements :
     335                                        [
     336                                        {
     337                                                type :'vbox',
     338                                                padding :1,
     339                                                children :
     340                                                [
     341                                                        {
     342                                                                type :'hbox',
     343                                                                widths : [ '50%', '50%' ],
     344                                                                children :
     345                                                                [
     346                                                                        {
     347                                                                                type :'text',
     348                                                                                id :'id',
     349                                                                                label :editor.lang.common.id,
     350                                                                                'default' : ''
     351                                                                        },
     352                                                                        {
     353                                                                                type :'text',
     354                                                                                id :'lang',
     355                                                                                label :editor.lang.link.langCode,
     356                                                                                'default' : ''
     357                                                                        }
     358                                                                ]
     359                                                        },
     360                                                        {
     361                                                                type :'hbox',
     362                                                                children :
     363                                                                [
     364                                                                                {
     365                                                                                        type :'text',
     366                                                                                        id :'style',
     367                                                                                        style :'width: 100%;',
     368                                                                                        label :editor.lang.common.cssStyle,
     369                                                                                        'default' : ''
     370                                                                                }
     371                                                                ]
     372                                                        },
     373                                                        {
     374                                                                type :'hbox',
     375                                                                children :
     376                                                                [
     377                                                                                {
     378                                                                                        type :'text',
     379                                                                                        id :'title',
     380                                                                                        style :'width: 100%;',
     381                                                                                        label :editor.lang.common.advisoryTitle,
     382                                                                                        'default' : ''
     383                                                                                }
     384                                                                ]
     385                                                        },
     386                                                        {
     387                                                                type :'select',
     388                                                                id :'dir',
     389                                                                style :'width: 100%;',
     390                                                                label :editor.lang.common.langDir,
     391                                                                'default' : '',
     392                                                                items :
     393                                                                [
     394                                                                        [
     395                                                                                editor.lang.common.langDirLtr,
     396                                                                                'ltr'
     397                                                                        ],
     398                                                                        [
     399                                                                                editor.lang.common.langDirRtl,
     400                                                                                'rtl'
     401                                                                        ]
     402                                                                ]
     403                                                        }
     404                                                ]
     405                                        }
     406                                        ]
     407                                }
     408                        ],
     409                        onLoad : function()
     410                        {
     411                                setupFields.call(this);
     412                        },
     413                        onShow : function()
     414                        {
     415                                containers = [];
     416                                // Whether always create new container regardless of existed
     417                                // ones.
     418                                if ( command == 'editdiv' )
     419                                {
     420                                        // Try to discover the containers that already existed in
     421                                        // ranges
     422                                        containers = applyDiv( editor );
     423                                        if( containers.length )
     424                                        {
     425                                                this._element = containers[ 0 ];
     426                                                // update dialog field values
     427                                                this.setupContent( this._element );
     428                                        }
     429                                }
     430                        },
     431                        onOk : function()
     432                        {
     433                                containers = applyDiv( editor, true );
     434                               
     435                                // Update elements attributes
     436                                for( var i = 0 ; i < containers.length ; i++ )
     437                                        this.commitContent( containers[ i ] );
     438                                this.hide();
     439                        }
     440                };
     441        }
     442       
     443        CKEDITOR.dialog.add( 'creatediv', function( editor )
     444                {
     445                        return divDialog( editor, 'creatediv' );
     446                } );
     447        CKEDITOR.dialog.add( 'editdiv', function( editor )
     448                {
     449                        return divDialog( editor, 'editdiv' );
     450                } );
     451})();
  • _source/plugins/div/plugin.js

    Property changes on: _source/plugins/div/dialogs/div.js
    ___________________________________________________________________
    Added: svn:executable
       + *
    
     
     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 "div" plugin. It wraps the selected block level elements with a 'div' element with specified styles and attributes.
     8 *
     9 */
     10
     11(function()
     12{
     13        CKEDITOR.plugins.add( 'div',
     14        {
     15                requires : [ 'editingblock', 'domiterator' ],
     16
     17                init : function( editor )
     18                {
     19                        var lang = editor.lang.div;
     20
     21                        editor.addCommand( 'creatediv', new CKEDITOR.dialogCommand( 'creatediv' ) );
     22                        editor.addCommand( 'editdiv', new CKEDITOR.dialogCommand( 'editdiv' ) );
     23                        editor.addCommand( 'removediv',
     24                                {
     25                                        exec : function( editor )
     26                                        {
     27                                                var selection = editor.getSelection();
     28                                                if ( !selection )
     29                                                        return;
     30
     31                                                // Calculate the list of div containers to be removed.
     32                                                var ranges = selection.getRanges();
     33                                                var divContainers = [];
     34                                                var markers = {};
     35                                                for ( var i = 0 ; i < ranges.length ; i++ )
     36                                                {
     37                                                        var boundaryNodes = ranges[i].getBoundaryNodes();
     38                                                        var currentNode = boundaryNodes.startNode;
     39                                                        var endNode = boundaryNodes.endNode;
     40
     41                                                        if ( currentNode.equals( endNode ) )
     42                                                                endNode = endNode.getNextSourceNode();
     43
     44                                                        while ( currentNode && !currentNode.equals( endNode ) )
     45                                                        {
     46                                                                var path = new CKEDITOR.dom.elementPath( currentNode );
     47                                                                var div = path.blockLimit;
     48                                                                if ( div && div.getName() == 'div' && !div.getAttribute( '_cke_div_added' ) )
     49                                                                {
     50                                                                        divContainers.push( div );
     51                                                                        div.setAttribute( '_cke_div_added' );
     52                                                                }
     53                                                                currentNode = currentNode.getNextSourceNode();
     54                                                        }
     55                                                }
     56                                               
     57                                                // Remove the div containers, preserve children and selection.
     58                                                var bookmarks = selection.createBookmarks();
     59                                                for ( var i = 0 ; i < divContainers.length ; i++ )
     60                                                        divContainers[i].remove( true );
     61
     62                                                selection.selectBookmarks( bookmarks );
     63                                        }
     64                                } );
     65                               
     66                        editor.ui.addButton( 'CreateDiv',
     67                        {
     68                                label : lang.toolbar,
     69                                command :'creatediv'
     70                        } );
     71
     72                        if ( editor.addMenuItems )
     73                        {
     74                                editor.addMenuItems(
     75                                        {
     76                                                editdiv :
     77                                                {
     78                                                        label : lang.edit,
     79                                                        command : 'editdiv',
     80                                                        group : 'div',
     81                                                        order : 1
     82                                                },
     83
     84                                                removediv:
     85                                                {
     86                                                        label : lang.remove,
     87                                                        command : 'removediv',
     88                                                        group : 'div',
     89                                                        order : 5
     90                                                }
     91                                        } );
     92
     93                                if ( editor.contextMenu )
     94                                {
     95                                        editor.contextMenu.addListener( function( element, selection )
     96                                                {
     97                                                        if ( !element )
     98                                                                return null;
     99
     100                                                        var elementPath = new CKEDITOR.dom.elementPath( element );
     101                                                        var blockLimit = elementPath.blockLimit;
     102
     103                                                        if ( blockLimit && blockLimit.getName() == 'div' )
     104                                                        {
     105                                                                return {
     106                                                                        editdiv : CKEDITOR.TRISTATE_OFF,
     107                                                                        removediv : CKEDITOR.TRISTATE_OFF
     108                                                                }
     109                                                        }
     110
     111                                                        return null;
     112                                                } );
     113                                }
     114                        }
     115                       
     116                        CKEDITOR.dialog.add( 'creatediv', this.path + 'dialogs/div.js' );
     117                        CKEDITOR.dialog.add( 'editdiv', this.path + 'dialogs/div.js' );
     118                }
     119        } );
     120})();
     121
     122// Whether to wrap the whole table when created 'div' in table cell.
     123CKEDITOR.config.div_wrapTable = false;
  • _source/plugins/toolbar/plugin.js

    Property changes on: _source/plugins/div/plugin.js
    ___________________________________________________________________
    Added: svn:executable
       + *
    
     
    240240        ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
    241241        '/',
    242242        ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
    243         ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
     243        ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
    244244        ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
    245245        ['Link','Unlink','Anchor'],     ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
    246246        '/',
  • _source/skins/office2003/icons.css

     
    296296{
    297297        background-position: 0 -32px;
    298298}
     299
     300.cke_skin_office2003 .cke_button_creatediv .cke_icon
     301{
     302        background-position: 0 -1168px;
     303}
     304
     305.cke_skin_office2003 .cke_button_editdiv .cke_icon
     306{
     307        background-position: 0 -1184px;
     308}
     309
     310.cke_skin_office2003 .cke_button_removediv .cke_icon
     311{
     312        background-position: 0 -1200px;
     313}
  • _source/skins/v2/icons.css

     
    296296{
    297297        background-position: 0 -32px;
    298298}
     299
     300.cke_skin_v2 .cke_button_creatediv .cke_icon
     301{
     302        background-position: 0 -1168px;
     303}
     304
     305.cke_skin_v2 .cke_button_editdiv .cke_icon
     306{
     307        background-position: 0 -1184px;
     308}
     309
     310.cke_skin_v2 .cke_button_removediv .cke_icon
     311{
     312        background-position: 0 -1200px;
     313}
  • _source/core/config.js

     
    150150         * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
    151151         */
    152152
    153         plugins : 'about,basicstyles,blockquote,button,clipboard,colorbutton,contextmenu,elementspath,enterkey,entities,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,save,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
     153        plugins : 'about,basicstyles,blockquote,button,clipboard,colorbutton,contextmenu,div,elementspath,enterkey,entities,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,save,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
    154154
    155155        /**
    156156         * The editor tabindex value.
  • _source/core/dtd.js

     
    6666                 */
    6767                $block : block,
    6868
     69                /**
     70                 * List of block limit elements.
     71                 * @type Object
     72                 * @example
     73                 */
     74                $blockLimit : { body:1,div:1,td:1,th:1,caption:1,form:1 },
     75
    6976                $body : X({script:1}, block),
    7077
    7178                /**
  • _source/core/dom/elementpath.js

     
    99        var pathBlockElements = { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 };
    1010
    1111        // Elements that may be considered the "Block limit" in an element path.
    12         var pathBlockLimitElements = { body:1,div:1,td:1,th:1,caption:1,form:1 };
     12        var pathBlockLimitElements = CKEDITOR.dtd.$blockLimit;
    1313
    1414        // Check if an element contains any block element.
    1515        var checkHasBlock = function( element )
  • _source/core/dom/element.js

     
    7575
    7676CKEDITOR.dom.element.setMarker = function( database, element, name, value )
    7777{
    78         var id = element.getCustomData( 'list_marker_id' ) ||
    79                         ( element.setCustomData( 'list_marker_id', CKEDITOR.tools.getNextNumber() ).getCustomData( 'list_marker_id' ) ),
    80                 markerNames = element.getCustomData( 'list_marker_names' ) ||
    81                         ( element.setCustomData( 'list_marker_names', {} ).getCustomData( 'list_marker_names' ) );
     78        var id = element.getCustomData( 'marker_id' ) ||
     79                        ( element.setCustomData( 'marker_id', CKEDITOR.tools.getNextNumber() ).getCustomData( 'marker_id' ) ),
     80                markerNames = element.getCustomData( 'marker_names' ) ||
     81                        ( element.setCustomData( 'marker_names', {} ).getCustomData( 'marker_names' ) );
    8282        database[id] = element;
    8383        markerNames[name] = 1;
    8484
     
    9393
    9494CKEDITOR.dom.element.clearMarkers = function( database, element, removeFromDatabase )
    9595{
    96         var names = element.getCustomData( 'list_marker_names' ),
    97                 id = element.getCustomData( 'list_marker_id' );
     96        var names = element.getCustomData( 'marker_names' ),
     97                id = element.getCustomData( 'marker_id' );
    9898        for ( var i in names )
    9999                element.removeCustomData( i );
    100         element.removeCustomData( 'list_marker_names' );
     100        element.removeCustomData( 'marker_names' );
    101101        if ( removeFromDatabase )
    102102        {
    103                 element.removeCustomData( 'list_marker_id' );
     103                element.removeCustomData( 'marker_id' );
    104104                delete database[id];
    105105        }
    106106};
     
    437437                {
    438438                        return new CKEDITOR.dom.nodeList( this.$.childNodes );
    439439                },
    440 
     440               
    441441                /**
    442442                 * Gets the current computed value of one of the element CSS style
    443443                 * properties.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy