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

m
nessun oggetto della modifica
mNessun oggetto della modifica
mNessun oggetto della modifica
Riga 121:
if (start < end) t = textbox.value.slice(start, end);
else t = textbox.value;
t = t.replace(/\n==/, "__TOC__\n==");
t = t.replace(/\[\[ ??categor(?:ia|y):.+?\]\]/gi, "");
t = t.replace(/\[\[\w\w:.+?\]\]/gi, ""); // rimuove interlink
Line 131 ⟶ 130:
 
function quickpreviewRequest(text) {
var t = text.split(/[^=]\n{2}/)[0];
const max = 700;
var t = text.split(/\n{2}/)[0];
if (t.length > max) t = t.slice(0, max);
var r = text.slice(t.length);
if (r.slice(0,1) == '\n' && r.slice(1,2) != '\n') r.replace(/\n/, "<br />");
t = t.replace(/\n/g, "%0A");
t = t.replace(/&/g, "%26");
Line 141 ⟶ 139:
var id = setTimeout(function() { httpRequest.abort(); alert("Errore: il server non risponde"); document.getElementsByTagName('body')[0].style.cursor = 'auto';}, 30000);
httpRequest.onreadystatechange = function () { quickpreviewWrite(httpRequest, r, id); };
const url = wgServer + "/api.php?action=parse&title=" + encodeURI(wgPageName) + "&format=xml&prop=text&text=__NOTOC__ __NOEDITSECTION__ %0A";
httpRequest.open('GET', url + t, true);
httpRequest.send('');
0

contributi