Ticket #4231: 4231_3.patch

File 4231_3.patch, 5.1 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Revised patch

  • _source/plugins/resize/plugin.js

     
    1111
    1212                if ( config.resize_enabled )
    1313                {
    14                         var container = null;
    15                         var origin, startSize;
     14                        var container = null,
     15                                origin,
     16                                startSize,
     17                                resizeHorizontal = ( config.resize_dir == 'both' || config.resize_dir == 'horizontal' ) &&
     18                                        ( config.resize_minWidth != config.resize_maxWidth ),
     19                                resizeVertical = ( config.resize_dir == 'both' || config.resize_dir == 'vertical' ) &&
     20                                        ( config.resize_minHeight != config.resize_maxHeight );
    1621
    1722                        function dragHandler( evt )
    1823                        {
    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;
     24                                var dx = evt.data.$.screenX - origin.x,
     25                                        dy = evt.data.$.screenY - origin.y,
     26                                        width = startSize.width,
     27                                        height = startSize.height,
     28                                        internalWidth = width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 ),
     29                                        internalHeight = height + dy;
    2330
    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 ) ) );
     31                                if ( resizeHorizontal )
     32                                        width =  Math.max( config.resize_minWidth, Math.min( internalWidth, config.resize_maxWidth ) );
     33
     34                                if ( resizeVertical )
     35                                        height =  Math.max( config.resize_minHeight, Math.min( internalHeight, config.resize_maxHeight ) );
     36
     37                                editor.resize( width, height );
    2638                        }
    2739
    2840                        function dragEndHandler ( evt )
     
    6173                                {
    6274                                        if ( event.data.space == 'bottom' )
    6375                                        {
    64                                                 event.data.html += '<div class="cke_resizer"' +
     76                                                var direction = '';
     77                                                if ( resizeHorizontal && !resizeVertical)
     78                                                        direction = ' cke_resizer_horizontal';
     79                                                if ( !resizeHorizontal && resizeVertical)
     80                                                        direction = ' cke_resizer_vertical';
     81
     82                                                event.data.html += '<div class="cke_resizer' + direction + '"' +
    6583                                                        ' title="' + CKEDITOR.tools.htmlEncode( editor.lang.resize ) + '"' +
    6684                                                        ' onmousedown="CKEDITOR.tools.callFunction(' + mouseDownFn + ', event)"' +
    6785                                                        '></div>';
     
    108126CKEDITOR.config.resize_maxHeight = 3000;
    109127
    110128/**
    111  * Whether to enable the resizing feature. If disabed the resize handler will not be visible.
     129 * Whether to enable the resizing feature. If disabled the resize handler will not be visible.
    112130 * @type Boolean
    113131 * @default true
    114132 * @example
    115133 * config.resize_enabled = false;
    116134 */
    117135CKEDITOR.config.resize_enabled = true;
     136
     137/**
     138 * The directions where resizing is enabled. It can be 'both', 'vertical' or 'horizontal'
     139 * @type String
     140 * @default 'both'
     141 * @since 3.3
     142 * @example
     143 * config.resize_dir = 'vertical';
     144 */
     145
     146CKEDITOR.config.resize_dir = 'both';
     147 No newline at end of file
  • _source/skins/kama/mainui.css

     
    133133        float: left;
    134134}
    135135
     136.cke_skin_kama .cke_resizer_horizontal,
     137.cke_skin_kama .cke_rtl .cke_resizer_horizontal
     138{
     139        cursor: e-resize;
     140}
     141
     142.cke_skin_kama .cke_resizer_vertical,
     143.cke_skin_kama .cke_rtl .cke_resizer_vertical
     144{
     145        cursor: n-resize;
     146}
     147
    136148.cke_skin_kama .cke_maximized .cke_resizer
    137149{
    138150        display: none;
  • _source/skins/office2003/mainui.css

     
    9393        cursor: se-resize;
    9494}
    9595
    96 .cke_skin_office2003 .cke_maximized .cke_resizer
    97 {
    98         display: none;
    99 }
    100 
    10196.cke_skin_office2003 .cke_rtl .cke_resizer
    10297{
    10398        cursor: sw-resize;
     
    106101        float: left;
    107102}
    108103
     104.cke_skin_office2003 .cke_resizer_horizontal,
     105.cke_skin_office2003 .cke_rtl .cke_resizer_horizontal
     106{
     107        cursor: e-resize;
     108}
     109
     110.cke_skin_office2003 .cke_resizer_vertical,
     111.cke_skin_office2003 .cke_rtl .cke_resizer_vertical
     112{
     113        cursor: n-resize;
     114}
     115
     116.cke_skin_office2003 .cke_maximized .cke_resizer
     117{
     118        display: none;
     119}
     120
    109121.cke_skin_office2003 .cke_browser_ie6 .cke_contents textarea,
    110122.cke_skin_office2003 .cke_browser_ie7 .cke_contents textarea
    111123{
  • _source/skins/v2/mainui.css

     
    110110        float: left;
    111111}
    112112
     113.cke_skin_v2 .cke_resizer_horizontal,
     114.cke_skin_v2 .cke_rtl .cke_resizer_horizontal
     115{
     116        cursor: e-resize;
     117}
     118
     119.cke_skin_v2 .cke_resizer_vertical,
     120.cke_skin_v2 .cke_rtl .cke_resizer_vertical
     121{
     122        cursor: n-resize;
     123}
     124
    113125.cke_skin_v2 .cke_maximized .cke_resizer
    114126{
    115127        display: none;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy