Clicking 加载更多 in the 多栏目文章 widget showed no skeleton at all — the
list simply stayed still until the response arrived, then the new cards
appeared. The homepage stream, archives and comments already had a working
skeleton; the widget's AJAX load goes through a different client and never
found its loader.
Root cause was DOM placement, not visibility: ContentRenderer emitted
.post_ajax_loader as a *sibling* of .widget-ajaxpager, while the widget REST
client resolves it with container.querySelector('.post_ajax_loader'). The
node existed but could never match, so .is-loading was never added and the
skeleton stayed display:none. Inactive tab panes had the same shape, and the
direct-load branch of ajaxpager() emitted no loader at all.
Changes, all following the reference theme's post_ajax() contract in
zibll/js/main.js (beforeSend anchors the loader to the end of the list;
success only hides it, never removes it):
- ContentRenderer: nest the loader inside .widget-ajaxpager for both the
direct-load and inactive-tab branches, and drop the sibling append.
- widgets/frontend.js: anchorLoader() moves the loader to the end of the
list before .ajax-pag on every request; appended cards are inserted before
it; a replace preserves the node instead of wiping it with innerHTML; a
fallback loader is created when the DOM has none; loadItems() now returns
its promise; drop the unreachable is-loading auto-load branch.
- Message centre, user-home panels and the search page switch from spinner /
opacity feedback to the same .posts-item-shaped skeleton, so all AJAX
surfaces share one loading contract.
- Remove the second, never-wired skeleton system (.aksrt-skeleton-* in
core-ui.css) and the dead spinner stylesheets/rules (skeleton.css,
ajax-spinner.css, .load-more__*, --skeleton-base/--skeleton-shine) plus the
unregistered assets/js/waterfall.js.
- Extend the widget, message-centre, user-home and asset-ledger contract
tests to pin the loader inside the container, the class-only visibility
switch, and the absence of the deleted dead code.
Verified: 470 node tests, 136 PHP widget assertions, admin-contract and
widget-system audits all green; rebuilt public assets after the CSS/JS
removals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
93 lines
4.6 KiB
PHP
93 lines
4.6 KiB
PHP
<?php
|
|
/**
|
|
* AKSRT Theme Bootstrap Loader
|
|
*
|
|
* Helpers + procedural modules + core hooks.
|
|
* Domain classes load via Composer PSR-4 (src/).
|
|
*
|
|
* @package AKSRT
|
|
* @version 3.4.0
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
// Stage 1: helpers
|
|
require_once AKSRT_DIR . '/inc/aksrt-ajax-debug.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-icons.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-icon-picker.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-avatar.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-domain-model.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-template-tags.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-frontend-tags.php';
|
|
// Shared comment kernel.
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-ip-geo.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/comments/content.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/comments/actions.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/comments/geo.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/comments/icons.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/comments/form-parts.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/comments/item.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-flow.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-homepage.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/homepage/content.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/homepage/header-components.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/homepage/layout.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-single-components.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-share.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-single.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-yiyan.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-single-render.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-single-aside.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-archive.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-archive-filters.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-comments.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-page-template.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-slider.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-vip.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-auth-ui.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-i18n-header.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-posts-renderer.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-resource.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-pay.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-coupon-order.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-credits.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-null.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/user-ban.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-ajax-list.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-links.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/message-placeholder.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/search/aksrt-search-posts.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/search/aksrt-search-box.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-header-userbox.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-header-menu-buttons.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/header/aksrt-header-render.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/header/aksrt-header-navbar.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/header/aksrt-header-mobile.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/header/aksrt-header-menu-search.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-float-buttons.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-identity.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-graphic-card.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-widgets-markup.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-icon-cards.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-user-card.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-rewards.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/menu-decoration.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-transactions.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-user-dashboard.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-user-center.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-user-home.php';
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-shortcodes.php';
|
|
|
|
// Stage 2: procedural modules
|
|
require_once AKSRT_DIR . '/inc/modules/captcha.php';
|
|
require_once AKSRT_DIR . '/inc/modules/user-hub.php';
|
|
require_once AKSRT_DIR . '/inc/modules/user-notifications.php';
|
|
require_once AKSRT_DIR . '/inc/modules/message-center.php';
|
|
require_once AKSRT_DIR . '/inc/modules/creator-revenue.php';
|
|
|
|
// Stage 3: core hooks
|
|
require_once AKSRT_DIR . '/inc/core-hooks.php';
|
|
|
|
add_action('admin_init', function () {
|
|
}, 5);
|