MediaWiki:Common.js

Материал из Энциклопедия МИФИ

Перейти к: навигация, поиск
м
м
Строка 29: Строка 29:
var newdiv = document.createElement("div");
var newdiv = document.createElement("div");
     newdiv.id = "GoogleTranslate";
     newdiv.id = "GoogleTranslate";
-
     newdiv.style.display='block'
+
     newdiv.style.display='none'
   toolbar.appendChild(newdiv)
   toolbar.appendChild(newdiv)
}
}

Версия 11:29, 17 августа 2009

/* Размещённый здесь JavaScript код будет загружаться всем пользователям при обращении к каждой странице */
function addWikifButton(){
 var toolbar = document.getElementById('toolbar')
 var textbox = document.getElementById('wpTextbox1')
 if (!textbox || !toolbar) 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'){
 document.write('<script type="text/javascript" src="http://ru.wikipedia.org/w/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript"><\/script>')
// document.write('<script type="text/javascript" src="http://wiki.mephist.ru/wiki?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript"><\/script>')
 addOnloadHook(addWikifButton)
}
 
function addImageMapButton(){
 var toolbar = document.getElementById('toolbar')
 var textbox = document.getElementById('wpTextbox1')
 if (!textbox || !toolbar) return
 var i = document.createElement('img')
 i.src = 'http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png'
 i.alt = i.title = 'Вставка картинки с разметкой'
 i.onclick = Wikify
 i.style.cursor = 'pointer'
 toolbar.appendChild(i)
var newdiv = document.createElement("div");
    newdiv.id = "GoogleTranslate";
    newdiv.style.display='none'
  toolbar.appendChild(newdiv)
}
if (wgAction == 'edit' || wgAction == 'submit'){
 document.write('<script type="text/javascript" src="http://ru.wikipedia.org/w/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript"><\/script>')
// document.write('<script type="text/javascript" src="http://wiki.mephist.ru/wiki?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript"><\/script>')
// addOnloadHook(addImageMapButton)
hookEvent("load", addImageMapButton)
}
Помощь