User:TreasuryTag/monobook.js

From Wikipedia, the free encyclopedia

If a message on your talk page led you here, please be wary of who left it. Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. If this is a .js page, the code will be executed when previewing the page.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
// [[User:Lupin/popups.js]] - please include this line 
 
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 
 
importScript('User:AzaToth/twinkle.js');
 
TwinkleConfig = {
        revertMaxRevisions              :       50,
        userTalkPageMode                :       'blank',
        showSharedIPNotice              :       false,
        openTalkPage                    :       ['norm', 'vand' ],
        openTalkPageOnAutoRevert        :       false,
        openAOLAnonTalkPage             :       true,
        summaryAd                       :       " ",
        deletionSummaryAd               :       " ",
        protectionSummaryAd             :       " ",
        watchSpeedyPages                :       [ ],
        watchProdPages                  :       true,
        openUserTalkPageOnSpeedyDelete  :       [ ],
        watchRevertedPages              :       [ ],
        markRevertedPagesAsMinor        :       ['agf' ],
        watchWarnings                   :       false,
        markAIVReportAsMinor            :       false,
        markSpeedyPagesAsMinor          :       true,
        markProdPagesAsMinor            :       false,
        confirmUsernameToAIV            :       true,
        toolboxButtons                  :       ['tw-prod', 'tw-rpp', 'tw-since', 'tw-sincemine'  ]
};
 
 
/* Watchlist notifier ([[User:Ais523/watchlistnotifier.js]]); displays a message every time a watched page changes. */
//<pre><nowiki>
 
var wmwpajax;
// From [[WP:US]] mainpage (wpajax renamed to wmwpajax)
wmwpajax={
        download:function(bundle) {
                // mandatory: bundle.url
                // optional:  bundle.onSuccess (xmlhttprequest, bundle)
                // optional:  bundle.onFailure (xmlhttprequest, bundle)
                // optional:  bundle.otherStuff OK too, passed to onSuccess and onFailure
 
                var x = window.XMLHttpRequest ? new XMLHttpRequest()
                : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP")
                : false;
 
                if (x) {
                        x.onreadystatechange=function() {
                                x.readyState==4 && wmwpajax.downloadComplete(x,bundle);
                        };
                        x.open("GET",bundle.url,true);
                        x.send(null); 
                }
                return x;
        },
 
        downloadComplete:function(x,bundle) {
                x.status==200 && ( bundle.onSuccess && bundle.onSuccess(x,bundle) || true )
                || ( bundle.onFailure && bundle.onFailure(x,bundle) || alert(x.statusText+': '+bundle.url));
        }
};
 
// Example:
// function dlComplete(xmlreq, data) {
//      alert(data.message + xmlreq.responseText);
// }
//  wmwpajax.download({url:'http://en.wikipedia.org/w/index.php?title=Thresher&action=raw', 
//                   onSuccess: dlComplete, message: "Here's what we got:\n\n" });
 
// End of [[WP:US]] quote
 
function wmWatchEditFound(xmlreq, data) {
  var watchrev, watchsum, watchrevold, watchpage, junk;
  watchrev=xmlreq.responseText.split('timestamp="')[1].split('"')[0];
  if(wgPageName == "Special:Watchlist")
    document.cookie="ais523wmwatchrev="+watchrev+".; path=/";
  else
  {
    watchsum=xmlreq.responseText.split('comment="')[1].split('"')[0];
    watchpage=xmlreq.responseText.split('title="')[1].split('"')[0];
    try
    {
      watchrevold=document.cookie.split('ais523wmwatchrev=')[1].split('.')[0];
    }
    catch(junk) {watchrevold=0;}
    watchsum=watchsum.split('<').join('&lt;').split('>').join('&gt;');
    watchpage=watchpage.split('<').join('&lt;').split('>').join('&gt;');
    if(watchrev!=watchrevold)
      document.getElementById('contentSub').innerHTML+=
        "<div class='watchlistnotify'>\""+watchpage+'" changed: "'+watchsum+'".</div>';
  }
}
 
addOnloadHook(function() {
  /* Find the top item in the watchlist, and its edit summary. We only need one item, so
     set the limit to 1 to ease the load on the server. */
  //if(location.href.indexOf("/wiki/")!=-1)
    wmwpajax.download({url:'http://en.wikipedia.org/w/api.php?action=query&list=watchlist&wllimit=1&'+
      'wldir=older&format=xml&wlprop=comment|timestamp|title', onSuccess: wmWatchEditFound});
});
// </nowiki></pre>
// [[Category:Wikipedia scripts]]
 
 
importScript('User:TheJosh/Scripts/NewPagePatrol.js');
 
 
 
 
/* <pre><nowiki> */
 
