Difarense intrà łe version de "MediaWiki:Gadget-saveandedit.js"

Contenuto cancellato Contenuto aggiunto
Pàjina creada co «//en:User:Mabdul/saveandedit.js //adding a new buttom if(document.getElementsByClassName('editButtons')[0]!='undefined') { document.getElementsByClassName('editButtons...»
 
p Maintenance: Replacing legacy global variable (phab:T72470)
Riga 19:
//get the token
var req = sajax_init_object();
req.open("GET", wgScriptPath + "/api.php?action=query&prop=info&indexpageids=1&intoken=edit&format=json&titles="+encodeURIComponent(mw.config.get('wgPageName')), false);
req.send(null);
var response = eval('(' + req.responseText + ')');
Riga 44:
if(section!="no")
params += "&section="+section;
params += "&format=json&token="+encodeURIComponent(token)+"&title="+encodeURIComponent(mw.config.get('wgPageName'))+"&text="+encodeURIComponent(newtext)+"&notminor="+notminor+"&summary="+encodeURIComponent(summary);
url = wgScriptPath + "/api.php";
req.open("POST", url, true);
Riga 59:
} else {
//or handle out the error message
document.getElementById('saveandedit_status').innerHTML = '<div style="color:red"><b>Edit failed on <a href="'+wgArticlePath.replace("$1", encodeURI(mw.config.get('wgPageName')))+'" title="'+mw.config.get('wgPageName')+'">'+mw.config.get('wgPageName')+'</a></b></div>. Best try it again (<b>Don\'t forget to copy the text</b>). Error info:' +response['error']['code'] + ' : ' + response['error']['info'];
}
}
catch(err) {
document.getElementById('saveandedit_status').innerHTML = '<div style="color:red"><b>Edit failed on <a href="'+wgArticlePath.replace("$1", encodeURI(mw.config.get('wgPageName')))+'" title="'+mw.config.get('wgPageName')+'">'+mw.config.get('wgPageName')+'</a></b></div>';
}
delete req;
Traesto fora da Wikipèdia - L'ençiclopedia łìbara e cołaboradiva in łéngua Vèneta "https://vec.wikipedia.org/wiki/MediaWiki:Gadget-saveandedit.js"