Utente:Salvatore Ingala/commandline.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m obsoleto
funzione trim inclusa in JS, -funzione banale, -globali
Riga 178:
return str;
}
 
//Rimuove i blank spaces iniziali e finali
function cmdTrim(str){return str.replace(/^\s+|\s+$/, '');}
 
function cmdGetPageTitle(){ return wgPageName; }
 
//Funzioni di Timendum
Riga 417 ⟶ 412:
//L'esecuzione ripartirà solo alla pagina title (quella corrente se title non viene fornito)
function cmdSaveCmdLine(title){
if(typeof(title) == 'undefined') title = cmdGetPageTitlemw.config.get('wgPageName');
 
var c = "";
Riga 455 ⟶ 450:
cmdline_next_argument--;
cmdSaveCmdLine();
___location.href = mw.config.get('wgServer') + "/w/index.php?title=" + encodeURIComponent(mw.config.get('wgPageName')) + "&action=edit";
return true;
}
Riga 541 ⟶ 536:
function cmd_purge(){
cmdSaveCmdLine();
___location.href=mw.config.get('wgServer')+mw.config.get('wgScriptPath')+"/index.php?title="+mw.config.get('wgPageName')+"&action=purge";
}
 
Riga 628 ⟶ 623:
cmdSaveCmdLine(dst.replace(/ /g, "_"));
 
___location.href = mw.config.get('wgServer') + "/w/index.php?title=" + encodeURIComponent(dst) + "&action=" + action + fa;
cmd_stop();
}
Riga 746 ⟶ 741:
var dst = cmdGetArg("Label di destinazione:");
while(cmdline_command_array[cmdline_next_argument]){
var b1 = cmdTrim(cmdline_command_array[cmdline_next_argument].trim();
var b2 = cmdTrim(cmdline_command_array[cmdline_next_argument+1].trim();
if((b1 == 'label') && (b2 == dst)){
cmdline_next_argument += 2; return;
Riga 883 ⟶ 878:
//Trasformiamo Allpages in una normale lista
res = text;
if (mw.config.get('wgPageName') == 'Speciale:TutteLePagine')
res = res.replace(/<tr>|<\/tr>|/g, "").replace(/<td>/g, "<li>").replace(/<\/td>/g, "</li>");
 
Riga 964 ⟶ 959:
cmd = " " + cmd + " "; //un carattere qualsiasi diverso da '$'
 
cmdSetVar("title", cmdGetPageTitlemw.config.get('wgPageName'), false);
cmdSetVar("plaintitle", cmdGetPageTitlemw.config.get('wgPageName').replace(/_/g," "), false);
cmdSetVar("currentyear", "" + cmdAnno(), false);
cmdSetVar("currentmonthname", "" + cmdMese(), false);
Riga 1 026 ⟶ 1 021:
while((command = cmdline_command_array[cmdline_next_argument++]) != null){
 
command = cmdPreprocessBlock(cmdTrim(command.trim());
if (command.indexOf("#") != -1){
cmdline_command_array = (command + cmdReencodeCmdLine()).split("#");
Riga 1 033 ⟶ 1 028:
}
 
command = cmdTrim(command.trim();
 
//Modifiers
Riga 1 114 ⟶ 1 109:
commandline = commandline.substring(4);
 
if (cmdGetPageTitlemw.config.get('wgPageName') == title){
cmdDeleteCookie("cmdAutoRunPage"+i);
cmdDeleteCookie("cmdAutoRunCommand"+i);