Ticket #6641: 6641_2.patch
File 6641_2.patch, 2.5 KB (added by , 13 years ago) |
---|
-
_source/plugins/styles/plugin.js
1204 1204 if ( element ) 1205 1205 element.copyAttributes( el ); 1206 1206 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; 1208 1216 } 1209 1217 1210 1218 function setupElement( el, style ) … … 1438 1446 } 1439 1447 else 1440 1448 selection.selectBookmarks( bookmarks ); 1449 1450 document.removeCustomData( 'doc_processing_style' ); 1441 1451 } 1442 1452 })(); 1443 1453 -
_source/plugins/link/dialogs/link.js
1161 1161 }, 1162 1162 onOk : function() 1163 1163 { 1164 var attributes = { href : 'javascript:void(0)/*' + CKEDITOR.tools.getNextNumber() + '*/'},1164 var attributes = {}, 1165 1165 removeAttributes = [], 1166 data = { href : attributes.href},1166 data = {}, 1167 1167 me = this, 1168 1168 editor = this.getParentEditor(); 1169 1169 … … 1283 1283 removeAttributes.push( attrName ); 1284 1284 }; 1285 1285 1286 if ( this._.selectedElement ) 1287 advAttr( 'advId', 'id' ); 1286 advAttr( 'advId', 'id' ); 1288 1287 advAttr( 'advLangDir', 'dir' ); 1289 1288 advAttr( 'advAccessKey', 'accessKey' ); 1290 1289 advAttr( 'advName', 'name' ); … … 1312 1311 selection.selectRanges( ranges ); 1313 1312 } 1314 1313 1314 // Browser need the "href" fro copy/paste link to work. (#6641) 1315 attributes.href = attributes[ 'data-cke-saved-href' ]; 1316 1315 1317 // Apply style. 1316 1318 var style = new CKEDITOR.style( { element : 'a', attributes : attributes } ); 1317 1319 style.type = CKEDITOR.STYLE_INLINE; // need to override... dunno why. 1318 1320 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 } 1334 1322 else 1335 1323 { 1336 1324 // We're only editing an existing link, so just overwrite the attributes.