父节点
435ba3ce00
当前提交
8d9230b2f3
|
@ -8,5 +8,5 @@
|
|||
],
|
||||
"@babel/preset-react"
|
||||
],
|
||||
"plugins": [],
|
||||
"plugins": []
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"root": true,
|
||||
"plugins": [
|
||||
"es5",
|
||||
"compat"
|
||||
],
|
||||
"plugins": ["es5", "compat"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:compat/recommended",
|
||||
|
|
34
.hintrc
34
.hintrc
|
@ -1,19 +1,19 @@
|
|||
{
|
||||
"extends": [
|
||||
"development"
|
||||
],
|
||||
"browserslist": [
|
||||
"defaults",
|
||||
"not ie < 11"
|
||||
],
|
||||
"hints": {
|
||||
"compat-api/css": [
|
||||
"default",
|
||||
{
|
||||
"ignore": [
|
||||
"@-moz-document"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
"extends": [
|
||||
"development"
|
||||
],
|
||||
"browserslist": [
|
||||
"defaults",
|
||||
"not ie < 11"
|
||||
],
|
||||
"hints": {
|
||||
"compat-api/css": [
|
||||
"default",
|
||||
{
|
||||
"ignore": [
|
||||
"@-moz-document"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php" />
|
||||
<arg name="encoding" value="UTF-8" />
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php" />
|
||||
<arg name="encoding" value="UTF-8" />
|
||||
</ruleset>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# About *Common Program of Qiuwen Baike* 关于《求闻百科共同纲领》
|
||||
# About _Common Program of Qiuwen Baike_ 关于《求闻百科共同纲领》
|
||||
|
||||
The development of this software is subject to the *Common Program of Qiuwen Baike*, which is a constitutional document of *Qiuwen Baike* and its community and plays the role similar to Code of Conduct in other open-source communities.
|
||||
The development of this software is subject to the _Common Program of Qiuwen Baike_, which is a constitutional document of _Qiuwen Baike_ and its community and plays the role similar to Code of Conduct in other open-source communities.
|
||||
|
||||
本软件之开发遵循《求闻百科共同纲领》,该文件为求闻百科纲领性文件,起到类似其他开源社区中“行为准则”的作用。
|
||||
|
||||
You can read the *Common Program* at <https://qwbk.org/c/31162>.
|
||||
You can read the _Common Program_ at <https://qwbk.org/c/31162>.
|
||||
|
||||
您可以在下列网址查阅《共同纲领》:<https://qwbk.org/c/31162>。
|
||||
|
|
36
Gruntfile.js
36
Gruntfile.js
|
@ -1,33 +1,25 @@
|
|||
'use strict';
|
||||
"use strict";
|
||||
|
||||
module.exports = function ( grunt ) {
|
||||
const conf = grunt.file.readJSON( 'extension.json' );
|
||||
module.exports = function (grunt) {
|
||||
const conf = grunt.file.readJSON("extension.json");
|
||||
|
||||
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
||||
grunt.loadNpmTasks( 'grunt-eslint' );
|
||||
grunt.loadNpmTasks( 'grunt-stylelint' );
|
||||
grunt.loadNpmTasks("grunt-banana-checker");
|
||||
grunt.loadNpmTasks("grunt-eslint");
|
||||
grunt.loadNpmTasks("grunt-stylelint");
|
||||
|
||||
grunt.initConfig( {
|
||||
grunt.initConfig({
|
||||
eslint: {
|
||||
options: {
|
||||
cache: true
|
||||
cache: true,
|
||||
},
|
||||
all: [
|
||||
'**/*.{js,json}',
|
||||
'!node_modules/**',
|
||||
'!vendor/**'
|
||||
]
|
||||
all: ["**/*.{js,json}", "!node_modules/**", "!vendor/**"],
|
||||
},
|
||||
stylelint: {
|
||||
all: [
|
||||
'**/*.{css,less}',
|
||||
'!node_modules/**',
|
||||
'!vendor/**'
|
||||
]
|
||||
all: ["**/*.{css,less}", "!node_modules/**", "!vendor/**"],
|
||||
},
|
||||
banana: conf.MessagesDirs
|
||||
} );
|
||||
banana: conf.MessagesDirs,
|
||||
});
|
||||
|
||||
grunt.registerTask( 'test', [ 'eslint', 'banana', 'stylelint' ] );
|
||||
grunt.registerTask( 'default', 'test' );
|
||||
grunt.registerTask("test", ["eslint", "banana", "stylelint"]);
|
||||
grunt.registerTask("default", "test");
|
||||
};
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
DarkMode
|
||||
========
|
||||
# DarkMode
|
||||
|
||||
A MediaWiki extension to add a toggleable dark mode for the MediaWiki user interface.
|
||||
|
||||
https://www.mediawiki.org/wiki/Extension:DarkMode
|
||||
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
{
|
||||
"name": "DarkMode",
|
||||
"version": "0.3.0",
|
||||
"author": [
|
||||
"MusikAnimal",
|
||||
"R4356th",
|
||||
"AnYi",
|
||||
"WaitSpring"
|
||||
],
|
||||
"author": ["MusikAnimal", "R4356th", "AnYi", "WaitSpring"],
|
||||
"url": "https://git.qiuwen.wiki/Fork/mediawiki-extensions-DarkMode",
|
||||
"descriptionmsg": "darkmode-desc",
|
||||
"license-name": "GPL-3.0",
|
||||
|
@ -23,24 +18,16 @@
|
|||
"HookHandlers": {
|
||||
"main": {
|
||||
"class": "MediaWiki\\Extension\\DarkMode\\Hooks",
|
||||
"services": [
|
||||
"MainConfig"
|
||||
]
|
||||
"services": ["MainConfig"]
|
||||
}
|
||||
},
|
||||
"MessagesDirs": {
|
||||
"DarkMode": [
|
||||
"i18n"
|
||||
]
|
||||
"DarkMode": ["i18n"]
|
||||
},
|
||||
"ResourceModules": {
|
||||
"ext.DarkMode": {
|
||||
"dependencies": [
|
||||
"mediawiki.api"
|
||||
],
|
||||
"packageFiles": [
|
||||
"ext.DarkMode.js"
|
||||
],
|
||||
"dependencies": ["mediawiki.api"],
|
||||
"packageFiles": ["ext.DarkMode.js"],
|
||||
"messages": [
|
||||
"darkmode-link",
|
||||
"darkmode-link-tooltip",
|
||||
|
@ -49,9 +36,7 @@
|
|||
]
|
||||
},
|
||||
"ext.DarkMode.styles": {
|
||||
"styles": [
|
||||
"ext.DarkMode.less"
|
||||
]
|
||||
"styles": ["ext.DarkMode.less"]
|
||||
}
|
||||
},
|
||||
"ResourceFileModulePaths": {
|
||||
|
|
12
i18n/af.json
12
i18n/af.json
|
@ -1,9 +1,7 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Rooiratel"
|
||||
]
|
||||
},
|
||||
"darkmode-link-tooltip": "Skakel donker modus aan",
|
||||
"darkmode-default-link-tooltip": "Skakel donker modus af"
|
||||
"@metadata": {
|
||||
"authors": ["Rooiratel"]
|
||||
},
|
||||
"darkmode-link-tooltip": "Skakel donker modus aan",
|
||||
"darkmode-default-link-tooltip": "Skakel donker modus af"
|
||||
}
|
||||
|
|
19
i18n/ar.json
19
i18n/ar.json
|
@ -1,13 +1,10 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Meno25",
|
||||
"ديفيد"
|
||||
]
|
||||
},
|
||||
"darkmode-desc": "وضع مظلم يمكن تبديله لواجهة مستخدم ميدياويكي",
|
||||
"darkmode-link": "وضع الظلام",
|
||||
"darkmode-link-tooltip": "قم بتشغيل الوضع المظلم",
|
||||
"darkmode-default-link": "الوضع الافتراضي",
|
||||
"darkmode-default-link-tooltip": "قم بإيقاف تشغيل الوضع المظلم"
|
||||
"@metadata": {
|
||||
"authors": ["Meno25", "ديفيد"]
|
||||
},
|
||||
"darkmode-desc": "وضع مظلم يمكن تبديله لواجهة مستخدم ميدياويكي",
|
||||
"darkmode-link": "وضع الظلام",
|
||||
"darkmode-link-tooltip": "قم بتشغيل الوضع المظلم",
|
||||
"darkmode-default-link": "الوضع الافتراضي",
|
||||
"darkmode-default-link-tooltip": "قم بإيقاف تشغيل الوضع المظلم"
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Fitoschido"
|
||||
]
|
||||
"authors": ["Fitoschido"]
|
||||
},
|
||||
"darkmode-desc": "Una modalidad oscura conmutable para la interfaz de MediaWiki",
|
||||
"darkmode-link": "Modo oscuro",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Chinamoonroll"
|
||||
]
|
||||
"authors": ["Chinamoonroll"]
|
||||
},
|
||||
"darkmode-desc": "Pilihan mode peteng antuk antarmuka anganggé MediaWiki",
|
||||
"darkmode-link": "Mode peteng",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Red Winged Duck"
|
||||
]
|
||||
"authors": ["Red Winged Duck"]
|
||||
},
|
||||
"darkmode-desc": "Падключальны рэжым цёмнага інтэрфэйсу карыстальніка для MediaWiki",
|
||||
"darkmode-link": "Цёмны рэжым",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"StanProg"
|
||||
]
|
||||
"authors": ["StanProg"]
|
||||
},
|
||||
"darkmode-desc": "Превключваем тъмен режим за потребителския интерфейс на МедияУики",
|
||||
"darkmode-link": "Тъмен режим",
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"আজিজ",
|
||||
"আফতাবুজ্জামান"
|
||||
]
|
||||
"authors": ["আজিজ", "আফতাবুজ্জামান"]
|
||||
},
|
||||
"darkmode-desc": "মিডিয়াউইকির ব্যবহারকারী ইন্টারফেসের জন্য একটি আঁধার মোড",
|
||||
"darkmode-link": "আঁধার মোড",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Fitoschido"
|
||||
]
|
||||
"authors": ["Fitoschido"]
|
||||
},
|
||||
"darkmode-link": "Mode fosc",
|
||||
"darkmode-default-link": "Mode per defecte"
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Patriccck",
|
||||
"Patrik L."
|
||||
]
|
||||
"authors": ["Patriccck", "Patrik L."]
|
||||
},
|
||||
"darkmode-desc": "Přepínatelný tmavý režim pro uživatelské rozhraní MediaWiki",
|
||||
"darkmode-link": "Tmavý režim",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Afalau"
|
||||
]
|
||||
"authors": ["Afalau"]
|
||||
},
|
||||
"darkmode-desc": "Modd tywyll a gellid ei doglo ar gyfer rhyngwyneb defnyddiwr MediaWiki",
|
||||
"darkmode-link": "Modd tywyll",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Mirzali"
|
||||
]
|
||||
"authors": ["Mirzali"]
|
||||
},
|
||||
"darkmode-desc": "Ein umschaltbarer Dunkelmodus für die MediaWiki-Benutzeroberfläche",
|
||||
"darkmode-link": "Dunkler Modus",
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Mirzali",
|
||||
"Orbot707"
|
||||
]
|
||||
"authors": ["Mirzali", "Orbot707"]
|
||||
},
|
||||
"darkmode-desc": "Mabênriyê karberanê MediaWiki rê seba vurnayışi modo tari",
|
||||
"darkmode-link": "Uslıbo tari",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"MusikAnimal"
|
||||
]
|
||||
"authors": ["MusikAnimal"]
|
||||
},
|
||||
"darkmode-desc": "A toggleable dark mode for the MediaWiki user interface",
|
||||
"darkmode-link": "Dark mode",
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Fitoschido",
|
||||
"Harvest"
|
||||
]
|
||||
"authors": ["Fitoschido", "Harvest"]
|
||||
},
|
||||
"darkmode-link": "Modo oscuro",
|
||||
"darkmode-default-link": "Modo predeterminado"
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Jeeputer"
|
||||
]
|
||||
"authors": ["Jeeputer"]
|
||||
},
|
||||
"darkmode-desc": "یک حالت تاریک قابل تغییر برای رابط کاربری مدیاویکی",
|
||||
"darkmode-link": "حالت تاریک",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Silvonen"
|
||||
]
|
||||
"authors": ["Silvonen"]
|
||||
},
|
||||
"darkmode-link": "Tumma tila",
|
||||
"darkmode-default-link": "Oletustila"
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Gomoko",
|
||||
"Thibaut120094",
|
||||
"Verdy p",
|
||||
"Wladek92"
|
||||
]
|
||||
"authors": ["Gomoko", "Thibaut120094", "Verdy p", "Wladek92"]
|
||||
},
|
||||
"darkmode-desc": "Un mode sombre basculable pour l’interface utilisateur de MediaWiki",
|
||||
"darkmode-link": "Mode sombre",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Banjo"
|
||||
]
|
||||
"authors": ["Banjo"]
|
||||
},
|
||||
"darkmode-desc": "Un modo escuro alternativo para o interface de usuario MediaWiki",
|
||||
"darkmode-link": "Modo escuro",
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Amire80",
|
||||
"Steeve815"
|
||||
]
|
||||
"authors": ["Amire80", "Steeve815"]
|
||||
},
|
||||
"darkmode-desc": "מצב חושך לממשק המשתמש של מדיה־ויקי, ניתן לקביעה ידנית",
|
||||
"darkmode-link": "מצב חושך",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"McDutchie"
|
||||
]
|
||||
"authors": ["McDutchie"]
|
||||
},
|
||||
"darkmode-desc": "Un modo obscur commutabile pro le interfacie de usator de MediaWiki",
|
||||
"darkmode-link": "Modo obscur",
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Daud I.F. Argana",
|
||||
"Veracious"
|
||||
]
|
||||
"authors": ["Daud I.F. Argana", "Veracious"]
|
||||
},
|
||||
"darkmode-desc": "Pilihan mode gelap untuk antarmuka pengguna MediaWiki",
|
||||
"darkmode-link": "Mode gelap",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Maxí"
|
||||
]
|
||||
"authors": ["Maxí"]
|
||||
},
|
||||
"darkmode-link": "Dökkt þema",
|
||||
"darkmode-link-tooltip": "Virkja dökkt þema",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Beta16"
|
||||
]
|
||||
"authors": ["Beta16"]
|
||||
},
|
||||
"darkmode-link": "Modalità scura",
|
||||
"darkmode-link-tooltip": "Attiva la modalità scura",
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"MathXplore",
|
||||
"Waki285"
|
||||
]
|
||||
"authors": ["MathXplore", "Waki285"]
|
||||
},
|
||||
"darkmode-link": "ダークモード",
|
||||
"darkmode-link-tooltip": "ダークモードをオンにする",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Mirzali"
|
||||
]
|
||||
"authors": ["Mirzali"]
|
||||
},
|
||||
"darkmode-link": "Uslıbo tari",
|
||||
"darkmode-default-link": "Uslıbo standard"
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Ykhwong"
|
||||
]
|
||||
"authors": ["Ykhwong"]
|
||||
},
|
||||
"darkmode-desc": "미디어위키 사용자 인터페이스의 토글 가능한 어두운 모드입니다",
|
||||
"darkmode-link": "어두운 모드",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Mirzali"
|
||||
]
|
||||
"authors": ["Mirzali"]
|
||||
},
|
||||
"darkmode-default-link": "Awayê standard"
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Robby"
|
||||
]
|
||||
"authors": ["Robby"]
|
||||
},
|
||||
"darkmode-link": "Däischtere Modus"
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Bjankuloski06"
|
||||
]
|
||||
"authors": ["Bjankuloski06"]
|
||||
},
|
||||
"darkmode-desc": "Темен изглед на корисничкиот посредник на МедијаВики, со можност за повраток на основниот",
|
||||
"darkmode-link": "Темен изглед",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Dr Lotus Black"
|
||||
]
|
||||
"authors": ["Dr Lotus Black"]
|
||||
},
|
||||
"darkmode-link": "အမှောင် အနေထား",
|
||||
"darkmode-default-link": "နဂို အနေထား"
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Jon Harald Søby"
|
||||
]
|
||||
"authors": ["Jon Harald Søby"]
|
||||
},
|
||||
"darkmode-desc": "En byttbar mørk modus for MediaWikis grensesnitt",
|
||||
"darkmode-link": "Mørk modus",
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Bas dehaan",
|
||||
"McDutchie",
|
||||
"Romaine"
|
||||
]
|
||||
"authors": ["Bas dehaan", "McDutchie", "Romaine"]
|
||||
},
|
||||
"darkmode-desc": "Een configureerbare donkere modus voor de MediaWiki gebruikersinterface",
|
||||
"darkmode-link": "Donkere modus",
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Rail",
|
||||
"Railfail536"
|
||||
]
|
||||
"authors": ["Rail", "Railfail536"]
|
||||
},
|
||||
"darkmode-desc": "Przełączany tryb ciemny dla interfejsu użytkownika MediaWiki",
|
||||
"darkmode-link": "Tryb ciemny",
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Eduardo Addad de Oliveira",
|
||||
"Eduardoaddad",
|
||||
"Fúlvio"
|
||||
]
|
||||
"authors": ["Eduardo Addad de Oliveira", "Eduardoaddad", "Fúlvio"]
|
||||
},
|
||||
"darkmode-desc": "Um modo escuro alternado para a interface de usuário do MediaWiki",
|
||||
"darkmode-link": "Modo escuro",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Hamilton Abreu"
|
||||
]
|
||||
"authors": ["Hamilton Abreu"]
|
||||
},
|
||||
"darkmode-desc": "Um modo escuro alternável para a interface de utilizador do MediaWiki",
|
||||
"darkmode-link": "Modo escuro",
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"MusikAnimal",
|
||||
"Umherirrender"
|
||||
]
|
||||
"authors": ["MusikAnimal", "Umherirrender"]
|
||||
},
|
||||
"darkmode-desc": "{{desc|name=Darkmode|url=https://www.mediawiki.org/wiki/Extension:DarkMode}}",
|
||||
"darkmode-link": "The link to turn on dark mode.",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Joetaras"
|
||||
]
|
||||
"authors": ["Joetaras"]
|
||||
},
|
||||
"darkmode-desc": "'Na modalità gnore luabbele pe l'inderfacce utende de MediaUicchi",
|
||||
"darkmode-link": "Modalità gnore",
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Kareyac",
|
||||
"Okras",
|
||||
"Pacha Tchernof"
|
||||
]
|
||||
"authors": ["Kareyac", "Okras", "Pacha Tchernof"]
|
||||
},
|
||||
"darkmode-desc": "Переключаемая тёмная тема для пользовательского интерфейса MediaWiki",
|
||||
"darkmode-link": "Тёмная тема",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Vlad5250"
|
||||
]
|
||||
"authors": ["Vlad5250"]
|
||||
},
|
||||
"darkmode-desc": "Mračni izgled korisničkog sučelja MediaWikija, sa mogućnošću za povratak osnovnog",
|
||||
"darkmode-link": "Mračni izgled",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Eleassar"
|
||||
]
|
||||
"authors": ["Eleassar"]
|
||||
},
|
||||
"darkmode-desc": "Preklopljiv temni način za uporabniški vmesnik MediaWiki",
|
||||
"darkmode-link": "Temni način",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"WikiPhoenix"
|
||||
]
|
||||
"authors": ["WikiPhoenix"]
|
||||
},
|
||||
"darkmode-desc": "Ett mörkt läge för MediaWikis användargränssnitt som kan slås på/av",
|
||||
"darkmode-link": "Mörkt läge",
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Hedda",
|
||||
"Mirzali",
|
||||
"SaldırganSincap"
|
||||
]
|
||||
"authors": ["Hedda", "Mirzali", "SaldırganSincap"]
|
||||
},
|
||||
"darkmode-desc": "MediaWiki kullanıcı arayüzü için değiştirilebilen koyu modu",
|
||||
"darkmode-link": "Koyu modu",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Ата"
|
||||
]
|
||||
"authors": ["Ата"]
|
||||
},
|
||||
"darkmode-desc": "Змінюваний темний режим для користувацького інтерфейсу MediaWiki",
|
||||
"darkmode-link": "Темний режим",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Obaid Raza"
|
||||
]
|
||||
"authors": ["Obaid Raza"]
|
||||
},
|
||||
"darkmode-desc": "میڈیاویکی صارف انٹرفیس کے لیے قابل ٹوگل سیاہ پس منظر (ڈارک موڈ)",
|
||||
"darkmode-link": "سیاہ پس منظر",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"NguoiDungKhongDinhDanh"
|
||||
]
|
||||
"authors": ["NguoiDungKhongDinhDanh"]
|
||||
},
|
||||
"darkmode-desc": "Chế độ tối cho giao diện người dùng MediaWiki",
|
||||
"darkmode-link": "Chế độ tối",
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"TsuyaMarisa",
|
||||
"铁桶",
|
||||
"WaitSpring"
|
||||
]
|
||||
"authors": ["TsuyaMarisa", "铁桶", "WaitSpring"]
|
||||
},
|
||||
"darkmode-desc": "MediaWiki用户界面的可切换暗色模式",
|
||||
"darkmode-link": "暗色模式",
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"Kly",
|
||||
"铁桶"
|
||||
]
|
||||
"authors": ["Kly", "铁桶"]
|
||||
},
|
||||
"darkmode-desc": "MediaWiki使用者介面的可切換暗色模式",
|
||||
"darkmode-link": "暗色模式",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"铁桶"
|
||||
]
|
||||
"authors": ["铁桶"]
|
||||
},
|
||||
"darkmode-desc": "MediaWiki用戶介面的可切換暗色模式"
|
||||
}
|
||||
|
|
|
@ -8,49 +8,50 @@ use OutputPage;
|
|||
use Skin;
|
||||
|
||||
class Hooks implements
|
||||
BeforePageDisplayHook
|
||||
BeforePageDisplayHook
|
||||
{
|
||||
|
||||
/**
|
||||
* Handler for BeforePageDisplay hook.
|
||||
*
|
||||
* @param OutputPage $out
|
||||
* @param Skin $skin Skin being used.
|
||||
*/
|
||||
public function onBeforePageDisplay( $out, $skin ): void {
|
||||
$out->addModules( 'ext.DarkMode' );
|
||||
$out->addModuleStyles( 'ext.DarkMode.styles' );
|
||||
/**
|
||||
* Handler for BeforePageDisplay hook.
|
||||
*
|
||||
* @param OutputPage $out
|
||||
* @param Skin $skin Skin being used.
|
||||
*/
|
||||
public function onBeforePageDisplay($out, $skin): void
|
||||
{
|
||||
$out->addModules('ext.DarkMode');
|
||||
$out->addModuleStyles('ext.DarkMode.styles');
|
||||
|
||||
if ( $this->isDarkModeActive( $skin ) ) {
|
||||
// The class must be on the <html> element because the CSS filter creates a new stacking context.
|
||||
// If we use the <body> instead (OutputPage::addBodyClasses), any fixed-positioned content
|
||||
// will be hidden in accordance with the w3c spec: https://www.w3.org/TR/filter-effects-1/#FilterProperty
|
||||
// Fixed elements may still be hidden in Firefox due to https://bugzilla.mozilla.org/show_bug.cgi?id=1650522
|
||||
$out->addHtmlClasses( 'client-darkmode' );
|
||||
} else {
|
||||
$out->addHtmlClasses( 'client-lightmode' );
|
||||
if ($this->isDarkModeActive($skin)) {
|
||||
// The class must be on the <html> element because the CSS filter creates a new stacking context.
|
||||
// If we use the <body> instead (OutputPage::addBodyClasses), any fixed-positioned content
|
||||
// will be hidden in accordance with the w3c spec: https://www.w3.org/TR/filter-effects-1/#FilterProperty
|
||||
// Fixed elements may still be hidden in Firefox due to https://bugzilla.mozilla.org/show_bug.cgi?id=1650522
|
||||
$out->addHtmlClasses('client-darkmode');
|
||||
} else {
|
||||
$out->addHtmlClasses('client-lightmode');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the Dark Mode active?
|
||||
*
|
||||
* @param IContextSource $context
|
||||
* @return bool
|
||||
*/
|
||||
private function isDarkModeActive( IContextSource $context ): bool {
|
||||
$var = !isset( $_GET[ 'usedarkmode' ] ) ? '' : $_GET[ 'usedarkmode' ];
|
||||
if ( $var === '0' || $var === '1' ) {
|
||||
// On usedarkmode is set, overwrite the cookie.
|
||||
return (bool)$var;
|
||||
}
|
||||
$varCookie = !isset( $_COOKIE[ 'usedarkmode' ] ) ? '' : $_COOKIE[ 'usedarkmode' ];
|
||||
if ( $varCookie === '0' || $varCookie === '1' ) {
|
||||
// If usedarkmode not set, return cookie value.
|
||||
return (bool)$varCookie;
|
||||
}
|
||||
/**
|
||||
* Is the Dark Mode active?
|
||||
*
|
||||
* @param IContextSource $context
|
||||
* @return bool
|
||||
*/
|
||||
private function isDarkModeActive(IContextSource $context): bool
|
||||
{
|
||||
$var = !isset($_GET['usedarkmode']) ? '' : $_GET['usedarkmode'];
|
||||
if ($var === '0' || $var === '1') {
|
||||
// On usedarkmode is set, overwrite the cookie.
|
||||
return (bool)$var;
|
||||
}
|
||||
$varCookie = !isset($_COOKIE['usedarkmode']) ? '' : $_COOKIE['usedarkmode'];
|
||||
if ($varCookie === '0' || $varCookie === '1') {
|
||||
// If usedarkmode not set, return cookie value.
|
||||
return (bool)$varCookie;
|
||||
}
|
||||
// Otherwise return false
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
文件差异内容过多而无法显示
加载差异
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "DarkMode",
|
||||
"name": "darkmode",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
|
|
|
@ -7,15 +7,26 @@
|
|||
|
||||
( function ( $, mw ) {
|
||||
var getCookie = function getCookie( name ) {
|
||||
return '; '.concat( decodeURIComponent( document.cookie ) ).split( '; '.concat( name, '=' ) ).pop().split( ';' ).shift();
|
||||
return '; '
|
||||
.concat( decodeURIComponent( document.cookie ) )
|
||||
.split( '; '.concat( name, '=' ) )
|
||||
.pop()
|
||||
.split( ';' )
|
||||
.shift();
|
||||
};
|
||||
var setCookie = function setCookie( name, value, time ) {
|
||||
var path = arguments.length > 3 && arguments[ 3 ] !== undefined ? arguments[ 3 ] : '/';
|
||||
var isSecure = arguments.length > 4 && arguments[ 4 ] !== undefined ? arguments[ 4 ] : true;
|
||||
var path =
|
||||
arguments.length > 3 && arguments[ 3 ] !== undefined ? arguments[ 3 ] : '/';
|
||||
var isSecure =
|
||||
arguments.length > 4 && arguments[ 4 ] !== undefined ? arguments[ 4 ] : true;
|
||||
if ( !name || !value || !time || !path ) {
|
||||
return;
|
||||
}
|
||||
var base = ''.concat( name, '=' ).concat( encodeURIComponent( value ), ';path=' ).concat( path ).concat( isSecure ? ';Secure' : '' ),
|
||||
var base = ''
|
||||
.concat( name, '=' )
|
||||
.concat( encodeURIComponent( value ), ';path=' )
|
||||
.concat( path )
|
||||
.concat( isSecure ? ';Secure' : '' ),
|
||||
date = new Date();
|
||||
if ( time === 'tmp' ) {
|
||||
document.cookie = base;
|
||||
|
@ -26,22 +37,26 @@
|
|||
};
|
||||
var cookieName = 'usedarkmode',
|
||||
isDarkMode = matchMedia( '( prefers-color-scheme: dark )' ).matches,
|
||||
darkModeButtonIcon = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 13.229 13.229'%3E%3Ccircle cx='6.614' cy='6.614' fill='%23fff' stroke='%2336c' stroke-width='1.322' r='5.953'/%3E%3Cpath d='M6.88 11.377a4.762 4.762 0 0 1-4.125-7.144 4.762 4.762 0 0 1 4.124-2.38v4.762z' fill='%2336c' paint-order='markers stroke fill'/%3E%3C/svg%3E",
|
||||
$darkModeButton = $( '<img>' ).attr( {
|
||||
src: darkModeButtonIcon,
|
||||
id: 'darkModeButton'
|
||||
} ).css( {
|
||||
cursor: 'pointer',
|
||||
opacity: 0.7,
|
||||
position: 'fixed',
|
||||
right: '8px',
|
||||
'-ms-user-select': 'none',
|
||||
'-moz-user-select': 'none',
|
||||
'-webkit-user-select': 'none',
|
||||
'user-select': 'none',
|
||||
width: '32px',
|
||||
height: '32px'
|
||||
} ).appendTo( 'body' ),
|
||||
darkModeButtonIcon =
|
||||
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 13.229 13.229'%3E%3Ccircle cx='6.614' cy='6.614' fill='%23fff' stroke='%2336c' stroke-width='1.322' r='5.953'/%3E%3Cpath d='M6.88 11.377a4.762 4.762 0 0 1-4.125-7.144 4.762 4.762 0 0 1 4.124-2.38v4.762z' fill='%2336c' paint-order='markers stroke fill'/%3E%3C/svg%3E",
|
||||
$darkModeButton = $( '<img>' )
|
||||
.attr( {
|
||||
src: darkModeButtonIcon,
|
||||
id: 'darkModeButton'
|
||||
} )
|
||||
.css( {
|
||||
cursor: 'pointer',
|
||||
opacity: 0.7,
|
||||
position: 'fixed',
|
||||
right: '8px',
|
||||
'-ms-user-select': 'none',
|
||||
'-moz-user-select': 'none',
|
||||
'-webkit-user-select': 'none',
|
||||
'user-select': 'none',
|
||||
width: '32px',
|
||||
height: '32px'
|
||||
} )
|
||||
.appendTo( 'body' ),
|
||||
modeSwitcher = function modeSwitcher() {
|
||||
if ( getCookie( cookieName ) === '0' ) {
|
||||
document.documentElement.classList.remove( 'client-lightmode' );
|
||||
|
@ -96,23 +111,36 @@
|
|||
} );
|
||||
}
|
||||
};
|
||||
matchMedia( '( prefers-color-scheme: dark )' ).addEventListener( 'change', function ( event ) {
|
||||
modeObserver.dark( event.target );
|
||||
} );
|
||||
matchMedia( '( prefers-color-scheme: light )' ).addEventListener( 'change', function ( event ) {
|
||||
modeObserver.light( event.target );
|
||||
} );
|
||||
matchMedia( '( prefers-color-scheme: dark )' ).addEventListener(
|
||||
'change',
|
||||
function ( event ) {
|
||||
modeObserver.dark( event.target );
|
||||
}
|
||||
);
|
||||
matchMedia( '( prefers-color-scheme: light )' ).addEventListener(
|
||||
'change',
|
||||
function ( event ) {
|
||||
modeObserver.light( event.target );
|
||||
}
|
||||
);
|
||||
window.addEventListener( 'scroll', function () {
|
||||
if ( document.getElementById( 'cat_a_lot' ) || document.getElementById( 'proveit' ) || document.getElementsByClassName( 'wordcount' )[ 0 ] ) {
|
||||
if (
|
||||
document.getElementById( 'cat_a_lot' ) ||
|
||||
document.getElementById( 'proveit' ) ||
|
||||
document.getElementsByClassName( 'wordcount' )[ 0 ]
|
||||
) {
|
||||
$darkModeButton.css( 'bottom', '162px' );
|
||||
} else {
|
||||
$darkModeButton.css( 'bottom', '120px' );
|
||||
}
|
||||
} );
|
||||
$darkModeButton.on( 'mouseenter mouseleave', function ( e ) {
|
||||
this.style.opacity = e.type === 'mouseenter' ? 1 : 0.7;
|
||||
} ).attr( 'draggable', 'false' ).on( 'click', function () {
|
||||
modeSwitcher();
|
||||
} );
|
||||
$darkModeButton
|
||||
.on( 'mouseenter mouseleave', function ( e ) {
|
||||
this.style.opacity = e.type === 'mouseenter' ? 1 : 0.7;
|
||||
} )
|
||||
.attr( 'draggable', 'false' )
|
||||
.on( 'click', function () {
|
||||
modeSwitcher();
|
||||
} );
|
||||
checkDarkMode();
|
||||
}( jQuery, mediaWiki ) );
|
||||
|
|
正在加载...
在新工单中引用