User:Maelgwn/monobook.js

/* // User:Lupin/popups.js

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

/* */ importScript('User:Quarl/util.js'); importScript('User:Quarl/wikipage.js'); importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css'); importScript('User:AzaToth/twinkle.js'); importScript('Wikipedia:WikiProject Deletion sorting/delsort.js'); importScript('User:Ais523_non-admin/adminrights.js');

/* */ function EnforceWikiBreak { //Please adjust the following variables according to when you want to end your break: var year = 2007; //YYYY var month = 11; //MM var day = 12; //DD var hour = 00; //HH var minute = 00; //MM var second = 00; //SS var currentdate = new Date; var enforced_break_end = new Date(year,changemonth(month),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(month) { //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; } $(EnforceWikiBreak); /* */

/* */ // This will add an [edit] link at the top of all pages except preview pages and the main page // by User:Pile0nades

// Add an [edit] link to pages $(function { // if this is preview page or generated page, stop if( document.getElementById("wikiPreview") || document.getElementById("histlegend‎") || document.getElementById("difference‎") || document.getElementById("watchdetails") || document.getElementById("ca-viewsource") || window.location.href.indexOf("/wiki/Special:") != -1 ) { if(window.location.href.indexOf("&action=edit&section=0") != -1) { document.getElementById("wpSummary").value = "/* Intro */ "; } return; };

// get the page title var pageTitle = wgPageName;

// create div and set innerHTML to link var divContainer = document.createElement("div"); divContainer.innerHTML = ' [edit intro] ';

// insert divContainer into the DOM below the h1 if(window.location.href.indexOf("&action=edit") == -1) { document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]); }

});

// Add date and time to your monobook "personal menu" list at the very top of the page. // Created by User:Mathwiz2020

// Indicate where you would like the time to appear: // 1 is first (before username), 2 is second (before talk link), ... 7 is last (after log out link) insertBeforeNum = 7;

// Do NOT edit below this line unless you're experiened in javascript insertBeforeArr = new Array("","pt-userpage","pt-mytalk","pt-preferences","pt-watchlist","pt-mycontris","pt-logout",""); insertBefore = insertBeforeArr[insertBeforeNum];

function makeTime { var li = document.createElement( 'li' ); li.id = 'pt-time';

var mySpan = document.createElement( 'span' ); mySpan.appendChild( document.createTextNode( 'date and time' ) );

li.appendChild( mySpan );

if ( insertBefore ) {   var before = document.getElementById( insertBefore ); before.appendChild( li, before ); } else // append to end (right) of list {   document.getElementById( 'pt-logout' ).parentNode.appendChild( li ); }

getTime; }

if     ( window.addEventListener ) window.addEventListener ( 'load', makeTime, false ); else if ( window.attachEvent     ) window.attachEvent      ( 'onload', makeTime      );

function getTime {   var time    = new Date; var date   = time.getUTCDate; var months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); month  = months[time.getUTCMonth]; var year   = time.getUTCFullYear; var hours  = '0' + time.getUTCHours; hours  = hours.substr(hours.length-2, hours.length); var minutes = '0' + time.getUTCMinutes; minutes = minutes.substr(minutes.length-2, minutes.length); var seconds = '0' + time.getUTCSeconds; seconds = seconds.substr(seconds.length-2, seconds.length); var curTime = hours + ":" + minutes + ":" + seconds + ", " + date + " " + month + " " + year + " (UTC)"; datePlace  = document.getElementById('pt-time').childNodes[0].childNodes[0]; datePlace.replaceData(0, datePlace.length, curTime); doTime     = window.setTimeout("getTime", 1000); } //

if (wgCanonicalSpecialPageName && wgCanonicalSpecialPageName=='Watchlist' && wgAction=='view') $(function { var frm = document.getElementsByTagName('form')[0]; frm.parentNode.insertBefore(document.createTextNode(' | '), frm); var lnk = document.createElement('a'); lnk.appendChild(document.createTextNode('Unwatch…')); lnk.href = 'javascript:importScript("User:Alex_Smotrov/wlunwatch.js")'; frm.parentNode.insertBefore(lnk, frm); })