*/\r
render : function( editor, output )\r
{\r
- var env = CKEDITOR.env;\r
+ var env = CKEDITOR.env,\r
+ id = this._.id = 'cke_' + CKEDITOR.tools.getNextNumber(),\r
+ classes = '',\r
+ command = this.command, // Get the command name.\r
+ clickFn,\r
+ index;\r
\r
- var id = this._.id = 'cke_' + CKEDITOR.tools.getNextNumber();\r
this._.editor = editor;\r
\r
var instance =\r
}\r
};\r
\r
- var clickFn = CKEDITOR.tools.addFunction( instance.execute, instance );\r
+ instance.clickFn = clickFn = CKEDITOR.tools.addFunction( instance.execute, instance );\r
\r
- var index = CKEDITOR.ui.button._.instances.push( instance ) - 1;\r
-\r
- var classes = '';\r
-\r
- // Get the command name.\r
- var command = this.command;\r
+ instance.index = index = CKEDITOR.ui.button._.instances.push( instance ) - 1;\r
\r
if ( this.modes )\r
{\r
output.push(\r
'<span class="cke_button">',\r
'<a id="', id, '"' +\r
- ' class="', classes, '" href="javascript:void(\'', ( this.title || '' ).replace( "'", '' ), '\')"' +\r
+ ' class="', classes, '"',\r
+ env.gecko && env.version >= 10900 && !env.hc ? '' : '" href="javascript:void(\''+ ( this.title || '' ).replace( "'", '' )+ '\')"',\r
' title="', this.title, '"' +\r
' tabindex="-1"' +\r
- ' hidefocus="true"' );\r
+ ' hidefocus="true"' +\r
+ ' role="button"' +\r
+ ' aria-labelledby="' + id + '_label"' +\r
+ ( this.hasArrow ? ' aria-haspopup="true"' : '' ) );\r
\r
// Some browsers don't cancel key events in the keydown but in the\r
// keypress.\r
}\r
\r
output.push(\r
- '></span>' +\r
- '<span class="cke_label">', this.label, '</span>' );\r
+ '> </span>' +\r
+ '<span id="', id, '_label" class="cke_label">', this.label, '</span>' );\r
\r
if ( this.hasArrow )\r
{\r
output.push(\r
- '<span class="cke_buttonarrow"></span>' );\r
+ '<span class="cke_buttonarrow">'\r
+ // BLACK DOWN-POINTING TRIANGLE\r
+ + ( CKEDITOR.env.hc ? '▼' : ' ' )\r
+ + '</span>' );\r
}\r
\r
output.push(\r
setState : function( state )\r
{\r
if ( this._.state == state )\r
- return;\r
+ return false;\r
+\r
+ this._.state = state;\r
\r
var element = CKEDITOR.document.getById( this._.id );\r
\r
if ( element )\r
{\r
element.setState( state );\r
+ state == CKEDITOR.TRISTATE_DISABLED ?\r
+ element.setAttribute( 'aria-disabled', true ) :\r
+ element.removeAttribute( 'aria-disabled' );\r
\r
- var htmlTitle = this.title,\r
- unavailable = this._.editor.lang.common.unavailable,\r
- labelElement = element.getChild( 1 );\r
-\r
- if ( state == CKEDITOR.TRISTATE_DISABLED )\r
- htmlTitle = unavailable.replace( '%1', this.title );\r
+ state == CKEDITOR.TRISTATE_ON ?\r
+ element.setAttribute( 'aria-pressed', true ) :\r
+ element.removeAttribute( 'aria-pressed' );\r
\r
- labelElement.setHtml( htmlTitle );\r
+ return true;\r
}\r
-\r
- this._.state = state;\r
+ else\r
+ return false;\r
}\r
};\r
\r
{\r
this.add( name, CKEDITOR.UI_BUTTON, definition );\r
};\r
+\r
+CKEDITOR.on( 'reset', function()\r
+ {\r
+ CKEDITOR.ui.button._.instances = [];\r
+ });\r