Jump to content

User:Spaully/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.
/* Twinkle */

importScript('User:AzaToth/twinkle.js');

TwinkleConfig = {
        revertMaxRevisions              :       50,
        userTalkPageMode                :       'tab',
        showSharedIPNotice              :       true,
        openTalkPage                    :       [ 'agf', 'norm', 'vand' ],
        openTalkPageOnAutoRevert        :       false,
        openAOLAnonTalkPage             :       false,
        summaryAd                       :       "([[WP:TW|tw]])",
        deletionSummaryAd               :       "([[WP:TW|tw]])",
        protectionSummaryAd             :       "([[WP:TW|tw]])",
        watchSpeedyPages                :       [ 'g3', 'g5', 'g10', 'g11', 'g12' ],
        watchProdPages                  :       true,
        watchWarnings                   :       false,
        openUserTalkPageOnSpeedyDelete  :       [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ],
        watchRevertedPages              :       [ 'agf', 'norm', 'torev' ],
        markRevertedPagesAsMinor        :       [ 'vand' ],
        deleteTalkPageOnDelete          :       false,
        markWarningsAsMinor             :       true,
        markAIVReportAsMinor            :       true,
        markSpeedyPagesAsMinor          :       false,
        markSpeedyPagesAsPatrolled	:	true,
        markProdPagesAsMinor            :       false,
        confirmUsernameToAIV            :       true,
        toolboxButtons                  :       [ ],
};

/* Dr pda - Prose size tool*/
importScript('User:Dr_pda/prosesize.js'); //[[User:Dr_pda/prosesize.js]]

//This script ([[User:ais523/highlightmyname2.js]]) highlights all instances of the
//logged-in user's username on pages by giving them a bright red background. It only
//checks bodyContent, not titles or sidebars, and doesn't change edit windows or
//Special:Preferences.
 
//<nowiki><pre>
function highlightmyname(n,p) //node, parent node
{
while(n!=null)
{
if(n.nodeType==3) //text node
{
if(n.data.toLowerCase().indexOf(mw.config.get('wgUserName').toLowerCase())!=-1)
{
var ix=n.data.toLowerCase().indexOf(mw.config.get('wgUserName').toLowerCase());
var t1=ix?document.createTextNode(n.data.substr(0,ix)):null;
var t2=document.createTextNode(n.data.substr(ix,mw.config.get('wgUserName').length));
var t3=ix+mw.config.get('wgUserName').length==n.data.length?null:
document.createTextNode(n.data.substr(ix+mw.config.get('wgUserName').length));
var s1=document.createElement("SPAN");
s1.style.backgroundColor="#FF0000";
s1.appendChild(t2);
var s2=document.createElement("SPAN");
if(t1!=null) s2.appendChild(t1);
s2.appendChild(s1);
if(t3!=null) s2.appendChild(t3);
p.replaceChild(s2,n);
if(t3!=null) highlightmyname(t3,s2); //find remaining occurences in the new nodes
n=s2.nextSibling;
}
else
n=n.nextSibling;
}
else
{
if(n.firstChild!=null) highlightmyname(n.firstChild,n);
n=n.nextSibling;
}
}
}
 
$(function() {
if(location.href.indexOf("?ais523")==-1&&location.href.indexOf("&ais523")==-1&&
location.href.indexOf("?action=edit")==-1&&location.href.indexOf("?action=submit")==-1&&
location.href.indexOf("&action=edit")==-1&&location.href.indexOf("&action=submit")==-1&&
location.href.indexOf("&action=raw")==-1&&wgPageName!="Special:Preferences")
highlightmyname(document.getElementById('bodyContent').firstChild,
document.getElementById('bodyContent'));
});
//</pre></nowiki>
//[[Category:Wikipedia scripts]]