Ticket #5214: FCK_img_link_fix.patch

File FCK_img_link_fix.patch, 1.9 KB (added by Tami, 13 years ago)
  • FCKeditorSkin.body.php

    diff -Naur FCKeditor.orig/FCKeditorSkin.body.php FCKeditor/FCKeditorSkin.body.php
    old new  
    158158                if( $fp['align'] ) {
    159159                        $ret .= "_fck_mw_location=\"" . strtolower( $fp['align'] ) . "\" ";
    160160                }
     161                if( $fp['link-url'] ) {
     162                        $ret .= "_fck_link_url=\"" . $fp['link-url'] . "\" ";
     163                }
     164                if( $fp['link-title'] ) {
     165                        $ret .= "_fck_link_title=\"" . $fp['link-title'] . "\" ";
     166                }
    161167                if( !empty( $hp ) ) {
    162168                        if( isset( $hp['width'] ) ) {
    163169                                $ret .= "_fck_mw_width=\"" . $hp['width'] . "\" ";
  • plugins/mediawiki/fckplugin.js

    diff -Naur FCKeditor.orig/plugins/mediawiki/fckplugin.js FCKeditor/plugins/mediawiki/fckplugin.js
    old new  
    553553                                                        var imgStyleHeight      = ( parseInt(htmlNode.style.height) || '' ) + '';
    554554                                                        var imgRealWidth        = ( htmlNode.getAttribute( 'width' ) || '' ) + '';
    555555                                                        var imgRealHeight       = ( htmlNode.getAttribute( 'height' ) || '' ) + '';
     556                                                        var imgLinkUrl          = htmlNode.getAttribute( '_fck_link_url' ) || '';
     557                                                        var imgLinkTitle        = htmlNode.getAttribute( '_fck_link_title' ) || '';
    556558
    557559                                                        stringBuilder.push( '[[Image:' );
    558560                                                        stringBuilder.push( imgName );
     
    582584                                                                stringBuilder.push( 'px' );
    583585                                                        }
    584586                                                       
     587                                                        if ( imgLinkUrl.length > 0 ){
     588                                                                stringBuilder.push( '|link=' + imgLinkUrl );
     589                                                                imgCaption = '';
     590                                                        }
     591                                                        else if ( imgLinkTitle.length > 0 ){
     592                                                                stringBuilder.push( '|link=' + imgLinkTitle );
     593                                                                imgCaption = '';
     594                                                        }
    585595                                                        if ( imgCaption.length > 0 )
    586596                                                                stringBuilder.push( '|' + imgCaption );
    587597
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy