Jump to content

User:Mkdw/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mkdw (talk | contribs) at 00:47, 3 March 2013 (adding delsort). 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.
// [[User:Lupin/popups.js]]

importScript('User:Lupin/popups.js');

popupImages=false;
popupDelay=0.0;
popupHideDelay=0.0;
popupImageLinks=false;
imagePopupsForImages=false;

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



/***** Begin deletion-sorting code ***************************************
   Substituted from [[Template:Deltab]]
   From code by [[User:Raylu|raylu]], updates made by [[User:Dinoguy1000]]
 
 
   This script adds a "{{{1}}} Deletion" tab to the top of XfD pages
   when in edit mode.
*/

function addDelsortMessage() {
    document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.rtrim();
    document.editform.wpTextbox1.value += '\{\{subst:deletion sorting|{{{1}}}| -- \~\~\~\~\}\}\n';
    if( document.editform.wpSummary.value.match(/[^\*\/\s][^\/\s]?\s*$/) ){ document.editform.wpSummary.value += '; '; }
    document.editform.wpSummary.value += 'tagged as a {{{1}}}-related deletion ([[Template:Deltab|script-assisted]])';
    document.editform.wpMinoredit.checked = true;
    document.editform.submit();
}

addOnloadHook(function() {
    if( wgNamespaceNumber == 4 && wgTitle.match( / for d(elet|iscuss)ion/ ) && ( wgAction == "edit" || wgAction == "submit" ) ) {
        addPortletLink( 'p-cactions', 'javascript:addDelsortMessage()', '{{{1}}} deletion', 'ca-{{{1}}}deletion', '{{{1}}} Deletion', '' );
    }
});

/***** End deletion-sorting code *****************************************/