Ticket #3085: 3085_3.patch
File 3085_3.patch, 5.3 KB (added by , 15 years ago) |
---|
-
_source/plugins/contextmenu/plugin.js
1 /*1 /* 2 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 10 10 beforeInit : function( editor ) 11 11 { 12 12 editor.contextMenu = new CKEDITOR.plugins.contextMenu( editor ); 13 14 editor.addCommand( 'contextMenu', 15 { 16 exec : function() 17 { 18 editor.contextMenu.show(); 19 } 20 }); 13 21 } 14 22 }); 15 23 … … 31 39 32 40 _ : 33 41 { 34 onMenu : function( domEvent)42 onMenu : function( offsetParent, offsetX, offsetY ) 35 43 { 36 // Cancel the browser context menu.37 domEvent.preventDefault();38 39 44 var menu = this._.menu, 40 45 editor = this.editor; 41 46 … … 57 62 else if ( item.command ) 58 63 editor.execCommand( item.command ); 59 64 }; 65 66 menu.onEscape = function() 67 { 68 editor.focus(); 69 }; 60 70 } 61 71 62 72 var listeners = this._.listeners, … … 85 95 } 86 96 } 87 97 88 menu.show( domEvent.getTarget().getDocument().getDocumentElement(), 1, domEvent.$.clientX, domEvent.$.clientY );98 menu.show( offsetParent, 1, offsetX, offsetY ); 89 99 } 90 100 }, 91 101 … … 95 105 { 96 106 element.on( 'contextmenu', function( event ) 97 107 { 98 return this._.onMenu( event.data ); 108 var domEvent = event.data; 109 110 // Cancel the browser context menu. 111 domEvent.preventDefault(); 112 113 var offsetParent = domEvent.getTarget().getDocument().getDocumentElement(); 114 offsetX = domEvent.$.clientX, 115 offsetY = domEvent.$.clientY; 116 117 CKEDITOR.tools.setTimeout( function() 118 { 119 this.editor.focus(); 120 this._.onMenu( offsetParent, offsetX, offsetY ); 121 }, 122 0, this ); 99 123 }, 100 124 this ); 101 125 }, … … 103 127 addListener : function( listenerFn ) 104 128 { 105 129 this._.listeners.push( listenerFn ); 130 }, 131 132 show : function() 133 { 134 this.editor.focus(); 135 this._.onMenu( CKEDITOR.document.getDocumentElement(), 0, 0 ); 106 136 } 107 137 } 108 138 }); -
_source/plugins/keystrokes/plugin.js
172 172 [ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ], 173 173 [ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ], 174 174 175 [ CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' ], 176 175 177 [ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ], 176 178 [ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ], 177 179 [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ], -
_source/plugins/menu/plugin.js
1 /*1 /* 2 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 125 125 }, 126 126 this._.level); 127 127 128 panel.onEscape = CKEDITOR.tools.bind( function() 129 { 130 this.hide(); 131 this.onEscape && this.onEscape(); 132 }, 133 this ); 134 128 135 // Create an autosize block inside the panel. 129 136 var block = panel.addBlock( this.id ); 130 137 block.autoSize = true; 131 138 139 var keys = block.keys; 140 keys[ 40 ] = 'next'; // ARROW-DOWN 141 keys[ 9 ] = 'next'; // TAB 142 keys[ 38 ] = 'prev'; // ARROW-UP 143 keys[ CKEDITOR.SHIFT + 9 ] = 'prev'; // SHIFT + TAB 144 keys[ 32 ] = 'click'; // SPACE 145 keys[ 39 ] = 'click'; // ARROW-RIGHT 146 132 147 element = this._.element = block.element; 133 148 element.addClass( editor.skinClass ); 134 149 element.getDocument().getBody().setStyle( 'overflow', 'hidden' ); … … 253 268 ' class="', classes, '" href="javascript:void(\'', ( this.label || '' ).replace( "'", '' ), '\')"' + 254 269 ' title="', this.label, '"' + 255 270 ' tabindex="-1"' + 271 '_cke_focus=1' + 256 272 ' hidefocus="true"' ); 257 273 258 274 // Some browsers don't cancel key events in the keydown but in the -
_source/skins/default/menu.css
14 14 } 15 15 16 16 .cke_skin_default .cke_menuitem a:hover, 17 .cke_skin_default .cke_menuitem a:focus 17 .cke_skin_default .cke_menuitem a:focus, 18 .cke_skin_default .cke_menuitem a:active 18 19 { 19 20 background-color: #8f8f73; 20 21 display:block; … … 41 42 } 42 43 43 44 .cke_skin_default .cke_menuitem a:hover .cke_icon, 44 .cke_skin_default .cke_menuitem a:focus .cke_icon 45 .cke_skin_default .cke_menuitem a:focus .cke_icon, 46 .cke_skin_default .cke_menuitem a:active .cke_icon 45 47 { 46 48 background-color: #737357; 47 49 border: solid 4px #737357; … … 60 62 } 61 63 62 64 .cke_skin_default .cke_menuitem a:hover .cke_label, 63 .cke_skin_default .cke_menuitem a:focus .cke_label 65 .cke_skin_default .cke_menuitem a:focus .cke_label, 66 .cke_skin_default .cke_menuitem a:active .cke_label 64 67 { 65 68 color: #fff; 66 69 background-color: #8f8f73;