- md5
- 872de156ab4dd1f570539897e841ef6a
- sha1
- 7f6daeda986a155214ef3cf754bdcd46ce9b8ca0
- sha256
- d12aac2ccd20d40a3fafb4373d4f2f35e745f3601017abe5f6f25ef2808a4517
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
/**
* @package Hathor
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Functions
*/
/**
* Set focus to username on the login screen
*/
function setFocus() {
if (jQuery("#login-page").length) {
jQuery('#form-login').find('input[name="username"]').focus()
}
}
/**
* 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() {
setFocus();
setSkip();
setAriaRoleElementsById();
setAriaProperties();
});
The same content is in 3 releases, Joomla 3.4.2-rc to 3.4.3. See them all, or every version of this file.