Nowa Micropedia jest jeszcze w fazie beta. W razie problemów, napisz maila na pomoc@wiki.mikronacje.info albo zgłoś go na kanale na Mikronacyjnym Discordzie!
MediaWiki:Common.js: Różnice pomiędzy wersjami
Z Micropedia
imported>Tomta1 m (drobne) |
Nie podano opisu zmian |
||
Linia 1: | Linia 1: | ||
var _paq = window._paq = window._paq || []; | |||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */ | |||
_paq.push(['trackPageView']); | |||
_paq.push(['enableLinkTracking']); | |||
(function() { | |||
var u="//stats.makary.online/"; | |||
_paq.push(['setTrackerUrl', u+'matomo.php']); | |||
_paq.push(['setSiteId', '1']); | |||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; | |||
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); | |||
})(); | |||
/* Dynamic Navigation Bars */ | /* Dynamic Navigation Bars */ | ||
// set up the words in your language | // set up the words in your language |
Wersja z 08:35, 11 gru 2020
var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//stats.makary.online/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); /* Dynamic Navigation Bars */ // set up the words in your language var NavigationBarHide = '[ukryj]'; var NavigationBarShow = '[pokaż]'; // set up max count of Navigation Bars on page, // if there are more, all will be hidden // NavigationBarShowDefault = 0; // all bars will be hidden // NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden var NavigationBarShowDefault = 0; // shows and hides content and picture (if available) of navigation bars // Parameters: // indexNavBar: the index of navigation bar to be toggled function toggleNavigationBar(indexNavBar) { var NavToggle = document.getElementById("NavToggle" + indexNavBar); var NavFrame = document.getElementById("NavFrame" + indexNavBar); if (!NavFrame || !NavToggle) return ; // values to be set var currDisplay; var currTitle; // if shown now if (NavToggle.firstChild.data == NavigationBarHide) { currDisplay = 'none'; currTitle = NavigationBarShow; } // if hidden now else if (NavToggle.firstChild.data == NavigationBarShow) { currDisplay = 'block'; currTitle = NavigationBarHide; } for (var NavChild=NavFrame.firstChild; NavChild!=null; NavChild=NavChild.nextSibling) { if (NavChild.nodeType==1) // only if this is an element node { if (NavChild.className=='NavPic' || NavChild.className=='NavContent') NavChild.style.display = currDisplay else if (NavChild.className == 'NavToggle') NavChild.firstChild.data = currTitle ; } } } // adds show/hide-button to navigation bars function createNavigationBarToggleButton() { var i; var indexNavBar = 0; var divs = document.getElementById('bodyContent').getElementsByTagName("div"); // iterate over all < div >-elements for (i=0; i<divs.length; i++) { // if found a navigation bar if (divs[i].className == "NavFrame") { var NavFrame = divs[i]; indexNavBar++; var NavToggle = document.createElement("a"); NavToggle.className = 'NavToggle'; NavToggle.setAttribute('id', 'NavToggle' + indexNavBar); NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavBar + ');'); var NavToggleText = document.createTextNode(NavigationBarHide); NavToggle.appendChild(NavToggleText); // add NavToggle-Button as first div-element // in < div class="NavFrame" > NavFrame.insertBefore(NavToggle, NavFrame.firstChild); NavFrame.setAttribute('id', 'NavFrame' + indexNavBar); } } // if more Navigation Bars found than Default then hide all if (NavigationBarShowDefault < indexNavBar) { for(i=1; i<=indexNavBar; i++) toggleNavigationBar(i) ; } } addOnloadHook(createNavigationBarToggleButton);