User:Snakesteuben/monobook.js

/*** Note: for some unknown reason, what is p-navigation on every other wiki site ***/ /*** I've messed with is p-Navigation here ***/

/*********** Knopkes ***********/

function loadButtons { var buttons = ' '; /* %%% Begjin fan knopkes %%% */ /* Kleuren en tekst formaat seksje */

/* Knopke blauruk */

buttons += ' ';

/* Knopke lyts */ buttons += ' ';

/* Knopke grut */ buttons += ' ';

/* Knopke read */ buttons += ' ';

/* Wurd OANMEITJSE seksje */

/* Fryske side - dodger blue*/

/* Engelske side deepskyblue*/ /* Knopke fyNPL */ buttons += ' ';

/* Knopke fy-head: Ingelsk side, Frysk wurd generic */ buttons += ' ';

/* Knopke fy: Ingelsk side, haadwurd ferbûging berjocht */ buttons += ' ';

/* Dútske side pale turquoise (other lightcyan -- thistle) */ /* OERSETTINGS */

/* Fryske side darkgreen*/ buttons += ' ';

buttons += '<a class="mybutton" title="fy side Ingelsk oersetting" href="javascript:fyEnTr" style="background:darkgreen"> </a>';

buttons += '<a class="mybutton" title="fy side Dútsk oersetting" href="javascript:fyDeTr" style="background:darkgreen"> </a>';

/* Ingelske side yellowgreen*/ /* Knopke t (neu) */ buttons += '<a class="mybutton" title="Ingelske side Frysk oersetting t (net witte)" href="javascript:enFyT" style="background:yellowgreen"> </a>'; /* Knopke t+fy: Ingelske side, oersettings seksje */ buttons += '<a class="mybutton" title="Ingelske side Frysk oersetting plus (it stiet op Fryske side)" href="javascript:enFyTplus" style="background:yellowgreen"> </a>';

/* Dútske side #6ef7a7 (others lightgreen)*/ /* Knopke Ütrad */ buttons += '<a class="mybutton" title="de-Ütrad" href="javascript:Uetrad" style="background:#6ef7a7"> </a>'; buttons += '<a class="mybutton" title="de-Ütrad-fy" href="javascript:fyUetrad" style="background:#6ef7a7"> </a>'; buttons += '<a class="mybutton" title="de-Ütrad-en" href="javascript:enUetrad" style="background:#6ef7a7"> </a>'; /* Knopke niu */ buttons += '<a class="mybutton" title="not in use" href="javascript:niu" style="background:mistyrose"> </a>';

/* Knopke test */ buttons += '<a class="mybutton" title="Test" href="javascript:test" style="background:lavenderblush"> </a>';

/* Knopke kat */ buttons += '<a class="mybutton" title="not in use" href="javascript:ponKat" style="background:lightcoral"> </a>';

/* Knopke subst */ buttons += '<a class="mybutton" title="Baustein mit subst" href="javascript:ponSubst" style="background:lightgrey"> </a>';

/* Knopke Contribs. */ buttons += '<a class="mybutton" title="Special:Contributions" href="javascript:spContrib" style="background:silver"> </a>';

/* Knopke clearall. */ buttons += '<a class="mybutton" title="clearall" href="javascript:clearAll" style="background:WhiteSmoke"> </a>';

/* Knopke SAS */ buttons += '<a class="mybutton" title=" " href="javascript:SAS" style="background:thistle"> </a>';

/* Knopke python */ buttons += '<a class="mybutton" title=" " href="javascript:python" style="background:thistle"> </a>';

/* Knopke iswikt: Önnur orð með sömu fallbeygingu */ buttons += '<a class="mybutton" title="not in use" href="javascript:niu" style="background:azure"> </a>';

/* Knopke */ buttons += '<a class="mybutton" title="niu" href="javascript:niu" style="background:paleturquoise"> </a>';

/* Knopke */ buttons += '<a class="mybutton" title="niu" href="javascript:niu" style="background:paleturquoise"> </a>';

/* Knopke iswikt: ref-orðabók háskólans*/ buttons += '<a class="mybutton" title="niu" href="javascript:niu" style="background:lightcyan"> </a>';

/* Knopke iswikt: Hugtakasafn Þýðingamiðstöðvar utanríkisráðuneytis*/ buttons += '<a class="mybutton" title="niu" href="javascript:niu" style="background:lightcyan"> </a>';

buttons += ' ';

var toolbox = document.getElementById("p-Navigation"); toolbox.innerHTML += ' Myn knopkes '+buttons;

}

