Ticket #8527: 8527.patch
File 8527.patch, 2.8 KB (added by , 12 years ago) |
---|
-
_source/plugins/link/plugin.js
38 38 'border:1px dotted #00f;'; 39 39 40 40 editor.addCss( 41 'a.cke_anchor ,a.cke_anchor_empty' +41 'a.cke_anchor' + 42 42 // IE6 breaks with the following selectors. 43 43 ( ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) ? '' : 44 44 ',a[name],a[data-cke-saved-name]' ) + … … 48 48 // Show the arrow cursor for the anchor image (FF at least). 49 49 'cursor:auto;' + 50 50 '}' + 51 ( CKEDITOR.env.ie ? (52 'a.cke_anchor_empty' +53 '{' +54 // Make empty anchor selectable on IE.55 'display:inline-block;' +56 '}'57 ) : '' ) +58 51 'img.cke_anchor' + 59 52 '{' + 60 53 basicCss + … … 188 181 189 182 var isEmpty = !element.children.length; 190 183 191 if ( CKEDITOR.plugins.link.synAnchorSelector ) 192 { 193 // IE needs a specific class name to be applied 194 // to the anchors, for appropriate styling. 195 var ieClass = isEmpty ? 'cke_anchor_empty' : 'cke_anchor'; 196 var cls = attributes[ 'class' ]; 197 if ( attributes.name && ( !cls || cls.indexOf( ieClass ) < 0 ) ) 198 attributes[ 'class' ] = ( cls || '' ) + ' ' + ieClass; 199 200 if ( isEmpty && CKEDITOR.plugins.link.emptyAnchorFix ) 201 { 202 attributes.contenteditable = 'false'; 203 attributes[ 'data-cke-editable' ] = 1; 204 } 205 } 206 else if ( CKEDITOR.plugins.link.fakeAnchor && isEmpty ) 184 if ( CKEDITOR.plugins.link.fakeAnchor && isEmpty ) 207 185 return editor.createFakeParserElement( element, 'cke_anchor', 'anchor' ); 208 186 209 187 return null; … … 212 190 }); 213 191 } 214 192 215 if ( CKEDITOR.plugins.link.emptyAnchorFix && htmlFilter )216 {217 htmlFilter.addRules(218 {219 elements :220 {221 a : function( element )222 {223 delete element.attributes.contenteditable;224 }225 }226 });227 }228 229 193 if ( pathFilters ) 230 194 { 231 195 pathFilters.push( function( element, name ) … … 284 248 285 249 // Opera and WebKit don't make it possible to select empty anchors. Fake 286 250 // elements must be used for them. 287 fakeAnchor : CKEDITOR.env.opera || CKEDITOR.env.webkit,251 fakeAnchor : !CKEDITOR.env.gecko, 288 252 289 // For browsers that don't support CSS3 a[name]:empty(), note IE9 is included because of #7783.290 synAnchorSelector : CKEDITOR.env.ie,291 292 // For browsers that have editing issue with empty anchor.293 emptyAnchorFix : CKEDITOR.env.ie && CKEDITOR.env.version < 8,294 295 253 tryRestoreFakeAnchor : function( editor, element ) 296 254 { 297 255 if ( element && element.data( 'cke-real-element-type' ) && element.data( 'cke-real-element-type' ) == 'anchor' )