Discussion MediaWiki:Monobook.js

message: Traduccion prepausada per:

message: /* tooltips and access keys */ ta = new Object(); ta['pt-userpage'] = new Array('.','My user page'); ta['pt-anonuserpage'] = new Array('.','The user page for the ip you\'re editing as'); ta['pt-mytalk'] = new Array('n','My talk page'); ta['pt-anontalk'] = new Array('n','Discussion about edits from this ip address'); ta['pt-preferences'] = new Array('','My preferences'); ta['pt-watchlist'] = new Array('l','The list of pages you\'re monitoring for changes.'); ta['pt-mycontris'] = new Array('y','List of my contributions'); ta['pt-login'] = new Array('o','You are encouraged to log in, it is not mandatory however.'); ta['pt-anonlogin'] = new Array('o','You are encouraged to log in, it is not mandatory however.'); ta['pt-logout'] = new Array('o','Log out'); ta['ca-talk'] = new Array('t','Discussion about the content page'); ta['ca-edit'] = new Array('e','You can edit this page. Please use the preview button before saving.'); ta['ca-addsection'] = new Array('+','Add a comment to this discussion.'); ta['ca-viewsource'] = new Array('e','This page is protected. You can view its source.'); ta['ca-history'] = new Array('h','Past versions of this page.'); ta['ca-protect'] = new Array('=','Protect this page'); ta['ca-delete'] = new Array('d','Delete this page'); ta['ca-undelete'] = new Array('d','Restore the edits done to this page before it was deleted'); ta['ca-move'] = new Array('m','Move this page'); ta['ca-watch'] = new Array('w','Add this page to your watchlist'); ta['ca-unwatch'] = new Array('w','Remove this page from your watchlist'); ta['search'] = new Array('f','Search this wiki'); ta['p-logo'] = new Array('','Main Page'); ta['n-mainpage'] = new Array('z','Visit the Main Page'); ta['n-portal'] = new Array('','About the project, what you can do, where to find things'); ta['n-currentevents'] = new Array('','Find background information on current events'); ta['n-recentchanges'] = new Array('r','The list of recent changes in the wiki.'); ta['n-randompage'] = new Array('x','Load a random page'); ta['n-help'] = new Array('','The place to find out.'); ta['n-sitesupport'] = new Array('','Support us'); ta['t-whatlinkshere'] = new Array('j','List of all wiki pages that link here'); ta['t-recentchangeslinked'] = new Array('k','Recent changes in pages linked from this page'); ta['feed-rss'] = new Array('','RSS feed for this page'); ta['feed-atom'] = new Array('','Atom feed for this page'); ta['t-contributions'] = new Array('','View the list of contributions of this user'); ta['t-emailuser'] = new Array('','Send a mail to this user'); ta['t-upload'] = new Array('u','Upload images or media files'); ta['t-specialpages'] = new Array('q','List of all special pages'); ta['ca-nstab-main'] = new Array('c','View the content page'); ta['ca-nstab-user'] = new Array('c','View the user page'); ta['ca-nstab-media'] = new Array('c','View the media page'); ta['ca-nstab-special'] = new Array('','This is a special page, you can\'t edit the page itself.'); ta['ca-nstab-wp'] = new Array('a','View the project page'); ta['ca-nstab-image'] = new Array('c','View the image page'); ta['ca-nstab-mediawiki'] = new Array('c','View the system message'); ta['ca-nstab-template'] = new Array('c','View the template'); ta['ca-nstab-help'] = new Array('c','View the help page'); ta['ca-nstab-category'] = new Array('c','View the category page'); 
---
/* tooltips and access keys */ ta = new Object(); ta['pt-userpage'] = new Array('.','Vòstra pagina d\'utilisator.'); ta['pt-anonuserpage'] = new Array('.','La pagina d\'utilisator per la ip de la quina es estada editada'); ta['pt-mytalk'] = new Array('n','Vòstra pagina de discutida.'); ta['pt-anontalk'] = new Array('n','Discutida sus las edicions per aquesta adreça ip.'); ta['pt-preferences'] = new Array('','Vòstras preferéncias.'); ta['pt-watchlist'] = new Array('l','La lista de las paginas que ne seguissètz los cambiaments.'); ta['pt-mycontris'] = new Array('y','Lista de vòstras contribucions.'); ta['pt-login'] = new Array('o','Vos encoratjam a vos enregistrar, mas es pas obligatòri.'); ta['pt-anonlogin'] = new Array('o','Vos encoratjam a vos enregistrar, mas es pas obligatòri.'); ta['pt-logout'] = new Array('o','Tancatz la session.'); ta['ca-talk'] = new Array('t','Discutida sul contengut d\'aquesta pagina.'); ta['ca-edit'] = new Array('e','Podètz editar aquesta pagina. S. v. p. previsualizatz abans de salvagardar.'); ta['ca-addsection'] = new Array('+','Ajustatz un comentari a aquesta discutida.'); ta['ca-viewsource'] = new Array('e','Aquesta pagina es protegida. Podètz veire son còdi de font.'); ta['ca-history'] = new Array('h','Versions ancianas d\'aquesta pagina.'); ta['ca-protect'] = new Array('=','Protegissètz aquesta pagina.'); ta['ca-delete'] = new Array('d','Escafatz aquesta pagina.'); ta['ca-undelete'] = new Array('d','Restauratz las edicions fachas d'aquesta pagina abans que foguèsse escafada.'); ta['ca-move'] = new Array('m','Cambiar lo nom d'aquesta pagina.'); ta['ca-nomove'] = new Array('','Avètz pas lo drech de mòure aquesta pagina.'); ta['ca-watch'] = new Array('w','Ajustatz aquesta pagina a vòstra lista de seguida.'); ta['ca-unwatch'] = new Array('w','Levatz aquesta pagina de vòstra lista de seguida.'); ta['search'] = new Array('f','Cercatz aqueste Wiki.'); ta['p-logo'] = new Array('','Pagina principala.'); ta['n-mainpage'] = new Array('z','Visitatz la pagina principala.'); ta['n-portal'] = new Array('','Sul projècte, qué podètz far, ont podètz trobar çò que cercatz?'); ta['n-currentevents'] = new Array('','Per trobar d'informacions generalas sus l\'actualitat.'); ta['n-recentchanges'] = new Array('r','La lista de cambiaments recents de la Oiquipedià.'); ta['n-randompage'] = new Array('x','Prenètz una pagina a l'azard.'); ta['n-help'] = new Array('','Lo lòc per trobar.'); ta['n-sitesupport'] = new Array('','Fasètz-nos una donacion.'); ta['t-whatlinkshere'] = new Array('j','Lista de totas las paginas wiki ligadas aquí.'); ta['t-recentchangeslinked'] = new Array('k','Darrièrs cambiaments de paginas ligadas amb aquesta pagina.'); ta['feed-rss'] = new Array('','RSS feed for this page'); ta['feed-atom'] = new Array('','Atom feed for this page'); ta['t-contributions'] = new Array('','Vesètz la lista de contribucions d\'aqueste utilisator.'); ta['t-emailuser'] = new Array('','Enviatz un corrièr a aqueste utilisator.'); ta['t-upload'] = new Array('u','Cargament d\'imatges o autres fichièrs.'); ta['t-specialpages'] = new Array('q','Lista de totas las paginas especialas.'); ta['ca-nstab-main'] = new Array('c','Vesètz lo contengut de la pagina.'); ta['ca-nstab-user'] = new Array('c','Vesètz la pagina de l\'utilisator.'); ta['ca-nstab-media'] = new Array('c','View the media page'); ta['ca-nstab-special'] = new Array('','Aquesta pagina es una pagina especiala, la podètz pas editar.'); ta['ca-nstab-wp'] = new Array('a','View the project page'); ta['ca-nstab-image'] = new Array('c','View the image page'); ta['ca-nstab-mediawiki'] = new Array('c','Vesètz lo messatge del sistèma.'); ta['ca-nstab-template'] = new Array('c','Vesètz lo modèl.'); ta['ca-nstab-help'] = new Array('c','Vesètz la pagina d\'ajuda.'); ta['ca-nstab-category'] = new Array('c','Vesètz la pagina de la categoria.');