/* tekst */ function BlueBack {insertTags(' ','');}

function small {insertTags(' ',' ','');}

function big {insertTags(' ',' ','');}

function reade {insertTags(' ',' ','');}

/* neu wurd */ /* fryske side */ /* ingelske side */ function fyNPL {insertTags(,,'');}

function fyInoun {insertTags(,);}

function fyHead {insertTags('==West Frisian==\n===','===\n\n#\n\n','');}

/* Dútske side */ function niu {insertTags(,);}

/* Oersettings line*/ /* Fryske side */ function fyEnTr {insertTags(':*: ','');} function fyDeTr {insertTags(':*: ','');} function fyTr {insertTags(':*:  – ','');} /* Ingelske side */

function enFyTplus {insertTags('* West Frisian: ','');}

function enFyT {insertTags('* West Frisian: ',,);} /* Dútske side */

function Uetrad {insertTags('*: [1] ','');}

function fyUetrad {insertTags('*: [1] ','');}

function enUetrad {insertTags('*: [1] ','');}

function hallo {insertTags(,);}

function test {insertTags(,);}

function ponSubst {insertTags(,);}

function spContrib {insertTags('Special:Contributions/',,);}

function clearAll {insertTags('<br clear="all"','>','');}

function SAS {insertTags(' ','');}

function python {insertTags(' ','');}

function addLoadEvent(func) {

if (window.addEventListener) window.addEventListener("load", func, false); else if (window.attachEvent) window.attachEvent("onload", func);

}

addLoadEvent( loadButtons );

/*********** Fin Knopkes ************/

/*Function to make shortcut toolbar. Adapted from en.wikipedia/Jsimlo/shortcuts.js*/

/*********************************************************** * INTERFACE ***********************************************************/

/** * Starts a new section of links. Function for external use. */ function shortcutsStartSection (name) {  shortcutsLinks[shortcutsLinks.length] = { 'name': name, 'links': new Array  }; }

/** * Adds new link into the current section of links. Function for external use. */ function shortcutsAddLink (name, article) {  var links = shortcutsLinks[shortcutsLinks.length - 1]['links'];

links[links.length] = { 'name': name, 'article': article }; }

/*********************************************************** * IMPLEMENTATION ***********************************************************/

/** * Link maker. * Creates and returns an li element with the desired link. */ function shortcutsMakeLink (name, url) {  var ntxt = document.createTextNode (name); var na  = document.createElement ('a'); var nli = document.createElement ('li');

na.setAttribute ('href', '/wiki/' + url); nli.setAttribute ('class', 'n-shortcut');

na.appendChild (ntxt); nli.appendChild (na);

return nli; }

/** * Portlet maker. * Creates and returns a portlet populated by list of links. */ function shortcutsMakePortlet (name, links) {  var nportlet = document.createElement ('div'); var nh5 = document.createElement ('h5'); var ntit = document.createTextNode (name); var nbody = document.createElement ('div'); var nul = document.createElement ('ul');

nportlet.setAttribute ('id', 'p-'+name); nportlet.setAttribute ('class', 'portlet'); nbody.setAttribute ('class', 'pBody'); nul.setAttribute ('id', 'p-'+name);

for (var i = 0; i < links.length; i++) nul.appendChild (      shortcutsMakeLink (links[i]['name'], links[i]['article'])     );

nh5.appendChild (ntit); nportlet.appendChild (nh5); nbody.appendChild (nul); nportlet.appendChild (nbody);

return nportlet; }

