Discussioni MediaWiki:Gadget-FasiAvanzamento.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
G4 (discussione | contributi) |
G4 (discussione | contributi) |
||
Riga 1: | Riga 1: | ||
Curiosavo qui in giro e ho trovato questo script. A titolo di prova, qualcuno potrebbe cambiare la funzione processRequest() con questa? |
|||
<source lang="javascript"> |
|||
function processRequest() |
|||
{ |
|||
if(this.xhttpreq.readyState == 4) { |
|||
var txtresp = this.xhttpreq.responseText; |
|||
var avanzoregexp = /\{\{[Aa]vanzamento\|(\d{1,3})%(\|(.*))?\}\}/; |
|||
var match = avanzoregexp.exec(txtresp); |
|||
if(match) |
|||
{ |
|||
var avanzamento = match[1]; |
|||
var data = null; |
|||
if(match.length == 3) |
|||
{ |
|||
data = match[2]; |
|||
} |
|||
this.onAvanzoCatched(this.currentPage, avanzamento, data); |
|||
} |
|||
this.avanzaCoda(); |
|||
} |
|||
} |
|||
</source> |
|||
--[[Discussioni utente:G4|'''G''']] · [[Utente:G4|'''4° è meglio''']] 18:34, 19 gen 2008 (CET) |