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
@@ -5,12 +5,12 @@
|
||||
* short in-memory caching, request deduplication, retryable errors, focus
|
||||
* restoration, and legacy `loaded.bs.modal` content lifecycle (auto_fun rescan).
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
(function (window, document) {
|
||||
"use strict";
|
||||
|
||||
var ROOT_ID = "aksrt-modal-runtime-root";
|
||||
var ROOT_ID = "jio-modal-runtime-root";
|
||||
var active = null;
|
||||
var sessions = [];
|
||||
var sequence = 0;
|
||||
@@ -25,7 +25,7 @@
|
||||
if (root) return root;
|
||||
root = document.createElement("div");
|
||||
root.id = ROOT_ID;
|
||||
root.className = "aksrt-modal-runtime-host";
|
||||
root.className = "jio-modal-runtime-host";
|
||||
document.body.appendChild(root);
|
||||
return root;
|
||||
}
|
||||
@@ -65,13 +65,13 @@
|
||||
scrollLock.push(padRight(element, gap));
|
||||
});
|
||||
}
|
||||
html.classList.add("aksrt-modal-runtime-open");
|
||||
body.classList.add("aksrt-modal-runtime-open");
|
||||
html.classList.add("jio-modal-runtime-open");
|
||||
body.classList.add("jio-modal-runtime-open");
|
||||
return;
|
||||
}
|
||||
if (!scrollLock) return;
|
||||
html.classList.remove("aksrt-modal-runtime-open");
|
||||
body.classList.remove("aksrt-modal-runtime-open");
|
||||
html.classList.remove("jio-modal-runtime-open");
|
||||
body.classList.remove("jio-modal-runtime-open");
|
||||
scrollLock.forEach(function (entry) {
|
||||
entry.element.style.paddingRight = entry.inline;
|
||||
});
|
||||
@@ -80,25 +80,25 @@
|
||||
|
||||
function skeleton(options) {
|
||||
if (options && options.loading === "spinner") {
|
||||
return '<div class="aksrt-modal-runtime__loading flex jc"><div class="em2x opacity5"><svg class="loading-circle" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20"></circle></svg></div></div>';
|
||||
return '<div class="jio-modal-runtime__loading flex jc"><div class="em2x opacity5"><svg class="loading-circle" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20"></circle></svg></div></div>';
|
||||
}
|
||||
return (options && options.skeleton) ||
|
||||
'<div class="aksrt-modal-runtime__skeleton" aria-live="polite" aria-busy="true">' +
|
||||
'<span class="aksrt-modal-runtime__skeleton-line is-wide"></span>' +
|
||||
'<span class="aksrt-modal-runtime__skeleton-line"></span>' +
|
||||
'<span class="aksrt-modal-runtime__skeleton-line is-short"></span>' +
|
||||
'<span class="aksrt-modal-runtime__skeleton-block"></span>' +
|
||||
'<div class="jio-modal-runtime__skeleton" aria-live="polite" aria-busy="true">' +
|
||||
'<span class="jio-modal-runtime__skeleton-line is-wide"></span>' +
|
||||
'<span class="jio-modal-runtime__skeleton-line"></span>' +
|
||||
'<span class="jio-modal-runtime__skeleton-line is-short"></span>' +
|
||||
'<span class="jio-modal-runtime__skeleton-block"></span>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
function telemetryStart(kind) {
|
||||
if (kind === false) return "";
|
||||
return window.AksrtModalTelemetry.start(kind || "generic");
|
||||
return window.JioModalTelemetry.start(kind || "generic");
|
||||
}
|
||||
|
||||
function telemetryMark(session, event) {
|
||||
if (!session || !session.telemetryId) return;
|
||||
window.AksrtModalTelemetry.mark(session.telemetryId, event);
|
||||
window.JioModalTelemetry.mark(session.telemetryId, event);
|
||||
}
|
||||
|
||||
function isLive(session) {
|
||||
@@ -109,7 +109,7 @@
|
||||
session.state.status = status;
|
||||
session.state.error = error || null;
|
||||
session.state.updatedAt = Date.now();
|
||||
if (session.shell) session.shell.setAttribute("data-aksrt-modal-state", status);
|
||||
if (session.shell) session.shell.setAttribute("data-jio-modal-state", status);
|
||||
if (typeof session.options.onState === "function") {
|
||||
session.options.onState(status, session);
|
||||
}
|
||||
@@ -120,7 +120,7 @@
|
||||
}
|
||||
|
||||
function closeSelector() {
|
||||
return "[data-aksrt-modal-close], .aksrt-modal-runtime__close";
|
||||
return "[data-jio-modal-close], .jio-modal-runtime__close";
|
||||
}
|
||||
|
||||
function bindChrome(session) {
|
||||
@@ -133,11 +133,11 @@
|
||||
close("control");
|
||||
return;
|
||||
}
|
||||
if (event.target === shell || event.target.classList.contains("aksrt-modal-runtime__overlay")) {
|
||||
if (event.target === shell || event.target.classList.contains("jio-modal-runtime__overlay")) {
|
||||
close("overlay");
|
||||
return;
|
||||
}
|
||||
var retry = event.target.closest("[data-aksrt-modal-retry]");
|
||||
var retry = event.target.closest("[data-jio-modal-retry]");
|
||||
if (retry) {
|
||||
event.preventDefault();
|
||||
refresh();
|
||||
@@ -178,32 +178,32 @@
|
||||
var heightStyle = options.height ? "min-height:" + parseInt(options.height, 10) + "px;" : "";
|
||||
var initialHtml = options.html !== undefined ? options.html : skeleton(options);
|
||||
var swipeHandle = bottom && options.swipeClose ? '<div class="touch-close" aria-hidden="true"></div>' : "";
|
||||
var titleId = "aksrt-modal-title-" + String(sequence + 1);
|
||||
var titleId = "jio-modal-title-" + String(sequence + 1);
|
||||
var titleHtml = options.title
|
||||
? '<header class="aksrt-modal-runtime__header"><h3 class="aksrt-modal-runtime__title" id="' + titleId + '">' + escapeHtml(options.title) + '</h3><button type="button" class="aksrt-modal-runtime__close" data-aksrt-modal-close aria-label="关闭">×</button></header>'
|
||||
? '<header class="jio-modal-runtime__header"><h3 class="jio-modal-runtime__title" id="' + titleId + '">' + escapeHtml(options.title) + '</h3><button type="button" class="jio-modal-runtime__close" data-jio-modal-close aria-label="关闭">×</button></header>'
|
||||
: "";
|
||||
|
||||
shell.className =
|
||||
"aksrt-modal-runtime" +
|
||||
(active ? " aksrt-modal-runtime--child" : "") +
|
||||
(bottom ? " aksrt-modal-runtime--bottom" : "") +
|
||||
"jio-modal-runtime" +
|
||||
(active ? " jio-modal-runtime--child" : "") +
|
||||
(bottom ? " jio-modal-runtime--bottom" : "") +
|
||||
(options.className ? " " + options.className : "");
|
||||
shell.setAttribute("role", "dialog");
|
||||
shell.setAttribute("aria-modal", "true");
|
||||
if (options.title) shell.setAttribute("aria-labelledby", titleId);
|
||||
shell.setAttribute("tabindex", "-1");
|
||||
shell.innerHTML =
|
||||
'<div class="aksrt-modal-runtime__overlay" data-aksrt-modal-close></div>' +
|
||||
'<div class="aksrt-modal-runtime__dialog" style="' + heightStyle + '">' +
|
||||
'<div class="jio-modal-runtime__overlay" data-jio-modal-close></div>' +
|
||||
'<div class="jio-modal-runtime__dialog" style="' + heightStyle + '">' +
|
||||
titleHtml +
|
||||
'<div class="aksrt-modal-runtime__content">' + initialHtml + "</div>" + swipeHandle + "</div>";
|
||||
'<div class="jio-modal-runtime__content">' + initialHtml + "</div>" + swipeHandle + "</div>";
|
||||
|
||||
var session = {
|
||||
id: String(++sequence),
|
||||
shell: shell,
|
||||
content: shell.querySelector(".aksrt-modal-runtime__content"),
|
||||
content: shell.querySelector(".jio-modal-runtime__content"),
|
||||
options: options,
|
||||
state: window.AksrtModalState.create(options.kind || "generic"),
|
||||
state: window.JioModalState.create(options.kind || "generic"),
|
||||
focusReturn: options.focusReturn !== undefined ? options.focusReturn : document.activeElement,
|
||||
controller: null,
|
||||
flight: null,
|
||||
@@ -212,7 +212,7 @@
|
||||
};
|
||||
|
||||
if (active) {
|
||||
active.shell.classList.add("aksrt-modal-runtime--parent");
|
||||
active.shell.classList.add("jio-modal-runtime--parent");
|
||||
active.shell.setAttribute("aria-modal", "false");
|
||||
active.shell.setAttribute("aria-hidden", "true");
|
||||
active.shell.setAttribute("inert", "");
|
||||
@@ -222,7 +222,7 @@
|
||||
if (bottom && options.swipeClose && window.jQuery && window.jQuery.fn && typeof window.jQuery.fn.minitouch === "function") {
|
||||
window.jQuery(shell).minitouch({
|
||||
direction: "bottom",
|
||||
selector: ".aksrt-modal-runtime__dialog",
|
||||
selector: ".jio-modal-runtime__dialog",
|
||||
start_selector: ".modal-colorful-header,.touch-close,.touch",
|
||||
depreciation: 50,
|
||||
stop: function () { return active !== session; },
|
||||
@@ -244,7 +244,7 @@
|
||||
(nodes.length ? nodes[0] : shell).focus();
|
||||
} catch (error) {}
|
||||
|
||||
document.dispatchEvent(new CustomEvent("aksrt:modal:open", {
|
||||
document.dispatchEvent(new CustomEvent("jio:modal:open", {
|
||||
detail: { shell: shell, options: options, session: session },
|
||||
}));
|
||||
|
||||
@@ -285,19 +285,19 @@
|
||||
if (!preserveRequest) abortSessionRequest(session);
|
||||
session.shell.classList.remove("is-open");
|
||||
if (active && resumeParent) {
|
||||
active.shell.classList.remove("aksrt-modal-runtime--parent");
|
||||
active.shell.classList.remove("jio-modal-runtime--parent");
|
||||
active.shell.setAttribute("aria-modal", "true");
|
||||
active.shell.removeAttribute("aria-hidden");
|
||||
active.shell.removeAttribute("inert");
|
||||
}
|
||||
if (!active && !preserveRequest) lockScroll(false);
|
||||
document.dispatchEvent(new CustomEvent("aksrt:modal:close", {
|
||||
document.dispatchEvent(new CustomEvent("jio:modal:close", {
|
||||
detail: { shell: session.shell, reason: reason || "close", session: session },
|
||||
}));
|
||||
|
||||
var node = session.shell;
|
||||
var exitDelay = 220;
|
||||
var dialog = node.querySelector(".aksrt-modal-runtime__dialog");
|
||||
var dialog = node.querySelector(".jio-modal-runtime__dialog");
|
||||
if (dialog) {
|
||||
var durations = window.getComputedStyle(dialog).transitionDuration || "";
|
||||
durations.split(",").forEach(function (duration) {
|
||||
@@ -348,11 +348,11 @@
|
||||
setState(session, unauthorized ? "unauthorized" : "error", error);
|
||||
telemetryMark(session, unauthorized ? "unauthorized" : "error");
|
||||
session.content.innerHTML =
|
||||
'<div class="aksrt-modal-runtime__error touch border-title"><b>提示</b></div>' +
|
||||
'<div class="aksrt-modal-runtime__error-body">' + escapeHtml(errorMessage(error)) +
|
||||
'<div class="jio-modal-runtime__error touch border-title"><b>提示</b></div>' +
|
||||
'<div class="jio-modal-runtime__error-body">' + escapeHtml(errorMessage(error)) +
|
||||
'</div><div class="but-average modal-buts">' +
|
||||
'<button type="button" class="but" data-aksrt-modal-retry>重试</button>' +
|
||||
'<button type="button" class="but" data-aksrt-modal-close>关闭</button></div>';
|
||||
'<button type="button" class="but" data-jio-modal-retry>重试</button>' +
|
||||
'<button type="button" class="but" data-jio-modal-close>关闭</button></div>';
|
||||
notifyContentLoaded(session);
|
||||
if (typeof session.options.onError === "function") session.options.onError(error, session);
|
||||
}
|
||||
@@ -366,7 +366,7 @@
|
||||
setState(session, "empty");
|
||||
telemetryMark(session, "first-content");
|
||||
telemetryMark(session, "ready");
|
||||
session.content.innerHTML = '<div class="aksrt-modal-runtime__error-body">暂无内容</div>';
|
||||
session.content.innerHTML = '<div class="jio-modal-runtime__error-body">暂无内容</div>';
|
||||
return;
|
||||
}
|
||||
if (typeof session.options.renderData === "function") {
|
||||
@@ -385,7 +385,7 @@
|
||||
setState(session, "empty");
|
||||
telemetryMark(session, "first-content");
|
||||
telemetryMark(session, "ready");
|
||||
session.content.innerHTML = '<div class="aksrt-modal-runtime__error-body">暂无内容</div>';
|
||||
session.content.innerHTML = '<div class="jio-modal-runtime__error-body">暂无内容</div>';
|
||||
return;
|
||||
}
|
||||
session.content.innerHTML = html;
|
||||
@@ -415,14 +415,14 @@
|
||||
if (!requestOptions.signal) delete requestOptions.signal;
|
||||
|
||||
var request = function () {
|
||||
return window.AksrtRequest.request(session.options.url, requestOptions);
|
||||
return window.JioRequest.request(session.options.url, requestOptions);
|
||||
};
|
||||
|
||||
var method = String(session.options.method || "GET").toUpperCase();
|
||||
var cacheable = method === "GET" && session.options.cache !== false;
|
||||
var cacheKey = session.options.cacheKey ||
|
||||
method + ":" + window.AksrtRequest.url(session.options.url, session.options.query);
|
||||
var cache = window.AksrtModalCache;
|
||||
method + ":" + window.JioRequest.url(session.options.url, session.options.query);
|
||||
var cache = window.JioModalCache;
|
||||
var acquireOptions = {
|
||||
ttl: Number(session.options.cacheTtl || 15000),
|
||||
tags: session.options.cacheTags || session.options.tags || [],
|
||||
@@ -471,7 +471,7 @@
|
||||
function sessionKey(options) {
|
||||
if (!options || !options.url) return "";
|
||||
var method = String(options.method || "GET").toUpperCase();
|
||||
var requestUrl = window.AksrtRequest.url(options.url, options.query);
|
||||
var requestUrl = window.JioRequest.url(options.url, options.query);
|
||||
return method + ":" + requestUrl;
|
||||
}
|
||||
|
||||
@@ -505,10 +505,10 @@
|
||||
}
|
||||
|
||||
function invalidate(tags) {
|
||||
return window.AksrtModalCache.invalidate(tags);
|
||||
return window.JioModalCache.invalidate(tags);
|
||||
}
|
||||
|
||||
window.AksrtModalRuntime = {
|
||||
window.JioModalRuntime = {
|
||||
open: open,
|
||||
openRemote: openRemote,
|
||||
close: close,
|
||||
@@ -520,13 +520,13 @@
|
||||
getState: function () { return active ? active.state : null; },
|
||||
};
|
||||
|
||||
document.dispatchEvent(new CustomEvent("aksrt:modal-runtime:ready"));
|
||||
document.dispatchEvent(new CustomEvent("jio:modal-runtime:ready"));
|
||||
|
||||
// legacy 契约(只绑定一次):modal 展示/内容注入后调用全局 auto_fun 重扫。
|
||||
if (window.jQuery) {
|
||||
window.jQuery(document).on(
|
||||
"loaded.bs.modal show.bs.modal",
|
||||
".modal, .aksrt-modal-runtime",
|
||||
".modal, .jio-modal-runtime",
|
||||
function () {
|
||||
if (typeof window.auto_fun === "function") window.auto_fun();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user