Jump to content

User:MarkS/monobook.js

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by MarkS (talk | contribs) at 19:15, 4 June 2007 (rv to WikiDudeMan's monobook and remove a line). 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.
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+"&section=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>