Wikipedia:Monobook.js/MonobookCompleto.js/Monobook: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
Nessun oggetto della modifica |
||
Riga 868:
if (typeof(wikEd) != "undefined" && wikEd && wikEd.useWikEd)
WikEdUpdateFrame();
}▼
// Aggiunge il link "Novita'" nella barra superiore▼
// Apre gli "Osservati Speciali" mostrando solo le modifiche avvenute dopo l'ultima volta che ci sei passato▼
if (mustLoad("since"))▼
function addSince(){▼
var watchlist = document.getElementById('pt-watchlist');▼
var newpt = document.createElement('li');▼
var link = document.createElement('a');▼
link.id = 'listSince';▼
link.href = '#modifiche da...';▼
var fixLinkHref = function () {▼
// Leggi il cookie▼
var then = GetCookie('wikiSince');▼
if (then == '') // Se il cookie non esiste▼
then = +(new Date()) - (1000 * 60 * 60 * 24 * 3); // visualizza gli ultimi tre giorni▼
var url = mw.config.get("wgServer") + '/wiki/Speciale:OsservatiSpeciali';▼
var days = ( +(new Date()) - then )/(1000 * 60 * 60 * 24); // trasforma i millisecondi in giorni▼
this.href = url + '?days=' + days;▼
return true;▼
};▼
link.onclick = fixLinkHref;▼
link.onmousedown = fixLinkHref;▼
// Crea la stringa mostrata a video▼
link.appendChild(document.createTextNode("Novità"));▼
// Se siamo sugli Osservati Speciali▼
if (wgCanonicalSpecialPageName && wgCanonicalSpecialPageName == "Watchlist")▼
{▼
// Aggiorna il cookie▼
var cookieExpire = new Date(); // scadenza del cookie▼
cookieExpire.setTime(cookieExpire.getTime() + (30 * 24 * 60 * 60 * 1000)); // il cookie scade dopo un mese▼
SetCookie('wikiSince', +(new Date()), cookieExpire.toGMTString(), '/');▼
}▼
// just one little ID attribute would be _so_ nice...▼
newpt.appendChild(link);▼
watchlist.parentNode.insertBefore(newpt, watchlist.nextSibling);▼
}
Riga 4 045 ⟶ 4 086:
newpt.appendChild(newa);
myprefs.parentNode.insertBefore(newpt, myprefs);
▲}
▲// Aggiunge il link "Novita'" nella barra superiore
▲// Apre gli "Osservati Speciali" mostrando solo le modifiche avvenute dopo l'ultima volta che ci sei passato
▲if (mustLoad("since"))
▲function addSince(){
▲ var watchlist = document.getElementById('pt-watchlist');
▲ var newpt = document.createElement('li');
▲ var link = document.createElement('a');
▲ link.id = 'listSince';
▲ link.href = '#modifiche da...';
▲ var fixLinkHref = function () {
▲ // Leggi il cookie
▲ var then = GetCookie('wikiSince');
▲ if (then == '') // Se il cookie non esiste
▲ then = +(new Date()) - (1000 * 60 * 60 * 24 * 3); // visualizza gli ultimi tre giorni
▲ var url = mw.config.get("wgServer") + '/wiki/Speciale:OsservatiSpeciali';
▲ var days = ( +(new Date()) - then )/(1000 * 60 * 60 * 24); // trasforma i millisecondi in giorni
▲ this.href = url + '?days=' + days;
▲ return true;
▲ };
▲ link.onclick = fixLinkHref;
▲ link.onmousedown = fixLinkHref;
▲ // Crea la stringa mostrata a video
▲ link.appendChild(document.createTextNode("Novità"));
▲ // Se siamo sugli Osservati Speciali
▲ if (wgCanonicalSpecialPageName && wgCanonicalSpecialPageName == "Watchlist")
▲ {
▲ // Aggiorna il cookie
▲ var cookieExpire = new Date(); // scadenza del cookie
▲ cookieExpire.setTime(cookieExpire.getTime() + (30 * 24 * 60 * 60 * 1000)); // il cookie scade dopo un mese
▲ SetCookie('wikiSince', +(new Date()), cookieExpire.toGMTString(), '/');
▲ }
▲ // just one little ID attribute would be _so_ nice...
▲ newpt.appendChild(link);
▲ watchlist.parentNode.insertBefore(newpt, watchlist.nextSibling);
}
|