- md5
- 7cf7cb89791ea4816229e7550ec7bc87
- sha1
- 198c1e82eea7103c563980d049021101b584eac5
- sha256
- d7a8be083273b11ce15be7b8b7c71335d6249f16b92378ac4aa5d0564685e62a
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
/**
* @package Hathor
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Functions
*/
/**
* Change the skip nav target to work with webkit browsers (Safari/Chrome) and
* Opera
*/
function setSkip() {
var $ = jQuery.noConflict();
var browser = $.browser;
if (browser.chrome || browser.safari || browser.opera) {
var $target = $('#skiptarget');
$target.attr('href',"#skiptarget");
$target.text("Start of main content");
$target.attr("tabindex", "0");
$('#skiplink').on("click", function(){
$('#skiptarget').focus();
});
}
}
/**
* Set the Aria Role based on the id
*
* @param id
* @param rolevalue
* @return
*/
function setRoleAttribute(id, rolevalue) {
if (jQuery('#' + id).length) {
jQuery('#'+ id).attr("role", rolevalue);
}
}
/**
* Set the WAI-ARIA Roles Specify the html id then aria role
*
* @return
*/
function setAriaRoleElementsById() {
setRoleAttribute("header", "banner");
setRoleAttribute("element-box", "main");
setRoleAttribute("footer", "contentinfo");
setRoleAttribute("nav", "navigation");
setRoleAttribute("submenu", "navigation");
setRoleAttribute("system-message", "alert");
}
/**
* This sets the given Aria Property state to true for the given element
*
* @param el
* The element (tag.class)
* @param prop
* The property to set to true
* @return
*/
function setPropertyAttribute(el, prop) {
if (jQuery(el).length) {
jQuery(el).attr(prop, "true");
}
}
/**
* Set the WAI-ARIA Properties Specify the tag.class then the aria property to
* set to true If classes are changed on the fly (i.e. aria-invalid) they need
* to be changed there instead of here.
*
* @return
*/
function setAriaProperties() {
setPropertyAttribute("input.required", "aria-required");
setPropertyAttribute("textarea.required", "aria-required");
setPropertyAttribute("input.readonly", "aria-readonly");
setPropertyAttribute("input.invalid", "aria-invalid");
setPropertyAttribute("textarea.invalid", "aria-invalid");
}
/**
* Process file
*/
/** from accessible suckerfish menu by Matt Carroll,
* mootooled by Bill Tomczak
*/
jQuery(function($){
var $menu = $('#menu');
if ($menu.length && !$menu.hasClass('disabled')) {
$menu.find('li').each(function(){
$(this).on('mouseenter', function(){
$(this).addClass('sfhover');
});
$(this).on('mouseleave', function() {
$(this).removeClass('sfhover');
});
});
$menu.find('a').each(function() {
$(this).on('focus', function() {
$(this).addClass('sffocus');
$(this).closest('li').addClass('sfhover');
});
$(this).on('blur', function() {
$(this).removeClass('sffocus');
$(this).closest('li').removeClass('sfhover');
});
});
}
});
jQuery(function() {
setSkip();
setAriaRoleElementsById();
setAriaProperties();
});
The same content is in 30 releases, Joomla 3.9.15-rc to 3.10.0-alpha1. See them all, or every version of this file.