MediaWiki:Common.js — различия между версиями
NeKit (обсуждение | вклад) (Новая страница: «function addWikifButton() { var toolbar = document.getElementById('toolbar') if (!toolbar) return var i = document.createElement('img') i.src = '/images/d/d1/But...») |
NeKit (обсуждение | вклад) м |
||
Строка 9: | Строка 9: | ||
toolbar.appendChild(i) | toolbar.appendChild(i) | ||
} | } | ||
− | if ( | + | if (document.URL.indexOf('action=edit') > 0 || document.URL.indexOf('action=submit') > 0) { |
importScriptURI('/wiki/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript') | importScriptURI('/wiki/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript') | ||
addOnloadHook(addWikifButton) | addOnloadHook(addWikifButton) | ||
} | } |
Версия 19:06, 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) {
importScriptURI('/wiki/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript')
addOnloadHook(addWikifButton)
}