进行了一些小修复
This commit is contained in:
@@ -1371,14 +1371,6 @@ html.dark .post-drop-meta__item:hover {
|
|||||||
--this-bg: var(--body-bg-color, #f5f5f5);
|
--this-bg: var(--body-bg-color, #f5f5f5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.single-metabox.cover-meta {
|
|
||||||
font-size: 14px;
|
|
||||||
right: 1em;
|
|
||||||
top: 1.6em;
|
|
||||||
--meta-color: rgba(255, 255, 255, 0.8);
|
|
||||||
--body-bg-color: rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* line-form-line owned by legacy-utilities.css — only context here */
|
/* line-form-line owned by legacy-utilities.css — only context here */
|
||||||
.article-avatar .line-form-line {
|
.article-avatar .line-form-line {
|
||||||
display: block;
|
display: block;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -631,14 +631,6 @@ html.dark .post-drop-meta__item:hover {
|
|||||||
--this-bg: var(--body-bg-color, #f5f5f5);
|
--this-bg: var(--body-bg-color, #f5f5f5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.single-metabox.cover-meta {
|
|
||||||
font-size: 14px;
|
|
||||||
right: 1em;
|
|
||||||
top: 1.6em;
|
|
||||||
--meta-color: rgba(255, 255, 255, 0.8);
|
|
||||||
--body-bg-color: rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* line-form-line owned by legacy-utilities.css — only context here */
|
/* line-form-line owned by legacy-utilities.css — only context here */
|
||||||
.article-avatar .line-form-line {
|
.article-avatar .line-form-line {
|
||||||
display: block;
|
display: block;
|
||||||
|
|||||||
@@ -78,8 +78,7 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single-cover__meta,
|
.single-cover__meta {
|
||||||
.single-cover__content .cover-meta {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
@@ -87,8 +86,7 @@
|
|||||||
opacity: 0.85;
|
opacity: 0.85;
|
||||||
}
|
}
|
||||||
|
|
||||||
.single-cover__meta span,
|
.single-cover__meta span {
|
||||||
.single-cover__content .cover-meta .meta-view {
|
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
@@ -223,9 +221,6 @@
|
|||||||
.single-head-cover .featured-video-episode .switch-video.active {
|
.single-head-cover .featured-video-episode .switch-video.active {
|
||||||
background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); color: var(--color-primary);
|
background: var(--color-primary-soft, rgba(240, 68, 148, 0.12)); color: var(--color-primary);
|
||||||
}
|
}
|
||||||
.single-head-cover .cover-meta.single-metabox {
|
|
||||||
display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; color: var(--color-ink-4);
|
|
||||||
}
|
|
||||||
/* Cover meta pills + title-h-left */
|
/* Cover meta pills + title-h-left */
|
||||||
.single-cover-con .article-title.title-h-left,
|
.single-cover-con .article-title.title-h-left,
|
||||||
.single-cover .article-title.title-h-left {
|
.single-cover .article-title.title-h-left {
|
||||||
@@ -233,14 +228,6 @@
|
|||||||
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
|
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.single-metabox.cover-meta,
|
|
||||||
.cover-meta.abs-right {
|
|
||||||
position: absolute;
|
|
||||||
top: 12px;
|
|
||||||
right: 12px;
|
|
||||||
z-index: 3;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.single-metabox .post-metas item,
|
.single-metabox .post-metas item,
|
||||||
.single-metabox .post-metas item a {
|
.single-metabox .post-metas item a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
@@ -334,6 +321,3 @@
|
|||||||
.aksrt-slider-overlay .article-title.title-h-left { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.45); }
|
.aksrt-slider-overlay .article-title.title-h-left { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.45); }
|
||||||
.aksrt-slider-overlay .breadcrumb a,
|
.aksrt-slider-overlay .breadcrumb a,
|
||||||
.aksrt-slider-overlay .breadcrumb li { color: rgba(255,255,255,.9); }
|
.aksrt-slider-overlay .breadcrumb li { color: rgba(255,255,255,.9); }
|
||||||
.aksrt-slider-overlay .single-metabox,
|
|
||||||
.aksrt-slider-overlay .cover-meta { pointer-events: auto; }
|
|
||||||
.aksrt-slider-overlay .post-drop-meta { pointer-events: auto; }
|
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ if (($settings['cover_type'] ?? '') === 'video' && (string) ($settings['cover_ur
|
|||||||
$settings['show_cover'] = true;
|
$settings['show_cover'] = true;
|
||||||
}
|
}
|
||||||
$settings['video_episodes'] = $episodes;
|
$settings['video_episodes'] = $episodes;
|
||||||
$settings['episode_count'] = count($episodes);
|
|
||||||
$settings['video_poster'] = (string) ($meta['cover_image'] ?? '');
|
$settings['video_poster'] = (string) ($meta['cover_image'] ?? '');
|
||||||
return $settings;
|
return $settings;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,10 +21,8 @@ if (!function_exists('aksrt_single_render_cover')) :
|
|||||||
$type = (string) $ctx['cover_type'];
|
$type = (string) $ctx['cover_type'];
|
||||||
$badge = (string) $ctx['status_badge'];
|
$badge = (string) $ctx['status_badge'];
|
||||||
$crumbs = (string) $ctx['breadcrumbs_html'];
|
$crumbs = (string) $ctx['breadcrumbs_html'];
|
||||||
$meta_box = (string) ($ctx['meta_box_html'] ?? '');
|
|
||||||
$img_scale = max(10, min(100, (int) $ctx['img_scale']));
|
$img_scale = max(10, min(100, (int) $ctx['img_scale']));
|
||||||
$video_scale = max(20, min(100, (int) $ctx['video_scale']));
|
$video_scale = max(20, min(100, (int) $ctx['video_scale']));
|
||||||
$episode = (int) $ctx['episode_count'];
|
|
||||||
$slides = is_array($ctx['slide_images'] ?? null) ? $ctx['slide_images'] : [];
|
$slides = is_array($ctx['slide_images'] ?? null) ? $ctx['slide_images'] : [];
|
||||||
$poster = (string) ($ctx['video_poster'] ?? '');
|
$poster = (string) ($ctx['video_poster'] ?? '');
|
||||||
$title_html = (string) ($ctx['title_html'] ?? esc_html(get_the_title()));
|
$title_html = (string) ($ctx['title_html'] ?? esc_html(get_the_title()));
|
||||||
@@ -37,14 +35,9 @@ if (!function_exists('aksrt_single_render_cover')) :
|
|||||||
<div class="aksrt-video single-cover__player" data-aksrt-video data-src="<?php echo esc_url($ctx['cover_url']); ?>"<?php echo $poster !== '' ? ' data-poster="' . esc_url($poster) . '"' : ''; ?> style="position:absolute;inset:0;width:100%;height:100%;"></div>
|
<div class="aksrt-video single-cover__player" data-aksrt-video data-src="<?php echo esc_url($ctx['cover_url']); ?>"<?php echo $poster !== '' ? ' data-poster="' . esc_url($poster) . '"' : ''; ?> style="position:absolute;inset:0;width:100%;height:100%;"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-video-footer dplayer-featured">
|
<div class="single-video-footer dplayer-featured">
|
||||||
<div class="flex jsb at">
|
<?php if ($crumbs !== '') : ?>
|
||||||
<?php if ($crumbs !== '') : ?>
|
<div class="post-breadcrumbs"><?php echo $crumbs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
|
||||||
<div class="post-breadcrumbs"><?php echo $crumbs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($meta_box !== '') : ?>
|
|
||||||
<?php echo str_replace('single-metabox', 'single-metabox mb10 ml10 shrink0', $meta_box); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<h1 class="article-title">
|
<h1 class="article-title">
|
||||||
<?php
|
<?php
|
||||||
$episodes = is_array($ctx['video_episodes'] ?? null) ? $ctx['video_episodes'] : [];
|
$episodes = is_array($ctx['video_episodes'] ?? null) ? $ctx['video_episodes'] : [];
|
||||||
@@ -95,8 +88,7 @@ if (!function_exists('aksrt_single_render_cover')) :
|
|||||||
. '<h1 class="article-title title-h-left">' . $title_html . '</h1>'
|
. '<h1 class="article-title title-h-left">' . $title_html . '</h1>'
|
||||||
. ($crumbs !== '' ? $crumbs : '')
|
. ($crumbs !== '' ? $crumbs : '')
|
||||||
. $badge
|
. $badge
|
||||||
. '</div>'
|
. '</div>';
|
||||||
. ($meta_box !== '' ? str_replace('single-metabox', 'single-metabox cover-meta abs-right', $meta_box) : '');
|
|
||||||
$slider_html = '';
|
$slider_html = '';
|
||||||
if (function_exists('aksrt_render_slider')) {
|
if (function_exists('aksrt_render_slider')) {
|
||||||
$slider_html = aksrt_render_slider([
|
$slider_html = aksrt_render_slider([
|
||||||
@@ -142,9 +134,6 @@ if (!function_exists('aksrt_single_render_cover')) :
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php echo $badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
<?php echo $badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($meta_box !== '') : ?>
|
|
||||||
<?php echo str_replace('single-metabox', 'single-metabox cover-meta abs-right', $meta_box); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
@@ -153,7 +142,7 @@ endif;
|
|||||||
|
|
||||||
if (!function_exists('aksrt_single_render_box_header')) :
|
if (!function_exists('aksrt_single_render_box_header')) :
|
||||||
/**
|
/**
|
||||||
* Title + author bar (when no cover).
|
* Title + author bar and the canonical article meta row.
|
||||||
*
|
*
|
||||||
* @param array<string,mixed> $ctx Single context.
|
* @param array<string,mixed> $ctx Single context.
|
||||||
*/
|
*/
|
||||||
@@ -172,7 +161,7 @@ if (!function_exists('aksrt_single_render_box_header')) :
|
|||||||
aksrt_single_render_author_bar([
|
aksrt_single_render_author_bar([
|
||||||
'show_actions' => true,
|
'show_actions' => true,
|
||||||
'show_time' => empty($settings['hide_time']),
|
'show_time' => empty($settings['hide_time']),
|
||||||
'meta_html' => empty($ctx['show_cover']) ? (string) ($ctx['meta_box_html'] ?? '') : '',
|
'meta_html' => (string) ($ctx['meta_box_html'] ?? ''),
|
||||||
]);
|
]);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -93,14 +93,13 @@ if (!function_exists('aksrt_single_build_context')) :
|
|||||||
'post_id' => $post_id,
|
'post_id' => $post_id,
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
'show_cover' => $show_cover,
|
'show_cover' => $show_cover,
|
||||||
'cover_url' => (string) ($settings['cover_url'] ?? ''),
|
'cover_url' => (string) ($settings['cover_url'] ?? ''),
|
||||||
'cover_type' => (string) ($settings['cover_type'] ?? 'none'),
|
'cover_type' => (string) ($settings['cover_type'] ?? 'none'),
|
||||||
'img_scale' => (int) ($settings['article_image_cover_scale'] ?? 35),
|
'img_scale' => (int) ($settings['article_image_cover_scale'] ?? 35),
|
||||||
'video_scale' => (int) ($settings['article_video_cover_scale'] ?? 56),
|
'video_scale' => (int) ($settings['article_video_cover_scale'] ?? 56),
|
||||||
'slide_images' => array_values(array_filter((array) ($settings['slide_images'] ?? []))),
|
'slide_images' => array_values(array_filter((array) ($settings['slide_images'] ?? []))),
|
||||||
'episode_count' => max(0, (int) ($settings['episode_count'] ?? 0)),
|
'video_episodes' => is_array($settings['video_episodes'] ?? null) ? array_values($settings['video_episodes']) : [],
|
||||||
'video_episodes' => is_array($settings['video_episodes'] ?? null) ? array_values($settings['video_episodes']) : [],
|
'video_poster' => (string) ($settings['video_poster'] ?? ''),
|
||||||
'video_poster' => (string) ($settings['video_poster'] ?? ''),
|
|
||||||
'meta_items' => $meta_items,
|
'meta_items' => $meta_items,
|
||||||
'meta_box_html' => $meta_box_html,
|
'meta_box_html' => $meta_box_html,
|
||||||
'title_html' => function_exists('aksrt_get_single_title_html') ? aksrt_get_single_title_html($post_id) : esc_html(get_the_title($post_id)),
|
'title_html' => function_exists('aksrt_get_single_title_html') ? aksrt_get_single_title_html($post_id) : esc_html(get_the_title($post_id)),
|
||||||
|
|||||||
@@ -498,6 +498,7 @@ test('single post more menu has one accessible runtime and an in-flow author anc
|
|||||||
const article = read('assets/js/core/article.js');
|
const article = read('assets/js/core/article.js');
|
||||||
const components = read('inc/helpers/aksrt-single-components.php');
|
const components = read('inc/helpers/aksrt-single-components.php');
|
||||||
const single = read('inc/helpers/aksrt-single.php');
|
const single = read('inc/helpers/aksrt-single.php');
|
||||||
|
const singleRender = read('inc/helpers/aksrt-single-render.php');
|
||||||
const authorBar = read('templates/parts/single-author-bar.php');
|
const authorBar = read('templates/parts/single-author-bar.php');
|
||||||
const styles = read('assets/css/frontend/single-post/author-actions.css');
|
const styles = read('assets/css/frontend/single-post/author-actions.css');
|
||||||
|
|
||||||
@@ -516,6 +517,8 @@ test('single post more menu has one accessible runtime and an in-flow author anc
|
|||||||
assert.doesNotMatch(components, /\$direction/);
|
assert.doesNotMatch(components, /\$direction/);
|
||||||
assert.match(authorBar, /class="single-meta-row"/);
|
assert.match(authorBar, /class="single-meta-row"/);
|
||||||
assert.doesNotMatch(authorBar, /single-metabox abs-right/);
|
assert.doesNotMatch(authorBar, /single-metabox abs-right/);
|
||||||
|
assert.match(singleRender, /'meta_html'\s*=>\s*\(string\) \(\$ctx\['meta_box_html'\] \?\? ''\)/);
|
||||||
|
assert.doesNotMatch(singleRender, /cover-meta|str_replace\('single-metabox'/);
|
||||||
assert.match(styles, /\.single-meta-row > \.single-metabox\s*\{[^}]*position:\s*relative;[^}]*transform:\s*none;/s);
|
assert.match(styles, /\.single-meta-row > \.single-metabox\s*\{[^}]*position:\s*relative;[^}]*transform:\s*none;/s);
|
||||||
assert.match(styles, /\.post-drop-meta__menu\s*\{[^}]*position:\s*absolute;[^}]*right:\s*0;/s);
|
assert.match(styles, /\.post-drop-meta__menu\s*\{[^}]*position:\s*absolute;[^}]*right:\s*0;/s);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user