Usuari:Aleator/novaentrada.js: diferència entre les revisions

De Viccionari
Contingut suprimit Contingut afegit
migrant... en-nom & en-verb
Use of "wgTitle" is deprecated. Use mw.config instead.
Línia 9: Línia 9:
var neccode='ca'
var neccode='ca'
var necpostlangtext=new Array()
var necpostlangtext=new Array()
var wS='\n\'\'\''+wgTitle+'\'\'\'';
var wgTitle2 = mw.config.get('wgTitle');
var wS='\n\'\'\''+wgTitle2+'\'\'\'';
function Deva2AFI(text, wISO) {
function Deva2AFI(text, wISO) {
Línia 78: Línia 79:
{nom:['\n=== Nom ===\n{'+'{ca-nom','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','|f}}'],['Femení i masculí singular','|mf}}'],['Masculí plural','-forma|mp}}'],['Femení plural','-forma|fp}}'],['Femení i masculí plural','-forma|mfp}}']]]],
{nom:['\n=== Nom ===\n{'+'{ca-nom','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','|f}}'],['Femení i masculí singular','|mf}}'],['Masculí plural','-forma|mp}}'],['Femení plural','-forma|fp}}'],['Femení i masculí plural','-forma|mfp}}']]]],
adjectiu:['\n=== Adjectiu ===\n{'+'{ca-adj','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','-forma|f}}'],['Invariable singular','|i}}'],['Masculí plural','-forma|mp}}'],['Femení plural','-forma|fp}}'],['Invariable plural','-forma|ip}}']]]],
adjectiu:['\n=== Adjectiu ===\n{'+'{ca-adj','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','-forma|f}}'],['Invariable singular','|i}}'],['Masculí plural','-forma|mp}}'],['Femení plural','-forma|fp}}'],['Invariable plural','-forma|ip}}']]]],
formaverbal:['=== Verb ===\n{'+'{verb-forma|ca|'+wgTitle+'-??ar}}\n#{'+'{ca-verb forma','|nodot=1}}',['— Persona','',[['Primera','|persona=1'],['Segona','|persona=2'],['Tercera','|persona=3'],['Impersonal','|persona=0']]],['— Nombre','',[['Singular','|nombre=s'],['Plural','|nombre=p']]],['— Temps','',[['Present','|temps=pres'],['Imperfet','|temps=imp'],['Passat','|temps=passat'],['Condicional','|temps=cond']]],['— Mode','',[['Indicatiu','|mode=ind'],['Subjuntiu','|mode=subj'],['Imperatiu','|mode=imp'],['Condicional','|mode=ind'],['Participi','|mode=par'],['Gerundi','|mode=ger']]],['— Gènere','',[['Masculí','|gènere=m'],['Femení','|gènere=f']]],['— Infinitiu','',[['input',' ','|verb=']]]],
formaverbal:['=== Verb ===\n{'+'{verb-forma|ca|'+wgTitle2+'-??ar}}\n#{'+'{ca-verb forma','|nodot=1}}',['— Persona','',[['Primera','|persona=1'],['Segona','|persona=2'],['Tercera','|persona=3'],['Impersonal','|persona=0']]],['— Nombre','',[['Singular','|nombre=s'],['Plural','|nombre=p']]],['— Temps','',[['Present','|temps=pres'],['Imperfet','|temps=imp'],['Passat','|temps=passat'],['Condicional','|temps=cond']]],['— Mode','',[['Indicatiu','|mode=ind'],['Subjuntiu','|mode=subj'],['Imperatiu','|mode=imp'],['Condicional','|mode=ind'],['Participi','|mode=par'],['Gerundi','|mode=ger']]],['— Gènere','',[['Masculí','|gènere=m'],['Femení','|gènere=f']]],['— Infinitiu','',[['input',' ','|verb=']]]],
pronom:['{'+'{-pronom-|ca',' {'+'{4 formes|'+wgTitle+'|'+wgTitle+'s|'+wgTitle+'|'+wgTitle+'s}}',['— Gènere i nombre','',[['Masculí singular','|m}}'+wS+' {'+'{m}} {'+'{pl.|'+wgTitle+'s}}'],['Femení singular','|f}}'+wS+' {'+'{f}} {'+'{pl.|'+wgTitle+'s}}'],['Invariable singular','|i}}'+wS+' {'+'{i}} {'+'{pl.|'+wgTitle+'s}}'],['Masculí plural','|m|plural}}'+wS+' {'+'{m}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle.substr(0,wgTitle.length-1)+']])'],['Femení plural','|f|plural}}'+wS+' {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle.substr(0,wgTitle.length-1)+']])'],['Invariable plural','|i|plural}}'+wS+' {'+'{i}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle.substr(0,wgTitle.length-1)+']])']]]]
pronom:['{'+'{-pronom-|ca',' {'+'{4 formes|'+wgTitle2+'|'+wgTitle2+'s|'+wgTitle2+'|'+wgTitle2+'s}}',['— Gènere i nombre','',[['Masculí singular','|m}}'+wS+' {'+'{m}} {'+'{pl.|'+wgTitle2+'s}}'],['Femení singular','|f}}'+wS+' {'+'{f}} {'+'{pl.|'+wgTitle2+'s}}'],['Invariable singular','|i}}'+wS+' {'+'{i}} {'+'{pl.|'+wgTitle2+'s}}'],['Masculí plural','|m|plural}}'+wS+' {'+'{m}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Femení plural','|f|plural}}'+wS+' {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Invariable plural','|i|plural}}'+wS+' {'+'{i}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])']]]]
},
},
en:
en:
Línia 87: Línia 88:
},
},
fr:
fr:
{nom:['{'+'{-nom-|fr','',['— Gènere i nombre','',[['Masculí singular','|m}}'+wS+' {'+'{m}} {'+'{pl.|'+wgTitle+'s}}'],['Femení singular','|f}}'+wS+' {'+'{f}} {'+'{pl.|'+wgTitle+'s}}'],['Femení i masculí singular','|mf}}'+wS+' {'+'{m}} i {'+'{f}} {'+'{pl.|'+wgTitle+'s}}'],['Masculí plural','|m|plural}}'+wS+' {'+'{m}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle.substr(0,wgTitle.length-1)+']])'],['Femení plural','|f|plural}}'+wS+' {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle.substr(0,wgTitle.length-1)+']])'],['Femení i masculí plural','|mf|plural}}'+wS+' {'+'{m}} i {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle.substr(0,wgTitle.length-1)+']])']]]]
{nom:['{'+'{-nom-|fr','',['— Gènere i nombre','',[['Masculí singular','|m}}'+wS+' {'+'{m}} {'+'{pl.|'+wgTitle2+'s}}'],['Femení singular','|f}}'+wS+' {'+'{f}} {'+'{pl.|'+wgTitle2+'s}}'],['Femení i masculí singular','|mf}}'+wS+' {'+'{m}} i {'+'{f}} {'+'{pl.|'+wgTitle2+'s}}'],['Masculí plural','|m|plural}}'+wS+' {'+'{m}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Femení plural','|f|plural}}'+wS+' {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Femení i masculí plural','|mf|plural}}'+wS+' {'+'{m}} i {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])']]]]
},
},
hi:
hi:
Línia 103: Línia 104:
es:
es:
{nom:['\n=== Nom ===\n{'+'{es-nom','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','|f}}'],['Femení i masculí singular','|mf}}'],['Masculí plural','|mp}}'],['Femení plural','|fp}}'],['Femení i masculí plural','|mfp}}']]]],
{nom:['\n=== Nom ===\n{'+'{es-nom','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','|f}}'],['Femení i masculí singular','|mf}}'],['Masculí plural','|mp}}'],['Femení plural','|fp}}'],['Femení i masculí plural','|mfp}}']]]],
formaverbal:['=== Verb ===\n{'+'{verb-forma|es|'+wgTitle+'-??r}}'+'\n# {{es-verb forma','|nodot=1}}',['— Persona','',[['Primera','|persona=1'],['Segona','|persona=2'],['Tercera','|persona=3'],['Impersonal','|persona=0']]],['— Nombre','',[['Singular','|nombre=s'],['Plural','|nombre=p']]],['— Temps','',[['Present','|temps=pres'],['Imperfet','|temps=imp'],['Passat','|temps=passat'],['Condicional','|temps=cond']]],['— Mode','',[['Indicatiu','|mode=ind'],['Subjuntiu','|mode=subj'],['Imperatiu','|mode=imp'],['Condicional','|mode=ind'],['Participi','|mode=par'],['Gerundi','|mode=ger']]],['— Gènere','',[['Masculí','|gènere=m'],['Femení','|gènere=f']]],['— Infinitiu','',[['input',' ','|verb=']]]],
formaverbal:['=== Verb ===\n{'+'{verb-forma|es|'+wgTitle2+'-??r}}'+'\n# {{es-verb forma','|nodot=1}}',['— Persona','',[['Primera','|persona=1'],['Segona','|persona=2'],['Tercera','|persona=3'],['Impersonal','|persona=0']]],['— Nombre','',[['Singular','|nombre=s'],['Plural','|nombre=p']]],['— Temps','',[['Present','|temps=pres'],['Imperfet','|temps=imp'],['Passat','|temps=passat'],['Condicional','|temps=cond']]],['— Mode','',[['Indicatiu','|mode=ind'],['Subjuntiu','|mode=subj'],['Imperatiu','|mode=imp'],['Condicional','|mode=ind'],['Participi','|mode=par'],['Gerundi','|mode=ger']]],['— Gènere','',[['Masculí','|gènere=m'],['Femení','|gènere=f']]],['— Infinitiu','',[['input',' ','|verb=']]]],
pronom:['{'+'{-pronom-|es',' {'+'{4 formes|'+wgTitle+'|'+wgTitle+'s|'+wgTitle+'|'+wgTitle+'s}}',['— Gènere i nombre','',[['Masculí singular','|m}}'+wS+' {'+'{m}} {'+'{pl.|'+wgTitle+'s}}'],['Femení singular','|f}}'+wS+' {'+'{f}} {'+'{pl.|'+wgTitle+'s}}'],['Invariable singular','|i}}'+wS+' {'+'{i}} {'+'{pl.|'+wgTitle+'s}}'],['Masculí plural','|m|plural}}'+wS+' {'+'{m}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle.substr(0,wgTitle.length-1)+']])'],['Femení plural','|f|plural}}'+wS+' {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle.substr(0,wgTitle.length-1)+']])'],['Invariable plural','|i|plural}}'+wS+' {'+'{i}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle.substr(0,wgTitle.length-1)+']])']]]],
pronom:['{'+'{-pronom-|es',' {'+'{4 formes|'+wgTitle2+'|'+wgTitle2+'s|'+wgTitle2+'|'+wgTitle2+'s}}',['— Gènere i nombre','',[['Masculí singular','|m}}'+wS+' {'+'{m}} {'+'{pl.|'+wgTitle2+'s}}'],['Femení singular','|f}}'+wS+' {'+'{f}} {'+'{pl.|'+wgTitle2+'s}}'],['Invariable singular','|i}}'+wS+' {'+'{i}} {'+'{pl.|'+wgTitle2+'s}}'],['Masculí plural','|m|plural}}'+wS+' {'+'{m}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Femení plural','|f|plural}}'+wS+' {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Invariable plural','|i|plural}}'+wS+' {'+'{i}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])']]]],
adjectiu:['\n=== Adjectiu ===\n{'+'{es-adj','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','-forma|f}}'],['Invariable singular','|i}}'],['Masculí plural','-forma|mp}}'],['Femení plural','-forma|fp}}'],['Invariable plural','-forma|ip}}']]]]
adjectiu:['\n=== Adjectiu ===\n{'+'{es-adj','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','-forma|f}}'],['Invariable singular','|i}}'],['Masculí plural','-forma|mp}}'],['Femení plural','-forma|fp}}'],['Invariable plural','-forma|ip}}']]]]
}
}
Línia 138: Línia 139:
function AFI() {
function AFI() {
var wI=document.getElementById('necinput').value;
var wI=document.getElementById('necinput').value;
var wT = " (" + wgTitle + ")";
var wT = " (" + wgTitle2 + ")";
var wP = wgTitle;
var wP = wgTitle2;
if(wI=="ca" || wI=="es") {
if(wI=="ca" || wI=="es") {
wP=wP.replace('é','e');wP=wP.replace('í','i');wP=wP.replace('ó','o');wP=wP.replace('ú','u');wP=wP.replace('d','ð');wP=wP.replace('ga','ɣa');wP=wP.replace('go','ɣo');wP=wP.replace('gue','ɣe');wP=wP.replace('gui','ɣi');wP=wP.replace('que','ke');wP=wP.replace('qui','ki');wP=wP.replace('gu','ɣu');wP=wP.replace('ll','ʎ');wP=wP.replace('r','ɾ');wP=wP.replace('v','b');wP=wP.replace('nf','ɱf');
wP=wP.replace('é','e');wP=wP.replace('í','i');wP=wP.replace('ó','o');wP=wP.replace('ú','u');wP=wP.replace('d','ð');wP=wP.replace('ga','ɣa');wP=wP.replace('go','ɣo');wP=wP.replace('gue','ɣe');wP=wP.replace('gui','ɣi');wP=wP.replace('que','ke');wP=wP.replace('qui','ki');wP=wP.replace('gu','ɣu');wP=wP.replace('ll','ʎ');wP=wP.replace('r','ɾ');wP=wP.replace('v','b');wP=wP.replace('nf','ɱf');
Línia 222: Línia 223:
else {
else {
if(ISO != "ca") {
if(ISO != "ca") {
k+="\n#''Forma plural de'' {"+"{e|"+wgTitle.substr(0,wgTitle.length-1)+"|"+ISO+"}} ([["+Acc+"]]).";
k+="\n#''Forma plural de'' {"+"{e|"+wgTitle2.substr(0,wgTitle2.length-1)+"|"+ISO+"}} ([["+Acc+"]]).";
} else {k+="\n#''Forma plural de'' ["+"["+Acc+"]].";}
} else {k+="\n#''Forma plural de'' ["+"["+Acc+"]].";}
}
}
Línia 262: Línia 263:
}
}
for(l in necdefs[i][1]) {//Exemple
for(l in necdefs[i][1]) {//Exemple
k+="\n#:\'\'"+necdefs[i][1][l][0].replace(new RegExp("("+wgTitle+")","ig"),"'''$1'''")+"''";
k+="\n#:\'\'"+necdefs[i][1][l][0].replace(new RegExp("("+wgTitle2+")","ig"),"'''$1'''")+"''";
if(neccode!="ca" && necdefs[i][1][l][2]){k+=" (''"+necdefs[i][1][l][2]+"'')";} //Traducció
if(neccode!="ca" && necdefs[i][1][l][2]){k+=" (''"+necdefs[i][1][l][2]+"'')";} //Traducció
}
}
for(l in necdefs[i][2]) {//Citació bibliogràfica
for(l in necdefs[i][2]) {//Citació bibliogràfica
k+="\n#:''";
k+="\n#:''";
k+=necdefs[i][2][l][5].replace(new RegExp("("+wgTitle+")","ig"),"'''$1'''");
k+=necdefs[i][2][l][5].replace(new RegExp("("+wgTitle2+")","ig"),"'''$1'''");
if(neccode!="ca"){k+=" (''"+necdefs[i][2][l][6]+"'')";}
if(neccode!="ca"){k+=" (''"+necdefs[i][2][l][6]+"'')";}
if(necdefs[i][2][l][1]) {k+="'' ({"+"{Versaleta|"+necdefs[i][2][l][1]+"}}";}//autor
if(necdefs[i][2][l][1]) {k+="'' ({"+"{Versaleta|"+necdefs[i][2][l][1]+"}}";}//autor
Línia 312: Línia 313:
}
}
if(k.indexOf('<ref')!=-1) {k+="==Referències==\n<references />\n";}
if(k.indexOf('<ref')!=-1) {k+="==Referències==\n<references />\n";}
var wM=wgTitle;HH=0;//{{ordre}}
var wM=wgTitle2;HH=0;//{{ordre}}
for(i=0;i<wM.length;i++) {
for(i=0;i<wM.length;i++) {
var wL = wM.substr(i,1);
var wL = wM.substr(i,1);
Línia 333: Línia 334:
}
}
for(i in necpost[2]) {k+="\n["+"[Categoria:"+necpost[2][i]+"]]";}
for(i in necpost[2]) {k+="\n["+"[Categoria:"+necpost[2][i]+"]]";}
if(ISO=="en") {k += "\n[[en:"+wgTitle+"]]\n";}
if(ISO=="en") {k += "\n[[en:"+wgTitle2+"]]\n";}
document.editform.wpTextbox1.value=k;
document.editform.wpTextbox1.value=k;
}
}

