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
+39
-39
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* AKSRT Public User Home runtime
|
||||
* Jio Public User Home runtime
|
||||
*
|
||||
* Handles public user-home dashboard tabs, panel fragment loading and cover
|
||||
* uploads. The URL stays clean (/author/{name}/) — tabs, follow sub-tabs and
|
||||
* pagination are loaded via the aksrt/v1 user-home panel REST fragment.
|
||||
* pagination are loaded via the jio/v1 user-home panel REST fragment.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
/* global aksrtAuthorPage, aksrtData, notyf */
|
||||
/* global jioAuthorPage, jioData, notyf */
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -21,8 +21,8 @@
|
||||
|
||||
function initPublicDashboards() {
|
||||
document.querySelectorAll('.dashboard--public').forEach(function (root) {
|
||||
if (root.dataset.aksrtAuthorBound === '1') return;
|
||||
root.dataset.aksrtAuthorBound = '1';
|
||||
if (root.dataset.jioAuthorBound === '1') return;
|
||||
root.dataset.jioAuthorBound = '1';
|
||||
|
||||
var tabs = Array.prototype.slice.call(root.querySelectorAll('.dashboard-tabs [data-tab]'));
|
||||
if (!tabs.length) return;
|
||||
@@ -79,10 +79,10 @@
|
||||
}
|
||||
|
||||
function loadPanelBody(panel, name, page, sub, appendComments, trigger) {
|
||||
var cfg = window.aksrtData || {};
|
||||
var cfg = window.jioData || {};
|
||||
var restBase = cfg.apiUrl || cfg.restUrl || '';
|
||||
if (!userId || !restBase) return Promise.reject(new Error('rest-unavailable'));
|
||||
if (panel._aksrtUhRequest) return panel._aksrtUhRequest;
|
||||
if (panel._jioUhRequest) return panel._jioUhRequest;
|
||||
|
||||
var followSub = sub || 'followers';
|
||||
// uhPage / uhSub 是**粉丝面板**的私有状态(其它面板没有子页签)。
|
||||
@@ -103,7 +103,7 @@
|
||||
var url = restBase.replace(/\/$/, '') + '/user-home/panel/' + userId + '/' + encodeURIComponent(name)
|
||||
+ '?page=' + encodeURIComponent(page) + '&sub=' + encodeURIComponent(followSub);
|
||||
|
||||
panel._aksrtUhRequest = fetch(url, {
|
||||
panel._jioUhRequest = fetch(url, {
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'X-WP-Nonce': cfg.restNonce || cfg.nonce || ''
|
||||
@@ -133,10 +133,10 @@
|
||||
}
|
||||
throw error;
|
||||
}).finally(function () {
|
||||
panel._aksrtUhRequest = null;
|
||||
panel._jioUhRequest = null;
|
||||
panel.classList.remove('is-loading');
|
||||
});
|
||||
return panel._aksrtUhRequest;
|
||||
return panel._jioUhRequest;
|
||||
}
|
||||
|
||||
function panelNameOf(panel) {
|
||||
@@ -214,15 +214,15 @@
|
||||
}
|
||||
|
||||
function initCoverUpload() {
|
||||
var cfg = window.aksrtAuthorPage || {};
|
||||
var cfg = window.jioAuthorPage || {};
|
||||
var upload = cfg.coverUpload || null;
|
||||
if (!upload || !upload.enabled || !upload.restUrl) return;
|
||||
|
||||
var btn = document.getElementById(upload.buttonId || 'aksrt-upload-bg-btn');
|
||||
var input = document.getElementById(upload.inputId || 'aksrt-bg-file-input');
|
||||
if (!btn || !input || btn.dataset.aksrtCoverBound === '1') return;
|
||||
var btn = document.getElementById(upload.buttonId || 'jio-upload-bg-btn');
|
||||
var input = document.getElementById(upload.inputId || 'jio-bg-file-input');
|
||||
if (!btn || !input || btn.dataset.jioCoverBound === '1') return;
|
||||
|
||||
btn.dataset.aksrtCoverBound = '1';
|
||||
btn.dataset.jioCoverBound = '1';
|
||||
|
||||
var label = btn.querySelector('span');
|
||||
var idleText = upload.idleText || (label ? label.textContent : '');
|
||||
@@ -236,7 +236,7 @@
|
||||
}
|
||||
|
||||
function resetImage(previousUrl) {
|
||||
var image = document.getElementById(upload.imageId || 'aksrt-cover-img');
|
||||
var image = document.getElementById(upload.imageId || 'jio-cover-img');
|
||||
if (!image) return;
|
||||
if (previousUrl) {
|
||||
image.src = previousUrl;
|
||||
@@ -248,7 +248,7 @@
|
||||
}
|
||||
|
||||
function applyImage(nextUrl) {
|
||||
var image = document.getElementById(upload.imageId || 'aksrt-cover-img');
|
||||
var image = document.getElementById(upload.imageId || 'jio-cover-img');
|
||||
if (image && nextUrl) {
|
||||
image.src = nextUrl;
|
||||
}
|
||||
@@ -314,14 +314,14 @@
|
||||
}
|
||||
|
||||
function initAvatarUpload() {
|
||||
var upload = (window.aksrtUserCenter || {}).avatarUpload;
|
||||
var upload = (window.jioUserCenter || {}).avatarUpload;
|
||||
if (!upload || !upload.enabled || !upload.restUrl) return;
|
||||
|
||||
var button = document.getElementById(upload.buttonId || 'aksrt-upload-avatar-btn');
|
||||
var input = document.getElementById(upload.inputId || 'aksrt-avatar-file-input');
|
||||
var image = document.getElementById(upload.imageId || 'aksrt-user-avatar-image');
|
||||
if (!button || !input || button.dataset.aksrtAvatarBound === '1') return;
|
||||
button.dataset.aksrtAvatarBound = '1';
|
||||
var button = document.getElementById(upload.buttonId || 'jio-upload-avatar-btn');
|
||||
var input = document.getElementById(upload.inputId || 'jio-avatar-file-input');
|
||||
var image = document.getElementById(upload.imageId || 'jio-user-avatar-image');
|
||||
if (!button || !input || button.dataset.jioAvatarBound === '1') return;
|
||||
button.dataset.jioAvatarBound = '1';
|
||||
|
||||
var label = button.querySelector('span');
|
||||
var idleText = upload.idleText || (label ? label.textContent : '更换头像');
|
||||
@@ -373,18 +373,18 @@
|
||||
}
|
||||
|
||||
function initCoverMenus() {
|
||||
document.querySelectorAll('[data-aksrt-menu]').forEach(function (menu) {
|
||||
if (menu.dataset.aksrtMenuBound === '1') return;
|
||||
menu.dataset.aksrtMenuBound = '1';
|
||||
var trigger = menu.querySelector('.aksrt-cover-menu__trigger');
|
||||
var panel = menu.querySelector('.aksrt-cover-menu__panel');
|
||||
document.querySelectorAll('[data-jio-menu]').forEach(function (menu) {
|
||||
if (menu.dataset.jioMenuBound === '1') return;
|
||||
menu.dataset.jioMenuBound = '1';
|
||||
var trigger = menu.querySelector('.jio-cover-menu__trigger');
|
||||
var panel = menu.querySelector('.jio-cover-menu__panel');
|
||||
if (!trigger || !panel) return;
|
||||
function close() { panel.hidden = true; trigger.setAttribute('aria-expanded', 'false'); }
|
||||
function open() {
|
||||
document.querySelectorAll('[data-aksrt-menu]').forEach(function (otherMenu) {
|
||||
document.querySelectorAll('[data-jio-menu]').forEach(function (otherMenu) {
|
||||
if (otherMenu === menu) return;
|
||||
var otherPanel = otherMenu.querySelector('.aksrt-cover-menu__panel');
|
||||
var otherTrigger = otherMenu.querySelector('.aksrt-cover-menu__trigger');
|
||||
var otherPanel = otherMenu.querySelector('.jio-cover-menu__panel');
|
||||
var otherTrigger = otherMenu.querySelector('.jio-cover-menu__trigger');
|
||||
if (otherPanel) otherPanel.hidden = true;
|
||||
if (otherTrigger) otherTrigger.setAttribute('aria-expanded', 'false');
|
||||
});
|
||||
@@ -400,21 +400,21 @@
|
||||
}
|
||||
|
||||
function initProfileDetailsModal() {
|
||||
var modal = document.getElementById('aksrt-profile-details-modal');
|
||||
var modal = document.getElementById('jio-profile-details-modal');
|
||||
if (!modal) return;
|
||||
var dialog = modal.querySelector('.aksrt-profile-details-modal__dialog');
|
||||
var dialog = modal.querySelector('.jio-profile-details-modal__dialog');
|
||||
var returnFocus = null;
|
||||
function close() { modal.hidden = true; if (returnFocus) returnFocus.focus(); }
|
||||
document.querySelectorAll('[data-aksrt-profile-details]').forEach(function (button) {
|
||||
document.querySelectorAll('[data-jio-profile-details]').forEach(function (button) {
|
||||
button.addEventListener('click', function () { returnFocus = button; modal.hidden = false; if (dialog) dialog.focus(); });
|
||||
});
|
||||
modal.querySelectorAll('[data-aksrt-modal-close]').forEach(function (button) { button.addEventListener('click', close); });
|
||||
modal.querySelectorAll('[data-jio-modal-close]').forEach(function (button) { button.addEventListener('click', close); });
|
||||
document.addEventListener('keydown', function (event) { if (event.key === 'Escape' && !modal.hidden) close(); });
|
||||
}
|
||||
|
||||
function init() {
|
||||
if (document.documentElement.dataset.aksrtAuthorInitialized === '1') return;
|
||||
document.documentElement.dataset.aksrtAuthorInitialized = '1';
|
||||
if (document.documentElement.dataset.jioAuthorInitialized === '1') return;
|
||||
document.documentElement.dataset.jioAuthorInitialized = '1';
|
||||
initPublicDashboards();
|
||||
initCoverMenus();
|
||||
initProfileDetailsModal();
|
||||
@@ -422,5 +422,5 @@
|
||||
initAvatarUpload();
|
||||
}
|
||||
|
||||
jQuery(document).off('auto_fun.aksrt-author').on('auto_fun.aksrt-author', function () { init(document); });
|
||||
jQuery(document).off('auto_fun.jio-author').on('auto_fun.jio-author', function () { init(document); });
|
||||
})();
|
||||
Reference in new issue
Block a user