diff --git a/admin/tool/brickfield/classes/local/htmlchecker/common/checks/i_is_not_used.php b/admin/tool/brickfield/classes/local/htmlchecker/common/checks/i_is_not_used.php index a9a7799b32a..656474b9f52 100644 --- a/admin/tool/brickfield/classes/local/htmlchecker/common/checks/i_is_not_used.php +++ b/admin/tool/brickfield/classes/local/htmlchecker/common/checks/i_is_not_used.php @@ -16,7 +16,7 @@ namespace tool_brickfield\local\htmlchecker\common\checks; -use tool_brickfield\local\htmlchecker\common\brickfield_accessibility_tag_test; +use tool_brickfield\local\htmlchecker\common\brickfield_accessibility_test; /** * Brickfield accessibility HTML checker library. @@ -28,11 +28,25 @@ * @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class i_is_not_used extends brickfield_accessibility_tag_test { +class i_is_not_used extends brickfield_accessibility_test { /** @var int The default severity code for this test. */ public $defaultseverity = \tool_brickfield\local\htmlchecker\brickfield_accessibility::BA_TEST_SEVERE; /** @var string The tag this test will fire on. */ public $tag = 'i'; + + /** + * Check for any i elements and flag them as errors + * while allowing font awesome icons to be used. + */ + public function check(): void { + foreach ($this->get_all_elements('i') as $element) { + // Ensure this is not a font awesome icon with aria-hidden. + if (str_contains($element->getAttribute('class'), 'fa-') && $element->getAttribute('aria-hidden') === 'true') { + continue; + } + $this->add_report($element); + } + } } diff --git a/admin/tool/brickfield/tests/local/htmlchecker/common/checks/i_is_not_used_test.php b/admin/tool/brickfield/tests/local/htmlchecker/common/checks/i_is_not_used_test.php index a5a6cebb5b1..c32705f5bb0 100644 --- a/admin/tool/brickfield/tests/local/htmlchecker/common/checks/i_is_not_used_test.php +++ b/admin/tool/brickfield/tests/local/htmlchecker/common/checks/i_is_not_used_test.php @@ -30,6 +30,8 @@ /** * Class i_is_not_used_testcase + * + * @covers \tool_brickfield\local\htmlchecker\common\checks\i_is_not_used */ class i_is_not_used_test extends all_checks { /** @var string Check type */ @@ -71,4 +73,13 @@ public function test_check(): void { $results = $this->get_checker_results($this->htmlpass); $this->assertEmpty($results); } + + /** + * Test for font awesome icon. + */ + public function test_fa_icon(): void { + $html = '
Hello there
'; + $results = $this->get_checker_results($html); + $this->assertCount(2, $results); + } } diff --git a/course/templates/activitychooser.mustache b/course/templates/activitychooser.mustache index 67b2cfb952d..46b322b8eb7 100644 --- a/course/templates/activitychooser.mustache +++ b/course/templates/activitychooser.mustache @@ -74,8 +74,8 @@ role="tab" aria-label="{{#str}} aria:recommendedtab, core_course {{/str}}" aria-controls="recommended-{{uniqid}}" - aria-selected="false" - tabindex="-1" + aria-selected="{{#recommendedFirst}}true{{/recommendedFirst}}{{^recommendedFirst}}false{{/recommendedFirst}}" + tabindex="{{#recommendedFirst}}0{{/recommendedFirst}}{{^recommendedFirst}}-1{{/recommendedFirst}}" > {{#str}} recommended, core {{/str}} diff --git a/install/lang/sgs/langconfig.php b/install/lang/sgs/langconfig.php new file mode 100644 index 00000000000..677968c275e --- /dev/null +++ b/install/lang/sgs/langconfig.php @@ -0,0 +1,32 @@ +. + +/** + * Automatically generated strings for Moodle installer + * + * Do not edit this file manually! It contains just a subset of strings + * needed during the very first steps of installation. This file was + * generated automatically by export-installer.php (which is part of AMOS + * {@link http://docs.moodle.org/dev/Languages/AMOS}) using the + * list of strings defined in /install/stringnames.txt. + * + * @package installer + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$string['thislanguage'] = 'Žemaitėškā'; diff --git a/lib/amd/build/form-autocomplete.min.js b/lib/amd/build/form-autocomplete.min.js index 1da59a5f391..8636b9bfdff 100644 --- a/lib/amd/build/form-autocomplete.min.js +++ b/lib/amd/build/form-autocomplete.min.js @@ -6,6 +6,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.0 */ -define("core/form-autocomplete",["jquery","core/log","core/str","core/templates","core/notification","core/loadingicon","core/aria","core_form/changechecker"],(function($,log,str,templates,notification,LoadingIcon,Aria,FormChangeChecker){var KEYS_DOWN=40,KEYS_ENTER=13,KEYS_SPACE=32,KEYS_ESCAPE=27,KEYS_COMMA=44,KEYS_UP=38,KEYS_LEFT=37,KEYS_RIGHT=39,uniqueId=Date.now(),activateSelection=function(index,state){var selectionElement=$(document.getElementById(state.selectionId));index=wrapListIndex(index,selectionElement.children("[aria-selected=true]").length);var element=$(selectionElement.children("[aria-selected=true]").get(index)),itemId=state.selectionId+"-"+index;return selectionElement.children().attr("data-active-selection",null).attr("id",""),element.attr("data-active-selection",!0).attr("id",itemId),selectionElement.attr("aria-activedescendant",itemId),selectionElement.attr("data-active-value",element.attr("data-value")),$.Deferred().resolve()},updateActiveSelectionFromState=function(state){var activeElement=function(state){var _selectionRegion$attr,selectionRegion=$(document.getElementById(state.selectionId)),activeId=selectionRegion.attr("aria-activedescendant");if(activeId){var activeElement=$(document.getElementById(activeId));if(activeElement.length)return activeElement}var activeValue=null===(_selectionRegion$attr=selectionRegion.attr("data-active-value"))||void 0===_selectionRegion$attr?void 0:_selectionRegion$attr.replace(/"/g,'\\"');return selectionRegion.find('[data-value="'+activeValue+'"]')}(state),activeValue=activeElement.attr("data-value"),selectionRegion=$(document.getElementById(state.selectionId));if(activeValue){var activeIndex=selectionRegion.find("[aria-selected=true]").index(activeElement);if(-1!==activeIndex)return void activateSelection(activeIndex,state)}activateSelection(0,state)},updateSelectionList=function(options,state,originalSelect){var pendingKey="form-autocomplete-updateSelectionList-"+state.inputId;M.util.js_pending(pendingKey);var items=rebuildOptions(originalSelect.children("option:selected"),!1),newSelection=$(document.getElementById(state.selectionId));if(!hasItemListChanged(state,items))return M.util.js_complete(pendingKey),Promise.resolve();state.items=items;var context=$.extend(options,state);return templates.render(options.templates.items,context).then((function(html,js){templates.replaceNodeContents(newSelection,html,js),updateActiveSelectionFromState(state)})).then((function(){return M.util.js_complete(pendingKey)})).catch(notification.exception)},hasItemListChanged=function(state,items){return state.items.length!==items.length||state.items.filter((item=>-1===items.indexOf(item))).length>0},notifyChange=function(originalSelect){FormChangeChecker.markFormChangedFromNode(originalSelect[0]),originalSelect[0].dispatchEvent(new Event("change",{bubbles:!0}))},deselectItem=function(options,state,item,originalSelect){var selectedItemValue=$(item).attr("data-value");return void 0!==originalSelect.find("option").first().attr("value")&&originalSelect.prepend($("