2023-07-16 23:53:49

This commit is contained in:
z17CX 2023-07-16 23:53:49 +00:00
parent 27e32b9802
commit 86b8a17f8e
Signed by: z17cx
GPG Key ID: 3F5F87C84EE943E4
26 changed files with 610 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea/

0
CHANGELOG.md Normal file
View File

13
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,13 @@
# Contributing
- Feedback, wishes and suggestions can be sent by email.
- Constructive criticism, bug descriptions and other reports are welcome.
- Email: mail@ihub.to
## Sources
- [**GitHub**](https://github.com/pkgstore)
- [GitLab](https://gitlab.com/pkgstore) (MIRROR)
- [Codeberg](https://codeberg.org/pkgstore) (MIRROR)
- [MosHub](https://hub.mos.ru/pkgstore) (MIRROR)
- [Git.Org.Ru](https://git.org.ru/pkgstore) (MIRROR)

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 Package Store
Copyright (c) 2023 iHub TO <https://ihub.to>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

30
MW_EXT_UI.class.php Normal file
View File

@ -0,0 +1,30 @@
<?php
namespace MediaWiki\Extension\PkgStore;
use OutputPage, Skin;
/**
* Class MW_EXT_UI
*/
class MW_EXT_UI
{
/**
* Load resource function.
*
* @param OutputPage $out
* @param Skin $skin
*
* @return void
*/
public static function onBeforePageDisplay(OutputPage $out, Skin $skin): void
{
$out->addStyle('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap', 'screen');
$out->addStyle('https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap', 'screen');
$out->addStyle('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap', 'screen');
$out->addStyle('https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,400;0,700;1,400;1,700&display=swap', 'screen');
$out->addStyle('https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css', 'screen');
$out->addStyle('/extensions/MW_EXT_UI/modules/styles/theme.css', 'screen');
$out->addModules(['ext.mw.theme']);
}
}

16
MW_EXT_UI.php Normal file
View File

@ -0,0 +1,16 @@
<?php
// Confirm MediaWiki environment.
if (!defined('MEDIAWIKI')) {
die('This file is a MediaWiki extension and thus not a valid entry point.');
}
if (function_exists('wfLoadExtension')) {
wfLoadExtension('MW_EXT_UI');
// Keep i18n globals so mergeMessageFileList.php doesn't break.
$wgExtensionMessagesFiles['MW_EXT_UI'] = __DIR__ . '/i18n';
return;
} else {
die('This version of the MW_EXT_UI extension requires MediaWiki 1.31+');
}

View File

@ -1 +1,16 @@
# mediawiki-ui-base
# Information
## Install
1. Загрузите папки и файлы в директорию `extensions/MW_EXT_UI`.
2. В самый низ файла `LocalSettings.php` добавьте строку:
```php
wfLoadExtension( 'MW_EXT_UI' );
```
## Syntax
```html
```

46
composer.json Normal file
View File

@ -0,0 +1,46 @@
{
"name": "pkgstore/mediawiki-ext-ui",
"type": "mediawiki-extension",
"description": "MediaWiki UI extension.",
"license": "MIT",
"homepage": "https://ihub.to/",
"keywords": [
"mediawiki",
"ui"
],
"authors": [
{
"name": "iHub TO",
"email": "mail@ihub.to",
"homepage": "https://ihub.to/",
"role": "Developer"
},
{
"name": "Kitsune Solar",
"email": "mail@kitsune.solar",
"homepage": "https://kitsune.solar/",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/pkgstore/mediawiki-ext-theme/issues",
"source": "https://github.com/pkgstore/mediawiki-ext-theme"
},
"require": {
"composer/installers": "^1.0.1",
"php": ">=8.2",
"pkgstore/mediawiki-ext-kernel": "*"
},
"autoload": {
"classmap": [
"MW_EXT_UI.class.php"
]
},
"config": {
"optimize-autoloader": true,
"prepend-autoloader": false
},
"extra": {
"installer-name": "MW_EXT_UI"
}
}

66
extension.json Normal file
View File

@ -0,0 +1,66 @@
{
"name": "MW_EXT_UI",
"version": "1.0.0",
"author": [
"[https://ihub.to/ iHub TO]",
"[https://kitsune.solar/ Kitsune Solar]",
"..."
],
"url": "https://ihub.to/",
"descriptionmsg": "mw-theme-desc",
"license-name": "[https://choosealicense.com/licenses/mit/ MIT]",
"type": "other",
"require": {
"MediaWiki": ">= 1.31.0",
"extensions": {
"MW_EXT_Kernel": "*"
}
},
"config": {
"EXT_Meta_FA_Version": {
"value": "5.1.0"
}
},
"AutoloadClasses": {
"MediaWiki\\Extension\\PkgStore\\MW_EXT_UI": "MW_EXT_UI.class.php"
},
"Hooks": {
"BeforePageDisplay": [
"MediaWiki\\Extension\\PkgStore\\MW_EXT_UI::onBeforePageDisplay"
]
},
"MessagesDirs": {
"MW_EXT_UI": [
"i18n"
]
},
"ResourceModules": {
"ext.mw.theme": {
"scripts": [
"scripts/functions.min.js",
"scripts/plugins.min.js",
"scripts/typography.min.js"
],
"position": "bottom",
"targets": [
"desktop",
"mobile"
]
},
"ext.mw.theme.styles": {
"styles": [
"styles/theme.css"
],
"position": "top",
"targets": [
"desktop",
"mobile"
]
}
},
"ResourceFileModulePaths": {
"localBasePath": "modules",
"remoteExtPath": "MW_EXT_UI/modules"
},
"manifest_version": 2
}

11
i18n/ru.json Normal file
View File

@ -0,0 +1,11 @@
{
"@metadata": {
"authors": [
"iHub TO"
]
},
"group-editor": "Редакторы",
"group-editor-member": "{{GENDER:$1|Редактор}}",
"grouppage-editor": "{{ns:project}}:Редакторы",
"mw-meta-desc": "Интеграция дополнительных элементов оформления в движок MediaWiki."
}

View File

@ -0,0 +1,14 @@
'use strict';
/**
* Slide & fade toggle.
* ------------------------------------------------------------------------------------------------------------------ */
jQuery.fn.slideFadeToggle = function (speed, easing, callback) {
return this.animate(
{
opacity: 'toggle',
height: 'toggle',
}, speed, easing, callback,
);
};

1
modules/scripts/functions.min.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";jQuery.fn.slideFadeToggle=function(a,b,c){return this.animate({opacity:"toggle",height:"toggle"},a,b,c)};

View File

@ -0,0 +1 @@
'use strict';

1
modules/scripts/plugins.min.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";

View File

@ -0,0 +1 @@
'use strict';

1
modules/scripts/typography.min.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";

View File

@ -0,0 +1,73 @@
/**
* Common.
* ------------------------------------------------------------------------------------------------------------------ */
html,
body {
font-family: $global-font-family;
}
a {
text-decoration: none;
&:hover {
color: #f60;
text-decoration: none;
}
&.image {
display: inline-block;
}
}
#p-logo a {
background-size: contain;
}
.mw-editsection {
float: right;
}
.wikiEditor-ui-text {
textarea {
font-family: $editor-font-family;
font-size: 1em;
}
}
#toc,
.toc {
min-width: 30em;
border: none;
background: hsl(0, 0%, 98%);
border-left: 3px solid hsl(0, 0%, 86%);
padding: 1em;
margin: 1em 0;
.toctitle {
overflow: hidden;
h2 {
display: block;
margin: 0;
text-align: left;
float: left;
}
.toctoggle {
display: block;
float: right;
}
}
}
.mw-body-content {
.mw-parser-output {
font-family: $content-font-family;
font-size: $content-font-size;
}
}
.thumb {
box-shadow: 0 2px 3px rgba(10, 10, 10, .1);
}

View File

@ -0,0 +1,116 @@
/**
* Extension: Echo.
* ------------------------------------------------------------------------------------------------------------------ */
div.oo-ui-popupWidget-popup {
//box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
}
#pt-notifications-alert,
#pt-notifications-message {
a.mw-echo-notifications-badge {
font-size: inherit;
}
}
/**
* Extension: VoteNY.
* ------------------------------------------------------------------------------------------------------------------ */
.mw-rating {
font-family: $global-font-family;
height: 3em;
overflow: hidden;
.rating-score {
display: inline-block;
float: none;
font-size: 10pt;
border-radius: .4em;
}
.rating-section {
display: inline-block;
position: relative;
.rating-total {
}
.rating-voted {
}
.vote-remove-stars-link {
font-size: 11px;
}
}
}
/**
* Extension: CharInsert.
* ------------------------------------------------------------------------------------------------------------------ */
#mw-edittools-charinsert {
padding: .5em;
border: 1px solid hsl(0, 0%, 86%);
background: #f0f0f0;
font-size: .9em;
a {
display: inline-block;
white-space: nowrap;
}
.mw-charinsert-header {
font-weight: bold;
}
}
/**
* Extension: ShortUrl.
* ------------------------------------------------------------------------------------------------------------------ */
#t-shorturl {
a {
color: #f00 !important;
font-weight: bold;
text-transform: uppercase;
}
}
.title-shortlink-container {
display: none;
float: right;
a {
display: inline-block;
}
}
/**
* Extension: SyntaxHighlight.
* ------------------------------------------------------------------------------------------------------------------ */
div.mw-highlight {
$background_color: hsl(0, 0%, 96%);
$border_color: hsl(0, 0%, 86%);
background: $background_color;
box-shadow: inset 0 1px 2px rgba(10, 10, 10, .1);
border: 1px solid $border_color;
max-height: 20rem;
margin: 1em 0;
overflow: auto;
pre {
background: transparent;
border: none;
box-shadow: none;
margin: 0;
overflow: unset;
span.lineno {
border-right: 3px solid $border_color;
color: hsl(0, 0%, 71%);
margin-right: 1rem;
}
}
}

View File

@ -0,0 +1,8 @@
span.subpages {
float: left;
}
#contentSub,
#contentSub2 {
@include clearfix();
}

View File

@ -0,0 +1,7 @@
@mixin clearfix() {
&::after {
display: block;
content: '';
clear: both;
}
}

View File

@ -0,0 +1,33 @@
/**
* Template: Information.
* ------------------------------------------------------------------------------------------------------------------ */
.file-infobox {
ol {
margin: 0;
li {
display: grid;
grid-template-columns: 10em 1fr;
list-style: none;
margin: 1px;
padding: 0;
.item-title,
.item-value {
display: block;
padding: 1em;
}
.item-title {
background: hsl(0, 0%, 96%);
font-weight: 700;
text-align: right;
}
.item-value {
background: hsl(0, 0%, 100%);
}
}
}
}

View File

@ -0,0 +1,91 @@
/**
* Article.
* ------------------------------------------------------------------------------------------------------------------ */
body {
&.ns-subject {
&.action-view {
#mw-content-text {
//font-family: $font-content;
//font-size: 1em;
p {
text-align: justify;
}
}
}
}
}
.text-center {
text-align: center;
}
/**
* Headers.
* ------------------------------------------------------------------------------------------------------------------ */
.mw-body {
@for $i from 1 through 6 {
h#{$i} {
font-family: $header-font-family;
//font-weight: $header-font-weight;
text-transform: uppercase;
}
}
}
/**
* PRE and CODE.
* ------------------------------------------------------------------------------------------------------------------ */
.mw-body {
pre,
code {
font-family: $font-family-mono;
line-height: 1.6;
}
pre {
background: hsl(0, 0%, 96%);
border: 1px solid hsl(0, 0%, 86%);
box-shadow: inset 0 1px 2px rgba(10, 10, 10, .1);
overflow: auto;
white-space: pre;
}
}
/**
* Lists.
* ------------------------------------------------------------------------------------------------------------------ */
.mw-body {
ul {
list-style-image: none;
}
}
/**
* Tables.
* ------------------------------------------------------------------------------------------------------------------ */
.mw-body {
.table-fixed {
table-layout: fixed;
}
.table-fluid {
width: 100%;
}
th {
font-family: $header-font-family;
text-transform: uppercase;
}
}
.mw-body {
.poem {
background-color: #f9f4e6;
border: 2px solid #d6d2c5;
padding: 1em;
}
}

