Differenze tra le versioni di "MediaWiki:Gadget-Ricetta.js"

fixes
(Migration: appendCSS → mw.util.addCSS; addOnloadHook → $; addPortletLink → mw.util.addPortletLink)
(fixes)
function creazionericettaForm() {
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 ricetta'));
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/thumb/1/1b/Example_recipe.svg/221px-Example_recipe.svg.png" style="border:1px dashed red;" /><br>'
+ '<b style="color:#990000;">'
+ '<br>Descrizione aspetto, indicazione periodo o ricorrenza. '
+ '<br> '
+ '<br>== Ingredienti == '
+ '<br>per \'\'\'' + queryString('persone') + '\'\'\' persone ';
if (queryString('ing1') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant1').replace(/\+/g," ") + ' ' + queryString('mis1') + ' di ' + queryString('ing1').replace(/\+/g," ");
}
if (queryString('ing2') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant2').replace(/\+/g," ") + ' ' + queryString('mis2') + ' di ' + queryString('ing2').replace(/\+/g," ");
}
if (queryString('ing3') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant3').replace(/\+/g," ") + ' ' + queryString('mis3') + ' di ' + queryString('ing3').replace(/\+/g," ");
}
if (queryString('ing4') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant4').replace(/\+/g," ") + ' ' + queryString('mis4') + ' di ' + queryString('ing4').replace(/\+/g," ");
}
if (queryString('ing5') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant5').replace(/\+/g," ") + ' ' + queryString('mis5') + ' di ' + queryString('ing5').replace(/\+/g," ");
}
if (queryString('ing6') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant6').replace(/\+/g," ") + ' ' + queryString('mis6') + ' di ' + queryString('ing6').replace(/\+/g," ");
}
if (queryString('ing7') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant7').replace(/\+/g," ") + ' ' + queryString('mis7') + ' di ' + queryString('ing7').replace(/\+/g," ");
}
if (queryString('ing8') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant8').replace(/\+/g," ") + ' ' + queryString('mis8') + ' di ' + queryString('ing8').replace(/\+/g," ");
}
if (queryString('ing9') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant9').replace(/\+/g," ") + ' ' + queryString('mis9') + ' di ' + queryString('ing9').replace(/\+/g," ");
}
if (queryString('ing10') !== "") {
bcon.innerHTML += '<b style="color:#990000;"> <br>* ' + queryString('quant10').replace(/\+/g," ") + ' ' + queryString('mis10') + ' di ' + queryString('ing10').replace(/\+/g," ");
}
bcon.innerHTML += '<b style="color:#990000;"> <br>'
+ '<br>' + queryString('consigli').replace(/\%3D/g,"=").replace(/\+/g," ")
+ '<br>'
+ '<br>{{Categorie della ricetta';
if ((queryString('regionali') !== "") && (queryString('regionali_cb') == "|Ricette regionali-")) {
bcon.innerHTML += '<b style="color:#990000;">'+ queryString('regionali_cb') + '' + queryString('regionali').replace(/\%3D/g,"=").replace(/\+/g," ");
}
if ((queryString('mondo') !== "") && (queryString('mondo_cb') == "|Ricette dal mondo-")) {
bcon.innerHTML += '<b style="color:#990000;">'+ queryString('mondo_cb') + '' + queryString('mondo').replace(/\%3D/g,"=").replace(/\+/g," ");
}
bcon.innerHTML += '<b style="color:#990000;"> }}'
+ '<br> '
+ '<br> <b style="color:#12831d;">Adesso copia tutto il testo ed incollalo nella pagina [[<a href="http://it.wikibooks.org/w/index.php?title=Libro_di_cucina/Ricette/' + queryString('pagina') + '&action=edit">' + queryString('pagina').replace(/\+/g," ") + '</a>]]'
+ '<br>';
}
+ '<label for="mondo">inserisci il nome del paese: </label><input id="mondo" type="text" name="mondo" /><p></p>'
+ '<input type="submit" value="Genera" name="submit" />'
+ '</fieldset></form>';
mw.util.addCSS('#content {visibility:visible;}');
if(queryString('regionali')) document.getElementById('regionali').value = queryString('regionali');
if(queryString('mondo')) document.getElementById('mondo').value = queryString('mondo');
;
}