Jump to content

User:...adam.../monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ...adam... (talk | contribs) at 19:37, 4 April 2007 (fixing wikibreak). 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.
<!-- TWINKLE -->
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');
importScript('User:AzaToth/twinkleprotect.js');

<!-- FORCE SUMMARIES -->
/* <pre><nowiki> */

function addForceSummary()
{
    if(!/&action=edit/.test(window.location.href) && !/&action=submit/.test(window.location.href)) return;
    if(/&section=new/.test(window.location.href)) return;
    if(!document.forms.editform) return;
    document.forms.editform.wpSave.onclick = forceSummary;
}

function forceSummary()
{
    if(!document.forms.editform.wpSummary.value.replace(/^(?:\/\\*.*\\*\/)? *(.*) *$/,'$1'))
    {
        flashcolour(7);
        document.forms.editform.wpSave.onclick = "";
        return false;
    }
    return true;
}

var flashcolour_timer;
function flashcolour(count) {
    if (count%2 == 1)
        document.forms.editform.wpSummary.style.backgroundColor = "#FF8000";
    else
        document.forms.editform.wpSummary.style.backgroundColor = "#FFFFFF";

    if (flashcolour_timer != null) {
        clearTimeout(flashcolour_timer);
        flashcolour_timer = null;
    }

    if (count > 0)
        flashcolour_timer = window.setTimeout("flashcolour(" + (count-1) + ")",350);
}


addOnloadHook(addForceSummary);

/* </nowiki></pre> */

<!-- wikiED -->
// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

<!-- Enforcing a short wikibreak to do some work (4/4/7 - 4/4/7 7pm) -->
/* <pre><nowiki> */

//Please adjust the following variables according to when you want to end your break:
var year = 2007; //2007
var month = 02; //04
var day = 25; //05
var hour = 20; //19
var minute = 52; //00
var second = 30; //00 

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 ("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> */