Changeset 4908
- Timestamp:
- 01/08/10 17:06:44 (3 years ago)
- Location:
- CKEditor/branches/features/aria/_source
- Files:
-
- 3 edited
-
lang/en.js (modified) (1 diff)
-
plugins/contextmenu/plugin.js (modified) (2 diffs)
-
plugins/menu/plugin.js (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/features/aria/_source/lang/en.js
r4903 r4908 556 556 }, 557 557 558 contextMenu : 559 { 560 panelTitle : 'context menu options', 561 panelVoiceLabel: '' 562 }, 563 558 564 div : 559 565 { -
CKEditor/branches/features/aria/_source/plugins/contextmenu/plugin.js
r4858 r4908 36 36 }, 37 37 this); 38 39 this._.definiton = 40 { 41 panel: 42 { 43 className : editor.skinClass + ' cke_contextmenu', 44 aria : 45 { 46 'aria-label' : editor.lang.contextMenu.panelTitle, 47 'aria-describedby' : editor.lang.contextMenu.panelVoiceLabel 48 } 49 } 50 }; 38 51 }, 39 52 … … 52 65 else 53 66 { 54 menu = this._.menu = new CKEDITOR.menu( editor );67 menu = this._.menu = new CKEDITOR.menu( editor, this._.definiton ); 55 68 menu.onClick = CKEDITOR.tools.bind( function( item ) 56 69 { -
CKEditor/branches/features/aria/_source/plugins/menu/plugin.js
r4903 r4908 52 52 CKEDITOR.menu = CKEDITOR.tools.createClass( 53 53 { 54 $ : function( editor, level ) 55 { 54 $ : function( editor, definition ) 55 { 56 definition = this._.definition = definition || {}; 56 57 this.id = 'cke_' + CKEDITOR.tools.getNextNumber(); 57 58 … … 59 60 this.items = []; 60 61 61 this._.level = level || 1; 62 this._.level = definition.level || 1; 63 64 var panelDefinition = CKEDITOR.tools.extend( {}, definition.panel, 65 { 66 css : editor.skin.editor.css, 67 level : this._.level - 1, 68 block : {} 69 } ); 70 71 var aria = panelDefinition.block.aria = ( panelDefinition.aria || {} ); 72 // Provide default role of 'menu'. 73 !aria.role && ( aria.role = 'menu' ); 74 this._.panelDefinition = panelDefinition; 62 75 }, 63 76 … … 84 97 else 85 98 { 86 menu = this._.subMenu = new CKEDITOR.menu( this.editor, this._.level + 1 ); 99 menu = this._.subMenu = new CKEDITOR.menu( this.editor, 100 CKEDITOR.tools.extend( {}, this._.definition, { level : this._.level + 1 }, true ) ); 87 101 menu.parent = this; 88 102 menu.onClick = CKEDITOR.tools.bind( this.onClick, this ); … … 136 150 if ( !panel ) 137 151 { 138 panel = this._.panel = new CKEDITOR.ui.floatPanel( this.editor, CKEDITOR.document.getBody(), 139 { 140 css : editor.skin.editor.css, 141 level : this._.level - 1, 142 className : editor.skinClass + ' cke_contextmenu' 143 }, 144 this._.level); 152 panel = this._.panel = new CKEDITOR.ui.floatPanel( this.editor, 153 CKEDITOR.document.getBody(), 154 this._.panelDefinition, 155 this._.level ); 145 156 146 157 panel.onEscape = CKEDITOR.tools.bind( function() … … 158 169 159 170 // Create an autosize block inside the panel. 160 var block = panel.addBlock( this.id );171 var block = panel.addBlock( this.id, this._.panelDefinition.block ); 161 172 block.autoSize = true; 162 173 … … 300 311 classes += ' ' + this.className; 301 312 313 var hasSubMenu = this.getItems; 314 302 315 output.push( 303 316 '<span class="cke_menuitem">' + … … 307 320 ' tabindex="-1"' + 308 321 '_cke_focus=1' + 309 ' hidefocus="true"' ); 322 ' hidefocus="true"' + 323 ' role="menuitem"' + 324 ( hasSubMenu ? 'aria-haspopup="true"' : '' ) + 325 ( state == CKEDITOR.TRISTATE_DISABLED ? 'aria-disabled="true"' : '' ) + 326 ( state == CKEDITOR.TRISTATE_ON ? 'aria-pressed="true"' : '' ) ); 310 327 311 328 // Some browsers don't cancel key events in the keydown but in the … … 339 356 '<span class="cke_label">' ); 340 357 341 if ( this.getItems)358 if ( hasSubMenu ) 342 359 { 343 360 output.push(
Note: See TracChangeset
for help on using the changeset viewer.
