Jump to content

User:Slakr/monobook.js

From Wikipedia, the free encyclopedia
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.
/* **********************
TwinkleConfig = {
        revertMaxRevisions              :       50,
        // userTalkPageMode                :       'window',
        userTalkPageMode                :       'hybrid',
        deleteTalkPageOnDelete          :       true,
        showSharedIPNotice              :       false,
        openTalkPage                    :       [ 'agf', 'norm', 'vand' ],
        openTalkPageOnAutoRevert        :       false,
        openAOLAnonTalkPage             :       false,
        summaryAd                       :       "",
        deletionSummaryAd               :       "",
        protectionSummaryAd             :       "",
        watchSpeedyPages                :       [ ],
        watchProdPages                  :       true,
        openUserTalkPageOnSpeedyDelete  :       [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ],
        watchRevertedPages              :       [ 'none' ],
        markRevertedPagesAsMinor        :       [ 'agf', 'norm', 'vand', 'torev' ],
        markWarningsAsMinor             :       false,
        markAIVReportAsMinor            :       false,
        markSpeedyPagesAsMinor          :       false,
        markProdPagesAsMinor            :       false,
        confirmUsernameToAIV            :       true,
        toolboxButtons                  :       [ ],
        orphanBacklinksOnSpeedyDelete   :       { orphan:false }
};
************** */

var cactions = {
    itabs: false,
    svars: [],
    tbusr: true,
    xmlhr: true
};


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

/* *******
importScript('User:Slakr/morebits.js');
importScript('User:Slakr/twinklefluff-custom.js');
importScript('User:Slakr/twinklespeedy-custom.js');
importScript('User:Slakr/twinklediff.js');
importScript('User:Slakr/twinkleprotect.js');
importScript('User:Slakr/twinkleprod.js');
importScript('User:Slakr/twinklexfd.js');
importScript('User:Slakr/twinkle-oldwarn-custom.js');

// summore.
importScript('User:Slakr/twinklebatchprotect.js');
importScript('User:Slakr/batchdelete.js');
importScript('User:Slakr/twinkledelimages.js');
importScript('User:Slakr/twinkleunlink.js');
**************** */

//importScript('User:Slakr/nixfundraiser.js');

popupHideDelay=0.60;
popupAdminLinks=true;

// patrolify.
importScript('User:Slakr/patrolLinks.js');

// afd closer.  Looks like it needs updating/cool-ifying, but this will work for now.
//importScript('Wikipedia:WikiProject User scripts/Scripts/CloseAFD.js');
//muuuuch better.
//importScript('User:Mr.Z-man/closeAFD.js');
importScript('User:Rami R/rfppClerk.js');
importScript('User:Timotheus Canens/massblock.js');
importScript('User:Writ Keeper/Scripts/massRollback.js');
importScript('User:Slakr/sectionlinks.js');
// some random stuff.
$(function(){ 
	mw.util.addPortletLink("p-tb", "https://en.wikipedia.org/wiki/Special:Prefixindex/" + encodeURIComponent(mw.config.get('wgPageName')), "Prefix index");
	mw.util.addPortletLink("p-tb", "https://en.wikipedia.org/w/index.php?title=Special%3ALog&type=&user=&page="+ encodeURIComponent(mw.config.get('wgPageName')) +"&year=&month=-1", "Logs entries upon");
	mw.util.addPortletLink("p-navigation", "https://en.wikipedia.org/wiki/Special:Upload", "Upload (raw)");
	if ($('#wpSave').length) {
		$('#wpSave').clone().attr('id', 'wpSaveClone').appendTo('#toolbar');
	}
});

/*addOnloadHook(
  function(){ 
    $('#p-tb').detach().insertBefore('#p-navigation'); 
    $('#p-search').detach().insertBefore('#p-tb'); 
  }
);*/


/* Demystify page revids */
$(function(){ 
  $('#pagehistory .comment').each(function(idx,ele) {
    var $ele = $(ele);
    var txt = $ele.html();
    var newTxt = txt.replace(/(Undid revision|Reverted to revision) ([\d]+)/, "$1 <a href='#mw-oldid-$2' class='doHilightRevision' data-revid='$2'>$2</a>");
    $ele.html(newTxt);
  });

  $(document).on('mouseover', '.doHilightRevision', function(e) {
    var $ele = $(this);
    $('#mw-oldid-'+$ele.attr('data-revid')).parent().css('background-color', '#ccc');
  });

  $(document).on('mouseout', '.doHilightRevision', function(e) {
    var $ele = $(this);
    $('#mw-oldid-'+$ele.attr('data-revid')).parent().css('background-color', 'inherit');
  });
});