Utente:Sanjilops/monobook.js: differenze tra le versioni

m
nessun oggetto della modifica
mNessun oggetto della modifica
mNessun oggetto della modifica
Riga 243:
function addThumb (link, file) {
var httpRequest = createRequest();
var id = setTimeout(function() { httpRequest.abort();}, 30000);
alert(file"Timeout");
httpRequest.abort();}, 30000);
httpRequest.onreadystatechange = function () { Do(httpRequest, id, link, file); return; }
httpRequest.open('GET', wgServer + wgScriptPath + "/api.php?action=imagethumb&format=xml&tiwidth=50&tiimage=" + encodeURIComponent(file.replace(/^File:/i, '')), true);
Line 253 ⟶ 255:
if (o.readyState != 4) return;
clearTimeout(id);
if (o.status != 200) { alert("Status:" + o.status); return; }
if (o.responseXML == null) return;
if (o.responseXML.normalize) o.responseXML.normalize();
alert(o.responseXML);
if (o.responseXML.getElementsByTagName('thumb')[0] == undefined) return false;
alert(o.responseXML.getElementsByTagName('thumb')[0]);
var url = o.responseXML.getElementsByTagName('thumb')[0].getAttribute("url");
alert(url);
if (url == null) return false;
alert(file);
var img = document.createElement('img');
img.src = url;
0

contributi