refactor: rename the theme brand and every identifier from AKSRT to Jio
Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.
Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)
Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
(dropped 3 stale entries, added the 17 missing ones)
Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
when it is empty
Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.
Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5b16bc6e15
commit
35bb96e82f
997 files changed
+28216
-28188
No files matched your search
@@ -1,39 +1,39 @@
|
||||
/**
|
||||
* AKSRT AJAX Pagination & Lazy Load
|
||||
* Jio AJAX Pagination & Lazy Load
|
||||
*/
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function hasAjaxConfig() {
|
||||
return !!(window.aksrtData && aksrtData.ajaxUrl && aksrtData.nonce);
|
||||
return !!(window.jioData && jioData.ajaxUrl && jioData.nonce);
|
||||
}
|
||||
|
||||
function initAjaxPagination(root) {
|
||||
var containers = (root || document).querySelectorAll("[data-aksrt-pagination], .aksrt-comment-pagination");
|
||||
var containers = (root || document).querySelectorAll("[data-jio-pagination], .jio-comment-pagination");
|
||||
if (!containers.length) return;
|
||||
|
||||
var triggerText = (window.aksrtData && aksrtData.ajaxTrigger) || "加载更多";
|
||||
var nomoreText = (window.aksrtData && aksrtData.ajaxNomore) || "没有更多了";
|
||||
var errorText = (window.aksrtData && aksrtData.ajaxLoadError) || "加载失败,请重试";
|
||||
var triggerText = (window.jioData && jioData.ajaxTrigger) || "加载更多";
|
||||
var nomoreText = (window.jioData && jioData.ajaxNomore) || "没有更多了";
|
||||
var errorText = (window.jioData && jioData.ajaxLoadError) || "加载失败,请重试";
|
||||
|
||||
containers.forEach(function (container) {
|
||||
if (container.dataset.aksrtPaginationBound === "1") return;
|
||||
container.dataset.aksrtPaginationBound = "1";
|
||||
if (container.dataset.jioPaginationBound === "1") return;
|
||||
container.dataset.jioPaginationBound = "1";
|
||||
|
||||
var mode = container.dataset.mode || "load_more";
|
||||
var nextPage = parseInt(container.dataset.nextPage, 10) || 2;
|
||||
var maxPages = parseInt(container.dataset.maxPages, 10) || 1;
|
||||
var isComment = container.classList.contains("aksrt-comment-pagination");
|
||||
var isComment = container.classList.contains("jio-comment-pagination");
|
||||
var postId = container.dataset.postId || "";
|
||||
var commentOrder = container.dataset.commentOrder || "newest";
|
||||
var loading = false;
|
||||
var failed = false;
|
||||
var clickTarget = container.querySelector(".next-page.ajax-next, .ias-btn") || container;
|
||||
var loadMoreBtn = container.querySelector("[data-aksrt-load-more]") || clickTarget;
|
||||
var loadMoreBtn = container.querySelector("[data-jio-load-more]") || clickTarget;
|
||||
var successfulAutoLoads = 0;
|
||||
var iasMax = isComment
|
||||
? ((window.aksrtData && typeof aksrtData.commentIasMax !== "undefined") ? parseInt(aksrtData.commentIasMax, 10) : 0)
|
||||
: ((window.aksrtData && typeof aksrtData.iasMax !== "undefined") ? parseInt(aksrtData.iasMax, 10) : 0);
|
||||
? ((window.jioData && typeof jioData.commentIasMax !== "undefined") ? parseInt(jioData.commentIasMax, 10) : 0)
|
||||
: ((window.jioData && typeof jioData.iasMax !== "undefined") ? parseInt(jioData.iasMax, 10) : 0);
|
||||
// legacy 契约:分页容器与列表同处一个 .ajaxpager 内(首页 tab pane、归档流),
|
||||
// 此时追加目标就是列表容器本身,新卡片插到分页控件之前。
|
||||
var listContainer = container.closest(".ajaxpager, .posts-row");
|
||||
@@ -50,7 +50,7 @@
|
||||
target = container.parentElement.querySelector(".post-grid, .comment-list, .commentlist, .content-stream__list");
|
||||
}
|
||||
|
||||
// 文章骨架:与 runtime/main.js 的 .ajax-next 处理器、aksrt_render_placeholder()
|
||||
// 文章骨架:与 runtime/main.js 的 .ajax-next 处理器、jio_render_placeholder()
|
||||
// 同源同款(1:1 对齐参考主题 zib_get_post_placeholder)。刻意不写 ajax-item:
|
||||
// 否则会被 inject() / find('.ajax-item') 当成真实条目删除或定位。
|
||||
var CARD_ITEM =
|
||||
@@ -94,7 +94,7 @@
|
||||
// 兜底(非文章列表面,例如评论区没有 .posts-item 时):转圈 + 文案,
|
||||
// 绝不用按钮自身文字来表达加载态。
|
||||
function fallbackLoader() {
|
||||
var text = (window.aksrtData && aksrtData.ajaxLoading) || "加载中...";
|
||||
var text = (window.jioData && jioData.ajaxLoading) || "加载中...";
|
||||
return (
|
||||
'<div class="mb20"><div class="text-center muted-2-color mt20">' +
|
||||
'<i class="loading mr10"></i>' + text +
|
||||
@@ -167,13 +167,13 @@
|
||||
// 只操作 .post_ajax_loader,不触碰「加载更多」按钮自身的文字)。
|
||||
showSkeleton();
|
||||
|
||||
var action = isComment ? "aksrt_load_more_comments" : "aksrt_load_more_posts";
|
||||
var action = isComment ? "jio_load_more_comments" : "jio_load_more_posts";
|
||||
var queryContext = container.dataset.queryContext || "";
|
||||
var queryVars = container.dataset.queryVars || "";
|
||||
var renderConfig = container.dataset.renderConfig || "";
|
||||
var body = new URLSearchParams();
|
||||
body.set("action", action);
|
||||
body.set("nonce", aksrtData.nonce);
|
||||
body.set("nonce", jioData.nonce);
|
||||
body.set("page", String(nextPage));
|
||||
if (queryContext) {
|
||||
body.set("query_context", queryContext);
|
||||
@@ -191,7 +191,7 @@
|
||||
if (authorOnly === "1") body.set("author_only", "1");
|
||||
}
|
||||
|
||||
return fetch(aksrtData.ajaxUrl, {
|
||||
return fetch(jioData.ajaxUrl, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" },
|
||||
credentials: "same-origin",
|
||||
@@ -285,9 +285,9 @@
|
||||
var max = parseInt(jumpInput.dataset.maxPages || String(maxPages), 10) || maxPages;
|
||||
targetPage = Math.max(1, Math.min(max, targetPage));
|
||||
// 评论跳页:本地 DOM 刷新,地址栏不携带 ? 参数。
|
||||
if (window.AksrtComments && typeof window.AksrtComments.loadPage === "function") {
|
||||
if (window.JioComments && typeof window.JioComments.loadPage === "function") {
|
||||
e.preventDefault();
|
||||
window.AksrtComments.loadPage(targetPage);
|
||||
window.JioComments.loadPage(targetPage);
|
||||
return;
|
||||
}
|
||||
window.location.hash = "comments";
|
||||
@@ -329,7 +329,7 @@
|
||||
}
|
||||
|
||||
if (mode === "infinite") {
|
||||
if ((isComment && window.aksrtData && aksrtData.commentIasAuto === false) || !hasAjaxConfig()) {
|
||||
if ((isComment && window.jioData && jioData.commentIasAuto === false) || !hasAjaxConfig()) {
|
||||
var autoTrigger = clickTarget.closest(".next-page") || clickTarget;
|
||||
autoTrigger.classList.remove("lazyload");
|
||||
autoTrigger.removeAttribute("lazyload-action");
|
||||
|
||||
Reference in new issue
Block a user