Ticket #3564: 3564_4.patch

File 3564_4.patch, 9.5 KB (added by Martin Kou, 15 years ago)
  • _source/lang/en.js

     
    647647                copy : 'Copyright © $1. All rights reserved.'
    648648        },
    649649
    650         maximize : 'Maximize'
     650        maximize : 'Maximize',
     651
     652        resize : 'Drag to resize'
    651653};
  • _source/plugins/resize/plugin.js

     
     1/*
     2Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6CKEDITOR.plugins.add( 'resize',
     7{
     8        init : function( editor )
     9        {
     10                var config = editor.config;
     11
     12                if ( config.resize_enabled )
     13                {
     14                        var container = null;
     15                        var origin, startSize;
     16
     17                        function dragHandler( evt )
     18                        {
     19                                var dx = evt.data.$.screenX - origin.x;
     20                                var dy = evt.data.$.screenY - origin.y;
     21                                var internalWidth = startSize.width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 );
     22                                var internalHeight = startSize.height + dy;
     23
     24                                editor.resize( Math.max( config.resize_minWidth, Math.min( internalWidth, config.resize_maxWidth ) ),
     25                                                Math.max( config.resize_minHeight, Math.min( internalHeight, config.resize_maxHeight ) ) );
     26                        }
     27
     28                        function dragEndHandler ( evt )
     29                        {
     30                                CKEDITOR.document.removeListener( 'mousemove', dragHandler );
     31                                CKEDITOR.document.removeListener( 'mouseup', dragEndHandler );
     32
     33                                if ( editor.document )
     34                                {
     35                                        editor.document.removeListener( 'mousemove', dragHandler );
     36                                        editor.document.removeListener( 'mouseup', dragEndHandler );
     37                                }
     38                        }
     39
     40                        var mouseDownFn = CKEDITOR.tools.addFunction( function( $event )
     41                                {
     42                                        if ( container == null )
     43                                                container = editor.getResizable();
     44
     45                                        startSize = { width : container.$.offsetWidth || 0, height : container.$.offsetHeight || 0 };
     46                                        origin = { x : $event.screenX, y : $event.screenY };
     47
     48                                        CKEDITOR.document.on( 'mousemove', dragHandler );
     49                                        CKEDITOR.document.on( 'mouseup', dragEndHandler );
     50
     51                                        if ( editor.document )
     52                                        {
     53                                                editor.document.on( 'mousemove', dragHandler );
     54                                                editor.document.on( 'mouseup', dragEndHandler );
     55                                        }
     56                                } );
     57
     58                        editor.on( 'themeSpace', function( event )
     59                                {
     60                                        if ( event.data.space == 'bottom' )
     61                                        {
     62                                                event.data.html += '<div class="cke_resizer"' +
     63                                                        ' title="' + CKEDITOR.tools.htmlEncode( editor.lang.resize ) + '"' +
     64                                                        ' onmousedown="CKEDITOR.tools.callFunction(' + mouseDownFn + ', event)"' +
     65                                                        '></div>';
     66                                        }
     67                                }, editor, null, 100 );
     68                }
     69        }
     70} );
     71
     72CKEDITOR.config.resize_minWidth = 750;
     73CKEDITOR.config.resize_minHeight = 250;
     74CKEDITOR.config.resize_maxWidth = 3000;
     75CKEDITOR.config.resize_maxHeight = 3000;
     76CKEDITOR.config.resize_enabled = true;
  • _source/themes/default/theme.js

     
    179179        var outer = contents.getAscendant( 'table' );
    180180
    181181        // Resize the width first.
     182        // WEBKIT BUG: Webkit requires that we put the editor off from display when we
     183        // resize it. If we don't, the browser crashes!
     184        CKEDITOR.env.webkit && outer.setStyle( 'display', 'none' );
    182185        outer.setStyle( 'width', width );
     186        if ( CKEDITOR.env.webkit )
     187        {
     188                outer.$.offsetWidth;
     189                outer.setStyle( 'display', '' );
     190        }
    183191
    184192        // Get the height delta between the outer table and the content area.
    185193        // If we're setting the content area's height, then we don't need the delta.
    186194        var delta = isContentHeight ? 0 : ( outer.$.offsetHeight || 0 ) - ( contents.$.clientHeight || 0 );
     195        contents.setStyle( 'height', Math.max( height - delta, 0 ) + 'px' );
    187196
    188         // Resize the height.
    189         contents.setStyle( 'height', ( height - delta ) + 'px' );
    190 
    191197        // Emit a resize event.
    192198        this.fire( 'resize' );
    193199};
     200
     201CKEDITOR.editor.prototype.getResizable = function()
     202{
     203        return this.container.getChild( [ 0, 0 ] );
     204};
  • _source/skins/office2003/elementspath.css

     
    1414.cke_skin_office2003 .cke_path
    1515{
    1616        padding: 3px 3px 0 3px;
     17        display: block;
     18        float: left;
    1719}
    1820
     21.cke_skin_office2003 .cke_rtl .cke_path
     22{
     23        float: right;
     24}
     25
    1926.cke_skin_office2003 .cke_path a,
    2027.cke_skin_office2003 .cke_path .cke_empty
    2128{
     
    3643}
    3744
    3845.cke_skin_office2003 .cke_rtl .cke_path a,
    39 .cke_skin_office2003 .cke_path .cke_empty
     46.cke_skin_office2003 .cke_rtl .cke_path .cke_empty
    4047{
    4148        float: right;
    4249}
  • _source/skins/office2003/mainui.css

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/skins/office2003/images/resizer.gif
    ___________________________________________________________________
    Name: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/skins/office2003/images/resizer_rtl.gif
    ___________________________________________________________________
    Name: svn:mime-type
       + application/octet-stream
    
     
    5454        white-space: pre;
    5555        background-color: #fff;
    5656}
     57
     58.cke_skin_office2003 .cke_resizer
     59{
     60        width: 12px;
     61        height: 12px;
     62        margin-top: 12px;
     63        display: block;
     64        float: right;
     65        background-image: url(images/resizer.gif);
     66        cursor: se-resize;
     67}
     68
     69.cke_skin_office2003 .cke_rtl .cke_resizer
     70{
     71        cursor: sw-resize;
     72        background-image: url(images/resizer_rtl.gif);
     73        float: left;
     74}
  • _source/skins/v2/elementspath.css

     
    1414.cke_skin_v2 .cke_path
    1515{
    1616        padding: 3px 3px 0 3px;
     17        display: block;
     18        float: left;
    1719}
    1820
     21.cke_skin_v2 .cke_rtl .cke_path
     22{
     23        float: right;
     24}
     25
    1926.cke_skin_v2 .cke_path a,
    2027.cke_skin_v2 .cke_path .cke_empty
    2128{
     
    3643}
    3744
    3845.cke_skin_v2 .cke_rtl .cke_path a,
    39 .cke_skin_v2 .cke_path .cke_empty
     46.cke_skin_v2 .cke_rtl .cke_path .cke_empty
    4047{
    4148        float: right;
    4249}
  • _source/skins/v2/mainui.css

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/skins/v2/images/resizer.gif
    ___________________________________________________________________
    Name: svn:mime-type
       + application/octet-stream
    
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    
    Property changes on: _source/skins/v2/images/resizer_rtl.gif
    ___________________________________________________________________
    Name: svn:mime-type
       + application/octet-stream
    
     
    6565        /* For IE6+Quirks only */
    6666        _white-space: normal;
    6767}
     68
     69.cke_skin_v2 .cke_resizer
     70{
     71        width: 12px;
     72        height: 12px;
     73        margin-top: 12px;
     74        display: block;
     75        float: right;
     76        background-image: url(images/resizer.gif);
     77        cursor: se-resize;
     78}
     79
     80.cke_skin_v2 .cke_rtl .cke_resizer
     81{
     82        cursor: sw-resize;
     83        background-image: url(images/resizer_rtl.gif);
     84        float: left;
     85}
  • _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,scayt,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
     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,resize,save,scayt,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
    154154
    155155        /**
    156156         * List of additional plugins to be loaded. This is a tool setting which
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy