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
+41
-41
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* On-site wallet tipping content for the shared modal runtime.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
;(function (window, document) {
|
||||
'use strict';
|
||||
|
||||
var cfg = window.aksrtData || {};
|
||||
var cfg = window.jioData || {};
|
||||
var titleSequence = 0;
|
||||
var toastId = 'aksrt-reward-toast';
|
||||
var toastId = 'jio-reward-toast';
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value == null ? '' : value).replace(/[&<>"']/g, function (character) {
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
function rewardModal(target) {
|
||||
return target.closest('.aksrt-modal-runtime.aksrt-reward-modal');
|
||||
return target.closest('.jio-modal-runtime.jio-reward-modal');
|
||||
}
|
||||
|
||||
function rewardTemplate(modal) {
|
||||
@@ -37,22 +37,22 @@
|
||||
}
|
||||
|
||||
function operationKey(template) {
|
||||
if (!template.dataset.aksrtOperationKey) {
|
||||
template.dataset.aksrtOperationKey = window.AksrtRequest.createIdempotencyKey();
|
||||
if (!template.dataset.jioOperationKey) {
|
||||
template.dataset.jioOperationKey = window.JioRequest.createIdempotencyKey();
|
||||
}
|
||||
return template.dataset.aksrtOperationKey;
|
||||
return template.dataset.jioOperationKey;
|
||||
}
|
||||
|
||||
function runCaptcha(modal) {
|
||||
var mount = modal.querySelector('[data-aksrt-captcha-config][data-scene="tip_user"]');
|
||||
var mount = modal.querySelector('[data-jio-captcha-config][data-scene="tip_user"]');
|
||||
if (!mount) return Promise.resolve({});
|
||||
if (!window.AKSRTCaptcha || typeof window.AKSRTCaptcha.run !== 'function') {
|
||||
if (!window.JioCaptcha || typeof window.JioCaptcha.run !== 'function') {
|
||||
return Promise.reject(new Error('人机验证正在加载,请稍后重试'));
|
||||
}
|
||||
|
||||
return window.AKSRTCaptcha.run('tip_user', modal).then(function (payload) {
|
||||
return window.JioCaptcha.run('tip_user', modal).then(function (payload) {
|
||||
if (!payload) return null;
|
||||
if (!payload.aksrt_captcha_proof) throw new Error('人机验证凭证未就绪,请重试');
|
||||
if (!payload.jio_captcha_proof) throw new Error('人机验证凭证未就绪,请重试');
|
||||
return payload;
|
||||
});
|
||||
}
|
||||
@@ -60,18 +60,18 @@
|
||||
function setSubmitting(modal, submit, submitting, succeeded) {
|
||||
submit.disabled = submitting || succeeded;
|
||||
submit.textContent = submitting ? '验证中…' : '余额赞赏';
|
||||
modal.querySelectorAll('[data-reward-amount], [data-aksrt-reward-custom]').forEach(function (control) {
|
||||
modal.querySelectorAll('[data-reward-amount], [data-jio-reward-custom]').forEach(function (control) {
|
||||
control.disabled = submitting || succeeded;
|
||||
});
|
||||
}
|
||||
|
||||
function openReward(trigger) {
|
||||
var runtime = window.AksrtModalRuntime;
|
||||
if (!runtime || !window.AksrtRequest) {
|
||||
if (trigger.dataset.aksrtRewardWaiting !== '1') {
|
||||
trigger.dataset.aksrtRewardWaiting = '1';
|
||||
document.addEventListener('aksrt:modal-runtime:ready', function () {
|
||||
delete trigger.dataset.aksrtRewardWaiting;
|
||||
var runtime = window.JioModalRuntime;
|
||||
if (!runtime || !window.JioRequest) {
|
||||
if (trigger.dataset.jioRewardWaiting !== '1') {
|
||||
trigger.dataset.jioRewardWaiting = '1';
|
||||
document.addEventListener('jio:modal-runtime:ready', function () {
|
||||
delete trigger.dataset.jioRewardWaiting;
|
||||
if (document.contains(trigger)) openReward(trigger);
|
||||
}, { once: true });
|
||||
}
|
||||
@@ -84,25 +84,25 @@
|
||||
|
||||
var shell = runtime.open({
|
||||
html: template.innerHTML,
|
||||
className: 'aksrt-reward-modal modal-mini full-sm',
|
||||
className: 'jio-reward-modal modal-mini full-sm',
|
||||
mobileBottom: true,
|
||||
kind: 'generic',
|
||||
});
|
||||
shell.dataset.templateId = template.id;
|
||||
shell.dataset.userId = trigger.getAttribute('data-user-id') || template.dataset.userId || '';
|
||||
shell.dataset.postId = trigger.getAttribute('data-post-id') || template.dataset.postId || '0';
|
||||
var title = shell.querySelector('.aksrt-reward__title');
|
||||
var title = shell.querySelector('.jio-reward__title');
|
||||
if (title) {
|
||||
title.id = 'aksrt-reward-title-' + (++titleSequence);
|
||||
title.id = 'jio-reward-title-' + (++titleSequence);
|
||||
shell.setAttribute('aria-labelledby', title.id);
|
||||
}
|
||||
|
||||
var initialFocus = shell.querySelector('[data-reward-amount].is-active, [data-aksrt-reward-custom]');
|
||||
var initialFocus = shell.querySelector('[data-reward-amount].is-active, [data-jio-reward-custom]');
|
||||
if (initialFocus) initialFocus.focus();
|
||||
}
|
||||
|
||||
document.addEventListener('click', function (event) {
|
||||
var opener = event.target.closest('[data-aksrt-reward-open]');
|
||||
var opener = event.target.closest('[data-jio-reward-open]');
|
||||
if (opener) {
|
||||
event.preventDefault();
|
||||
openReward(opener);
|
||||
@@ -114,27 +114,27 @@
|
||||
var amountModal = rewardModal(amountButton);
|
||||
if (!amountModal) return;
|
||||
var amountTemplate = rewardTemplate(amountModal);
|
||||
if (amountTemplate) delete amountTemplate.dataset.aksrtOperationKey;
|
||||
if (amountTemplate) delete amountTemplate.dataset.jioOperationKey;
|
||||
amountModal.querySelectorAll('[data-reward-amount]').forEach(function (button) {
|
||||
var isActive = button === amountButton;
|
||||
button.classList.toggle('is-active', isActive);
|
||||
button.setAttribute('aria-pressed', isActive ? 'true' : 'false');
|
||||
});
|
||||
var customInput = amountModal.querySelector('[data-aksrt-reward-custom]');
|
||||
var customInput = amountModal.querySelector('[data-jio-reward-custom]');
|
||||
if (customInput) customInput.value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
var submit = event.target.closest('[data-aksrt-reward-submit]');
|
||||
var submit = event.target.closest('[data-jio-reward-submit]');
|
||||
if (!submit || submit.disabled) return;
|
||||
|
||||
var modal = rewardModal(submit);
|
||||
var template = rewardTemplate(modal);
|
||||
var runtime = window.AksrtModalRuntime;
|
||||
var runtime = window.JioModalRuntime;
|
||||
if (!modal || !template || !runtime) return;
|
||||
|
||||
var message = modal.querySelector('[data-aksrt-reward-message]');
|
||||
var custom = modal.querySelector('[data-aksrt-reward-custom]');
|
||||
var message = modal.querySelector('[data-jio-reward-message]');
|
||||
var custom = modal.querySelector('[data-jio-reward-custom]');
|
||||
var selected = modal.querySelector('[data-reward-amount].is-active');
|
||||
var amount = custom && custom.value ? custom.value : (selected ? selected.dataset.rewardAmount : '');
|
||||
if (!amount) {
|
||||
@@ -159,7 +159,7 @@
|
||||
if (message) message.textContent = '正在进行人机验证…';
|
||||
|
||||
var body = new URLSearchParams();
|
||||
body.set('action', 'aksrt_submit_tip');
|
||||
body.set('action', 'jio_submit_tip');
|
||||
body.set('nonce', cfg.nonce || '');
|
||||
body.set('recipient_id', modal.dataset.userId || '');
|
||||
body.set('post_id', modal.dataset.postId || '0');
|
||||
@@ -168,14 +168,14 @@
|
||||
|
||||
runCaptcha(modal).then(function (captchaPayload) {
|
||||
if (!captchaPayload) {
|
||||
if (window.AKSRTCaptcha && typeof window.AKSRTCaptcha.reset === 'function') {
|
||||
window.AKSRTCaptcha.reset('tip_user', modal);
|
||||
if (window.JioCaptcha && typeof window.JioCaptcha.reset === 'function') {
|
||||
window.JioCaptcha.reset('tip_user', modal);
|
||||
}
|
||||
return { cancelled: true };
|
||||
}
|
||||
if (runtime.getActive() !== modal) {
|
||||
if (window.AKSRTCaptcha && typeof window.AKSRTCaptcha.reset === 'function') {
|
||||
window.AKSRTCaptcha.reset('tip_user', modal);
|
||||
if (window.JioCaptcha && typeof window.JioCaptcha.reset === 'function') {
|
||||
window.JioCaptcha.reset('tip_user', modal);
|
||||
}
|
||||
return { cancelled: true };
|
||||
}
|
||||
@@ -207,7 +207,7 @@
|
||||
var text = response && response.data && response.data.message ? response.data.message : '赞赏失败';
|
||||
if (response && response.success) {
|
||||
succeeded = true;
|
||||
delete template.dataset.aksrtOperationKey;
|
||||
delete template.dataset.jioOperationKey;
|
||||
if (message) message.textContent = text;
|
||||
notify(text, 'success', 5);
|
||||
window.setTimeout(function () {
|
||||
@@ -216,8 +216,8 @@
|
||||
} else {
|
||||
if (message) message.textContent = text;
|
||||
notify(text, 'danger', 5);
|
||||
if (window.AKSRTCaptcha && typeof window.AKSRTCaptcha.reset === 'function') {
|
||||
window.AKSRTCaptcha.reset('tip_user', modal);
|
||||
if (window.JioCaptcha && typeof window.JioCaptcha.reset === 'function') {
|
||||
window.JioCaptcha.reset('tip_user', modal);
|
||||
}
|
||||
}
|
||||
}).catch(function (error) {
|
||||
@@ -225,8 +225,8 @@
|
||||
var errorMessage = error && error.message ? error.message : '网络错误,请稍后重试';
|
||||
if (message) message.textContent = errorMessage;
|
||||
notify(errorMessage, 'danger', 5);
|
||||
if (window.AKSRTCaptcha && typeof window.AKSRTCaptcha.reset === 'function') {
|
||||
window.AKSRTCaptcha.reset('tip_user', modal);
|
||||
if (window.JioCaptcha && typeof window.JioCaptcha.reset === 'function') {
|
||||
window.JioCaptcha.reset('tip_user', modal);
|
||||
}
|
||||
}).finally(function () {
|
||||
setSubmitting(modal, submit, false, succeeded);
|
||||
@@ -234,10 +234,10 @@
|
||||
});
|
||||
|
||||
document.addEventListener('input', function (event) {
|
||||
if (!event.target.matches('[data-aksrt-reward-custom]')) return;
|
||||
if (!event.target.matches('[data-jio-reward-custom]')) return;
|
||||
var modal = rewardModal(event.target);
|
||||
var template = rewardTemplate(modal);
|
||||
if (template) delete template.dataset.aksrtOperationKey;
|
||||
if (template) delete template.dataset.jioOperationKey;
|
||||
if (!modal) return;
|
||||
|
||||
var hasCustomAmount = event.target.value !== '';
|
||||
|
||||
Reference in new issue
Block a user