Użytkownik:Botyzjusz I/monobook.js: Różnice pomiędzy wersjami

Z Nonsensopedii, polskiej encyklopedii humoru
Linia 22: Linia 22:
return;
return;
}
}
document.getElementById("wpTextbox1").innerHTML = document.getElementById("wpTextbox1").innerHTML.replace(/\<br clear=\"?all\"?\s*\/?\s*\>\n*/gi, "");
nowytekst = document.getElementById("wpTextbox1").innerHTML.replace(/\<br clear=\"?all\"?\s*\/?\s*\>\n*/gi, "");
zmienilosie = (document.getElementById("wpTextbox1").innerHTML == nowytekst);
if(!zmienilosie) return;
document.getElementById("wpTextbox1").innerHTML = nowytekst;
document.getElementById("wpSummary").value = "Bot usuwa: <br clear=\"all\">";
document.getElementById("wpSummary").value = "Bot usuwa: <br clear=\"all\">";
document.getElementById("editform").submit();
document.getElementById("editform").submit();

Wersja z 13:55, 4 maj 2012

/*
addOnloadHook(function(){
    if(wgPageName != "Nonsensopedia:Ankiety/propozycje") return;
    var content = document.getElementById("bodyContent");
    var h2 = content.getElementsByTagName("h2");
    for(i in h2)
    {
        if(h2[i].parentNode.getAttribute("id") == "toctitle") continue;
        var ul = h2[i].nextSibling;
        if(ul.nodeName == "#text") ul = ul.nextSibling; 
        var text = "";
    }
});
*/


addOnloadHook(function(){
  if(wgPageName.indexOf("Szablon:") != 0) return; 
  if(wgAction != "edit") 
  {
    location.href+="?action=edit";
    return;
  }
  nowytekst = document.getElementById("wpTextbox1").innerHTML.replace(/\<br clear=\"?all\"?\s*\/?\s*\>\n*/gi, "");
  zmienilosie = (document.getElementById("wpTextbox1").innerHTML == nowytekst);
  if(!zmienilosie) return;
  document.getElementById("wpTextbox1").innerHTML = nowytekst;
  document.getElementById("wpSummary").value = "Bot usuwa: <br clear=\"all\">";
  document.getElementById("editform").submit();
});