Utilizador:Marcelo-Silva/monobook.js

Origem: Wikilivros, livros abertos por um mundo aberto.

Nota: Depois de publicar, poderá ter de contornar a cache do seu navegador para ver as alterações.

  • Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
  • Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
  • Internet Explorer / Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5
  • Opera: Pressione Ctrl-F5.
function a1(){anchors=document.getElementById('content').getElementsByTagName('A');
for(i=0;i<anchors.length;i++){
anchors[i].setAttribute('onmouseover','a2("'+anchors[i].href+'")');
anchors[i].setAttribute('onclick','click2("'+anchors[i].href+'");return false;');
anchors[i].setAttribute('onmouseout','a3()');}}
var b=0;var url;
function a2(pp){b=1; if(pp.indexOf("index.php?")==-1){url='/w/index.php?title='+pp.substring(29,pp.length)+'&action=edit';}else{url=pp;}}
function a3(){b=1;}function click(evt){k=evt.keyCode; if(k==113&&b==1){b=2;window.focus();} }function click3(){b=1;}
function click2(cc){if(b==2){window.open(url,'_blank');window.focus();}else{window.location=cc;}}

window.onload = a1;
window.onkeydown = click;
window.onkeyup = click3;