MediaWiki:Common.js
Материал из SubaruWiki
(Различия между версиями)
Figaro (Обсуждение | вклад) |
Figaro (Обсуждение | вклад) |
||
Строка 7: | Строка 7: | ||
return; | return; | ||
} | } | ||
+ | alert('!?!'); | ||
var i = document.createElement('img'); | var i = document.createElement('img'); | ||
i.src = 'http://upload.wikimedia.org/wikisource/ru/d/d1/Button-wikifikator.png'; | i.src = 'http://upload.wikimedia.org/wikisource/ru/d/d1/Button-wikifikator.png'; | ||
Строка 12: | Строка 13: | ||
i.onclick = Wikify; | i.onclick = Wikify; | ||
i.style.cursor = 'pointer'; | i.style.cursor = 'pointer'; | ||
- | toolbar.appendChild(i); | + | toolbar.appendChild(i); |
- | + | ||
} | } | ||
if (wgAction == 'edit' || wgAction == 'submit') { | if (wgAction == 'edit' || wgAction == 'submit') { |
Версия 08:51, 20 ноября 2011
/* Размещённый здесь JavaScript код будет загружаться всем пользователям при обращении к каждой странице */ function addWikifButton() { var toolbar = document.getElementById('toolbar'); if (!toolbar) { return; } alert('!?!'); var i = document.createElement('img'); i.src = 'http://upload.wikimedia.org/wikisource/ru/d/d1/Button-wikifikator.png'; i.alt = i.title = 'викификатор'; i.onclick = Wikify; i.style.cursor = 'pointer'; toolbar.appendChild(i); } if (wgAction == 'edit' || wgAction == 'submit') { // alert('!!'); // importScriptURI('/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript'); addOnloadHook(addWikifButton); }