Ticket #6641: 6641_3.patch
File 6641_3.patch, 3.3 KB (added by , 13 years ago) |
---|
-
_source/plugins/image/dialogs/image.js
1102 1102 { 1103 1103 if ( this.getValue() || this.isChanged() ) 1104 1104 { 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 ); 1108 1108 1109 1109 if ( this.getValue() || !editor.config.image_removeLinkByEmptyURL ) 1110 1110 this.getDialog().addLink = true; -
_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' ); … … 1297 1296 advAttr( 'advStyles', 'style' ); 1298 1297 } 1299 1298 1299 1300 // Browser need the "href" fro copy/paste link to work. (#6641) 1301 attributes.href = attributes[ 'data-cke-saved-href' ]; 1302 1300 1303 if ( !this._.selectedElement ) 1301 1304 { 1302 1305 // Create element if current selection is collapsed. … … 1316 1319 var style = new CKEDITOR.style( { element : 'a', attributes : attributes } ); 1317 1320 style.type = CKEDITOR.STYLE_INLINE; // need to override... dunno why. 1318 1321 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 1322 } 1334 1323 else 1335 1324 { -
_source/plugins/styles/plugin.js
1202 1202 if ( element ) 1203 1203 element.copyAttributes( el ); 1204 1204 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; 1206 1214 } 1207 1215 1208 1216 function setupElement( el, style ) … … 1430 1438 } 1431 1439 1432 1440 selection.selectRanges( ranges ); 1441 1442 document.removeCustomData( 'doc_processing_style' ); 1433 1443 } 1434 1444 })(); 1435 1445