MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary Tags: Reverted Mobile edit Mobile web edit |
||
| Line 16: | Line 16: | ||
} | } | ||
} | |||
// HIDING ELEMENTS | |||
// ######################## | |||
if( | |||
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page" | |||
) | |||
{ | |||
var plusLinks = document.querySelectorAll('.pre-content'); | |||
var firstLink = plusLinks[0]; | |||
firstLink.setAttribute('class', 'hidethis'); | |||
} | |||
// ######################## | |||
if( | |||
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(ru)&mobileaction=toggle_view_desktop" | |||
) | |||
{var plusLinks = document.querySelectorAll('.pre-content'); | |||
var firstLink = plusLinks[0]; | |||
firstLink.setAttribute('class', 'hidethis'); | |||
} | |||
// ######################## | |||
if( | |||
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page&mobileaction=toggle_view_desktop" | |||
) | |||
{ | |||
var plusLinks = document.querySelectorAll('.pre-content'); | |||
var firstLink = plusLinks[0]; | |||
firstLink.setAttribute('class', 'hidethis'); | |||
} | |||
// ######################## | |||
if( | |||
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(ru)" | |||
) | |||
{var plusLinks = document.querySelectorAll('.pre-content'); | |||
var firstLink = plusLinks[0]; | |||
firstLink.setAttribute('class', 'hidethis'); | |||
} | } | ||
Revision as of 12:58, 19 October 2022
/* Any JavaScript here will be loaded for all users on every page load. */
if ( mw.config.get( 'wgIsMainPage' )) {
var language = navigator.language || navigator.browserLanguage;
// alert(language);
if (language.indexOf('ru') > -1) {
document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page(ru)';
} else {
document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page';
}
}
// HIDING ELEMENTS
// ########################
if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page"
)
{
var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}
// ########################
if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(ru)&mobileaction=toggle_view_desktop"
)
{var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}
// ########################
if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page&mobileaction=toggle_view_desktop"
)
{
var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}
// ########################
if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(ru)"
)
{var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}