« MediaWiki:Common.js » : différence entre les versions

De Les Archives de Vault-Tec
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Kharmitch (discussion | contributions)
Aucun résumé des modifications
 
(2 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
/* Tout JavaScript ici sera chargé pour chaque page visitée par n’importe quel utilisateur. */
/* Tout JavaScript ici sera chargé pour chaque page visitée par n’importe quel utilisateur. */
/* ######################################################################## */
/* ### FANCY TOOLTIPS (Template:Icon, Template:Infobox,                ### */
/* ###                Template:Tooltip)                                ### */
/* ### ---------------------------------------------------------------- ### */
/* ### Description: Nicer-looking tooltips using jQuery.tipsy          ### */
/* ### Credit:      User:Porter21    THE VAULT                        ### */
/* ######################################################################## */
function fancyTooltips () {
  var ftTooltipsE = $('.va-infobox-tooltip-cell');
  var ftTooltipsS = $('.va-icon, .va-tooltip');
  if (ftTooltipsE.length || ftTooltipsS.length) {
      mw.loader.using('jquery.tipsy', function () {
        if (ftTooltipsE.length) {
            // Tooltip appears to the left of the element
            ftTooltipsE.tipsy({gravity: 'e'});
        }
        if (ftTooltipsS.length) {
            // Tooltip appears above the element
            ftTooltipsS.tipsy({gravity: 's'});
        }
      });
  }
}
/* ######################################################################## */
/* ### SHOW/HIDE                                                        ### */
/* ### ---------------------------------------------------------------- ### */
/* ### Description: Collapsible tables using jQuery. Allows tables to  ### */
/* ###              be collapsed, showing only the header.              ### */
/* ### Credit:      User:Dantman                                        ### */
/* ### Disclaimer:  See http://dev.wikia.com/wiki/ShowHide/code.js      ### */
/* ######################################################################## */
function importScriptPage (page, server)
{
var url = '/index.php?title=' + encodeURIComponent(page.replace(/ /g,'_')).replace('%2F','/').replace('%3A',':') + '&action=raw&ctype=text/javascript';
if (typeof server == "string") url = (server.indexOf('://') == -1)?'http://' + server + '.wikia.com' + url:server + url;
return mw.loader.load(url);
}
var ShowHideConfig = { autoCollapse: 1, userLang: false };
importScriptPage( 'ShowHide/code.js', 'dev' );


/* ######################################################################## */
/* ######################################################################## */

Dernière version du 30 décembre 2021 à 17:14

/* Tout JavaScript ici sera chargé pour chaque page visitée par n’importe quel utilisateur. */

/* ######################################################################## */
/* ### IMAGEMAPEDIT                                                     ### */
/* ### ---------------------------------------------------------------- ### */
/* ### Description: permet de connaître les coordonnées d'une image.    ### */
/* ###              utile pour imagemap                                 ### */
/* ######################################################################## */

if (mw.config.get('wgNamespaceNumber')==6 && mw.config.get('wgAction')=='view') {
	mw.loader.load('//tools.wmflabs.org/imagemapedit/ime.js');
}