//Please adjust the following variables according to when you want to end your break:
var year = 2008; //YYYY
var month = 02; //MM
var day = 24; //DD
var hour = 14; //HH
var minute = 00; //MM
var second = 01; //SS 
 
function EnforceWikiBreak() {
    var currentdate = new Date();
    var enforced_break_end = new Date(year,changemonth(),day,hour,minute,second);
    if (currentdate > enforced_break_end) {
      // alert ("Welcome back from your enforced wikibreak!");
    } else {
      alert ("No way!! You're on an Enforced Wikibreak until " + enforced_break_end.toLocaleString() + " (currently " + currentdate.toLocaleString() + "). Bye!");
      window.location.href = ("http://"+document.location.host+"/w/index.php?title=Special:Userlogout&returnto=Main_Page");
    }
}
 
function changemonth() {
//thing to subtract 1 from the month. you can't use month-1 because it removes the '0' from the front
if(month==01) return 00;
if(month==02) return 01;
if(month==03) return 02;
if(month==04) return 03;
if(month==05) return 04;
if(month==06) return 05;
if(month==07) return 06;
if(month==08) return 07;
if(month==09) return 08;
if(month==10) return 09;
if(month==11) return 10;
if(month==12) return 11;
return 00;
}
 
addOnloadHook(function() { EnforceWikiBreak(); });
 
/* </nowiki></pre> */
 
 
importScript('User:Voice_of_All/Addtabs/monobook.js');
importScript('User:Misza13/statusChanger.js');
 
 
 
importScript('User:Ioeth/friendly.js');
importScript('User:AzaToth/morebits.js');
importScript('User:Ioeth/friendlywelcome.js');
importScript('User:AzaToth/morebits.js');
importScript('User:Ioeth/friendlytag.js');
 
FriendlyConfig = {
        summaryAd                       :       " ",
        topWelcomes                     :       false,
        watchWelcomes                   :       false,
        markWelcomesAsMinor             :       false,
        insertHeadings                  :       true,
        welcomeHeading                  :       "== Welcome ==",
        insertUsername                  :       false,
        insertSignature                 :       true,
        quickWelcomeMode                :       "semiauto",
        quickWelcomeTemplate            :       "Welcome",
        groupByDefault                  :       true,
        watchTaggedPages                :       false,
        markTaggedPagesAsMinor          :       false
};
 
 
 
// [[User:Animum/reset.js]] by Animum
importScript('User:Animum/urlparameters.js');
importScript('User:Voice of All/Addtabs/monobook.js');
 
function resetSandbox() {
  if(UrlParameters["sandboxreset"] == 'reset' && wgPageName == "Wikipedia:Sandbox" && wgAction == "edit") {
    document.forms["editform"].wpTextbox1.value = "\{\{Please leave this line alone (sandbox heading)\}\}\n" + 
"<!-- Hello! Feel free to try your formatting and editing skills below this line\. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. -->"; //Add the base text for the sandbox
    document.forms["editform"].wpSummary.value = "[[User:Animum/reset.js|JS EDIT]]: Reset the Sandbox"; //Make a descriptive edit summary
    document.forms["editform"].wpMinoredit.checked = true; //Make it a minor edit
    if(UrlParameters["indirect"] == '1' && wgPageName == "Wikipedia:Sandbox" && wgAction == "edit") { //If you've clicked on the toolbox link
      window.setTimeout(function() { document.forms["editform"].wpDiff.click(); }, 200); //Load the diff if you are resetting it per the toolbox link
      var save = confirm("Save? (click \"OK\" to save; \"cancel\" to abort)") // Do you want to make these changes?
      if(save == true) { 
        window.setTimeout(function() { document.forms["editform"].wpSave.click(); }, 500); //Submit it!
      } else { location.href = "http://en.wikipedia.org/wiki/Wikipedia:Sandbox"; } // Go back two pages if you don't want to save it
    } else {
    window.setTimeout(function() { document.forms["editform"].wpSave.click(); }, 200); //Submit it! 
    }
  }
}
 
addOnloadHook(function () {
    if(wgPageName == "Wikipedia:Sandbox") // If the page you are viewing is the sandbox
      { addPortletLink('p-cactions', 'http://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&action=edit&sandboxreset=reset', 'reset', 'ca-reset', "Reset the Sandbox"); }
    if(wgPageName != "Wikipedia:Sandbox") // If the page you are viewing is NOT the sandbox 
      { addToolboxLink("http://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&action=edit&sandboxreset=reset&indirect=1", 'Reset the Sandbox', '', '', ''); }
});
 
addOnloadHook(resetSandbox);
 
importScript('User:Gracenotes/rollback.js');