User:Thright/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin can be added at User:Thright/monobook.css. |
<!-- QUICK NEWARTICLE -->
// This script adds a "new" tab to the top of article pages
// when in edit mode. It is disabled for the User namespace.
function doNewtag() {
document.editform.wpTextbox1.value = '{' + '{' + 'New|date=' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = 'Cleanup requested for new article.';
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
addOnloadHook(function() {
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
return;
}
if (document.editform) {
mw.util.addPortletLink("p-cactions", "javascript:doNewtag()", "new", "ca-new", "Cleanup requested for new article", "");
}
});
//
<!-- QUICK PROD-->
//From [[User:Mathwizard1232/monobook.js]]
//Quick proposed deletion
//<pre><nowiki>
function doProd()
{
var reason=prompt("Please enter reason for prod.")
if (reason != null && reason != "")
{
document.editform.wpTextbox1.value = "{{subst:prod|" + reason + "}}\n" + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = "[[WP:PROD|Proposed deletion]] - " + reason;
document.editform.wpMinoredit.checked = false;
document.editform.wpWatchthis.checked = true;
}
}
addOnloadHook(function() {
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
return;
}
if (document.editform) {
mw.util.addPortletLink("p-cactions", "javascript:doProd()", "prod", "ca-prod", "Proposed deletion", "");
}
});
//
//</nowiki></pre>
<!-- QUICK CATEGORIZE -->
// This script adds a "categorize" tab to the top of article pages
// when in edit mode. It is disabled for the User namespace.
function doUncategorized() {
document.editform.wpTextbox1.value = '{' + '{' + 'Uncategorized|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = 'Categories needed.';
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
addOnloadHook(function() {
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
return;
}
if (document.editform) {
mw.util.addPortletLink("p-cactions", "javascript:doUncategorized()", "Uncategorized", "ca-Uncategorized", "Categories needed", "");
}
});
//
<!-- QUICK SOURCES -->
// This script adds a "sources" tab to the top of article pages
// when in edit mode. It is disabled for the User namespace.
function doSources() {
document.editform.wpTextbox1.value = '{' + '{' + 'Sources|' + 'date=' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = 'Tagged for sources.';
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
addOnloadHook(function() {
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
return;
}
if (document.editform) {
mw.util.addPortletLink("p-cactions", "javascript:doSources()", "sources", "ca-sources", "Tag for sources", "");
}
});
//
<!-- QUICK CLEANUP -->
// CleanupTab.js
//
// This script adds a "cleanup" tab to the top of article pages
// when in edit mode. It is disabled for the User namespace.
function doCleanup() {
document.editform.wpTextbox1.value = '{' + '{' + 'Cleanup|date=' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = 'Marked for cleanup.';
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
addOnloadHook(function() {
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
return;
}
if (document.editform) {
mw.util.addPortletLink("p-cactions", "javascript:doCleanup()", "cleanup", "ca-cleanup", "Mark for cleanup", "");
}
});
//
<!-- QUICK WIKIFY -->
// <nowiki>If you are editing a page, click the wikify button on your tab bar to add "{{Wikify|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}" to the top, set "Marked for wikification." as the edit summary, mark it as a minor edit, and submit.</nowiki>
function doQwikify() {
document.editform.wpTextbox1.value = '{' + '{' + 'Wikify|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = 'Marked for wikification.';
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
addOnloadHook(function() {
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
// wouldn't it make more sense to just check for wgCanonicalNamespace != "", or am I missing something?
return;
}
if (document.editform) {
mw.util.addPortletLink("p-cactions", "javascript:doQwikify()", "wikify", "ca-wikify", "Mark for wikification", "");
}
});
// by [[User:Raylu|raylu]]
//
//
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+'&action=raw&ctype=text/javascript&dontcountme=s"'+gt+lt+'/script'+gt);
}
inc("User:Lightdarkness/aiv.js");
<!-- RECENT CHANGES -->
// Script from [[User:Lupin/recent2.js]]
mw.loader.load(
'http://en.wiki.x.io/w/index.php?title=User:Lupin/recent2.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
<!-- POPUPS -->
// [[User:Lupin/popups.js]]
importScript('User:Lupin/popups.js');
//
<!-- USER WARNING SCRIPT -->
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-vandalism" + number + "|" + page + "}} ~" + "~" + "~" + "~";
f.wpSummary.value = "Your edits to [[" + page + "]]";
f.wpMinoredit.checked = false;
f.wpWatchthis.checked = false;
}
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)',"t1"));
tabs.appendChild(tnaddlilink('javascript:testn(2)',"t2"));
tabs.appendChild(tnaddlilink('javascript:testn(3)',"t3"));
tabs.appendChild(tnaddlilink('javascript:testn(4)',"t4"));
}
}
addOnloadHook(add_testn_tabs);
//
<!--EASY DB-->
//<pre><nowiki>
//Please leave the following line
//[[user:Where/easy db]]
//Start db script
addOnloadHook(function()
{
//check if called from deletion request
if (document.title.indexOf("Editing ") != -1)
{
if (document.URL.lastIndexOf("&fakeaction=huff") == -1)
return;
if (document.URL.lastIndexOf("&reason=off") != -1)
{
var type = prompt("Enter criteria for speedy deletion, e.g. A1, G3");
var f = document.editform, t = f.wpTextbox1;
t.value = "{{db-" + type.toLowerCase() + "}}\n" + t.value;
f.wpSummary.value = "JS: Requesting speedy deletion ([[WP:CSD#" + type + "|CSD " + type + "]])";
f.wpMinoredit.checked = false;
f.wpWatchthis.checked = true;
<!-- // f.wpSave.click(); - don't automatically save -->
return;
}
else if (document.URL.lastIndexOf("&reason=on") != -1)
{
var type = prompt("Enter reason for speedy deletion");
var f = document.editform, t = f.wpTextbox1;
t.value = "{{db|" + type + "}}\n" + t.value;
f.wpSummary.value = "JS: Requesting speedy deletion ([[WP:CSD]]) – " + type;
f.wpMinoredit.checked = false;
f.wpWatchthis.checked = true;
<!-- // f.wpSave.click(); - don't automatically save -->
return;
}
}
if (wgCanonicalNamespace == "Special")
return;
mw.util.addPortletLink("p-cactions", "javascript:easyDb(0)", "db (csd)", "ca-db0", "Request speedy deletion according to WP:CSD", "");
mw.util.addPortletLink("p-cactions", "javascript:easyDb(1)", "db (reason)", "ca-db1", "Request speedy deletion with reason", "");
});
function easyDb(n)
{
if (n == 0)
{
//edit page
location.assign("/w/index.php?title=" + wgPageName + "&action=edit&fakeaction=huff&reason=off");
}
if (n == 1)
{
//edit page
location.assign("/w/index.php?title=" + wgPageName + "&action=edit&fakeaction=huff&reason=on");
}
}
//End db script
//</nowiki></pre>
<!--TWINKLE-->
importScript('User:AzaToth/morebits.js');
importScript('User:AzaToth/twinklexfd.js');
importScript('User:AzaToth/twinklewarn.js');
importScript('User:AzaToth/twinkleprotect.js');
importScript('User:AzaToth/twinklearv.js');
TwinkleConfig = {
showSharedIPNotice : true,
summaryAd : " using [[WP:TWINKLE|TW]]",
deletionSummaryAd : " using [[WP:TWINKLE|TW]]",
protectionSummaryAd : " using [[WP:TWINKLE|TW]]",
watchWarnings : false,
markAIVReportAsMinor : false,
};
<!-- HIDE MY CONTRIBS -->
// [[User:Ais523/hidetopcontrib.js]]
// By a suggestion by [[User:Discospinster]]
// This script color-codes lines according to who has the top contribution for a page.
//<pre><nowiki>
function hidetopcontrib()
{
var i,li,a;
li=document.getElementById("bodyContent");
li=li.getElementsByTagName("li");
i=-1;
a=new Array();
while(++i<li.length)
{
var s,t;
t=li[i].innerHTML.match(/"\/wiki\/([^"]*)"/)[1];
if(li[i].getElementsByTagName("strong").length>0)
s="none";
else
s="";
if(a[t]!=undefined) s=a[t]; else a[t]=s;
if(s!="") li[i].style.display=(li[i].style.display=="none"?"list-item":"none");
}
}
addOnloadHook(function () {
if((location.href.indexOf("Special:Contributions")!=-1||
location.href.indexOf("Special%3AContributions")!=-1)
&&location.href.indexOf("&ais523")==-1&&location.href.indexOf("?ais523")==-1)
mw.util.addPortletLink('p-cactions', 'javascript:hidetopcontrib()', 'show/hide top', 'ca-hidetop',
"Show/hide pages for which you're the top contributor", '');
});
//</nowiki></pre>
//[[Category:Wikipedia scripts]]
<!-- WIKED -->
// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://en.wiki.x.io/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');
<!-- USER WATCH -->
importScript('User:Tra/userwatchlist.js'); //[[User:Tra/userwatchlist.js]]