MediaWiki:Common.js: відмінності між версіями

нема опису редагування
Немає опису редагування
Немає опису редагування
Рядок 252: Рядок 252:
     var $tabs = $('.player-tab');
     var $tabs = $('.player-tab');
     var $contents = $('.player-tab-content');
     var $contents = $('.player-tab-content');
    var $lbox = $('.l-box');
      
      
     if ($tabs.length === 0) return;
     if ($tabs.length === 0) return;
Рядок 265: Рядок 266:
         $contents.removeClass('active');
         $contents.removeClass('active');
         $content.addClass('active');
         $content.addClass('active');
       
        // Ховаємо/показуємо l-box залежно від табу
        if (tabId === 'games') {
            $lbox.fadeOut(200);
        } else {
            $lbox.fadeIn(200);
        }
          
          
         // Lazy load для ігор
         // Lazy load для ігор
Рядок 271: Рядок 279:
              
              
             if (playerName) {
             if (playerName) {
                // Завантажуємо через API
                var apiUrl = mw.util.getUrl('Спеціальна:ExpandTemplates');
               
                 $.ajax({
                 $.ajax({
                     url: mw.config.get('wgScriptPath') + '/api.php',
                     url: mw.config.get('wgScriptPath') + '/api.php',
Рядок 285: Рядок 290:
                     success: function(response) {
                     success: function(response) {
                         if (response.expandtemplates && response.expandtemplates.wikitext) {
                         if (response.expandtemplates && response.expandtemplates.wikitext) {
                            // Парсимо wikitext в HTML
                             $.ajax({
                             $.ajax({
                                 url: mw.config.get('wgScriptPath') + '/api.php',
                                 url: mw.config.get('wgScriptPath') + '/api.php',
Рядок 300: Рядок 304:
                                         $content.html(parseResponse.parse.text['*']);
                                         $content.html(parseResponse.parse.text['*']);
                                         $content.data('loaded', true);
                                         $content.data('loaded', true);
                                       
                                        // Ініціалізуємо сортування таблиці
                                         $content.find('table.sortable').tablesorter();
                                         $content.find('table.sortable').tablesorter();
                                     }
                                     }