MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load.  
/* Any JavaScript here will be loaded for all users on every page load.*/
wikEd.js is a Gadget implemented at MediaWiki:Gadget-wikEd.js and in Special:Preferences
 
/* Make the VisualEditor Sticky */
/* leverage jQuery for the selector and the sticky class from Chameleon?
This doesn't actually work properly
AND, the VE Toolbar is floating in Vector2022 skin
So, it's a bug? in Chameleon
$('.ve-ui-toolbar').addClass('sticky');
*/
 
/** Matomo
* disabled on 2025-09-26 because it is not documented nor working at this time
 
  var _paq = window._paq || [];
  // tracker methods like "setCustomDimension" should be called before "trackPageView"
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//wiki.freephile.org/analytics/";
    _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.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
/** End Matomo **/
 
/**
* wikEd.js is a Gadget implemented at MediaWiki:Gadget-wikEd.js and in Special:Preferences
 
// install [[:Wikipedia:User:Cacycle/wikEd]] in-browser text editor
(function ()
{
var script = document.createElement('script');
script.src = '//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js&action=raw&ctype=text/javascript';
script.async = true;
document.getElementsByTagName('head')[0].appendChild(script);
}
) ();
*/
*/


Line 85: Line 121:
         }
         }
}
}
/**
function CustomizeModificationsOfSidebar() {
jQuery( document ).ready( function( $ ) {
         // adds [[Special:Html2Wiki]] to toolbox
         // adds [[Special:Html2Wiki]] to toolbox
         ModifySidebar( 'add', 'toolbox', 'Import HTML', '/wiki/Special:Html2Wiki' );
         ModifySidebar( 'add', 'toolbox', 'Import HTML', '/wiki/Special:Html2Wiki' );
        // removes [[Special:Upload]] from toolbox
} );
        // ModifySidebar( 'remove', 'toolbox', 'Upload file', 'http://en.wikipedia.org/wiki/Special:Upload' );
*/
}
// for anyone
addOnloadHook( CustomizeModificationsOfSidebar );
// customize only for bureaucrats
// didn't work in testing
/*if ( isArray( wgUserGroups ) ) {
        if ( wgUserGroups.Contains( 'bureaucrat' ) ) {
                addOnloadHook( CustomizeModificationsOfSidebar );
        }
}*/