Jump to content

User:Ansumang/vector.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ansumang (talk | contribs) at 20:54, 3 December 2011. 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.
importScript('User:Splarka/timestamplocalizer.js');
importScript('User:Splarka/lifilter.js');
importScript('User:Splarka/domdump.js');
importScript('User:Splarka/lastmod.js');
 
//conditional
if(wgCanonicalSpecialPageName == 'Imagelist') importScript('User:Splarka/galleryimagelist.js');
if(wgCanonicalSpecialPageName == 'Prefixindex') importScript('User:Splarka/cmlhider.js');
if(wgCanonicalNamespace == 'Category') importScript('User:Splarka/togglegallery.js');
if(wgAction == 'view') importScript('User:Splarka/timetravel.js');
if(wgNamespaceNumber == -1 || wgAction == 'history') importScript('User:Splarka/synaesthesia.js');
 
//Misc tests
addOnloadHook(pLangOverflow)
function pLangOverflow() {
  var lang = document.getElementById('p-lang');
  if(!lang) return;
  var bod = getElementsByClassName(lang,'div','pBody');
  var li = bod[0].getElementsByTagName('li');
  if(li.length < 10) return
  appendCSS('#p-lang .pBody {height:15em; overflow:auto;}');
}


//importScript('User:Lightmouse/monobook.js/script.js');
importScript('User:Pyrospirit/metadata.js'); // Metadata Assessment
importScript('User:Tra/sidebartranslate.js'); //[[User:Tra/sidebartranslate.js]]
importScript('User:Js/ajaxPreview.js')
ajaxPreviewPos = 'bottom';  //Buttons on the bottom, replacing standard buttons.
ajaxPreviewScrollTop = true;
ajaxPreviewExec = function(previewArea){ //code to execute after each preview update
  if (window.setupTooltips) setupTooltips(previewArea)
}

importScript('User:Splarka/dabfinder.js'); // Disambiguation lookup script
importScript('User:Gimmetrow/fixRefs.js'); // Fix References
importScript('User:Dr pda/prosesize.js'); // Prose Size
importScript('User:Dr_pda/prosesizebytes.js'); //[[User:Dr_pda/prosesizebytes.js]]
importScript('User:Cameltrader/Advisor.js');
importScript('User:Shubinator/DYKcheck.js');
importScript('User:Ale_jrb/Scripts/igloo.js'); // [[User:Ale_jrb/Scripts/igloo]]
importScript('User:Splarka/sysopdectector.js'); // Admin Detector
var showUserGroupSettings = { 'groups': true, 'groupless': true }
importScript('User:Δ/Copyvio Detection Candidates.js');
importScript('User:GregU/dashes.js');
//importScript('User:PleaseStand/segregate-refs.js');
//importScript('User:Plastikspork/datetools.js');
//importScript('User:Splarka/electrocute.js');
importScript('User:Gary King/nominations viewer.js'); // [[Wikipedia:Nominations Viewer]]
//importScript('MediaWiki:Gadget-edittop.js'); // Edit Top
//importScript('User:AndyZ/peerreviewer.js');  [[User:AndyZ/peerreviewer.js]] semi-automated MOS formatter
importScript('User:Sross_(Public_Policy)/ambassadorwikilove.js');
importScript('User:TheDJ/qui.js');
importScript('User:Smith609/endnote.js');
importScript('User:Smith609/toolbox.js');
importScript('User:Smith609/refsByName.js');
importScript('User:Gracenotes/rollback.js');
//importScript('User:Mr.Z-man/closeAFD.js'); //[[User:Mr.Z-man/closeAFD.js]]
//importScript('User:Σ/Testing facility/Foobar.js'); //[[User:Σ/Testing facility/Foobar.js]]
//importScript('User:Σ/Testing facility/Barbaz.js'); //[[User:Σ/Testing facility/Barbaz.js]] and [[User:Ais523/votesymbols.js]]
//importScript('User:Ale_jrb/Scripts/csdhelper.js');  //[[User:Ale_jrb/Scripts]] Decline CSD or PROD articles
    var notifyByDefaultNew = false;

importScript('User:Ale_jrb/Scripts/statusCheck.js');  //[[User:Ale_jrb/Scripts]]
    var offlineAfter = 7200;
    var statPosition = new Array(0, 827);

//importScript('User:Rami_R/rfppClerk.js');
    pr_timeout = 1
    fr_timeout = 6

