User:MarkS/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 is at User:MarkS/monobook.css. |
importScript('User:AzaToth/morebits.js');
importScript('User:AzaToth/twinklefluff.js');
importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
importScript('User:AzaToth/twinklewarn.js');
importScript('User:AzaToth/twinklearv.js');
importScript('User:AzaToth/twinklespeedy.js');
importScript('User:AzaToth/twinklediff.js');
TwinkleConfig = {
revertMaxRevisions : 50,
userTalkPageMode : 'window',
showSharedIPNotice : true,
openTalkPage : [ 'agf', 'norm', 'vand' ],
openTalkPageOnAutoRevert : false,
openAOLAnonTalkPage : false,
summaryAd : " ",
deletionSummaryAd : " ",
watchSpeedyPages : [ 'g3', 'g5', 'g10', 'g11', 'g12' ],
openUserTalkPageOnSpeedyDelete : [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ],
watchRevertedPages : [ 'agf', 'norm', 'vand', 'torev' ],
markRevertedPagesAsMinor : [ 'agf', 'norm', 'vand', 'torev' ],
deleteTalkPageOnDelete : false,
markWarningsAsMinor : true,
markAIVReportAsMinor : true,
markSpeedyPagesAsMinor : true,
confirmUsernameToAIV : true
};
//
// ADD UNWATCH LINKS:
addOnloadHook(function () {
if (!wgCanonicalSpecialPageName || wgCanonicalSpecialPageName != "Watchlist") return;
if (!document.forms[0] || !document.forms[0].namespace) return;
//var query_prefix = "title="+encodeURIComponent(wgPageName)+"&action=submit&remove=1&id[]=";
var query_prefix = "action=unwatch&title=";
// get list of all links in content:
var links = document.getElementById('content').getElementsByTagName('a');
// make a static copy of the nodelist and lose the original for speed
// while we're at it, prune the uninteresting links from the list
var linksCopy = new Array ();
for (var i = 0; i < links.length; i++) {
if (/[?&]action=history([&#]|$)/.test(links[i].href)) linksCopy.push(links[i]);
}
links = linksCopy;
for (var i = 0; i < links.length; i++) {
// create unwatch link and append it after history link
var unwatch = document.createElement('a');
unwatch.href = wgServer + wgScriptPath + "/index.php?" + query_prefix + encodeURIComponent(links[i].title);
unwatch.title = "Unwatch "+links[i].title;
unwatch.appendChild(document.createTextNode("unwatch"));
links[i].parentNode.insertBefore(unwatch, links[i].nextSibling);
// insert a delimiter between the two links
var delim = links[i].previousSibling;
delimText = (delim.nodeType == 3 ? delim.nodeValue : ""); // kluge to handle case where "diff" is unlinked
delim = document.createTextNode(delimText.replace(/^.*diff/, ""));
links[i].parentNode.insertBefore(delim, unwatch);
}
});
//
// [[User:Lupin/popups.js]]
importScript('User:Lupin/popups.js');
//
addOnloadHook(function () {
var x;
if (!(x = document.getElementById('ca-edit') )) return;
var url;
if (!(url = x.getElementsByTagName('a')[0] )) return;
if (!(url = url.href )) return;
var y = addPortletLink('p-cactions', url+"§ion=0", '0', 'ca-edit-0',
'Edit the lead section of this page', '0', x.nextSibling);
y.className = x.className; // steal classes from the the edit tab...
x.className = 'istalk'; // ...and make the edit tab have no right margin
// exception: don't steal the "selected" class unless actually editing section 0:
if (/(^| )selected( |$)/.test(y.className)) {
if (!document.editform || !document.editform.wpSection
|| document.editform.wpSection.value != "0") {
y.className = y.className.replace(/(^| )selected( |$)/g, "$1");
x.className += ' selected';
}
}
});
XEBOrder='A,B,C,D,F,D1,U,S,G,Q,W,K,H,R,FS,P1,R1,R2,R3,R4,Y1,';
rmEditButtons=[1,2,3];
myButtons=[];
// Script from [[User:MarkS/extraeditbuttons.js]]
importScript('User:MarkS/extraeditbuttons.js'); //[[User:MarkS/extraeditbuttons.js]]
addOnloadHook(function(){ document.getElementById("ca-edit").firstChild.innerHTML = "Edit";});
importScript('User:Dycedarg/easyprod.js');
importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
/**** welcome new user ****/
document.write('<script type="text/javascript"' +
'src="http://en.wikipedia.org/w/index.php?title=User:Nmajdan/welcome_newuser.js' +
'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
importScript("User:Lupin/recent2.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>');
/* This is to keep track of who is using this extension: [[User:Howcheng/quickimgdelete.js]] */
// <pre>
// [[User:Wikidudeman/monobook.js]]
// <nowiki>
//requires:
//importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');
//importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
if(typeof(autosubmit) == 'undefined') { var autosubmit = 'false'; }
if(typeof(minoredit) == 'undefined') { var minoredit = 'true'; }
if(typeof(show_cwli) == 'undefined') { var showcwli = 'false'; }
Date.monthNames = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ];
Date.prototype.getMonthName = function() { return Date.monthNames[ this.getMonth() ]; }
Date.prototype.getUTCMonthName = function() { return Date.monthNames[ this.getUTCMonth() ]; }
function doCleanup(n) {
text = document.editform.wpTextbox1.value;
date = new Date();
switch(n) {
case 'abbr':
text = '{' + '{' + 'Abbreviations|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as containing inappropriate abbreviations';
break;
case 'confusing':
text = '{' + '{' + 'confusing|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as confusing';
break;
case 'copyedit':
text = '{' + '{' + 'copyedit|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as requiring some copyediting';
break;
case 'context':
text = '{' + '{' + 'context|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as providing insufficient context';
break;
case 'cleanup':
text = '{' + '{' + 'Cleanup|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as requiring cleanup';
break;
case 'globalize':
text = '{' + '{' + 'Globalize|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as being in need of globalization';
break;
case 'resume':
text = '{' + '{' + 'Like-resume|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as possibly being in violation of [[WP:COI|conflict of interest policy]]';
break;
case 'orphan':
text = '{' + '{' + 'orphan|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as being orphaned';
break;
case 'subsections':
text = '{' + '{' + 'Subsections' + '}' + '}\n\n' + text;
summary = 'Marked article as needing subsections';
break;
case 'trivia':
text = '{' + '{' + 'Trivia' + '}' + '}\n\n' + text;
summary = 'Marked article as containing an inappropriate trivia';
break;
case 'unreferenced':
text = '{' + '{' + 'Unreferenced|date=' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as not properly citing its sources';
break;
case 'wikify':
text = '{' + '{' + 'wikify|' + date.getUTCMonthName() + ' ' + date.getUTCFullYear() + '}}\n\n' + text;
summary = 'Marked article as needing wikification';
break;
case 'can we link it':
window.location = "http://can-we-link-it.nickj.org/suggest-links/suggester.php?page=" + encodeURIComponent( wgPageName );
break;
}
document.editform.wpSummary.value = summary;
document.editform.wpTextbox1.value = text;
if (minoredit == true) {
document.editform.wpMinoredit.checked = true;
}
if (autosubmit == true) {
document.editform.submit();
}
}
addOnloadHook(function() {
if ( wgCanonicalNamespace in { "User":'', "User_talk":'' } ) {
return;
}
if ( document.editform ) {
var tabs = document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0];
addlimenu(tabs, "tags", "tags" );
addPortletLink("tags", "javascript:doCleanup('abbr')", "abbr", "abbr", "Add abbreviations template", "");
addPortletLink("tags", "javascript:doCleanup('confusing')", "confusing", "confusing", "Add confusing template", "");
addPortletLink("tags", "javascript:doCleanup('copyedit')", "copyedit", "copyedit", "Add Copyedit template", "");
addPortletLink("tags", "javascript:doCleanup('context')", "context", "context", "Add Context template", "");
addPortletLink("tags", "javascript:doCleanup('cleanup')", "cleanup", "cleanup", "Add cleanup template", "");
addPortletLink("tags", "javascript:doCleanup('globalize')", "globalize", "globalize", "Add Globalize template", "");
addPortletLink("tags", "javascript:doCleanup('resume')", "resume", "resume", "Add Like-resume template", "");
addPortletLink("tags", "javascript:doCleanup('orphan')", "orphan", "orphan", "Add orphan template", "");
addPortletLink("tags", "javascript:doCleanup('subsections')", "subsections", "subsections", "Add Subsections template", "");
addPortletLink("tags", "javascript:doCleanup('trivia')", "trivia", "trivia", "Add Trivia template", "");
addPortletLink("tags", "javascript:doCleanup('unreferenced')", "unreferenced", "unreferenced", "Add unreferenced template", "");
addPortletLink("tags", "javascript:doCleanup('wikify')", "wikify", "wikify", "Add wikify template", "");
}
});
// </nowiki>
// </pre>