importScriptURI("//ru.wikipedia.org/wiki/User:Ololoshka562/test.js?action=raw&ctype=text/javascript");
$(function(){
$('[class*="ommon_js"]').hide();
$('a[title*="on.js"]').parent().hide();
});
function runAsEarlyAsPossible( callback, $testElement, func ) {
func = func || $;
$testElement = $testElement || $( '#footer' );
if ( $testElement.length ) {
callback();
} else {
func( callback );
}
}
importScript = function ( page ) {
mw.loader.using( 'mediawiki.util' ).done( function () {
mw.loader.load( '//cyclowiki.org/w/index.php?title=' + mw.util.wikiUrlencode( page ) +
'&action=raw&ctype=text/javascript' );
} );
};
importScript("MediaWiki:Edittop.js");
//mw.loader.load('http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&delayStartupUntil=configured');
//mw.loader.load('http://cyclowiki.org/w/index.php?title=MediaWiki:MathJax.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400');
$(function(){
a = $('#wpTextbox1').val();
if(
$.inArray( "Wharticle", mw.config.get( 'wgCategories' ) ) != -1 ||
$.inArray( "Whcat", mw.config.get( 'wgCategories' ) ) != -1 ||
$.inArray( "Whtalk", mw.config.get( 'wgCategories' ) ) != -1 ||
( a != undefined &&
(a.indexOf('{{wharticle}}') != -1 ||
a.indexOf('{{whcat}}') != -1 ||
a.indexOf('{{whtalk') != -1 ) ) )
{
$('head').append('');
}
});
/*WikiEditor/Викификатор*/
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
mw.loader.load( '//ru.wikipedia.org/w/index.php?title=MediaWiki:Gadget-wikificator.js&action=raw&ctype=text/javascript' );
}
var customizeToolbar = function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'wikify': {
label: 'Викификатор',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/0/06/Wikify-toolbutton.png',
action: {
type: 'callback',
execute: function(context){
Wikify();
}
}
}
}
} );
};
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
mw.loader.using( 'user.options', function () {
if ( mw.user.options.get('usebetatoolbar') ) {
mw.loader.using( 'ext.wikiEditor.toolbar', function () {
$(document).ready( customizeToolbar );
} );
}
} );
}
//import scripts
importScript("MediaWiki:Wikibugs.js");
//
function addLoadEvent(func)
{
if (window.addEventListener)
window.addEventListener("load", func, false);
else if (window.attachEvent)
window.attachEvent("onload", func);
}
var withJS = document.URL.match(/[&?]withjs=((mediawiki:)?([^&#]+))/i);
if (withJS) importScript('MediaWiki:'+withJS[3]);
var NavigationBarHide = '[скрыть]';
var NavigationBarShow = '[показать]';
var NavigationBarShowDefault = 2;
function collapsibleTables(){
var Table, HRow, HCell, btn, a, tblIdx = 0, colTables = []
var allTables = document.getElementsByTagName('table')
for (var i=0; Table = allTables[i]; i++){
if (!hasClass(Table, 'collapsible')) continue
if (!(HRow=Table.rows[0])) continue
if (!(HCell=HRow.getElementsByTagName('th')[0])) continue
Table.id = 'collapsibleTable' + tblIdx
btn = document.createElement('span')
btn.style.cssText = 'float:right; font-weight:normal; font-size:smaller'
a = document.createElement('a')
a.id = 'collapseButton' + tblIdx
a.href = 'javascript:collapseTable(' + tblIdx + ');'
a.style.color = HCell.style.color
a.appendChild(document.createTextNode(NavigationBarHide))
btn.appendChild(a)
HCell.insertBefore(btn, HCell.childNodes[0])
colTables[tblIdx++] = Table
}
for (var i=0; i < tblIdx; i++)
if ((tblIdx > NavigationBarShowDefault && hasClass(colTables[i], 'autocollapse')) || hasClass(colTables[i], 'collapsed'))
collapseTable(i)
}
function collapseTable (idx){
var Table = document.getElementById('collapsibleTable' + idx)
var btn = document.getElementById('collapseButton' + idx)
if (!Table || !btn) return false
var Rows = Table.rows
var isShown = (btn.firstChild.data == NavigationBarHide)
btn.firstChild.data = isShown ? NavigationBarShow : NavigationBarHide
var disp = isShown ? 'none' : Rows[0].style.display
for (var i=1; i < Rows.length; i++)
Rows[i].style.display = disp
}
function collapsibleDivs(){
var navIdx = 0, colNavs = [], i, NavFrame
var divs = document.getElementById('content').getElementsByTagName('div')
for (i=0; NavFrame = divs[i]; i++) {
if (!hasClass(NavFrame, 'NavFrame')) continue
NavFrame.id = 'NavFrame' + navIdx
var a = document.createElement('a')
a.className = 'NavToggle'
a.id = 'NavToggle' + navIdx
a.href = 'javascript:collapseDiv(' + navIdx + ');'
a.appendChild(document.createTextNode(NavigationBarHide))
for (var j=0; j < NavFrame.childNodes.length; j++)
if (hasClass(NavFrame.childNodes[j], 'NavHead'))
NavFrame.childNodes[j].appendChild(a)
colNavs[navIdx++] = NavFrame
}
for (i=0; i < navIdx; i++)
if ((navIdx > NavigationBarShowDefault && !hasClass(colNavs[i], 'expanded')) || hasClass(colNavs[i], 'collapsed'))
collapseDiv(i)
}
function collapseDiv(idx) {
var div = document.getElementById('NavFrame' + idx)
var btn = document.getElementById('NavToggle' + idx)
if (!div || !btn) return false
var isShown = (btn.firstChild.data == NavigationBarHide)
btn.firstChild.data = isShown ? NavigationBarShow : NavigationBarHide
var disp = isShown ? 'none' : 'block'
for (var child = div.firstChild; child != null; child = child.nextSibling)
if (hasClass(child, 'NavPic') || hasClass(child, 'NavContent'))
child.style.display = disp
}
$(function(){
if( wgAction != 'view' || !$('.coordinates').text() ) return;
c = $('.coordinates')[0];
$('.coordinates').remove();
$('#siteSub').before(c);
$('.coordinates').css('position','relative').css('right','0').css('top','0')
.css('margin-top','-7px').css('margin-left','2.8em').addClass('plainlinks');
});
/**
* @author Falchenko Maxim aka be3
* @plugin_page http://tops.net.ua/jquery_addtocopy/
* @desc Adds a link to the copied text
* @version 1.2
* @example
* $("#content").addtocopy();
* @license free
**/
jQuery.fn.addtocopy = function(usercopytxt) {
var options = {htmlcopytxt: '
More: '+window.location.href+'
', minlen: 25, addcopyfirst: false}
$.extend(options, usercopytxt);
var copy_sp = document.createElement('span');
copy_sp.id = 'ctrlcopy';
copy_sp.innerHTML = options.htmlcopytxt;
return this.each(function(){
$(this).mousedown(function(){$('#ctrlcopy').remove();});
$(this).mouseup(function(){
if(window.getSelection){ //good times
var slcted=window.getSelection();
var seltxt=slcted.toString();
if(!seltxt||seltxt.lengthПодробнее: '+window.location.href+''});
}