Ticket #3385: 3385.patch

File 3385.patch, 4.6 KB (added by Garry Yao, 15 years ago)
  • _source/core/dom/elementpath.js

     
    101101
    102102                return true;
    103103        }
     104        // %REMOVE_START%
     105        ,toString : function()
     106        {
     107                var str ="";
     108                for ( var i = 0 ; i < this.elements.length ; i++ )
     109                {
     110                        var element = this.elements[ i ];
     111                        str +=
     112                                // Path block  decorated as "
     113                                ( element.equals( this.block ) ?
     114                                ( '\"' + element.getName() + '\"' ) :
     115                                // Path block limit decorated as *
     116                                ( element.equals( this.blockLimit )?   
     117                                ( '*' + element.getName() + '*' ) : element.getName() ) )+
     118                                ( i == this.elements.length -1 ? '' : '->' );
     119                }
     120                return str + '\n';
     121        }
     122        // %REMOVE_END%
    104123};
  • _source/core/dom/nodelist.js

     
    2020                var $node = this.$[ index ];
    2121                return $node ? new CKEDITOR.dom.node( $node ) : null;
    2222        }
     23       
     24        // %REMOVE_START%
     25        ,toString : function()
     26        {
     27                var str = "";
     28                for ( var i = 0 ; i < this.count() ; i++ )
     29                {
     30                        str += CKEDITOR.tools.rtrim( this.getItem( i ).toString() );
     31                }
     32                return str + '\n';
     33        }
     34        // %REMOVE_END%
    2335};
  • _source/core/dom/documentfragment.js

     
    2525                {
    2626                        node = node.$;
    2727                        node.parentNode.insertBefore( this.$, node.nextSibling );
     28                },
     29               
     30                getHtml : function()
     31                {
     32                        var str = "",
     33                                childList = this.getChildren();
     34                        for ( var i = 0; i < childList.count(); i++ )
     35                        {
     36                                var child = childList.getItem( i );
     37                                str += ( child.getOuterHtml?
     38                                        child.getOuterHtml() : child.getText() );
     39                        }
     40                        return str;
     41                },
     42               
     43                getOuterHtml : function()
     44                {
     45                        return this.getHtml();
    2846                }
     47               
    2948        },
    3049        true,
    3150        {
     
    4362                'getDocument' : 1,
    4463                'getChildCount' : 1,
    4564                'getChild' : 1,
    46                 'getChildren' : 1
     65                'getChildren' : 1,
     66                'getHtml' : 1,
     67                'getOuterHtml' : 1
     68                ,'toString' : 1                 // %REMOVE_LINE%
    4769        } );
  • _source/core/dom/range.js

     
    15271527
    15281528                        return container.getChild[ this.endOffset - 1 ] || container ;
    15291529                }
     1530                // %REMOVE_START%
     1531                ,toString : function()
     1532                {
     1533                        if ( this.collapsed )
     1534                        {
     1535                                // TODO: print previous and next source node by range iterator;
     1536                                return '^' + '\n';
     1537                        }
     1538                        else
     1539                                return '[' + CKEDITOR.tools.rtrim(
     1540                                        this.cloneContents().toString() ) + ']' + '\n';
     1541                }
     1542                // %REMOVE_END%
    15301543        };
    15311544})();
    15321545
  • _source/core/dom/node.js

     
    630630                                }
    631631                        }
    632632                }
     633               
    633634        }
    634635);
  • _source/core/dom/text.js

     
    108108                        else
    109109                                return this.$.nodeValue.substring( indexA, indexB );
    110110                }
    111         });
     111                // %REMOVE_START%
     112                ,toString : function()
     113                {
     114                        return '#' + this.getText() + '\n';
     115                }
     116                // %REMOVE_END%
     117        }, true );
  • _source/core/dom/walker.js

     
    218218                        {
    219219                                return iterate.call( this, true, true ) !== false;
    220220                        }
     221                        // %REMOVE_START%                       
     222                        ,toString : function()
     223                        {
     224                                return ( this.startNode? this.startNode.toString() : '^' )+ '...'
     225                                        + ( this.current? this.current.toString() + '...' : '' )
     226                                        + ( this.endNode? this.endNode.toString() : '$' )
     227                                        + '\n';
     228                        }
     229                        // %REMOVE_END%
    221230                }
    222231        });
    223232})();
  • _source/core/dom/element.js

     
    13241324                        newNode.$._cke_expando = this.$._cke_expando;
    13251325                        this.$ = newNode.$;
    13261326                }
    1327         });
     1327                // %REMOVE_START%
     1328                ,toString : function()
     1329                {
     1330                        return this.getOuterHtml() + '\n';
     1331                }
     1332                // %REMOVE_END%
     1333        }, true );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy