function addSumButton(name, text) {
$('<a title="'+text+'">'+name+'</a>').click(insertSummary).appendTo(wpSummaryButtons);
}
function insertSummary ( txt ) {
if ( typeof txt !== 'string' ) {
txt = this.title;
}
var vv = $( '#wpReason' ).val();
if ( vv.indexOf( txt ) !== -1 ) {
return;
}
if ( /[^,; \/]$/.test( vv ) ) {
vv += ',';
}
if ( /[^ ]$/.test( vv ) ) {
vv += ' ';
}
$( '#wpReason' ).val( vv + txt );
}
$(function (){
var sum = document.getElementById('wpReason');
if (!sum || (sum.form && sum.form.wpSection && sum.form.wpSection.value == 'new')) return;
mw.util.addCSS('\
#userSummaryButtonsA a {background:#cef; border:1px solid #adf; padding:0 2px; margin:0 2px;\
cursor:pointer; font-size:80%; color:#666}\
#userSummaryButtonsA a:hover {background:#bdf; color:black; text-decoration:none}');
wpSummaryButtons = $('<div id=userSummaryButtonsA />').insertAfter(sum); //global var
var ss = ["[[VP:Vandalizm|vandalizm]]|amaçlı değişiklik",
"deneme|amaçlı değişiklik",
"[[VP:Reklam|reklam]]|amaçlı değişiklik",
"yapıcı|olmayan değişiklik",
"[[VP:Telif|telif]]|hakkının ısrarlı ihlali",
"nedensiz içerik silinmesi" ];
for (var i=0; i<ss.length; i++)
addSumButton(ss[i].replace(/\|.*/,' '), ss[i].replace(/\|/,' '));
});