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
+28
-28
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* AKSRT Comment System — AJAX submit, captcha, ordering, author filter
|
||||
* Jio Comment System — AJAX submit, captcha, ordering, author filter
|
||||
*/
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function initCommentSystem() {
|
||||
var form = document.querySelector("#commentform");
|
||||
if (!form || form.dataset.aksrtCommentInit === "1") return;
|
||||
form.dataset.aksrtCommentInit = "1";
|
||||
if (!form || form.dataset.jioCommentInit === "1") return;
|
||||
form.dataset.jioCommentInit = "1";
|
||||
|
||||
// 修复:同时匹配 button 和 input 元素
|
||||
var submitBtn = form.querySelector('[type="submit"]');
|
||||
@@ -35,7 +35,7 @@
|
||||
isSubmitting = true;
|
||||
submitBtn.classList.add("is-loading");
|
||||
submitBtn.disabled = true;
|
||||
var loadingText = (window.aksrtData && aksrtData.commentSubmittingText) || '发送中...';
|
||||
var loadingText = (window.jioData && jioData.commentSubmittingText) || '发送中...';
|
||||
setSubmitBtnContent('<i class="fa fas fa-spinner fa-spin"></i> ' + loadingText, loadingText);
|
||||
} else {
|
||||
isSubmitting = false;
|
||||
@@ -98,10 +98,10 @@
|
||||
setLoading(true);
|
||||
|
||||
var formData = collectFormData();
|
||||
var restRoot = (window.aksrtData && aksrtData.siteUrl) ? String(aksrtData.siteUrl).replace(/\/$/, '') : '';
|
||||
var restRoot = (window.jioData && jioData.siteUrl) ? String(jioData.siteUrl).replace(/\/$/, '') : '';
|
||||
var editId = form.querySelector('[name="edit_comment_ID"]');
|
||||
var isEdit = editId && parseInt(editId.value, 10) > 0;
|
||||
var restBase = (restRoot || '') + '/wp-json/aksrt/v1/comment/' + (isEdit ? 'edit' : 'submit');
|
||||
var restBase = (restRoot || '') + '/wp-json/jio/v1/comment/' + (isEdit ? 'edit' : 'submit');
|
||||
|
||||
// Try REST endpoint for local-insert HTML response
|
||||
var restBody = {};
|
||||
@@ -116,7 +116,7 @@
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-WP-Nonce': (window.aksrtData && aksrtData.restNonce) || ''
|
||||
'X-WP-Nonce': (window.jioData && jioData.restNonce) || ''
|
||||
},
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify(restBody)
|
||||
@@ -135,7 +135,7 @@
|
||||
setLoading(false);
|
||||
notyf(json.message || '评论已更新', 'success');
|
||||
var respondEl = document.getElementById('respond');
|
||||
if (respondEl && window.AksrtFixedInput) window.AksrtFixedInput(respondEl, 'hide');
|
||||
if (respondEl && window.JioFixedInput) window.JioFixedInput(respondEl, 'hide');
|
||||
return;
|
||||
}
|
||||
if (json && json.success && json.html) {
|
||||
@@ -160,8 +160,8 @@
|
||||
|
||||
// Hide mobile FixedInput after successful submit.
|
||||
var respondEl = document.getElementById('respond');
|
||||
if (respondEl && window.AksrtFixedInput) {
|
||||
window.AksrtFixedInput(respondEl, 'hide');
|
||||
if (respondEl && window.JioFixedInput) {
|
||||
window.JioFixedInput(respondEl, 'hide');
|
||||
} else if (respondEl) {
|
||||
respondEl.classList.remove('show');
|
||||
}
|
||||
@@ -185,12 +185,12 @@
|
||||
setTimeout(function () { reloadCommentList(); }, 500);
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error('[AKSRT Comment] 提交失败:', error);
|
||||
console.error('[Jio Comment] 提交失败:', error);
|
||||
notyf((error && error.message) || '网络连接失败,请检查网络后重试', 'danger');
|
||||
setLoading(false);
|
||||
})
|
||||
.finally(function () {
|
||||
if (window.AKSRTCaptcha) window.AKSRTCaptcha.reset('comment', form);
|
||||
if (window.JioCaptcha) window.JioCaptcha.reset('comment', form);
|
||||
if (!countdownTimer && isSubmitting) setLoading(false);
|
||||
});
|
||||
}
|
||||
@@ -277,7 +277,7 @@
|
||||
// 阻止默认表单提交
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
var captcha = window.AKSRTCaptcha;
|
||||
var captcha = window.JioCaptcha;
|
||||
setLoading(true);
|
||||
(captcha ? captcha.run('comment', form) : Promise.resolve({})).then(function (captchaPayload) {
|
||||
if (captchaPayload === null) {
|
||||
@@ -301,8 +301,8 @@
|
||||
|
||||
|
||||
function getCommentsRestBase() {
|
||||
var root = (window.aksrtData && aksrtData.siteUrl) ? String(aksrtData.siteUrl).replace(/\/$/, "") : "";
|
||||
return root + "/wp-json/aksrt/v1";
|
||||
var root = (window.jioData && jioData.siteUrl) ? String(jioData.siteUrl).replace(/\/$/, "") : "";
|
||||
return root + "/wp-json/jio/v1";
|
||||
}
|
||||
|
||||
function getCurrentCommentPostId() {
|
||||
@@ -317,7 +317,7 @@
|
||||
var active = document.querySelector("#comments .comment-order-box li.active .comment-orderby");
|
||||
if (active && active.dataset && active.dataset.order) return active.dataset.order;
|
||||
var url = new URL(window.location.href);
|
||||
return url.searchParams.get("aksrt_comment_order") || "newest";
|
||||
return url.searchParams.get("jio_comment_order") || "newest";
|
||||
}
|
||||
|
||||
function getCurrentAuthorOnly() {
|
||||
@@ -326,7 +326,7 @@
|
||||
}
|
||||
|
||||
/* ====== 全局无参数加载:评论状态仅保存在客户端,地址栏不携带 ? 参数 ====== */
|
||||
var COMMENT_URL_PARAMS = ["cpage", "aksrt_comment_order", "aksrt_author_only"];
|
||||
var COMMENT_URL_PARAMS = ["cpage", "jio_comment_order", "jio_author_only"];
|
||||
var commentUrlStateCleaned = false;
|
||||
|
||||
function stripCommentUrlParams() {
|
||||
@@ -448,7 +448,7 @@
|
||||
method: "GET",
|
||||
credentials: "same-origin",
|
||||
headers: {
|
||||
"X-WP-Nonce": (window.aksrtData && aksrtData.restNonce) || ""
|
||||
"X-WP-Nonce": (window.jioData && jioData.restNonce) || ""
|
||||
}
|
||||
}).then(function (r) { return r.json(); });
|
||||
}
|
||||
@@ -474,7 +474,7 @@
|
||||
|
||||
function reloadCommentList() {
|
||||
loadCommentPage(1, { noScroll: true }).catch(function (error) {
|
||||
console.error('[AKSRT Comment] 刷新评论列表失败:', error);
|
||||
console.error('[Jio Comment] 刷新评论列表失败:', error);
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
@@ -525,7 +525,7 @@
|
||||
throw new Error("order fragment failed");
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error("[AKSRT Comment] 排序刷新失败:", error);
|
||||
console.error("[Jio Comment] 排序刷新失败:", error);
|
||||
// 兜底整页刷新,地址栏保持无参。
|
||||
window.location.reload();
|
||||
});
|
||||
@@ -545,7 +545,7 @@
|
||||
throw new Error("author fragment failed");
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error("[AKSRT Comment] Author filter failed:", error);
|
||||
console.error("[Jio Comment] Author filter failed:", error);
|
||||
// 兜底整页刷新,地址栏保持无参。
|
||||
window.location.reload();
|
||||
});
|
||||
@@ -577,7 +577,7 @@
|
||||
if (page > 0) {
|
||||
e.preventDefault();
|
||||
loadCommentPage(page).catch(function (error) {
|
||||
console.error("[AKSRT Comment] 分页刷新失败:", error);
|
||||
console.error("[Jio Comment] 分页刷新失败:", error);
|
||||
// AJAX 不可用时退回原始链接(pretty 链接本身无 ? 参数)。
|
||||
window.location.href = pageLink.href;
|
||||
});
|
||||
@@ -592,7 +592,7 @@
|
||||
|
||||
function jumpToCommentPage(page) {
|
||||
loadCommentPage(page).catch(function (error) {
|
||||
console.error("[AKSRT Comment] 跳页失败:", error);
|
||||
console.error("[Jio Comment] 跳页失败:", error);
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
@@ -623,17 +623,17 @@
|
||||
function closeAllCommentDropdowns() {
|
||||
document.querySelectorAll("#postcomments .dropdown.open").forEach(function (wrap) {
|
||||
wrap.classList.remove("open");
|
||||
var trigger = wrap.querySelector("[data-aksrt-comment-drop]");
|
||||
var trigger = wrap.querySelector("[data-jio-comment-drop]");
|
||||
if (trigger) trigger.setAttribute("aria-expanded", "false");
|
||||
});
|
||||
}
|
||||
|
||||
function initCommentActionDropdowns() {
|
||||
if (document.documentElement.dataset.aksrtCommentDropBound === "1") return;
|
||||
document.documentElement.dataset.aksrtCommentDropBound = "1";
|
||||
if (document.documentElement.dataset.jioCommentDropBound === "1") return;
|
||||
document.documentElement.dataset.jioCommentDropBound = "1";
|
||||
|
||||
document.addEventListener("click", function (event) {
|
||||
var trigger = event.target.closest ? event.target.closest("[data-aksrt-comment-drop]") : null;
|
||||
var trigger = event.target.closest ? event.target.closest("[data-jio-comment-drop]") : null;
|
||||
if (trigger) {
|
||||
event.preventDefault();
|
||||
var wrap = trigger.closest(".dropdown");
|
||||
@@ -684,7 +684,7 @@
|
||||
}
|
||||
|
||||
// 供 pagination.js 等模块复用:评论页码加载 / 列表刷新(局部 DOM,无 ? 参数)。
|
||||
window.AksrtComments = {
|
||||
window.JioComments = {
|
||||
loadPage: function (page, opts) { return loadCommentPage(page, opts); },
|
||||
reload: function () { reloadCommentList(); }
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user