Тема оформления:Cosmos

From mediawiki.org
This page is a translated version of the page Skin:Cosmos and the translation is 93% complete.
Outdated translations are marked like this.
MediaWiki skins manual - category
Cosmos
Release status: stable
Description Cosmos - тема оформления, разработанная на основе темы оформления Oasis ФЭНДОМа. Предназначена для улучшения их дизайна и обеспечения эффективной темы оформления MediaWiki для участников, не являющихся пользователями ФЭНДОМа, или для пользователей, выходящих из ФЭНДОМа.
Author(s)
Latest version 7.0.0 (2023-05-11)
Compatibility policy Snapshots releases along with MediaWiki. Master is not backwards compatible.
MediaWiki 1.39.0+
License GNU General Public License 3.0 or later
Download
README.md
Присоединяйтесь к серверу Cosmos в Discord, если вам требуется немедленная помощь, или создайте задачу на Фабрикаторе об этом (ссылка ниже).
Example Cosmos Example Wiki, Wikimedia Skins Lab
Parameters
  • $wgCosmosWordmark
  • $wgCosmosBannerBackgroundColor
  • $wgCosmosWikiHeaderBackgroundImage
  • $wgCosmosBackgroundImage
  • $wgCosmosMainBackgroundColor
  • $wgCosmosContentBackgroundColor
  • $wgCosmosBackgroundImageSize
  • $wgCosmosContentWidth
  • $wgCosmosButtonBackgroundColor
  • $wgCosmosToolbarBackgroundColor
  • $wgCosmosFooterBackgroundColor
  • $wgCosmosLinkColor
  • $wgCosmosSocialProfileAllowBio
  • $wgCosmosSocialProfileFollowBioRedirects
  • $wgCosmosSocialProfileModernTabs
  • $wgCosmosSocialProfileRoundAvatar
  • $wgCosmosSocialProfileShowEditCount
  • $wgCosmosSocialProfileShowGroupTags
  • $wgCosmosSocialProfileTagGroups
  • $wgCosmosSocialProfileNumberofGroupTags
  • $wgCosmosUseSocialProfileAvatar
  • $wgCosmosEnablePortableInfoboxEuropaTheme
  • $wgCosmosBackgroundImageRepeat
  • $wgCosmosBackgroundImageFixed
  • $wgCosmosContentOpacityLevel
  • $wgCosmosEnabledRailModules
  • $wgCosmosRailDisabledNamespaces
  • $wgCosmosRailDisabledPages
  • $wgCosmosEnableWantedPages
  • $wgCosmosFetchWantedPagesFromCache
  • $wgCosmosWantedPagesMaxTitlesCount
  • $wgCosmosWantedPagesFetchedNamespaces
Quarterly downloads 97 (Ranked 7th)
Public wikis using 25 (Ranked 71st)
Public wikis using as default skin 2
Translate the Cosmos skin if it is available at translatewiki.net
Issues : Open tasks · Report a bug

Cosmos - тема оформления, разработанная на основе темы оформления Oasis ФЭНДОМа. Предназначены для улучшения их дизайна и обеспечения эффективной темы оформления MediaWiki для участников, не являющихся пользователями ФЭНДОМа, или для пользователей, выходящих из ФЭНДОМа. Если вы хотите узнать, как сделать свой вклад, пожалуйста, прочитайте наше руководство.


Установка

  • Скачайте и распакуйте файл(ы) в папку с именем «Cosmos» в папке skins/ вашего сайта.
  • Добавьте следующий код в ваш файл LocalSettings.php :
    wfLoadSkin( 'Cosmos' );
    
  • Настройте, как вам требуется.
  • Yes Готово - Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что тема оформления успешно установлена.

Настройка

Эти настройки будут применяться, когда Cosmos является активной темой оформления.

Опция Тип Значение по умолчанию Требует Документация
$wgCosmosWordmark Строка; полный URL-адрес или имя файла
  • $wgLogos['wordmark']['src'] (if exists)
  • $wgLogos['1x'] (if exists; fallback)
  • false (if neither of the above exist)
Добавляет текстовую метку в вики-навигацию
$wgCosmosBannerBackgroundColor Строка; название цвета или шестнадцатеричный код '#c0c0c0' Изменяет цвет фона верхнего баннера (с раскрывающимся списком "Личные инструменты").
$wgCosmosWikiHeaderBackgroundImage Строка; полный URL-адрес или название файла false Добавляет фоновое изображение в заголовок вики (с навигационными ссылками сайта); комбинирует изображение с цветами заголовка с помощью градиента.
$wgCosmosWikiHeaderBackgroundColor Строка; название цвета или шестнадцатеричный код '#c0c0c0' Изменяет цвет фона заголовка вики (тот, который содержит ссылки для навигации по сайту); $wgCosmosWikiHeaderBackgroundImage используется для смешивания изображения с этим цветом, если изображение задано.
$wgCosmosBackgroundImage Строка; полный URL-адрес или название файла false Добавляет фоновое изображение в тело страницы (за областью содержимого); эффективно устраняет $wgCosmosMainBackgroundColor, так как изображение будет покрывать цвет.
$wgCosmosMainBackgroundColor Строка; название цвета или шестнадцатеричный код '#1A1A1A' Добавляет цвет фона к телу страницы (за областью содержимого); эффективно отменяется $wgCosmosBackgroundImage, так как изображение будет перекрывать цвет.
$wgCosmosContentBackgroundColor Строка; название цвета или шестнадцатеричный код '#ffffff' Изменение цвета фона основной области содержимого вики-статьи; $wgCosmosContentOpacityLevel используйте это для создания уровня непрозрачности цвета фона в стиле RGBA.
$wgCosmosBackgroundImageSize Строка; auto, contain или cover 'cover' $wgCosmosBackgroundImage set; Задает размер фонового изображения для фона тела, если он установлен; хотя строка принимает любые значения, рекомендуется использовать одно из следующих: auto, contain или cover.
$wgCosmosContentWidth String; default, large, or full 'default' Sets the main content area width. Can be 'default', 'large', or 'full'. 'default' means the width is 1024px on screen sizes 1084px to 1595px, and 1178px on screen sizes 1596px and above. 'large' means it is the default (for the relevent screen size) plus 176px. 'full' will set the width to 'auto' for either screen size. In addition if it is set to 'full', the screen-size specific max-width, and padding on #mw-content-wrapper are not set on either of the mentioned screen sizes, and use the default ones or that of lower screen sizes, making max-width much larger, and making the content area have much less padding.
$wgCosmosButtonBackgroundColor Строка; название цвета или шестнадцатеричный код '#c0c0c0' Изменяет цвет фона кнопок действий страницы для Cosmos; также устанавливает цвет PortableInfobox через смешивание, если расширение установлено.
$wgCosmosToolbarBackgroundColor Строка; название цвета или шестнадцатеричный код '#000000' Изменяет цвет фона плавающей панели инструментов внизу.
$wgCosmosFooterBackgroundColor Строка; название цвета или шестнадцатеричный код '#c0c0c0' Изменяет цвет фона колонтитула; колонтитул всегда имеет непрозрачность 0.8, поэтому эта переменная преобразуется в RGBA для установки этой непрозрачности.
$wgCosmosBackgroundImageRepeat Логическое false $wgCosmosBackgroundImage set; если true, то фоновое изображение будет установлено на 'repeat', если false, то на 'no-repeat'.
$wgCosmosBackgroundImageFixed Логическое true $wgCosmosBackgroundImage set; Если true, то фоновое изображение будет установлено на position: fixed;.
$wgCosmosLinkColor Строка; название цвета или шестнадцатеричный код '#0645ad' Меняет цвет ссылок.
$wgCosmosContentOpacityLevel Целое число 100 $wgCosmosContentBackgroundColor set; Установите непрозрачность фона области содержимого в процентах, без символа процента (%).
$wgCosmosRailDisabledNamespaces Массив [ NS_SPECIAL, NS_MEDIAWIKI, NS_MEDIAWIKI_TALK ] List of namespace constants or IDs to always hide the rail in.
$wgCosmosRailDisabledPages Массив [ 'mainpage' ] List of page titles or 'mainpage' to always hide the rail in. Works exactly like __NORAIL__ magic word.
$wgCosmosEnableWantedPages Логическое true Whether or not to enable the WantedPages feature of the create page dialog.
$wgCosmosFetchWantedPagesFromCache Логическое false Whether or not to fetch the wanted pages shown within the create page dialog from cache. If enabled you will need to run php updateSpecialPages.php --only=WantedPages in order to update the wanted pages. It is recommended to set this to true on large wikis.
$wgCosmosWantedPagesMaxTitlesCount Целое число 6 Set to the max number of wanted pages to display in the create page dialog, if wanted pages are enabled.
$wgCosmosWantedPagesFetchedNamespaces Массив [ NS_MAIN ] Set to an array of namespaces to fetch wanted pages from, if wanted pages are enabled for the create page dialog.
Associative arrays
Опция Значение по умолчанию Документация
$wgCosmosEnabledRailModules
 'recentchanges' => false,
 'interface' => [
       'cosmos-custom-rail-module' => 'normal',
       'cosmos-custom-sticky-rail-module' => 'sticky'
 ]
