MediaWiki:Common.js: Difference between revisions
WikiSysopIG (talk | contribs) No edit summary Tag: Manual revert |
WikiSysopIG (talk | contribs) No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* IndraStra Analytics */ | /* IndraStra Analytics */ | ||
var _paq = window._paq = window._paq || []; | |||
_paq.push(['trackPageView']); | |||
_paq.push(['enableLinkTracking']); | |||
(function () { | |||
var u = "https://analytics.indrastra.com/"; | |||
var u="https://analytics.indrastra.com/"; | _paq.push(['setTrackerUrl', u + 'matomo.php']); | ||
_paq.push(['setTrackerUrl', u+'matomo.php']); | |||
_paq.push(['setSiteId', '13']); | _paq.push(['setSiteId', '13']); | ||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; | |||
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); | var d = document, | ||
g = d.createElement('script'), | |||
s = d.getElementsByTagName('script')[0]; | |||
g.async = true; | |||
g.src = u + 'matomo.js'; | |||
s.parentNode.insertBefore(g, s); | |||
})(); | |||
/** | |||
* Wiki@IndraStra | |||
* Keep the Vector 2022 main menu visible for anonymous visitors. | |||
*/ | |||
if ( !mw.config.get( 'wgUserName' ) ) { | |||
const observer = new MutationObserver( function ( mutationsList, observer ) { | |||
for ( const mutation of mutationsList ) { | |||
if ( mutation.target.classList.contains( 'vector-animations-ready' ) ) { | |||
const button = document.querySelector( | |||
'[data-event-name="pinnable-header.vector-main-menu.pin"]' | |||
); | |||
if ( button ) { | |||
button.click(); | |||
} | |||
observer.disconnect(); | |||
break; | |||
} | |||
} | |||
} ); | |||
observer.observe( document.documentElement, { | |||
attributes: true, | |||
attributeFilter: [ 'class' ] | |||
} ); | |||
} | |||