message: Cedric31 2 mar 2006 à 16:39 (UTC)

message: Quauquei modificacions menoras (e gaire nombrosas) prepausadas (correccions, o coeréncia, o sintaxi pus idiomatica). En particular (lista non limitativa):
#quauquei fautas de picatge
#"levar" puslèu que "traire"
#"mandar" puslèu que "enviar"
#"coma" per introduire una lista d'exemples ("talas coma" es un francisme dins aqueu contèxt): Mesuras '''coma''' proteccion de pagina, interdiccion d'edicion...
#"de qualitat" au singular
#"Comitat_d'arbitratge" (e non pas "Comitata_d'arbitratge")
#ai trobat "TODO" dins un comentari dau programa ("De faire" ?)
Lei modificacions (lingüisticas) son dins lo còdi ; evidentament, ai ren modificat d'autre. [[Utilisator:Vivarés|Vivarés]] 18 d'abril 2006 à 18:30 (UTC)
/* <pre> <nowiki> */
//

message: // 
// Info-bulla e botons d'acorchi
// 
//============================================================
ta = new Object();
ta['pt-userpage']           = new Array('.', 'Ma pagina d'utilisator'); 
ta['pt-anonuserpage']       = new Array('.', 'La pagina d'utilisator per l\'adreça IP qu'utilisatz'); 
ta['pt-mytalk']             = new Array('N', 'Ma pagina de discutida'); 
ta['pt-anontalk']           = new Array('N', 'La pagina de discutida per aquesta adreça'); 
ta['pt-preferences']        = new Array(,  'Mas preferéncias'); 
ta['pt-watchlist']          = new Array('L', 'La lista de las paginas que seguissètz'); 
ta['pt-mycontris']          = new Array('Y', 'La lista de mas contribucions'); 
ta['ca-talk']               = new Array('T', 'Discutida per aquesta pagina'); 
ta['ca-edit']               = new Array('E', 'Podètz modificar aquesta pagina. Mercé de previsualisar abans d\'enregistrar.'); 
ta['ca-addsection']         = new Array('+', 'Ajustar un comentari a aquesta discutida.'); 
ta['ca-viewsource']         = new Array('E', 'Aquesta pagina es protegida. Çaquelà, ne podètz veire lo contengut.'); 
ta['ca-history']            = new Array('H', 'Los autors e versions precedentas d'aquesta pagina.'); 
ta['ca-protect']            = new Array('=', 'Per protegir aquesta pagina.'); 
ta['ca-delete']             = new Array('D', 'Per suprimir aquesta pagina.'); 
ta['ca-undelete']           = new Array('D', 'Per restaurar aquesta pagina.'); 
ta['ca-move']               = new Array('M', 'Per desplaçar o renomenar aquesta pagina.'); 
ta['ca-nomove']             = new Array(,  'Avètz pas la permission de desplaçar aquesta pagina.'); 
ta['ca-watch']              = new Array('W', 'Ajustatz aquesta pagina a vòstra lista de seguit.'); 
ta['ca-unwatch']            = new Array('W', 'Levar aquesta pagina de vòstra lista de seguit.'); 
ta['search']                = new Array('F', 'Per efectuar una recèrca.'); 
ta['p-logo']                = new Array(,  'Pagina principala.'); 
ta['n-mainpage']            = new Array('Z', 'Per afichar la pagina principala.'); 
ta['n-portal']              = new Array(,  'A prepaus del projècte.'); 
ta['n-currentevents']       = new Array(,  'Trobatz d'informacions suls eveniments recents.'); 
ta['n-recentchanges']       = new Array('R', 'La lista dels darrièrs cambiaments.'); 
ta['n-randompage']          = new Array('X', 'Afichar una pagina a l'azard.'); 
ta['n-help']                = new Array(,  'Ajuda.'); 
ta['n-sitesupport']         = new Array(,  'Per sosténer lo projècte.'); 
ta['t-whatlinkshere']       = new Array('J', 'Lista de las paginas ligadas a aquesta.'); 
ta['t-recentchangeslinked'] = new Array('K', 'Lista dels darrièrs cambiaments de las paginas ligadas a aquesta.'); 
ta['feed-rss']              = new Array(,  'Alimentar lo flux RSS per aquesta pagina.'); 
ta['feed-atom']             = new Array(,  'Alimentar lo flux Atom per aquesta pagina.'); 
ta['t-contributions']       = new Array(,  'Veire la lista de las contribucions d'aqueste utilisator.'); 
ta['t-emailuser']           = new Array(,  'Mandar un corrièr electronic a aqueste utilisator.'); 
ta['t-upload']              = new Array('U', 'Importar un imatge o fichièr medià sul serveire.'); 
ta['t-specialpages']        = new Array('Q', 'Lista de las paginas especialas.'); 
ta['ca-nstab-main']         = new Array('C', 'Afichar lo contengut d'aquesta pagina.'); 
ta['ca-nstab-user']         = new Array('C', 'Afichar la pagina d'utilisator.'); 
ta['ca-nstab-media']        = new Array('C', 'Afichar la pagina medià.'); 
ta['ca-nstab-special']      = new Array(,  'Aquò es una pagina especiala, la podètz pas modificar.'); 
ta['ca-nstab-wp']           = new Array('A', 'Afichar la pagina del projècte.'); 
ta['ca-nstab-image']        = new Array('C', 'Afichar la pagina de descripcion de l\'imatge.'); 
ta['ca-nstab-mediawiki']    = new Array('C', 'Afichar lo messatge sistèma.'); 
ta['ca-nstab-template']     = new Array('C', 'Afichar lo modèl.'); 
ta['ca-nstab-help']         = new Array('C', 'Afichar la pagina d\'ajuda.'); 
ta['ca-nstab-category']     = new Array('C', 'Afichar la pagina de categoria.');
//============================================================
//
// Foncions de gestion
//
//============================================================
/**
 * Installacion d'una foncion novèla d'aqueste biais:
 * aOnloadFunctions[aOnloadFunctions.length] = nom_de_la_foncion; // (sens parentèsis)
 */
if (!window.aOnloadFunctions) { 
  var aOnloadFunctions = new Array(); 
}
window.onload = function() 
{
  if (window.aOnloadFunctions) {
    for (var _i=0; _i<aOnloadFunctions.length; _i++) {
      aOnloadFunctions[_i]();
    }
  }
}
/**
 * Ajustar una foncion novèla d'executar al cargament de la pagina.
 */ 
function addLoadEvent(func) 
{
  if (window.addEventListener) 
    window.addEventListener("load", func, false);
  else if (window.attachEvent) 
    window.attachEvent("onload", func);
}
//============================================================
//
// Boitas desenrotlantas
//
//============================================================
 // BEGIN Dynamic Navigation Bars (experimantal)
 
 // set up the words in your language
 var NavigationBarHide = '[ Enrotlar ]';
 var NavigationBarShow = '[ Desenrotlar ]';
 
 // set up max count of Navigation Bars on page,
 // if there are more, all will be hidden
 // NavigationBarShowDefault = 0; // all bars will be hidden
 // NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
 var NavigationBarShowDefault = 0;
 
 
 // shows and hides content and picture (if available) of navigation bars
 // Parameters:
 //     indexNavigationBar: the index of navigation bar to be toggled
 function toggleNavigationBar(indexNavigationBar)
 {
    var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
    var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);
 
    if (!NavFrame || !NavToggle) {
        return false;
    }
 
    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (
                var NavChild = NavFrame.firstChild;
                NavChild != null;
                NavChild = NavChild.nextSibling
            ) {
            if (NavChild.className == 'NavPic') {
                NavChild.style.display = 'none';
            }
            if (NavChild.className == 'NavContent') {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;
 
    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (
                var NavChild = NavFrame.firstChild;
                NavChild != null;
                NavChild = NavChild.nextSibling
            ) {
            if (NavChild.className == 'NavPic') {
                NavChild.style.display = 'block';
            }
            if (NavChild.className == 'NavContent') {
                NavChild.style.display = 'block';
            }
        }
    NavToggle.firstChild.data = NavigationBarHide;
    }
 }
 
 // adds show/hide-button to navigation bars
 function createNavigationBarToggleButton()
 {
    var indexNavigationBar = 0;
    // iterate over all < div >-elements
    for(
            var i=0; 
            NavFrame = document.getElementsByTagName("div")[i]; 
            i++
        ) {
        // if found a navigation bar
        if (NavFrame.className == "NavFrame") {
 
            indexNavigationBar++;
            var NavToggle = document.createElement("a");
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
            
            var NavToggleText = document.createTextNode(NavigationBarHide);
            NavToggle.appendChild(NavToggleText);
            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(
              var j=0; 
              j < NavFrame.childNodes.length; 
              j++
            ) {
              if (NavFrame.childNodes[j].className == "NavHead") {
                NavFrame.childNodes[j].appendChild(NavToggle);
              }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
    // if more Navigation Bars found than Default: hide all
    if (NavigationBarShowDefault < indexNavigationBar) {
        for(
                var i=1; 
                i<=indexNavigationBar; 
                i++
        ) {
            toggleNavigationBar(i);
        }
    }
 
 }
 
 addLoadEvent(createNavigationBarToggleButton);
 
 // END Dynamic Navigation Bars
//============================================================
//
// Foncions d'empliment automatic
//
//============================================================
function InitPaS(page_name)
{
    var c1 = "";
    var c2 = "";
    var tpl = '';
    return c1 + '\n' + tpl + '\n' + c2;
}
function InitPaV(page_name)
{
    var c1 = "";
    var c2 = "";
    var tpl = '';
    return c1 + '\n' + tpl + '\n' + c2;
}
function InitLANN(page_name)
{
    var c1 = "";
    var c2 = "";
    var tpl = '';
    return c1 + '\n' + tpl + '\n' + c2;
}
function InitIaS(page_name)
{
    var c1 = "";
    var c2 = "";
    var tpl = '';
    return c1 + '\n' + tpl + '\n' + c2;
}
function InitPAdQ(page_name)
{
    var c1 = "";
    var tpl = '\n';
}
function InitIaA(page_name)
{
    var c1 = "";
    return c1 + '\n'
}
function InitPCP(page_name)
{
    var c1 = "";
    var c2 = "";
    var tpl = '';
    return c1 + '\n' + tpl + '\n' + c2;
}
function InitArbReq(page_name)
{
    var c1 = "<" + "!-- Emplenatz los camps (???) puèi salvagardatz --" + ">\n";
    var c2 = "Categoria:Arbitratge en cors\n{" + "{Pagina d'arbitratge}}\n\nArbitre coordinator :\n\n";
    var c3 = "Arbitre(s) participant pas a aqueste arbitratge :\n\n";
    var c4 = "== Descripcion del conflicte ==\n\nDemanda depausada per : X lo ??? a ???\n\n";
    var c5 = "Partidas concernidas pel conflicte : ??? e  (e ).\n\n";
    var c6 = "Natura del conflicte  : ???\n\n";
    var c7 = "Receptibilitat :\n\nDecision :\n\n";
    var c8 = "== Arguments de ??? ==\n{" + "{CAr limit dels arguments}}\n\n";
    var c9 = c8;
    var c10 = "== Receptibilitat ==\n\n== Mesuras conservatòrias ==\n<" + "!-- Mesuras coma proteccion de pagina, interdiccion d'edicion o blocatge, decidida pel coordinator, amb justificacion. Los autres arbitres i reagisson aicí. --" + ">\n\n== Discutida sul fons ==\n\n=== Comentaris dels arbitres ===\n\n";
    var c11 = "=== Proposicions ===\n\n==== Proposicion 1 ====\n\nProposicion :\n\nVòte :";
    return c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9 + c10 + c11;
}
var init_if_empty = new Array(
    new Array('Oiquipedià:Paginas_de_suprimir/', InitPaS),
    new Array('Oiquipedià:Paginas_de_verificar/', InitPaV),
    new Array('Oiquipedià:Lista_dels_articles_non_neutres/', InitLANN),
    new Array('Oiquipedià:Imatges_de_suprimir/', InitIaS),
    new Array('Oiquipedià:Proposicion_articles_de_qualitat/', InitPAdQ),
    new Array('Oiquipedià:Paginas_sospechadas_de_violacion_de_copyright/', InitPCP),
    new Array('Oiquipedià:Comitat_d'arbitratge/Arbitratge/', InitArbReq)
);
/**
 * Emplega la zòna d'edicion s'es voida amb lo tèxt retornat per
 * un ponchaire de foncion seleccionat pel nom de la pagina.
 */
function InitPage()
{
    // TODO, cal testar l'existéncia de l'edit box e la longor
    // del tèxt  en defòra de la bocla
    ugly_url = 'http://oc.wikipedia.org/w/index.php?title=';
    for (var i = 0; i < init_if_empty.length; ++i) {
      var page_name = document.URL;
      var page_match = init_if_empty[i][0];
      var index = page_name.indexOf(ugly_url + page_match);
      if (index != -1) {
	var text_area = document.editform.wpTextbox1;
	if (text_area.value.length == 0) {
           page_name = page_name.slice((ugly_url + page_match).length);
           page_name = page_name.split('&')[0];
           page_name = decodeURI(page_name);
           page_name = page_name.replace(/_/g, ' ')
	   text_area.value = init_if_empty[i][1](page_name);
           break;
	}
      }
    }
}
addLoadEvent(InitPage);
//============================================================
//
// Caractèrs especials
//
//============================================================
/**
 * Ajustatz lo menut per causir de jos-ensembles de caractèrs especials
 * @note	L'òrdre d'aquesta lista deu correspondre al de MediaWiki:Edittools !
 */
function addCharSubsetMenu() {
  var specialchars = document.getElementById('specialchars');
  if (specialchars) {
    var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
    menu += "<option>Wiki</option>";
    menu += "<option>Matematicas</option>";
    menu += "<option>API</option>";
    menu += "<option>Latin/Roman</option>";
    menu += "<option>Grèc</option>";
    menu += "<option>Cirillic</option>";
    menu += "<option>AHD</option>";
    menu += "<option>Alemand</option>";
    menu += "<option>Arab</option>";
    menu += "<option>Catalan</option>";
    menu += "<option>Croat</option>";
    menu += "<option>Espanhòl</option>";
    menu += "<option>Esperanto</option>";
    menu += "<option>Estonian</option>";
    menu += "<option>Gallés</option>";
    menu += "<option>Hawaian</option>";
    menu += "<option>Ebrèu</option>";
    menu += "<option>Ieroglif</option>";
    menu += "<option>Olandés</option>";
    menu += "<option>Ongrés</option>";
    menu += "<option>Indo-europenc</option>";
    menu += "<option>Irlandés</option>";
    menu += "<option>Islandés</option>";
    menu += "<option>Italian</option>";
    menu += "<option>Leton</option>";
    menu += "<option>Lituanian</option>";
    menu += "<option>Maltés</option>";
    menu += "<option>Navajo & Apache</option>";
    menu += "<option>Pinyin</option>";
    menu += "<option>Polonés</option>";
    menu += "<option>Portugués</option>";
    menu += "<option>Rōmaji</option>";
    menu += "<option>Romanés</option>";
    menu += "<option>Escandinau</option>";
    menu += "<option>Sèrbe</option>";
    menu += "<option>Chèc</option>";
    menu += "<option>Turc</option>";
    menu += "<option>Vièlh anglés</option>";
    menu += "<option>Vietnamian</option>";
    menu += "<option>Yiddish</option>";
    menu += "</select>";
    specialchars.innerHTML = menu + specialchars.innerHTML;
    /* default subset - try to use a cookie some day */
    chooseCharSubset(0);
  }
}
/* select subsection of special characters */
function chooseCharSubset(s) {
  var l = document.getElementById('specialchars').getElementsByTagName('p');
  for (var i = 0; i < l.length ; i++) {
    l[i].style.display = i == s ? 'inline' : 'none';
    l[i].style.visibility = i == s ? 'visible' : 'hidden';
  }
}
addLoadEvent(addCharSubsetMenu);
//============================================================
//
// Causida de l'afichatge de las referéncias
//
//============================================================
/**
 * Causida del mòde d'afichatge de las referéncias.
 * @note	L'òrdre d'aquesta lista deu correspondre al del Modèl:Edicion !
 */
function addBibSubsetMenu() 
{
  var specialBib = document.getElementById('specialBib');
  if (specialBib) 
  {
    specialBib.style.display = 'block';
    var menu = "<select style=\"display:inline;\" onChange=\"chooseBibSubset(selectedIndex)\">";
    menu += "<option>Lista</option>";
    menu += "<option>WikiNorme</option>";
    menu += "<option>BibTeX</option>";
    menu += "<option>ISBD</option>";
    menu += "<option>ISO690</option>";
    menu += "</select>";
    specialBib.innerHTML = specialBib.innerHTML + menu;
  }
    /* default subset - try to use a cookie some day */
    chooseBibSubset(0);
}
/* select subsection of special characters */
function chooseBibSubset(s) 
{
  var l = document.getElementsByTagName('div');
  for (var i = 0; i < l.length ; i++) 
  {
         if(l[i].className == 'BibList')   l[i].style.display = s == 0 ? 'block' : 'none';
    else if(l[i].className == 'WikiNorme') l[i].style.display = s == 1 ? 'block' : 'none';
    else if(l[i].className == 'BibTeX')    l[i].style.display = s == 2 ? 'block' : 'none';
    else if(l[i].className == 'ISBD')      l[i].style.display = s == 3 ? 'block' : 'none';
    else if(l[i].className == 'ISO690')    l[i].style.display = s == 4 ? 'block' : 'none';
  }
}
addLoadEvent(addBibSubsetMenu);
//============================================================
//
// Previsualisacion rapida 
//
//============================================================
/**
 * Escript ajustant una opcion de previsualisacion rapida.
 * 
 *
 * English: Add a Quick View option on the Edit pages.
 * This script add 2 new buttons into the "editButtons" div.
 * When QuickPrev button is press, the content of edit window 
 * is retreived and parsed using regular expressions.
 *
 * @author: fr:user:aoineko
 * @version: 0.2
 */
function addQuickPreview() 
{
  var QuickPreviewBtnTitle  = "Previsualisacion rapida de vòstras modificacions [Alt + Q]";
  var QuickPreviewBtnValue  = "Previsualisacion rapida";
  var QuickPrevHideBtnTitle = "Amagar la previsualisacion rapida [Alt + H]";
  var QuickPrevHideBtnValue = "Amagar";
  var div = document.getElementsByTagName('div');
  for(var i = 0; i < div.length ; i++)
  {
    if(div[i].className == "editButtons") // search "editButtons" div
    {
      div[i].appendChild(document.createElement("br")); // add a 
      var wpQuick = document.createElement("input"); // create and set the "QuickPrev" button
      wpQuick.setAttribute("id",        "wpQuick");
      wpQuick.setAttribute("name",      "wpQuick");
      wpQuick.setAttribute("title",     QuickPreviewBtnTitle);
      wpQuick.setAttribute("value",     QuickPreviewBtnValue);
      wpQuick.setAttribute("type",      "button");
      wpQuick.setAttribute("onclick",   "doQuickPreview();");
      wpQuick.setAttribute("tabindex",  "8");
      wpQuick.setAttribute("accesskey", "Q");
      div[i].appendChild(wpQuick);
      var wpHide = document.createElement("input"); // create and set the "Hide" button
      wpHide.setAttribute("id",        "wpHide");
      wpHide.setAttribute("name",      "wpHide");
      wpHide.setAttribute("title",     QuickPrevHideBtnTitle);
      wpHide.setAttribute("value",     QuickPrevHideBtnValue);
      wpHide.setAttribute("type",      "button");
      wpHide.setAttribute("onclick",   "hideQuickPreview();");
      wpHide.setAttribute("tabindex",  "9");
      wpHide.setAttribute("accesskey", "H");
      div[i].appendChild(wpHide);
    }
  }
}
/// Retreive current code and parse it
function doQuickPreview() 
{
  var wpQuickPreview = document.getElementById("wpQuickPreview");
  if(!wpQuickPreview) 
  {
    /*var l = document.getElementsByTagName('div');
    for(var i = 0; i < l.length ; i++)
      if(l[i].className == "previewnote")
        wpQuickPreview = l;
    
    if(!wpQuickPreview)*/
    {
      wpQuickPreview = document.createElement("div");
      wpQuickPreview.setAttribute("style", "border:solid 1px gray; width:100%; margin-top:1em; margin-bottom:1em; padding:0.5em;");
      var wpSummaryLabel = document.getElementById("wpSummaryLabel");
      wpSummaryLabel.parentNode.insertBefore(wpQuickPreview, wpSummaryLabel);
    }
    wpQuickPreview.setAttribute("id",    "wpQuickPreview");
  }
  wpQuickPreview.style.display = "block";
  wpTextbox1 = document.getElementById("wpTextbox1");
  var str = "=Previsualisacion rapida=\n" + wpTextbox1.value;
  var qp = new QuickPreview(str);
  wpQuickPreview.innerHTML = qp.Parse();
}
function QuickPreview(wiki)
{
  this.line = wiki.split(/\n/);
  this.html = new String;
  
  this.list = 0; // current list depth
  this.tab  = 0; // current tabulation depth
  this.pre  = false; /// inside a  tag
  this.para = false; /// inside a paragraph
  this.HandlePre = function(i)
  {
      if(this.line[i][0] == ' ')
      {
        if(this.para)
        {
          this.para = false;
          this.html += "</p>\n";
        }
        if(!this.pre)
        {
          this.pre = true;
          this.html += "<pre>\n";
        }
        this.html += this.line[i] + "\n";
        return true;
      }
      else if(this.pre)
      {
        this.pre = false;
        this.html += "\n";
      }
      return false;
  };
  this.HandleH = function(i)
  {
    if(res = this.line[i].match(/^(={1,6})(.*)\1(.*)$/))
    {
        this.line[i] = "<h" + res[1].length + ">" + res[2] + "</h" + res[1].length + ">" + res[3];
        return true;
    }
    return false;
  };
  
  this.Parse = function()
  {
    this.html = "";
    for(var i = 0; i < this.line.length ; i++)
    {
      var p = true;
    
      if(this.HandlePre(i))
        continue;
      if(this.HandleH(i))
        p = false;
      
      if(p && !this.para)
      {
        this.para = true;
        this.html += "";
      }
      this.html += this.line[i]
      // Sign //
      .replace(/~{5}/g, Date())
      .replace(/~{4}/g, "Signature "+Date())
      .replace(/~{3}/g, "Signature")
      // Style //
      .replace(/(.*?)(.*?)/g, "$1$2")
      .replace(/(.*?)(.*?)/g, "$1$2")
      .replace(/(.*?)(.*?)/g, "$1$2")
      .replace(/(.*?)'/g,       "\'$1")
      .replace(/'(.*?)'/g,        "$1")
      .replace(/'(.*?)/g,         "\'$1")
      .replace(/(.*?)/g,          "$1")
      .replace(/'(.*?)/g,           "\'$1")
      .replace(/(.*?)/g,            "$1")
      // List //
      .replace(/^\*(.*)/g,  "$1")
      .replace(/^#(.*)/g,   "$1")
      .replace(/^:(.*)/g,   "$1")
      // Link //
      .replace(/\{\{([^\|]*).*}}/g, "Modèle : $1")
      .replace(/\[\[[Ii]mage:([^\|]*)[^\[]*\]\]/g, "Image : $1")
      .replace(/\[\[[Cc]atégorie:([^\|]*)[^\[]*\]\]/g, "<a href='/wiki/Categoria:$1' title='$1'>Categoria : $1</a>")
      .replace(/\[\[([^\[.]*)\|([^\[.]*)\]\]/g, "<a href='/wiki/$1' title='$1'>$2</a>")
      .replace(/\[\[([^\[.]*)\]\]/g,      "<a href='/wiki/$1' title='$1'>$1</a>")
/*
      // Special //
      .replace(/\n\n/g,          "\n\n")
      .replace(/(^|\n)-{4}(?!~)/g, "")
      // Table //
      .replace(/(^|\n)\{\|(.*)/g, "$1")
      .replace(/(^|\n)\|}/g, "$1")
      .replace(/(^|\n)(\|.*)\|\|/g, "$1$2</td>")
      .replace(/(^|\n)\|[^-}](.*)/g, "$1$2")
      .replace(/(^|\n)(!.*)!!/g, "$1$2</th>")
      .replace(/(^|\n)![^-](.*)/g, "$1$2")
*/
      ;
      this.html += "\n";
    }
    return this.html;
  };
};
/// Hide
function hideQuickPreview() 
{
  var wpQuickPreview = document.getElementById("wpQuickPreview");
  if(wpQuickPreview) 
  {
    wpQuickPreview.style.display = 'none';
  }
}
addLoadEvent(addQuickPreview);
//============================================================
//
// Barra d'espleches
//
//============================================================
//============================================================
// Generator de tablèus
//============================================================
/**
 *
 * English: Generate an array using Mediawiki syntax
 *
 * @author: fr:user:dake
 * @version: 0.1
 */
 
function generateTableau(nbCol, nbRow, border, styleHeader, styleLine)
{
	var code = "\n";
	if (styleHeader==1) {
		code += '\n';
	} else {
		code += '{| border="' + border + '"\n';
		code += '|+ Títol del tablèu\n';
	}
	
	for (var i=0;i<nbCol;i++) code += '! en-tèsta ' + i + '\n'
	
	for (var j=0;j<nbRow;j++) {
		if ((j+1)%2==0 && styleLine==1) {
			code += '|-{'+'{linha grisa}'+'}\n'
		} else {		
			code += '|-----\n'
		}
		
		for (var i=0;i<nbCol;i++) code += '| element\n';
	}
	
	code += '|}';
	insertTags(,, code); 
}
/**
 *
 * English: Open a popup with parameters to generate an array. 
 * The number of rows/columns can be modified. Some additional
 * parameters are related to templates available on :fr
 *
 * @author: fr:user:dake
 * @version: 0.1
 */
 
function popupTablèu()
{
  var popup = window.open(,'name','height=400,width=500');
  
  javaCode =  '<script type="text\/javascript">function insertCode(){';
  javaCode += 'var row = parseInt(document.paramForm.inputRow.value); '
  javaCode += 'var col = parseInt(document.paramForm.inputCol.value); '
  javaCode += 'var bord = parseInt(document.paramForm.inputBorder.value); '
  javaCode += 'var styleHeader = document.paramForm.inputHeader.checked; '
  javaCode += 'var styleLine = document.paramForm.inputLine.checked; '
  javaCode += 'window.opener.generateTablèu(col,row,bord,styleHeader,styleLine); '
  javaCode += '}<\/script>';
  
  popup.document.write('<html><head><title>Paramètres del tablèu</title>');
  popup.document.write('<script type="text\/javascript" src="\/skins-1.5\/common\/wikibits.js"><\/script>');
  popup.document.write('<style type="text\/css" media="screen,projection">/*<![CDATA[*/ @import "\/skins-1.5\/monobook\/main.css?5"; /*]]>*/<\/style>');
  popup.document.write(javaCode); 
  popup.document.write('</head><body>');
  popup.document.write('Entratz los paramètres del tablèu : ');
  popup.document.write('<form name="paramForm">');
  popup.document.write('Nombre de linhas : <input type="text" name="inputRow" value="3" >');
  popup.document.write('Nombre de colonas : <input type="text" name="inputCol" value="3" >');
  popup.document.write('Largor de la bordadura : <input type="text" name="inputBorder" value="1" >');
  popup.document.write('Entèsta en gris (estil « carta grafica ») : <input type="checkbox" name="inputHeader" checked="1" >');
  popup.document.write('Linhas grisas alternadas (estil « carta grafica ») : <input type="checkbox" name="inputLine" checked="1" >');
  popup.document.write('</form">');
  popup.document.write('<a href="javascript:insertCode()"> Inserir lo còdi dins la fenèstra d\'edicion</a>');
  popup.document.write('<a href="javascript:self.close()"> Tampar</a>');
  popup.document.write('</body></html>');
  popup.document.close();
}
//============================================================
// Inseriment de botons novèls dins la barra d'espleches
//============================================================
/**
 * Ajusta qualques botons sus la barra d'espleches
 * Inspirat de mon còdi precedent e de las icònas sus he:
 * @author: fr:user:dake
 * @version: 0.1
 */
function ImprovedToolbar()
{
 tooly = document.getElementById('toolbar');
 if (tooly == null) return;
 StrikeTextButton = "<a href=\"javascript:insertTags('','',);\"><img src=\"http://upload.wikimedia.org/wikipedia/fr/3/30/Btn_toolbar_rayer.png\" alt=\"Raiar\" title=\"Raiar\"></a>";
 EnumTextButton = "<a href=\"javascript:insertTags('\\n# element 1\\n# element 2\\n# element 3',,);\"><img src=\"http://upload.wikimedia.org/wikipedia/fr/8/88/Btn_toolbar_enum.png\" alt=\"Enumeracion\" title=\"Enumeracion\"></a>";
 ListTextButton = "<a href=\"javascript:insertTags('\\n* element A\\n* element B\\n* element C',,);\"><img src=\"http://upload.wikimedia.org/wikipedia/fr/1/11/Btn_toolbar_liste.png\" alt=\"Lista\" title=\"Lista\"></a>";
 GalleryButton = "<a href=\"javascript:insertTags('\\n\\nImage:Vista-openbsd.png|Légende\\nImage:AMule.png|Légende\\nImage:Cyberduck icon.png|Légende\\n',,);\"><img src=\"http://upload.wikimedia.org/wikipedia/fr/9/9e/Btn_toolbar_gallery.png\" alt=\"Galariá d'imatges\" title=\"Galariá d'imatges\"></a>";
 CommentTextButton = "<a href=\"javascript:insertTags(,);\"><img src=\"http://upload.wikimedia.org/wikipedia/fr/3/37/Btn_toolbar_commentaire.png\" alt=\"Comentari\" title=\"Comentari\"></a>";
 RedirectButton = "<a href=\"javascript:insertTags('#REDIRECT ','','nom de la destinacion');\"><img src=\"http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png\" alt=\"Redirection\" title=\"Redirection\"></a>";
 ArrayButton = "<a href=\"javascript:popupTableau();\"><img src=\"http://upload.wikimedia.org/wikipedia/fr/0/04/Button_array.png\" alt=\"Tableau\" title=\"Tableau\"></a>";
 tooly.innerHTML = tooly.innerHTML + StrikeTextButton + EnumTextButton + 
ListTextButton + CommentTextButton + GalleryButton + RedirectButton + ArrayButton ;
}
addLoadEvent(ImprovedToolbar);
//============================================================
// 
// Divèrs
// 
//============================================================
/**
 * Transformar las paginas de la Tavèrna en pagina de discutida
 */
function DiscutidaTavèrna() 
{
  if(document.title.search("Oiquipedià:La Tavèrna") != -1)
    document.body.className = "ns-1";
}
     
addLoadEvent(DiscutidaTavèrna);
/**
 * Ajust d'un estil particular als ligams interlengas vèrs d'articles de qualitat
 */
function LigamAdQ() 
{
   var lang = document.getElementById("p-lang"); // fin language link list
   if(lang)
   {
      var span = document.getElementsByTagName("span");
      for(i=0; i-elements
      {
         // if found a AdQ span
         if(span[i].className == "AdQ") {
            var li = lang.getElementsByTagName("li");
            for(j=0; j </pre> */
thread_title: ================================================