Sets which rail modules will be enabled on Cosmos, and whether they are 'sticky' or 'normal'. 'interface' can be an array of any size with a list of interface messages for Cosmos to recognize as a new custom right rail. For any rail module, it can be mapped to either 'normal' or 'sticky', 'normal' will make them stay in a fixed position on the page, and 'sticky' makes them stick to the page as you scroll down. Setting it to false will disable the specific rail module entirely. If interface messages, set in the config are set to '-', don't exist, or are completely empty, it will treat them as disabled and won't appear in the rail at all. If no modules are appearing in rail, then the article area will expand to cover the rail area. If you don't have JavaScript enabled in your browser, then it is recommended to only have one sticky rail module enabled at the same time, otherwise they will overlap on top of each other. Also see other configs for rail.

Параметры конфигурации расширений

SocialProfile

Эти параметры конфигурации требуют установки SocialProfile для их использования.

Опция Тип Значение по умолчанию Требуется Документация
$wgCosmosSocialProfileAllowBio Логическое true Allows users to add a bio to display on their user pages, through Special:MyPage/bio.
$wgCosmosSocialProfileFollowBioRedirects Логическое false $wgCosmosSocialProfileAllowBio set to true Whether or not to follow redirects from Special:MyPage/bio and display the redirect target as bio instead. (experimental)
$wgCosmosSocialProfileModernTabs Логическое true Включает современную версию вкладок на страницах профиля SocialProfile.
$wgCosmosSocialProfileRoundAvatar Логическое true Делает аватар круглым на страницах профиля SocialProfile.
$wgCosmosSocialProfileShowEditCount Логическое true Показывает количество правок и дату регистрации пользователя на страницах профиля SocialProfile под его именем пользователя.
$wgCosmosSocialProfileShowGroupTags Логическое true $wgCosmosNumberofGroupTags set and more than zero; $wgCosmosProfileTagGroups set with at least one usergroup in the array Включает отображение тегов групп пользователей рядом с именем пользователя на страницах профиля SocialProfile.
$wgCosmosSocialProfileTagGroups Массив [ 'bureaucrat', 'bot', 'sysop', 'interface-admin' ] $wgCosmosSocialProfileNumberofGroupTags set and more then zero; $wgCosmosSocialProfileShowGroupTags set to true Массив групп пользователей, которые будут отображаться на страницах SocialProfile, если они есть у пользователя.
$wgCosmosSocialProfileNumberofGroupTags Целое число 2 $wgCosmosSocialProfileTagGroups set with at least one usergroup in the array; $wgCosmosSocialProfileShowGroupTags set to true Установите максимальное количество групповых тегов, которые будут отображаться на странице SocialProfile пользователя, если они у него есть.
$wgCosmosUseSocialProfileAvatar Логическое true Использовать аватар SocialProfile в качестве аватара рядом с именем пользователя в верхнем баннере (баннер с выпадающим персональными инструментами). Если у пользователя нет аватара, а этот параметр установлен, будет использоваться аватар SocialProfile по умолчанию.

PortableInfobox

Эти параметры конфигурации требуют установки PortableInfobox для их использования.

Опция Тип Значение по умолчанию Требуется Документация
$wgCosmosEnablePortableInfoboxEuropaTheme Логическое true $wgCosmosButtonBackgroundColor set; Включает тему Europa из расширения portable infobox Fandom's в портированном расширении.

Usage

Интерфейс

