Ticket #2353: 2353.patch

File 2353.patch, 3.5 KB (added by Felix Siebert, 16 years ago)
  • FCKeditorSkin.body.php

     
    5050                }
    5151                if (!empty($params)) {
    5252                        if (isset($params['width'])) {
    53                                 $ret .= "_fck_mw_width=\"".$params['width']."\" ";
     53                                $ret .= "width=\"".$params['width']."\" ";
    5454                        }
    5555                        if (isset($params['height'])) {
    56                                 $ret .= "_fck_mw_height=\"".$params['height']."\" ";
     56                                $ret .= "height=\"".$params['height']."\" ";
    5757                        }
    5858                }
    5959                $class = "";
     
    167167                }
    168168                if (!empty($hp)) {
    169169                        if (isset($hp['width'])) {
    170                                 $ret .= "_fck_mw_width=\"".$hp['width']."\" ";
     170                                $ret .= "width=\"".$hp['width']."\" ";
    171171                        }
    172172                        if (isset($hp['height'])) {
    173                                 $ret .= "_fck_mw_height=\"".$hp['height']."\" ";
     173                                $ret .= "height=\"".$hp['height']."\" ";
    174174                        }
    175175                }
    176176                $class = "";
  • plugins/mediawiki/dialogs/image.html

     
    7373        GetE('xType').value             = GetAttribute( oImage, '_fck_mw_type', '' ) ;
    7474        GetE('cmbAlign').value  = GetAttribute( oImage, '_fck_mw_location', '' ) ;
    7575
    76         GetE('txtWidth').value  = GetAttribute( oImage, '_fck_mw_width', '' ) ;
    77         GetE('txtHeight').value = GetAttribute( oImage, '_fck_mw_height', '' ) ;
     76        GetE('txtWidth').value  = GetAttribute( oImage, 'width', '' ) ;
     77        if(!isNaN(parseInt(oImage.style.width)))
     78        {
     79                $width = parseInt(oImage.style.width)+'';
     80                GetE('txtWidth').value = $width;
     81                SetAttribute(oImage, 'width', $width);
     82                oImage.style.width='';
     83        }
     84        GetE('txtHeight').value = GetAttribute( oImage, 'height', '' ) ;
     85        if(!isNaN(parseInt(oImage.style.height)))
     86        {
     87                $height = parseInt(oImage.style.height)+'';
     88                GetE('txtHeight').value = $height;
     89                SetAttribute(oImage, 'height', $height);
     90                oImage.style.height='';
     91        }
    7892
    7993        UpdatePreview();
    8094}
     
    149163        SetAttribute( e, "alt", GetE('txtAlt').value ) ;
    150164        SetAttribute( e, "_fck_mw_type", imgType ) ;
    151165        SetAttribute( e, "_fck_mw_location", imgLocation ) ;
    152         SetAttribute( e, "_fck_mw_width", GetE('txtWidth').value ) ;
    153         SetAttribute( e, "_fck_mw_height", GetE('txtHeight').value ) ;
    154166
    155167        SetAttribute( e, "width" , GetE('txtWidth').value ) ;
    156168        SetAttribute( e, "height", GetE('txtHeight').value ) ;
  • plugins/mediawiki/fckplugin.js

     
    525525                                                        var imgCaption  = htmlNode.getAttribute( 'alt' ) || '' ;
    526526                                                        var imgType             = htmlNode.getAttribute( '_fck_mw_type' ) || '' ;
    527527                                                        var imgLocation = htmlNode.getAttribute( '_fck_mw_location' ) || '' ;
    528                                                         var imgWidth    = htmlNode.getAttribute( '_fck_mw_width' ) || '' ;
    529                                                         var imgHeight   = htmlNode.getAttribute( '_fck_mw_height' ) || '' ;
     528                                                        var imgWidth    = htmlNode.getAttribute( 'width' )+'' || '';
     529                                                        if(!isNaN(parseInt(htmlNode.style.width)))
     530                                                        {
     531                                                                imgWidth=parseInt(htmlNode.style.width)+'';
     532                                                                htmlNode.style.width = '';
     533                                                        }
     534                                                        var imgHeight   = htmlNode.getAttribute( 'height' )+'' || '';
     535                                                        if(!isNaN(parseInt(htmlNode.style.height)))
     536                                                        {
     537                                                                imgHeight = parseInt(htmlNode.style.height)+'';
     538                                                                htmlNode.style.height = '';
     539                                                        }
    530540
    531541                                                        stringBuilder.push( '[[Image:' )
    532542                                                        stringBuilder.push( imgName )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy