Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = function UseVector() {
- var li = document.createElement('li');
- var query = '';
- for(i in location.href.split('?')) {
- if(location.href.split('?')[i].split('=')[0] == 'title') {
- for(j = 1; j < location.href.split('?')[i].split('&').length; j++) {
- if(location.href.split('?')[i].split('&')[j].split('=')[0] != 'useskin') {query += '&' + location.href.split('?')[i].split('&')[j];}
- }
- }
- }
- if(skin == 'oasis') {
- li.innerHTML = '<a href="/index.php?title=' + wgPageName + query + '&useskin=vector">Vector</a>'
- document.getElementById('AccountNavigation').insertBefore(li, document.getElementById('AccountNavigation').firstChild);
- }
- if(skin == 'vector') {
- var url = '';
- var urlquery = '';
- var quot = '';
- var title = '';
- for(i = 0; i < document.getElementsByTagName('a').length; i++) {
- url = document.getElementsByTagName('a')[i].href;
- urlquery = '';
- if(url.indexOf('?') != -1) {
- quot = url.split('?');
- for(j in quot) {
- if(quot[j].split('=')[0] == 'title') {
- title = quot[j].split('=')[1].split('&')[0];
- for(k = 1; k < quot[j].split('&').length; k++) {
- if(quot[j].split('&')[k].split('=')[0] != 'useskin') {urlquery += '&' + quot[j].split('&')[k];}
- }
- }
- }
- }
- else {
- title = url.split('.')[url.split('.').length - 1].substring(url.split('.')[url.split('.').length - 1].indexOf('/', 4) + 1, url.length);
- }
- document.getElementsByTagName('a')[i].href = '/index.php?title=' + title + urlquery + '&useskin=vector';
- }
- li.innerHTML = '<a href="/wiki/' + wgPageName + query + '"><span>Oasis</span></a>'
- document.getElementById('p-namespaces').getElementsByTagName('ul')[0].appendChild(li);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment