MediaWiki:Gadget-editSummary.js: различия между версиями
м -___- |
м I HATE IT! .. We'll see. |
||
| Строка 4: | Строка 4: | ||
if (!sum || (sum.form.wpSection && sum.form.wpSection.value == 'new')) return; | if (!sum || (sum.form.wpSection && sum.form.wpSection.value == 'new')) return; | ||
var sp = document.createElement('span'); sp.id = 'userSummaryButtonsA'; | var sp = document.createElement('span'); sp.id = 'userSummaryButtonsA'; | ||
sum.parentNode.insertBefore(sp, sum.nextSibling); | sum.parentNode.insertBefore(sp, sum.nextSibling); | ||
sum.parentNode.insertBefore(document.createElement('br'), sum.nextSibling); | sum.parentNode.insertBefore(document.createElement('br'), sum.nextSibling); | ||
/* | |||
$("#userSummaryButtonsA").css({position:'relative', top:'-2em', marginBottom:'-2em', display:'inline-block', float:'right'}); | |||
*/ | |||
addSumButton('абсурдоф.', 'абсурдофикация', 'Произведена абсурдофикация'); | addSumButton('абсурдоф.', 'абсурдофикация', 'Произведена абсурдофикация'); | ||
addSumButton('оформл.', 'оформление', 'Улучшено оформление'); | addSumButton('оформл.', 'оформление', 'Улучшено оформление'); | ||
| Строка 25: | Строка 26: | ||
addSumButton('уточ.', 'уточнение', 'Уточнение'); | addSumButton('уточ.', 'уточнение', 'Уточнение'); | ||
addSumButton('картинка', 'картинка', 'Добавлены картинки'); | addSumButton('картинка', 'картинка', 'Добавлены картинки'); | ||
sp.insertAdjacentHTML('afterbegin', '<b>[+]</b>'); | |||
} | } | ||
| Строка 31: | Строка 34: | ||
btn.appendChild(document.createTextNode(name)); | btn.appendChild(document.createTextNode(name)); | ||
btn.title = title; | btn.title = title; | ||
btn.style = " | btn.style = "float:left"; | ||
btn.onclick = function(){insertSummary(text)}; | btn.onclick = function(){insertSummary(text)}; | ||
document.getElementById('userSummaryButtonsA').appendChild(btn); | document.getElementById('userSummaryButtonsA').appendChild(btn); | ||
| Строка 43: | Строка 46: | ||
sum.value += text; | sum.value += text; | ||
} | } | ||
$("#userSummaryButtonsA").on("mouseover", function() { | |||
$("#userSummaryButtonsA a").show(); | |||
}); | |||
$("#userSummaryButtonsA").on("mouseout", function() { | |||
$("#userSummaryButtonsA a").hide(); | |||
}); | |||
addOnloadHook(SummaryButtons); | addOnloadHook(SummaryButtons); | ||