Utente:Salvatore Ingala/commandline.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
mNessun oggetto della modifica |
mNessun oggetto della modifica |
||
Riga 39:
function anno(){
var today = new Date(); return today.getYear()+1900;
}▼
//Prova a completare string usando dict come dizionario.
//Restituisce -1 se c'è ambiguità, 0 se non trova nessuna corrispondenza, o la stringa completa se trova una sola occorrenza
function autoComplete(dict, string){▼
var found = ''▼
for (var x in dict)▼
if (x.indexOf(string) == 0)▼
if (found == '')▼
found = x;▼
else {▼
return -1;▼
}▼
if (found != '')▼
return found;▼
return 0;▼
}
//Prova ad auto-completare l'argomento usando arrayArgument[] come dizionario;
//In caso di fallimento restituisce arg
function autoCompleteArgument(arg){
var completed = autoComplete(arrayArgument, arg);
if ((completed == -1) || (complete == 0))
return arg;
else
return completed;
}
Riga 74 ⟶ 100:
wpTextbox1=document.getElementById("wpTextbox1");
if (wpTextbox1 == null) return;
TimenPr('{{A|motivo='+(getArg("Motivo"))+'|argomento='+(autoCompleteArgument(getArg("Argomento")))+'|mese='+mese()+' '+anno()+'|firma=~~~~}}\n');
TimenSA('+da aiutare; '); TimenME();
}
Riga 81 ⟶ 107:
wpTextbox1=document.getElementById("wpTextbox1");
if (wpTextbox1 == null) return;
TimenPr('{{W|argomento='+(autoCompleteArgument(getArg("Argomento")))+'|mese='+mese()+' '+anno()+'|firma=~~~~}}\n');
TimenSA('+wikificare; '); TimenME();
}
Riga 88 ⟶ 114:
wpTextbox1=document.getElementById("wpTextbox1");
if (wpTextbox1 == null) return;
TimenPr('{{E|'+(getArg("Motivo"))+'|'+(autoCompleteArgument(getArg("Argomento")))+'|'+mese()+' '+anno()+'|~~~~}}\n');
TimenSA('+avviso enciclopedicità dubbia; '); TimenME();
}
Riga 95 ⟶ 121:
wpTextbox1=document.getElementById("wpTextbox1");
if (wpTextbox1 == null) return;
TimenPr('{{P|motivo='+(getArg("Motivo"))+'|argomento='+(autoCompleteArgument(getArg("Argomento")))+'|mese='+mese()+' '+anno()+'|firma=~~~~}}\n');
TimenSA('+avviso nNPOV; '); TimenME();
}
Riga 102 ⟶ 128:
wpTextbox1=document.getElementById("wpTextbox1");
if (wpTextbox1 == null) return;
TimenPr('{{C|motivo='+(getArg("Motivo"))+'|argomento='+(autoCompleteArgument(getArg("Argomento")))+'|mese='+mese()+' '+anno()+'|firma=~~~~}}\n');
TimenSA('+da controllare; '); TimenME();
}
Riga 109 ⟶ 135:
wpTextbox1=document.getElementById("wpTextbox1");
if (wpTextbox1 == null) return;
var argomento = autoCompleteArgument(getArg("Argomento"));
TimenPr('{{S' + (((argomento != null)&&(argomento!='')) ? ('|' + argomento + '}}\n') : '}}\n'));
TimenSA('+stub; '); TimenME();
Riga 269 ⟶ 295:
if (wpTextbox1 == null) return;
document.getElementById("wpDiff").click();
▲}
▲function autoComplete(dict, string){
▲ var found = ''
▲ for (var x in dict)
▲ if (x.indexOf(string) == 0)
▲ if (found == '')
▲ found = x;
▲ else {
▲ return -1;
▲ }
▲ if (found != '')
▲ return found;
▲ return 0;
}
|