Skip to content

Commit 108cbb0

Browse files
committed
Merge branch 'release/v3.4.1'
2 parents 41d6c49 + dda1f6b commit 108cbb0

13 files changed

+52
-32
lines changed

EmbedVideo.i18n.magic.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@
2929
'autoresize' => [ 0, 'autoresize' ],
3030
'title' => [ 0, 'title=$1' ],
3131
'description' => [ 0, 'description=$1' ],
32+
'class' => [ 0, 'class=$1' ],
3233
];

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "starcitizenwiki/embedvideo",
3-
"version": "3.4.0",
3+
"version": "3.4.1",
44
"type": "mediawiki-extension",
55
"description": "Adds a parser function embedding video from popular sources.",
66
"license": "MIT",

extension.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "EmbedVideo",
3-
"version": "3.4.0",
3+
"version": "3.4.1",
44
"author": [
55
"[https://www.mediawiki.org/wiki/User:Octfx Octfx]",
66
"[https://www.mediawiki.org/wiki/User:Alistair3149 Alistair3149]",
@@ -70,7 +70,8 @@
7070
{ "name": "iframe.js", "file": "modules/iframe.js" }
7171
],
7272
"styles": [
73-
"ext.embedVideo.consent.less"
73+
"ext.embedVideo.consent.less",
74+
"ext.embedVideo.evl.less"
7475
],
7576
"position": "top",
7677
"targets": [

i18n/qqq.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"embedvideo-consent-privacy-notice-dismiss": "{{identical|Dismiss}}",
1111
"embedvideo-service-archiveorg": "{{Optional}}",
1212
"embedvideo-service-bilibili": "{{Optional}}",
13+
"embedvideo-service-bandcamp": "{{optional}}\nThe name of an online music publishing service, https://bandcamp.com/ .",
1314
"embedvideo-service-dailymotion": "{{optional}}\nName of Dailymotion video streaming service, see https://www.dailymotion.com",
1415
"embedvideo-service-kakaotv": "{{Optional}}",
1516
"embedvideo-service-loom": "{{optional}}",

i18n/zh-hans.json

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,32 @@
1717
"embedvideo-consent-privacy-notice-continue": "继续",
1818
"embedvideo-consent-privacy-notice-dismiss": "关闭",
1919
"embedvideo-service-bilibili": "哔哩哔哩",
20+
"embedvideo-service-videolink": "视频链接",
2021
"embedvideo-service-localvideo": "本地文件",
2122
"embedvideo-service-externalvideo": "外部视频",
2223
"embedvideo-play": "播放视频",
23-
"embedvideo-error-missingparams": "EmbedVideo缺少一个必须的参数。",
24-
"embedvideo-error-service": "嵌入视频无法识别视频服务“$1”。",
25-
"embedvideo-error-id": "视频嵌入收到了一个对服务“$1”不可用的id “$2“",
26-
"embedvideo-error-width": "EmbedVideo收到了一个错误的高度参数“$1”",
27-
"embedvideo-error-height": "EmbedVideo收到了一个错误的高度参数“$1”",
28-
"embedvideo-error-alignment": "EmbedVideo的对齐参数“$1”有非法值。有效值为“left”“center”或“right”。",
29-
"embedvideo-error-valignment": "EmbedVideo的对齐参数“$1”有非法值。有效值为“top”“middle”“bottom”或“baseline”。",
30-
"embedvideo-error-urlargs": "EmbedVideo收到的URL参数列表包含畸形数据或空参数。",
31-
"embedvideo-error-unknown": "EmbedVideo在尝试生成该视频嵌入块时遇到了一个未知的错误。($1)",
32-
"embedvideo-error-evp_deprecated": "#evp解析器函数在EmbedVideo 2.0中已弃用。请将您的解析器函数标记转换为#ev。",
33-
"embedvideo-error-container": "为‘集装箱’ 提供的参数为不可用的。",
34-
"embedvideo-video-long-desc": "$1, $2 解码编辑器, 长度 $3, $4x$5 像素, 总体 $6",
35-
"embedvideo-audio-long-desc": "$1,$2 解码编辑器,总体长度$3,$4",
36-
"embedvideo-error-cantdecode_evu": "无法使视频通过$1",
37-
"apihelp-embedvideo-summary": "得到所给参数生成的视频嵌入代码。",
38-
"apihelp-embedvideo-param-service": "服务的名称(YouTube,推特等等)",
39-
"apihelp-embedvideo-param-id": "对该服务所需的视频ID",
40-
"apihelp-embedvideo-param-dimensions": "一个数字宽度(100)或宽比高(100 x 100)",
41-
"apihelp-embedvideo-param-alignment": "视频校准",
24+
"embedvideo-error-missingparams": "EmbedVideo缺少一个必需的参数。",
25+
"embedvideo-error-service": "EmbedVideo无法识别视频服务“$1”。",
26+
"embedvideo-error-id": "EmbedVideo收到了对于服务“$1”的错误ID“$2“",
27+
"embedvideo-error-width": "EmbedVideo收到了错误的宽度参数“$1”。",
28+
"embedvideo-error-height": "EmbedVideo收到了错误的高度参数“$1”。",
29+
"embedvideo-error-alignment": "给予了EmbedVideo的对齐参数“$1”一个非法的值。有效值为“left”“center”或“right”。",
30+
"embedvideo-error-valignment": "给予了EmbedVideo的垂直对齐参数“$1”一个非法的值。有效值为“top”“middle”“bottom”或“baseline”。",
31+
"embedvideo-error-urlargs": "EmbedVideo收到的URL参数列表包含异常数据或空参数。",
32+
"embedvideo-error-unknown": "EmbedVideo在尝试生成该视频嵌入块时发生未知错误。($1)",
33+
"embedvideo-error-evp_deprecated": "#evp解析器函数在EmbedVideo 2.0中已弃用。请将您的解析器函数标签转换为#ev。",
34+
"embedvideo-error-container": "提供给“container”的参数无效。",
35+
"embedvideo-video-long-desc": "$1,编解码器$2,长度$3,$4x$5像素,总体$6",
36+
"embedvideo-audio-long-desc": "$1,编解码器$2,长度$3,总体$4",
37+
"embedvideo-error-cantdecode_evu": "无法解析来自$1的视频",
38+
"embedvideo-error-url-not-whitelisted": "$wgAllowExternalImagesFrom中未设置提供的URL",
39+
"apihelp-embedvideo-summary": "获取给定参数所生成视频的嵌入代码。",
40+
"apihelp-embedvideo-param-service": "服务名称(youtube、twitch等)",
41+
"apihelp-embedvideo-param-id": "用于该服务的视频ID",
42+
"apihelp-embedvideo-param-dimensions": "数字宽度(100)或宽 x 高(100 x 100)",
43+
"apihelp-embedvideo-param-alignment": "视频对齐",
4244
"apihelp-embedvideo-param-description": "视频描述",
4345
"apihelp-embedvideo-param-container": "接受框架,或留空",
44-
"apihelp-embedvideo-param-urlargs": "视频URL中额外需要通过的争论(对于部分服务",
45-
"apihelp-embedvideo-param-autoresize": "自动调整视频大小?(是或否"
46+
"apihelp-embedvideo-param-urlargs": "视频URL中的额外参数(用于部分服务",
47+
"apihelp-embedvideo-param-autoresize": "自动调整视频大小?(true或false"
4648
}

