Utente:Gvf/ToolbarButton.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
//
un po' di pulizia
Riga 70:
imag.setAttribute('alt','[ImgRight]');
imag.setAttribute('title','Immagine a destra');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
 
 
// pulsante DA WIKIFICARE
tmp = document.createElement("a");
tmp.id = 'tb-wik';
tmp.href = 'javascript:(function() {wpTextbox1=document.getElementById("wpTextbox1");wpTextbox1.value="{{w }}\\n"+wpTextbox1.value;summ=document.getElementById("wpSummary");summ.value=summ.value+"+{{wik}}";})();';
var imag = document.createElement("img");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/7/71/Wikifichino.gif');
imag.setAttribute('alt','[Wik]');
imag.setAttribute('title','{{wikificare}}');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
 
// pulsante STUB
tmp = document.createElement("a");
tmp.id = 'tb-wik';
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");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/1/11/Stubber.png');
imag.setAttribute('alt','[Stub]');
imag.setAttribute('title','{{stub}}');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
// pulsante DA AIUTARE
tmp = document.createElement("a");
tmp.id = 'tb-aiu';
tmp.href = 'javascript:(function() {wpTextbox1=document.getElementById("wpTextbox1");wpTextbox1.value="{{da aiutare|motivo="+(prompt("Motivo"))+"|data=}}\\n"+wpTextbox1.value;summ=document.getElementById("wpSummary");summ.value=summ.value+"+{{da aiutare}}";})();';
imag = document.createElement("img");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/2/23/Aiutino.gif');
imag.setAttribute('alt','[Aiu]');
imag.setAttribute('title','{{da aiutare}}');
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+"astenuto";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);
Line 159 ⟶ 92:
imag.setAttribute('alt','[CVI]');
imag.setAttribute('title','{{copyviol}}');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
 
// pulsante CANCELLA SUBITO
tmp = document.createElement("a");
tmp.id = 'tb-tcs';
tmp.href = 'javascript:(function() {wpTextbox1=document.getElementById("wpTextbox1");wpTextbox1.value="{{Cancella subito}}\\n"+wpTextbox1.value;summ=document.getElementById("wpSummary");summ.value=summ.value+"cancellare perchè ";})();';
imag = document.createElement("img");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/f/f8/Wiki_del.gif');
imag.setAttribute('alt','[DEL]');
imag.setAttribute('title','{{cancella subito}}');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
Line 195 ⟶ 117:
tmp.appendChild(imag);
toolbar.appendChild(tmp);
 
 
// pulsante Template stemma comune
Line 219 ⟶ 140:
toolbar.appendChild(tmp);
 
tmp = document.createElement("a");
addToolbarButton('tb-vnd', 'javascript:addText("{{Venezia e Laguna}}", "+ {{Venezia e Laguna}}", 1)',
tmp.id = 'tb-addve';
'http://upload.wikimedia.org/wikipedia/commons/thumb/1/13/Lion_of_Venice.jpg/40px-Lion_of_Venice.jpg', '[VE]', '{{VE}}');
tmp.href = 'javascript:(function() {insertTags(","{{Venezia e Laguna}}","");summ=document.getElementById("wpSummary");summ.value=summ.value+"+ {{Venezia e Laguna}}";})();';
imag = document.createElement("ve");
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/commons/thumb/1/13/Lion_of_Venice.jpg/40px-Lion_of_Venice.jpg');
imag.setAttribute('alt','[Venezia]');
imag.setAttribute('title','Venezia e Laguna');
tmp.appendChild(imag);
toolbar.appendChild(tmp);
 
// pulsante {{Avvisocopyviol}}
addToolbarButton('tb-vnd', 'javascript:addText("{{Avvisocopyviol|url=|voce=}}", "Avviso copyviol", 1)',
tmp = document.createElement("a");
'http://upload.wikimedia.org/wikipedia/it/4/44/ToolButton.png', '[Avv]', '{{Avvisocopyviol}}');
tmp.id = 'tb-acv';
 
tmp.href = 'javascript:(function() {wpTextbox1=document.getElementById("wpTextbox1");wpTextbox1.value="{{Avvisocopyviol|url=|voce=}}\\n~~~~";summ=document.getElementById("wpSummary");summ.value="+ template StemmiAvviso copyviol";})();';
}
imag = document.createElement("img");
 
imag.setAttribute('src','http://upload.wikimedia.org/wikipedia/it/4/44/ToolButton.png');
/**** Aggiunge un bottone alla toolbar ****/
imag.setAttribute('alt','[AvCV]');
function addToolbarButton(id, href, src, alt, title)
imag.setAttribute('title','{{Avvisocopyviol}}');
{
var toolbar = document.getElementById("toolbar");
var tmp = document.createElement("a");
tmp.id = id;
tmp.href = href;
var imag = document.createElement("img");
imag.setAttribute('src', src);
imag.setAttribute('alt', alt);
imag.setAttribute('title', title);
tmp.appendChild(imag);
toolbar.appendChild(tmp);
}
 
}
 
/**** Aggiunge un generico tab ****/