Common.js
Записаний нижче код в режимі Редагування вставте в сторінку MediaWiki:Common.js
if (document.URL.indexOf("action=edit") > 0 || document.URL.indexOf("action=submit") > 0)
{
if (wgCanonicalNamespace != "Special") { document.write('<script type="text/javascript" src="' + 'http://uk.vijskpens.wikia.com/index.php?title=MediaWiki:Onlyifediting.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); addOnloadHook(function(){ if (mwEditButtons.length < 3) return; mwEditButtons[0].imageFile = 'http://upload.wikimedia.org/wikipedia/commons/f/fa/Button_bold_ukr.png'; mwEditButtons[1].imageFile = 'http://upload.wikimedia.org/wikipedia/commons/f/f3/Button_italic_ukr.png'; mwEditButtons[2].imageFile = 'http://upload.wikimedia.org/wikipedia/commons/0/03/Button_internal_link_ukr.png'; }) }
}
if (mwCustomEditButtons) {
//Перенаправлення mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/ru/1/1d/Button_redirect_rus.png", "speedTip": "Перенаправлення", "tagOpen": "#Перенаправлення [[", "tagClose": "]]", "sampleText": "назва сторінки"}
//Template button mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/3b/Button_template_alt.png", "speedTip": "Шаблон", "tagOpen": "{{", "tagClose": "}}", "sampleText": "Назва шаблону"}
//Category button mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/3c/Button_cat_ru.png", "speedTip": "Категорія", "tagOpen": "[[Категорія:", "tagClose": "|Common.js]]", "sampleText": "Назва категорії"}
//Underline mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.uncyc.org/uk/6/64/Button_underline_ukr.png", "speedTip": "Підкреслення", "tagOpen": "", "tagClose": "", "sampleText": "Підкреслений текст"}
//Strike-Out Button mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.uncyc.org/uk/4/45/Button_strike_ukr.png", "speedTip": "Закреслений текст", "tagOpen": "", "tagClose": "", "sampleText": "Закреслений текст"}
//Нерозривний пробіл mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/4/4b/Button_nbsp.png", "speedTip": "Нерозривний пробіл", "tagOpen": " ", "tagClose": "", "sampleText": ""}
//Line break button mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/13/Button_enter.png", "speedTip": "Розрив", "tagOpen": "
", "tagClose": "", "sampleText": ""}
//Наголос mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0e/Button_acute_accent.png", "speedTip": "Наголос", "tagOpen": "́", "tagClose": "", "sampleText": ""}
//Цитата mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/05/Button_Anführung.png", "speedTip": "Вставка цитати", "tagOpen": "
- „",
"tagClose": "“
- ~
- ~
",
"sampleText": "Цитата"}
//Superscript mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png", "speedTip": "Верхній індекс", "tagOpen": "", "tagClose": "", "sampleText": "Верхній індекс"}
//Subscript mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png", "speedTip": "Нижній індекс", "tagOpen": "", "tagClose": "", "sampleText": "Нижній індекс"}
//Left-Text Button mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/e/ea/Button_align_left.png", "speedTip": "Вирівняти по лівому краю",
"tagOpen": "
",
"sampleText": "Вирівняний ліворуч текст"}
//Center-Text Button mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/he/5/5f/Button_center.png", "speedTip": "Вирівняти по центру",
"tagOpen": "
",
"sampleText": "Вирівняний по центру текст"}
//Right-Text Button mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.uncyc.org/uk/a/a5/Button_align_right.png", "speedTip": "Вирівняти по правому краю",
"tagOpen": "
",
"sampleText": "Вирівняний праворуч текст"}
//Прихований коментар mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/he/3/34/Button_hide_comment.png", "speedTip": "Прихований коментар", "tagOpen": "", "sampleText": "Коментар"}
//Заголовок при наведенні курсору mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/74/Button_comment.png", "speedTip": "Курсорний заголовок", "tagOpen": "", "tagClose": "", "sampleText": "Текст"}
//Великий текст mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/c/cb/Button_big_2.png", "speedTip": "Великий шрифт", "tagOpen": "", "tagClose": "", "sampleText": "Текст великим шрифтом"}
//Малий текст mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.uncyc.org/uk/4/4c/Button_small_ukr.png", "speedTip": "Малий шрифт", "tagOpen": "", "tagClose": "", "sampleText": "Текст малим шрифтом"}
//Gallery mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/9/9e/Btn_toolbar_gallery.png", "speedTip": "Галерея",
"tagOpen": "\n
- \n",
- "tagClose": "\n
",
"sampleText": "Файл:Назва_зображення1.jpg|Опис_зображення1\n\Файл:Назва_зображення2.jpg|Опис_зображення2"}
//Video mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png", "speedTip": "Відео з YouTube", "tagOpen": "\n", "sampleText": "title=\n\movie_url=http://www.youtube.com/watch?v=\n\embed_source_url=http://www.youtube.com/v/&fs=1\n\wrap=yes\n\width=400\n\height=300"}
//Reference link button mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/c/c4/Button_ref.png", "speedTip": "Виноска", "tagOpen": "[1]", "sampleText": "Посилання"}
//Reference button mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/6/64/Buttonrefvs8.png", "speedTip": "Список виносок",
"tagOpen": "\n== Виноски ==\n
- ↑ ", "tagClose": "
",
"tagClose": "", "sampleText": ""}
//Colour mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/he/1/1e/Button_font_color.png", "speedTip": "Кольоровий текст", "tagOpen": "", "tagClose": "", "sampleText": "Кольоровий текст"}
//Code mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/2/23/Button_code.png",
"speedTip": "Вставка коду",
"tagOpen": "",
"tagClose": "
",
"sampleText": "Код"}
//Моноширинний шрифт mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/30/Tt_icon.png", "speedTip": "Моноширинний шрифт", "tagOpen": "", "tagClose": "", "sampleText": "Моноширинний шрифт"}
//Посилання на шаблон mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/37/Button_tl_template.png", "speedTip": "Посилання на шаблон", "tagOpen": "Шаблон:Ш", "sampleText": "Назва шаблону"} }
/* Імпорт додаткових скриптів */
function importExternalScript(url) { var s = document.createElement('script'); s.src = url; s.type='text/javascript'; document.getElementsByTagName('head')[0].appendChild(s); } function importScript(page) { importExternalScript(wgScriptPath + '/index.php?title=' + encodeURIComponent(page.replace(' ','_')) + '&action=raw&ctype=text/javascript&dontcountme=s'); }
// </nowiki>
/**
* * English: Open a popup with parameters to generate an array. * The number of rows/columns can be modified. Some additional * parameters are related to templates available on :fr * * @author: fr:user:dake * @version: 0.1 */
function popupTable() {
var popup = window.open(,'name','height=180,width=300,scrollbars=yes'); javaCode = '<script type="text\/javascript">function insertCode(){'; javaCode += 'var row = parseInt(document.paramForm.inputRow.value); ' javaCode += 'var col = parseInt(document.paramForm.inputCol.value); ' javaCode += 'var bord = 0; ' javaCode += 'var styleHeader = false; ' javaCode += 'var styleLine = false; ' javaCode += 'var exfield = false; ' javaCode += 'var align = document.paramForm.inputAlign.value; ' javaCode += 'var padding = false; ' javaCode += 'window.opener.generateTableau(col,row,bord,styleHeader,styleLine,exfield,align,padding); ' javaCode += "alert('Таблиця створена!'); " javaCode += 'window.close(); ' javaCode += '}<\/script>'; popup.document.write('<html><head><title>Створення таблиці</title>'); popup.document.write('<script type="text\/javascript" src="\/skins-1.5\/common\/wikibits.js"><\/script>'); popup.document.write('<style type="text\/css" media="screen,projection">/*<![CDATA[*/ @import "\/skins-1.5\/monobook\/main.css?5"; /*]]>*/<\/style>'); popup.document.write(javaCode); popup.document.write('</head><body>');
popup.document.write('
Введіть параметри таблиці:
');
popup.document.write('<form name="paramForm">');
popup.document.write('Вирівнювання : <input type="text" name="inputAlign" value="center" >
'); popup.document.write('Кількість рядків : <input type="text" name="inputRow" value="3" >
'); popup.document.write('Кількість стовпчиків: <input type="text" name="inputCol" value="3" >
'); popup.document.write('</form">'); popup.document.write('
<a href="javascript:insertCode()">Вставити таблицю</a> |'); popup.document.write(' <a href="javascript:self.close()">Відмінити (зачинити вікно)</a>
');
popup.document.write('</body></html>'); popup.document.close();
}
/* Маленьке корегування кнопки підпису */ appendCSS('#mw-editbutton-signature { display: none; }'); if (mwCustomEditButtons) { mwCustomEditButtons.push({ 'imageFile': 'http://static.uncyc.org/skins/common/images/button_sig.png', 'speedTip': 'Ваш підпис з часовою міткою', 'tagOpen': '— ~~\~~', 'tagClose': , 'sampleText': , 'imageId': 'editbutton-customsig' }); }
/* Всі додаткові скрипти включені нижче */ importScript("MediaWiki:Otherscripts.js");
/*
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-7117465-1']); _gaq.push(['_trackPageview']);
(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = 'http://www.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
function ukrbash()
{
if (document.getElementById('ukrbash')) (function(){var script=document.createElement('script');script.type='text/javascript';script.async=true;script.src='http://i.ukrbash.org/export/random.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(script,s)})();
} addOnloadHook(ukrbash);
/** Collapsible tables *********************************************************
* * Description: Allows tables to be collapsed, showing only the header. See * http://www.mediawiki.org/wiki/Manual:Collapsible_tables. * Maintainers: **MAINTAINERS** */
var autoCollapse = 2; var collapseCaption = 'сховати'; var expandCaption = 'показати';
function collapseTable( tableIndex ) { var Button = document.getElementById( 'collapseButton' + tableIndex ); var Table = document.getElementById( 'collapsibleTable' + tableIndex );
if ( !Table || !Button ) { return false; }
var Rows = Table.rows;
if ( Button.firstChild.data == collapseCaption ) { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = 'none'; } Button.firstChild.data = expandCaption; } else { for ( var i = 1; i < Rows.length; i++ ) { Rows[i].style.display = Rows[0].style.display; } Button.firstChild.data = collapseCaption; } }
function createCollapseButtons() { var tableIndex = 0; var NavigationBoxes = new Object(); var Tables = document.getElementsByTagName( 'table' );
for ( var i = 0; i < Tables.length; i++ ) { if ( hasClass( Tables[i], 'collapsible' ) ) { /* only add button and increment count if there is a header row to work with */ var HeaderRow = Tables[i].getElementsByTagName( 'tr' )[0]; if( !HeaderRow ) continue; var Header = HeaderRow.getElementsByTagName( 'th' )[0]; if( !Header ) continue;
NavigationBoxes[tableIndex] = Tables[i]; Tables[i].setAttribute( 'id', 'collapsibleTable' + tableIndex );
var Button = document.createElement( 'span' ); var ButtonLink = document.createElement( 'a' ); var ButtonText = document.createTextNode( collapseCaption );
Button.className = 'collapseButton'; // Styles are declared in MediaWiki:Common.css
ButtonLink.style.color = Header.style.color; ButtonLink.setAttribute( 'id', 'collapseButton' + tableIndex ); ButtonLink.setAttribute( 'href', "javascript:collapseTable(" + tableIndex + ");" ); ButtonLink.appendChild( ButtonText );
Button.appendChild( document.createTextNode( '[' ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( ']' ) );
Header.insertBefore( Button, Header.childNodes[0] ); tableIndex++; } }
for ( var i = 0; i < tableIndex; i++ ) { if ( hasClass( NavigationBoxes[i], 'collapsed' ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], 'autocollapse' ) ) ) { collapseTable( i ); } } }
addOnloadHook( createCollapseButtons );
/** Test if an element has a certain class **************************************
* * Description: Uses regular expressions and caching for better performance. * Maintainers: User:Mike Dillon, User:R. Koot, User:SG */
var hasClass = (function() { var reCache = {}; return function( element, className ) { return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className); }; })(); /* Шаблон:Nologo */ function noLogo() { if(document.getElementById('nologo'))
document.getElementById('p-logo').style.display = 'none';
} addOnloadHook(onPageInit);
function onPageInit() {
noLogo();
}