{\r
$ : function( editor )\r
{\r
- this.id = 'cke_' + CKEDITOR.tools.getNextNumber();\r
+ this.id = CKEDITOR.tools.getNextId();\r
this.editor = editor;\r
this._.listeners = [];\r
this._.functionId = CKEDITOR.tools.addFunction( function( commandName )\r
{\r
addTarget : function( element, nativeContextMenuOnCtrl )\r
{\r
- // Opera doesn't support 'contextmenu' event, we have duo approaches employed here:\r
- // 1. Inherit the 'button override' hack we introduced in v2 (#4530), while this require the Opera browser\r
- // option 'Allow script to detect context menu/right click events' to be always turned on.\r
+\r
+ // For browsers (Opera <=10a) that doesn't support 'contextmenu' event, we have duo approaches employed here:\r
+ // 1. Inherit the 'button override' hack we introduced in v2 (#4530) (In Opera browser, this require the\r
+ // option 'Allow script to detect context menu/right click events' to be always turned on).\r
// 2. Considering the fact that ctrl/meta key is not been occupied\r
// for multiple range selecting (like Gecko), we use this key\r
// combination as a fallback for triggering context-menu. (#4530)\r
- if ( CKEDITOR.env.opera )\r
+ if ( CKEDITOR.env.opera && !( 'oncontextmenu' in document.body ) )\r
{\r
var contextMenuOverrideButton;\r
element.on( 'mousedown', function( evt )\r
},\r
this );\r
\r
+ if ( CKEDITOR.env.opera )\r
+ {\r
+ // 'contextmenu' event triggered by Windows menu key is unpreventable,\r
+ // cancel the key event itself. (#6534)\r
+ element.on( 'keypress' , function ( evt )\r
+ {\r
+ var domEvent = evt.data;\r
+\r
+ if ( domEvent.$.keyCode === 0 )\r
+ domEvent.preventDefault();\r
+ });\r
+ }\r
+\r
if ( CKEDITOR.env.webkit )\r
{\r
var holdCtrlKey,\r