Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // BEGIN Rito
- // set up the words in your language
- var RitoRomano = 'Rito Romano';
- var RitoAmbrosiano = 'RitoAmbrosiano';
- // Cambia il rito mostrato
- // Parameters:
- // indexRito: indice del box da mostrare
- function toggleRito(indexRito)
- {
- var NavToggle = document.getElementById("RitoToggle" + indexNavigationBar);
- var NavFrame = document.getElementById("RitoFrame" + indexNavigationBar);
- if (!RitoFrame || !RitoToggle) {
- return false;
- }
- // se รจ mostrato il rito romano
- if (RitoToggle.firstChild.data == RitoRomano) {
- for (
- var RitoChild = RitoFrame.firstChild;
- RitoChild != null;
- RitoChild = RitoChild.nextSibling
- ) {
- if (hasClass(RitoChild, 'RitoPic')) {
- RitoChild.style.display = 'none';
- RitoChild.nextSibling.style.display = 'block';
- }
- if (hasClass(RitoChild, 'RitoContent')) {
- RitoChild.style.display = 'none';
- RitoChild.nextSibling.style.display = 'block';
- }
- if (hasClass(RitoChild, 'RitoToggle')) {
- RitoChild.firstChild.data = RitoAmbrosiano;
- }
- }
- // Altrimenti
- } else if (RitoToggle.firstChild.data == RitoAmbrosiano) {
- for (
- var RitoChild = RitoFrame.firstChild;
- RitoChild != null;
- RitoChild = RitoChild.nextSibling
- ) {
- if (hasClass(RitoChild, 'RitoPic')) {
- RitoChild.style.display = 'block';
- RitoChild.nextSibling.style.display = 'none';
- }
- if (hasClass(NavChild, 'NavContent')) {
- NavChild.style.display = 'block';
- RitoChild.nextSibling.style.display = 'none';
- }
- if (hasClass(NavChild, 'NavToggle')) {
- NavChild.firstChild.data = RitoRomano;
- }
- }
- }
- }
- // Aggiunge il link per cambiare rito, nella barra
- function createRitoBarToggleButton()
- {
- var indexRitoBar = 0;
- // iterate over all < div >-elements
- for(
- var i=0;
- RitoFrame = document.getElementsByTagName("div")[i];
- i++
- ) {
- // Se trova un div che fa da barra superiore a un box rito
- if (hasClass(RitoFrame, 'RitoFrame')) {
- indexRitoBar++;
- var RitoToggle = document.createElement("a");
- RitoToggle.className = 'RitoToggle';
- RitoToggle.setAttribute('id', 'RitoToggle' + indexRito);
- RitoToggle.setAttribute('href', 'javascript:toggleRito(' + indexRito + ');');
- var RitoToggleText = document.createTextNode(RitoAmbrosiano);
- RitoToggle.appendChild(RitoToggleText);
- // aggiunge il bottone come primo div in
- // < div class="RitoFrame" >
- RitoFrame.insertBefore(
- RitoToggle,
- RitoFrame.firstChild
- );
- RitoFrame.setAttribute('id', 'RitoFrame' + indexRitoBar);
- }
- }
- }
- aOnloadFunctions[aOnloadFunctions.length] = createRitoBarToggleButton;
- // END Dynamic Navigation Bars
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement