refactor: flatten src/AKSRT → src (drop theme-identifier dir)

Move all domain folders from src/AKSRT/{Domain} to src/{Domain}; remap
Composer PSR-4 "AKSRT\\": "src/"; update audit script + README + ADR
paths; remove dead tools/build-psr4-map.php (scanned deleted inc/classes).
This commit is contained in:
2026-08-02 22:06:06 +08:00
parent 56f1a8175f
commit 8c5b1555c9
285 changed files with 26 additions and 3600 deletions
+625
View File
@@ -0,0 +1,625 @@
<?php
/**
* @package AKSRT
*/
namespace AKSRT\Core;
defined('ABSPATH') || exit;
/**
* Scripts public enqueue continuation: fonts, icons, global JS, localize.
*
* @package AKSRT
*/
trait ScriptsPart1c {
/**
* Fonts / FA / global JS stack / aksrtData (split from enqueue_public).
*/
private function enqueue_public_fonts_js_and_data($base_uri, $core_dep, $deps, $is_fixed_homepage, $is_home_or_archive, $is_single_post, $is_single_resource, $version): void {
// ===== 5. 字体 =====
// 5a. 拉丁字体 - Inter (UI) + Source Serif 4 (正文)
wp_enqueue_style(
'aksrt-fonts',
'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400&display=swap',
[],
null
);
// 5b. 中文字体 - jsDelivr CDN (思源黑体 / 思源宋体)
// 仅 regular 字重,避免拖慢首屏;其它字重通过 system fallback (PingFang/微软雅黑)
// Fontsource v5 已按 unicode-range 自动分包,浏览器只会下载用到的简中子集
wp_enqueue_style(
'aksrt-fonts-cn',
'https://cdn.jsdelivr.net/npm/@fontsource/noto-sans-sc@5.2.9/400.css',
[],
null
);
wp_enqueue_style(
'aksrt-fonts-cn-serif',
'https://cdn.jsdelivr.net/npm/@fontsource/noto-serif-sc@5.2.9/400.css',
[],
null
);
// ===== 6. 图标系统 =====
// Font Awesome 5 全站加载(评论回复、单篇互动栏、profile 联系方式等
// 多处模板使用 fa-* 类名,作为全主题图标包统一使用)
wp_enqueue_style(
'aksrt-font-awesome-5',
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css',
[],
'5.15.4'
);
// FA4 class aliases (fa-diamond, fa-file-text-o, ...) used by zibll-style markup.
wp_enqueue_style(
'aksrt-font-awesome-5-v4-shims',
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/v4-shims.min.css',
['aksrt-font-awesome-5'],
'5.15.4'
);
// ===== 7. JS =====
// Swiper.js(首页/归档/CMS 模块/单篇文章页加载)
$needs_swiper = $is_home_or_archive || $is_single_post || $is_single_resource;
if ($needs_swiper) {
wp_enqueue_style(
'aksrt-swiper',
$base_uri . '/assets/css/frontend/swiper-bundle.min.css',
[],
'11.0'
);
wp_enqueue_script(
'aksrt-swiper',
$base_uri . '/assets/js/swiper-bundle.min.js',
[],
'11.0',
true
);
}
wp_enqueue_script(
'aksrt-qrcode',
'https://cdn.jsdelivr.net/npm/kjua@0.9.0/dist/kjua.min.js',
[],
'0.9.0',
true
);
// Rehydrate system — must load before aksrt-script so AksrtFrontend is available
wp_enqueue_script(
'aksrt-rehydrate',
$base_uri . '/assets/js/rehydrate.js',
[],
file_exists(get_template_directory() . '/assets/js/rehydrate.js')
? (string) filemtime(get_template_directory() . '/assets/js/rehydrate.js')
: $version,
true
);
// Runtime infrastructure: tbquire / notyf / confirm / refreshModal / scrollTopTo / [data-*] declarative
$runtime_js = get_template_directory() . '/assets/js/aksrt-runtime.js';
if (file_exists($runtime_js)) {
wp_enqueue_script(
'aksrt-runtime',
$base_uri . '/assets/js/aksrt-runtime.js',
['aksrt-rehydrate'],
(string) filemtime($runtime_js),
true
);
}
// Core modules (split from main.js) — register with AksrtFrontend
$core_modules = [
'aksrt-core-theme' => 'theme.js',
'aksrt-core-nav' => 'nav.js',
'aksrt-core-search' => 'search.js',
'aksrt-core-dropdown' => 'dropdown.js',
'aksrt-core-scroll' => 'scroll.js',
'aksrt-core-slider' => 'slider.js',
'aksrt-core-article' => 'article.js',
'aksrt-core-comments' => 'comments.js',
'aksrt-core-comment-fixed' => 'comment-fixed-input.js',
'aksrt-core-comment-move' => 'comment-move-form.js',
// Shared zibll-parity list/modal engines (before pagination consumers).
'aksrt-core-ajax-list' => 'ajax-list.js',
'aksrt-core-remote-modal' => 'remote-modal.js',
'aksrt-core-pagination' => 'pagination.js',
'aksrt-core-archive' => 'archive.js',
'aksrt-core-footer-tabbar' => 'footer-tabbar.js',
'aksrt-core-misc' => 'misc.js',
];
$core_handles = [];
foreach ($core_modules as $handle => $file) {
$path = get_template_directory() . '/assets/js/core/' . $file;
if (file_exists($path)) {
// Depend on aksrt-runtime so window.aksrtData (localized below) is available.
$deps = ['aksrt-rehydrate', 'aksrt-runtime'];
if ($handle === 'aksrt-core-slider') {
$deps = array_merge($deps, $needs_swiper ? ['aksrt-swiper'] : []);
}
wp_enqueue_script(
$handle,
$base_uri . '/assets/js/core/' . $file,
$deps,
(string) filemtime($path),
true
);
$core_handles[] = $handle;
}
}
wp_enqueue_script(
'aksrt-script',
$base_uri . '/assets/js/main.js',
array_merge(
['jquery', 'bootstrap5', 'aksrt-rehydrate', 'aksrt-runtime'],
$core_handles
),
file_exists(get_template_directory() . '/assets/js/main.js')
? (string) filemtime(get_template_directory() . '/assets/js/main.js')
: $version,
true
);
// SVG icon data + helper (must load before other scripts that use icons)
$svg_icon_js = get_template_directory() . '/assets/js/svg-icon.js';
if (file_exists($svg_icon_js)) {
wp_enqueue_script(
'aksrt-svg-icon',
$base_uri . '/assets/js/svg-icon.js',
[],
(string) filemtime($svg_icon_js),
false // load in <head> so icons are available early
);
}
$svg_helper_js = get_template_directory() . '/assets/js/svg-icon-helper.js';
if (file_exists($svg_helper_js)) {
wp_enqueue_script(
'aksrt-svg-icon-helper',
$base_uri . '/assets/js/svg-icon-helper.js',
['aksrt-svg-icon'],
(string) filemtime($svg_helper_js),
true
);
}
// Page loading indicator (top progress bar)
$loader_js = get_template_directory() . '/assets/js/loader.js';
if (file_exists($loader_js)) {
wp_enqueue_script(
'aksrt-loader',
$base_uri . '/assets/js/loader.js',
[],
(string) filemtime($loader_js),
true
);
}
// Code block enhancements (copy button + language label)
$precode_js = get_template_directory() . '/assets/js/precode.js';
if (file_exists($precode_js)) {
wp_enqueue_script(
'aksrt-precode',
$base_uri . '/assets/js/precode.js',
[],
(string) filemtime($precode_js),
true
);
}
// Input field enhancements (auto-resize, counter, validation)
$input_expand_js = get_template_directory() . '/assets/js/input-expand.js';
if (file_exists($input_expand_js)) {
wp_enqueue_script(
'aksrt-input-expand',
$base_uri . '/assets/js/input-expand.js',
[],
(string) filemtime($input_expand_js),
true
);
}
// Instant page prefetch (hover to preload)
$instant_page_js = get_template_directory() . '/assets/js/instant-page.js';
if (file_exists($instant_page_js)) {
wp_enqueue_script(
'aksrt-instant-page',
$base_uri . '/assets/js/instant-page.js',
[],
(string) filemtime($instant_page_js),
false // load in <head> for early prefetch capability
);
}
// Touch gesture support (swipe, pull-to-dismiss)
$mini_touch_js = get_template_directory() . '/assets/js/mini-touch.js';
if (file_exists($mini_touch_js)) {
wp_enqueue_script(
'aksrt-mini-touch',
$base_uri . '/assets/js/mini-touch.js',
[],
(string) filemtime($mini_touch_js),
true
);
}
// Section navs: article TOC / scrollspy
$section_navs_js = get_template_directory() . '/assets/js/section-navs.js';
if (file_exists($section_navs_js)) {
wp_enqueue_script(
'aksrt-section-navs',
$base_uri . '/assets/js/section-navs.js',
['aksrt-rehydrate', 'aksrt-runtime'],
(string) filemtime($section_navs_js),
true
);
}
// Video player (MP4/HLS/FLV)
$video_player_js = get_template_directory() . '/assets/js/video-player.js';
if (file_exists($video_player_js)) {
wp_enqueue_script(
'aksrt-video-player',
$base_uri . '/assets/js/video-player.js',
[],
(string) filemtime($video_player_js),
true
);
}
// Image color extraction
$color_extract_js = get_template_directory() . '/assets/js/color-extract.js';
if (file_exists($color_extract_js)) {
wp_enqueue_script(
'aksrt-color-extract',
$base_uri . '/assets/js/color-extract.js',
[],
(string) filemtime($color_extract_js),
true
);
}
$widget_set_js = get_template_directory() . '/assets/js/widget-set.js';
if (file_exists($widget_set_js)) {
wp_enqueue_script(
'aksrt-widget-set',
$base_uri . '/assets/js/widget-set.js',
['aksrt-script', 'aksrt-qrcode'],
(string) filemtime($widget_set_js),
true
);
}
// ===== 全局 UI 增强(Toast、骨架屏、悬停动效、灯箱、滚动感知)=====
$enhancements_css = get_template_directory() . '/assets/css/frontend/enhancements.css';
if (file_exists($enhancements_css)) {
wp_enqueue_style(
'aksrt-enhancements',
$base_uri . '/assets/css/frontend/enhancements.css',
[$core_dep],
(string) filemtime($enhancements_css)
);
}
$enhancements_js = get_template_directory() . '/assets/js/enhancements.js';
if (file_exists($enhancements_js)) {
wp_enqueue_script(
'aksrt-enhancements',
$base_uri . '/assets/js/enhancements.js',
['aksrt-script'],
(string) filemtime($enhancements_js),
true
);
}
$enhancements2_js = get_template_directory() . '/assets/js/enhancements2.js';
if (file_exists($enhancements2_js)) {
wp_enqueue_script(
'aksrt-enhancements2',
$base_uri . '/assets/js/enhancements2.js',
['aksrt-script'],
(string) filemtime($enhancements2_js),
true
);
}
// Reward (打赏)
$reward_js = get_template_directory() . '/assets/js/reward.js';
if (file_exists($reward_js)) {
wp_enqueue_script(
'aksrt-reward',
$base_uri . '/assets/js/reward.js',
['aksrt-script'],
(string) filemtime($reward_js),
true
);
}
// Effects (count-up, countdown, marquee, tilt, FPS detection)
$effects_js = get_template_directory() . '/assets/js/effects.js';
if (file_exists($effects_js)) {
wp_enqueue_script(
'aksrt-effects',
$base_uri . '/assets/js/effects.js',
['aksrt-script'],
(string) filemtime($effects_js),
true
);
}
// Yiyan (一言轮播)
$yiyan_js = get_template_directory() . '/assets/js/yiyan.js';
if (file_exists($yiyan_js)) {
wp_enqueue_script(
'aksrt-yiyan',
$base_uri . '/assets/js/yiyan.js',
[],
(string) filemtime($yiyan_js),
true
);
}
// Frontend translate (默认关)
$translate_js = get_template_directory() . '/assets/js/frontend-translate.js';
if (file_exists($translate_js)) {
wp_enqueue_script(
'aksrt-frontend-translate',
$base_uri . '/assets/js/frontend-translate.js',
[],
(string) filemtime($translate_js),
true
);
}
// Content protection (copy notice / right-click / F12)
$content_protect_js = get_template_directory() . '/assets/js/content-protect.js';
if (file_exists($content_protect_js)) {
wp_enqueue_script(
'aksrt-content-protect',
$base_uri . '/assets/js/content-protect.js',
[],
(string) filemtime($content_protect_js),
false // load in <head> for early binding
);
}
// Site notice popup (global, controlled by Settings)
$site_notice_css = get_template_directory() . '/assets/css/frontend/site-notice.css';
if (file_exists($site_notice_css)) {
wp_enqueue_style(
'aksrt-site-notice',
$base_uri . '/assets/css/frontend/site-notice.css',
[$core_dep],
(string) filemtime($site_notice_css)
);
}
$site_notice_js = get_template_directory() . '/assets/js/site-notice.js';
if (file_exists($site_notice_js)) {
wp_enqueue_script(
'aksrt-site-notice',
$base_uri . '/assets/js/site-notice.js',
[],
(string) filemtime($site_notice_js),
true
);
}
// 弹窗登录/注册(仅未登录用户)
if (!is_user_logged_in()) {
$modal_auth_js = get_template_directory() . '/assets/js/modal-auth.js';
if (file_exists($modal_auth_js)) {
wp_enqueue_script(
'aksrt-modal-auth',
$base_uri . '/assets/js/modal-auth.js',
['aksrt-script'],
(string) filemtime($modal_auth_js),
true
);
}
}
if ($is_fixed_homepage) {
$homepage_js_path = get_template_directory() . '/assets/js/homepage-fixed.js';
wp_enqueue_script(
'aksrt-homepage-fixed',
$base_uri . '/assets/js/homepage-fixed.js',
['aksrt-script'],
file_exists($homepage_js_path) ? (string) filemtime($homepage_js_path) : $version,
true
);
}
// Comment toolbar (smilie/code/image/quick shortcodes) — post form.
$load_comment_tools = (is_singular() && comments_open());
if ($load_comment_tools) {
$comment_tools_path = get_template_directory() . '/assets/js/comment-tools.js';
wp_enqueue_script(
'aksrt-comment-tools',
$base_uri . '/assets/js/comment-tools.js',
['aksrt-script', 'aksrt-core-comment-fixed', 'aksrt-core-comment-move'],
file_exists($comment_tools_path) ? (string) filemtime($comment_tools_path) : $version,
true
);
$comment_tools_css = get_template_directory() . '/assets/css/frontend/comment-tools.css';
if (file_exists($comment_tools_css)) {
wp_enqueue_style(
'aksrt-comment-tools',
$base_uri . '/assets/css/frontend/comment-tools.css',
['aksrt-comments'],
(string) filemtime($comment_tools_css)
);
}
}
// Comment actions client (like / edit / delete / moderate / pin).
// Submit path lives in assets/js/core/comments.js (REST).
if (is_singular() && (comments_open() || (int) get_comments_number() > 0)) {
$comment_ajax_path = get_template_directory() . '/assets/js/comment-ajax.js';
if (file_exists($comment_ajax_path)) {
wp_enqueue_script(
'aksrt-comment-ajax',
$base_uri . '/assets/js/comment-ajax.js',
['aksrt-script', 'aksrt-core-comments'],
(string) filemtime($comment_ajax_path),
true
);
}
}
if (is_singular()) {
$page_template_path = get_template_directory() . '/assets/js/page-template.js';
if (file_exists($page_template_path)) {
wp_enqueue_script(
'aksrt-page-template',
$base_uri . '/assets/js/page-template.js',
['aksrt-script'],
(string) filemtime($page_template_path),
true
);
}
}
// Post/resource share functionality
if ($is_single_post || $is_single_resource) {
$weixin_share_path = get_template_directory() . '/assets/js/weixin-share.js';
if (file_exists($weixin_share_path)) {
wp_enqueue_script(
'aksrt-weixin-share',
$base_uri . '/assets/js/weixin-share.js',
['aksrt-script'],
(string) filemtime($weixin_share_path),
true
);
}
$post_share_path = get_template_directory() . '/assets/js/post-share.js';
if (file_exists($post_share_path)) {
wp_enqueue_script(
'aksrt-post-share',
$base_uri . '/assets/js/post-share.js',
['aksrt-script', 'aksrt-weixin-share', 'aksrt-share-data'],
(string) filemtime($post_share_path),
true
);
}
}
// Page navigation (TOC highlight, smooth scroll, doc search)
// 评论回复脚本
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
$runtime_routes = $this->resolve_frontend_routes();
// 数据注入 - 全站统一消费 window.aksrtData
// Attach to aksrt-runtime (loaded before all core modules) so ajaxUrl/nonce
// exist before pagination/search/article handlers run.
$aksrt_data_handle = wp_script_is('aksrt-runtime', 'registered') || wp_script_is('aksrt-runtime', 'enqueued')
? 'aksrt-runtime'
: 'aksrt-script';
wp_localize_script($aksrt_data_handle, 'aksrtData', [
'ajaxUrl' => admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('aksrt_public_nonce'),
'restNonce' => wp_create_nonce('wp_rest'),
'visibilityNonce' => wp_create_nonce('aksrt_visibility'),
'siteUrl' => home_url('/'),
'themeUrl' => AKSRT_URI,
'themeMode' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::theme_mode_js_value() : 'auto',
'debug' => defined('WP_DEBUG') && WP_DEBUG,
'debugLog' => defined('WP_DEBUG') && WP_DEBUG && defined('WP_DEBUG_LOG') && WP_DEBUG_LOG,
'postPaginationMode' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_post_pagination_mode() : 'load_more',
'commentPaginationMode' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_comment_pagination_mode() : 'numbered',
'homepagePostsPerPage' => function_exists('aksrt_homepage_get_tab_posts_per_page') ? aksrt_homepage_get_tab_posts_per_page() : (int) get_option('posts_per_page'),
'homepageDefaultSort' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::homepage_default_sort() : 'modified',
'homepageDefaultView' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::homepage_default_view() : 'list',
'homepageSortAjax' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::homepage_sort_ajax_enabled() : true,
'homepageStickyTabs' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::homepage_sticky_tabs_enabled() : true,
'homePostsListEnabled' => !class_exists('\AKSRT\Settings\Settings') || \AKSRT\Settings\Settings::home_posts_list_enabled(),
'homeListSortEnabled' => !class_exists('\AKSRT\Settings\Settings') || \AKSRT\Settings\Settings::home_list_sort_enabled(),
'homeListSortDropdown' => class_exists('\AKSRT\Settings\Settings') && \AKSRT\Settings\Settings::home_list_sort_dropdown(),
// AJAX 翻页文案
'ajaxTrigger' => (class_exists('\AKSRT\Settings\Settings') && ($t = \AKSRT\Settings\Settings::get_post_list_style_settings()['ajax_trigger_text'] ?? '') !== '') ? $t : __('加载更多', 'aksrt'),
'ajaxNomore' => (class_exists('\AKSRT\Settings\Settings') && ($n = \AKSRT\Settings\Settings::get_post_list_style_settings()['ajax_nomore_text'] ?? '') !== '') ? $n : __('没有更多了', 'aksrt'),
'ajaxLoading' => __('正在加载...', 'aksrt'),
'iasMax' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_post_list_style_settings()['ias_max'] : 3,
'commentIasAuto' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_comment_display_settings()['paging_ajax_ias'] : true,
'commentUploadEnabled' => class_exists('\AKSRT\Settings\Settings') ? !empty((\AKSRT\Settings\Settings::get_comment_display_settings()['toolbar']['upload_img'] ?? false)) : false,
'commentUploadUrl' => esc_url_raw(rest_url('aksrt/v1/comment/upload-image')),
'commentUploadMaxSize' => 2 * 1024 * 1024,
'commentIasMax' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_comment_display_settings()['paging_ajax_ias_max'] : 3,
'commentQuickPhrases' => class_exists('\AKSRT\Settings\Settings') ? (\AKSRT\Settings\Settings::get_comment_display_settings()['quick_phrases'] ?? []) : [],
'commentSmiliesBase' => function_exists('aksrt_comment_smilies_base_uri') ? aksrt_comment_smilies_base_uri() : (trailingslashit(get_template_directory_uri()) . 'assets/img/smilies/'),
'restUrl' => esc_url_raw(rest_url('aksrt/v1')),
// Alias used by modal-auth / follow / report (same value as restUrl).
'apiUrl' => esc_url_raw(rest_url('aksrt/v1')),
'stickyEnabled' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_post_list_style_settings()['sticky_enabled'] : true,
'stickyPages' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_post_list_style_settings()['sticky_pages'] : ['home', 'cat'],
'badgeShow' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_post_list_style_settings()['badge_show'] : true,
'badgeTypes' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_post_list_style_settings()['badge_types'] : ['pay', 'tag', 'topics', 'cat'],
'search' => [
'mode' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::search_mode() : 'default',
'placeholder' => function_exists('aksrt_get_search_placeholder') ? aksrt_get_search_placeholder() : __('开启精彩搜索...', 'aksrt'),
'historyEnabled' => function_exists('aksrt_search_history_enabled') ? aksrt_search_history_enabled() : true,
'suggestionsEnabled' => function_exists('aksrt_search_suggestions_enabled') ? aksrt_search_suggestions_enabled() : false,
'hotKeywords' => function_exists('aksrt_get_search_hot_keywords') ? aksrt_get_search_hot_keywords() : [],
'popularTitle' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::search_popular_title() : __('热门搜索', 'aksrt'),
'contentTypes' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_search_content_types()['types'] : ['post', 'category', 'tag'],
'defaultType' => class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_search_content_types()['default'] : 'post',
],
// 用户状态
'isLoggedIn' => is_user_logged_in(),
'userId' => get_current_user_id(),
'cartUrl' => $runtime_routes['cart'],
'ordersUrl' => $runtime_routes['orders'],
'userCenterUrl' => function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/'),
'routes' => [
'home' => home_url('/'),
'login' => function_exists('aksrt_get_login_url') ? aksrt_get_login_url() : wp_login_url(),
'register' => function_exists('aksrt_get_register_url') ? aksrt_get_register_url() : wp_registration_url(),
'resetPassword' => function_exists('aksrt_get_reset_password_url') ? aksrt_get_reset_password_url() : wp_lostpassword_url(),
'profile' => function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/profile/'),
'cart' => $runtime_routes['cart'],
'orders' => $runtime_routes['orders'],
'resources' => $runtime_routes['resources'],
],
'shell' => [
'wrapperId' => '',
'navId' => 'navbar-top',
'searchPanelId' => 'nav-search-panel',
'drawerId' => 'mobile-navbar',
'userMenuId' => 'sub-user-box',
'floatActionsId' => 'float-right-btns',
'tabbarId' => 'footer-tabbar',
],
'themeUri' => get_template_directory_uri(),
'codeHighlight' => class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_code_highlight_config()
: ['enabled' => true, 'lightTheme' => 'enlighter', 'darkTheme' => 'monokai', 'lineNumbers' => false, 'showButtons' => true, 'maxHeight' => 500],
'lazyload' => class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_lazyload_config()
: ['enabled' => true, 'animation' => 'blur', 'placeholder_url' => '', 'blur' => true],
'systemNotice' => class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_system_notice_config()
: ['enabled' => false],
'contentProtect' => [
'enabled' => class_exists('\AKSRT\Settings\Settings') && (bool) \AKSRT\Settings\Settings::get_value('content_protect_enabled', false),
'copyNotice' => class_exists('\AKSRT\Settings\Settings') && (bool) \AKSRT\Settings\Settings::get_value('content_protect_copy_notice', false),
'copyNoticeText' => class_exists('\AKSRT\Settings\Settings') ? (string) \AKSRT\Settings\Settings::get_value('content_protect_copy_text', '来自本站,请尊重原创版权。') : '',
'disableRightClick'=> class_exists('\AKSRT\Settings\Settings') && (bool) \AKSRT\Settings\Settings::get_value('content_protect_right_click', false),
'detectDevTools' => class_exists('\AKSRT\Settings\Settings') && (bool) \AKSRT\Settings\Settings::get_value('content_protect_f12', false),
],
'translate' => class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_i18n_config()
: ['enabled' => false, 'autoDetect' => true, 'defaultLang' => 'zh-CN'],
]);
}
}