MDL-56431 messaging: Added aria label to filter.
authorAdrian Greeve <adrian@moodle.com>
Thu, 24 Nov 2016 07:04:48 +0000 (15:04 +0800)
committerAdrian Greeve <adrian@moodle.com>
Thu, 24 Nov 2016 09:33:22 +0000 (17:33 +0800)
Added an aria label to the course filter in the
messaging page.

lang/en/message.php
message/amd/build/message_area_search.min.js
message/amd/src/message_area_search.js
message/templates/message_area_response.mustache

index ded0aeb..3a404a3 100644 (file)
@@ -97,6 +97,7 @@ $string['outputnotconfigured'] = 'Not configured';
 $string['permitted'] = 'Permitted';
 $string['processorsettings'] = 'Processor settings';
 $string['removecontact'] = 'Remove contact';
+$string['removecoursefilter'] = 'Remove filter for course {$a}';
 $string['removefromyourcontacts'] = 'Remove from your contacts';
 $string['requiresconfiguration'] = 'Requires configuration';
 $string['searchforuser'] = 'Search for a user';
index 8426361..587f42c 100644 (file)
Binary files a/message/amd/build/message_area_search.min.js and b/message/amd/build/message_area_search.min.js differ
index dd248ef..584f4f8 100644 (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.SEARCHFILTERAREA).show();
         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.SEARCHFILTER).empty();
         this.messageArea.find(SELECTORS.SEARCHFILTERAREA).hide();
+        this.messageArea.find(SELECTORS.SEARCHFILTERAREA).removeAttr('aria-label');
     };
 
     /**
index f224c86..f7de545 100644 (file)
@@ -19,6 +19,7 @@
         rows="1"
         data-auto-rows
         data-max-rows="5"
+        role="textbox"
         aria-label="{{#str}} writeamessage, message {{/str}}"
         placeholder="{{#str}} writeamessage, message {{/str}}"></textarea>
 </div>