View File

@ -0,0 +1,11 @@
$font-family-sans: 'Roboto', 'Helvetica', 'Arial', sans-serif;
$font-family-serif: 'PT Serif', 'Georgia', 'Times New Roman', 'Times', serif;
$font-family-mono: 'JetBrains Mono', 'Fira Code', 'Fira Mono', 'Consolas', monospace;
$font-family-condensed: 'Roboto Condensed', sans-serif;
$global-font-family: $font-family-sans;
$header-font-family: $font-family-condensed;
$header-font-weight: 400;
$content-font-family: $global-font-family;
$content-font-size: inherit;
$editor-font-family: $font-family-mono;

View File

@ -0,0 +1,7 @@
/**
* Widget: DISQUS.
* ------------------------------------------------------------------------------------------------------------------ */
#disqus_thread {
display: block;
}

37
modules/styles/theme.css Normal file
View File

@ -0,0 +1,37 @@
/*!
* @package variables
* @version 1.0.0
* @category css.global
* @author iHub TO
* @copyright METADATA Foundation
*/span.subpages{float:left}#contentSub::after,#contentSub2::after{display:block;content:'';clear:both}/*!
* @package common
* @version 1.0.0
* @category css.global
* @author iHub TO
* @copyright METADATA Foundation
*/html,body{font-family:"Roboto","Helvetica","Arial",sans-serif}a{text-decoration:none}a:hover{color:#f60;text-decoration:none}a.image{display:inline-block}#p-logo a{background-size:contain}.mw-editsection{float:right}.wikiEditor-ui-text textarea{font-family:"Fira Code","Fira Mono",monospace;font-size:1em}#toc,.toc{min-width:30em;border:none;background:#fafafa;border-left:3px solid #dbdbdb;padding:1em;margin:1em 0}#toc .toctitle,.toc .toctitle{overflow:hidden}#toc .toctitle h2,.toc .toctitle h2{display:block;margin:0;text-align:left;float:left}#toc .toctitle .toctoggle,.toc .toctitle .toctoggle{display:block;float:right}.mw-body-content .mw-parser-output{font-family:"Roboto","Helvetica","Arial",sans-serif;font-size:inherit}.thumb{box-shadow:0 2px 3px rgba(10,10,10,0.1)}/*!
* @package template
* @version 1.0.0
* @category css.global
* @author iHub TO
* @copyright METADATA Foundation
*/.file-infobox ol{margin:0}.file-infobox ol li{display:grid;grid-template-columns:10em 1fr;list-style:none;margin:1px;padding:0}.file-infobox ol li .item-title,.file-infobox ol li .item-value{display:block;padding:1em}.file-infobox ol li .item-title{background:#f5f5f5;font-weight:700;text-align:right}.file-infobox ol li .item-value{background:#fff}/*!
* @package extension
* @version 1.0.0
* @category css.global
* @author iHub TO
* @copyright METADATA Foundation
*/#pt-notifications-alert a.mw-echo-notifications-badge,#pt-notifications-message a.mw-echo-notifications-badge{font-size:inherit}.mw-rating{font-family:"Roboto","Helvetica","Arial",sans-serif;height:3em;overflow:hidden}.mw-rating .rating-score{display:inline-block;float:none;font-size:10pt;border-radius:.4em}.mw-rating .rating-section{display:inline-block;position:relative}.mw-rating .rating-section .vote-remove-stars-link{font-size:11px}#mw-edittools-charinsert{padding:.5em;border:1px solid #dbdbdb;background:#f0f0f0;font-size:.9em}#mw-edittools-charinsert a{display:inline-block;white-space:nowrap}#mw-edittools-charinsert .mw-charinsert-header{font-weight:bold}#t-shorturl a{color:#f00 !important;font-weight:bold;text-transform:uppercase}.title-shortlink-container{display:none;float:right}.title-shortlink-container a{display:inline-block}div.mw-highlight{background:#f5f5f5;box-shadow:inset 0 1px 2px rgba(10,10,10,0.1);border:1px solid #dbdbdb;max-height:20rem;margin:1em 0;overflow:auto}div.mw-highlight pre{background:transparent;border:none;box-shadow:none;margin:0;overflow:unset}div.mw-highlight pre span.lineno{border-right:3px solid #dbdbdb;color:#b5b5b5;margin-right:1rem}/*!
* @package widget
* @version 1.0.0
* @category css.global
* @author iHub TO
* @copyright METADATA Foundation
*/#disqus_thread{display:block}/*!
* @package typography
* @version 1.0.0
* @category css.global
* @author iHub TO
* @copyright METADATA Foundation
*/body.ns-subject.action-view #mw-content-text p{text-align:justify}.text-center{text-align:center}.mw-body h1{font-family:"Roboto Condensed",sans-serif;text-transform:uppercase}.mw-body h2{font-family:"Roboto Condensed",sans-serif;text-transform:uppercase}.mw-body h3{font-family:"Roboto Condensed",sans-serif;text-transform:uppercase}.mw-body h4{font-family:"Roboto Condensed",sans-serif;text-transform:uppercase}.mw-body h5{font-family:"Roboto Condensed",sans-serif;text-transform:uppercase}.mw-body h6{font-family:"Roboto Condensed",sans-serif;text-transform:uppercase}.mw-body pre,.mw-body code{font-family:"Fira Code","Fira Mono",monospace;line-height:1.6}.mw-body pre{background:#f5f5f5;border:1px solid #dbdbdb;box-shadow:inset 0 1px 2px rgba(10,10,10,0.1);overflow:auto;white-space:pre}.mw-body ul{list-style-image:none}.mw-body .table-fixed{table-layout:fixed}.mw-body .table-fluid{width:100%}.mw-body th{font-family:"Roboto Condensed",sans-serif;text-transform:uppercase}.mw-body .poem{background-color:#f9f4e6;border:2px solid #d6d2c5;padding:1em}

View File

@ -0,0 +1,8 @@
@import 'variables.scss';
@import 'mixin.scss';
@import 'fixed.scss';
@import 'common.scss';
@import 'template.scss';
@import 'extension.scss';
@import 'widget.scss';
@import 'typography.scss';