User:MER-C/monobook.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

// <pre><nowiki>
function inc (file) {
  var lt = String.fromCharCode(60);
  var gt = String.fromCharCode(62);
  document.writeln(lt+'script type="text/javascript" src="/w/index.php?title='+file+'&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"'+gt+lt+'/script'+gt);
}

inc("User:VoA/monobook.js");

// popup customisation
popupSubpopups = false;
popupImages = false;

// speedy deletion warning

function dbwarn()
{
  var title = document.title.substr(0, document.title.lastIndexOf(' - Wikipedia, the free'));
  if (title.indexOf("Editing User talk") != -1)
  {
    var type = prompt("Enter page up for speedy deletion");
    if (type == null)
      return;
    var f = document.editform, t = f.wpTextbox1;
    t.value = t.value + "\n{{subst:nn-warn|" + type + "}} ~~~~ \n" ;
    f.wpSummary.value = "User notice: nn-warn";
    f.wpSave.click();
    return;
  }
}

addOnloadHook(function()
{
  if (document.title.indexOf("Editing User talk:") != -1)
  {
    var c1 = document.getElementById('column-one'); 
    var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
    tabs.appendChild(tnaddlilink('javascript:dbwarn()',"nn"));

  // {{spam4im}} warning
  tabs.appendChild(tnaddlilink('javascript:spam4im()',"s4im"));
  }
});

// {{spam4im}} warning
function spam4im()
{
  var f = document.editform, t = f.wpTextbox1;
  t.value = t.value + "\n{{subst:spam4im}} ~~~~ \n" ;
  f.wpSummary.value = "warning user (spam4im)";
}
//</nowiki></pre>
// [[Category:Wikipedians who use RC script]]