/** * Main function. * Enumerates all non-empty sections, and adds new portlets beneath the old ones. */ function shortcutsMain {  var sidecol = document.getElementById ('column-one');

for (var i = 0; i < shortcutsLinks.length; i++) if (shortcutsLinks[i]['links'].length > 0) sidecol.appendChild (        shortcutsMakePortlet (shortcutsLinks[i]['name'], shortcutsLinks[i]['links'])       ); }

/** * Initializes the onload events. */ function shortcutsInitialize {  shortcutsInit ; shortcutsMain ; }

/*********************************************************** * INITIALIZATION ***********************************************************/

var shortcutsLinks = new Array ; shortcutsStartSection (wgUserName ? wgUserName : 'shortcuts');

addOnloadHook (shortcutsInitialize);

function shortcutsInit { shortcutsAddLink ('current', 'Category:Frisian language'); shortcutsAddLink ('current2', 'Category:Translations to be checked (Frisian)'); shortcutsAddLink ('System messages', 'Special:Allmessages'); shortcutsAddLink ('New pages', 'Special:Newpages'); shortcutsAddLink ('IP Blocklist', 'Special:Ipblocklist'); shortcutsAddLink ('List sysop users', 'Special:Listusers/sysop'); shortcutsAddLink ('Linksearch', 'Special:Linksearch'); shortcutsAddLink ('PrefixIndex', 'Special:Prefixindex'); shortcutsAddLink ('Shortpages', 'Special:Shortpages'); shortcutsAddLink ('Greasepit', 'Wiktionary:Grease pit'); shortcutsAddLink ('Refresh server cache, current page', ''); } /* from de.wikipedia.org/Benutzer:Luxo/gwatch.js */ //LINK AUF gWatch OBEN NACH "BEOBACHTEN" $(function { //funktion mw.util.addPortletLink von wikibits.js wird verwendet! if (!(hist = document.getElementById('ca-watch') )) { if (!(hist = document.getElementById('ca-unwatch') )) return; }  var url;   if (!(url = hist.getElementsByTagName('a')[0] )) return;   if (!(url = url.href )) return; mw.util.addPortletLink('p-cactions', "javascript:addiframe;", "gWatch", 'ca-gwatch', 'Beobachten mit gWatch', 'b', hist.nextSibling); }); //FUNKTION UM IFRAME HINZUZUFÜGEN function addiframe{ //alle attribute kreieren var pfad = document.createAttribute("src"); pfad.nodeValue = "http://tools.wikimedia.de/~luxo/gwatch/edit.php?action=addirfromwiki&page="+wgPageName+"&pageid="+wgArticleId+"&wiki="+wgServer+"&username="+wgUserName; var breite = document.createAttribute("width"); breite.nodeValue = "60%"; var scroll = document.createAttribute("scrolling"); scroll.nodeValue = "no"; var marginheight = document.createAttribute("marginheight"); marginheight.nodeValue = "0"; var marginwidth = document.createAttribute("marginwidth"); marginwidth.nodeValue = "0"; var frameborder = document.createAttribute("frameborder"); frameborder.nodeValue = "0"; var gWid = document.createAttribute("id"); gWid.nodeValue = "gWatchframe"; //element kreieren var myiframe = document.createElement("iframe"); //alle anhängen myiframe.setAttributeNode(pfad); myiframe.setAttributeNode(breite); myiframe.setAttributeNode(scroll); myiframe.setAttributeNode(marginheight); myiframe.setAttributeNode(frameborder); //mit Center umfassen var mycenter = document.createElement("center"); mycenter.setAttributeNode(gWid);//ID anhängen mycenter.appendChild(myiframe);//Einfügen document.getElementById("bodyContent").insertBefore(mycenter, document.getElementById("siteSub")); setTimeout("hidegWatch", 10000); } function hidegWatch{ document.getElementById("gWatchframe").style.display = 'none'; }