Добро пожаловать на Lesta Games Wiki!

MediaWiki:Common.js — различия между версиями

Перейти к: навигация, поиск
Версия 23:23, 30 июня 2012
func
Версия 06:08, 3 июля 2012
Переключатель
Строка 409:Строка 409:
  });  });
 } }
 +
 +/* Переключатель */
 +function switcher() {
 + $('.switcher').each(function () {
 + $(this).css('width',$(this).data('width'));
 + $(this).children('.switcherFrame').css('height',$(this).data('height'));
 + $(this).children('.switcherFrame').css('width',$(this).data('width'));
 + $(this).find('.subSwitcher').css('height',$(this).data('height'));
 + $(this).find('.subSwitcher').css('width',$(this).data('width'));
 + $(this).find('.subSwitcher:not(:first)').hide();
 + $(this).find('.switcherControlButton:first').addClass('active');
 + $(this).removeClass('hidden');
 + })
 +
 + $('.switcherControlButton').click(function (){
 + var buttonCkickId=$(this).data('id');
 + $(this).parent().children('.switcherControlButton').removeClass('active');
 + $(this).addClass('active');
 + $(this).parent().parent().find('.subSwitcher').each(function() {
 + if(buttonCkickId == $(this).data('id')) $(this).show();
 + else $(this).hide();
 + });
 +});
 +
 +}
 +
  
 /* Конфиг */ /* Конфиг */
Строка 422:Строка 448:
  setTimeout(makeShellsHidable,0);  setTimeout(makeShellsHidable,0);
  if(addImagePopupControl())setTimeout(addImagePopups,0);  if(addImagePopupControl())setTimeout(addImagePopups,0);
 + setTimeout(switcher,0);
  
  if ( $('div.TankPerformance').size() && $('#pt-userpage').text()!='SoSpoke' ) { // фикс глюка движка  if ( $('div.TankPerformance').size() && $('#pt-userpage').text()!='SoSpoke' ) { // фикс глюка движка

Версия 06:08, 3 июля 2012

/* Размещённый здесь JavaScript код будет загружаться всем пользователям при обращении к каждой странице */
function addWikifButton() {
        var toolbar = document.getElementById('toolbar')
        if (!toolbar) return
        var i = document.createElement('img')
        i.src = 'https://upload.wikimedia.org/wikisource/ru/d/d1/Button-wikifikator.png'
        i.alt = i.title = 'викификатор'
        i.onclick = Wikify
        i.style.cursor = 'pointer'
        toolbar.appendChild(i)
}

function addPlayButton() {
  try {
    var logout = document.getElementById('pt-logout');
    if (logout != null) {
      document.getElementById('footer-wot-link').style.display = 'none';
    }   
  } catch(e) {
    return;
  }
}

var tacticCounter = 1;
var mapImages = new Array();

function tacticNext() {  
  document.getElementById('step' + tacticCounter).style.display = 'none';

  if (tacticCounter < mapImages.length - 1) { 
    tacticCounter++ ;
    if (tacticCounter == mapImages.length - 1) document.getElementById('nextsteplink').innerHTML = 'В начало';
  } else { 
    tacticCounter = 1; 
    document.getElementById('nextsteplink').innerHTML = 'Продолжить »';
  }

  document.getElementById('step' + tacticCounter).style.display = 'block';
  document.getElementById('tacticimg').src = mapImages[tacticCounter];
  return false;
}

function tacticSlideShow() {
  try {
    var mapDiv = document.getElementById('tacticmap');
    if (mapDiv == null) {
      return;
    }
    mapImages = mapDiv.innerHTML.split(',');
    mapDiv.innerHTML = '';
    mapDiv.style.background = 'url(' + mapImages[0] + ') top no-repeat';
    var imgNode = document.createElement( 'img' );
    imgNode.id = 'tacticimg';
    imgNode.src = mapImages[1];
    mapDiv.appendChild( imgNode );

    var aNode = document.createElement( 'a' ); 
    aNode.setAttribute( 'id', 'nextsteplink' );
    aNode.setAttribute( 'href', '#' );
    aNode.setAttribute( 'onClick', 'return tacticNext();' );
    aNode.appendChild(document.createTextNode('Продолжить »'));
    document.getElementById('nextstep').appendChild(aNode);
  } catch(e) {
    return;
  }
}

function tthToTop() {
  document.getElementById('stockTTH').style.display = 'none';
  document.getElementById('topTTH').style.display = 'block';
  return false;
}

function tthToStock() {
  document.getElementById('topTTH').style.display = 'none';
  document.getElementById('stockTTH').style.display = 'block';
  return false;
}

function tthTopStock() {
  try {
    var toStock = document.getElementById('toStock');
    var toTop = document.getElementById('toTop');
    if (toStock == null || toTop == null) {
      return;
    }

    var aNode = document.createElement( 'a' ); 
    aNode.setAttribute( 'href', '#' );
    aNode.setAttribute( 'onClick', 'return tthToTop();' );
    aNode.appendChild(document.createTextNode('топ'));
    toTop.appendChild(aNode);

    var aNode = document.createElement( 'a' ); 
    aNode.setAttribute( 'href', '#' );
    aNode.setAttribute( 'onClick', 'return tthToStock();' );
    aNode.appendChild(document.createTextNode('сток'));
    toStock.appendChild(aNode);

  } catch(e) {
    return;
  }
}

//Messages
var NavigationBarHide = '[скрыть]'
var NavigationBarShow = '[показать]'
var NavigationBarShowDefault = 2

//Collapsiblе

var hasClass = (function (){
 var reCache = {}
 return function (element, className){
   return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className)
  }
})()

