Bureaucrats, Interface administrators, oversight, redactor, Suppressors, Administrators, translator, Widget editors
142
edits
(Created page with "→All JavaScript here will be loaded for users of the mobile site: →copypasta from garco's source: var NAV_ORIENT_BOTTOM = 0; var NAV_ORIENT_TOP = 1; var NAV_ORIENT_LEFT...") |
|||
Line 1: | Line 1: | ||
/* All JavaScript here will be loaded for users of the mobile site */ | /* All JavaScript here will be loaded for users of the mobile site */ | ||
/*copypasta from garco's source*/ | /*copypasta from garco's source*/ | ||
(function () { | |||
if(navigator.cookieEnabled == true){ | |||
if(document.cookie.indexOf("u1476219_mw19788language") == -1){ | |||
document.cookie = "u1476219_mw19788language="+ navigator.languages[0].slice(0, 2); | |||
} | |||
} | |||
var lang = mediaWiki.cookie.get("u1476219_mw19788language", ""); | |||
var page = window.location.pathname.slice(6); | |||
var l = page.slice(-2); | |||
if(lang !== null && l !== lang) | |||
{ | |||
if(l == 'en' || l == 'ru' || l == 'vi'){ | |||
page = page.slice(0, -3); | |||
} | |||
var translate_exist = true; | |||
$.getJSON('https://gachiwiki.info/api.php?action=query&titles='+page +'/' + lang +'&format=json', function(response) { | |||
console.log(response.query.pages); | |||
if(response.query.pages['-1']) | |||
return; | |||
else | |||
window.location.href = 'https://gachiwiki.info/wiki/' + page+'/' + lang; | |||
}); | |||
} | |||
if (window.history.replaceState) { | |||
if(window.location.pathname.slice(-3) == '/en') | |||
window.history.replaceState('wow', 'title', window.location.pathname.slice(0,-3)); | |||
} | |||
}()); | |||
var NAV_ORIENT_BOTTOM = 0; | var NAV_ORIENT_BOTTOM = 0; | ||
var NAV_ORIENT_TOP = 1; | var NAV_ORIENT_TOP = 1; |
edits