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.
// <pre> 
$(function() {
  mw.util.addPortletLink('p-tb','/wiki/Speciale:CreazioneRapida','Creazione rapida');
});

if(wgPageName == 'Speciale:CreazioneRapida') {
  document.title = 'Creazione rapida';
  appendCSS('#content {visibility:hidden;}');
  addOnloadHook(creazionerapidaForm);
}

function creazionerapidaForm() {
  var con = (document.getElementById('content')) ? document.getElementById('content') : document.getElementById('mw_content')
  var bcon = (document.getElementById('bodyContent')) ? document.getElementById('bodyContent') : document.getElementById('mw_contentholder')
  var fh = getElementsByClassName(con,'h1','firstHeading')[0];
  while(fh.firstChild) fh.removeChild(fh.firstChild)
  fh.appendChild(document.createTextNode('Creazione rapida'));
  for(var i=0;i<bcon.childNodes.length;i++) {
    bcur = bcon.childNodes[i];
    if(bcur.id != 'siteSub' && bcur.id != 'contentSub' && bcur.className != 'visualClear') {
      while(bcur.firstChild) bcur.removeChild(bcur.firstChild)
      if(bcur.nodeType == 3) bcur.nodeValue = '';
    }
  }
  if(queryString('submit')) {
    bcon.innerHTML += '<img src="http://upload.wikimedia.org/wikipedia/commons/5/52/Nuvola_apps_edu_miscellaneous.png" style="border:1px dashed red;" /><br>'
    + '<b style="color:#990000;">{{-' + queryString('lingua') + '-}}
{{-|' + queryString('parte') + '|' + queryString('lingua') + '}}'
    + '<br>{{pn}} \'\' ' + queryString('genere') + ' \'\' '
    + '<br> '
    + '<br># ' + queryString('definizione')
    + '<br> '
    + '<br>{{-hyph-}}'
    + '<br>; ' + queryString('sillabazione').replace(/\ /g," | ")
    + '<br> '
    + '<br>{{-etim-}}'
    + '<br>' + queryString('etim')
    + '<br> '
    + '<br>{{-ref-}}'
    + '<br>' + queryString('ref')
    + '<br> '
    + '<br> '
    + '<br>adesso copia tutto il testo ed incollalo nella pagina [[<a href="http://it.wiktionary.org/w/index.php?title=' + queryString('pagina') + '&action=edit">' + queryString('pagina') + '</a>]]'
    + '<br>' 
  }

  //Note: I was writing this as nice dom, but since it is for a gag anyways, it is too much work'
  bcon.innerHTML += '<form method="get" action="' + mw.config.get('wgServer') + mw.config.get('wgScript') + '"><input name="title" type="hidden" value="Speciale:CreazioneRapida" />'
    + '<fieldset><legend>Creazione rapida delle pagine per utenti inesperti</legend>'
    + '<label for="pagina">Titolo della pagina: </label><input id="pagina" type="text" name="pagina" /><p></p>'
    + '<label for="lingua"> Lingua: </label><select id="lingua" name="lingua">'
    + '<option selected="selected" value="it">Italiano</option><option value="fr">Francese</option><option value="de">Tedesco</option>'
    + '<option value="en">Inglese</option><option value="es">Spagnolo</option><option value="pt">Portoghese</option></select>'
    + '<label for="parte"> Parte del discorso: </label><select id="parte" name="parte">'
    + '<option value="agg">Aggettivo</option><option value="noun">Sostantivo</option><option value="verb">Verbo</option>'
    + '<option value="agg_form">Aggettivo forma flessa</option><option value="noun_form">Sostantivo forma flessa</option><option selected="selected" value="verb_form">Verbo forma flessa</option>'
    + '<option value="abbr">Abreviazione</option><option value="comp">Complementi</option><option value="avv">Avverbi</option><option value="phrase">Espressioni</option></select>'
    + '<input id="genere_m" value="m" name="genere" type="radio" checked="checked" /><label for="genere_m">Maschile</label>'
    + '<input id="genere_f" value="f" name="genere" type="radio" /><label for="genere_f">Femminile</label> ' 
    + '<small> (<a href="http://it.wiktionary/wiki/wikizionario:Manuale di stile">help</a>)</small><p></p>'
    + '<label for="etim"> Conosci l\'etimologia?: </label><input id="etim_n" value="{{Noetim|' + queryString('lingua') + '}}" name="etim" type="radio" checked="checked"  /><label for="etim_n">No</label>'
    + '<input id="etim_s" value="scrivi qui l\'etimologia" name="etim" type="radio" /><label for="etim_s">Si</label><p></p>'
    + '<label for="definizione">Definizione <small> (racchiudi tra doppie parentesi quadre le parole difficili/chiave; es [[eucariota]]):</small> </label><input id="definizione" type="text" name="definizione" value=""/><p></p>'
    + '<label for="sillabazione">Sillabazione <small>(dividi ogni sillaba con uno spazio)</small>: </label><input id="sillabazione" type="text" name="sillabazione" value=""/><p></p>'
    + '<label for="ref">Conosci una fonte?: </label><input id="ref_n" value="{{Noref|' + queryString('lingua') + '}}" name="ref" type="radio" /><label for="ref_n">No</label>'
    + '<input id="ref_s" value="* {{Fonte|' + queryString('fonti') + '}}" name="ref" type="radio" checked="checked" /><label for="ref_s">Si:</label>' 
    + '<label for="fonti"> Scegli la fonte: </label><select id="fonti" name="fonti">'
    + '<option value="dem">De Mauro Paravia</option><option value="dizit">Il dizionario italiano</option><option value="verb">Verbo</option>'
    + '<option value="trec">Vocabolario Treccani</option><option value="sape">Sapere.it</option><option selected="selected" value="hoep">Hoepli Gabrielli</option>'
    + '<option value="0">0</option><option value="480">480</option><option value="2000">2000</option><option value="60000">60,000</option></select><p></p>'
    + '<input type="submit" value="Genera" name="submit" />'
    + '</fieldset></form>'
  appendCSS('#content {visibility:visible;}');

  if(queryString('pagina')) document.getElementById('pagina').value = queryString('pagina');
  if(queryString('definizione')) document.getElementById('definizione').value = queryString('definizione');
  if(queryString('sillabazione')) document.getElementById('sillabazione').value = queryString('sillabazione');
;
}

function appendCSS(text) {
  var s = document.createElement('style');
  s.type = 'text/css';
  s.rel = 'stylesheet';
  if (s.styleSheet) s.styleSheet.cssText = text //IE
  else s.appendChild(document.createTextNode(text + '')) //Safari sometimes borks on null
  document.getElementsByTagName('head')[0].appendChild(s);
  return s;
}

function queryString(p) {
  var re = RegExp('[&?]' + p + '=([^&]*)');
  var matches;
  if (matches = re.exec(document.location)) {
    try { 
      return decodeURI(matches[1]).replace(/\+/g," ");
    } catch (e) {
    }
  }
  return null;
}

//</pre>