MediaWiki:Common.js: Diferență între versiuni

De la Wiki The-West RO
Jump to navigation
Fără descriere a modificării
Fără descriere a modificării
Linia 27: Linia 27:
         $(this).html('<iframe width="100%" height="100%" src="https://www.youtube.com/embed/' + $(this).attr('data-id') + '?cc_load_policy=1&cc_lang_pref=' + $(this).attr('data-subtitles') + '" frameborder="0" allowfullscreen></iframe>');
         $(this).html('<iframe width="100%" height="100%" src="https://www.youtube.com/embed/' + $(this).attr('data-id') + '?cc_load_policy=1&cc_lang_pref=' + $(this).attr('data-subtitles') + '" frameborder="0" allowfullscreen></iframe>');
     });
     });
}
/* Pentru navigarea din pagina https://wiki.the-west.ro/wiki/Echipament. */
function showCat(evt, catName) {
var i, catBox_text, catBox_new;
catBox_text = document.getElementsByClassName("catBox_text");
for (i = 0; i < catBox_text.length; i++) {
catBox_text[i].style.display = "none";
}
catBox_new = document.getElementsByClassName("catBox_new");
for (i = 0; i < catBox_new.length; i++) {
catBox_new[i].className = catBox_new[i].className.replace(" active", "");
}
document.getElementById(catName).style.display = "block";
evt.currentTarget.className += " active";
<!-- Hide Main Text when hover a category -->
document.getElementById("main_text").style.display = "none";
}
function reverse(ev, catName) {
var i, catBox_text, catBox_new;
catBox_text = document.getElementsByClassName("catBox_text");
for (i = 0; i < catBox_text.length; i++) {
catBox_text[i].style.display = "none";
}
catBox_new = document.getElementsByClassName("catBox_new");
for (i = 0; i < catBox_new.length; i++) {
catBox_new[i].className = catBox_new[i].className.replace(" active", "");
}
<!-- Show Main Text when unhover a category -->
document.getElementById("main_text").style.display = "block";
}
}

Versiunea de la data 5 septembrie 2021 13:57

/* Any JavaScript here will be loaded for all users on every page load. */
$('.tbbox-logo').wrap('<a href="/wiki/Pagina_principal%C4%83"></a>');
if ($('.item_container').length!==0) {
    $('.item_container').each(function() {
        $(this).append('<img src="https://westzz.innogamescdn.com/images/items/' + $(this).attr('data-url') + '?1">');
    });
    $.getScript("/wiki/Popup.js?action=raw");
}

$(window).scroll(function() {
    if ($(this).scrollTop() > 300) {
        $('#back-top').fadeIn();
    } else {
        $('#back-top').fadeOut();
    }
});
// Scroll body to top on click
$('#back-top a').click(function() {
    $('body,html').animate({
        scrollTop: 0
    }, 800);
    return false;
});
// Embed youtube videos
if ($('.youtube_video').length !== 0) {
    $('.youtube_video').each(function() {
        $(this).html('<iframe width="100%" height="100%" src="https://www.youtube.com/embed/' + $(this).attr('data-id') + '?cc_load_policy=1&cc_lang_pref=' + $(this).attr('data-subtitles') + '" frameborder="0" allowfullscreen></iframe>');
    });
}

/* Pentru navigarea din pagina https://wiki.the-west.ro/wiki/Echipament. */
function showCat(evt, catName) {
	var i, catBox_text, catBox_new;
	
	catBox_text = document.getElementsByClassName("catBox_text");
	for (i = 0; i < catBox_text.length; i++) {
		catBox_text[i].style.display = "none";
	}
	
	catBox_new = document.getElementsByClassName("catBox_new");
	for (i = 0; i < catBox_new.length; i++) {
		catBox_new[i].className = catBox_new[i].className.replace(" active", "");
	}
	
	document.getElementById(catName).style.display = "block";
	evt.currentTarget.className += " active";
	
	<!-- Hide Main Text when hover a category -->
	document.getElementById("main_text").style.display = "none";
}

function reverse(ev, catName) {
	var i, catBox_text, catBox_new;
	
	catBox_text = document.getElementsByClassName("catBox_text");
	for (i = 0; i < catBox_text.length; i++) {
		catBox_text[i].style.display = "none";
	}
	
	catBox_new = document.getElementsByClassName("catBox_new");
	for (i = 0; i < catBox_new.length; i++) {
		catBox_new[i].className = catBox_new[i].className.replace(" active", "");
	}
	
	<!-- Show Main Text when unhover a category -->
	document.getElementById("main_text").style.display = "block";
}