MediaWiki:Cosmos-tagline
Изменяет текст названия сайта в заголовке вики. По умолчанию имеет значение MediaWiki:Sitename.
MediaWiki:Cosmos-navigation
Изменяет навигацию сайта для этой темы оформления; по умолчанию используется MediaWiki:Sidebar, хотя для достижения наилучших результатов рекомендуется скопировать MediaWiki:Sidebar в MediaWiki:Cosmos-navigation и следовать формату навигации Cosmos. Эта навигация может иметь глубину до 3 уровней и позволяет использовать несколько переменных:
  • {$NEWVIDEOS_CONDITIONAL} (alternatively, {$NEWVIDEOS}) will display a link to Special:NewVideos only when the Video extension is enabled.
  • {$WANTEDPAGES_CONDITIONAL} (alternatively, {$WANTEDPAGES}) will display a link to Special:WantedPages only when the Video extension is not enabled.
  • {$WANTEDPAGES_FORCE} will display a link to Special:WantedPages regardless of if the Video extension is enabled or not.

The navigation should be in the format of:


*#|Community
**mainpage|mainpage-description
**recentchanges-url|recentchanges
**portal-url|portal
*link|Tab title/level one
**Level 2 tab title
***Level 3 content 1

*cosmos-explore
**recentchanges-url|recentchanges
**randompage-url|randompage
**Special:NewFiles|cosmos-newfiles
{$NEWVIDEOS_CONDITIONAL}
{$WANTEDPAGES_CONDITIONAL}

and, defaults to:


{{int:Sidebar}}
*cosmos-explore
**recentchanges-url|recentchanges
**randompage-url|randompage
**Special:NewFiles|cosmos-newfiles
{$NEWVIDEOS_CONDITIONAL}
{$WANTEDPAGES_CONDITIONAL}

Parser functions

Cosmos provides a couple parser functions:

  • {{#ADDITIONALBODYCLASS}}
    • Description: Allows to add additional body class to particular pages to allow for further per-page customisation with CSS. Available as of version 6.2.0.
    • Usage: {{#ADDITIONALBODYCLASS:class-name}}
  • __NORAIL__
    • Description: provides a magic word to hide the rail on particular pages. Available as of version 6.0.0.
    • Usage: Put __NORAIL__ at the top of the page you want to hide the rail on.

Примечания

  • On large wikis, it is recommended to set either $wgCosmosEnableWantedPages = false; or $wgCosmosFetchWantedPagesFromCache = true; (both available since version 6.2.0), otherwise it can have significant performance impact.
  • As of version 6.2.0, MediaWiki:Cosmos-navigation is cached to provide performance improvements and not fetch this on every page load. This cache is reset when any interface message is updated.
  • As of version 5.0.0 Cosmos has a special page, Special:ThemeDesigner, that allows some theme-related Cosmos configs be modified on-wiki. It also comes with the themdesigner right, which is given to sysops by default and is required in order to enter Special:ThemeDesigner. This is a highly experimental feature.
  • As of version 4.0.0, Cosmos supports MediaWiki 1.36.
  • Cosmos uses the Special:Statistics article count, therefore setting $wgArticleCountMethod = 'any'; and afterwards running maintenance/UpdateArticleCount.php will make that counter use all content pages.
    • Counter will not display at all if user does not have the read userright.
  • Иконка "Admin Dashboard" появится, если установлено расширение AdminLinks и у вас есть необходимые права (adminlinks).
  • Ссылки на Special:AddVideo появятся, если установлено расширение Video и у вас есть необходимое право (addvideo).
  • По умолчанию Cosmos использует cookies для sitenotice. Если установлено расширение DismissableSiteNotice, то Cosmos будет использовать это расширение вместо него.
  • Cosmos поддерживает уведомления Echo. Если расширение Echo установлено и пользователь вошел в систему, то Cosmos будет отображать значки уведомлений рядом с меню личных инструментов.
  • В Cosmos есть метод создания статьи, позволяющий легко создавать статьи через всплывающее окно.
    • Will not appear if user does not have both the edit and createpage rights.
  • Cosmos supports the mobile responsiveness preference provided by MediaWiki core.
  • Cosmos протестирован и работает с VisualEditor.
  • Существуют классы body для главной страницы, для того, вошел ли пользователь в систему или нет, и для того, установлена ли тема $wgCosmosContentBackgroundColor на светлую или темную (классы theme-dark или theme-light).

Планируемые функции

  • All the formerly planned features have now been implemented. If you wish to request a feature, please do so on the talk page of this skin.