includes/EmbedService/EmbedHtmlFormatter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public static function toHtml( AbstractEmbedService $service, array $config = []
4949
$config
5050
);
5151

52+
if ( !empty( $config['img-class'] ) ) {
53+
$config['class'] .= ' ' . $config['img-class'];
54+
}
55+
5256
$inlineStyles = [
5357
'container' => $config['style'] ?? '',
5458
'wrapper' => '',

includes/Media/AudioHandler.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function getParamMap(): array {
4242
'loop' => 'loop',
4343
'nocontrols' => 'nocontrols',
4444
'muted' => 'muted',
45+
'class' => 'class',
4546
];
4647
}
4748

@@ -63,7 +64,7 @@ public function validateParam( $name, $value ): bool {
6364
return $this->parseTimeString( $value ) !== false;
6465
}
6566

66-
if ( $name === 'autoplay' || $name === 'loop' || $name === 'nocontrols' ) {
67+
if ( in_array( $name, [ 'autoplay', 'loop', 'nocontrols', 'class' ], true ) ) {
6768
return true;
6869
}
6970

@@ -124,7 +125,7 @@ public function parseParamString( $string ): array {
124125
* Returns false if the parameters are unacceptable and the transform should fail
125126
*
126127
* @param stdClass|File $image
127-
* @param array $params
128+
* @param array &$params
128129
* @return bool Success
129130
*/
130131
public function normaliseParams( $image, &$params ): bool {
@@ -151,6 +152,7 @@ public function normaliseParams( $image, &$params ): bool {
151152
}
152153

153154
$params['page'] = 1;
155+
$params['img-class'] = $params['img-class'] ?? $params['class'] ?? null;
154156

155157
return true;
156158
}

includes/Media/TransformOutput/AudioTransformOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function toHtml( $options = [] ): string {
5252
return Html::rawElement( 'audio', [
5353
'src' => $this->getSrc(),
5454
'width' => $this->getWidth(),
55-
'class' => $options['img-class'] ?? false,
55+
'class' => $options['img-class'] ?? $this->parameters['img-class'] ?? false,
5656
'style' => $this->getStyle( $options ),
5757
'controls' => !isset( $this->parameters['nocontrols'] ),
5858
'autoplay' => isset( $this->parameters['autoplay'] ),

includes/Media/TransformOutput/VideoEmbedTransformOutput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function toHtml( $options = [] ): string {
2424
'withConsent' => true,
2525
'autoresize' => ( $this->parameters['autoresize'] ?? false ) === true,
2626
'description' => $this->parameters['description'] ?? null,
27+
'img-class' => $this->parameters['img-class'] ?? null,
2728
] );
2829
}
2930
}

includes/Media/TransformOutput/VideoTransformOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function toHtml( $options = [] ): string {
4848
'src' => $this->getSrc(),
4949
'width' => $this->getWidth(),
5050
'height' => $this->getHeight(),
51-
'class' => $options['img-class'] ?? false,
51+
'class' => $options['img-class'] ?? $this->parameters['img-class'] ?? false,
5252
'style' => $this->getStyle( $options ),
5353
'poster' => $this->parameters['posterUrl'] ?? false,
5454
'controls' => !isset( $this->parameters['nocontrols'] ),

0 commit comments

Comments
 (0)