/**** navpop ****/
// [[User:Lupin/popups.js]]
 
importScript('User:Lupin/popups.js');
 
//<pre>
//This function adds a tab which, when clicked, extracts data from an infobox and
//populates the fields of the Persondata template. See the talk page for more details.
//
//To use this function add {{subst:js|User:Dr pda/persondata.js}} to your skin.js
//
function format_name(x){
   NAME = x.substr(x.indexOf('=')+1);
   NAME = NAME.replace(/'''?/g,'');
   NAME = NAME.replace(/^\s*/g,'');
   NAME = NAME.replace(/\s*$/g,'');
   var comma = NAME.indexOf(',');
   var start = (comma == -1) ? NAME.length : comma;
   var lastSpace = NAME.lastIndexOf(' ',start);
   if(lastSpace != -1){
     NAME = NAME.substring(lastSpace,start)+', '+NAME.substring(0,lastSpace)+NAME.substring(start);
   }
   return NAME;
}

function suggestPersonData(){
  var text = document.getElementById('wpTextbox1').value;

  //do nothing if article already contains persondata
  if(text.match(/persondata/i)) return;

  var template = '';
  var NAME = '';
  var ALTERNATIVE_NAMES = '';
  var SHORT_DESCRIPTION = '';
  var PLACE_OF_BIRTH = '';
  var DATE_OF_BIRTH = '';
  var PLACE_OF_DEATH = '';
  var DATE_OF_DEATH = '';

  //handle cases where the template name doesn't contain infobox
  text = text.replace(/{{NFL player/i,'{{NFL player infobox');
  if(text.match(/Infobox/i)){
    start = text.lastIndexOf('{{',text.indexOf('nfobox'));
    stop = text.indexOf('}}',start);
    next = text.indexOf('{{',start+1)
    //Correctly handle other templates used within the infobox
    while (next < stop && text.indexOf('{{',start+1)!= -1){
      next = text.indexOf('{{',stop+1);
      stop = text.indexOf('}}',stop+1);
    }
    template = text.substring(start,stop);

    //Remove references, birth/death date and age templates
    template = template.replace(/<ref.*(\/ref>|$)/gm,'');
    template = template.replace(/{{(?:[Bb]irth|[Dd]eath) date(?: and age)?\s?(\|\s?[md]f\s?=\s?ye?s?)?\|\s?(\d{1,4})\|\s?(\d{1,2})\|\s?(\d{1,2}).*}}/g,"$2-$3-$4");
    template = template.replace(/\[\[Image:Flag.*px\]\]/ig,'');
    template = template.replace(/{{flagicon.*}}/ig,'');
    template = template.replace(/<\/?small>/ig,'');
    template = template.replace(/<br\s*\/?>/ig,'');

    var firstpar = template.indexOf('|');
    template = template.substr(firstpar+1);

    var birthplace_in_born = false;  
    var array = template.split(/(\n\s*\||\|\s*\n)/);
    for (x=0;x<array.length;x++){
      if(array[x].match(/subject_name/i)||array[x].match(/^\s*\bname\b/i)||array[x].match(/fullname/i)){
      NAME = format_name(array[x]);
    }
    if(array[x].match(/playername/i)||array[x].match(/birth_?name/i)){
      ALTERNATIVE_NAMES = (ALTERNATIVE_NAMES == '') ? format_name(array[x]):ALTERNATIVE_NAMES + ';' + format_name(array[x]);
    }
    else if(array[x].match(/date_of_birth/i)||array[x].match(/dateofbirth/i)||array[x].match(/birthdate/i)||array[x].match(/birth_date/i)||array[x].match(/date of birth/i)||array[x].match(/datebirth/i)){
      DATE_OF_BIRTH = array[x].substr(array[x].indexOf('=')+1);
    }
    else if(array[x].match(/place_of_birth/i)||(array[x].match(/origin/i)&&birthplace_in_born==false)||array[x].match(/birthplace/i)||array[x].match(/placebirth/i)||array[x].match(/location/i)||array[x].match(/placeofbirth/i)||array[x].match(/birth_place/i)||array[x].match(/place of birth/i)){
      PLACE_OF_BIRTH = array[x].substr(array[x].indexOf('=')+1);
    }
    else if(array[x].match(/born/i)){
      var temp =  array[x].indexOf('<br');
	  if(temp != -1){
	    DATE_OF_BIRTH = array[x].substring(array[x].indexOf('=')+1,temp);
            PLACE_OF_BIRTH = array[x].substr(array[x].indexOf('>',temp)+1);
	    birthplace_in_born = true;
	  }
	  else{
	    DATE_OF_BIRTH = array[x].substring(array[x].indexOf('=')+1);
	  }
    }
    else if(array[x].match(/lived/i)){
      var temp =  array[x].substr(array[x].indexOf('=')+1);
      temp = temp.replace(/born\s*/i,'');
      var dash = temp.search(/&ndash;\s*|-\s*/);
      if(dash >=0){
        DATE_OF_BIRTH = temp.substring(0,dash);
        DATE_OF_DEATH = temp.substring(temp.indexOf(' ',dash)+1);
      }
      else{
        DATE_OF_BIRTH = temp;
      }
    }
    else if(array[x].match(/cityofbirth/i)){
      var temp =  array[x].substr(array[x].indexOf('=')+1);
      temp = temp.match(/.*/);
      PLACE_OF_BIRTH = (PLACE_OF_BIRTH == '') ? temp : temp + ' ,' + PLACE_OF_BIRTH;
    }
    else if(array[x].match(/countryofbirth/i)){
      PLACE_OF_BIRTH = (PLACE_OF_BIRTH == '') ? array[x].substr(array[x].indexOf('=')+1) : PLACE_OF_BIRTH + ',' + array[x].substr(array[x].indexOf('=')+1);
    }
    else if(array[x].match(/date_of_death/i)||array[x].match(/dateofdeath/i)||array[x].match(/deathdate/i)||array[x].match(/death_date/i)||array[x].match(/date of death/i)||array[x].match(/datedeath/i)){
      DATE_OF_DEATH = array[x].substr(array[x].indexOf('=')+1);
    }
    else if(array[x].match(/place_of_death/i)||array[x].match(/deathplace/i)||array[x].match(/placeofdeath/i)||array[x].match(/death_place/i)||array[x].match(/place of death/i)||array[x].match(/placedeath/i)){
      PLACE_OF_DEATH = array[x].substr(array[x].indexOf('=')+1);
    }
    else if(array[x].match(/died/i)){
      var temp =  array[x].indexOf('<br');
	  if(temp != -1){
	    DATE_OF_DEATH = array[x].substring(array[x].indexOf('=')+1,temp);
            PLACE_OF_DEATH = array[x].substr(array[x].indexOf('>',temp)+1);
	  }
	  else{
	    DATE_OF_DEATH = array[x].substring(array[x].indexOf('=')+1);
	  }
    }
    else if(array[x].match(/cityofdeath/i)){
      var temp =  array[x].substr(array[x].indexOf('=')+1);
      temp = temp.match(/.*/);
      PLACE_OF_DEATH = (PLACE_OF_DEATH == '') ? temp : temp + ' ,' + PLACE_OF_DEATH;
    }
    else if(array[x].match(/countryofdeath/i)){
      PLACE_OF_DEATH = (PLACE_OF_DEATH == '') ? array[x].substr(array[x].indexOf('=')+1) : PLACE_OF_DEATH + ',' + array[x].substr(array[x].indexOf('=')+1);
    }
    else if(array[x].match(/occupation/i)||array[x].match(/\bfield\b\s*=/i)||array[x].match(/office/i)){
      SHORT_DESCRIPTION = array[x].substr(array[x].indexOf('=')+1);
      SHORT_DESCRIPTION = SHORT_DESCRIPTION.replace(/\s*<br\s*\/?>\s*/g,', ');
    }
  }

  //more tidy up
  DATE_OF_BIRTH = DATE_OF_BIRTH.replace(/\(age? \d*\)/i,'');
  DATE_OF_DEATH = DATE_OF_DEATH.replace(/\(age? \d*\)/i,'');
  }
  if(NAME == ''){
      var pagename = wgPageName.replace(/_/g,' ');
      pagename = pagename.replace(/\(.*\)/g,' ');
      NAME = format_name(pagename);
  }
  if(DATE_OF_BIRTH=='' && text.match(/Category:\d* births/)){
    var catbirth = text.search(/Category:\d* births/);
    DATE_OF_BIRTH = text.substring(catbirth+9,text.indexOf('births')-1);
  } 
  if(DATE_OF_DEATH=='' && text.match(/Category:\d* deaths/)){
    var catdeath = text.search(/Category:\d* deaths/);
    DATE_OF_DEATH = text.substring(catdeath+9,text.indexOf('deaths')-1);
  } 

  //restore original text, in case this special case was found
  text = text.replace(/{{NFL player infobox/i,'{{NFL player');

  var persondata = "\n\n<!-- Metadata: see [[Wikipedia:Persondata]] -->\n{{Persondata\n|NAME="+NAME+"\n|ALTERNATIVE NAMES="+ALTERNATIVE_NAMES+"\n|SHORT DESCRIPTION="+SHORT_DESCRIPTION+"\n|DATE OF BIRTH="+DATE_OF_BIRTH+"\n|PLACE OF BIRTH="+PLACE_OF_BIRTH+"\n|DATE OF DEATH="+DATE_OF_DEATH+"\n|PLACE OF DEATH="+PLACE_OF_DEATH+"\n}}\n\n";

  var insertPosition = text.indexOf('[[Category:')-1;
  if(text.match('{{DEFAULTSORT')) insertPosition = text.indexOf('{{DEFAULTSORT')-1;
  if(insertPosition != -2){
    document.getElementById('wpTextbox1').value = text.substr(0,insertPosition)+persondata+text.substr(insertPosition+1);
  }
  else{
    alert('This article does not belong to any categories! Consider adding some.');
    document.getElementById('wpTextbox1').value = text+persondata;
  }
  document.getElementById('wpSummary').value += ' adding [[WP:PDATA|persondata]] using [[User talk:Dr pda/persondata.js|User:Dr pda/persondata.js]]';
  document.getElementById('wpDiff').click();

}

function togglePersondata() {
  var element = document.getElementById('persondata');

  if (element.style.display != 'block'){
    element.style.display = 'block';
  }
  else{
    element.style.display = 'none';
  }
}

addOnloadHook(function () {
  if(!document.forms.editform){
    if (document.getElementById('persondata') != null){
      addPortletLink('p-cactions', 'javascript:togglePersondata()', 'show/hide persondata', 'ca-pdata', 'Show/hide persondata metadata', '', '');
    }
  }
  else{
    if (wgNamespaceNumber == 0 && document.getElementById('wpTextbox1').value.match(/persondata/i) == null){
      addPortletLink('p-cactions', 'javascript:suggestPersonData()', 'add persondata', 'ca-pdata', 'add persondata metadata', '', '');
    }
  }
});


/* Ajax file move module, version [0.0.4c]
Originally from: http://en.wikipedia.org/wiki/User:Splarka/ajaxfilemove.js

Notes:
* Very complex script, but very simple operation:
** Go to a File: page, click [speedy move], enter new name.
* Specifically written to move requested images, summaries and template removal regex are hard coded.
** Framework can be forked though.
* Does not suppress redirects, a feature could be written though.
** This would need more complex input, than a prompt().

*/

var sfmMoveToken = '';
var sfmNewTitle = '';
if(wgNamespaceNumber == 6 && wgCurRevisionId) {
  addOnloadHook(function() {
    var move = document.getElementById('ca-move');
    if(!move) return
    var sm = addPortletLink('p-cactions','javascript:sfmInit()','speedy move','ca-gonzales','Speed move this File','i',move);
  });
}

function sfmInit() {
  var def = wgCanonicalNamespace + ':';
  var suggest = getElementsByClassName(document,'span','media-move-suggestion');
  if(suggest.length > 0) def = getInnerText(suggest[0])
  var newtitle = prompt('Move file to page:',def);
  if(!newtitle) return
  if(newtitle.toLowerCase().indexOf(wgCanonicalNamespace.toLowerCase() + ':') != 0) {
    alert('You can\'t move files to other namespaces');
    return;
  }
  var oldext = wgPageName.split('.')[wgPageName.split('.').length-1];
  var newext = newtitle.split('.')[newtitle.split('.').length-1];
  if(oldext.toLowerCase() != newext.toLowerCase()) {
    var conf = confirm('Warning: you appear to be changing this file\'s extension from "' + oldext + '" to "' + newext + '".\nWhile this is works sometimes for very old files uploaded with the wrong\nextension, this is rare. Are you really sure you want to try that?');
    if(!conf) return
  }

  var bar = document.getElementById('contentSub') || document.getElementById('topbar');
  var out = document.createElement('pre');
  out.setAttribute('id','sfm-output');
  appendCSS('#sfm-output {border:1px solid black !important;padding:.5em;overflow:auto;font-size:120%}');
  bar.appendChild(out);

  var badchars = /([#<>\[\]{}|\/]|\:.*\:)/;
  if(newtitle == wgPageName || newtitle.indexOf(wgCanonicalNamespace + ':') != 0 || badchars.test(newtitle)) {
    out.appendChild(document.createTextNode('! That seems like a bad title to me: [[' + newtitle + ']]'));
    return;
  }

  out.appendChild(document.createTextNode('* Input accepted, fetching edit/move tokens and page text...\n'));
  document.getElementById('ca-gonzales').style.display = 'none';

  var url = wgScriptPath + '/api.php?action=query&prop=info|revisions&rvprop=content|timestamp&indexpageids=1&intoken=edit|move&format=json&titles=' + encodeURIComponent(wgPageName);
  var req = sajax_init_object();
  req.open('GET', url, true);
  req.onreadystatechange = function() {
    if(req.readyState == 4 && req.status == 200) {
      eval("sfmTokens(" + req.responseText + ",'" + req.responseText.replace(/\'/g,"`") + "')");
    }
  }
  sfmNewTitle = newtitle;
  req.send(null);
}

function sfmTokens(obj,txt) {
  //http://test.wikipedia.org/w/api.php?action=query&prop=info|revisions&rvprop=content|timestamp&indexpageids=1&intoken=edit|move&format=jsonfm&titles=File:Test.png
  var out = document.getElementById('sfm-output');
  if(obj['error']) {
    out.appendChild(document.createTextNode('! Api error: ' + obj['error']['code'] + ' - ' + obj['error']['info'] + '\n'));
    return;
  }
  if(!obj['query'] || !obj['query']['pageids'] || !obj['query']['pages'][obj['query']['pageids'][0]] || !obj['query']['pages'][obj['query']['pageids'][0]]['movetoken'] || !obj['query']['pages'][obj['query']['pageids'][0]]['edittoken'] || !obj['query']['pages'][obj['query']['pageids'][0]]['revisions'][0]['timestamp'] || !obj['query']['pages'][obj['query']['pageids'][0]]['revisions'][0]['*']) {
    out.appendChild(document.createTextNode('? Unexpected response: ' + txt + '\n'));
    return;
  }
  if(obj['query']['pages'][obj['query']['pageids'][0]]['redirect']) {
    out.appendChild(document.createTextNode('! This file is apparently a redirect, and should not be moved again.\n'));
    return;
  }
  var edittoken = obj['query']['pages'][obj['query']['pageids'][0]]['edittoken'];
  var movetoken = obj['query']['pages'][obj['query']['pageids'][0]]['movetoken'];
  var pagetext = obj['query']['pages'][obj['query']['pageids'][0]]['revisions'][0]['*'];
  var timestamp = obj['query']['pages'][obj['query']['pageids'][0]]['revisions'][0]['timestamp'];
  var startstamp = obj['query']['pages'][obj['query']['pageids'][0]]['starttimestamp'];

  out.appendChild(document.createTextNode('* Got tokens and text, searching for templates...\n'));
  var templates = /\{\{[\s\n\t]*(ifr|rename[ _]*media|rename[ _]*image|ImageRename|rename)[\s\n\t]*(\|[^\}]*|)\}\}/ig;
  var found = templates.test(pagetext);
  if(!found) {
    out.appendChild(document.createTextNode('! No automatically removable templates found, please continue manually.'));
    return;
  }
  out.appendChild(document.createTextNode('* Move template(s) found and removed, attempting edit...\n'));
  pagetext = pagetext.replace(templates,'');

  var params = 'action=edit&format=json&title=' + encodeURIComponent(wgPageName) + '&text=' + encodeURIComponent(pagetext) + '&token=' + encodeURIComponent(edittoken) + '&summary=' + encodeURIComponent('Automatic removal of requested move templates in preparation for move.') + '&minor=1&basetimestamp=' + timestamp.replace(/[^\d]/g,'');
  if(startstamp) params += '&starttimestamp=' + startstamp.replace(/[^\d]/g,'')
  var url = wgScriptPath + '/api.php';
  var req = sajax_init_object();
  req.open('POST', url, true);
  req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
  req.setRequestHeader('Content-length', params.length);
  req.setRequestHeader('Connection', 'close');
  req.onreadystatechange = function() {
    if(req.readyState == 4 && req.status == 200) {
      eval("sfmEdit(" + req.responseText + ",'" + req.responseText.replace(/\'/g,"`") + "')");
    }
  }
  sfmMoveToken = movetoken;
  req.send(params);
}

function sfmEdit(obj,txt) {
  var out = document.getElementById('sfm-output');
  if(obj['error']) {
    out.appendChild(document.createTextNode('! Api error: ' + obj['error']['code'] + ' - ' + obj['error']['info'] + '\n* Please finish manually.'));
    return;
  } else if(obj['edit'] && obj['edit']['result']) {
    out.appendChild(document.createTextNode('* Edit returned as "' + obj['edit']['result'] + '", attempting to move page to [[' + sfmNewTitle + ']]... \n'));
  } else {
    out.appendChild(document.createTextNode('? Unexpected response: ' + txt + '\n* Please finish manually.'));
    return;
  }
  var def = "Semi-automated file move";
  var reason = getElementsByClassName(document,'span','media-move-reason');
  if(reason.length > 0) def = getInnerText(reason[0])

  var params = 'action=move&format=json&token=' + encodeURIComponent(sfmMoveToken) + '&movetalk=1&from=' + encodeURIComponent(wgPageName) + '&to=' + encodeURIComponent(sfmNewTitle) + '&reason=' + encodeURIComponent( 'using [[User:Splarka/ajaxfilemove.js]];' +def );

  var url = wgScriptPath + '/api.php';
  var req = sajax_init_object();
  req.open('POST', url, true);
  req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
  req.setRequestHeader('Content-length', params.length);
  req.setRequestHeader('Connection', 'close');
  req.onreadystatechange = function() {
    if(req.readyState == 4 && req.status == 200) {
      eval("sfmMove(" + req.responseText + ",'" + req.responseText.replace(/\'/g,"`") + "')");
    }
  }
  req.send(params);
}

function sfmMove(obj,txt) {
  var out = document.getElementById('sfm-output');
  if(obj['error']) {
    out.appendChild(document.createTextNode('* Api error: ' + obj['error']['code'] + ' - ' + obj['error']['info'] + '\n* Please finish manually.'));
  } else if(obj['move'] && obj['move']['from'] && obj['move']['to']) {
    out.appendChild(document.createTextNode('* File [[' + obj['move']['from'] + ']] moved to [[' + obj['move']['to'] + ']]\n* Be sure to '));
    var a = document.createElement('a');
    a.setAttribute('href',wgScript + '?title=Special:WhatLinksHere&hidelinks=1&hidetrans=1&target=' + encodeURIComponent(obj['move']['to']));
    a.appendChild(document.createTextNode('Check for double redirects!'));
    out.appendChild(a);
  } else {
    out.appendChild(document.createTextNode('? Unexpected response: ' + txt + '\n* Please finish manually.'));
  }
}

function test_protect(){
// testing date protection inside image names
 var txt=document.editform.wpTextbox1;
	Ohc_protect_ISO_convert();
}
 
// Add [[WP:Reflinks]] launcher in the toolbox on left
addOnloadHook(function () {
 addPortletLink(
  "p-tb",     // toolbox portlet
  "http://toolserver.org/~dispenser/cgi-bin/webreflinks.py/" + wgPageName 
   + "?client=script&citeweb=on&overwrite=&limit=30&lang=" + wgContentLanguage,
  "Reflinks"  // link label
)});


/*** BEGIN WIKIBREAK ENFORCER ***/
addOnloadHook(function() {

/*** Start editing here ***/

// When you want to end your break?
// no leading zeroes. (example: 7 - correct, 07 - incorrect)

var date = { year: 2011, month: 11, day: 3};
var time = { hours: 18, minutes: 30, seconds: 0 };

/*** Stop editing here ***/

var currentDate = new Date();
var enforcedBreakEnd = new Date(
date.year,date.month-1,date.day,time.hours,time.minutes,time.seconds);
if (currentDate <= enforcedBreakEnd) {
alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString()
+ "\n(now is "+currentDate.toLocaleString()+")\n\nBye!");
location = "http://"+location.host+"/w/index.php?title="
+ "Special:Userlogout&returnto=Main_Page";
}
});
/*** END WIKIBREAK ENFORCER ***/