Перейти к содержанию

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

Нет описания правки
Нет описания правки
Строка 39: Строка 39:
         applyTheme(activeTheme);
         applyTheme(activeTheme);


         let selectHtml = '<div id="p-tg-theme" class="vector-menu vector-dropdown vector-user-menu-logged-in" style="margin-right: 8px; display: inline-block !important; vertical-align: middle !important; position: relative;">';
         let selectHtml = '<div id="p-tg-theme" style="margin: 0 10px; display: inline-block !important; vertical-align: middle !important; position: relative; width: 36px !important; height: 36px !important;">';
         selectHtml += '<input type="checkbox" id="p-tg-theme-dropdown-checkbox" role="button" aria-haspopup="true" class="vector-dropdown-checkbox">';
         selectHtml += '<input type="checkbox" id="p-tg-theme-dropdown-checkbox" role="button" aria-haspopup="true" class="vector-dropdown-checkbox" style="display: none !important;">';
         selectHtml += '<label id="p-tg-theme-dropdown-label" for="p-tg-theme-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--weight-quiet cdx-button--icon-only" aria-label="Смена темы" title="Выбрать тему фракции" style="display: flex !important; width: 32px !important; height: 32px !important; align-items: center; justify-content: center; border: 1px solid var(--border-color, #444) !important; background: var(--bg-input, #222) !important; cursor: pointer; padding: 0 !important; box-sizing: border-box !important;">';
         selectHtml += '<label id="p-tg-theme-dropdown-label" for="p-tg-theme-dropdown-checkbox" aria-label="Смена темы" title="Выбрать тему фракции" style="display: flex !important; width: 36px !important; height: 36px !important; align-items: center; justify-content: center; cursor: pointer; padding: 0 !important; margin: 0 !important; border: none !important; background: transparent !important;">';
         selectHtml += '<span class="tg-custom-palette-icon" style="display: block !important; width: 26px !important; height: 26px !important;"></span>';
         selectHtml += '<span class="tg-custom-palette-icon" style="display: block !important; width: 32px !important; height: 32px !important;"></span>';
         selectHtml += '</label>';
         selectHtml += '</label>';
         selectHtml += '<div class="vector-dropdown-content" style="padding: 8px; min-width: 180px; display: none; position: absolute; top: 100%; right: 0; z-index: 1000;">';
         selectHtml += '<div class="vector-dropdown-content" style="padding: 8px; min-width: 180px; display: none; position: absolute; top: 110%; right: 0; z-index: 1000;">';
         selectHtml += '<ul class="vector-menu-content-list" style="margin: 0; padding: 0; list-style: none;">';
         selectHtml += '<ul class="vector-menu-content-list" style="margin: 0; padding: 0; list-style: none;">';


Строка 91: Строка 91:
     e.preventDefault();
     e.preventDefault();
     const chosenTheme = $(this).data('theme');
     const chosenTheme = $(this).data('theme');
 
   
     const classes = ['theme-stddark', 'theme-nanotrasen', 'theme-syndicate', 'theme-plasmafire', 'theme-clockcult', 'theme-bloodcult', 'theme-heretic', 'theme-default'];
     const classes = ['theme-stddark', 'theme-nanotrasen', 'theme-syndicate', 'theme-plasmafire', 'theme-clockcult', 'theme-bloodcult', 'theme-heretic', 'theme-default'];
     classes.forEach(id => document.body.classList.remove(id));
     classes.forEach(id => document.body.classList.remove(id));