Jump to content

User:Macy/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Macy (talk | contribs) at 23:38, 18 February 2009 (fixing (again)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//<nowiki>
if (mwCustomEditButtons) {
    mwCustomEditButtons.push({
        "imageFile": "/media/wikipedia/commons/7/7e/Bouton_Vandale4.png",
        "speedTip": "MfD close (Delete)",
        "tagOpen": "{{subst:MfD top}} '''Delete''' (non-admin closure). ~~~~\n",
        "tagClose": "\n{{subst:MfD bottom}}",
        "sampleText": ""
    });
 
    mwCustomEditButtons.push({
        "imageFile": "/media/wikipedia/commons/5/5b/Button_check.png",
        "speedTip": "MfD close (Keep)",
        "tagOpen": "{{subst:MfD top}} '''Keep''' (non-admin closure). ~~~~\n",
        "tagClose": "\n{{subst:MfD bottom}}",
        "sampleText": ""
    });

}
//</nowiki>

function tnaddlilink(url, name)
{
  var na = document.createElement('a');
  na.setAttribute('href', url);

  var txt = document.createTextNode(name);
  na.appendChild(txt);

  var li = document.createElement('li');
  li.appendChild(na);
  return li;
}

function testn(number)
{
  var page = prompt("Vandalism to which article?")
  var f = document.editform, t = f.wpTextbox1;
  if (t.value.length > 0)
    t.value += '\n';
  t.value += "{{subst:" + "uw-vand" + number + "|" + page + "}} ~" + "~" + "~" + "~";
  f.wpSummary.value = "User warning: Vandalism to [[" + page + "]]";
}

function add_testn_tabs()
{
  var c1 = document.getElementById('column-one');
  var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];

  // Only add for pages with "Editing User talk:" somewhere in the title
  if (document.title.indexOf("Editing User talk:") != -1)
    {
      tabs.appendChild(tnaddlilink('javascript:testn(1)',"1"));
      tabs.appendChild(tnaddlilink('javascript:testn(2)',"2"));
      tabs.appendChild(tnaddlilink('javascript:testn(3)',"3"));
      tabs.appendChild(tnaddlilink('javascript:testn(4)',"4"));
    }
}

addOnloadHook(add_testn_tabs);


//FastButtons 1.0
importScript('User:Macy/FastButtons.js');

/**** quick image delete ****/
document.write('<script type="text/javascript"' +
  'src="http://en.wikipedia.org/w/index.php?title=User:Howcheng/quickimgdelete.js' +
  '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

//[[User:Macy/Deluxe]]
importScript('User:Macy/deluxetool.js');

importScript('User:Ais523 non-admin/adminrights.js');

// [[User:Henrik/live-edit-counter]]
importScript('User:Henrik/js/live-edit-counter.js');

// New Page Patroller
importScript('User:TheJosh/Scripts/NewPagePatrol.js');
npp_enabled = true;

//Mr.Z-man AFD tool
importScript('User:Mr.Z-man/closeAFD.js');

//Status changer 
var pagina =''; var mot=''; var txt=''; var botones=''; var usuario=''; var temporal=''
var es = ' using  [[User:Macy/monobook.js|qStatus]]';

addOnloadHook((function (){ 
    var wrapper = document.getElementById("globalWrapper");
    if (wrapper) {
        var div = document.createElement('div');
        div.id = "status-changer";
        div.style.cssText = "position:absolute; z-index:40; left:155px; top:1px; clear:both; float:left; font-size:90%; font-style:normal; white-space:nowrap";
        div.innerHTML = '[<a href="http://en.wikipedia.org/w/index.php?title=User:'+wgUserName+'/Status&action=edit&status=in" title="Change status to in"><b>in</b></a>] [<a href="http://en.wikipedia.org/w/index.php?title=User:'+wgUserName+'/Status&action=edit&status=busy" title="Change status to busy"><b>busy</b></a>] [<a href="http://en.wikipedia.org/w/index.php?title=User:'+wgUserName+'/Status&action=edit&status=irc" title="Change status to on IRC"><b>irc</b></a>] [<a href="http://en.wikipedia.org/w/index.php?title=User:'+wgUserName+'/Status&action=edit&status=away" title="Change status to away"><b>away</b></a>] [<a href="http://en.wikipedia.org/w/index.php?title=User:'+wgUserName+'/Status&action=edit&status=out" title="Change status to out"><b>out</b></a>]';
        wrapper.insertBefore(div, wrapper.firstChild);
    }
}));
 
addOnloadHook(function ()
{

if (location.href.match("status=in")) 
{
	txt=document.getElementById("wpTextbox1").value;
	if (txt.match("1")==null)
	{
		txt= '1';
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Status update: in'+es;
		document.editform.wpMinoredit.checked = true;
		document.editform.submit();
	}
}
 
else if (location.href.match("status=busy")) 
{
	txt=document.getElementById("wpTextbox1").value;
	if ((txt.match("2")==null))
	{
		txt= '2';
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Status update: busy'+es;
		document.editform.wpMinoredit.checked = true;
		document.editform.submit();
	}
}
 
else if (location.href.match("status=irc")) 
{
	txt=document.getElementById("wpTextbox1").value;
	if ((txt.match("3")==null))
	{
		txt= '3';
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Status update: on IRC'+es;
		document.editform.wpMinoredit.checked = true;
		document.editform.submit();
	}
}
 
else if (location.href.match("status=out")) 
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("5")==null))
	{
		txt= '5';
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Status update: out'+es;
		document.editform.wpMinoredit.checked = true;
		document.editform.submit();
	}
}
 
else if (location.href.match("status=away"))
{
	txt=document.getElementById("wpTextbox1").value
	if ((txt.match("4")==null))
	{
		txt= '4';
		document.getElementById ("wpTextbox1").value=txt;
		document.editform.wpSummary.value = 'Status update: away'+es;
		document.editform.wpMinoredit.checked = true;
		document.editform.submit();
	}
}
 
 
 
 
});