Naar inhoud springen

Gebruiker:Freestyle/monobook.js

Uit Wikipedia, de vrije encyclopedie

Opmerking: na het publiceren is het wellicht nodig uw browsercache te legen om de veranderingen te zien.

  • Firefox / Safari: houd Shift ingedrukt terwijl u:je op Vernieuwen klikt of druk op Ctrl-F5 of Ctrl-R (⌘-Shift-R op een Mac)
  • Google Chrome: druk op Ctrl-Shift-R (⌘-Shift-R op een Mac)
  • Edge: houd Ctrl ingedrukt terwijl u:je op Vernieuwen klikt of druk op Ctrl-F5.
/* <pre><nowiki> */
//
//Dit (gedwongen wikibreak) is een aangepaste versie van een script gekopieëerd vanaf Gebruiker:Melsaran/monobook.js  
//
//Functies:
//* Zorgt ervoor dat een gebruiker niet in kan loggen tot een bepaalde datum.
//* Als de gebruiker in probeert te loggen, logt hij automatisch weer uit.
//* De gebruiker kan nog steeds pagina's lezen en bewerken als een anoniem (hoewel je dit script ook eventueel aan kunt zetten voor je IP-adres)
//* Hoewel dit script op verschillende manieren omzeild kan worden, gaan we je niet vertellen hoe. (Als het echt urgent is kun je een op IRC inloggen of een moderator mailen om te vragen of iemand je monobook leeg kan halen.)
 
//Gebruik:
//* Kopieer deze code naar je [[Special:Mypage/monobook.js|monobook.js]], en specificeer de gewenste einddatum. Sla de pagina op.
//* Herlaad een Wikipedia-pagina, en leeg je cache: '''Mozilla/Safari/Konqueror''': Ctrl-Shift-R, '''Internet Explorer''': Ctrl-F5 '''Opera''': F5.
//* Veel plezier op je Wikibreak!
 
//Zet hier neer wanneer je Wikibreak eindigt:
var year = 2007; //YYYY
var month = 12; //MM
var day = 19; //DD
var hour = 12; //HH
var minute = 00; //MM
var second = 00; //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 ("Welkom terug van je gedwongen Wikibreak!");
    } else {
      // alert ("Gedwongen Wikibreak tot " + enforced_break_end.toLocaleString() + " (momenteel " + currentdate.toLocaleString() + "). Doei!");
      window.location="http://www.google.nl/";
    }
}
 
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;
}
 
$(function() { EnforceWikiBreak(); });
 
/* </nowiki></pre> */
// Adds a tab allowing you to edit the 0th section of a page (the top area usually used as an introduction).
 
$(function () {
    var x;
    if (!(x = document.getElementById('ca-edit') )) return;
    var url;
    if (!(url = x.getElementsByTagName('a')[0] )) return;
    if (!(url = url.href )) return;
    var y = mw.util.addPortletLink('p-cactions', url+"&section=0", '0', 'ca-edit-0',
                           'Edit the lead section of this page', '', x.nextSibling);
 
    y.className = x.className;  // steal classes from the the edit tab...
    x.className = 'istalk';     // ...and make the edit tab have no right margin
 
    // exception: don't steal the "selected" class unless actually editing section 0:
    if (/(^| )selected( |$)/.test(y.className)) {
        if (!document.editform || !document.editform.wpSection
            || document.editform.wpSection.value != "0") {
            y.className = y.className.replace(/(^| )selected( |$)/g, "$1");
            x.className += ' selected';
        }
    }
});

// [[en:User:Lupin/popups.js]] - please include this line 

document.write('<script type="text/javascript" src="' 
             + 'http://nl.wikipedia.org/w/index.php?title=Gebruiker:Henna/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

popupRevertSummary='Wijzigingen m.b.v. [[:en:Wikipedia:Tools/Navigation_popups|Popups]] hersteld tot versie %s';

var qPreviewKey = '`';
var qPreviewName = 'QPreview';

function qPreviewButton(){ 
	addToolbarButton(qPreviewName, qPreview, 'btnQPreview', 'Quick Preview', qPreviewKey);
}
$(qPreviewButton);

function qPreview(){
 var divPreview = document.getElementById('wikiPreview');
 if (!divPreview) return;
 var btnQPreview = document.getElementById('btnQPreview');
 if (btnQPreview) btnQPreview.value = 'Wait...';
 a = sajax_init_object();
 a.open('POST', document.editform.action+'&live', true);
 var Boundary = '--------p1415';
 a.setRequestHeader('Content-Type', 'multipart/form-data; boundary='+Boundary);
 var PostData = '--' + Boundary 
  + '\nContent-Disposition: form-data; name="wpTextbox1"\n\n'
  + document.getElementById('wpTextbox1').value + '\n--'+Boundary;
 if (a.overrideMimeType) a.overrideMimeType('text/html');
 a.send(PostData);
 a.onreadystatechange = function(){
  if (a.readyState != 4) return;
	var html = a.responseText;
	html = html.replace(/&gt;/g,'>').replace(/&lt;/g,'<').replace(/&quot;/g,'"').replace(/&amp;/g,'&').replace(/&apos;/g,"'");
	divPreview.innerHTML = html;
	if (btnQPreview)  btnQPreview.value =  qPreviewName;
 };
}

//Adds a text button to edit toolbar
function addToolbarButton(name, onclick, id, tooltip, accesskey){
	var toolbar = document.getElementById('toolbar');
	if (!toolbar) return;
	var newBtn = document.createElement('input');
	newBtn.type = 'button'; 
	newBtn.style.background = '#adbede';
	newBtn.style.height = '22px'; 
	newBtn.style.verticalAlign = 'middle';
	if (name) newBtn.value = name; 
	if (onclick) newBtn.onclick = onclick;
	if (id) newBtn.id = id;
	if (tooltip) newBtn.title = tooltip; 
	if (accesskey) newBtn.accessKey = accesskey; 
	toolbar.appendChild(newBtn);
	return newBtn;
}
//revs toevoegen aan lijst vd specialchars
$(function () {
  var specialchars = document.getElementById ('Standaard');
  if(specialchars)
    specialchars.innerHTML +=
      "<a onclick=\"insertTags('<ref name=\\'Iets\\'>','</ref>','');return false\""
      + " href='#'>&lt;ref name=\"Iets\"&gt;</a>"
});