Ticket #7911: 7911_2.patch
File 7911_2.patch, 2.6 KB (added by , 13 years ago) |
---|
-
_source/lang/en.js
201 201 menu : 'Edit Anchor', 202 202 title : 'Anchor Properties', 203 203 name : 'Anchor Name', 204 errorName : 'Please type the anchor name' 204 errorName : 'Please type the anchor name', 205 remove : 'Remove Anchor' 205 206 }, 206 207 207 208 // List style dialog -
_source/plugins/link/plugin.js
11 11 editor.addCommand( 'link', new CKEDITOR.dialogCommand( 'link' ) ); 12 12 editor.addCommand( 'anchor', new CKEDITOR.dialogCommand( 'anchor' ) ); 13 13 editor.addCommand( 'unlink', new CKEDITOR.unlinkCommand() ); 14 editor.addCommand( 'removeAnchor', new CKEDITOR.removeAnchorCommand() ); 14 15 editor.ui.addButton( 'Link', 15 16 { 16 17 label : editor.lang.link.toolbar, … … 108 109 { 109 110 label : editor.lang.anchor.menu, 110 111 command : 'anchor', 111 group : 'anchor' 112 group : 'anchor', 113 order : 1 112 114 }, 113 115 116 removeAnchor : 117 { 118 label : editor.lang.anchor.remove, 119 command : 'removeAnchor', 120 group : 'anchor', 121 order : 5 122 }, 123 114 124 link : 115 125 { 116 126 label : editor.lang.link.menu, … … 148 158 menu = { link : CKEDITOR.TRISTATE_OFF, unlink : CKEDITOR.TRISTATE_OFF }; 149 159 150 160 if ( anchor && anchor.hasAttribute( 'name' ) ) 151 menu.anchor = CKEDITOR.TRISTATE_OFF;161 menu.anchor = menu.removeAnchor = CKEDITOR.TRISTATE_OFF; 152 162 153 163 return menu; 154 164 }); … … 329 339 startDisabled : true 330 340 }; 331 341 342 CKEDITOR.removeAnchorCommand = function(){}; 343 CKEDITOR.removeAnchorCommand.prototype = 344 { 345 /** @ignore */ 346 exec : function( editor ) 347 { 348 var sel = editor.getSelection(), 349 bms = sel.createBookmarks(), 350 anchor; 351 if ( sel && ( anchor = sel.getSelectedElement() ) && ( CKEDITOR.plugins.link.fakeAnchor && !anchor.getChildCount() ? CKEDITOR.plugins.link.tryRestoreFakeAnchor( editor, anchor ) : anchor.is( 'a' ) ) ) 352 anchor.remove( 1 ); 353 else 354 { 355 if ( ( anchor = CKEDITOR.plugins.link.getSelectedLink( editor ) ) ) 356 { 357 if ( anchor.hasAttribute( 'href' ) ) 358 { 359 anchor.removeAttributes( { name : 1, 'data-cke-saved-name' : 1 } ); 360 anchor.removeClass( 'cke_anchor' ); 361 } 362 else 363 anchor.remove( 1 ); 364 } 365 } 366 sel.selectBookmarks( bms ); 367 } 368 }; 369 332 370 CKEDITOR.tools.extend( CKEDITOR.config, 333 371 { 334 372 linkShowAdvancedTab : true,