Ticket #6641: 6641_2.patch

File 6641_2.patch, 2.5 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/styles/plugin.js

     
    12041204                if ( element )
    12051205                        element.copyAttributes( el );
    12061206
    1207                 return setupElement( el, style );
     1207                el = setupElement( el, style );
     1208
     1209                // Avoid ID duplication.
     1210                if ( targetDocument.getCustomData( 'doc_processing_style' ) && el.hasAttribute( 'id' ) )
     1211                        el.removeAttribute( 'id' );
     1212                else
     1213                        targetDocument.setCustomData( 'doc_processing_style', 1 );
     1214
     1215                return el;
    12081216        }
    12091217
    12101218        function setupElement( el, style )
     
    14381446                }
    14391447                else
    14401448                        selection.selectBookmarks( bookmarks );
     1449
     1450                document.removeCustomData( 'doc_processing_style' );
    14411451        }
    14421452})();
    14431453
  • _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' );
     
    13121311                                        selection.selectRanges( ranges );
    13131312                                }
    13141313
     1314                                // Browser need the "href" fro copy/paste link to work. (#6641)
     1315                                attributes.href = attributes[ 'data-cke-saved-href' ];
     1316
    13151317                                // Apply style.
    13161318                                var style = new CKEDITOR.style( { element : 'a', attributes : attributes } );
    13171319                                style.type = CKEDITOR.STYLE_INLINE;             // need to override... dunno why.
    13181320                                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                                 }
    1333                         }
     1321                        }
    13341322                        else
    13351323                        {
    13361324                                // We're only editing an existing link, so just overwrite the attributes.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy