Difference between revisions of "MediaWiki:Common.js"

From LIFS LipidXplorer Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
+
mw.loader.using( ['mediawiki.user', 'mediawiki.util', 'jquery.client'] ).done( function () {
 
   var _paq = window._paq || [];
 
   var _paq = window._paq || [];
 
   _paq.push(['requireConsent']);
 
   _paq.push(['requireConsent']);
Line 5: Line 5:
 
   _paq.push(['trackPageView']);
 
   _paq.push(['trackPageView']);
 
   _paq.push(['enableLinkTracking']);
 
   _paq.push(['enableLinkTracking']);
   (function() {
+
   jQuery( document ).ready( function ( $ ) {
 
     var u="https://lifs-tools.org/matomo/";
 
     var u="https://lifs-tools.org/matomo/";
 
     _paq.push(['setTrackerUrl', u+'matomo.php']);
 
     _paq.push(['setTrackerUrl', u+'matomo.php']);
Line 11: Line 11:
 
     var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
 
     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);
 
     g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
   })();
+
   });
 +
});

Revision as of 07:56, 10 June 2021

mw.loader.using( ['mediawiki.user', 'mediawiki.util', 'jquery.client'] ).done( function () {
  var _paq = window._paq || [];
  _paq.push(['requireConsent']);
  _paq.push(['requireCookieConsent']);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  jQuery( document ).ready( function ( $ ) {
    var u="https://lifs-tools.org/matomo/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '7']);
    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);
  });
});