Utente:Kal-El/monobook.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m minuzia |
copia incolla da paulatz |
||
Riga 1:
/* <
Riga 8:
* See also: [[User:JesseW/monobook.js]]
* For italian translation [[it:Utente:Helios89/monobook.js]]
* Additional programming: [[it:Utente:Paulatz/monobook.js]]
*/
/** GLOBALS **/
var curTemplate;
/**** Initialise on window load ****/
Riga 31 ⟶ 35:
addPurge();
// §ion=0
//addEditSection0();
// cause the personal menu looks bad
changeLinks();
// because edit summaries are good
//addForceSummary();
// if this is VFD, add the show/hide thingies
if(document.title.indexOf("Wikipedia:Pagine da cancellare") != -1 && document.title.indexOf("Editing ") != 0) vfdlinks();
Riga 50 ⟶ 54:
}
// Functions auxFicus and Ficus
function auxFicus(){
Argument = document.getElementById('inlinePopupDiv').getElementsByTagName('select')[0].value;
Template = curTemplate;
wpTextbox1 = document.getElementById("wpTextbox1");
if (Template == "W"||Template == "w")
wpTextbox1.value="{{"+Template+"|"+Argument+"|"+"{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}|~~~~}}"+wpTextbox1.value;
else {
Because = document.getElementById('inlinePopupDiv').getElementsByTagName('input')[0].value;
wpTextbox1.value="{{"+Template+"|"+Because+"|"+Argument+"|"+"{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}|~~~~}}"+wpTextbox1.value;
summ=document.getElementById("wpSummary");
summ.value=summ.value+"+Aiutare";
RemoveNode('inlinePopupDiv');
}
function Ficus(Template){
arrayArgument = new Array("antropologia", "archeologia", "architettura", "biografie", "biologia", "calcio", "chimica", "cinema", "diritto", "economia", "filosofia", "fisica", "fumetti", "geografia", "giochi", "informatica", "ingegneria", "letteratura", "matematica", "meccanica", "medicina", "musei", "musica", "politica", "religione", "scienza", "sociologia", "sport", "storia", "teatro")
switch(Template){
case
Greeter = "Hai richiesto di inserire questa pagina nella Categoria <b>\"Da aiutare\"</b>\n. Per favore scrivi una motivazione e scegli un argomento dalla lista";
case "c":
Greeter = "Hai richiesto di inserire questa pagina nella Categoria <b>\"Da controllare\"</b>\n. Per favore scrivi una motivazione e scegli un argomento dalla lista";
break;
case "P":
case "p":
Greeter = "Hai richiesto di inserire questa pagina nella Categoria <b>\"Segnalazioni NPOV\"</b>\n. Per favore scrivi una motivazione e scegli un argomento dalla lista";
case "W":
case "w":
Greeter = "Hai richiesto di inserire questa pagina nella Categoria <b>\"Da wikificare\"</b>\n. Per favore scegli un argomento dalla lista.";
break;
default: Greeter = "Qualcosa è andato storto, fai pure quello che vuoi: non ho idea di cosa succederà"
}
curTemplate = Template;
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' );
top.id = 'inlinePopupTop';
top.style.textAlign = 'right';
top.style.margin = '8px';
top.style.backgroundColor = '#DDDDDD';
var a = document.createElement( 'a' );
a.appendChild( document.createTextNode( 'Close' ) );
a.href = "javascript:void RemoveNode('inlinePopupDiv')";
a.style.margin = '8px';
top.appendChild( a );
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('Motivazione:'));
if((Template!='W')&&(Template!='w')){
var myedit = document.createElement('input');
myedit.name = 'editReason';
myedit.type = 'text';
p.appendChild(myedit);
}
p.appendChild(document.createTextNode('Argomento:'));
var sel = document.createElement('select');
sel.name = 'popupSelect';
sel.size = 1;
var option;
for (i=0; i<arrayArgument.length; i++){
option = new Option(arrayArgument[i],' ');
option.value = arrayArgument[i];
sel.options[sel.options.length] = option;
}
p.appendChild(sel);
var button = document.createElement('input');
button.value = 'OK';
button.type = 'button';
button.setAttribute('onclick', 'auxFicus()');
p.appendChild(button);
form.appendChild(p);
div.appendChild(form);
document.body.appendChild( div );
div.getElementsByTagName('input')[0].focus();
}
/**** Extra tab adding ****/
function addlilink(tabs, url, name, id){
Riga 146 ⟶ 223:
txt.value += '{{subst:edit summary}} ~~~~';
txt.focus();
}
Riga 227 ⟶ 291:
addlilink(tabs, 'javascript:showvfd()', 'show closed', 'ca-show');
ta['ca-show'] = ['', 'Show closed VFDs'];
}
Riga 312 ⟶ 350:
addlilink(tb, '/wiki/WP:ICT', 'Image Copyright tags', '');
}
// Returns <li><a href="url">name</a></li>
Riga 366 ⟶ 394:
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
tabs.appendChild(addlilink('/w/index.php?title=Special%3ALog&type=block&user=&page=
}
Riga 403 ⟶ 431:
//add "contributions" tab
tabs.appendChild(addlilink('/w/wiki.phtml?title=Speciale:Contributions&target=
}
Riga 473 ⟶ 501:
document.getElementById( 'p-personal' ).getElementsByTagName( 'ul' )[0].style.textTransform = 'none';
//
UserMenu.insertBefore( 'pt-mycontris', 'pt-list', 'copyscape', 'http://copyscape.com/' );
UserMenu.insertBefore( 'pt-logout' , 'pt-logs', 'log',
'/w/index.php?title=Special%3ALog&user=' + userName );
UserMenu.insertBefore( 'pt-
'javascript:void InlineKate( "' + userName + '" )' );
// article-actions menu, (the "tabs")
Riga 501 ⟶ 524:
NavMenu.append( 'n-' + x++, 'Sondaggi', '/wiki/Wikipedia:Sondaggi' );
NavMenu.append( 'n-' + x++, 'Stub', '/wiki/Categoria:Stub' );
Riga 608 ⟶ 629:
}
function RemoveNode( id )
{ var node = document.getElementById( id )
node.parentNode.removeChild( node );
}
Riga 645 ⟶ 651:
}
addLoadEvent(WikiSign);
//ToolbarButton
Riga 764 ⟶ 702:
}
// pulsante STUB
tmp = document.createElement("a");
tmp.id = 'tb-
tmp.href = 'javascript:(function() {wpTextbox1=document.getElementById("wpTextbox1");wpTextbox1.value="{{stub}}\\n"+wpTextbox1.value;summ=document.getElementById("wpSummary");summ.value=summ.value+"+{{stub}}";})();';
var imag = document.createElement("img");
Riga 786 ⟶ 713:
toolbar.appendChild(tmp);
// pulsante
tmp = document.createElement("a");
tmp.id = 'tb-
tmp.href = "javascript:Ficus('A');";
//tmp.href = "javascript:void auxFicus('TestCase')";
var imag = document.createElement("img");
imag.setAttribute('
imag.setAttribute('
imag.setAttribute('title','{{A}}iutare');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
// pulsante
tmp = document.createElement("a");
tmp.id = 'tb-
tmp.href = "javascript:Ficus('C');";
//tmp.href = "javascript:void auxFicus('TestCase')";
var imag = document.createElement("img");
imag.setAttribute('
imag.setAttribute('
imag.setAttribute('title','{{C}}ontrollare');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
// pulsante FICUS-POV
tmp = document.createElement("a");
tmp.id = 'tb-fic';
tmp.href = "javascript:Ficus('P');";
//tmp.href = "javascript:void auxFicus('TestCase')";
var imag = document.createElement("img");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/a/ab/Pulsante-pov.gif');
imag.setAttribute('alt','[ficus]');
imag.setAttribute('title','{{P}}OV');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
// pulsante FICUS-WIKIFICARE
tmp = document.createElement("a");
tmp.id = 'tb-fic';
tmp.href = "javascript:Ficus('W');";
//tmp.href = "javascript:void auxFicus('TestCase')";
var imag = document.createElement("img");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/2/24/Pulsante-wikificare.gif');
imag.setAttribute('alt','[ficus]');
imag.setAttribute('title','{{W}}ikificare');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
// pulsante VOTO FAVOREVOLE +1
tmp = document.createElement("a");
tmp.id = 'tb-piu';
tmp.href = 'javascript:(function() {wpTextbox1=document.getElementById("wpTextbox1");wpTextbox1.value=wpTextbox1.value+"*{{+1}} ~~~ ~~~~~";summ=document.getElementById("wpSummary");summ.value=summ.value+"+{{+1}}";document.getElementById("wpMinoredit").checked=1;})();';
var imag = document.createElement("img");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/f/f8/Favorevole.png');
imag.setAttribute('alt','[+1]');
imag.setAttribute('title','voto +1');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
// pulsante VOTO ASTENUTO =0
tmp = document.createElement("a");
tmp.id = 'tb-uguale';
tmp.href = 'javascript:(function() {wpTextbox1=document.getElementById("wpTextbox1");wpTextbox1.value=wpTextbox1.value+"*{{0}} ~~~ ~~~~~";summ=document.getElementById("wpSummary");summ.value=summ.value+"+{{0}}";document.getElementById("wpMinoredit").checked=1;})();';
var imag = document.createElement("img");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/a/aa/Astenuto.png');
imag.setAttribute('alt','[=0]');
imag.setAttribute('title','voto =0');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
// pulsante VOTO CONTRARIO -1
tmp = document.createElement("a");
tmp.id = 'tb-meno';
tmp.href = 'javascript:(function() {wpTextbox1=document.getElementById("wpTextbox1");wpTextbox1.value=wpTextbox1.value+"*{{-1}} ~~~ ~~~~~";summ=document.getElementById("wpSummary");summ.value=summ.value+"+{{-1}}";document.getElementById("wpMinoredit").checked=1;})();';
var imag = document.createElement("img");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/4/43/Contrario.png');
imag.setAttribute('alt','[-1]');
imag.setAttribute('title','voto -1');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
Riga 810 ⟶ 796:
addLoadEvent(ToolbarButton);
/* </
|