Ticket #2885: 2885_8.patch

File 2885_8.patch, 24.3 KB (added by Martin Kou, 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/domiterator/plugin.js

     
    323323                        {
    324324                                var lastChild = block.getLast();
    325325                                if ( lastChild && lastChild.type == CKEDITOR.NODE_ELEMENT && lastChild.getName() == 'br' )
    326                                         lastChild.remove();
     326                                {
     327                                        // Take care not to remove the block expanding <br> in non-IE browsers.
     328                                        if ( CKEDITOR.env.ie || lastChild.getPrevious() || lastChild.getNext() )
     329                                                lastChild.remove();
     330                                }
    327331                        }
    328332
    329333                        // Get a reference for the next element. This is important because the
  • _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                                       
     232                                        // Firefox might have added some non-block nodes (e.g. _moz_dirty) to our
     233                                        // div, clean them up.
     234                                        for ( var j = divElement.getChildCount() - 1 ; j >= 0 ; j-- )
     235                                        {
     236                                                var child = divElement.getChild( j );
     237                                                if ( !( child.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[ child.getName() ] ) )
     238                                                        child.remove();
     239                                        }
     240
     241                                        // If the divElement has no blocks in it, append p or div.
     242                                        if ( divElement.getChildCount() < 1 )
     243                                        {
     244                                                var filler = editor.document.createElement( editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
     245                                                if ( !CKEDITOR.env.ie )
     246                                                        filler.appendBogus();
     247                                                filler.appendTo( divElement );
     248                                        }
     249       
     250                                        containers.push( divElement );
     251                                }
     252                                else
     253                                {
     254                                        // discover existed container
     255                                        if ( ancestor.getName() == 'div'
     256                                                && childCount == getNonEmptyChildren( ancestor ).length )
     257                                                containers.push( ancestor );
     258                                }
     259                        }
     260       
     261                        return containers;
     262                }
     263               
     264                /**
     265                 * Divide a set of nodes to different groups by their path's blocklimit element.
     266                 * Note: the specified nodes should be in source order naturally, which mean they are supposed to producea by following class:
     267                 *  * CKEDITOR.dom.range.Iterator
     268                 *  * CKEDITOR.dom.domWalker
     269                 *  @return {Array []} the grouped nodes
     270                 */
     271                function groupByDivLimit( nodes )
     272                {
     273                        var groups = [],
     274                                lastDivLimit = null,
     275                                path, block;
     276                        for ( var i = 0 ; i < nodes.length ; i++ )
     277                        {
     278                                block = nodes[i];
     279                                var limit = getDivLimitElement( block );
     280                                if ( !limit.equals( lastDivLimit ) )
     281                                {
     282                                        lastDivLimit = limit ;
     283                                        groups.push( [] ) ;
     284                                }
     285                                groups[ groups.length - 1 ].push( block ) ;
     286                        }
     287                        return groups;
     288                }
     289               
     290                /**
     291                 * Hold a collection of created block container elements. 
     292                 */
     293                var containers = [];
     294                /**
     295                 * @type divDialog
     296                 */
     297                return {
     298                        title : editor.lang.div.title,
     299                        minWidth : 400,
     300                        minHeight : 165,
     301                        contents :
     302                        [
     303                        {
     304                                id :'info',
     305                                label :editor.lang.common.generalTab,
     306                                title :editor.lang.common.generalTab,
     307                                elements :
     308                                [
     309                                        {
     310                                                type :'hbox',
     311                                                widths : [ '50%', '50%' ],
     312                                                children :
     313                                                [
     314                                                        {
     315                                                                id :'elementStyle',
     316                                                                type :'select',
     317                                                                style :'width: 100%;',
     318                                                                label :editor.lang.div.styleSelectLabel,
     319                                                                'default' : '',
     320                                                                items : [],
     321                                                                setup : function( element )
     322                                                                {
     323                                                                        this.setValue( element.$.style.cssText || '' );
     324                                                                },
     325                                                                commit: function( element )
     326                                                                {
     327                                                                        if ( this.getValue() )
     328                                                                                element.$.style.cssText = this.getValue();
     329                                                                        else
     330                                                                                element.removeAttribute( 'style' );
     331                                                                }
     332                                                        },
     333                                                        {
     334                                                                id :'class',
     335                                                                type :'text',
     336                                                                label :editor.lang.common.cssClass,
     337                                                                'default' : ''
     338                                                        }
     339                                                ]
     340                                        }
     341                                ]
     342                        },
     343                        {
     344                                        id :'advanced',
     345                                        label :editor.lang.common.advancedTab,
     346                                        title :editor.lang.common.advancedTab,
     347                                        elements :
     348                                        [
     349                                        {
     350                                                type :'vbox',
     351                                                padding :1,
     352                                                children :
     353                                                [
     354                                                        {
     355                                                                type :'hbox',
     356                                                                widths : [ '50%', '50%' ],
     357                                                                children :
     358                                                                [
     359                                                                        {
     360                                                                                type :'text',
     361                                                                                id :'id',
     362                                                                                label :editor.lang.common.id,
     363                                                                                'default' : ''
     364                                                                        },
     365                                                                        {
     366                                                                                type :'text',
     367                                                                                id :'lang',
     368                                                                                label :editor.lang.link.langCode,
     369                                                                                'default' : ''
     370                                                                        }
     371                                                                ]
     372                                                        },
     373                                                        {
     374                                                                type :'hbox',
     375                                                                children :
     376                                                                [
     377                                                                                {
     378                                                                                        type :'text',
     379                                                                                        id :'style',
     380                                                                                        style :'width: 100%;',
     381                                                                                        label :editor.lang.common.cssStyle,
     382                                                                                        'default' : ''
     383                                                                                }
     384                                                                ]
     385                                                        },
     386                                                        {
     387                                                                type :'hbox',
     388                                                                children :
     389                                                                [
     390                                                                                {
     391                                                                                        type :'text',
     392                                                                                        id :'title',
     393                                                                                        style :'width: 100%;',
     394                                                                                        label :editor.lang.common.advisoryTitle,
     395                                                                                        'default' : ''
     396                                                                                }
     397                                                                ]
     398                                                        },
     399                                                        {
     400                                                                type :'select',
     401                                                                id :'dir',
     402                                                                style :'width: 100%;',
     403                                                                label :editor.lang.common.langDir,
     404                                                                'default' : '',
     405                                                                items :
     406                                                                [
     407                                                                        [
     408                                                                                editor.lang.common.langDirLtr,
     409                                                                                'ltr'
     410                                                                        ],
     411                                                                        [
     412                                                                                editor.lang.common.langDirRtl,
     413                                                                                'rtl'
     414                                                                        ]
     415                                                                ]
     416                                                        }
     417                                                ]
     418                                        }
     419                                        ]
     420                                }
     421                        ],
     422                        onLoad : function()
     423                        {
     424                                setupFields.call(this);
     425                        },
     426                        onShow : function()
     427                        {
     428                                containers = [];
     429                                // Whether always create new container regardless of existed
     430                                // ones.
     431                                if ( command == 'editdiv' )
     432                                {
     433                                        // Try to discover the containers that already existed in
     434                                        // ranges
     435                                        containers = applyDiv( editor );
     436                                        if( containers.length )
     437                                        {
     438                                                this._element = containers[ 0 ];
     439                                                // update dialog field values
     440                                                this.setupContent( this._element );
     441                                        }
     442                                }
     443                        },
     444                        onOk : function()
     445                        {
     446                                containers = applyDiv( editor, true );
     447                               
     448                                // Update elements attributes
     449                                for( var i = 0 ; i < containers.length ; i++ )
     450                                        this.commitContent( containers[ i ] );
     451                                this.hide();
     452                        }
     453                };
     454        }
     455       
     456        CKEDITOR.dialog.add( 'creatediv', function( editor )
     457                {
     458                        return divDialog( editor, 'creatediv' );
     459                } );
     460        CKEDITOR.dialog.add( 'editdiv', function( editor )
     461                {
     462                        return divDialog( editor, 'editdiv' );
     463                } );
     464})();
  • _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
       + *
    
     
    277277        ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
    278278        '/',
    279279        ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
    280         ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
     280        ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
    281281        ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
    282282        ['Link','Unlink','Anchor'],     ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
    283283        '/',
  • _source/skins/office2003/icons.css

     
    306306{
    307307        background-position: 0 -1040px;
    308308}
     309
     310.cke_skin_office2003 .cke_button_creatediv .cke_icon
     311{
     312        background-position: 0 -1168px;
     313}
     314
     315.cke_skin_office2003 .cke_button_editdiv .cke_icon
     316{
     317        background-position: 0 -1184px;
     318}
     319
     320.cke_skin_office2003 .cke_button_removediv .cke_icon
     321{
     322        background-position: 0 -1200px;
     323}
  • _source/skins/v2/icons.css

     
    306306{
    307307        background-position: 0 -1040px;
    308308}
     309
     310.cke_skin_v2 .cke_button_creatediv .cke_icon
     311{
     312        background-position: 0 -1168px;
     313}
     314
     315.cke_skin_v2 .cke_button_editdiv .cke_icon
     316{
     317        background-position: 0 -1184px;
     318}
     319
     320.cke_skin_v2 .cke_button_removediv .cke_icon
     321{
     322        background-position: 0 -1200px;
     323}
  • _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};
     
    441441                {
    442442                        return new CKEDITOR.dom.nodeList( this.$.childNodes );
    443443                },
    444 
     444               
    445445                /**
    446446                 * Gets the current computed value of one of the element CSS style
    447447                 * properties.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy