53,890
edits
(reverting) |
(Update with code from beta: Remove old GR code; GuidedResearch Main Page variant; Expanded language wiki Main Page maps) |
||
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. */ | ||
// | // Initialize Tooltips from Bootstrap | ||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); | |||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { | |||
} | return new bootstrap.Tooltip(tooltipTriggerEl) | ||
}); | |||
/** | |||
* Display the 'Additional online resources' using jQuery | |||
*/ | |||
$(document).ready(function(){ | |||
$("#mw-customcollapsible-Additional_online_resources").css({"display": "block"}); | |||
}); | |||
/* Add Adobe Launch 2020-11-12 | /* Add Adobe Launch 2020-11-12 | ||
Line 19: | Line 28: | ||
}; | }; | ||
// send it | // send it | ||
_satellite.track('page_view', config); | try { | ||
_satellite.track('page_view', config); | |||
} catch (e) { | |||
// ignore | |||
} | |||
console.log("recorded page view for " + config.page_detail); | console.log("recorded page view for " + config.page_detail); | ||
}); | }); | ||
Line 284: | Line 297: | ||
/* end Accordion button */ | /* end Accordion button */ | ||
/** | /** | ||
* Conditional include of Map Menus data structure | * Conditional include of Map Menus data structure | ||
* and all the Map Menus functionality | * and all the Map Menus functionality | ||
* - only for | * - only for 'Main Page' landing pages | ||
*/ | */ | ||
// | const re = /Hauptseite|Main_Page|P%C3%A1gina_principal|Accueil|Pagina_principale|%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%9A%E3%83%BC%E3%82%B8|%EB%8C%80%EB%AC%B8|%D0%97%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0|Huvudsida|%E9%A6%96%E9%A1%B5/; | ||
if ( | if ( re.test(document.location.href) ) { | ||
// align the Heading | |||
$("#firstHeading").css({"border": "0", "textAlign": "center"}); | |||
// console.log('loading menus data'); | // console.log('loading menus data'); | ||
mw.loader.load('/wiki/ | const regr = /GR$/; | ||
var isGR = regr.test(document.location.href); | |||
var lang = mw.config.get('wgContentLanguage'); | |||
var variant = 'MapMenu.js'; | |||
if (isGR) { | |||
variant = 'MapMenu-GR.js'; | |||
} | |||
mw.loader.load('/wiki/' + lang + '/index.php?title=MediaWiki:' + variant + '&action=raw&ctype=text/javascript'); | |||
/** | /** |
edits