MDL-56431 messaging: Added aria label to filter.

Added an aria label to the course filter in the
messaging page.
This commit is contained in:
Adrian Greeve 2016-11-24 15:04:48 +08:00
parent c5c8f3a6f5
commit 72a5842bd7
4 changed files with 7 additions and 1 deletions

View file

@ -97,6 +97,7 @@ $string['outputnotconfigured'] = 'Not configured';
$string['permitted'] = 'Permitted'; $string['permitted'] = 'Permitted';
$string['processorsettings'] = 'Processor settings'; $string['processorsettings'] = 'Processor settings';
$string['removecontact'] = 'Remove contact'; $string['removecontact'] = 'Remove contact';
$string['removecoursefilter'] = 'Remove filter for course {$a}';
$string['removefromyourcontacts'] = 'Remove from your contacts'; $string['removefromyourcontacts'] = 'Remove from your contacts';
$string['requiresconfiguration'] = 'Requires configuration'; $string['requiresconfiguration'] = 'Requires configuration';
$string['searchforuser'] = 'Search for a user'; $string['searchforuser'] = 'Search for a user';

File diff suppressed because one or more lines are too long

View file

@ -383,6 +383,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
this.messageArea.find(SELECTORS.CONTACTSAREA).addClass('searchfilter'); this.messageArea.find(SELECTORS.CONTACTSAREA).addClass('searchfilter');
this.messageArea.find(SELECTORS.SEARCHFILTERAREA).show(); this.messageArea.find(SELECTORS.SEARCHFILTERAREA).show();
this.messageArea.find(SELECTORS.SEARCHFILTER).html(text); this.messageArea.find(SELECTORS.SEARCHFILTER).html(text);
Str.get_string('removecoursefilter', 'message', text).then(function(languagestring) {
this.messageArea.find(SELECTORS.SEARCHFILTERAREA).attr('aria-label', languagestring);
}.bind(this));
}; };
/** /**
@ -394,6 +397,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
this.messageArea.find(SELECTORS.CONTACTSAREA).removeClass('searchfilter'); this.messageArea.find(SELECTORS.CONTACTSAREA).removeClass('searchfilter');
this.messageArea.find(SELECTORS.SEARCHFILTER).empty(); this.messageArea.find(SELECTORS.SEARCHFILTER).empty();
this.messageArea.find(SELECTORS.SEARCHFILTERAREA).hide(); this.messageArea.find(SELECTORS.SEARCHFILTERAREA).hide();
this.messageArea.find(SELECTORS.SEARCHFILTERAREA).removeAttr('aria-label');
}; };
/** /**

View file

@ -19,6 +19,7 @@
rows="1" rows="1"
data-auto-rows data-auto-rows
data-max-rows="5" data-max-rows="5"
role="textbox"
aria-label="{{#str}} writeamessage, message {{/str}}" aria-label="{{#str}} writeamessage, message {{/str}}"
placeholder="{{#str}} writeamessage, message {{/str}}"></textarea> placeholder="{{#str}} writeamessage, message {{/str}}"></textarea>
</div> </div>