/*
$(document).ready(function(){
	$("table.collapsible").each(function(idx, table){
		$(table).attr( "id", 'collapsibleTable' + idx );
	});
});

*/


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
}

// Add Hooks

addOnloadHook(addPlayButton);

if (wgAction == 'edit' || wgAction == 'submit') {
	importScriptURI('https://ru.wikipedia.org/w/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript')
	addOnloadHook(addWikifButton)
} else {
	addOnloadHook(tacticSlideShow)
	addOnloadHook(tthTopStock)
	addOnloadHook(collapsibleDivs)
	addOnloadHook(collapsibleTables)
}

var isDropDownBox = false;

$('.commentDrop').hover(
function(){
  if (!isDropDownBox) {
    $('#bodyContent').append('<div id="dropDownBox" style="position:absolute;"></div>');
    isDropDownBox = true;
  }
  var offset = $(this).position();
  var top = offset.top + $(this).height();

  var obj = $.parseJSON($(this).find(".commentData").text());

  var str = '<div style="border:1px dotted;background:#f2f2d2;padding:5px 1em;"><p style="text-align:center;"><b>' 
  + obj.type + ' ' + obj.mark + '</b></p> <dl>';

  var items = [];
  $.each(obj.data, function(key, val){
    items.push('<dt>' + key + ':</dt><dd>' + val + '</dd>');
  });

  str += items.join('') + ' </dl></div><p>&nbsp;</p>';

  $("#dropDownBox").html(str);
  $("#dropDownBox").css({"top": top + "px", "left":offset.left + "px"})
  $("#dropDownBox").show();
},
function(){
  $("#dropDownBox").hide();
});

/*  Добавление комплектации в Edittools  */
function addComplectationEdittools() {
	$('#editpage-specialchars').append('<p><u>Комплектация:</u> '+
	"<a onclick=\"insertTags('{{Комплектация|Модуль1 = |Модуль2 = |Модуль3 = |Снаряд1 = ББ |БК1 = 0 |Снаряд2 = БП |БК2 = 0 |Снаряд3 = ОФ |БК3 = 0 |Снаряжение1 = |Снаряжение2 = |Снаряжение3 = }}','','');return false\" href=\"#\">Комплектация</a> "+
	"| "+
	"<a onclick=\"insertTags('Маскировочная сеть','','');return false\" href=\"#\">Масксеть</a> "+
	"<a onclick=\"insertTags('Стереотруба','','');return false\" href=\"#\">Стереотруба</a> "+
	"<a onclick=\"insertTags('Ящик с инструментами','','');return false\" href=\"#\">Ящик</a> "+
	"<a onclick=\"insertTags('Рессоры','','');return false\" href=\"#\">Рессоры</a> "+
	"<a onclick=\"insertTags('Противоосколочный подбой','','');return false\" href=\"#\">Подбой</a> "+
	"<a onclick=\"insertTags('Улучшенная вентиляция','','');return false\" href=\"#\">Вентиляция</a> "+
	"<a onclick=\"insertTags('Мокрая боеукладка','','');return false\" href=\"#\">Боеуклад</a> "+
	"<a onclick=\"insertTags('Досылатель','','');return false\" href=\"#\">Досылатель</a> "+
	"<a onclick=\"insertTags('Дополнительные грунтозацепы','','');return false\" href=\"#\">Грунтозацепы</a> "+
	"<a onclick=\"insertTags('Заполнение баков CO2','','');return false\" href=\"#\">СО2</a> "+
	"<a onclick=\"insertTags('Просветленная оптика','','');return false\" href=\"#\">Оптика</a> "+
	"<a onclick=\"insertTags('Стабилизатор вертикальной наводки','','');return false\" href=\"#\">Стабилизатор</a> "+
	"<a onclick=\"insertTags('Усиленные приводы наводки','','');return false\" href=\"#\">Приводы</a> "+
	"<a onclick=\"insertTags('Фильтр Циклон','','');return false\" href=\"#\">Циклон</a> "+
	"| "+
	"<a onclick=\"insertTags('Малый ремкомплект','','');return false\" href=\"#\">Ремкомплект</a> "+
	"<a onclick=\"insertTags('Малая аптечка','','');return false\" href=\"#\">Аптечка</a> "+
	"<a onclick=\"insertTags('Ручной огнетушитель','','');return false\" href=\"#\">Огнетушитель</a> "+
	"<a onclick=\"insertTags('Ленд-лизное масло','','');return false\" href=\"#\">ЛЛ-масло</a> "+
	"<a onclick=\"insertTags('Качественное масло','','');return false\" href=\"#\">Кач-масло</a> "+
	"<a onclick=\"insertTags('100-Октановый бензин','','');return false\" href=\"#\">100окт-бензин</a> "+
	"<a onclick=\"insertTags('Подкрученный регулятор оборотов','','');return false\" href=\"#\">Регулятор</a> "+
	'</p>');
}

/*  Проверка контента  */
function checkContent() {
  if ( $('div.TankPerformance').length ) {
    var problems = new Array(); var problemsText = '';
    if( $('div#stockTTH.TankPerformance h3').text().indexOf("Ошибка: Значение не задано")+1 ){ problems.push('<a href="/WoT:Коды_модулей">Код техники</a>') }
    if( !$('.commentDrop').length ){ problems.push('<a href="/WoT:Коды_модулей">Комментарии модулей</a>') }
    if( !$('.skillsPanel').length ){ problems.push('<a href="/Шаблон:Навыки">Панели навыков</a>') }
    if( !$('.complect').length ){ problems.push('<a href="/WoT:Содержание_статей_о_технике#.D0.9E.D0.B1.D0.BE.D1.80.D1.83.D0.B4.D0.BE.D0.B2.D0.B0.D0.BD.D0.B8.D0.B5.2C_.D1.81.D0.BD.D0.B0.D1.80.D1.8F.D0.B6.D0.B5.D0.BD.D0.B8.D0.B5_.D0.B8_.D0.B1.D0.BE.D0.B5.D0.BA.D0.BE.D0.BC.D0.BF.D0.BB.D0.B5.D0.BA.D1.82">Примеры комплектации</a>') }
    if( $('.mw-headline').text().indexOf("Исследование и прокачка")+1 == 0 && $('.TankPerformance .mw-headline a img').attr("src") != '/uploads/2/2b/Gold_icon.png'){ problems.push('<a href="/WoT:Содержание_статей_о_технике#.D0.98.D1.81.D1.81.D0.BB.D0.B5.D0.B4.D0.BE.D0.B2.D0.B0.D0.BD.D0.B8.D0.B5_.D0.B8_.D0.BF.D1.80.D0.BE.D0.BA.D0.B0.D1.87.D0.BA.D0.B0">Раздел Исследование и прокачка</a>');}
    if( $('.mw-headline').text().indexOf("Боевая эффективность")+1 == 0 ){ problems.push('<a href="/WoT:Содержание_статей_о_технике#.D0.91.D0.BE.D0.B5.D0.B2.D0.B0.D1.8F_.D1.8D.D1.84.D1.84.D0.B5.D0.BA.D1.82.D0.B8.D0.B2.D0.BD.D0.BE.D1.81.D1.82.D1.8C">Раздел Боевая эффективность</a>') }
    if( $('div.wot-panel h3').text().indexOf("Галерея скриншотов")+1 == 0 && $('div.wot-panel h2').text().indexOf("Галерея скриншотов")+1 == 0 && $('.NavHead').text().indexOf("Галерея")+1 == 0 ){ problems.push('<a href="/WoT:Содержание_статей_о_технике#.D0.93.D0.B0.D0.BB.D0.B5.D1.80.D0.B5.D1.8F_.D1.81.D0.BA.D1.80.D0.B8.D0.BD.D1.88.D0.BE.D1.82.D0.BE.D0.B2">Галерея скриншотов</a>') }
    if( $('div.wot-panel h3').text().indexOf("Оценка")+1 == 0 ){ problems.push('<a href="/WoT:Содержание_статей_о_технике#.D0.9E.D1.86.D0.B5.D0.BD.D0.BA.D0.B0_.D0.BC.D0.B0.D1.88.D0.B8.D0.BD.D1.8B">Оценка машины</a>') }
    if( $('.mw-headline').text().indexOf("Историческая справка")+1 == 0 ){ problems.push('<a href="/WoT:Содержание_статей_о_технике#.D0.98.D1.81.D1.82.D0.BE.D1.80.D0.B8.D1.87.D0.B5.D1.81.D0.BA.D0.B0.D1.8F_.D1.81.D0.BF.D1.80.D0.B0.D0.B2.D0.BA.D0.B0">Раздел Историческая справка</a>') }
    if( !$('.navbox').length ){ problems.push('<a href="#">Навигация</a>') }

    if (problems != "") {
      for ( key in problems ) {
        problemsText += '<li>'+problems[key]+'</li>';
      }
      $('#mw-panel').append('<div class="portal" style="background:RGBA(255,0,0,0.1); padding: 7px 0px 24px 0px;"><h5>Статье требуется</h5><div class="body"><ul>'+problemsText+'</ul></div></div>');
    }
  }
}

/* Прячет боекомплект */
function makeShellsHidable() {
  $(".shells").prepend("<a href='javascript:void(0);' class='openShellsBtn' >Развернуть</a>");
  $(".shells").addClass("closed");
  $(".openShellsBtn").click(function () {
  if ( $(this).parent().is('.closed') ) { $(this).parent().removeClass("closed"); $(this).text("Свернуть"); }
  else { $(this).parent().addClass("closed"); $(this).text("Развернуть")}
  });
}

/* Прячет не заданные параметры в ТТХ */
function hideNoDataInfoInTankPerformance() { 
  $('.TankPerformance td span').each(function(key, value) { 
    if ($(value).text().indexOf('не задано')+1) $(value).parent().parent().hide();
  });
}

/*image popup*/
function addImagePopupWindow() {
  $('body').append('<div id="popupImageWindow"><table><tr><td><div id="popupImageWrapper">'+
  '<img id="popupImage" src="" /><div id="popupImageInfo"></div><div>'+
  '</td></tr></table></div>'+
  '<div id="popupImageButtons"><a id="openImageFile" href="#">Файл</a></div>');
}

function addImagePopups() {
  if(localStorage.oImagePopupOn==0) return true;
  addImagePopupWindow();
  
  $('a.image').click(function(index) {
    $('#popupImage').attr('src','');
    var srcStr = $(this).children('img').attr('src');  //Адрес картинки
    if(srcStr.indexOf('thumb')+1>0) {
      srcStr = srcStr.replace(/thumb\//gi, '');  
      srcStr = srcStr.substring(0, srcStr.lastIndexOf("/"));
    }
    
    $('#popupImageWindow table').css('background-image', 'url('+imageLoaderUrl+')');
    $('#popupImage').width('1px'); $('#popupImage').height('1px');
    $('#popupImage').attr('src',srcStr);
    $('#popupImageButtons a#openImageFile').attr('href', $(this).attr('href'));
    
    var titleStr = '';  //Подпись
    if($(this).next('div.thumbcaption').length>0) {titleStr=$(this).next('div.thumbcaption').text().trim();} 
    else if($(this).parent().parent().parent().children('div.gallerytext').length>0){titleStr=$(this).parent().parent().parent().children('div.gallerytext').text().trim();}  //слабоумие и отвага
    
    if(titleStr.trim().length > 0) {$('#popupImageInfo').text(titleStr.trim());} else {$('#popupImageInfo').text('');}
  
    $('#popupImageWrapper').hide(); $('#popupImageWindow').show(); $('#popupImageButtons').show();
    return false;
  });
  
  //  При загрузке картинки
  $('#popupImage').load(function() {
    $('#popupImage').width(''); $('#popupImage').height('');
    $(this).css('max-width', (self.innerWidth-100)+'px'); $(this).css('max-height',(self.innerHeight-100)+'px');
    $('#popupImageWindow table').css('background-image', '');
    $('#popupImageWrapper').show();
    if($('#popupImageInfo').text().trim().length > 0) {$('#popupImageInfo').show();} else {$('#popupImageInfo').hide();}
  });
  
  //Закрыть
  $('#popupImageWindow').click(function(index) {  
    $(this).hide(); $('#popupImageButtons').hide();
    $('#popupImageButtons a').attr('href', '#'); $('#popupImageInfo').text('');$('#popupImage').attr('src','');
  });
  
};


/* Выключалка на случай проблем, потом удалить */
function addImagePopupControl() {
  if(typeof(Storage)==="undefined"){return false;}
  if(typeof(localStorage.oImagePopupOn)==="undefined"){localStorage.oImagePopupOn=1;} if(localStorage.oImagePopupOn==undefined){localStorage.oImagePopupOn=1;}
  $('div#p-personal ul').prepend('<li id="pt-popupState"><a href="javascript:void(0);" title="Просмотр изображений">[выкл]</a></li>');
  if(localStorage.oImagePopupOn==1){$('#pt-popupState a').text('[вкл]');} else {$('#pt-popupState a').text('[выкл]');}
  $('li#pt-popupState').click(function (){
    if(localStorage.oImagePopupOn==1){localStorage.oImagePopupOn=0;$('#pt-popupState a').text('[выкл]');}
    else {localStorage.oImagePopupOn=1;$('#pt-popupState a').text('[вкл]');}
  })
  return true;
}


/* Дерево модулей */
function modulesBlock() {
  var currentModulesBlock = 1;
  var modulesShowTxt = [];
  modulesShowTxt[-1] = 'показать список';
  modulesShowTxt[1] = 'показать дерево';
  var modulesBlock = [];
  modulesBlock[-1] = false;
  modulesBlock[1] = $('#modulesBlock').html();
  var vehicle = $('#modulesBlock').attr("class");
  $('#modulesBlock').attr("class", "");

  $('#modulesBlockH2').html($('#modulesBlockH2').html() + '&nbsp;&nbsp;<small>[<a id="modulesBlockChange" href="#">' + modulesShowTxt[currentModulesBlock] + '</a>]</small>');
  $('#modulesBlockChange').click(function(){
    currentModulesBlock = -1 * currentModulesBlock;
    if (modulesBlock[currentModulesBlock] == false ) {
      modulesBlock[currentModulesBlock] = '<iframe frameborder="0" style="border-width: 0; width: 100%; min-width: 780px; height: 620px;" src="https://armor.kiev.ua/wot/tanks/modulestree.php?vehicle=' + vehicle + '"></iframe>';       
    }
    $('#modulesBlock').html(modulesBlock[currentModulesBlock]);
    $(this).text(modulesShowTxt[currentModulesBlock]);
    return false;
  });

  $('.treeFrame').each(function(indx){
    $(this).html('<iframe frameborder="0" style="border-width: 0; width: 100%; min-width: 1010px; height: 550px;" src="' + $(this).html() + '"></iframe>');    
  });
  $('.modulesTreeFrame').each(function(indx){
    $(this).html('<iframe frameborder="0" style="border-width: 0; width: 100%; min-width: 820px; height: 620px;" src="' + $(this).html() + '"></iframe>');    
  });
}

/* Переключатель */
function switcher() {
  $('.switcher').each(function () {
    $(this).css('width',$(this).data('width'));
    $(this).children('.switcherFrame').css('height',$(this).data('height'));
    $(this).children('.switcherFrame').css('width',$(this).data('width'));
    $(this).find('.subSwitcher').css('height',$(this).data('height'));
    $(this).find('.subSwitcher').css('width',$(this).data('width'));
    $(this).find('.subSwitcher:not(:first)').hide();
    $(this).find('.switcherControlButton:first').addClass('active');
    $(this).removeClass('hidden');
  })

  $('.switcherControlButton').click(function (){
    var buttonCkickId=$(this).data('id');
    $(this).parent().children('.switcherControlButton').removeClass('active');
    $(this).addClass('active');
    $(this).parent().parent().find('.subSwitcher').each(function() {
      if(buttonCkickId == $(this).data('id')) $(this).show();
      else $(this).hide();
    });
});

}


/*  Конфиг  */
var imageLoaderUrl = '/uploads/4/42/Loading.gif';


/*  ready  */
$(document).ready( function(){
  setTimeout(modulesBlock,0);
  setTimeout(addComplectationEdittools,0);
  setTimeout(checkContent,0);
  setTimeout(hideNoDataInfoInTankPerformance,0);
  setTimeout(makeShellsHidable,0);
  if(addImagePopupControl())setTimeout(addImagePopups,0);
  setTimeout(switcher,0);

  if ( $('div.TankPerformance').size() && $('#pt-userpage').text()!='SoSpoke' ) { // фикс глюка движка
    $('.editsection').hide();
  }
});