MediaWiki:Gadget-FormeFlesse2.js

Da Wikizionario, il dizionario a contenuto aperto.

Nota: dopo aver pubblicato, potrebbe essere necessario pulire la cache del proprio browser per vedere i cambiamenti.

  • Firefox / Safari: tieni premuto il tasto delle maiuscole Shift e fai clic su Ricarica, oppure premi Ctrl-F5 o Ctrl-R (⌘-R su Mac)
  • Google Chrome: premi Ctrl-Shift-R (⌘-Shift-R su un Mac)
  • Internet Explorer / Edge: tieni premuto il tasto Ctrl e fai clic su Aggiorna, oppure premi Ctrl-F5
  • Opera: premi Ctrl-F5.
/* jshint maxerr: 10000 */
/**
 * Creatore di forme flesse per it.wikt version [2.0.1]]
 * di [[m:User:Wim b]]
 */
/*
Changelog:
- 1.0.1 : Aggiunta la possibilità di creare i plurali anche alle parole che hanno una sola forma;
		- aggiunto il link nelle pagine speciali;
		- rimossa la classe "link rosso" ai collegamenti alla pagina
- 1.0.2 : Funzione per recuperare automaticamente la parte del discorso corretta e creazione del pulsante accanto ai titoli nei lemmi
- 1.0.3 : Responso creazione pagina con link per visualizzazione + titolo nella scheda del browser
- 1.0.4 : Piccolo convertitore di sillabazione per favorire il copia-incolla dai dizionari on line
- 1.1.0 : Riscritto il codice per i lemmi che hanno solo una forma per i plurali (reso compatibile per i maschili e femminili);
		- divise le sezioni tramite colori per evitare confusioni
- 1.2.0 : Aggiunta la possibilità di tradurre automaticamente l'interfaccia in base alle preferenze utente
- 1.3.0 : Aggiunta la possibilità di specificare una seconda forma flessa alternativa
- 1.4.0 : Aggiunta la possibilità del caso "Maschile singolare - Femminile plurale", con la funzione per togliere la spunta alle forme "femminile plurale" e "femminile singolare e plurale" nel caso venga spuntata una forma che porterebbe a creare un duplicato
- 1.5.0 : Aggiunto un controllo sulle eventuali omonimie date dalle desinenze;
		- aggiunto un pittogramma colorato, per dividere maschili e femminili, accanto al checkbox corrispondente
- 1.6.0 : Aggiunta la possibilità di creare lemmi che possono essere sia aggettivi che sostantivi in modo da non doverci ripassare in futuro per modificare a mano
- 1.6.1 : Aggiunta la tabella riassuntiva per agevolare il riscontro dei lemmi effettivamente creati
- 1.6.2 : Aggiunto controllo che impedisce di proseguire con la creazione se non sono state specificate tutte le informazioni preliminari
- 1.6.3 : Corretta la creazione dei lemmi con doppia parte del discorso, adesso aggiunge soltanto un template:Tabs
- 1.6.4 : Aggiunti i tag per raggruppare le modifiche e renderle più riconoscibili
- 1.7.0 : Aggiunto un bottone nel {{Tabs}} per recuperare i parametri e compilare i campi automaticamente
- 1.7.1 : Unificata funzione per correggere la sillabazione
- 2.0.0 : Esternalizzate le funzioni comuni e aggiunta la pronuncia;
		- riscrittura variabili per correggere doppia nominazione;
		- Ora il titolo della pagina è una variabile per comodità
- 2.0.1 : Aggiunto il link diretto alla modalità di modifica della pagina
*/
//<nowiki>
( function( mw, $ ) {
	'use strict';

var SpecialPageLink = 'FormeFlesse2';


	//Funzione per correggere la sillabazione
	function ConvertiSillabazione( IDPulsante, IDCampo ) {
		$( "" + IDPulsante + "" ).click( function( event ) {
			$( '' + IDCampo + '' ).val(
				$( '' + IDCampo + '' ).val()
				.replace( /​/g, '' )
				.replace( /ʒ/g, 'z' )
				.replace( /(-|·|\|)/g, ' | ' )
				.replace( /\] o \[/g, '</br>\; ' )
				.replace( /(\[|\]|\/)/g, '' )
				.replace( /((\w) (\w))/g, '$2 - $3' )
			);
		} );
	}

	//Rimuovo il colore rosso del link inesistente
	$( "a[href$='/wiki/Speciale:"+SpecialPageLink+"']" ).attr( {
		'title': 'Speciale:'+SpecialPageLink+''
	} ).removeClass();

	//Anche alla pagina della versione stabile, per comodità redirecto alla versione sperimentale
	$( "a[href$='/wiki/Speciale:FormeFlesse']" ).attr( {
		'title': 'Speciale:'+SpecialPageLink+''
	} ).attr( "href", "/wiki/Speciale:"+SpecialPageLink+"" ).removeClass();

	// Funzione per tradurre i messaggi
	mw.messages.set( messages[ 'it' ] );
	var lang = mw.config.get( 'wgUserLanguage' );
	if ( lang && lang != 'it' && lang in messages ) {
		mw.messages.set( messages[ lang ] );
	}
	
//Creo link nella pagine delle "pagine speciali"
	if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Specialpages' ) {
		$( '#mw-specialpagesgroup-pagetools' ).next().find( 'ul' ).eq( 0 )
			.prepend(
				'<li><a href=" /wiki/Speciale:'+SpecialPageLink+'">' +
				mw.msg( 'Txt-portletLink' ) +
				' (beta)</a></li>'
			);
	}

	// Link nel portlet
	mw.util.addPortletLink(
		'p-tb',
		'/wiki/Special:'+SpecialPageLink+'',
		mw.msg( 'Txt-portletLink' ) + ' (beta)',
		't-ff',
		mw.msg( 'Txt-Help-portletLink' ) + ' (beta)',
		'-',
		''
	);

	//$('#t-ff2').hide()
	// CREO  E APPENDO IL BOTTONE PER IL REINDIRIZZAMENTO 
	// Recupero i parametri
	var ffdms = $( "#FFdms" ).text();
	var ffdmp = $( "#FFdmp" ).text();
	var ffdfs = $( "#FFdfs" ).text();
	var ffdfp = $( "#FFdfp" ).text();
	var ffrad = $( "#FFrad" ).text();

	//creo fisicamente il bottone
	$( '#ButtonFF' ).append( ' <input id="wpLinkButton2" type="button" value="' + mw.msg('FF-Button-Tabs') + '">' ).click( function() {
		var classParte = $( this ).attr( 'class' );
		window.location = "/wiki/Speciale:"+SpecialPageLink+"?parte=" + classParte + "&ms=" + ffdms + "&mp=" + ffdmp + "&fs=" + ffdfs + "&fp=" + ffdfp + "&rad=" + ffrad + "";
	} );

	if ( mw.config.get( 'wgNamespaceNumber' ) !== -1 || mw.config.get( 'wgTitle' ) !== SpecialPageLink ) {
		return;
	}
	//TITOLO NELLA SCHEDA DEL BROWSER 
	document.title = 'Forme Flesse - ' + mw.config.get( 'wgSiteName' );

	//FUNZIONE PER SCRIVERE NELLE PAGINE
	var writeInPage = function( title, content, summary, success ) {
		var param = {
			action: 'edit',
			title: title,
			summary: summary,
			text: content,
			tags: "Forme flesse (BETA)"
		};

		new mw.Api().postWithEditToken( param )
			.done( success )
			.fail( function( e ) {
				mw.log.error( 'Impossibile modificare la pagina. Errore: ' + e );
			} );
	};



	var success = '<li><span style="color:#00A050; font-size:20px">√</span>';

	//INIZIO SCRIPT IMPAGINAZIONE
	//Sostituisco il titolo
	$( 'h1' ).text( '' + mw.msg('Title') + '' );
	$( '#bodyContent' ).replaceWith( '' +
		'<input name="title" type="hidden" value="Speciale:FormeFlesse" />' +
		'<fieldset><legend>' + mw.msg('Legend') + '</legend>' +
		'' + mw.msg('Intro') + '' +
		'<h3 id=Esempio style="background:#eedae3; padding-left: 10px;">' + mw.msg('InfoPre-Title') + '</h3> ' +
		'<div class="toccolours">' +
		'<table style="width:60%">' +
		'<td> ' + mw.msg('InfoPre-Radice') + ': <input type="text" id="radice" name="radice"></td>' +
		'<td> ' + mw.msg('InfoPre-Desinenza') + ': <input type="text" id="principale" name="principale"></td>' +
		'<table>' +
		'<tbody><tr>' +
		'<td> <input type="radio" name="Parte" value="agg" id="agg" style=""> ' + mw.msg('InfoPre-Agg') + ' </td>' +
		'<td style="font-size: 250%;" rowspan="2">} </td>' +
		'<td rowspan="2"> <input type="radio" name="Parte" value="agg" id="AeS" style=""> ' + mw.msg('InfoPre-Agg-Sost') + ' </td></tr>' +
		'<tr> <td> <input type="radio" name="Parte" value="sost" id="sost" style=""> ' + mw.msg('InfoPre-Sost') + ' </td></tr>' +
		'</tbody></table>' +
		'</tr>' +
		'</table></div>' +
		'<p></p>' +
		'<h3 style="background:#e0e8ff; padding-left: 10px;">' + mw.msg('FF-Title') + '</h3>' +
		'<div class="toccolours">' +
		'<p></p>' +
		'<table style="width:100%">' +
		'<tr>' +
		'<td><li> <img src="https://upload.wikimedia.org/wikipedia/commons/7/7b/Blue_man_silhouette_symbol.png" alt="Sagoma maschile" width="10" /><img src="https://upload.wikimedia.org/wikipedia/commons/7/7b/Blue_man_silhouette_symbol.png" alt="Sagoma maschile" width="10" /> <input name="CBmp" type="checkbox" value="" id="CBmp" style="">' + mw.msg('FF-MP') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaMP" name="desinenzaMP" disabled></p></li></td>' +
		'</td>' +
		'<td><li> <img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Pink_woman_silhouette.png" alt="Sagoma femminile" width="10" /> <input name="CBfs" type="checkbox" value="" id="CBfs" style="">' + mw.msg('FF-FS') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaFS" name="desinenzaFS" disabled></p></li></td>' +
		'<td><li> <img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Pink_woman_silhouette.png" alt="Sagoma femminile" width="10" /><img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Pink_woman_silhouette.png" alt="Sagoma femminile" width="10" /><input name="CBfp" type="checkbox" value="" id="CBfp" style="">' + mw.msg('FF-FP') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaFP" name="desinenzaFP" disabled></p></li></td>' +
		'<td><li> <img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Pink_woman_silhouette.png" alt="Sagoma femminile" width="10" /> <img src="https://upload.wikimedia.org/wikipedia/commons/b/b3/Minus_font_awesome.svg" alt="-" width="10" />  <img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Pink_woman_silhouette.png" alt="Sagoma femminile" width="10" /><img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Pink_woman_silhouette.png" alt="Sagoma femminile" width="10" /><input name="CBfsp" type="checkbox" value="" id="CBfsp" style="">' + mw.msg('FF-FSP') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaFSP" name="desinenzaFSP" disabled></p></li></td>' +
		'<td><li> <img src="https://upload.wikimedia.org/wikipedia/commons/7/7b/Blue_man_silhouette_symbol.png" alt="Sagoma maschile" width="10" /> <img src="https://upload.wikimedia.org/wikipedia/commons/b/b3/Minus_font_awesome.svg" alt="-" width="10" /> <img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Pink_woman_silhouette.png" alt="Sagoma femminile" width="10" /><img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Pink_woman_silhouette.png" alt="Sagoma femminile" width="10" /> <input name="CBmsfp" type="checkbox" value="" id="CBmsfp" style="">' + mw.msg('FF-MSFP') + '  <p>' +
		'<li> <img src="https://upload.wikimedia.org/wikipedia/commons/7/7b/Blue_man_silhouette_symbol.png" alt="Sagoma maschile" width="10" /> <img src="https://upload.wikimedia.org/wikipedia/commons/b/b3/Minus_font_awesome.svg" alt="-" width="10" /> <img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Pink_woman_silhouette.png" alt="Sagoma femminile" width="10" /><img src="https://upload.wikimedia.org/wikipedia/commons/e/ed/Pix.gif" alt="Sagoma femminile" width="10" /> <input name="CBmsfs" type="checkbox" value="" id="CBmsfs" style="">' + mw.msg('FF-MSFS') + ' </li></td>' +
		'</tr>' +
		'<tr>' +
		'<td><h5 id="formeAlternative">' + mw.msg('FF-Alternative') + '</h5>' +
		'<p></p></td>' +
		'</tr>' +
		'<tr>' +
		'<td><li> <input name="CBmp2" type="checkbox" value="" id="CBmp2" style="">' + mw.msg('FF-MP2') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaMP2" name="desinenzaMP2" disabled></p></li></td>' +
		'</td>' +
		'<td><li> <input name="CBfs2" type="checkbox" value="" id="CBfs2" style="">' + mw.msg('FF-FS2') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaFS2" name="desinenzaFS2" disabled></p></li></td>' +
		'<td><li> <input name="CBfp2" type="checkbox" value="" id="CBfp2" style="">' + mw.msg('FF-FP2') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaFP2" name="desinenzaFP2" disabled></p></li></td>' +
		'<td><li> <input name="CBfsp2" type="checkbox" value="" id="CBfsp2" style="">' + mw.msg('FF-FSP2') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaFSP2" name="desinenzaFSP2" disabled></p></li></td>' +
		'</tr>' +
		'<tr>' +
		'<td><h4 id="sillabazione">' + mw.msg('FF-Hyph') + '</h4>' +
		'<p></p></td>' +
		'</tr>' +
		'<tr>' +
		'<td>' + mw.msg('FF-Sill-Radice') + ': <input type="text" id="radiceSill" name="radiceSill"> <input id="ConvertiSill" type="button" value="' + mw.message( 'FF-HyphConvert' ).escaped() + '"></td>' +
		'</tr>' +
		'<tr>' +
		'<td> <li> <input name="CBSillmp" type="checkbox" value="" id="CBSillmp" style="">' + mw.msg('FF-MP') + '<p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaSillMP" name="desinenzaSillMP" disabled></p></li></td>' +
		'<td><li> <input name="CBSillfs" type="checkbox" value="" id="CBSillfs" style="">' + mw.msg('FF-FS') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaSillFS" name="desinenzaSillFS" disabled></p></li></td>' +
		'<td><li> <input name="CBSillfp" type="checkbox" value="" id="CBSillfp" style="">' + mw.msg('FF-FP') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaSillFP" name="desinenzaSillFP" disabled></p></li></td>' +
		'<td><li> <input name="CBSillfsp" type="checkbox" value="" id="CBSillfsp" style="">' + mw.msg('FF-FSP') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaSillFSP" name="desinenzaSillFSP" disabled></p></li></td>' +
		'</tr>' +
		'<td><h5 id="sillabazioneAlternative">' + mw.msg('FF-Alternative') + '</h5>' +
		'<p></p></td>' +
		'</tr>' +
		'<tr>' +
		'<td> <li> <input name="CBSillmp2" type="checkbox" value="" id="CBSillmp2" style="">' + mw.msg('FF-MP2') + '<p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaSillMP2" name="desinenzaSillMP2" disabled></p></li></td>' +
		'<td><li> <input name="CBSillfs2" type="checkbox" value="" id="CBSillfs2" style="">' + mw.msg('FF-FS2') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaSillFS2" name="desinenzaSillFS2" disabled></p></li></td>' +
		'<td><li> <input name="CBSillfp2" type="checkbox" value="" id="CBSillfp2" style="">' + mw.msg('FF-FP2') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaSillFP2" name="desinenzaSillFP2" disabled></p></li></td>' +
		'<td><li> <input name="CBSillfsp2" type="checkbox" value="" id="CBSillfsp2" style="">' + mw.msg('FF-FSP2') + ' <p> ' + mw.msg('FF-Desinenza') + ': <input type="text" id="desinenzaSillFSP2" name="desinenzaSillFSP2" disabled></p></li></td>' +
		'</tr>' +
		
        
    //Pronuncia
        '<td><h4 id="pronuncia">' + mw.message('FF-Pron').text() + '</h4>' +
        '<p></p></td>' +
        '</tr>' +
        '<tr>' +
        '<td> <li> <input name="CBPronmp" type="checkbox" value="" id="CBPronmp" style="">' + mw.message('FF-MP').text() + '<p> <input type="text" id="VpronMP" name="VpronMP" disabled></p></li></td>' +
        '<td><li> <input name="CBPronfs" type="checkbox" value="" id="CBPronfs" style="">' + mw.message('FF-FS').text() + ' <p> <input type="text" id="VpronFS" name="VpronFS" disabled></p></li></td>' +
        '<td><li> <input name="CBPronfp" type="checkbox" value="" id="CBPronfp" style="">' + mw.message('FF-FP').text() + ' <p> <input type="text" id="VpronFP" name="VpronFP" disabled></p></li></td>' +
        '<td><li> <input name="CBPronfsp" type="checkbox" value="" id="CBPronfsp" style="">' + mw.message('FF-FSP').text() + ' <p> <input type="text" id="VpronFSP" name="VpronFSP" disabled></p></li></td>' +
        '</tr>' +
        
    //Pronuncia: Alternativa
        '<td><h5 id="PronunciaAlternative">' + mw.message('FF-Alternative').text() + '</h5>' +
        '<p></p></td>' +
        '</tr>' +
        '<tr>' +
        '<td> <li> <input name="CBPronmp2" type="checkbox" value="" id="CBPronmp2" style="">' + mw.message('FF-MP2').text() + '<p> <input type="text" id="VpronMP2" name="VpronMP2" disabled></p></li></td>' +
        '<td><li> <input name="CBPronfs2" type="checkbox" value="" id="CBPronfs2" style="">' + mw.message('FF-FS2').text() + ' <p> <input type="text" id="VpronFS2" name="VpronFS2" disabled></p></li></td>' +
        '<td><li> <input name="CBPronfp2" type="checkbox" value="" id="CBPronfp2" style="">' + mw.message('FF-FP2').text() + ' <p> <input type="text" id="VpronFP2" name="VpronFP2" disabled></p></li></td>' +
        '<td><li> <input name="CBPronfsp2" type="checkbox" value="" id="CBPronfsp2" style="">' + mw.message('FF-FSP2').text() + ' <p> <input type="text" id="VpronFSP2" name="VpronFSP2" disabled></p></li></td>' +
        '</tr>' +

        '</table></div>' +
		'<p></p>' +
		'<h3 style="background:#daeedc; padding-left: 10px;">' + mw.msg('PL-Title') + ':</h3>' +
		'<div class="toccolours">' +
		'<p></p>' +
		'<table style="width:100%">' +
		mw.msg('FF-Desinenza') + ': <input type="text" id="DesinenzaPlurale" name="DesinenzaPlurale"><p>' +
		'<li> <input name="CBGenere" type="radio" value="m" id="CBGenere" style="">' + mw.msg('PL-M') + '</li>' +
		'<li> <input name="CBGenere" type="radio" value="f" id="CBGenere" style="">' + mw.msg('PL-F') + '</li>' +
		'<li> <input name="CBGenere" type="radio" value="m\'\' e \'\'f" id="CBGenere" style="">' + mw.msg('PL-MF') + '</li>' +
		'<h4 id="sillabazionePlurale">' + mw.msg('FF-Hyph') + '</h4>' +
		'<p></p>' +
		mw.msg('FF-Sill-Radice') + ' : <input type="text" id="radicePluraleSill" name="radicePluraleSill"> <input id="ConvertiSillPlurale" type="button" value="' + mw.message( 'PL-HyphConvert' ).escaped() + '"><p>' +
		mw.msg('FF-Desinenza') + ': <input type="text" id="DesinenzaSillPlurale" name="DesinenzaSillPlurale">' +
 
 // Pronuncia solo plurale       
        '<h4 id="PronunciaPlurale">' + mw.message('FF-Pron').text() + '</h4>' +
        '<p></p>' +
        '<input type="text" id="VpronPlurale" name="VpronPlurale">' +
        '</table></div>' +
        '<div id="FFbuttons"></div>' +
        '</fieldset><div id="results" style="visibility: hidden"></div>' +
		' <table class="wikitable"> ' +
		' <tbody><tr> ' +
		' <th></th> ' +
		' <th>' + mw.msg('FF-MP') + '</th> ' +
		' <th>' + mw.msg('FF-FS') + '</th> ' +
		' <th>' + mw.msg('FF-FP') + '</th> ' +
		' <th>' + mw.msg('FF-FSP') + '</th> ' +
		' </tr> ' +
		' <tr style="text-align: center;"> ' +
		' <th>' + mw.msg('Table-RegForm') + '</th> ' +
		' <td> <div id="MPSuccess"></div> </td> ' +
		' <td> <div id="FSSuccess"></div> </td> ' +
		' <td> <div id="FPSuccess"></div> </td> ' +
		' <td> <div id="FSPSuccess"></div> </td> ' +
		' </tr> ' +
		' <tr style="text-align: center;"> ' +
		' <th>' + mw.msg('Table-AltForm') + '</th> ' +
		' <td> <div id="MP2Success"></div> </td> ' +
		' <td> <div id="FS2Success"></div> </td> ' +
		' <td> <div id="FP2Success"></div> </td> ' +
		' <td> <div id="FSP2Success"></div> </td> ' +
		' </tr> ' +
		' <tr> ' +
		' <th colspan="7">' + mw.msg('Table-PL') + '</th> ' +
		' </tr> ' +
		' <tr style="text-align: center;"> ' +
		' <td colspan="7"> <div id="PluraleSuccess"></div> </td> ' +
		' </tr> ' +
		' </tbody></table> </form>' );

	$( function() {
		//RECUPERA I PARAMETRI DAL TITOLO...
		var CheckParte = mw.util.getParamValue( 'parte' );
		var ValMS = mw.util.getParamValue( 'ms' );
		var ValMP = mw.util.getParamValue( 'mp' );
		var ValFS = mw.util.getParamValue( 'fs' );
		var ValFP = mw.util.getParamValue( 'fp' );
		var ValRAD = mw.util.getParamValue( 'rad' );

		// .... e spunta il checkbox relativo
		//$( 'input#'+CheckParte+' ').prop('checked', true);

		//Compilo la radice e la desinenza del maschile singolare
		$( '#radice' ).val( ValRAD );
		$( '#principale' ).val( ValMS );

		//Compilo e attivo il maschile plurale
		if ( ValMP !== null ) {
			$( 'input#CBmp' ).attr( 'checked', 'checked' );
			$( 'input[id=desinenzaMP]' ).attr( 'disabled', false );
			$( '#desinenzaMP' ).val( ValMP );
		}

		//Compilo e attivo il femminile singolare
		if ( ValFS !== null ) {
			$( 'input#CBfs' ).attr( 'checked', 'checked' );
			$( 'input[id=desinenzaFS]' ).attr( 'disabled', false );
			$( '#desinenzaFS' ).val( ValFS );
		}

		//Compilo e attivo il femminile plurale
		if ( ValFP !== null ) {
			$( 'input#CBfp' ).attr( 'checked', 'checked' );
			$( 'input[id=desinenzaFP]' ).attr( 'disabled', false );
			$( '#desinenzaFP' ).val( ValFP );
		}

		//COMPILAZIONE DELL'ESEMPIO
		$( '#Esempio' ).append( ' <input id="wpEsempio"type="button" value="' + mw.message( 'FF-Example' ).escaped() + '">' ).click( function() {
			$( '#radice' ).val( 'bell' );
			$( '#principale' ).val( 'o' );
			$( 'input#CBmp' ).attr( 'checked', 'checked' );
			$( '#desinenzaMP' ).val( 'i' );
			$( 'input#CBfs' ).attr( 'checked', 'checked' );
			$( '#desinenzaFS' ).val( 'a' );
			$( 'input#CBfp' ).attr( 'checked', 'checked' );
			$( '#desinenzaFP' ).val( 'e' );

			$( "#radiceSill" ).val( 'bèl | l' );
			$( 'input#CBSillmp' ).attr( 'checked', 'checked' );
			$( '#desinenzaSillMP' ).val( 'i' );
			$( 'input#CBSillfs' ).attr( 'checked', 'checked' );
			$( '#desinenzaSillFS' ).val( 'a' );
			$( 'input#CBSillfp' ).attr( 'checked', 'checked' );
			$( '#desinenzaSillFP' ).val( 'e' );
		} );


        	
        //CARICO LE IMPOSTAZIONI COMUNI
        $(FFCommonSettings);

		// BOTTONE "CLEAR"
			var buttonFFClear = new OO.ui.ButtonWidget( {
				label: mw.msg('btn-Reset'),
				target: '_blank',
				flags: ['destructive']
			});    
		//BOTTONE "SCRIVI"
			var buttonFFSubmit = new OO.ui.ButtonWidget( {
				label: mw.msg('btn-Submit'),
				target: '_blank',
				flags: ['progressive']
			});
		// APPENDO BOTTONE "SUBMIT"	
			$('#FFbuttons').first().append(' <br>')
			.append( buttonFFSubmit.$element );
			
		// APPENDO BOTTONE "CLEAR"	
			$('#FFbuttons').first().append(' ')
			.append( buttonFFClear.$element );
        	
        // FUNZIONE BOTTONE CLEAR	
        	buttonFFClear.$element.click(function () {
				$('input[type=text]').val('');
            	$('input').prop('checked', false);
		
			});
			
		// FUNZIONE BOTTONE SUBMIT
		buttonFFSubmit.$element.click(function(event) {
			
			
			//CONTROLLO COMPILAZIONE INFORMAZIONI PRELIMINARI

			if ( $( "input[name=Parte]" ).is( ":checked" ) === false || $( '#radice' ).val() === "" || $( '#principale' ).val() === "" ) {

				mw.util.$content.prepend( '<div id="AvvisoNoParte" title="' + mw.msg('DB-InfoPre-Title') + '"><p><div style="text-align:center"></br><b><div style="text-align:center"><img src="http://upload.wikimedia.org/wikipedia/commons/5/55/Gtk-stop.svg" alt="operazione annullata" width="20" height="20" />' + mw.msg('DB-Subtitle') + '</div></b>' + mw.msg('DB-InfoPre-Text') + ' ' +
					'</div>' );

				mw.loader.using( [ 'jquery.ui' ], function() { // inizializzo la finestra di dialogo
					$( "#AvvisoNoParte" ).dialog( {
						width: 500,
						modal: true,
						buttons: [ {
							text: mw.msg('DB-Edit'),
							click: function() {
								$( this ).dialog( "close" );
							}
						}, ]
					} );
				} );

			} else {

				// CONTROLLO OMONIMIE
				if ( ( $( "#principale" ).val() ) == ( $( "#desinenzaMP" ).val() ) || ( $( "#principale" ).val() ) == ( $( "#desinenzaFS" ).val() ) || ( $( "#principale" ).val() ) == ( $( "#desinenzaFP" ).val() ) || ( $( "#principale" ).val() ) == ( $( "#desinenzaFSP" ).val() )
					/* 
	FORME ALTERNATIVE
*/
					||
					( $( "#principale" ).val() ) == ( $( "#desinenzaMP2" ).val() ) || ( $( "#principale" ).val() ) == ( $( "#desinenzaFS2" ).val() ) || ( $( "#principale" ).val() ) == ( $( "#desinenzaFP2" ).val() ) || ( $( "#principale" ).val() ) == ( $( "#desinenzaFSP2" ).val() )
					/* 
	SOLO PLURALE
*/
					||
					( $( "#principale" ).val() ) == ( $( "#DesinenzaPlurale" ).val() ) ) {

					//CREAZIONE DIALOG
					mw.util.$content.prepend( '<div id="AvvisoUguali" title="' + mw.msg('DB-Homon-Title') + '"><p><div style="text-align:center"></br><b><div style="text-align:center"><img src="http://upload.wikimedia.org/wikipedia/commons/5/55/Gtk-stop.svg" alt="operazione annullata" width="20" height="20" />' + mw.msg('DB-Subtitle') + '</div></b>' + mw.msg('DB-Homon-Text') + ' ' +
						'</div>' );



					mw.loader.using( [ 'jquery.ui' ], function() { // inizializzo la finestra di dialogo
						$( "#AvvisoUguali" ).dialog( {
							width: 500,
							modal: true,
							buttons: [ {
									text: mw.msg('DB-Edit'),
									click: function() {
										$( this ).dialog( "close" );
									}
								},
								{
									text: mw.msg('DB-Continue'),
									click: function() {
										SCRIVI();
										$( this ).dialog( "close" );

									}
								}
							]
						} );
					} );

				} else {
					SCRIVI();
				}
			}



		} );

	} );


	function SCRIVI() {
	//Recupero variabili comuni
		var common = window.FFCommonValues.init();
		
	//Variabile "spunta verde" in caso di esito positivo
		var success = common.success;
		
		var str = $( "fieldset" ).serialize();
		$( "#results" ).text( str );

				var MP = (( $( 'input#omonimoMS' ).is( ':checked' ) ) ? 
				''+ common.radice + common.principale +'' : ''+ common.radice + common.desinenzaMP +'');
				
				var MP2 = (( $( 'input#CBmp2' ).is( ':checked' ) ) === true ? '\|mp2=' + common.radice + common.desinenzaMP2 + '' : '');
			
				var FS2 = (( $( 'input#CBfs2' ).is( ':checked' ) ) === true ? '\|f2=' + common.radice + common.desinenzaFS2 + '' : '');
			
				var FP2 = (( $( 'input#CBfp2' ).is( ':checked' ) ) === true ? '\|fp2=' + common.radice + common.desinenzaFP2 + '' : '');
				
				var realDesinenzaFS = (( $( 'input#CBfsp' ).is( ':checked' ) ) === true ?  common.desinenzaFSP : common.desinenzaFS );
				var realDesinenzaFP = (( $( 'input#CBfsp' ).is( ':checked' ) ) === true ?  common.desinenzaFSP : common.desinenzaFP );

				var FTabs = (( $( 'input#CBfsp' ).is( ':checked' ) ) === true ? common.radice + common.desinenzaFSP + '\|' + common.radice + common.desinenzaFSP : common.radice + realDesinenzaFS + '\|' + common.radice + common.desinenzaFP );

				var FSP2 = (( $( 'input#CBfsp2' ).is( ':checked' ) ) === true ? '\|f2=' + common.radice + common.desinenzaFSP2 + '\|fp2=' + common.radice + common.desinenzaFSP2 + '' : '' );
			
				var MSFP = (( $( 'input#CBmsfp' ).is( ':checked' ) ) === true ? '' + common.principale + '' : '' );
			
				var MSFS = (( $( 'input#CBmsfs' ).is( ':checked' ) ) === true ? '' + common.principale + '' : '' );
				
		// CREAZIONE MASCHILE PLURALE
		if ( $( 'input#CBmp' ).is( ':checked' ) ) {
				var AeSTXTMP = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{-sost form-\|it\}\}\n' +
					'\{\{Pn\}\} \'\'m pl\'\' \n' +
					'\n' +
					'# plurale di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n' : '');

				var SillMP = (( $( 'input#CBSillmp' ).is( ':checked' ) ) ?
					'\{\{-sill-\}\}\n' +
					'; '+common.radiceSill+common.desinenzaSillMP+'\n\n' : '');
					
				var PronMP = (( $( 'input#CBPronmp' ).is( ':checked' ) && $('#VpronMP').val() !== '' ) ?
					'\{\{-pron-\}\}\n' +
					'\{\{IPA|'+common.VpronMP+'\}\}\n\n' : '');

				var AeSTRADMP = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{Trad1|plurale di ' + common.radice + common.principale + ' (aggettivo) \}\}\n' +
					'\:*\{\{en\}\}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\} \n\n' +
					'\{\{Trad1\|plurale di ' + common.radice + common.principale + ' (sostantivo) \}\}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' : '\{\{Trad1\|\}\}\n' +
					'\:*\{\{en\}\}\: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\}');

			var TestoMP = '== \{\{-it-\}\} == \n' +
				'\{\{-' + common.parte + ' form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'m pl\'\' \{\{Tabs\|' + common.radice + common.principale + '\|' + MP + '\|' + common.radice + realDesinenzaFS + MSFS + '\|' + common.radice + common.desinenzaFP + MP2 + FS2 + FP2 + FSP2 + MSFP + '}} \n' +
				'\n' +
				'# plurale di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n' +
				'\n' + AeSTXTMP + '' +
				''+ SillMP +'' +
				'' + PronMP + '' +
				'{{-etim-}}\n' +
				'\{\{Etim-link\|' + common.radice + common.principale + '\}\}\n'+
				'\n' +
				'{{-trad-}}\n' +
				'' + AeSTRADMP + '';

			writeInPage(
				"" + common.radice + common.desinenzaMP + "",
				"" + TestoMP + "",
				"[[" + mw.message( 'ScriptLink' ).escaped() + "|Script]]: " + mw.message( 'FF-Created-MP' ).escaped() + "",
				function() {
					$( '#MPSuccess' ).html( success + ' <a href="/wiki/' + common.radice + common.desinenzaMP + '" id="PageCreated">' + common.radice + common.desinenzaMP + '</a> <a href="/w/index.php?title=' + common.radice + common.desinenzaMP + '&action=edit" id="PageCreatedEdit">(modifica)</a>' );
				}
			);
		}

		// CREAZIONE MASCHILE PLURALE (FORMA ALTERNATIVA)
		if ( $( 'input#CBmp2' ).is( ':checked' ) ) {
				var AeSTXTMP2 = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{-sost form-\|it\}\}\n' +
					'\{\{Pn\}\} \'\'m pl\'\' \n' +
					'\n' +
					'# plurale alterntivo di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' : '');

				var SillMP2 = (( $( 'input#CBSillmp2' ).is( ':checked' ) ) ?
					'\{\{-sill-\}\}\n' +
					'; '+common.radiceSill+common.desinenzaSillMP+'\n\n' : '');
					
				var PronMP2 = (( $( 'input#CBPronmp2' ).is( ':checked' ) && $('#VpronMP2').val() !== '' ) ?
					'\{\{-pron-\}\}\n' +
					'\{\{IPA|'+common.VpronMP+'\}\}\n\n' : '');

				var AeSTRADMP2 = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{Trad1|plurale di ' + common.radice + common.principale + ' (aggettivo) \}\}\n' +
					'\:*\{\{en\}\}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\} \n\n' +
					'\{\{Trad1\|plurale di ' + common.radice + common.principale + ' (sostantivo) \}\}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' : '\{\{Trad1\|\}\}\n' +
					'\:*\{\{en\}\}\: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\}');

			var TestoMP2 = '== \{\{-it-\}\} == \n' +
				'\{\{-' + common.parte + ' form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'m pl\'\' \{\{Tabs\|' + common.radice + common.principale + '\|' + MP + '\|' + common.radice + realDesinenzaFS + MSFS + '\|' + common.radice + common.desinenzaFP + MP2 + FS2 + FP2 + FSP2 + MSFP + '}} \n' +
				'\n' +
				'# plurale alternativo di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' +
				'' + AeSTXTMP2 + '' +
				''+ SillMP2 +'' +
				'' + PronMP2 + '' +
				'{{-etim-}}\n' +
				'\{\{Etim-link\|' + common.radice + common.principale + '\}\}\n'+
				'\n' +
				'{{-trad-}}\n' +
				'' + AeSTRADMP2 + '';

			writeInPage(
				"" + common.radice + common.desinenzaMP2 + "",
				"" + TestoMP2 + "",
				"[[" + mw.message( 'ScriptLink' ).escaped() + "|Script]]: " + mw.message( 'FF-Created-MP2' ).escaped() + "",
				function() {
					$( '#MP2Success' ).html( success + ' <a href="/wiki/' + common.radice + common.desinenzaMP2 + '" id="PageCreated">' + common.radice + common.desinenzaMP2 + '</a> <a href="/w/index.php?title=' + common.radice + common.desinenzaMP2 + '&action=edit" id="PageCreatedEdit">(modifica)</a>' );
				}
			);
		}


		// CREAZIONE FEMMINILE SINGOLARE
		if ( $( 'input#CBfs' ).is( ':checked' ) ) {
				var AeSTXTFS = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{-sost form-\|it\}\}\n' +
					'\{\{Pn\}\} \'\'f sing\'\' \n' +
					'\n' +
					'# femminile di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n' : '');

				var SillFS = (( $( 'input#CBSillfs' ).is( ':checked' ) ) ?
					'\{\{-sill-\}\}\n' +
					'; '+common.radiceSill+common.desinenzaSillFS+'\n\n' : '');
					
				var PronFS = (( $( 'input#CBPronfs' ).is( ':checked' ) && $('#VpronFS').val() !== '' ) ?
					'\{\{-pron-\}\}\n' +
					'\{\{IPA|'+common.VpronFS+'\}\}\n\n' : '');

				var AeSTRADFS = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{Trad1|femminile di ' + common.radice + common.principale + ' (aggettivo) \}\}\n' +
					'\:*\{\{en\}\}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\} \n\n' +
					'\{\{Trad1\|femminile di ' + common.radice + common.principale + ' (sostantivo) \}\}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' : '\{\{Trad1\|\}\}\n' +
					'\:*\{\{en\}\}\: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\}');

			var TestoFS = '== \{\{-it-\}\} == \n' +
				'\{\{-' + common.parte + ' form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'f sing\'\' \{\{Tabs\|' + common.radice + common.principale + '\|' + MP + '\|' + common.radice + realDesinenzaFS + MSFS + '\|' + common.radice + common.desinenzaFP + MP2 + FS2 + FP2 + FSP2 + MSFP + '}} \n' +
				'\n' +
				'# femminile di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' +
				'' + AeSTXTFS + '' +
				''+ SillFS +'' +
				'' + PronFS + '' +
				'{{-etim-}}\n' +
				'\{\{Etim-link\|' + common.radice + common.principale + '\}\}\n'+
				'\n' +
				'{{-trad-}}\n' +
				'' + AeSTRADFS + '';
				
			writeInPage(
				"" + common.radice + common.desinenzaFS + "",
				"" + TestoFS + "",
				"[[" + mw.message( 'ScriptLink' ).escaped() + "|Script]]: " + mw.message( 'FF-Created-FS' ).escaped() + "",
				function() {
					$( '#FSSuccess' ).html( success + ' <a href="/wiki/' + common.radice + common.desinenzaFS + '" id="PageCreated">' + common.radice + common.desinenzaFS + '</a> <a href="/w/index.php?title=' + common.radice + common.desinenzaFS + '&action=edit" id="PageCreatedEdit">(modifica)</a>' );
				}
			);
		}

		// CREAZIONE FEMMINILE SINGOLARE (FORMA ALTERNATIVA)
		if ( $( 'input#CBfs2' ).is( ':checked' ) ) {
				var AeSTXTFS2 = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{-sost form-\|it\}\}\n' +
					'\{\{Pn\}\} \'\'f sing\'\' \n' +
					'\n' +
					'# femminile di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n' : '');

				var SillFS2 = (( $( 'input#CBSillsf2' ).is( ':checked' ) ) ?
					'\{\{-sill-\}\}\n' +
					'; '+common.radiceSill+common.desinenzaSillFS2+'\n\n' : '');
					
				var PronFS2 = (( $( 'input#CBPronfs2' ).is( ':checked' ) && $('#VpronFS2').val() !== '' ) ?
					'\{\{-pron-\}\}\n' +
					'\{\{IPA|'+common.VpronFS2+'\}\}\n\n' : '');

				var AeSTRADFS2 = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{Trad1|femminile di ' + common.radice + common.principale + ' (aggettivo) \}\}\n' +
					'\:*\{\{en\}\}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\} \n\n' +
					'\{\{Trad1\|femminile di ' + common.radice + common.principale + ' (sostantivo) \}\}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' : '\{\{Trad1\|\}\}\n' +
					'\:*\{\{en\}\}\: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\}');

			var TestoFS2 = '== \{\{-it-\}\} == \n' +
				'\{\{-' + common.parte + ' form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'f sing\'\' \{\{Tabs\|' + common.radice + common.principale + '\|' + MP + '\|' + common.radice + realDesinenzaFS + MSFS + '\|' + common.radice + common.desinenzaFP + MP2 + FS2 + FP2 + FSP2 + MSFP + '}} \n' +
				'\n' +
				'# femminile di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' +
				'' + AeSTXTFS2 + '' +
				''+ SillFS2 +'' +
				'' + PronFS2 + '' +
				'{{-etim-}}\n' +
				'\{\{Etim-link\|' + common.radice + common.principale + '\}\}\n'+
				'\n' +
				'{{-trad-}}\n' +
				'' + AeSTRADFS2 + '';
				
			writeInPage(
				"" + common.radice + common.desinenzaFS2 + "",
				"" + TestoFS2 + "",
				"[[" + mw.message( 'ScriptLink' ).escaped() + "|Script]]: " + mw.message( 'FF-Created-FS2' ).escaped() + "",
				function() {
					$( '#FS2Success' ).html( success + ' <a href="/wiki/' + common.radice + common.desinenzaFS2 + '" id="PageCreated">' + common.radice + common.desinenzaFS2 + '</a> <a href="/w/index.php?title=' + common.radice + common.desinenzaFS2 + '&action=edit" id="PageCreatedEdit">(modifica)</a>' );
				}
			);
		}


		// CREAZIONE FEMMINILE PLURALE
		if ( $( 'input#CBfp' ).is( ':checked' ) ) {

				var AeSTXTFP = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{-sost form-\|it\}\}\n' +
					'\{\{Pn\}\} \'\'f pl\'\' \n' +
					'\n' +
					'# femminile plurale di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' : '');
					
				var SillFP = (( $( 'input#CBSillfp' ).is( ':checked' ) ) ?
					'\{\{-sill-\}\}\n' +
					'; '+common.radiceSill+common.desinenzaSillFP+'\n\n' : '');
					
				var PronFP = (( $( 'input#CBPronfp' ).is( ':checked' ) && $('#VpronFP').val() !== '' ) ?
					'\{\{-pron-\}\}\n' +
					'\{\{IPA|'+common.VpronFP+'\}\}\n\n' : '');
					
				var AeSTRADFP = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{Trad1|femminile plurale di ' + common.radice + common.principale + ' (aggettivo) \}\}\n' +
					'\:*\{\{en\}\}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\} \n\n' +
					'\{\{Trad1\|femminile plurale di ' + common.radice + common.principale + ' (sostantivo) \}\}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' : '\{\{Trad1\|\}\}\n' +
					'\:*\{\{en\}\}\: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\}');

			var TestoFP = '== \{\{-it-\}\} == \n' +
				'\{\{-' + common.parte + ' form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'f pl\'\' \{\{Tabs\|' + common.radice + common.principale + '\|' + MP+ '\|' + common.radice + common.desinenzaFS + MSFS + '\|' + common.radice + common.desinenzaFP + MP2 + FS2 + FP2 + FSP2 + '}}\n' +
				'\n' +
				'# femminile plurale di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' +
				'' + AeSTXTFP + '' +
				'' + SillFP + '' +
				'' + PronFP + '' +
				'{{-etim-}}\n' +
				'\{\{Etim-link\|' + common.radice + common.principale + '\}\}\n'+
				'\n' +
				'{{-trad-}}\n' +
				'' + AeSTRADFP + '';

			writeInPage(
				"" + common.radice + common.desinenzaFP + "",
				"" + TestoFP + "",
				"[[" + mw.message( 'ScriptLink' ).escaped() + "|Script]]: " + mw.message( 'FF-Created-FP' ).escaped() + "",
				function() {
					$( '#FPSuccess' ).html( success + ' <a href="/wiki/' + common.radice + common.desinenzaFP + '" id="PageCreated">' + common.radice + common.desinenzaFP + '</a> <a href="/w/index.php?title=' + common.radice + common.desinenzaFP + '&action=edit" id="PageCreatedEdit">(modifica)</a>' );
				}
			);
		}




		// CREAZIONE FEMMINILE PLURALE  (FORMA ALTERNATIVA)
		if ( $( 'input#CBfp2' ).is( ':checked' ) ) {
				var AeSTXTFP2 = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{-sost form-\|it\}\}\n' +
					'\{\{Pn\}\} \'\'f pl\'\' \n' +
					'\n' +
					'# femminile plurale alternativo di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' : '');
					
				var SillFP2 = (( $( 'input#CBSillfp2' ).is( ':checked' ) ) ?
					'\{\{-sill-\}\}\n' +
					'; '+common.radiceSill+common.desinenzaSillFP2+'\n\n' : '');
					
				var PronFP2 = (( $( 'input#CBPronfp2' ).is( ':checked' ) && $('#VpronFP2').val() !== '' ) ?
					'\{\{-pron-\}\}\n' +
					'\{\{IPA|'+common.VpronFP2+'\}\}\n\n' : '');

				var AeSTRADFP2 = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{Trad1|femminile plurale alternativo di ' + common.radice + common.principale + ' (aggettivo) \}\}\n' +
					'\:*\{\{en\}\}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\} \n\n' +
					'\{\{Trad1\|femminile plurale alternativo di ' + common.radice + common.principale + ' (sostantivo) \}\}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' : '\{\{Trad1\|\}\}\n' +
					'\:*\{\{en\}\}\: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\}');

			var TestoFP2 = '== \{\{-it-\}\} == \n' +
				'\{\{-' + common.parte + ' form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'f pl\'\' \{\{Tabs\|' + common.radice + common.principale + '\|' + MP+ '\|' + common.radice + common.desinenzaFS + MSFS + '\|' + common.radice + common.desinenzaFP + MP2 + FS2 + FP2 + FSP2 + '}}\n' +
				'\n' +
				'# femminile plurale alternativo di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n' +
				'' + AeSTXTFP2 + '' +
				'' + SillFP2 + '' +
				'' + PronFP2 + '' +
				'{{-etim-}}\n' +
				'\{\{Etim-link\|' + common.radice + common.principale + '\}\}\n'+
				'\n' +
				'{{-trad-}}\n' +
				'' + AeSTRADFP2 + '';

			writeInPage(
				"" + common.radice + common.desinenzaFP2 + "",
				"" + TestoFP2 + "",
				"[[" + mw.message( 'ScriptLink' ).escaped() + "|Script]]: " + mw.message( 'FF-Created-FP2' ).escaped() + "",
				function() {
					$( '#FP2Success' ).html( success + ' <a href="/wiki/' + common.radice + common.desinenzaFP2 + '" id="PageCreated">' + common.radice + common.desinenzaFP2 + '</a> <a href="/w/index.php?title=' + common.radice + common.desinenzaFP2 + '&action=edit" id="PageCreatedEdit">(modifica)</a>' );
				}
			);
		}


		// CREAZIONE FEMMINILE SINGOLARE E PLURALE
		if ( $( 'input#CBfsp' ).is( ':checked' ) ) {
			var AeSTXTFSP = (( $( 'input#AeS' ).is( ':checked' ) ) ?
				'\{\{-sost form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'f s\'\' e \'\'f pl\'\' \n' +
				'\n' +
				'# femminile di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n' +
				'# femminile plurale di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' : '' );
					
				var SillFSP = (( $( 'input#CBSillfsp' ).is( ':checked' ) ) ?
					'\{\{-sill-\}\}\n' +
					'; '+common.radiceSill+common.desinenzaSillFSP+'\n\n' : '');
					
				var PronFSP = (( $( 'input#CBPronfp' ).is( ':checked' ) && $('#VpronFSP').val() !== '' ) ?
					'\{\{-pron-\}\}\n' +
					'\{\{IPA|'+common.VpronFSP+'\}\}\n\n' : '');

			if ( $( 'input#AeS' ).is( ':checked' ) ) {
				var AeSTRADFSP = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'{{Trad1|femminile di ' + common.radice + common.principale + ' (aggettivo)}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}}\n' +
					'\n' +
					'{{Trad1|femminile plurale di ' + common.radice + common.principale + ' (aggettivo)}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}}\n' +
					'\n' +
					'{{Trad1|femminile plurale di ' + common.radice + common.principale + ' (sostantivo)}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' +
					'\n' +
					'{{Trad1|femminile plurale di ' + common.radice + common.principale + ' (sostantivo)}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' : '{{Trad1|femminile di ' + common.radice + common.principale + '}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}}\n' +
					'\n' +
					'{{Trad1|femminile plurale di ' + common.radice + common.principale + '}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}}');
				
			}
			
			var TestoFSP = '== \{\{-it-\}\} == \n' +
				'\{\{-' + common.parte + ' form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'f s\'\' e \'\'f pl\'\' \{\{Tabs\|' + common.radice + common.principale + '\|' + common.radice + common.desinenzaMP + '\|' + common.radice + common.desinenzaFSP + '\|' + common.radice + common.desinenzaFSP + MP2 + FS2 + FP2 + FSP2 + '}}\n' +
				'\n' +
				'# femminile di \[\[' + common.radice + common.principale + '\]\]\n' +
				'# femminile plurale di \[\[' + common.radice + common.principale + '\]\]\n' +
				'' + AeSTXTFSP + '' +
				'' + SillFSP + '' +
				'' + PronFSP + '' +
				'{{-etim-}}\n' +
				'\{\{Etim-link\|' + common.radice + common.principale + '\}\}\n' +
				'\n' +
				'{{-trad-}}\n' +
				'' + AeSTRADFSP + '';

			writeInPage(
				"" + common.radice + common.desinenzaFSP2 + "",
				"" + TestoFSP + "",
				"[[" + mw.message( 'ScriptLink' ).escaped() + "|Script]]: " + mw.message( 'FF-Created-FSP' ).escaped() + "",
				function() {
					$( '#FSPSuccess' ).html( success + ' <a href="/wiki/' + common.radice + common.desinenzaFSP + '" id="PageCreated">' + common.radice + common.desinenzaFSP + '</a> <a href="/w/index.php?title=' + common.radice + common.desinenzaFSP + '&action=edit" id="PageCreatedEdit">(modifica)</a>' );
				}
			);
		}

		// CREAZIONE FEMMINILE SINGOLARE E PLURALE (FORMA ALTERNATIVA)
		if ( $( 'input#CBfsp2' ).is( ':checked' ) ) {
			var AeSTXTFSP2 = (( $( 'input#AeS' ).is( ':checked' ) ) ?
				'\{\{-sost form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'f s\'\' e \'\'f pl\'\' \n' +
				'\n' +
				'# femminile di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n' +
				'# femminile plurale di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n' : '' );
					
				var SillFSP2 = (( $( 'input#CBSillfsp2' ).is( ':checked' ) ) ?
					'\{\{-sill-\}\}\n' +
					'; '+common.radiceSill+common.desinenzaSillFSP+'\n\n' : '');
					
				var PronFSP2 = (( $( 'input#CBPronfp2' ).is( ':checked' ) && $('#VpronFSP2').val() !== '' ) ?
					'\{\{-pron-\}\}\n' +
					'\{\{IPA|'+common.VpronFSP+'\}\}\n\n' : '');

			if ( $( 'input#AeS' ).is( ':checked' ) ) {
				var AeSTRADFSP2 = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'{{Trad1|femminile alternativo di ' + common.radice + common.principale + ' (aggettivo)}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}}\n' +
					'\n' +
					'{{Trad1|femminile plurale alternativo di ' + common.radice + common.principale + ' (aggettivo)}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}}\n' +
					'\n' +
					'{{Trad1|femminile plurale alternativo di ' + common.radice + common.principale + ' (sostantivo)}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' +
					'\n' +
					'{{Trad1|femminile plurale alternativo di ' + common.radice + common.principale + ' (sostantivo)}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' : '{{Trad1|femminile di ' + common.radice + common.principale + '}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}}\n' +
					'\n' +
					'{{Trad1|femminile plurale alternativo di ' + common.radice + common.principale + '}}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}}');
				
			}
			
			var TestoFSP2 = '== \{\{-it-\}\} == \n' +
				'\{\{-' + common.parte + ' form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'f s\'\' e \'\'f pl\'\' \{\{Tabs\|' + common.radice + common.principale + '\|' + common.radice + common.desinenzaMP + '\|' + common.radice + common.desinenzaFSP + '\|' + common.radice + common.desinenzaFSP + MP2 + FS2 + FP2 + FSP2 + '}}\n' +
				'\n' +
				'# femminile di \[\[' + common.radice + common.principale + '\]\]\n' +
				'# femminile plurale di \[\[' + common.radice + common.principale + '\]\]\n' +
				'' + AeSTXTFSP2 + '' +
				'' + SillFSP2 + '' +
				'' + PronFSP2 + '' +
				'{{-etim-}}\n' +
				'\{\{Etim-link\|' + common.radice + common.principale + '\}\}\n' +
				'\n' +
				'{{-trad-}}\n' +
				'' + AeSTRADFSP2 + '';

			writeInPage(
				"" + common.radice + common.desinenzaFSP2 + "",
				"" + TestoFSP2 + "",
				"[[" + mw.message( 'ScriptLink' ).escaped() + "|Script]]: " + mw.message( 'FF-Created-FSP2' ).escaped() + "",
				function() {
					$( '#FSP2Success' ).html( success + ' <a href="/wiki/' + common.radice + common.desinenzaFSP2 + '" id="PageCreated">' + common.radice + common.desinenzaFSP2 + '</a> <a href="/w/index.php?title=' + common.radice + common.desinenzaFSP2 + '&action=edit" id="PageCreatedEdit">(modifica)</a>' );
				}
			);
		}


		//SOLO PLURALE

				var AeSTXTP = (( $( 'input#AeS' ).is( ':checked' ) === true) ?
				'\n\{\{-sost form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'' + common.PluraleGenere + ' pl\'\' \n' +
				'\n' +
				'# plurale di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' : '');
					
				var SillP = (( $( '#radicePluraleSill').val() !== '' ) ?
					'\{\{-sill-\}\}\n' +
					'; '+common.radicePluraleSill+common.DesinenzaSillPlurale+'\n\n' : '');
					
				var PronP = (( $( '#VpronPlurale').val() !== '' ) ?
					'\{\{-pron-\}\}\n' +
					'\{\{IPA|'+common.VpronPlurale+'\}\}\n\n' : '');

				var AeSTRADP = (( $( 'input#AeS' ).is( ':checked' ) ) ?
					'\{\{Trad1|plurale di ' + common.radice + common.principale + ' (aggettivo) \}\}\n' +
					'\:*\{\{en\}\}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\} \n\n' +
					'\{\{Trad1\|plurale di ' + common.radice + common.principale + ' (sostantivo) \}\}\n' +
					':*{{en}}: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'{{Trad2}} \n' : '\{\{Trad1\|\}\}\n' +
					'\:*\{\{en\}\}\: <!-- inserire dopo i : la/le traduzione/ni nelle altre lingue -->\n' +
					'\{\{Trad2\}\}');

			
			if ( $( 'input#CBGenere' ).is( ':checked' ) ) {
			var TestoPlurale = '== \{\{-it-\}\} == \n' +
				'\{\{-' + common.parte + ' form-\|it\}\}\n' +
				'\{\{Pn\}\} \'\'' + common.PluraleGenere + ' pl\'\' \n' +
				'\n' +
				'# plurale di \[\[' + common.radice + common.principale + '#Italiano|'+ common.radice + common.principale +'\]\]\n\n' +
				'' + AeSTXTP + '' +
				'' + SillP + '' +
				'' + PronP + '' +
				'{{-etim-}}\n' +
				'\{\{Etim-link\|' + common.radice + common.principale + '\}\}\n' +
				'\n' +
				'{{-trad-}}\n' +
				'' + AeSTRADP + '';

			writeInPage(
				"" + common.radice + common.DesinenzaPlurale + "",
				"" + TestoPlurale + "",
				"[[" + mw.message( 'ScriptLink' ).escaped() + "|Script]]: " + mw.message( 'PL-Created' ).escaped() + "",
				function() {
					$( '#PluraleSuccess' ).html( success + ' <a href="/wiki/' + common.radice + common.DesinenzaPlurale + '" id="PageCreated">' + common.radice + common.DesinenzaPlurale + '</a></a> <a href="/w/index.php?title=' + common.radice + common.DesinenzaPlurale + '&action=edit" id="PageCreatedEdit">(modifica)</a>' );
				}
			);
		}
	}
console.log('Forme Flesse V2.0.1'); 
	
}( mediaWiki, jQuery ) );
//</nowiki>