Changeset 381

Show
Ignore:
Timestamp:
2007-06-14 16:48:54 (17 months ago)
Author:
fredck
Message:

Updated "stable" branch with version 2.4.3.

Location:
FCKeditor/releases/stable
Files:
78 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/releases/stable/editor/css/fck_internal.css

    r242 r381  
    4343.FCK__Flash 
    4444{ 
    45         border: darkgray 1px solid; 
     45        border: #a9a9a9 1px solid; 
    4646        background-position: center center; 
    4747        background-image: url(images/fck_flashlogo.gif); 
     
    6767{ 
    6868        border: 1px dotted #00F; 
    69         background-position: 1 center; 
     69        background-position: 1px center; 
    7070        background-image: url(images/fck_anchor.gif); 
    7171        background-repeat: no-repeat; 
  • FCKeditor/releases/stable/editor/dialog/fck_about.html

    r242 r381  
    7979                                                                <span fcklang="DlgAboutVersion">version</span> 
    8080                                                                <br /> 
    81                                                                 <b>2.4.2</b><br /> 
    82                                                                 Build 14978</td> 
     81                                                                <b>2.4.3</b><br /> 
     82                                                                Build 15657</td> 
    8383                                                </tr> 
    8484                                        </table> 
  • FCKeditor/releases/stable/editor/dialog/fck_anchor.html

    r242 r381  
    111111 
    112112        // Create a new anchor preserving the current selection 
    113         oAnchor = oEditor.FCK.CreateLink( '#' ) ; 
    114         if ( !oAnchor ) 
     113        var aNewAnchors = oEditor.FCK.CreateLink( '#' ) ; 
     114 
     115        if ( aNewAnchors.length == 0 ) 
    115116        { 
    116117                // Nothing was selected, so now just create a normal A 
    117                 oAnchor = oEditor.FCK.CreateElement( 'a' ) ; 
     118                aNewAnchors.push( oEditor.FCK.CreateElement( 'a' ) ) ; 
    118119        } 
    119120        else 
    120121        { 
    121122                // Remove the fake href 
    122                 oAnchor.removeAttribute( 'href' ) ; 
    123         } 
    124         // Set the name 
    125         oAnchor.name = sNewName ; 
    126  
    127         // IE does require special processing to show the Anchor's image 
    128         // Opera doesn't allow to select empty anchors 
    129         if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera ) 
    130         { 
    131                 if ( oAnchor.innerHTML != '' ) 
     123                for ( var i = 0 ; i < aNewAnchors.length ; i++ ) 
     124                        aNewAnchors[i].removeAttribute( 'href' ) ; 
     125        } 
     126 
     127        // More than one anchors may have been created, so interact through all of them (see #220). 
     128        for ( var i = 0 ; i < aNewAnchors.length ; i++ ) 
     129        { 
     130                oAnchor = aNewAnchors[i] ; 
     131 
     132                // Set the name 
     133                oAnchor.name = sNewName ; 
     134 
     135                // IE does require special processing to show the Anchor's image 
     136                // Opera doesn't allow to select empty anchors 
     137                if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera ) 
    132138                { 
    133                         if ( FCKBrowserInfo.IsIE ) 
    134                                 oAnchor.className += ' FCK__AnchorC' ; 
     139                        if ( oAnchor.innerHTML != '' ) 
     140                        { 
     141                                if ( FCKBrowserInfo.IsIE ) 
     142                                        oAnchor.className += ' FCK__AnchorC' ; 
     143                        } 
     144                        else 
     145                        { 
     146                                // Create a fake image for both IE and Opera 
     147                                var oImg = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oAnchor.cloneNode(true) ) ; 
     148                                oImg.setAttribute( '_fckanchor', 'true', 0 ) ; 
     149 
     150                                oAnchor.parentNode.insertBefore( oImg, oAnchor ) ; 
     151                                oAnchor.parentNode.removeChild( oAnchor ) ; 
     152                        } 
     153 
    135154                } 
    136                 else 
    137                 { 
    138                         // Create a fake image for both IE and Opera 
    139                         var oImg = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oAnchor.cloneNode(true) ) ; 
    140                         oImg.setAttribute( '_fckanchor', 'true', 0 ) ; 
    141  
    142                         oAnchor.parentNode.insertBefore( oImg, oAnchor ) ; 
    143                         oAnchor.parentNode.removeChild( oAnchor ) ; 
    144                 } 
    145  
    146155        } 
    147156 
  • FCKeditor/releases/stable/editor/dialog/fck_flash/fck_flash.js

    r231 r381  
    8282{ 
    8383        if ( ! oEmbed ) return ; 
    84  
    85         var sUrl = GetAttribute( oEmbed, 'src', '' ) ; 
    8684 
    8785        GetE('txtUrl').value    = GetAttribute( oEmbed, 'src', '' ) ; 
     
    106104        { 
    107105                GetE('txtAttClasses').value = oEmbed.getAttribute('class',2) || '' ; 
    108                 GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) ; 
     106                GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) || '' ; 
    109107        } 
    110108 
     
    151149        SetAttribute( e, 'pluginspage'  , 'http://www.macromedia.com/go/getflashplayer' ) ; 
    152150 
    153         e.src = GetE('txtUrl').value ; 
     151        SetAttribute( e, 'src', GetE('txtUrl').value ) ; 
    154152        SetAttribute( e, "width" , GetE('txtWidth').value ) ; 
    155153        SetAttribute( e, "height", GetE('txtHeight').value ) ; 
     
    203201                var e           = oDoc.createElement( 'EMBED' ) ; 
    204202 
    205                 e.src           = GetE('txtUrl').value ; 
    206                 e.type          = 'application/x-shockwave-flash' ; 
    207                 e.width         = '100%' ; 
    208                 e.height        = '100%' ; 
     203                SetAttribute( e, 'src', GetE('txtUrl').value ) ; 
     204                SetAttribute( e, 'type', 'application/x-shockwave-flash' ) ; 
     205                SetAttribute( e, 'width', '100%' ) ; 
     206                SetAttribute( e, 'height', '100%' ) ; 
    209207 
    210208                ePreview.appendChild( e ) ; 
  • FCKeditor/releases/stable/editor/dialog/fck_image/fck_image.js

    r231 r381  
    144144                        iWidth = aMatchW[1] ; 
    145145                        oImage.style.width = '' ; 
     146                        SetAttribute( oImage, 'width' , iWidth ) ; 
    146147                } 
    147148        } 
     
    154155                        iHeight = aMatchH[1] ; 
    155156                        oImage.style.height = '' ; 
     157                        SetAttribute( oImage, 'height', iHeight ) ; 
    156158                } 
    157159        } 
     
    169171        if ( oEditor.FCKBrowserInfo.IsIE ) 
    170172        { 
    171                 GetE('txtAttClasses').value = oImage.getAttribute('className') || '' ; 
     173                GetE('txtAttClasses').value = oImage.className || '' ; 
    172174                GetE('txtAttStyle').value = oImage.style.cssText ; 
    173175        } 
     
    249251                                oEditor.FCKSelection.SelectNode( oImage ) ; 
    250252 
    251                         oLink = oEditor.FCK.CreateLink( sLnkUrl ) ; 
     253                        oLink = oEditor.FCK.CreateLink( sLnkUrl )[0] ; 
    252254 
    253255                        if ( !bHasImage ) 
     
    285287        SetAttribute( e, 'lang'         , GetE('txtAttLangCode').value ) ; 
    286288        SetAttribute( e, 'title'        , GetE('txtAttTitle').value ) ; 
    287         SetAttribute( e, 'class'        , GetE('txtAttClasses').value ) ; 
    288289        SetAttribute( e, 'longDesc'     , GetE('txtLongDesc').value ) ; 
    289290 
    290291        if ( oEditor.FCKBrowserInfo.IsIE ) 
     292        { 
     293                e.className = GetE('txtAttClasses').value ; 
    291294                e.style.cssText = GetE('txtAttStyle').value ; 
    292         else 
     295        } 
     296        else 
     297        { 
     298                SetAttribute( e, 'class'        , GetE('txtAttClasses').value ) ; 
    293299                SetAttribute( e, 'style', GetE('txtAttStyle').value ) ; 
     300        } 
    294301} 
    295302 
  • FCKeditor/releases/stable/editor/dialog/fck_link/fck_link.js

    r231 r381  
    152152                GetE('frmUpload').action = FCKConfig.LinkUploadURL ; 
    153153 
     154        // Set the default target (from configuration). 
     155        SetDefaultTarget() ; 
     156 
    154157        // Activate the "OK" button. 
    155158        window.parent.SetOkButton( true ) ; 
     
    500503        } 
    501504 
    502         // No link selected, so try to create one. 
    503         if ( !oLink ) 
    504                 oLink = oEditor.FCK.CreateLink( sUri ) ; 
    505  
    506         if ( oLink ) 
    507                 sInnerHtml = oLink.innerHTML ;          // Save the innerHTML (IE changes it if it is like an URL). 
    508         else 
    509         { 
    510                 // If no selection, use the uri as the link text (by dom, 2006-05-26) 
    511  
     505        // If no link is selected, create a new one (it may result in more than one link creation - #220). 
     506        var aLinks = oLink ? [ oLink ] : oEditor.FCK.CreateLink( sUri ) ; 
     507 
     508        // If no selection, no links are created, so use the uri as the link text (by dom, 2006-05-26) 
     509        var aHasSelection = ( aLinks.length > 0 ) ; 
     510        if ( !aHasSelection ) 
     511        { 
    512512                sInnerHtml = sUri; 
    513513 
     
    535535 
    536536                // Create a new (empty) anchor. 
    537                 oLink = oEditor.FCK.CreateElement( 'a' ) ; 
     537                aLinks = [ oEditor.FCK.CreateElement( 'a' ) ] ; 
    538538        } 
    539539 
    540540        oEditor.FCKUndo.SaveUndoStep() ; 
    541541 
    542         oLink.href = sUri ; 
    543         SetAttribute( oLink, '_fcksavedurl', sUri ) ; 
    544  
    545         // Accesible popups 
    546         if( GetE('cmbTarget').value == 'popup' ) 
    547         { 
    548                 SetAttribute( oLink, 'onclick_fckprotectedatt', " onclick=\"" + BuildOnClickPopup() + "\"") ; 
    549         } 
    550         else 
    551         { 
    552                 // Check if the previous onclick was for a popup: 
    553                 // In that case remove the onclick handler. 
    554                 var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ; 
    555                 if( oRegex.OnClickPopup.test( onclick ) ) 
    556                         SetAttribute( oLink, 'onclick_fckprotectedatt', '' ) ; 
    557         } 
    558  
    559         oLink.innerHTML = sInnerHtml ;          // Set (or restore) the innerHTML 
    560  
    561         // Target 
    562         if( GetE('cmbTarget').value != 'popup' ) 
    563                 SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ; 
    564         else 
    565                 SetAttribute( oLink, 'target', null ) ; 
    566  
    567         // Advances Attributes 
    568         SetAttribute( oLink, 'id'               , GetE('txtAttId').value ) ; 
    569         SetAttribute( oLink, 'name'             , GetE('txtAttName').value ) ; 
    570         SetAttribute( oLink, 'dir'              , GetE('cmbAttLangDir').value ) ; 
    571         SetAttribute( oLink, 'lang'             , GetE('txtAttLangCode').value ) ; 
    572         SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ; 
    573         SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ; 
    574         SetAttribute( oLink, 'title'    , GetE('txtAttTitle').value ) ; 
    575         SetAttribute( oLink, 'type'             , GetE('txtAttContentType').value ) ; 
    576         SetAttribute( oLink, 'charset'  , GetE('txtAttCharSet').value ) ; 
    577  
    578         if ( oEditor.FCKBrowserInfo.IsIE ) 
    579         { 
    580                 var sClass = GetE('txtAttClasses').value ; 
    581                 // If it's also an anchor add an internal class 
    582                 if ( GetE('txtAttName').value.length != 0 ) 
    583                         sClass += ' FCK__AnchorC' ; 
    584                 SetAttribute( oLink, 'className', sClass ) ; 
    585  
    586                 oLink.style.cssText = GetE('txtAttStyle').value ; 
    587         } 
    588         else 
    589         { 
    590                 SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ; 
    591                 SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ; 
    592         } 
    593  
    594         // Select the link. 
    595         oEditor.FCKSelection.SelectNode(oLink); 
     542        for ( var i = 0 ; i < aLinks.length ; i++ ) 
     543        { 
     544                oLink = aLinks[i] ; 
     545 
     546                if ( aHasSelection ) 
     547                        sInnerHtml = oLink.innerHTML ;          // Save the innerHTML (IE changes it if it is like an URL). 
     548 
     549                oLink.href = sUri ; 
     550                SetAttribute( oLink, '_fcksavedurl', sUri ) ; 
     551 
     552                // Accesible popups 
     553                if( GetE('cmbTarget').value == 'popup' ) 
     554                { 
     555                        SetAttribute( oLink, 'onclick_fckprotectedatt', " onclick=\"" + BuildOnClickPopup() + "\"") ; 
     556                } 
     557                else 
     558                { 
     559                        // Check if the previous onclick was for a popup: 
     560                        // In that case remove the onclick handler. 
     561                        var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ; 
     562                        if( oRegex.OnClickPopup.test( onclick ) ) 
     563                                SetAttribute( oLink, 'onclick_fckprotectedatt', '' ) ; 
     564                } 
     565 
     566                oLink.innerHTML = sInnerHtml ;          // Set (or restore) the innerHTML 
     567 
     568                // Target 
     569                if( GetE('cmbTarget').value != 'popup' ) 
     570                        SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ; 
     571                else 
     572                        SetAttribute( oLink, 'target', null ) ; 
     573 
     574                // Let's set the "id" only for the first link to avoid duplication. 
     575                if ( i == 0 ) 
     576                        SetAttribute( oLink, 'id', GetE('txtAttId').value ) ; 
     577 
     578                // Advances Attributes 
     579                SetAttribute( oLink, 'name'             , GetE('txtAttName').value ) ; 
     580                SetAttribute( oLink, 'dir'              , GetE('cmbAttLangDir').value ) ; 
     581                SetAttribute( oLink, 'lang'             , GetE('txtAttLangCode').value ) ; 
     582                SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ; 
     583                SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ; 
     584                SetAttribute( oLink, 'title'    , GetE('txtAttTitle').value ) ; 
     585                SetAttribute( oLink, 'type'             , GetE('txtAttContentType').value ) ; 
     586                SetAttribute( oLink, 'charset'  , GetE('txtAttCharSet').value ) ; 
     587 
     588                if ( oEditor.FCKBrowserInfo.IsIE ) 
     589                { 
     590                        var sClass = GetE('txtAttClasses').value ; 
     591                        // If it's also an anchor add an internal class 
     592                        if ( GetE('txtAttName').value.length != 0 ) 
     593                                sClass += ' FCK__AnchorC' ; 
     594                        SetAttribute( oLink, 'className', sClass ) ; 
     595 
     596                        oLink.style.cssText = GetE('txtAttStyle').value ; 
     597                } 
     598                else 
     599                { 
     600                        SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ; 
     601                        SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ; 
     602                } 
     603        } 
     604 
     605        // Select the (first) link. 
     606        oEditor.FCKSelection.SelectNode( aLinks[0] ); 
    596607 
    597608        return true ; 
     
    663674        return true ; 
    664675} 
     676 
     677function SetDefaultTarget() 
     678{ 
     679        var target = FCKConfig.DefaultLinkTarget + '' ; 
     680         
     681        if ( oLink || target.length == 0 ) 
     682                return ; 
     683 
     684        switch ( target ) 
     685        { 
     686                case '_blank' : 
     687                case '_self' : 
     688                case '_parent' : 
     689                case '_top' : 
     690                        GetE('cmbTarget').value = target ; 
     691                        break ; 
     692                default : 
     693                        GetE('cmbTarget').value = 'frame' ; 
     694                        break ; 
     695        } 
     696         
     697        GetE('txtTargetFrame').value = target ; 
     698} 
  • FCKeditor/releases/stable/editor/dialog/fck_listprop.html

    r242 r381  
    6161        { 
    6262                if ( oActiveEl.getAttribute('type') ) 
    63                         oActiveSel.value = oActiveEl.getAttribute('type').toLowerCase() ; 
     63                        oActiveSel.value = oActiveEl.getAttribute('type') ; 
    6464        } 
    6565 
  • FCKeditor/releases/stable/editor/dialog/fck_paste.html

    r242 r381  
    203203 
    204204                // Word likes to insert extra <font> tags, when using MSIE. (Wierd). 
    205                 html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2</$1>' ); 
    206                 html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2</$1>' ); 
     205                html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' ); 
     206                html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' ); 
    207207        } 
    208208        else 
  • FCKeditor/releases/stable/editor/dialog/fck_select/fck_select.js

    r231 r381  
    6262        var oTxtValue   = document.getElementById( "txtValue" ) ; 
    6363 
    64         oListText.options[ iIndex ].innerHTML   = oTxtText.value ; 
     64        oListText.options[ iIndex ].innerHTML   = HTMLEncode( oTxtText.value ) ; 
    6565        oListText.options[ iIndex ].value               = oTxtText.value ; 
    6666 
    67         oListValue.options[ iIndex ].innerHTML  = oTxtValue.value ; 
     67        oListValue.options[ iIndex ].innerHTML  = HTMLEncode( oTxtValue.value ) ; 
    6868        oListValue.options[ iIndex ].value              = oTxtValue.value ; 
    6969 
     
    116116 
    117117        var oOption = combo.options[ iActualIndex ] ; 
    118         var sText       = oOption.innerHTML ; 
     118        var sText       = HTMLDecode( oOption.innerHTML ) ; 
    119119        var sValue      = oOption.value ; 
    120120 
     
    163163                combo.options.add( oOption ) ; 
    164164 
    165         oOption.innerHTML = optionText.length > 0 ? optionText : '&nbsp;' ; 
     165        oOption.innerHTML = optionText.length > 0 ? HTMLEncode( optionText ) : '&nbsp;' ; 
    166166        oOption.value     = optionValue ; 
    167167