Revisió del 20:39, 29 ago 2015

/*Adaptat de en.wiktionary.org/wiki/User:Yair_rand/newentrywiz.js */
var necdata=new Array()
necdata['pos']="nom"
necdata['pos2']="Nom"
var necdefs=new Array()
necdefs[0]=['',[],[],[]] //accep,ex.,cit.,refs.
var necpost=new Array();//Categ. gram.
for(i=0;i<=3;i++) {necpost[i]=new Array()}//categ.,declin.
var neccode='ca'
var necpostlangtext=new Array()
var wgTitle2 = mw.config.get('wgTitle');
var wS='\n\'\'\''+wgTitle2+'\'\'\'';
 
function Deva2AFI(text, wISO) {
 var typo_def = new Array (
  "(क)", "kə", "(ख)", "kʰə", "(ग)", "gə", "(घ)", "gʱə",
  "(ङ)", "ŋə", "(ह)", "hə", "(च)", "tʃə", "(छ)", "tʃʰə",
  "(ज)", "dʒə", "(झ)", "dʒʱə", "(ञ)", "ɲə", "(य)", "jə",
  "(श)", "ʃə", "(ट)", "ʈə", "(ठ)", "ʈʰə", "(ड)", "ɖə",
  "(ढ)", "ɖʱə", "(ण)", "ɳə", "(र)", "rə", "(ष)", "ʂə", "(ऱ)", "ɽə",
  "(त)", "t̪ə", "(थ)", "t̪ʰə", "(द)", "d̪ə",
  "(ध)", "d̪ʱə", "(न)", "nə", "(ल)", "lə", "(स)", "sə", "(ळ)", "ɭə", 
  "(प)", "pə", "(फ)", "pʰə", "(ब)", "bə", "(भ)", "bʱə",
  "(म)", "mə", "(व)", "ʋə",
  "(्)", "[<-elidir]", "(ँ)", "ṃ", "(ं)", "ṃ", "(ः)", "h",
  "(अ)", "ə", "(आ)", "aː", "(ा)", "aː",
  "(इ)", "ɪ", "(ि)", "ɪ", "(ई)", "i", "(ी)", "i",
  "(उ)", "ʊ", "(ु)", "ʊ", "(ऊ)", "u", "(ू)", "u",
  "(ऋ)", "r", "(ृ)", "r", "(ए)", "e", "(े)", "e", "(ऐ)", "ɛ", "(ै)", "ɛ",
  "(ओ)", "o", "(ो)", "o", "(औ)", "au", "(ौ)", "au",
  "(əə)", "ə", "(əa)", "a", "(əɪ)", "ɪ", "(əi)", "i", "(əʊ)", "ʊ", "(əu)", "u",
  "(əe)", "e", "(əɛ)", "ɛ", "(ड़)", "ɽ", "(ढ़)", "ɽʱ"
 );
 var lng = typo_def.length;
 if (lng % 2 != 0) return text;
 for (var i = 0; i < lng; i += 2) {
  search = new RegExp(typo_def[i + 0], "g");
  text = text.replace(search, typo_def[i + 1]);
 }
 if(wISO=="mr") {
  text = text.replace('dʒ','ɟʝ'); text = text.replace('n','n̪');
  text = text.replace('ʋ','v'); text = text.replace('ɪ','i');
  text = text.replace('ʊ','u'); text = text.replace('ɛ','əi');
  text = text.replace('ऑ','ɔ'); text = text.replace('अ‍ॅ','æ');
 }
 return text;
}
function Deva2IAST(text) {
 var typo_def = new Array (
  "(क)", "ka", "(ख)", "kha", "(ग)", "ga", "(घ)", "gha",
  "(ङ)", "ṅa", "(ह)", "ha", "(च)", "ca", "(छ)", "cha",
  "(ज)", "ja", "(झ)", "jha", "(ञ)", "ña", "(य)", "ya",
  "(श)", "śa", "(ट)", "ṭa", "(ठ)", "ṭha", "(ड)", "ḍa",
  "(ढ)", "ḍha", "(ण)", "ṇa", "(र)", "ra", "(ष)", "ṣa", "(ऱ)", "ṟa",
  "(त)", "ta", "(थ)", "tha", "(द)", "da",
  "(ध)", "dha", "(न)", "na", "(ल)", "la", "(स)", "sa", "(ळ)", "ḷa",
  "(प)", "pa", "(फ)", "pha", "(ब)", "ba", "(भ)", "bha",
  "(म)", "ma", "(व)", "va",
  "(्)", "[<-elidir]", "(ँ)", "ṃ", "(ं)", "ṃ", "(ः)", "ḥ",
  "(अ)", "a", "(आ)", "ā", "(ा)", "ā",
  "(इ)", "i", "(ि)", "i", "(ई)", "ī", "(ी)", "ī",
  "(उ)", "u", "(ु)", "u", "(ऊ)", "ū", "(ू)", "ū",
  "(ai)", "i", "(au)", "u",
  "(ऋ)", "ŕ", "(ृ)", "ŕ", "(ए)", "e", "(े)", "e", "(ऐ)", "ai", "(ै)", "ai",
  "(ओ)", "o", "(ो)", "o", "(औ)", "au", "(ौ)", "au",
  "(aa)", "a", "(aā)", "ā", "(aī)", "ī", "(aū)", "ū",
  "(ae)", "e", "(ड़)", "ṛ", "(ढ़)", "ṛh"
 );
 var lng = typo_def.length;
 if (lng % 2 != 0) return text;
 for (var i = 0; i < lng; i += 2) {
  search = new RegExp(typo_def[i + 0], "g");
  text = text.replace(search, typo_def[i + 1]);
 }
 return text;
}
var necinfls={
ca:
{nom:['\n=== Nom ===\n{'+'{ca-nom','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','|f}}'],['Femení i masculí singular','|mf}}'],['Masculí plural','-forma|mp}}'],['Femení plural','-forma|fp}}'],['Femení i masculí plural','-forma|mfp}}']]]],
adjectiu:['\n=== Adjectiu ===\n{'+'{ca-adj','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','-forma|f}}'],['Invariable singular','|i}}'],['Masculí plural','-forma|mp}}'],['Femení plural','-forma|fp}}'],['Invariable plural','-forma|ip}}']]]],
formaverbal:['=== Verb ===\n{'+'{verb-forma|ca|'+wgTitle2+'-??ar}}\n#{'+'{ca-verb forma','|nodot=1}}',['— Persona','',[['Primera','|persona=1'],['Segona','|persona=2'],['Tercera','|persona=3'],['Impersonal','|persona=0']]],['— Nombre','',[['Singular','|nombre=s'],['Plural','|nombre=p']]],['— Temps','',[['Present','|temps=pres'],['Imperfet','|temps=imp'],['Passat','|temps=passat'],['Condicional','|temps=cond']]],['— Mode','',[['Indicatiu','|mode=ind'],['Subjuntiu','|mode=subj'],['Imperatiu','|mode=imp'],['Condicional','|mode=ind'],['Participi','|mode=par'],['Gerundi','|mode=ger']]],['— Gènere','',[['Masculí','|gènere=m'],['Femení','|gènere=f']]],['— Infinitiu','',[['input',' ','|verb=']]]],
pronom:['{'+'{-pronom-|ca',' {'+'{4 formes|'+wgTitle2+'|'+wgTitle2+'s|'+wgTitle2+'|'+wgTitle2+'s}}',['— Gènere i nombre','',[['Masculí singular','|m}}'+wS+' {'+'{m}} {'+'{pl.|'+wgTitle2+'s}}'],['Femení singular','|f}}'+wS+' {'+'{f}} {'+'{pl.|'+wgTitle2+'s}}'],['Invariable singular','|i}}'+wS+' {'+'{i}} {'+'{pl.|'+wgTitle2+'s}}'],['Masculí plural','|m|plural}}'+wS+' {'+'{m}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Femení plural','|f|plural}}'+wS+' {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Invariable plural','|i|plural}}'+wS+' {'+'{i}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])']]]]
},
en:
{nom:['\n=== Nom ===\n{'+'{en-nom}}'],
verb:['\n=== Verb ===\n{'+'{en-verb}}'],
adjectiu:['\n=== Adjectiu ===\n{'+'{','',['— Forma','',[['Demostratiu','en-adj|?}}'],['Comparatiu','adj-forma|en}}']]]]
},
fr:
{nom:['{'+'{-nom-|fr','',['— Gènere i nombre','',[['Masculí singular','|m}}'+wS+' {'+'{m}} {'+'{pl.|'+wgTitle2+'s}}'],['Femení singular','|f}}'+wS+' {'+'{f}} {'+'{pl.|'+wgTitle2+'s}}'],['Femení i masculí singular','|mf}}'+wS+' {'+'{m}} i {'+'{f}} {'+'{pl.|'+wgTitle2+'s}}'],['Masculí plural','|m|plural}}'+wS+' {'+'{m}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Femení plural','|f|plural}}'+wS+' {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Femení i masculí plural','|mf|plural}}'+wS+' {'+'{m}} i {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])']]]]
},
hi:
{nom:['{'+'{-nom-|hi','',['— Gènere','',[['Masculí','|m}}\n#'+'{'+'{m}} '],['Femení','|f}}\n#'+'{'+'{f}} ']]]]
},
mr:
{nom:['{'+'{-nom-|mr','',['— Gènere','',[['Masculí','|m}}\n#'+'{'+'{m}} '],['Femení','|f}}\n#'+'{'+'{f}} '],['Neutre','|n}}\n#'+'{'+'{n}} ']]]]
},
sa:
{nom:['{'+'{-nom-|sa','',['— Gènere','',[['Masculí','|m}}\n#'+'{'+'{m}} '],['Femení','|f}}\n#'+'{'+'{f}} ']]]]
},
la:
{nom:['{'+'{-nom-|la','',['— Gènere','',[['Masculí','|m}}'+wS+' {'+'{m}}'],['Femení','|f}}'+wS+' {'+'{f}}'],['Neutre','|n}}'+wS+' {'+'{n}}']]]]
},
es:
{nom:['\n=== Nom ===\n{'+'{es-nom','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','|f}}'],['Femení i masculí singular','|mf}}'],['Masculí plural','|mp}}'],['Femení plural','|fp}}'],['Femení i masculí plural','|mfp}}']]]],
formaverbal:['=== Verb ===\n{'+'{verb-forma|es|'+wgTitle2+'-??r}}'+'\n# {{es-verb forma','|nodot=1}}',['— Persona','',[['Primera','|persona=1'],['Segona','|persona=2'],['Tercera','|persona=3'],['Impersonal','|persona=0']]],['— Nombre','',[['Singular','|nombre=s'],['Plural','|nombre=p']]],['— Temps','',[['Present','|temps=pres'],['Imperfet','|temps=imp'],['Passat','|temps=passat'],['Condicional','|temps=cond']]],['— Mode','',[['Indicatiu','|mode=ind'],['Subjuntiu','|mode=subj'],['Imperatiu','|mode=imp'],['Condicional','|mode=ind'],['Participi','|mode=par'],['Gerundi','|mode=ger']]],['— Gènere','',[['Masculí','|gènere=m'],['Femení','|gènere=f']]],['— Infinitiu','',[['input',' ','|verb=']]]],
pronom:['{'+'{-pronom-|es',' {'+'{4 formes|'+wgTitle2+'|'+wgTitle2+'s|'+wgTitle2+'|'+wgTitle2+'s}}',['— Gènere i nombre','',[['Masculí singular','|m}}'+wS+' {'+'{m}} {'+'{pl.|'+wgTitle2+'s}}'],['Femení singular','|f}}'+wS+' {'+'{f}} {'+'{pl.|'+wgTitle2+'s}}'],['Invariable singular','|i}}'+wS+' {'+'{i}} {'+'{pl.|'+wgTitle2+'s}}'],['Masculí plural','|m|plural}}'+wS+' {'+'{m}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Femení plural','|f|plural}}'+wS+' {'+'{f}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])'],['Invariable plural','|i|plural}}'+wS+' {'+'{i}} {'+'{p}} (\'\'sing.\'\' [['+wgTitle2.substr(0,wgTitle2.length-1)+']])']]]],
adjectiu:['\n=== Adjectiu ===\n{'+'{es-adj','',['— Gènere i nombre','',[['Masculí singular','|m}}'],['Femení singular','-forma|f}}'],['Invariable singular','|i}}'],['Masculí plural','-forma|mp}}'],['Femení plural','-forma|fp}}'],['Invariable plural','-forma|ip}}']]]]
}
}
 
