/*EUSKADI.EUS MENUAREN SCRIPT ERABILERRAZA v0.2
Eusko Jaurlaritzako Web Zerbitzua (2017/09)
*/
r01JQuery(document).ready( function() {
// Hizkuntzaren arabera testua sortu //
if (r01gLang == 'eu'){
var closed_text = 'Ezkutatu azpiko menua: ';
var open_text = 'Erakutsi azpiko menua: ';
}
else {
var closed_text = 'Ocultar submenu ';
var open_text = 'Mostrar submenu ';
}
// Submenua duten aukerei DIV bat jarri //
r01JQuery('.has-subnav').each(
function() {
var menu_text = r01JQuery(this).clone().children('ul').remove().end().html();
r01JQuery(this).html(function () {
return r01JQuery(this).html().replace(menu_text,'
'+menu_text+'
');
});
}// end each function
); // end each loop
// Submenua duten aukerei funtzionamendua eman //
r01JQuery('.has-subnav div').each(
function() {
var reset_menu = function(node){
var menu_wrapper = r01JQuery(node).closest('ul');
menu_wrapper.find('li.has-subnav a.close').each(function(){
r01JQuery(this).removeClass('close');
r01JQuery(this).attr('class', 'open');
r01JQuery(this).attr('aria-expanded', 'false');
r01JQuery(this).find('span').text(open_text);
r01JQuery(this).parent().next('ul').css('display', 'none');
});
}
var toggle_treeitem = function( node ) {
var sub_menu_node = r01JQuery(node).parent().next('ul');
if( r01JQuery(node).hasClass('open') ) {
reset_menu(node);
r01JQuery(node).attr('class', 'close');
r01JQuery(node).attr('aria-expanded', 'true');
r01JQuery(node).find('span').text(closed_text)
sub_menu_node.css('display','block');
} else if( r01JQuery(node).hasClass('close') ) {
r01JQuery(node).attr('class', 'open');
r01JQuery(node).attr('aria-expanded', 'false');
r01JQuery(node).find('span').text(open_text);
sub_menu_node.css('display', 'none');
} // endif
} // end click function
var text = r01JQuery(this).html();
r01JQuery(this).html('' + open_text + '' + text + '');
r01JQuery(this).next('ul').css('display', 'none');
// Edozein tokian sakatzerakoan menuak itxi egiten da//
r01JQuery("body").click(function(){
reset_menu(".has-subnav div");
});
// Add click handler to open and close the menu with the keyboard or the mouse
r01JQuery(this).children('a').click(function(){
toggle_treeitem(this);
return false; }
); // end click bind
} // end each function
); // end each loop
//mugikorrentzako egokitzapenak
r01JQuery('nav.menu_webgune_02 h1,nav.menu_webgune_02 h2').click(function(){
r01JQuery('ul.level-1').toggle(200);
r01JQuery(this).toggleClass("menuarlo_itxi");
return false;
})
});
/**
* @namespace aria
*/
var aria = aria || {};
/**
* @desc
* Key code constants
*/
aria.KeyCode = {
BACKSPACE: 8,
TAB: 9,
RETURN: 13,
ESC: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
DELETE: 46
};
aria.Utils = aria.Utils || {};
// Polyfill src https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
aria.Utils.matches = function (element, selector) {
if (!Element.prototype.matches) {
Element.prototype.matches =
Element.prototype.matchesSelector ||
Element.prototype.mozMatchesSelector ||
Element.prototype.msMatchesSelector ||
Element.prototype.oMatchesSelector ||
Element.prototype.webkitMatchesSelector ||
function (s) {
var matches = element.parentNode.querySelectorAll(s);
var i = matches.length;
while (--i >= 0 && matches.item(i) !== this) {}
return i > -1;
};
}
return element.matches(selector);
};
aria.Utils.remove = function (item) {
if (item.remove && typeof item.remove === 'function') {
return item.remove();
}
if (item.parentNode &&
item.parentNode.removeChild &&
typeof item.parentNode.removeChild === 'function') {
return item.parentNode.removeChild(item);
}
return false;
};
aria.Utils.isFocusable = function (element) {
if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)) {
return true;
}
if (element.disabled) {
return false;
}
switch (element.nodeName) {
case 'A':
return !!element.href && element.rel != 'ignore';
case 'INPUT':
return element.type != 'hidden' && element.type != 'file';
case 'BUTTON':
case 'SELECT':
case 'TEXTAREA':
return true;
default:
return false;
}
};
aria.Utils.getAncestorBySelector = function (element, selector) {
if (!aria.Utils.matches(element, selector + ' ' + element.tagName)) {
// Element is not inside an element that matches selector
return null;
}
// Move up the DOM tree until a parent matching the selector is found
var currentNode = element;
var ancestor = null;
while (ancestor === null) {
if (aria.Utils.matches(currentNode.parentNode, selector)) {
ancestor = currentNode.parentNode;
}
else {
currentNode = currentNode.parentNode;
}
}
return ancestor;
};
aria.Utils.hasClass = function (element, className) {
return (new RegExp('(\\s|^)' + className + '(\\s|$)')).test(element.className);
};
aria.Utils.addClass = function (element, className) {
if (!aria.Utils.hasClass(element, className)) {
element.className += ' ' + className;
}
};
aria.Utils.removeClass = function (element, className) {
var classRegex = new RegExp('(\\s|^)' + className + '(\\s|$)');
element.className = element.className.replace(classRegex, ' ').trim();
};
{
"@graph" : [ {
"@id" : "http://id.euskadi.eus/eli/es-pv/l/1998/06/11/14/dof",
"@type" : "http://schema.org/Legislation"
}, {
"@id" : "http://id.euskadi.eus/eli/es-pv/l/2012/06/21/12",
"@type" : "http://schema.org/Legislation"
}, {
"@id" : "http://id.euskadi.eus/eli/es-pv/l/2012/06/21/12/dof",
"@type" : "http://schema.org/Legislation",
"http://schema.org/about" : [ {
"@id" : "http://id.euskadi.eus/kos/public-sector/sector/sector-publico"
}, {
"@id" : "http://id.euskadi.eus/kos/public-sector/sector/cultura-ocio"
}, {
"@id" : "http://id.euskadi.eus/kos/public-sector/sector/salud"
}, {
"@id" : "http://id.euskadi.eus/kos/public-sector/sector/deporte"
} ],
"http://schema.org/datePublished" : "2012-06-28",
"http://schema.org/isPartOf" : {
"@id" : "http://id.euskadi.eus/eli/es-pv/l/2012/06/21/12",
"@type" : "http://schema.org/Legislation"
},
"http://schema.org/legislationChanges" : {
"@id" : "http://id.euskadi.eus/eli/es-pv/l/1998/06/11/14/dof",
"@type" : "http://schema.org/Legislation"
},
"http://schema.org/legislationDate" : "2012-06-21",
"http://schema.org/legislationIdentifier" : "bopv201202954",
"http://schema.org/legislationResponsible" : {
"@id" : "http://datos.gob.es/recurso/sector-publico/org/Organismo/A16003011",
"@type" : "http://schema.org/Organization",
"http://schema.org/name" : "Comunidad Autónoma del País Vasco"
},
"http://schema.org/legislationType" : "l",
"http://schema.org/license" : "https://creativecommons.org/licenses/by/4.0/deed.es_ES",
"http://schema.org/workExample" : [ {
"@id" : "http://id.euskadi.eus/eli/es-pv/l/2012/06/21/12/dof/eus",
"@type" : "http://schema.org/Legislation",
"http://schema.org/encoding" : [ {
"@id" : "_:b0",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.legegunea.euskadi.eus/eli/es-pv/l/2012/06/21/12/dof/eus/html",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/HTML"
}, {
"@id" : "_:b1",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.legegunea.euskadi.eus/x59-contfich/eu/contenidos/ley/bopv201202954/eu_def/data/bopv",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/XML"
}, {
"@id" : "_:b5",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.euskadi.eus:80/bopv2/datos/2012/06/1202954e.pdf",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/PDF"
} ],
"http://schema.org/inLanguage" : "eus",
"http://schema.org/name" : "12/2012 Legea, ekainaren 21ekoa, Kiroleko Dopinaren aurkakoa.\r\n"
}, {
"@id" : "http://id.euskadi.eus/eli/es-pv/l/2012/06/21/12/dof/spa",
"@type" : "http://schema.org/Legislation",
"http://schema.org/encoding" : [ {
"@id" : "_:b2",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.euskadi.eus:80/bopv2/datos/2012/06/1202954a.pdf",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/PDF"
}, {
"@id" : "_:b3",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.legegunea.euskadi.eus/x59-contfich/es/contenidos/ley/bopv201202954/es_def/data/bopv",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/XML"
}, {
"@id" : "_:b4",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.legegunea.euskadi.eus/eli/es-pv/l/2012/06/21/12/dof/spa/html",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/HTML"
} ],
"http://schema.org/inLanguage" : "spa",
"http://schema.org/name" : "LEY 12/2012, de 21 de junio, contra el Dopaje en el Deporte."
} ]
}, {
"@id" : "http://id.euskadi.eus/eli/es-pv/l/2012/06/21/12/dof/eus",
"@type" : "http://schema.org/Legislation",
"http://schema.org/encoding" : [ {
"@id" : "_:b0",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.legegunea.euskadi.eus/eli/es-pv/l/2012/06/21/12/dof/eus/html",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/HTML"
}, {
"@id" : "_:b1",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.legegunea.euskadi.eus/x59-contfich/eu/contenidos/ley/bopv201202954/eu_def/data/bopv",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/XML"
}, {
"@id" : "_:b5",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.euskadi.eus:80/bopv2/datos/2012/06/1202954e.pdf",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/PDF"
} ],
"http://schema.org/inLanguage" : "eus",
"http://schema.org/name" : "12/2012 Legea, ekainaren 21ekoa, Kiroleko Dopinaren aurkakoa.\r\n"
}, {
"@id" : "http://id.euskadi.eus/eli/es-pv/l/2012/06/21/12/dof/spa",
"@type" : "http://schema.org/Legislation",
"http://schema.org/encoding" : [ {
"@id" : "_:b2",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.euskadi.eus:80/bopv2/datos/2012/06/1202954a.pdf",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/PDF"
}, {
"@id" : "_:b3",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.legegunea.euskadi.eus/x59-contfich/es/contenidos/ley/bopv201202954/es_def/data/bopv",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/XML"
}, {
"@id" : "_:b4",
"@type" : "http://schema.org/LegislationObject",
"http://schema.org/contentUrl" : "http://www.legegunea.euskadi.eus/eli/es-pv/l/2012/06/21/12/dof/spa/html",
"http://schema.org/fileFormat" : "http://publications.europa.eu/resource/authority/file-type/HTML"
} ],
"http://schema.org/inLanguage" : "spa",
"http://schema.org/name" : "LEY 12/2012, de 21 de junio, contra el Dopaje en el Deporte."
} ]
}
José María González Zorrilla - Ekonomiaren Garapena eta Azpiegitura Saila - Euskadi.eus
Ir al contenido
Joan edukira