Utilizador:Snakesteuben/monobook.js

Origem: Wikcionário, o dicionário livre.
Nota: Após salvar, você terá de limpar a cache do seu navegador para ver as alterações:
  • Internet Explorer: Mantenha pressionada a tecla Ctrl e aperte F5; ou mantenha pressionada a tecla Ctrl e clique no botão "Recarregar" (Reload)
  • Firefox e SeaMonkey: Mantenha pressionada a tecla Shift ⇧ e clique no botão "Recarregar" (Reload ou Atualizar) ou mantenha pressionada a tecla Ctrl e aperte F5; ou mantenha pressionada as teclas Ctrl, Shift ⇧ e R (Command ⌘, Shift ⌥ e R em Macintosh)
  • Safari e Konqueror: Clique no botão "Recarregar" (Reload)
  • Opera: É necessário limpar manualmente a cache no menu "Ferramentas"→"Preferências"→"Avançadas"→"Histórico" e clicar no botão "Esvaziar Já"
  • Chrome: É necessário limpar manualmente a cache no botão "Ferramentas"→"Limpar dados de navegação", selecione "Esvaziar o cache" e clicar no botão "Limpar dados de navegação"
 /* Everything here was adapted from either: en.wikipedia/Jsimlo/shortcuts.js, or */
 /* Spacebirdy on meta. For best results you should probably go to the source. -Winter */

 /*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);

 /*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

 /*********** Botonera ***********/

 function loadButtons()
 {
 var buttons = '<div>';
 /*  %%% Begin drawing buttons %%% */
 /* Botón blueback */
 buttons += '<a class="mybutton" title="Spacebirdys kewl colour scheme" href="javascript:BlueBack()" style="background:gold" ><code style="background:gold">:\)</code></a>';

 /* Botón small */
 buttons += '<a class="mybutton" title="Código para escribir texto en letra pequeña" href="javascript:small()" style="background:skyblue"><code style="background:skyblue"><small>p</small></code></a>';

 /* Botón big */
buttons += '<a class="mybutton" title="Código para escribir texto en letra grande" href="javascript:big()" style="background:lightskyblue"><code style="background:lightskyblue"><big>G</big></code></a>';

 /* Button red */
buttons += '<a class="mybutton" title="red" href="javascript:red()" style="background:red"><code style="background:red"><big>R</big></code></a>';

 /* Botón iswikt: Frysk header*/
 buttons += '<a class="mybutton" title="fyHead" href="javascript:fyHead()" style="background:deepskyblue"><code style="background:deepskyblue">S</code></a>';

 /* Botón t+fy: Ingelsk site, oersettings section */
 buttons += '<a class="mybutton" title="fy translation insert" href="javascript:advBeyging()" style="background:dodgerblue"><code style="background:dodgerblue">f0</code></a>';

 /* Botón t+fy: Ingelsk site, oersettings section */
 buttons += '<a class="mybutton" title="fy translation insert" href="javascript:advBeyging()" style="background:green"><code style="background:green">fc</code></a>';

 /* Botón en-N */
 buttons += '<a class="mybutton" title="Ingelsk noun template" href="javascript:enN()" style="background:mistyrose"><code style="background:mistyrose">eN</code></a>';

 /* Botón en-translation line */
 buttons += '<a class="mybutton" title="Ingelsk oersetting lyn" href="javascript:engTran()" style="background:lavenderblush"><code style="background:lavenderblush">eO</code></a>';

 /* Botón de */
 buttons += '<a class="mybutton" title="Hallo" href="javascript:de()" style="background:mistyrose"><code style="background:mistyrose">de</code></a>';

 /* Botón stq */
 buttons += '<a class="mybutton" title="stq" href="javascript:stq()" style="background:lavenderblush"><code style="background:lavenderblush">T</code></a>';

 /* Botón bywurd/adverb */
 buttons += '<a class="mybutton" title="adv" href="javascript:adv()" style="background:lightcoral"><code style="background:lightcoral">Av</code></a>';

 /* Botón conj/bynwurd */
 buttons += '<a class="mybutton" title="cj/bynwurd" href="javascript:conj()" style="background:lightgrey"><code style="background:lightgrey">cj</code></a>';

 /* Botón Contribs. */
 buttons += '<a class="mybutton" title="Special:Contributions" href="javascript:spContrib()" style="background:silver"><code style="background:silver">C</code></a>';

 /* Botón clearall. */
 buttons += '<a class="mybutton" title="clearall" href="javascript:clearAll()" style="background:WhiteSmoke"><code style="background:WhiteSmoke">/</code></a>';

 /* Botón sigh */
 buttons += '<a class="mybutton" title="<pre>" href="javascript:ponPre()" style="background:thistle"><code style="background:thistle;font-size:80%">pre</code></a>';

 /* Botón Uetrad */
 buttons += '<a class="mybutton" title="Ü" href="javascript:Uetrad()" style="background:lightsteelblue"><code style="background:lightsteelblue">*</code></a>';

 /* Botón iswikt: Önnur orð með sömu fallbeygingu */
 buttons += '<a class="mybutton" title="Önnur orð" href="javascript:oennurOrd()" style="background:azure"><code style="background:azure">Ö</code></a>';

 /* Botón iswikt: ref-icelandiconlinedictionary */
 buttons += '<a class="mybutton" title="Icelandic Online Dictionary" href="javascript:iceOnline()" style="background:paleturquoise"><code style="background:paleturquoise">1</code></a>';

 /* Botón iswikt: ref-orðabanki */
 buttons += '<a class="mybutton" title="Orðabanki" href="javascript:ordabanki()" style="background:paleturquoise"><code style="background:paleturquoise">2</code></a>';

 /* Botón iswikt: ref-orðabók háskólans*/
 buttons += '<a class="mybutton" title="Orðabók Háskólans" href="javascript:ordabokhaskolans()" style="background:lightcyan"><code style="background:lightcyan">3</code></a>';

 /* Botón iswikt: Hugtakasafn Þýðingamiðstöðvar utanríkisráðuneytis*/
 buttons += '<a class="mybutton" title="Hugtakasafn Þýðingamiðstöðvar utanríkisráðuneytis" href="javascript:hugtakasafn()" style="background:lightcyan"><code style="background:lightcyan">4</code></a>';
/* %%% End of button drawing %%% */

 buttons += '</div>'; 

 var toolbox = document.getElementById("p-navigation");
 toolbox.innerHTML += '<h5>Mi botonera</h5>'+buttons;
 }

 function BlueBack()
 {insertTags('<code style="background:steelblue;color:white">','</code>','');}

 function small ()
 {insertTags('<small>','</small>','');}

 function big ()
 {insertTags('<big>','</big>','');}

 function red ()
 {insertTags('<font color=red>','</font>','');}

 function fyHead ()
 {insertTags('==Frysk==\n',' ','');}

 function noun ()
 {insertTags('===noun===\n','');}

 function enN ()
 {insertTags('{{subst:en-N|','}}','');}

 function engTran ()
 {insertTags(':*{{eng}}: {{trad|en|','}}','');}

 function de ()
 {insertTags('==Dútsk==','');}

 function stq ()
 {insertTags('==Sealterfrysk==','');}

 function adv ()
 {insertTags('===bywurd===','');}

 function conj ()
 {insertTags('===bynwurd===','');}

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

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

 function ponPre ()
 {insertTags('<pre>','</pre>','');}

 function Uetrad ()
 {insertTags('*{{is}}: [1] <nowiki>{{Ü|is|','}}</nowiki>','');}

 function oennurOrd ()
 {insertTags('[[Kerfissíða:Whatlinkshere/Snið:Fallbeyging ','|Önnur orð með sömu fallbeygingu]]','');}

 function iceOnline ()
 {insertTags('<nowiki>{{Ref-IcelandicOnlineDictionary|','}}</nowiki>\n<!-- á= %E1, ð= %F0, é= %E9, í=%ED, ó= %F3, ú= %FA, ý= %FD, þ=%FE, æ= %E6, ö= %F6 -->','');}

 function ordabanki ()
 {insertTags('<nowiki>{{Ref-Orðabanki|','}}</nowiki>','');}

 function ordabokhaskolans ()
 {insertTags('<nowiki>{{Ref-Orðabók Háskólans|','}}</nowiki>\n<!-- á= %E1, ð= %F0, é= %E9, í=%ED, ó= %F3, ú= %FA, ý= %FD, þ=%FE, æ= %E6, ö= %F6 -->','');}

 function hugtakasafn ()
 {insertTags('<nowiki>{{Ref-Hugtakasafn|','}}</nowiki>\n<!-- á= %E1, ð= %F0, é= %E9, í=%ED, ó= %F3, ú= %FA, ý= %FD, þ=%FE, æ= %E6, ö= %F6 -->','');}

 /******* from Spacebirdy, who got it from Connel ****/

function addLoadEvent(func) {
 if (window.addEventListener) 
   window.addEventListener("load", func, false);
 else if (window.attachEvent) 
   window.attachEvent("onload", func);
}

addLoadEvent( loadButtons );

 /*********** Fin botonera ************/

 /*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

 /*********** arkkiste *************/
 /* Selsadvys: fy/stq where the admin-oriented links are actually useful */
 /* to me use a different naming convention; wiki rather than special. */
 /* those alias correctly ONLY if you use an html external link. */
  
 function shortcutsInit ()
 {
  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 ('Where are MY fucking pages?', 'Special:Prefixindex/User:Snakesteuben');
  shortcutsAddLink ('Shortpages', 'Special:Shortpages');
  shortcutsAddLink ('current', ':en:Category:Frisian language');
  shortcutsAddLink ('Greasepit', ':en:Wiktionary:Grease pit');
  shortcutsAddLink ('Refresh server cache, current page', '[http://en.wiktionary.org/w/index.php?title={{BASEPAGENAME}}&action=purge]');
}

/* 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';
}