var necetym;var necpron;var nechomof;var necparon;var necanag;
var necheadingorder=new Array('Sinònims','Traduccions','Categoria','Declinació');
var necinputadvanced="";
var necposlist=new Array('Nom','Verb','Adjectiu','Adverbi','Forma verbal','Pronom','Conjunció','Interjecció','Preposició','Nom propi','Prenom','Article','Prefix','Infix','Sufix','Numerals','Acrònim','Sigles','Símbol','Locucions','Forma adjectival');
 
function necfunction2() { //OPCIONS DE CREACIÓ
  var x="Codi de llengua: <input type=text value='ca' id='necinput' onKeyUp='neccode=this.value;necfunction();AFI();necfunction4();necfunction()' onblur=if(necCleanLangCode(this.value)){this.value=necCleanLangCode(this.value)};neccode=this.value;document.getElementById('nectransspan').style.display=((this.value=='ca')?'':'none');if(/^[a-z]{2,3}(-[a-z\-]{1,7})?$/.test(this.value)){document.getElementById('neclangerror').style.display='none'}else{document.getElementById('neclangerror').style.display=''};necfunction();necfunction4();necfunction();necdefupdate() title='Les 2 o 3 lletres del codi ISO-639'></input><span id=neclangerror style=display:none;color:red> ERROR: CODI DE LLENGUA INVÀLID</span><br>Categoria gramatical: ";
  for(i=0;i<4;i++) { //omple Nom,Verb,Adjectiu,Adverbi
    x+="<a id='necinputpos"+necposlist[i]+"' href=javascript: onclick=document.getElementById('necinputpos'+necdata['pos2']).style.fontWeight='';necdata['pos2']='"+necposlist[i]+"';necdata['pos']='"+necposlist[i].toLowerCase()+"';this.style.fontWeight='bold';necfunction4();necfunction()";if(!i){x+=" style='font-weight:bold'"};x+=">"+necposlist[i]+"</a>, ";
  }
  //mostra la llista de categs. gram (a partir del 4è)
  x+="<span id='necinputpos'>Altre: <input type=text onKeyUp=\"document.getElementById('necinputpos'+necdata['pos2']).style.fontWeight='';necdata['pos2']=this.value;necdata['pos']=this.value.toLowerCase().replace(/ /g,'');this.parentNode.setAttribute('ID','necinputpos'+this.value);document.getElementById('necinputpos'+necdata['pos2']).style.fontWeight='bold';necfunction();necfunction4()\" /><select onchange=\"document.getElementById('necinputpos'+necdata['pos2']).style.fontWeight='';necdata['pos2']=this.value;necdata['pos']=this.value.toLowerCase().replace(/ /g,'');this.parentNode.setAttribute('ID','necinputpos'+this.value);document.getElementById('necinputpos'+necdata['pos2']).style.fontWeight='bold';necfunction();necfunction4()\"><option value=''>Seleccioneu</option>";
  for(i in necposlist) {
    if(i>3){x+="<option>"+necposlist[i]+"</option>";}
  }
  x+="</select></span><span id=necinfls></span><br>Altres dades: <a href=javascript: id=necSynonymsbutton onclick=necpost[0][necpost[0].length]=['',''];necpostbox();necfunction();this.style.fontWeight='bold' title='Afegiu secció de sinònims'>Sinònims</a>, <span id=nectransspan><a href=javascript: id=nectransbutton onclick=necpost[1][necpost[1].length]=['',''];necpostbox();necfunction();this.style.fontWeight='bold' title='Afegiu secció de traduccions'>Traduccions</a>, </span>Més: <select onchange=necpostbox(this.value);this.selectedIndex=0;necfunction()><option select='selected'>Seleccioneu</option>";
 
for(i in necheadingorder) {//excepte sense ús, sinònims i traduccions
 if(i!=0&&i!=1){x+="<option value="+i+">"+necheadingorder[i]+"</option>"}
}
 
x+="</select><br><span id=necpostbox></span><span id='necdefs'>Accepció: <input type=text id='necinput3' onKeyUp=necdefs[0][0]=this.value;necfunction() /><br></span>Informació inicial: <a href=javascript:necdefs.push(['',[],[],[]]);uNec() title='Afegiu nova accepció'>Nova accepció</a>, <a href=javascript: id=necpronbutton onclick=document.getElementById('necpronspan').style.display='';necpron=document.getElementById('necproninput').value;necfunction();this.style.fontWeight='bold' title='Afegiu secció de Pronúcia'>Pronúncia</a>, <a href=javascript: id=nechomofbutton onclick=document.getElementById('nechomofspan').style.display='';nechomof=document.getElementById('nechomofinput').value;necfunction();this.style.fontWeight='bold' title='Afegiu secció Homòfons'>Homòfons</a>, <a href=javascript: id=necparonbutton onclick=document.getElementById('necparonspan').style.display='';necparon=document.getElementById('necparoninput').value;necfunction();this.style.fontWeight='bold' title='Afegiu secció Parònims'>Parònims</a>, <a href=javascript: id=necetymbutton onclick=document.getElementById('necetymspan').style.display='';necetym=document.getElementById('necetyminput').value;necfunction();this.style.fontWeight='bold' title='Afegiu secció Etimologia'>Etimologia</a>, <a href=javascript: id=necanagbutton onclick=document.getElementById('necanagspan').style.display='';necanag=document.getElementById('necanaginput').value;necfunction();this.style.fontWeight='bold' title='Afegiu secció Anagrames'>Anagrames</a>. <span id='necetymspan' style='display:none'><br>Etimologia: <a href=javascript: onclick=necetym=undefined;document.getElementById('necetymspan').style.display='none';necfunction();document.getElementById('necetymbutton').style.fontWeight='' title='Esborra secció Etimologia'>(esborra)</a><br><textarea id=necetyminput onKeyUp=necetym=this.value;necfunction()></textarea></span><span id='nechomofspan' style='display:none'><br>Homòfons: <a href=javascript: onclick=nechomof=undefined;document.getElementById('nechomofspan').style.display='none';necfunction();document.getElementById('nechomofbutton').style.fontWeight='' title='Esborra secció Homòfons'>(esborra)</a><br><textarea id=nechomofinput onKeyUp=nechomof=this.value;necfunction()></textarea></span><span id='necparonspan' style='display:none'><br>Parònims: <a href=javascript: onclick=necparon=undefined;document.getElementById('necparonspan').style.display='none';necfunction();document.getElementById('necparonbutton').style.fontWeight='' title='Esborra secció Parònims'>(esborra)</a><br><textarea id=necparoninput onKeyUp=necparon=this.value;necfunction()></textarea></span><span id=necpronspan style='display:none'><br>Pronúncia: <a href=javascript: onclick=necpron=undefined;document.getElementById('necpronspan').style.display='none';necfunction();document.getElementById('necpronbutton').style.fontWeight='' title='Esborra secció Pronúncia'>(esborra)</a><br><textarea id=necproninput onKeyUp=necpron=this.value;necfunction()></textarea></span><span id=necanagspan style='display:none'><br>Anagrames: <a href=javascript: onclick=necanag=undefined;document.getElementById('necanagspan').style.display='none';necfunction();document.getElementById('necanagbutton').style.fontWeight='' title='Esborra secció Anagrama'>(esborra)</a><br><textarea id=necanaginput onKeyUp=necanag=this.value;necfunction()></textarea></span><div style='float:right;'><a href=/wiki/User_talk:Aleator/novaentrada.js>Suggeriments i errors</a> — <a href=/wiki/Viccionari:Llibre_d'estil>Llibre d'estil</a></div>"
 
document.getElementById("editform").insertBefore(document.getElementById("necblah"),document.getElementById("editform").firstChild)
document.getElementById("necblah").innerHTML=x
}
 
function AFI() {
 var wI=document.getElementById('necinput').value;
 var wT = " (" + wgTitle2 + ")";
 var wP = wgTitle2;
 if(wI=="ca" || wI=="es") {
wP=wP.replace('é','e');wP=wP.replace('í','i');wP=wP.replace('ó','o');wP=wP.replace('ú','u');wP=wP.replace('d','ð');wP=wP.replace('ga','ɣa');wP=wP.replace('go','ɣo');wP=wP.replace('gue','ɣe');wP=wP.replace('gui','ɣi');wP=wP.replace('que','ke');wP=wP.replace('qui','ki');wP=wP.replace('gu','ɣu');wP=wP.replace('ll','ʎ');wP=wP.replace('r','ɾ');wP=wP.replace('v','b');wP=wP.replace('nf','ɱf');
 } 
 switch(wI) {
  case "ca":
wP=wP.replace('à','a');wP=wP.replace('a','ə');wP=wP.replace('ò','ɔ');wP=wP.replace('e','ə');wP=wP.replace('è','ɛ');wP=wP.replace('ç','s');wP=wP.replace('ce','se');wP=wP.replace('ci','si');wP=wP.replace('ge','ʒe');wP=wP.replace('gi','ʒi');wP=wP.replace('ny','ɲ');wP=wP.replace('tj','dʒ͡');wP=wP.replace('tg','dʒ͡');wP=wP.replace('tx','tʃ͡');wP=wP.replace('j','ʒ');wP=wP.replace('tz','dz͡');wP=wP.replace('x','ʃ');wP=wP.replace('bl','bbl');wP=wP.replace('l·l','ɫɫ');break;
  case "es":
wP=wP.replace('á','a');wP=wP.replace('ch','tʃ͡');wP=wP.replace('ce','θe');wP=wP.replace('ci','θi');wP=wP.replace('x','ks');wP=wP.replace('ge','xe');wP=wP.replace('gi','xi');wP=wP.replace('j','x');wP=wP.replace('ion','jon');wP=wP.replace('ñ','ɲ');wP=wP.replace('y','ʝ');wP=wP.replace('z','θ');break;
  case "hi":
  case "mr":
  case "sa":
   wP=Deva2AFI(wP,wI); wT=Deva2IAST(wT); break;
  default: break;
 }  
 if(wI=="ca" || wI=="es") {wP=wP.replace('c','k');}
 wP="/"+wP+"/";
 if(wI=="hi" || wI=="mr" || wI=="sa") {wP=wP+wT;}
 document.getElementById('necproninput').value = wP;
}
 
function necfunction() {
  var k="";
  document.getElementById("wpSummary").value="nou";
  var ISO=document.getElementById('necinput').value;
  if(necdata['pos2']!="Símbol") {
   k+="== {"+"{-"+ISO+"-}} ==\n"; //== {{-ca-}} ==
  }
  if(necpron!=undefined) {
   if(necpron.length>0) {k+="{"+"{-pronafi-}} {"+"{pron|"+ISO+"|"+necpron+"}}\n";}
  }
  if(nechomof!=undefined) {
   if(nechomof.length>0) {k+="{"+"{homòfons}} "+nechomof+"\n";}
  }
  if(necparon!=undefined) {
   if(necparon.length>0) {k+="{"+"{parònims}} "+necparon+"\n";}
  }
  if(necetym!=undefined) {
   if(necetym.length>0) {k+="{"+"{-etimologia-}} "+necetym+"\n";}
  }
  if(necanag!=undefined) {
   if(necanag.length>0) {k+="{"+"{anagrama}} "+necanag+"\n";}
  }
  if(!neccode){neccode='';}
 
  if(neccode!='' && necinfls[neccode] && necinfls[neccode][necdata['pos']] && necinfls[neccode][necdata['pos']][2]) {
    if(necinfls[neccode][necdata['pos']][0]!=undefined) {k+=necinfls[neccode][necdata['pos']][0];}
    var x=necinfls[neccode][necdata['pos']];
    for (z in x) {
      if(z<=1) {continue;}
      var zz=neccode+"-"+necdata['pos']+z;
      for (y in x[z][2]) { //cerca inflexions
        if(necdata[zz]==x[z][2][y][0]) {k+=x[z][2][y][1];break;}//clicat
        if(x[z][2][y][0]=="input" && necfunction7(x[z][2],necdata[zz])==false) {k+=x[z][2][y][2]+necdata[zz];}//inputbox
      }
    }
    if(necinfls[neccode][necdata['pos']][1]!=undefined) {
     k+=necinfls[neccode][necdata['pos']][1];
    }
  }
  else { //no hi ha idioma-categoria específic
   var wC="?";
   switch(necdata['pos2']) {
    case "Adjectiu": wC="adj";break;
    case "Adverbi": wC="adv";break;
    case "Article": wC="art";break;
    case "Conjunció": wC="conj";break;
    case "Interjecció": wC="interj";break;
    case "Locucions": wC="loc";break;
    case "Forma verbal": wC="formaverbal";break;
    default: wC=necdata['pos2'].toLowerCase(); break;
   }
   if(wC!="símbol") {k+="{"+"{-"+wC+"-|"+ISO+"}}";}
   else {k+="== {"+"{-"+wC+"-}} ==";}
   if(ISO != "hi" && ISO != "mr" && ISO != "sa") {k+=wS;}
  }
 
  for (i in necdefs) {//Accepcions
    var Acc=necdefs[i][0];
    if( (k.indexOf('|plural}}') != -1) || (k.indexOf('p}}') != -1)) {
      if(Acc.indexOf(' ') != -1) {k+="\n#"+Acc+".";}
      else {
        if(ISO != "ca") {
          k+="\n#''Forma plural de'' {"+"{e|"+wgTitle2.substr(0,wgTitle2.length-1)+"|"+ISO+"}} ([["+Acc+"]]).";
        } else {k+="\n#''Forma plural de'' ["+"["+Acc+"]].";}
      }
    } else {
      if(necdata['pos2']=="Adjectiu" && (k.indexOf('|f|') != -1 || k.indexOf('|f}') != -1)) {k+="\n#''Forma femenina de'' {"+"{e|"+Acc+"|"+ISO+"}}.";}
      else {
       if(ISO != "ca") {
         if(Acc.indexOf(' ') != -1) {k+="\n#"+Acc+".";}
         else {
           if(k.indexOf('nodot=1') != -1) {//formaverbal
             k+=" ({"+"{e|"+Acc+"}}).";
           } else {k+="\n#[["+Acc+"#ca|"+Acc+"]].";}
         }
       } else {k+="\n#"+Acc;}
      }
    }
    var wR="";
    for(l in necdefs[i][3]) {//Refs.
     if(necdefs[i][3][l][0].length>6) {
      wR=necdefs[i][3][l][0];
      wR=wR.replace('{'+'{diec}}','<ref name="diec">{'+'{diec}}</ref>');
      wR=wR.replace('{'+'{gdlc}}','<ref name="gdlc">{'+'{gdlc}}</ref>');
      wR=wR.replace('{'+'{dcvb}}','<ref name="dcvb">{'+'{dcvb}}</ref>');
      wR=wR.replace('{'+'{CCLFI}}','<ref name="CCLFI">{'+'{R:CCLFI 1839}}</ref>');
      wR=wR.replace('{'+'{DCM}}','<ref name="DCM">{'+'{R:DMC 1840}}</ref>');
      wR=wR.replace('{'+'{DLCCCL1}}','<ref name="DLCCCL1">{'+'{R:DLCCCL-1}}</ref>');
      wR=wR.replace('{'+'{DLCCCL2}}','<ref name="DLCCCL2">{'+'{R:DLCCCL 1840}}</ref>');
      wR=wR.replace('{'+'{Platts}}','<ref name="Platts">{'+'{R:Platts 1884}}</ref>');
      wR=wR.replace('{'+'{Vaze}}','<ref>{'+'{R:Vaze 1911}}</ref>');
      if(k.indexOf('"diec">') != -1) wR=wR.replace('<ref name="diec">{'+'{diec}}</ref>','<ref name="diec"/>');
      if(k.indexOf('"gdlc">') != -1) wR=wR.replace('<ref name="gdlc">{'+'{gdlc}}</ref>','<ref name="gdlc"/>');
      if(k.indexOf('"dcvb">') != -1) wR=wR.replace('<ref name="dcvb">{'+'{dcvb}}</ref>','<ref name="dcvb"/>');
      if(k.indexOf('"CCLFI">') != -1) wR=wR.replace('<ref name="CCLFI">{'+'{R:CCLFI 1839}}</ref>','<ref name="CCLFI"/>');
      if(k.indexOf('"DCM">') != -1) wR=wR.replace('<ref name="DCM">{'+'{R:DMC 1840}}</ref>','<ref name="DCM"/>');
      if(k.indexOf('"DLCCCL1">') != -1) wR=wR.replace('<ref name="DLCCCL1">{'+'{R:DLCCCL-1}}</ref>','<ref name="DLCCCL1"/>');
      if(k.indexOf('"DLCCCL2">') != -1) wR=wR.replace('<ref name="DLCCCL2">{'+'{R:DLCCCL 1840}}</ref>','<ref name="DLCCCL2"/>');
      k+=wR;
     }
    }
    for(l in necdefs[i][1]) {//Exemple
     k+="\n#:\'\'"+necdefs[i][1][l][0].replace(new RegExp("("+wgTitle2+")","ig"),"'''$1'''")+"''";
     if(neccode!="ca" && necdefs[i][1][l][2]){k+=" (''"+necdefs[i][1][l][2]+"'')";} //Traducció
    }
    for(l in necdefs[i][2]) {//Citació bibliogràfica
     k+="\n#:''";
     k+=necdefs[i][2][l][5].replace(new RegExp("("+wgTitle2+")","ig"),"'''$1'''");
     if(neccode!="ca"){k+=" (''"+necdefs[i][2][l][6]+"'')";}
     if(necdefs[i][2][l][1]) {k+="'' ({"+"{Versaleta|"+necdefs[i][2][l][1]+"}}";}//autor
     if(necdefs[i][2][l][2]) {k+=": ''"+necdefs[i][2][l][2]+"''";}//obra
     if(necdefs[i][2][l][3]) {k+=", "+necdefs[i][2][l][3];}//edit.
     if(necdefs[i][2][l][0]) {k+=", "+necdefs[i][2][l][0];}//any
     if(necdefs[i][2][l][4]) {k+=", p."+necdefs[i][2][l][4];}//pàgs.
     k+=").";
    }
  }
  k+="\n";
  for(i in necpost[3]) {k+="\n====Declinació====\n"+necpost[3][i]+"\n";}
  var HH=0;//hi ha?
  for(i in necpost[0]) { //Sinònims
    if(HH==0) {k+="\n{"+"{-sin-}}";HH=1;}
    if(necpost[0][i][0]) {k+="\n*" + necpost[0][i][0] + ": ";}
    else {k+="\n";}
    for(u in necpost[0][i]) {
      if(u!=0){ //concatenar sinònims
        if(u!=1){k+=", ";}
        if(ISO=="ca") {k+= "{" + "{e|" +necpost[0][i][u] + "|" + ISO + "}}";}
        else {k+= "{" + "{e|" +necpost[0][i][u] + "}}";}
      }
    }
    k+="\n";
  }
 
  if(ISO=="ca") { //traduccions
   if(necpost[1]) {
    HH=0;
    for(i in necpost[1]) {
     if(HH==0) {k+="\n{"+"{-trad-}}\n";k+="{"+"{inici}}";}
     k+="\n*{"+"{"+necpost[1][i][0]+"}}: ";
     for(u in necpost[1][i]) {
      if(u!=0){ //concatenar trads
       if(u!=1){k+=", ";}
       k+="{"+"{trad|"+necpost[1][i][0]+"|"+necpost[1][i][u]+"}}";
      }
     }
     if(HH==0) {k+="\n{"+"{mig}}";HH=1;}
    }
    if(HH==1) {k+="\n{"+"{final}}\n";}
   }
  }
  if(k.indexOf('<ref')!=-1) {k+="==Referències==\n<references />\n";}
  var wM=wgTitle2;HH=0;//{{ordre}}
  for(i=0;i<wM.length;i++) {
   var wL = wM.substr(i,1);
   switch(wL) {
    case "à":
    case "á":
    case "è":
    case "é":
    case "í":
    case "ó":
    case "ò":
    case "ú":
    case "ç": HH=1; break;
    default:break;
   }
  }
  if(HH>0) {
wM=wM.replace('á','a');wM=wM.replace('à','a');wM=wM.replace('é','e');wM=wM.replace('è','e');wM=wM.replace('í','i');wM=wM.replace('ó','o');wM=wM.replace('ò','o');wM=wM.replace('ú','u');wM=wM.replace('ç','c');wM=wM.replace('l·l','ll');
   k+="\n{{ordre|"+wM+"}}\n";
  }
  for(i in necpost[2]) {k+="\n["+"[Categoria:"+necpost[2][i]+"]]";}
  if(ISO=="en") {k += "\n[[en:"+wgTitle2+"]]\n";}
  document.editform.wpTextbox1.value=k;
}
 
function necCleanLangCode(lang) {//converteix a codi ISO
var key = lang.toLowerCase().replace(' ','');
var dict = {aar:"aa",afar:"aa",abk:"ab",afr:"af",afrikaans:"af",aka:"ak",akan:"ak",amh:"am",amharic:"am",ara:"ar",àrab:"ar",arg:"an",aragonès:"an",asm:"as",ava:"av",avaric:"av",ave:"ae",avestan:"ae",aym:"ay",aymara:"ay",aze:"az",bak:"ba",bashkir:"ba",bam:"bm",bambara:"bm",bel:"be",bielorús:"be",ben:"bn",bengali:"bn",bis:"bi",bislama:"bi",bod:"bo",tibetà:"bo",bos:"bs",bosni:"bs",bre:"br",bretó:"br",bul:"bg",búlgar:"bg",cat:"ca",catala:"ca",català:"ca",ces:"cs",txec:"cs",cha:"ch",chamorro:"ch",che:"ce",txetxè:"ce",chu:"cu",chv:"cv",cor:"kw",còrnic:"kw",cos:"co",cors:"co",cre:"cr",cree:"cr",cym:"cy",welsh:"cy",dan:"da",danès:"da",deu:"de",alemany:"de",div:"dv",dhivehi:"dv",dzo:"dz",dzongkha:"dz",ell:"el",grec:"el",eng:"en",anglès:"en",epo:"eo",esperanto:"eo",est:"et",estoni:"et",eus:"eu",basc:"eu",ewe:"ee",fao:"fo",faroese:"fo",fas:"fa",persa:"fa",fij:"fj",fin:"fi",finès:"fi",fra:"fr",francés:"fr",fry:"fy",ful:"ff",fulah:"ff",gla:"gd",gle:"ga",irlandès:"ga",glg:"gl",gallec:"gl",glv:"gv",manx:"gv",grn:"gn",guaraní:"gn",guj:"gu",gujarati:"gu",hat:"ht",haitià:"ht",hau:"ha",hausa:"ha",heb:"he",hebreu:"he",her:"hz",herero:"hz",hin:"hi",hindi:"hi",hmo:"ho",hirimotu:"ho",hrv:"hr",croat:"hr",hun:"hu",hongarès:"hu",hye:"hy",armeni:"hy",ibo:"ig",igbo:"ig",ido:"io",iii:"ii",iku:"iu",inuktitut:"iu",ile:"ie",ina:"ia",interlingua:"ia",ind:"id",indonesi:"id",ipk:"ik",inupiaq:"ik",isl:"is",islandès:"is",ita:"it",italià:"it",jav:"jv",javanès:"jv",jpn:"ja",japonès:"ja",kal:"kl",kan:"kn",kannada:"kn",kas:"ks",kashmiri:"ks",kat:"ka",georgià:"ka",kau:"kr",kanuri:"kr",kaz:"kk",kazakh:"kk",khm:"km",centralkhmer:"km",kik:"ki",kikuyu:"ki",kin:"rw",kir:"ky",kirghiz:"ky",kom:"kv",komi:"kv",kon:"kg",kongo:"kg",kor:"ko",koreà:"ko",kua:"kj",kuanyama:"kj",kur:"ku",kurd:"ku",lao:"lo",lat:"la",llatí:"la",lav:"lv",latvian:"lv",lim:"li",limburguès:"li",lin:"ln",lingala:"ln",lit:"lt",lituani:"lt",ltz:"lb",luxemburguès:"lb",lub:"lu",lubakatanga:"lu",lug:"lg",ganda:"lg",mah:"mh",mal:"ml",malayalam:"ml",mar:"mr",marathi:"mr",mkd:"mk",macedoni:"mk",mlg:"mg",malagasy:"mg",mlt:"mt",mon:"mn",mongol:"mn",mri:"mi",maori:"mi",msa:"ms",malay:"ms",mya:"my",burmese:"my",nau:"na",nauru:"na",nav:"nv",navajo:"nv",nbl:"nr",nde:"nd",ndo:"ng",ndonga:"ng",nep:"ne",nepali:"ne",nld:"nl",dutch:"nl",nno:"nn",nob:"nb",nor:"no",noruec:"no",nya:"ny",nyanja:"ny",oci:"oc",occità:"oc",oji:"oj",ori:"or",oriya:"or",orm:"om",oromo:"om",oss:"os",pan:"pa",panjabi:"pa",pli:"pi",pali:"pi",pol:"pl",polonès:"pl",por:"pt",portuguès:"pt",pus:"ps",pushto:"ps",que:"qu",quechua:"qu",roh:"rm",romanx:"rm",ron:"ro",romanès:"ro",run:"rn",rundi:"rn",rus:"ru",sag:"sg",san:"sa",sanskrit:"sa",sin:"si",sinhala:"si",slk:"sk",slv:"sl",esloveni:"sl",sme:"se",smo:"sm",sna:"sn",shona:"sn",snd:"sd",sindhi:"sd",som:"so",somali:"so",sot:"st",spa:"es",castella:"es",castellà:"es",espanyol:"es",sqi:"sq",albanès:"sq",srd:"sc",sard:"sc",srp:"sr",serbi:"sr",swahili:"sw",swe:"sv",suec:"sv",tah:"ty",tahitià:"ty",tam:"ta",tamil:"ta",tat:"tt",tatar:"tt",tel:"te",telugu:"te",tgk:"tg",tajik:"tg",tgl:"tl",tagalog:"tl",tha:"th",thai:"th",ton:"to",tonga:"to",tsn:"tn",tswana:"tn",tso:"ts",tuk:"tk",turcman:"tk",tur:"tr",turc:"tr",uig:"ug",uigur:"ug",ukr:"uk",ucrainès:"uk",urd:"ur",urdu:"ur",uzb:"uz",uzbek:"uz",valencià:"ca",ven:"ve",venda:"ve",vie:"vi",vietnamita:"vi",vol:"vo",wln:"wa",walloon:"wa",wol:"wo",wolof:"wo",xho:"xh",xhosa:"xh",yid:"yi",yiddish:"yi",yor:"yo",yoruba:"yo",xinés:"zh",zulú:"zu"}
return dict[key];
}
 
function necfunction4() {
 if(!neccode){neccode='';}
 if(neccode && necinfls[neccode] && necinfls[neccode][necdata['pos']]!=undefined && necinfls[neccode][necdata['pos']][2]!=undefined) {necfunction5(necinfls[neccode][necdata['pos']]);}
 else { //ocultar idioma-categoria no específic
  var xx="<span class=buit></span>";
  document.getElementById("necinfls").innerHTML=xx;
  necfunction();
 }
}
 
function necfunction5(a) { /* INFLECTION OPTIONS */
  var q="";
  for(r in a) {
    if(r<=1) {continue;}
    var qq=neccode+"-"+necdata['pos']+r;
    if(necdata[qq]==undefined) {
      if(a[r][2][0][0]=='input'){necdata[qq]='';}
      else{necdata[qq]=a[r][2][0][0];}
    }
    q+="<br>"+a[r][0]+": ";
    for(i in a[r][2]) {
      if(a[r][2][i][0]!='input') {
        q+="<a href=javascript: id='necinput"+qq+a[r][2][i][0]+"' onclick=\"";
        if(a[r][2][i][2]) {q+=a[r][2][i][2]+";";}
        q+="necdata[\'"+qq+"\']=\'"+a[r][2][i][0]+"\';necfunction4();necfunction()\">"+a[r][2][i][0]+"</a>";
        if(i!=a[r][2].length-1){q+=", "}
      } else {
        q+="<span id='necinput"+qq;
        if(necfunction7(a[r][2],necdata[qq])==false) {q+=necdata[qq];}
        q+="'>"+a[r][2][i][1]+"<input type=text value='' id='";
        q+=neccode+"-"+necdata['pos']+"-"+r+"-"+i;
        q+="' onKeyUp=";
        if(a[r][2][i][4]) {q+=a[r][2][i][4]+";";}
        q+="necfunction6('"+qq+"','"+neccode+"-"+necdata['pos']+"-"+r+"-"+i+"');";
        q+="necfunction() /></span>";
        if(i!=a[r][2].length-1){q+=", ";}
      }
    }
  }
  document.getElementById("necinfls").innerHTML=q;
  for(r in a) {
    if(r<=1) {continue;}
    var qq=neccode+"-"+necdata['pos']+r;
    document.getElementById('necinput'+qq+necdata[qq]).style.fontWeight='bold';
    if(document.getElementById('necinput'+qq+necdata[qq]).childNodes[1]&&necfunction7(a[r][2],necdata[qq])==false) {
      document.getElementById('necinput'+qq+necdata[qq]).childNodes[1].value=necdata[qq];
}}}
 
function necdefupdate() { //ACCEPCIONS: Exemples, citacions, refs.
 def="";
 for(i in necdefs) {
   def+="Accepció: <input size=110 type=text value='"+necdefs[i][0]+"' onKeyUp=necdefs["+i+"][0]=this.value;necfunction() />";
   if(i>0) {def+="<a href=javascript:necdefs.splice("+i+",1);uNec() title='Esborra aquesta definició'>(–)</a>";}
   def+="<a href=javascript:necdefs["+i+"][1].push(['','','']);uNec() title='Afegiu exemple'>(+exemple)</a><a href=javascript:necdefs["+i+"][2].push(['','','','','','','']);uNec() title='Afegeix citació'>(+citació)</a><a href=javascript:necdefs["+i+"][3].push(['','','']);uNec() title='Afegiu referència'>(+referència)</a>"
  for(l in necdefs[i][1]) { //Exemple
   def+="<br><span style='padding-left:30px;'>Exemple: </span><input type=text size=40 value='"+necdefs[i][1][l][0]+"' onKeyUp=necdefs["+i+"][1]["+l+"][0]=this.value;necfunction() /><a href=javascript:necdefs["+i+"][1].splice("+l+",1);uNec() title='Esborra aquest exemple'>(–)</a>";
   if(neccode!="ca") {
    def+="<br><span style='padding-left:60px;'>Traducció: </span><input type=text size=40 value='"+necdefs[i][1][l][2]+"' onKeyUp=necdefs["+i+"][1]["+l+"][2]=this.value;necfunction() />";
   }
  }
  for(l in necdefs[i][2]) { //Citacions
   var x=['Any','Autor','Títol','Editor','Pàgines'];
   var z=[4,20,20,20,5]; //mides
   def+="<br><span style='padding-left:30px;'>";
   for(y in x) {
    def+=x[y]+": <input type=text size="+z[y]+" value='"+necdefs[i][2][l][y]+"' onKeyUp=necdefs["+i+"][2]["+l+"]["+y+"]=this.value;necfunction() /> "}
def+="</span><br><span style='padding-left:30px;'>Citació: <input type=text size=40 value='"+necdefs[i][2][l][5]+"' onKeyUp=necdefs["+i+"][2]["+l+"][5]=this.value;necfunction() /><a href=javascript:necdefs["+i+"][2].splice("+l+",1);uNec() title='Esborra aquesta citació'>(–)</a>";
    if(neccode!="ca") {def+="<br><span style='padding-left:60px;'>Traducció: </span><input type=text size=40 value='"+necdefs[i][2][l][6]+"' onKeyUp=necdefs["+i+"][2]["+l+"][6]=this.value;necfunction() />";}
  }
  for(l in necdefs[i][3]) { //Ref.
   def+="<br><span style='padding-left:30px;'>Refs.: </span><input type=text size=40 value='"+necdefs[i][3][l][0]+"' onKeyUp=necdefs["+i+"][3]["+l+"][0]=this.value;necfunction() />";
   if(neccode=="ca") {def+=" DIEC:<input type=checkbox onclick=necdefs["+i+"][3]["+l+"][0]+='{{diec}}';uNec() /> GDLC:<input type=checkbox onclick=necdefs["+i+"][3]["+l+"][0]+='{{gdlc}}';uNec() /> DCVB:<input type=checkbox onclick=necdefs["+i+"][3]["+l+"][0]+='{{dcvb}}';uNec() />";}
   if(neccode=="hi" || neccode=="ur" || neccode=="sa") {def+=" Platts:<input type=checkbox onclick=necdefs["+i+"][3]["+l+"][0]+='{{Platts}}';uNec() />";}
   if(neccode=="mr") {def+=" Vaze:<input type=checkbox onclick=necdefs["+i+"][3]["+l+"][0]+='{{Vaze}}';uNec() />";}
   if(neccode=="ca" || neccode=="es") {
   def+=" CCLFI:<input type=checkbox onclick=necdefs["+i+"][3]["+l+"][0]+='{{CCLFI}}';uNec() /> DCM:<input type=checkbox onclick=necdefs["+i+"][3]["+l+"][0]+='{{DCM}}';uNec() /> DLCCCL1:<input type=checkbox onclick=necdefs["+i+"][3]["+l+"][0]+='{{DLCCCL1}}';uNec() /> DLCCCL2:<input type=checkbox onclick=necdefs["+i+"][3]["+l+"][0]+='{{DLCCCL2}}';uNec() />";}
   def+="<a href=javascript:necdefs["+i+"][3].splice("+l+",1);uNec() title='Esborra ref.'>(–)</a>";
  }
  def+="<br>";
 }
 document.getElementById('necdefs').innerHTML=def;
}
 
function necpostbox(q) {
  if(q!=undefined) {
   if(q==0) {necpost[q][necpost[q].length]='';}//Sin.
   else if(q==1) {necpost[q][necpost[q].length]=['',''];}//Trad.
   else if(q==2) {necpost[q][necpost[q].length]='';}//Cat.
   else if(q==3) {necpost[q][necpost[q].length]='';}//Decl.
  }
  var m="";
  for(o=0;o<2;o++) {
    if(o==0) {//Sin.
      document.getElementById('necSynonymsbutton').style.fontWeight='';
    }
    else if(o==1) {//Trad.
      document.getElementById('nectransbutton').style.fontWeight='';
    }
    for(i in necpost[o]) {
      if(o==1) {//Trad.
        m+="<span style='padding-left:60px;'>Idioma: <input type=text size=5 value='"+necpost[o][i][0]+"' onKeyUp=necpost["+o+"]["+i+"][0]=this.value;necfunction() /> "+necheadingorder[o]+": ";
      }
      else {//Sin.
        m+="<span style='padding-left:60px;'>Accepció: <input type=text value='"+necpost[o][i][0]+"' onKeyUp=necpost["+o+"]["+i+"][0]=this.value;necfunction() /> "+necheadingorder[o]+": ";
      }
      for(u in necpost[o][i]) {
        if(u!=0){
          if(u!=1){m+=", ";}
          m+="<input type=text size=10 value='"+necpost[o][i][u]+"' onKeyUp=necpost["+o+"]["+i+"]["+u+"]=this.value;necfunction() />";
        }
      }
      m+="<a href=javascript:necpost["+o+"]["+i+"].push('');necpostbox();necfunction() title='Add "+necheadingorder[o].substr(0,necheadingorder[o].length-1).toLowerCase()+"'>(+)</a>";
      if(necpost[o][i].length>2) {
        m+="<a href=javascript:necpost["+o+"]["+i+"].splice("+(necpost[o][i].length-1)+",1);necpostbox();necfunction() title='Esborra "+necheadingorder[o].substr(0,necheadingorder[o].length-1).toLowerCase()+"'>(–)</a>";
      }
      m+="<a href=javascript:necpost["+o+"].splice("+i+",1);necpostbox();necfunction() title='Elimina secció'>(elimina secció)</a><br>";
    }
  }
 
  if(necpost[2][0]!=undefined) {
   for(i in necpost[2]) {
    m+="<span style='padding-left:30px;'>Categoria:<input type=text value='"+necpost[2][i]+"' onKeyUp=necpost[2]["+i+"]=this.value;necfunction() /><a href=javascript:necpost[2].splice("+i+",1);necpostbox();necfunction() title='Elimina categoria'>(–)</a>";
    if(i==0) {
     m+="<a href=javascript:necpost[2].push('');necpostbox();necfunction() title='Afegir nova categoria'>(+nova categoria)</a>";
    }
    m+="</span><br>";
   }
  }
 
  if(necpost[3][0]!=undefined) {
   for(i in necpost[3]) {
    m+="<span style='padding-left:30px;'>Declinació:<input type=text value='"+necpost[3][i]+"' onKeyUp=necpost[3]["+i+"]=this.value;necfunction() /><a href=javascript:necpost[3].splice("+i+",1);necpostbox();necfunction() title='Elimina'>(–)</a>";
    if(i==0) {
     m+="<a href=javascript:necpost[3].push('');necpostbox();necfunction() title='Afegir'>(+)</a>";
    }
    m+="</span><br>";
   }
  }
  document.getElementById('necpostbox').innerHTML=m;
}
 
function necfunction6(cc,dd) {document.getElementById('necinput'+cc+necdata[cc]).style.fontWeight='';necdata[cc]=document.getElementById(dd).value;document.getElementById(dd).parentNode.setAttribute('ID','necinput'+cc+document.getElementById(dd).value);document.getElementById('necinput'+cc+necdata[cc]).style.fontWeight='bold';}
 
function necfunction7(qw,er) {var qwe=false;for(ty in qw) {if(er==qw[ty][0]){qwe=true}}return qwe;}
function uNec() {necdefupdate();necfunction();}
function necload() {
 var PP=document.getElementById('ca-nstab-main');
 if(PP) {
  if(PP.firstChild) {
    if(document.getElementById('necblah')) {
     necfunction2();uNec();necfunction4();necfunction();
    }
}}}
 
$(document).ready(necload);