Ticket #6641: 6641_3.patch

File 6641_3.patch, 3.3 KB (added by Sa'ar Zac Elias, 13 years ago)
  • _source/plugins/image/dialogs/image.js

     
    11021102                                                                {
    11031103                                                                        if ( this.getValue() || this.isChanged() )
    11041104                                                                        {
    1105                                                                                 element.data( 'cke-saved-href', decodeURI( this.getValue() ) );
    1106                                                                                 element.setAttribute( 'href', 'javascript:void(0)/*' +
    1107                                                                                         CKEDITOR.tools.getNextNumber() + '*/' );
     1105                                                                                var url = decodeURI( this.getValue() );
     1106                                                                                element.data( 'cke-saved-href', url );
     1107                                                                                element.setAttribute( 'href', url );
    11081108
    11091109                                                                                if ( this.getValue() || !editor.config.image_removeLinkByEmptyURL )
    11101110                                                                                        this.getDialog().addLink = true;
  • _source/plugins/link/dialogs/link.js

     
    11611161                },
    11621162                onOk : function()
    11631163                {
    1164                         var attributes = { href : 'javascript:void(0)/*' + CKEDITOR.tools.getNextNumber() + '*/' },
     1164                        var attributes = {},
    11651165                                removeAttributes = [],
    1166                                 data = { href : attributes.href },
     1166                                data = {},
    11671167                                me = this,
    11681168                                editor = this.getParentEditor();
    11691169
     
    12831283                                                removeAttributes.push( attrName );
    12841284                                };
    12851285
    1286                                 if ( this._.selectedElement )
    1287                                         advAttr( 'advId', 'id' );
     1286                                advAttr( 'advId', 'id' );
    12881287                                advAttr( 'advLangDir', 'dir' );
    12891288                                advAttr( 'advAccessKey', 'accessKey' );
    12901289                                advAttr( 'advName', 'name' );
     
    12971296                                advAttr( 'advStyles', 'style' );
    12981297                        }
    12991298
     1299
     1300                        // Browser need the "href" fro copy/paste link to work. (#6641)
     1301                        attributes.href = attributes[ 'data-cke-saved-href' ];
     1302
    13001303                        if ( !this._.selectedElement )
    13011304                        {
    13021305                                // Create element if current selection is collapsed.
     
    13161319                                var style = new CKEDITOR.style( { element : 'a', attributes : attributes } );
    13171320                                style.type = CKEDITOR.STYLE_INLINE;             // need to override... dunno why.
    13181321                                style.apply( editor.document );
    1319 
    1320                                 // Id. Apply only to the first link.
    1321                                 if ( data.adv && data.adv.advId )
    1322                                 {
    1323                                         var links = this.getParentEditor().document.$.getElementsByTagName( 'a' );
    1324                                         for ( i = 0 ; i < links.length ; i++ )
    1325                                         {
    1326                                                 if ( links[i].href == attributes.href )
    1327                                                 {
    1328                                                         links[i].id = data.adv.advId;
    1329                                                         break;
    1330                                                 }
    1331                                         }
    1332                                 }
    13331322                        }
    13341323                        else
    13351324                        {
  • _source/plugins/styles/plugin.js

     
    12021202                if ( element )
    12031203                        element.copyAttributes( el );
    12041204
    1205                 return setupElement( el, style );
     1205                el = setupElement( el, style );
     1206
     1207                // Avoid ID duplication.
     1208                if ( targetDocument.getCustomData( 'doc_processing_style' ) && el.hasAttribute( 'id' ) )
     1209                        el.removeAttribute( 'id' );
     1210                else
     1211                        targetDocument.setCustomData( 'doc_processing_style', 1 );
     1212
     1213                return el;
    12061214        }
    12071215
    12081216        function setupElement( el, style )
     
    14301438                }
    14311439
    14321440                selection.selectRanges( ranges );
     1441
     1442                document.removeCustomData( 'doc_processing_style' );
    14331443        }
    14341444})();
    14351445
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy