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

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
m Test Wiso
Riga 1:
var toLoad = "purg led ns0 lks tabs chat nav stru unw allp tbar avan cwtch popup nms cmd qed wed since goo rch edt ver vfol";
//<pre>
// Elenco dei tool da caricare. NB: La stringa deve iniziare e finire con uno spazio
 
var toLoad = "purg led ns0 lks orol tabs nav stru unw allp tbar avan cwtch popup nms cmd qed wed since goo ver vpop vfol";
 
var nomeBot="JaloBot";
 
 
if(typeof mbTrustedPages == 'undefined') mbTrustedPages = new Object();
mbTrustedPages['Utente:Salvatore_Ingala/Orfanizza'] = true;
 
 
//Monobook Modulare ver.4.2.6.
//Lancia il vero monobook
// Vedi [[Wikipedia:Monobook.js/MonobookCompleto.js]]
//
//document.writeln('<script type="text/javascript" src="/w/index.php?title=Wikipedia:Monobook.js/MonobookCompleto.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
//JUST FOR DEBUG
document.writeln('<script type="text/javascript" src="/w/index.php?title=Utente:Jalo/monobook.js/test&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
//************SET STATUS***********
//CONFIGURAZIONE POPUP
if (window.addEventListener) window.addEventListener("load",setLogonStatus,false);
popupDelay = 2; // aspetta 2 secondi
else if (window.attachEvent) window.attachEvent("onload",setLogonStatus);
popupRedlinkRemoval = true; // elimina i collegamenti a link rossi
else
popupQueriedRevertSummary = "Rollback da popup. Ripristinata la versione di $3";
{
popupRedlinkSummary = "Eliminato link rosso: %s";
window.previousLoadFunction = window.onload;
popupOnEditSelection = false;
window.onload = function()
{
window.previousLoadFunction();
setLogonStatus();
}
}
 
// adds tab "set status"
//Mostra i Tatoo
function setLogonStatus()
document.writeln('<script type="text/javascript" src="/w/index.php?title=Utente:Jalo/Tatoo&action=raw&ctype=text/javascript&dontcountme=s"></script>');
{
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
addlilink(tabs,'javascript:setCurrentStatus()','set status', 'pb-sstatus');
}
function setCurrentStatus()
{
Greeter = " Hai chiesto di cambiare il tuo logon status\n. " +
" Scegli il nuovo stato dalla lista ";
var div = document.createElement('div');
div.id = 'inlinePopupDiv';
div.style.position = 'absolute';
div.style.zIndex = 1000;
div.style.left = '5px';
div.style.top = '5px';
div.style.backgroundColor = '#FFFFFF';
div.style.borderStyle = 'solid';
div.style.borderWidth = ' medium';
div.style.borderColor = '#000000';
 
var top = document.createElement('div');
//JUST FOR DEBUG
top.id = 'inlinePopupTop';
//document.writeln('<script type="text/javascript" src="/w/index.php?title=Utente:Jalo/Sandbox&action=raw&ctype=text/javascript&dontcountme=s"></script>');
top.style.textAlign = 'right';
top.style.margin = '8px';
top.style.backgroundColor = '#DDDDDD';
 
var a = document.createElement('a');
//TASTI PERSONALI
a.appendChild( document.createTextNode('Close'));
addLoadEvent( function ()
a.href = "javascript:void RemoveNode('inlinePopupDiv')";
{
a.style.margin = '8px';
addToolbarButton('tb-firma', 'javascript:addTextAtCursor("~~~~","","",4)',
'http://upload.wikimedia.org/wikipedia/commons/d/d1/Button_mysignature.png', 'My sign', 'Jalo');
 
top.appendChild(a);
daInserire = "==Cronologia precedente alla pulizia dai copyviol==\n{{cassetto\n|titolo=cronologia\n|testo=<pre>\n</pre>}}";
addToolbarButton('tb-cass', 'javascript:addText(daInserire, "Cronologia pre-pulizia copyviol", 1)',
'http://upload.wikimedia.org/wikipedia/commons/c/cd/Button_vote_deletion.png', '[pre-copyviol]', 'Cronologia pre-copyviol');
});
 
div.appendChild(top);
 
var greet = document.createElement('p');
greet.innerHTML = Greeter;
div.appendChild(greet);
 
var form = document.createElement('form');
form.name = "popupForm";
var p = document.createElement('p');
 
p.appendChild(document.createTextNode('Stato:'));
//Speedy Google Search
addOnloadHook(function(){
var sel = document.createElement('select');
var listener = function(e){
e = (e) ? e : ((window.event) ? windowsel.eventname := null)'popupSelect';
if(e && e sel.ctrlKey){size = 1;
var option;
if(navigator.appName=='Microsoft Internet Explorer' && navigator.userAgent.indexOf("Opera")==-1) //IE
var t = document.selection.createRange().text;
option = new Option("in",' ');
else //Non-IE
option.value = "in";
var t = document.getSelection().toString();
sel.options[sel.options.length] = option;
t = t.replace(/^\s+/, '').replace(/\s+$/, ''); //trim
var q = t.indexOf('"') == -1 ? '"' : '';
if(t)
window.open("http://www.google.com/search?q=" + q + encodeURIComponent(t) + q);
}
}
if (window.addEventListener)
window.addEventListener('mouseup', listener, false); //Non-IE
else
document.onmouseup = listener; //IE
});
 
option = new Option("busy",' ');
option.value = "busy";
sel.options[sel.options.length] = option;
 
option = new Option("away",' ');
option.value = "away";
sel.options[sel.options.length] = option;
 
option = new Option("studying",' ');
option.value = "studying";
sel.options[sel.options.length] = option;
 
p.appendChild(sel);
/*
var savefile = "d:\\mozdata.txt";
 
var button = document.createElement('input');
function save() {
button.value = 'OK';
try {
button.type = 'button';
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
button.setAttribute('onclick', 'saveNewStatus()');
} catch (e) {
p.appendChild(button);
alert("Permission to save file was denied.");
}
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath( savefile );
if ( file.exists() == false ) {
alert( "Creating file... " );
file.create( Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420 );
}
var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance( Components.interfaces.nsIFileOutputStream );
*//* Open flags
#define PR_RDONLY 0x01
#define PR_WRONLY 0x02
#define PR_RDWR 0x04
#define PR_CREATE_FILE 0x08
#define PR_APPEND 0x10
#define PR_TRUNCATE 0x20
#define PR_SYNC 0x40
#define PR_EXCL 0x80
*/
/*
** File modes ....
**
** CAVEAT: 'mode' is currently only applicable on UNIX platforms.
** The 'mode' argument may be ignored by PR_Open on other platforms.
**
** 00400 Read by owner.
** 00200 Write by owner.
** 00100 Execute (search if a directory) by owner.
** 00040 Read by group.
** 00020 Write by group.
** 00010 Execute by group.
** 00004 Read by others.
** 00002 Write by others
** 00001 Execute by others.
**
*//*
outputStream.init( file, 0x04 | 0x08 | 0x20, 420, 0 );
// var output = document.getElementById('blog').value;
var output = "Testo di prova";
var result = outputStream.write( output, output.length );
outputStream.close();
 
form.appendChild(p);
}
div.appendChild(form);
function read() {
 
try {
document.body.appendChild(div);
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
div.getElementsByTagName('input')[0].focus();
} catch (e) {
alert("Permission to read file was denied.");
}
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath( savefile );
if ( file.exists() == false ) {
alert("File does not exist");
}
var is = Components.classes["@mozilla.org/network/file-input-stream;1"]
.createInstance( Components.interfaces.nsIFileInputStream );
is.init( file,0x01, 00004, null);
var sis = Components.classes["@mozilla.org/scriptableinputstream;1"]
.createInstance( Components.interfaces.nsIScriptableInputStream );
sis.init( is );
var output = sis.read( sis.available() );
document.getElementById('blog').value = output;
}
 
function saveNewStatus()
save();
{
*/
var newStatus = document.getElementById('inlinePopupDiv').getElementsByTagName('select')[0].value;
//</pre>
var newString='{{Utente:Wiso/StatusTemplate|'+newStatus+'|User=Wiso}}\n';
___location.href='http://it.wikipedia.org/w/index.php?title=Utente:Wiso/Status&action=edit';
alert("Quando la pagina e' stata caricata\npremi OK");
 
wpTextbox1=document.getElementById("wpTextbox1");
wpTextbox1.value=newString;
summ=document.getElementById("wpSummary");
summ.value=summ.value+"stato modificato in \""+newStatus+"\"";
document.getElementById("wpMinoredit").checked=1
wpSave=document.getElementById("wpSave");
wpSave.click();
}