MediaWiki:Common.js: Difference between revisions

Use pathname instead of href because otherwise we get the querystring included
(Temporarily adding back 'old' GR Map)
(Use pathname instead of href because otherwise we get the querystring included)
Line 326: Line 326:
  */
  */
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/;
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 ( re.test(document.location.href) ) {
if ( re.test(document.location.pathname) ) {
// align the Heading
// align the Heading
$("#firstHeading").css({"border": "0", "textAlign": "center"});
$("#firstHeading").css({"border": "0", "textAlign": "center"});
Line 332: Line 332:
     // console.log('loading menus data');
     // console.log('loading menus data');
     const regr = /GR$/;
     const regr = /GR$/;
     var isGR = regr.test(document.location.href);
     var isGR = regr.test(document.location.pathname);
     var lang = mw.config.get('wgContentLanguage');
     var lang = mw.config.get('wgContentLanguage');
     var variant = 'MapMenu.js';
     var variant = 'MapMenu.js';
53,890

edits