Monchoman45

UseVector

Apr 23rd, 2011
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.onload = function UseVector() {
  2.     var li = document.createElement('li');
  3.     var query = '';
  4.     for(i in location.href.split('?')) {
  5.         if(location.href.split('?')[i].split('=')[0] == 'title') {
  6.             for(j = 1; j < location.href.split('?')[i].split('&').length; j++) {
  7.                 if(location.href.split('?')[i].split('&')[j].split('=')[0] != 'useskin') {query += '&' + location.href.split('?')[i].split('&')[j];}
  8.             }
  9.         }
  10.     }
  11.     if(skin == 'oasis') {
  12.         li.innerHTML = '<a href="/index.php?title=' + wgPageName + query + '&useskin=vector">Vector</a>'
  13.         document.getElementById('AccountNavigation').insertBefore(li, document.getElementById('AccountNavigation').firstChild);
  14.     }
  15.     if(skin == 'vector') {
  16.         var url = '';
  17.         var urlquery = '';
  18.         var quot = '';
  19.         var title = '';
  20.         for(i = 0; i < document.getElementsByTagName('a').length; i++) {
  21.             url = document.getElementsByTagName('a')[i].href;
  22.             urlquery = '';
  23.             if(url.indexOf('?') != -1) {
  24.                 quot = url.split('?');
  25.                 for(j in quot) {
  26.                     if(quot[j].split('=')[0] == 'title') {
  27.                         title = quot[j].split('=')[1].split('&')[0];
  28.                         for(k = 1; k < quot[j].split('&').length; k++) {
  29.                             if(quot[j].split('&')[k].split('=')[0] != 'useskin') {urlquery += '&' + quot[j].split('&')[k];}
  30.                         }
  31.                     }
  32.                 }
  33.             }
  34.             else {
  35.                 title = url.split('.')[url.split('.').length - 1].substring(url.split('.')[url.split('.').length - 1].indexOf('/', 4) + 1, url.length);
  36.             }
  37.             document.getElementsByTagName('a')[i].href = '/index.php?title=' + title + urlquery + '&useskin=vector';
  38.         }
  39.  
  40.         li.innerHTML = '<a href="/wiki/' + wgPageName + query + '"><span>Oasis</span></a>'
  41.         document.getElementById('p-namespaces').getElementsByTagName('ul')[0].appendChild(li);
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment