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

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

Отмена версии 8958, сделанной Glamyr (обсуждение)
Метка: отмена
Нет описания правки
 
(не показана 1 промежуточная версия этого же участника)
Строка 20: Строка 20:
         applyTheme(activeTheme);
         applyTheme(activeTheme);


         let selectHtml = '<div id="p-tg-theme" style="margin: 0 10px; display: inline-block; vertical-align: middle; position: relative; width: 36px; height: 36px;">';
         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" style="display: none !important;">';
         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" aria-label="Смена темы" title="Выбрать тему фракции" style="display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; cursor: pointer; padding: 0; margin: 0; border: none; background: transparent;">';
         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"></span>';
         selectHtml += '<span class="tg-custom-palette-icon"></span>';
         selectHtml += '</label>';
         selectHtml += '</label>';
         selectHtml += '<div class="vector-dropdown-content" style="padding: 8px; min-width: 180px; display: none; position: absolute; top: 110%; right: 0; z-index: 1000;">';
         selectHtml += '<div class="vector-dropdown-content" id="p-tg-dropdown-menu" style="padding: 8px; min-width: 180px; display: none; position: absolute; top: 110%; right: 0; z-index: 10000;">';
         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;">';


         const names = { 'theme-stddark': 'Standard Dark', 'theme-nanotrasen': 'Nanotrasen TGUI', 'theme-syndicate': 'Syndicate TGUI', 'theme-plasmafire': 'Plasmafire', 'theme-clockcult': 'Clock Cult', 'theme-bloodcult': 'Blood Cult', 'theme-heretic': 'Heretic', 'theme-default': 'Standard Light' };
         const names = { 'theme-stddark': 'Standard Dark', 'theme-nanotrasen': 'Nanotrasen TGUI', 'theme-syndicate': 'Syndicate TGUI', 'theme-plasmafire': 'Plasmafire', 'theme-clockcult': 'Clock Cult', 'theme-bloodcult': 'Blood Cult', 'theme-heretic': 'Heretic', 'theme-default': 'Standard Light' };
         classes.forEach(id => {
         classes.forEach(id => {
             selectHtml += `<li style="margin: 4px 0;"><a href="#" class="tg-theme-item" data-theme="${id}" style="display: block; padding: 6px 8px; border-radius: 4px; text-decoration: none;">${names[id]}</a></li>`;
             selectHtml += '<li style="margin: 4px 0;"><a href="#" class="tg-theme-item" data-theme="' + id + '" style="display: block; padding: 6px 8px; border-radius: 4px; text-decoration: none;">' + names[id] + '</a></li>';
         });
         });
         selectHtml += '</ul></div></div>';
         selectHtml += '</ul></div></div>';