Permalink
Browse files

MDL-30899 moodle-core-notification Adding ARIA attributes

  • Loading branch information...
dmonllao committed Sep 21, 2012
1 parent 520a601 commit b4454b133fa9be7c22c8292e1a5adc39708da012
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/yui/notification/notification.js
@@ -29,7 +29,7 @@ var DIALOGUE = function(config) {
var id = 'moodle-dialogue-'+COUNT;
config.notificationBase =
C('<div class="'+CSS.BASE+'">')
- .append(C('<div id="'+id+'" class="'+CSS.WRAP+'"></div>')
+ .append(C('<div id="'+id+'" role="dialog" aria-labelledby="'+id+'-header-text" class="'+CSS.WRAP+'"></div>')
.append(C('<div class="'+CSS.HEADER+' yui3-widget-hd"></div>'))
.append(C('<div class="'+CSS.BODY+' yui3-widget-bd"></div>'))
.append(C('<div class="'+CSS.FOOTER+' yui3-widget-ft"></div>')));
@@ -146,7 +146,7 @@ Y.extend(ALERT, DIALOGUE, {
.append(yes));
this.get(BASE).addClass('moodle-dialogue-confirm');
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
- this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
+ this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+COUNT+'-header-text">' + this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
this._enterKeypress = Y.on('key', this.submit, window, 'down:13', this);
yes.on('click', this.submit, this);
@@ -201,7 +201,7 @@ Y.extend(CONFIRM, DIALOGUE, {
.append(no));
this.get(BASE).addClass('moodle-dialogue-confirm');
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
- this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
+ this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+COUNT+'-header-text">' + this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
this._enterKeypress = Y.on('key', this.submit, window, 'down:13', this, true);
this._escKeypress = Y.on('key', this.submit, window, 'down:27', this, false);
@@ -254,7 +254,7 @@ Y.extend(EXCEPTION, DIALOGUE, {
_keypress : null,
initializer : function(config) {
this.get(BASE).addClass('moodle-dialogue-exception');
- this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + config.name + '</h1>', Y.WidgetStdMod.REPLACE);
+ this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+COUNT+'-header-text">' + config.name + '</h1>', Y.WidgetStdMod.REPLACE);
var content = C('<div class="moodle-exception"></div>')
.append(C('<div class="moodle-exception-message">'+this.get('message')+'</div>'))
.append(C('<div class="moodle-exception-param hidden param-filename"><label>File:</label> '+this.get('fileName')+'</div>'))
@@ -325,7 +325,7 @@ Y.extend(AJAXEXCEPTION, DIALOGUE, {
_keypress : null,
initializer : function(config) {
this.get(BASE).addClass('moodle-dialogue-exception');
- this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + config.name + '</h1>', Y.WidgetStdMod.REPLACE);
+ this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+COUNT+'-header-text">' + config.name + '</h1>', Y.WidgetStdMod.REPLACE);
var content = C('<div class="moodle-ajaxexception"></div>')
.append(C('<div class="moodle-exception-message">'+this.get('error')+'</div>'))
.append(C('<div class="moodle-exception-param hidden param-debuginfo"><label>URL:</label> '+this.get('reproductionlink')+'</div>'))

0 comments on commit b4454b1

Please sign in to comment.