Difference between revisions 56274165 and 59579601 on enwiki

/* <nowiki> */
// [[User:Lupin/popups.js]]

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>');
/* add tabs to warn vandals */
function vandal(tmplt) {
    var txt = document.editform.wpTextbox1;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += '{{subst:' + tmplt + '}} 12:15, 27 January 2006 (UTC)';
    txt.focus();
    txt = document.editform.wpSummary;
    txt.value = tmplt
    document.editform.wpWatchthis.checked = true;
}

// Add block buttons to the page
// ----------------------------------------------------------------------------- 
function AddBlockButtons() {
  var l, article = '', vandal;
  // Add 'block' links to a diff page
  l = document.getElementById('t-contributions');
  if (l) {
    clone = l.cloneNode(true);
    l.id = 't-blockuser';
    a = clone.getElementsByTagName('a')[0];
    a.href = a.href.replace(/Special:Contributions\//, 'Special:Blockip/');
    a.href = a.href.replace(/target=/, 'faketarget=');
    a.innerHTML = blocklink;
    l.parentNode.insertBefore(clone, l.nextSibling);
  }
}
 
/**** Add Godmode-lite ****/

// this one breaks popups
// document.write('<SCRIPT SRC="http://sam.zoy.org/wikipedia/godmode-light.js"><\/SCRIPT>'); 

document.write('<SCRIPT SRC="http://share.zopatista.com/WikiPedia/godmode-light.js"><\/SCRIPT>');

// ----------------------------------------------------------------------------- 
// God-like Monobook skin
// (c) 2005 Sam Hocevar <[email protected]>
// $Id: godmode-light.js 804 2005-03-21 12:16:18Z sam $
// ----------------------------------------------------------------------------- 

// -----------------------------------------------------------------------------
// Language support, taken from phase3/languages/*
// ----------------------------------------------------------------------------- 
var rollbacklink = 'rollback';
var cantrollback = 'Cannot revert edit; last contributor is only author of this page.';
var alreadyrolled = 'Cannot rollback last edit of [[$1]] by [[User:$2|$2]] ([[User talk:$2|Talk]]); someone else has edited or rolled back the page already. Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]). '; 
var revertpage = 'Reverted edit of $2, changed back to last version by $1';
switch (document.getElementsByTagName('html')[0].lang) {
  case 'fr':
    rollbacklink = 'révoquer';
    cantrollback = 'Impossible de révoquer: dernier auteur est le seul à avoir modifié cet article'; 
    alreadyrolled = 'Impossible de révoquer la dernière modification de [[$1]] par  [[User:$2|$2]] ([[User talk:$2|Talk]]); quelqu\'un d\'autre à déjà modifer ou révoquer l\'article. La dernière modificaion était de [[User:$3|$3]] ([[User talk:$3|Talk]]). '; // lol @ pathetic grammar 
    revertpage = 'restitution de la dernière modification de $1';
    break;
  case 'de':
    rollbacklink = 'Rollback';
    cantrollback = 'Die Änderung kann nicht zurückgenommen werden; der letzte Autor ist der einzige.'; 
    alreadyrolled = 'Die Zurücknahme des Artikels [[$1]] von [[Benutzer:$2|$2]] ([[Benutzer Diskussion:$2|Diskussion]]) ist nicht möglich, da eine andere Änderung oder Rücknahme erfolgt ist.  Die letzte Änderung ist von [[Benutzer:$3|$3]] ([[Benutzer Diskussion:$3|Diskussion]])'; 
    revertpage = 'Wiederhergestellt zur letzten Änderung von $1';
    break;
  case 'es':
    rollbacklink = 'Revertir';
    cantrollback = 'No se pueden revertir las ediciones; el último colaborador es el único autor de este artículo.'; 
    alreadyrolled = 'No se puede revertir la última edición de [[$1]] por [[Colaborador:$2|$2]] ([[Colaborador Discusión:$2|Discusión]]); alguien más ya ha editado o revertido esa página.  La última edición fue hecha por [[Colaborador:$3|$3]] ([[Colaborador Discusión:$3|Discusión]]). '; 
    revertpage = 'Revertida a la última edición de $1';
    break;
  case 'it':
    //rollbacklink = '';
    cantrollback = 'Impossibile tornare ad una versione precedente: l\'ultima modifica è stata apportata dall\'unico utente che abbia lavorato a questo articolo.'; 
    //alreadyrolled = '';
    revertpage = 'Riportata alla revisione precedente da $1';
    break;
  case 'pt':
    rollbacklink = 'voltar';
    cantrollback = 'Não foi possível reverter a edição; o último contribuidor é o único autor deste artigo.'; 
    alreadyrolled = 'Não foi possível reverter as edições de  [[$1]] por [[User:$2|$2]] ([[User talk:$2|Talk]]); alguém o editou ou já o reverteu.  A última edição foi de  [[User:$3|$3]] ([[User talk:$3|Conversar com ele]]). '; 
    revertpage = 'Revertido para a última edição por  $1';
    break;
}
 
 
// Our nice Revert functions
// -----------------------------------------------------------------------------
var vandal, editor, url;

function PerformRevert() {
  var l, token = '', revert = false;
  // Look for '&fakeaction=rollback' in URL
  url = location.pathname;
  l = location.search.substring(1).split('&');
  for (i = 0; i < l.length; i++) {
    var n = l[i].indexOf('=');
    var name = l[i].substring(0, n); 
    if (name == 'fakeaction') {
      if (l[i].substring(n + 1) == 'rollback')
        revert = true;
    } else if (name == 'vandal') {
      vandal = unescape(l[i].substring(n + 1));
    } else if (name == 'token') { 
      token = unescape(l[i].substring(n + 1));
    } else if (name == 'title') {
      url += '?' + l[i];
    }
  }
  if (!revert)
    return;
  document.getElementById('bodyContent').innerHTML = 'Please wait, reverting edits by ' + vandal + '...'; 
  // Avoid XSS kiddies by using a special token
  if (token == '' || token != hex_md5(url + vandal + document.cookie)) {
    document.getElementById('bodyContent').innerHTML += '<br />Bad authentication token!'; 
    return;
  }

  xmlhttp = HTTPClient();
  if (!xmlhttp)
    return;
  xmlhttp.open("GET", url + '&action=history&limit=50', true);
  xmlhttp.onreadystatechange = RevertStepTwo; 
  xmlhttp.send(null);
}

function RevertStepTwo() {
  if (xmlhttp.readyState != 4)
    return
  var l;
  var oldid;
  // Get the vandal and new editor names
  editor = '';
  l = XMLParse( xmlhttp.responseText, "text/xml").getElementById('pagehistory').getElementsByTagName('li');
  for (i = 0; i < l.length; i++) {
    var name = l[i].getElementsByTagName('span')[0].getElementsByTagName('a')[0].innerHTML; 
    if (i == 0 && name != vandal) {
      document.getElementById('bodyContent').innerHTML += '<br />Error: ' + vandal + ' is not the last editor!';
      return;
    } else if (i > 0 && name != vandal) { 
      oldid = l[i].getElementsByTagName('input')[0].value;
      editor = name;
      break;
    }
  }
  if (editor == '') {
    document.getElementById('bodyContent').innerHTML += '<br />Error: ' + vandal + ' is the only editor!'; 
    return;
  }

  xmlhttp = HTTPClient();
  if (!xmlhttp)
    return;
  xmlhttp.open("GET", url + '&action=edit&oldid=' + oldid, true);
  xmlhttp.onreadystatechange = RevertStepThree; 
  xmlhttp.send(null);
}

function RevertStepThree() {
  if (xmlhttp.readyState != 4)
    return
  var l;
  // Insert the downloaded form in our current page, using
  // only hidden form inputs. 
  var oldform = XMLParse(xmlhttp.responseText, "text/xml").getElementById('editform');
  var newform = document.createElement('form');
  l = oldform.getElementsByTagName('textarea');
  for (i = l.length ; i--; ) {
    var t = document.createElement('input');
    t.type = 'hidden';
    t.name = l[i].name;
    t.value = l[i].innerHTML;
    newform.appendChild(t);
  }
  l = oldform.getElementsByTagName ('input');
  for (i = l.length; i--; ) {
    if (l[i].name == 'wpSummary') {
      l[i].value = revertpage.replace(/\$1/g, editor).replace(/\$2/g, vandal);
    } else if (l[i].name == 'wpMinoredit') {
      l[i].value = '1'; 
    } else if (l[i].name == 'wpWatchthis') {
      continue; // Don’t touch the "watch" status
    } else if (l[i].name == 'wpPreview') {
      continue;
    }
    l[i].type = 'hidden';
    newform.appendChild(l[i]);
  }
  newform.name = oldform.name;
  newform.method = oldform.method;
  newform.id = oldform.id;
  newform.action = oldform.action;
  document.getElementById('bodyContent').appendChild(newform);
  // Submit the form
  newform.submit();
}

// ----------------------------------------------------------------------------- 
// Add revert buttons to the page
// -----------------------------------------------------------------------------
function AddRevertButtons() {
  var l, article = '', vandal;
  // Add 'revert' links to the diff page 
  l = document.getElementById('bodyContent').getElementsByTagName('td');
  for (i = 0; i < l.length; i++) {
    if (l[i].className == 'diff-otitle') {
      article = l[i].getElementsByTagName('a')[0].href.split('&')[0].replace(/[^\/]*\/\/[^\/]*/, ''); 
    } else if (l[i].className == 'diff-ntitle') {
      vandal = l[i].getElementsByTagName('a')[1].title.split(':')[1];
      var t = l[i].innerHTML
      n = t.indexOf('</a>) <br' );
      if (n >= 0 && article != '' && t.indexOf('oldid=') == -1) {
        l[i].innerHTML = t.substring(0, n + 5) + ' &nbsp;&nbsp;&nbsp;<strong>[<a href="' + article + '&fakeaction=rollback&vandal=' + vandal + '&token=' + hex_md5(article + vandal + document.cookie) + '">' + rollbacklink + '</a>]</strong> ' + t.substring(n + 5, t.length);
      }
    }
  }
  // Add 'revert' links to the contributions page
  if (location.href.indexOf (':Contributions') != -1) {
    vandal = document.getElementById('contentSub').getElementsByTagName('a')[0].innerHTML;
    l = document.getElementById('bodyContent').getElementsByTagName('li');
    for (i = 0; i < l.length; i++) {
      var t = l[i].innerHTML
      // If we are already a sysop on this wiki, abort
      if (t.indexOf('>' + rollbacklink + '</a>]') != -1)
          break;
      if (t.indexOf('&amp;diff=0') != -1) { 
        article = l[i].getElementsByTagName('a')[0].href.split('&')[0].replace(/[^\/]*\/\/[^\/]*/, '');
        l[i].innerHTML += ' [<a href="' + article + '&fakeaction=rollback&vandal=' + vandal + '&token=' + hex_md5(article + vandal + document.cookie) + '">' + rollbacklink + '</a>]';
      }
    }
  }
}
// include comfortable javascript editor by cacycle

// levels of undo (each level holds the whole text)
var undoBufferMax = 20;

// text and popup title of summary buttons
var summaryButtons = [
  ['Copyedit',  'Copyedit'],
  ['Linkfix',   'Linkfix'],
  ['Vandal',    'Reverting vandalism'],
  ['Format',    'Formatting source text'],
  ['Cap lists', 'Capitalizing (link) lists as per [[Wikipedia:List]] and [[Wikipedia:Manual_of_Style]]'] 
];

// background color of preview box
var previewBackground = '#ffffdd';

// loads the editor
document.write('<script type="text/javascript" src=" http://en.wikipedia.org/w/index.php?title=User:Cacycle/editor.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// Live Preview ([[User:Pilaf/Live Preview]], )
wpUserName   = 'Cacycle'; // User name to display in signatures 
wpShowImages = true; // Enable downloading and displaying of images
document.write('<script type="text/javascript" src=" http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// installs the editor and other tools after loading the page 
window.onload = Main;
function Main() {
  SetupEditor();
//  othertools();
}
 
 
 //  Add a "Kate" link to your monobook "personal menu" list at the very
  //  top of the page.
  //
  //  Indicate where you would like "Kate" to appear:
  //    pt-userpage, pt-mytalk, pt-preferences, 
  //    pt-watchlist, pt-mycontris, pt-logout
  //
gsKateInsertBefore = 'pt-mycontris'; // leave blank to append after "logout"
  //
function KateLink()
{
  var user = document.getElementById ( 'pt-userpage' ).firstChild.firstChild.data;

  var li = document.createElement( 'li' );
    li.id = 'pt-kate';

    var a = document.createElement( 'a' );
      a.appendChild ( document.createTextNode( 'Kate' ) ); // eh, the css makes the text lowercase
      a.href = ' http://tools.wikimedia.de/~kate/cgi-bin/count_edits?dbname=enwiki&user=' + user;

    li.appendChild( a );

  if ( ! gsKateInsertBefore ) // append to end (right) of list
  {  document.getElementById ( 'pt-logout' ).parentNode.appendChild( li );
  }
  else
  {  var before = document.getElementById( gsKateInsertBefore );
      before.appendChild( li, before );
  }
}
   if ( window.addEventListener ) window.addEventListener( 'load', KateLink, false );
else if ( window.attachEvent      ) window.attachEvent   ( 'onload', KateLink );


function warn()
{
    var txt = document.editform.wpTextbox1;
var prompter = prompt("Which warning do you wish to issue?");
var msgtext = "{{subst:" + prompter + "}}[[User:Betacommand|Betacommand]] 16:03, 13 February 2006 (UTC)";
var summary = "{{" + prompter + "}}";
    document.editform.wpSummary.value = summary;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += msgtext;
    document.editform.submit();
}
//From http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510

// 
function tnaddlilink(url, name)
{
  var na = document.createElement('a');
  na.setAttribute('href', url);

  var txt = document.createTextNode(name);
  na.appendChild(txt);

  var li = document.createElement('li');
  li.appendChild(na);
  return li;
}

function testn(number)
{
  var page = prompt("Vandalism to which article?")
  var f = document.editform, t = f.wpTextbox1;
  if (t.value.length > 0)
    t.value += '\n';
  t.value += "{{subst:" + "test" + number + "-n|" + page + "}} ~" + "~" + "~" + "~";
  f.wpSummary.value = "Vandalism to [[" + page + "]] - warning " + number;
}

function add_testn_tabs()
{
  var c1 = document.getElementById('column-one');
  var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];

  // Only add for pages with "Editing User talk:" somewhere in the title
  if (document.title.indexOf("Editing User talk:") != -1)
    {
      tabs.appendChild(tnaddlilink('javascript:testn(1)',"t1"));
      tabs.appendChild(tnaddlilink('javascript:testn(2)',"t2"));
      tabs.appendChild(tnaddlilink('javascript:testn(3)',"t3"));
      tabs.appendChild(tnaddlilink('javascript:testn(4)',"t4"));
    }
}

addOnloadHook(add_testn_tabs);

//
// Filter changes live
// [[User:Lupin/recent2.js]] - please include this line
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');


// Returns <li><a href="url">name</a></li>
function addlilink(url, name)
{
  var na = document.createElement('a');
  na.setAttribute('href', url);

  var txt = document.createTextNode(name);
  na.appendChild(txt);

  var li = document.createElement('li');
  li.appendChild(na);
  return li;
}

// Adds a "blocklog" tab and fills in the username field on Special:Blockip, if a "&faketarget=username" is present.
function do_blockip_stuff()
{
  // Look for a &faketarget= for the username/ip
  var l = location.search.substring(1).split('&');
  var target = '';
  for (var i = 0; i < l.length; ++i)
    {
      var n = l[i].indexOf('=');
      if (l[i].substring(0, n) == 'faketarget')
 {
   target = l[i].substring(n + 1);
   break;
 }
    }

  if (target == '')
    return;

  // put account name in "IP Address/username" field
  var addr = document.getElementsByName('wpBlockAddress')[0];
  addr.value = unescape(target);

  // add "blocklog" tab
  var c1 = document.getElementById('column-one');
  var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
  tabs.appendChild(addlilink('/w/index.php?title=Special%3ALog&type=block&user=&page=User%3A' + target, 'blocklog'));
}

// Adds "block" and "blocklog" tabs to User: and User talk: pages.
function add_block_tab()
{
  var c1 = document.getElementById('column-one');
  var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];

  // use the "edit this page" tab to get already-tidied url
  var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
  // cut everything up to "title=" from the start and everything past "&action=edit" from the end
  editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit'));
  editlk = editlk.substring(editlk.indexOf(':') + 1);
  var slloc = editlk.indexOf('/');
  if (slloc > 0)
    editlk = editlk.substring(0, slloc);
  // add "block" tab
  tabs.appendChild(addlilink('/w/index.php?title=Special%3ABlockip&faketarget=' + editlk, 'block'));
  // add "blocklog" tab
  tabs.appendChild(addlilink('/w/index.php?title=Special%3ALog&type=block&user=&page=User%3A' + editlk, 'blocklog'));
}

function do_onload()
{
  if (document.title.indexOf('User:') == 0
      || document.title.indexOf('User talk:') == 0)
    add_block_tab();
  else if (document.title.indexOf('Block user') == 0) // could stand to be more robust
    do_blockip_stuff();
 // if (document.title.indexOf('Image:') == 0)
    add_unverified_tab();
}

if (window.addEventListener) 
  window.addEventListener("load", do_onload, false);
else if (window.attachEvent) 
  window.attachEvent("onload", do_onload);

function add_unverified_tab()
{
//My Test
tabs.appendChild("javascript:unverified()", "unverified", "ca-unverified", "Tag as unverified", "");
}

function unverified() 
{
//document.forms[0].wpTextbox1.value = document.forms[0].wpTextbox1.value + "\n    erified}}";
//document.forms[0].wpSummary.value = "unverified";
//document.forms[0].submit();
//document.forms[0].wpMinoredit.checked = true;
}

// =-=-=- HELPER FUNCTIONS -=-=-=

function addlilink(tabs, url, name, id, title, key){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    tabs.appendChild(li);
    if(id)
    {
        if(key && title)
        {
            ta[id] = [key, title];
        }
        else if(key)
        {
            ta[id] = [key, ''];
        }
        else if(title)
        {
            ta[id] = ['', title];
        }
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}

function addToolboxLink(url, name, id){
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
    addlilink(tb, url, name, id);
}

function addTab(url, name, id, title, key){
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    return addlilink(tabs, url, name, id, title, key);
}

function addLink(where, url, name, id, title, key, after){
    //* where is the id of the toolbar where the button should be added;
    //   i.e. one of "p-cactions", "p-personal", or "p-navigation".
    //* url is the URL which will be called when the button is clicked.
    //   javascript: urls can be used to do more complex things.
    //* name is what will appear as the name of the button.
    //* id is the id of the button; it's best to define one.  
    //   Use a prefix to make sure its unique. Optional.
    //* title is the tooltip title that gives a longer description 
    //   of the button; if you define a accesskey, mention it here. Optional.
    //* key is the char you want for the accesskey. Optional.
    //* after is the id of the button you want to follow this one. Optional.
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
    if(after) {
 tabs.insertBefore(li,document.getElementById(after));
    } else {
 tabs.appendChild(li);
    }
    if(id) {
 if(key && title) { ta[id] = [key, title]; }
 else if(key) { ta[id] = [key, '']; }
 else if(title) { ta[id] = ['', title];} 
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
}
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

//========= LAST DIFF TAB =========
addOnloadHook(function () {
    z=document.getElementById("content").childNodes;
    for (var n=0;n<z.length;n++) { 
      if (z[n].className=="firstHeading") {
        var pname=z[n].textContent;
      }
    }
    var l=addTab("http://en.wikipedia.org/w/index.php?title=" + pname + "&diff=cur&oldid=prev", 'last', '');
    l.lastChild.title="Show most recent diff";
});

// ======== USER TABS =======
 
 addOnloadHook(function() {
   if (document.title.search("/") != -1 || document.title.search("- History -") != -1) { //no subpages or history
      return;
   }
   if (document.title.indexOf("User:") == 0 || document.title.indexOf("User talk:") == 0) {
      username_a = document.URL.match(/:.*:(.*)/);
      username=username_a[1];
      addTab("http://en.wikipedia.org/wiki/Special:Contributions/" + username, "contrib", "ca-contrib", "contribs", "");
      addTab("http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=move&user=" + username, "page moves", "ca-pagemoves", "page moves", "");
      addTab("http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=" + username, "block log", "ca-blog", "blog", "");
      addTab("http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user=" + username, "edit count", "ca-kate", "kate", "");
   }
 });
//================= warn.js ==================
function warn()
{
    var txt = document.editform.wpTextbox1;
var prompter = prompt("Which warning do you wish to issue?");
var msgtext = "{{subst:" + prompter + "}}[[User:Betacommand|Betacommand]] 04:47, 20 February 2006 (UTC)";
var summary = "{{" + prompter + "}}";
    document.editform.wpSummary.value = summary;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += msgtext;
    document.editform.submit();
}
// ==========logs link on toolbox =========
addOnloadHook(function () {

 // get page title
 var pagetitleRe=/[^:]*:\/\/en\.wikipedia\.org\/(wiki\/|w\/index\.php\?title=)([^&?#]*)/;
 ptitle = pagetitleRe.exec(decodeURI(location.href))[2].split('_').join(' ');
 
 // if this is a user, show the logs for the user rather than the page
 if( (window.location.href.indexOf("User:") != -1) || (window.location.href.indexOf("User_talk:") != -1) ) {
  regDropSubpages = /[User|User_talk]:([^&?\/]*)[\/]?.*/;
  user = regDropSubpages.exec(ptitle)[1];
  url = "http://en.wikipedia.org/w/index.php?title=Special%3ALog&user=" + user;
 } else if(window.location.href.indexOf("Special:") != -1) {
  // don't display link for special pages
  return;
 } else {
  url = "http://en.wikipedia.org/w/index.php?title=Special%3ALog&page=" + ptitle;
 }
 
 tabs = document.getElementById('p-tb').getElementsByTagName('ul')[0];
 l = addlilink(tabs, url, "Logs", "pt-logs");

});

// ============ replace within edit dialog ==============
function replace() {
    var s = prompt("Search regexp?");
    if(s) {
        var r = prompt("Replace regexp?");
        if(!r && r != '') return;
        var txt = document.editform.wpTextbox1;
        txt.value = txt.value.replace(new RegExp(s, "g"), r);
    }
}
/**/
  // AutoCopyvio - Adds copyright violation notice to article and adds entry to Copyright Problems page
  // Created by Bmicomp from modified AutoVFD(by Korath)
  
  function add_link2(url, name)
  {
    var na = document.createElement('a');
    na.setAttribute('href', url);
    na.appendChild(document.createTextNode(name));
  
    var li = document.createElement('li');
    li.appendChild(na);
  
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    tabs.appendChild(li);
  }
  
  function strip_namespace(target)
  {
    var colon = target.indexOf(':');
    if (colon != -1)
      {
        var spaces = new Array('User', 'Wikipedia', 'Image', 'MediaWiki', 'Template', 'Help', 'Category');
        var ns = target.substring(0, colon);
        if (ns == '' || ns == 'Talk')
          return target.substring(colon + 1);
        else
          for (var i = 0; i < spaces.length; ++i)
            {
              if (ns == spaces[i]
                  || ns == spaces[i] + '_talk')
                return target.substring(colon + 1);
            }
      }
    return target;
  }
  
  function copyvio()
  {
    document.editform.wpTextbox1.value = '{' + '{' + 'copyvio|url=}}';
    document.editform.wpSummary.value = 'copyvio';
  
    var target = document.editform.action;
    target = target.substring(target.indexOf('title=') + 6,
                              target.lastIndexOf('&action=submit'));
  
    var months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
    var date = new Date();
    var datestring = date.getUTCFullYear() + '_' + months[date.getUTCMonth()] + '_' + date.getUTCDate();
    var pagename = strip_namespace(target);
  
    window.open('/w/index.php?title=Wikipedia:Copyright_problems/' + datestring + '&action=edit&fakeaction=copyviolist&faketarget=' + pagename, 'status,toolbar,location,menubar,directories,resizeable,scrollbars');
  }
  
  function autocopyvio()
  {
    if (document.title.indexOf('Editing ') == 0)
      {
        var action = '';
        var target = '';
        if (location.search)
          {
            var l = location.search.substring(1).split('&');
            for (var i = 0; i < l.length; ++i)
              {
                var eq = l[i].indexOf('=');
                var name = l[i].substring(0, eq);
                if (name == 'fakeaction')
                  action = l[i].substring(eq + 1);
                else if (name == 'faketarget')
                  target = unescape(l[i].substring(eq + 1)).replace(/_/g, ' ');
              }
          }
  
        if (action == 'copyviolist')
          {
              document.editform.wpTextbox1.value += '*[[' + target + ']] <span class="plainlinks">([http://en.wikipedia.org/{{localurl:' + target + '|action=history}} history] · [http://en.wikipedia.org/{{localurl:' + target + '|diff=0}} last edit])</span>' + ' from [' + '] ~' + '~~' + '~';
              document.editform.wpSummary.value = 'Copyvio ' + '[[' + target + ']]';
          }
        else
          add_link2('javascript:copyvio()', 'copyvio');
      }
  }
  
  addOnloadHook(autocopyvio);
 /**/

//Please leave the following line
//user:Where/easy db
//Start db script
addOnloadHook(function() {
  if (document.title.indexOf("Editing ") != 0 && document.URL.search(/\?/) == -1)  {
     addTab("javascript:easyDb(0)", "db-", "ca-db0", "db-", "");
     addTab("javascript:easyDb(1)", "db|", "ca-db0", "db|", "");
  }
});

function easyDb(n) {
  var db;
  if (n == 0) {db="db-";}
  if (n == 1) {db="db|";}
  var type = prompt("What is X in Template:" + db + "X ?");
  document.location = document.URL + "?action=edit&autoedit=s/^/\nTemplate:" + db + type + "\n/&autosummary=Tagged for speedy deletion&autoclick=wpSave";
}
//End db script

// addPurge
addOnloadHook( function (){
    var x = document.getElementById('ca-history');
    if(!x) return;
    if(x.children) x = x.children[0].href;
    else x = x.childNodes[0].href;
    addLink("p-cactions", x.replace(/=history/, "=purge"), 'purge', 'ca-purge', 'Purge the internal cache for this page', 0);
});


// 

/* </nowiki> */{{{image|{{#if:
 {{{flag|{{{nation}}}}}}
 |[[Image:Flag of {{{flag|{{{nation}}}}}}.svg|thumb|right|{{{px|250px}}}|Flag of [[{{{flag|{{{nation}}}}}}]]]]
}}}}}
{| class="toccolours" cellpadding="2" cellspacing="0" style="margin:3px auto; border: 1px solid; font-size:95%;  align="center" 
|-
| align="center" |
'''Aircraft by nationality of original manufacturer'''<br> 
[[:Category:International aircraft |International joint ventures]] <br>
[[:Category:Argentine aircraft|Argentina]]&nbsp;-
[[:Category:Australian aircraft|Australia]]&nbsp;-
[[:Category:Belgian aircraft|Belgium]]&nbsp;-
[[:Category:Brazilian aircraft|Brazil]]&nbsp;-
[[:Category:Bulgarian aircraft|Bulgaria]]&nbsp;-
[[:Category:Canadian aircraft|Canada]]&nbsp;-
[[:Category:Chilean aircraft|Chile]]&nbsp;-
[[:Category:Chinese aircraft|China]]&nbsp;-
[[:Category:Czech and Czechoslovakian aircraft|Czechoslovakia]]&nbsp;-
[[:Category:Danish aircraft|Denmark]]&nbsp;-
[[:Category:Finnish aircraft|Finland]]&nbsp;-
[[:Category:French aircraft|France]]&nbsp;-
[[:Category:German aircraft|Germany]]&nbsp;-
[[:Category:Greek aircraft|Greece]]&nbsp;-
[[:Category:Indian aircraft|India]]&nbsp;-
[[:Category:Iranian aircraft|Iran]]&nbsp;-
[[:Category:Israeli aircraft|Israel]]&nbsp;-
[[:Category:Italian aircraft|Italy]]&nbsp;-
[[:Category:Japanese aircraft|Japan]]&nbsp;-
[[:Category:Latvian aircraft|Latvia]]&nbsp;-
[[:Category:Mexican aircraft|Mexico]]&nbsp;-
[[:Category:Dutch aircraft|Netherlands]]&nbsp;-
[[:Category:New Zealand aircraft|New Zealand]]&nbsp;-
[[:Category:Polish aircraft|Poland]]&nbsp;-
[[:Category:Romanian aircraft|Romania]]&nbsp;-
[[:Category:South African aircraft|South Africa]]&nbsp;-
[[:Category:Soviet and Russian aircraft|Soviet Union and CIS]]&nbsp;-
[[:Category:Spanish aircraft|Spain]]&nbsp;-
[[:Category:Swedish aircraft|Sweden]]&nbsp;-
[[:Category:Swiss aircraft|Switzerland]]&nbsp;-
[[:Category:Ukrainian aircraft|Ukraine]]&nbsp;-
[[:Category:British aircraft|United Kingdom]]&nbsp;-
[[:Category:U.S. aircraft|United States]]&nbsp;-
[[:Category:Yugoslav and Serbian aircraft|Yugoslavia]]
|}

{{airlistbox}}

{{{cat|[[Category:Aircraft by country]]
[[Category:Aviation in {{{nation}}}|Aircraft]]}}}