User:DoubleO711/monobook.js

importScript('Wikipedia:WikiProject User scripts/Scripts/qSig'); importScript('User:Misza13/viewSource.js'); /**** afd helper ****/ importScript('User:Jnothman/afd_helper/script.js'); /* This is to keep track of who is using this extension: User:Jnothman/afd_helper/script.js */ importScript('User:TheJosh/Scripts/NewPagePatrol.js'); importScript('User:TheFearow/qstring.js'); addOnloadHook(doAddQuickPreview); function doAddQuickPreview { if ((wgAction != "edit") && (wgAction != "submit")) return; var qbutton = document.getElementById("wpPreview").cloneNode(false); qbutton.value = "Quick preview"; qbutton.type="button"; qbutton.tabindex="6"; qbutton.accessKey="g"; qbutton.id="dlQuickPreview"; qbutton.title="Preview your changes"; qbutton.addEventListener("click", doQuickPreview, false); document.getElementById("wpPreview").parentNode.insertBefore(qbutton,document.getElementById("wpDiff")); } function doQuickPreview { var bt = document.getElementById("dlQuickPreview"); document.getElementById("contentSub").innerHTML = "Getting preview"; bt.value="Getting preview"; bt.disabled=true; var form = document.editform; var postData = { 'wpMinoredit': form.wpMinoredit.checked, 'wpWatchthis': form.wpWatchthis.checked, 'wpStarttime': form.wpStarttime.value, 'wpEdittime': form.wpEdittime.value, 'wpAutoSummary': form.wpAutoSummary.value, 'wpEditToken': form.wpEditToken.value, 'wpSummary': "Quick preview", 'wpTextbox1': document.editform.wpTextbox1.value }; var addr = document.URL; addr = addr.replace("&action=edit", "&action=submit"); addr += "&wpPreview=true&live=true"; var qwxmlhttp = sajax_init_object(null); qwxmlhttp.overrideMimeType('text/xml'); qwxmlhttp.open( 'POST', addr, true); qwxmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); qwxmlhttp.onload = function { document.getElementById("wikiPreview").innerHTML =  unescape(qwxmlhttp.responseText.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&").replace(/&quot;/g,'"')); bt.disabled=false; bt.value = "Quick preview"; document.getElementById("contentSub").innerHTML = ""; } qwxmlhttp.send(QueryString.create(postData)); } importScript('User:Gary King/comments in local time.js'); // If you are editing a page, click the unref button on your tab bar to add "" to the top, set "Marked as unreferenced" as the edit summary, mark it as a minor edit, and submit. function doQunref { document.editform.wpTextbox1.value = '{' + '{' + 'Unreferenced|date=' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked as unreferenced.'; 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:doQunref", "unref", "ca-unref", "Mark as unreferenced", ""); } }); // by jj137 // 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) { mw.util.addPortletLink("p-cactions", "javascript:doCleanup", "cleanup", "ca-cleanup", "Mark for cleanup", ""); } }); // If you are editing a page, click the wikify button on your tab bar to add "" 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|date=' + '{' + '{' + '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) { mw.util.addPortletLink("p-cactions", "javascript:doQwikify", "wikify", "ca-wikify", "Mark for wikification", ""); } }); // by raylu // // //