fix(runtime): 按参考主题硬切换为 loader/main/auto_fun 单一 DOM 生命周期
- 删除 AksrtFrontend registry/rehydrate 双路架构及 build/public.js 拼包入口,
前台唯一初始路径为 PHP 本地栈(jQuery 1.9.1 → Bootstrap 3.4.1)
→ loader_js(_win/aksrtData 唯一注入)→ tbquire(['main']) → runtime/main.min.js
- window.auto_fun = debounce(z_auto_fun, 100) 为唯一重扫入口;所有模块改为
执行一次 + off/on('auto_fun.aksrt-*') 命名空间重扫,data/class 标记幂等
- 局部更新协议统一:HTML 注入 → post_ajax.ed → auto_fun();
远程 modal → loaded.bs.modal → auto_fun();JSON 成功 → zib_ajax.success
- 灯箱恢复 Miniimgbox/imgbox 唯一 owner(imgbox-container、a[data-imgbox]、
imgbox_data),删除 AksrtLightbox/data-aksrt-lightbox 第二实现及 CSS/overlay,
_win.imgbox* 重新接上 post-display 设置
- 死代码清理:runtime 下 11 组被自有实现替代的旧模块副本、无消费 vendored 库、
顶层 grade.min.js、revenue.js、无调用方的 aksrt_get_win_runtime_config(),
以及 loader 中 16 条死 mapping
- PHP 入队改为本地栈 + loader_js,routed/widget/submit 依赖统一换绑;
用户卡片发布按钮恢复 nav_user_newposts_btn 设置门控
- 测试对齐:新增 frontend-lifecycle-contract,重写 navigation/lazyload/toast/
auth-source/comment/page-display/post-visual 等断言为目标架构契约
验证:node --test widget-system+navigation 223 通过 0 失败;
构建脚本重建 main/imgbox min 与 CSS bundles;改动 PHP php -l、JS node --check
全部通过;git diff --check 干净;credits 重入 harness 通过。
This commit is contained in:
1 parent
1cd81fb61a
commit
5fd7c212ed
124 files changed
+2128
-17328
No files matched your search
@@ -1,6 +1,13 @@
|
||||
<?php
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
// window._win runtime bridge (legacy aksrt_win_var)
|
||||
add_action('wp_head', static function () {
|
||||
if (function_exists('aksrt_print_win_var')) {
|
||||
aksrt_print_win_var();
|
||||
}
|
||||
}, 1);
|
||||
|
||||
// 前端隐藏 WordPress Admin Bar
|
||||
// ============================================================
|
||||
|
||||
|
||||
@@ -226,8 +226,7 @@ add_action('init', function () {
|
||||
|
||||
if (empty($slides)) return '';
|
||||
|
||||
return '<div class="aksrt-carousel-block swiper aksrt-lightbox-trigger" data-aksrt-lightbox="1" data-autoplay="' . $autoplay . '" data-delay="' . $delay . '" data-effect="' . $effect . '">'
|
||||
|
||||
return '<div class="aksrt-carousel-block swiper" data-autoplay="' . $autoplay . '" data-delay="' . $delay . '" data-effect="' . $effect . '">'
|
||||
. '<div class="swiper-wrapper">' . $slides . '</div>'
|
||||
. '<div class="swiper-pagination"></div>'
|
||||
. '<div class="swiper-button-prev"></div><div class="swiper-button-next"></div>'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Float button commerce types.
|
||||
* Float button commerce types + runtime window._win bridge (legacy parity).
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@ if (!function_exists('aksrt_single_render_cover')) :
|
||||
?>
|
||||
<div class="single-head-cover">
|
||||
<div class="single-video">
|
||||
<div class="graphic single-cover single-cover--video" style="padding-bottom:<?php echo esc_attr((string) $video_scale); ?>%;">
|
||||
<div class="graphic single-cover single-cover--video imgbox-container" style="padding-bottom:<?php echo esc_attr((string) $video_scale); ?>%;">
|
||||
<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 class="single-video-footer dplayer-featured">
|
||||
@@ -630,15 +630,13 @@ if (!function_exists('aksrt_single_render_article')) :
|
||||
<?php aksrt_single_render_pay_box($ctx); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($ctx['front_content'] !== '') : ?>
|
||||
<div class="post_front_content theme-box box-body"<?php echo !empty($settings['lightbox']) ? ' data-aksrt-lightbox="1"' : ''; ?>><?php echo wp_kses_post((string) $ctx['front_content']); ?></div>
|
||||
|
||||
<?php if ($ctx['front_content'] !== '') : ?>
|
||||
<div class="post_front_content theme-box box-body"><?php echo wp_kses_post((string) $ctx['front_content']); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="theme-box wp-posts-content<?php echo $maxheight > 0 ? ' limit-height' : ''; ?>"
|
||||
<?php echo $maxheight > 0 ? ' style="max-height:' . esc_attr((string) $maxheight) . 'px;"' : ''; ?>
|
||||
data-maxheight="<?php echo esc_attr((string) ($maxheight > 0 ? max(0, $maxheight - 80) : 0)); ?>"
|
||||
<?php echo !empty($settings['lightbox']) ? ' data-aksrt-lightbox="1"' : ''; ?>>
|
||||
data-maxheight="<?php echo esc_attr((string) ($maxheight > 0 ? max(0, $maxheight - 80) : 0)); ?>">
|
||||
<?php the_content(); ?>
|
||||
<?php
|
||||
wp_link_pages([
|
||||
|
||||
@@ -195,10 +195,19 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
||||
}
|
||||
|
||||
if (!empty($ctx['can_publish'])) {
|
||||
$pub_url = (string) $ctx['publish_url'];
|
||||
$href .= '<a rel="nofollow" href="' . esc_url($pub_url) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-green"><i class="fa fas fa-edit" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-green">' . esc_html__('发布内容', 'aksrt') . '</div></a>';
|
||||
// legacy:用户卡片发布按钮由 nav_user_newposts_btn 门控,文案可配。
|
||||
$newposts_type = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_value('nav_user_newposts_btn', 'post')
|
||||
: 'post';
|
||||
if (!empty($newposts_type)) {
|
||||
$newposts_text = class_exists('\AKSRT\Settings\Settings')
|
||||
? (string) \AKSRT\Settings\Settings::get_value('nav_user_newposts_btn_text', __('发布内容', 'aksrt'))
|
||||
: __('发布内容', 'aksrt');
|
||||
$pub_url = (string) $ctx['publish_url'];
|
||||
$href .= '<a rel="nofollow" href="' . esc_url($pub_url) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-green"><i class="fa fas fa-edit" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-green">' . esc_html($newposts_text) . '</div></a>';
|
||||
}
|
||||
}
|
||||
|
||||
$href .= '<a href="javascript:;" data-toggle="modal" data-target="#modal_signout">';
|
||||
@@ -346,7 +355,7 @@ if (!function_exists('aksrt_menu_button')) :
|
||||
$account = '<ul class="list-inline splitters relative aksrt-navbar-account'
|
||||
. ($user_id <= 0 && '2' === $layout ? ' navbar-text' : '') . '">'
|
||||
. $notification_but . $sign_but . $search_but . '</ul>';
|
||||
$button = '<div class="aksrt-navbar-actions navbar-form navbar-right">'
|
||||
$button = '<div class="aksrt-navbar-actions navbar-form navbar-right navbar-but">'
|
||||
. $actions . $utility_buttons . $account . '</div>';
|
||||
|
||||
$fold = '<div class="navbar-form navbar-right hide show-nav-but" style="margin-right:-10px;">'
|
||||
|
||||
Reference in new issue
Block a user