MediaWiki:Common.js
Материал из SubaruWiki
(Различия между версиями)
Figaro (Обсуждение | вклад) |
Figaro (Обсуждение | вклад) |
||
| Строка 3: | Строка 3: | ||
function addWikifButton() { | function addWikifButton() { | ||
var toolbar = document.getElementById('toolbar'); | var toolbar = document.getElementById('toolbar'); | ||
| - | if (!toolbar) return; | + | if (!toolbar) |
| + | { | ||
| + | alert('QQQ'); | ||
| + | return; | ||
| + | } | ||
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: | Строка 16: | ||
} | } | ||
if (wgAction == 'edit' || wgAction == 'submit') { | if (wgAction == 'edit' || wgAction == 'submit') { | ||
| - | + | // alert('!!'); | |
// importScriptURI('/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript'); | // importScriptURI('/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript'); | ||
addOnloadHook(addWikifButton); | addOnloadHook(addWikifButton); | ||
} | } | ||
Версия 08:47, 20 ноября 2011
/* Размещённый здесь JavaScript код будет загружаться всем пользователям при обращении к каждой странице */
function addWikifButton() {
var toolbar = document.getElementById('toolbar');
if (!toolbar)
{
alert('QQQ');
return;
}
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);
}