MediaWiki:Common.js — различия между версиями
NeKit (обсуждение | вклад) м |
NeKit (обсуждение | вклад) м |
||
Строка 10: | Строка 10: | ||
} | } | ||
if (document.URL.indexOf('action=edit') > 0 || document.URL.indexOf('action=submit') > 0) { | if (document.URL.indexOf('action=edit') > 0 || document.URL.indexOf('action=submit') > 0) { | ||
− | + | document.write('<script type="text/javascript" src="/wiki/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript"><\/script>') | |
addOnloadHook(addWikifButton) | addOnloadHook(addWikifButton) | ||
} | } |
Версия 19:13, 19 марта 2014
function addWikifButton() {
var toolbar = document.getElementById('toolbar')
if (!toolbar) return
var i = document.createElement('img')
i.src = '/images/d/d1/Button-wikifikator.png'
i.alt = i.title = 'викификатор'
i.onclick = Wikify
i.style.cursor = 'pointer'
toolbar.appendChild(i)
}
if (document.URL.indexOf('action=edit') > 0 || document.URL.indexOf('action=submit') > 0) {
document.write('<script type="text/javascript" src="/wiki/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript"><\/script>')
addOnloadHook(addWikifButton)
}