User:Wikidudeman/monobook.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.
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'; } } }); // // // If you are editing a page, click the wikify button on your tab bar to add <code><nowiki>"{{Wikify|February 2007}}"</nowiki><code> to the top, set "Marked for wikification." as the edit summary, mark it as a minor edit, and submit. function doQwikify() { document.editform.wpTextbox1.value = '{' + '{' + 'Wikify|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\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) { addPortletLink("p-cactions", "javascript:doQwikify()", "wikify", "ca-wikify", "Mark for wikification", ""); } }); // by raylu // // // 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\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) { addPortletLink("p-cactions", "javascript:doCleanup()", "cleanup", "ca-cleanup", "Mark for cleanup", ""); } }); //