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
+31
-31
@@ -1,16 +1,16 @@
|
||||
/**
|
||||
* AKSRT Captcha front-end runtime — cloud providers only.
|
||||
* Jio Captcha front-end runtime — cloud providers only.
|
||||
*
|
||||
* Mounts are registered internally by uid and resolved by scene plus DOM scope.
|
||||
* The only public surface is window.AKSRTCaptcha.
|
||||
* The only public surface is window.JioCaptcha.
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var TOKEN_FIELDS = Object.freeze([
|
||||
'captcha_verified',
|
||||
'aksrt_captcha_challenge',
|
||||
'aksrt_captcha_proof',
|
||||
'jio_captcha_challenge',
|
||||
'jio_captcha_proof',
|
||||
'cf_turnstile_response',
|
||||
'tencent_ticket', 'tencent_randstr',
|
||||
'geetest_lot_number', 'geetest_captcha_output', 'geetest_pass_token', 'geetest_gen_time',
|
||||
@@ -35,7 +35,7 @@
|
||||
if (configured) return configured;
|
||||
} catch (_) {}
|
||||
}
|
||||
return box.closest('[data-aksrt-captcha-scope], form, [data-aksrt-download-box], [data-aksrt-auth], .aksrt-modal, [data-signin-captcha], #comments') || box.parentElement;
|
||||
return box.closest('[data-jio-captcha-scope], form, [data-jio-download-box], [data-jio-auth], .jio-modal, [data-signin-captcha], #comments') || box.parentElement;
|
||||
}
|
||||
|
||||
function register(instance) {
|
||||
@@ -52,7 +52,7 @@
|
||||
var candidates = scenes[scene] || [];
|
||||
var element = asElement(scope);
|
||||
if (element && element.getAttribute) {
|
||||
var uid = element.getAttribute('data-aksrt-captcha-uid') || element.getAttribute('data-captcha-uid');
|
||||
var uid = element.getAttribute('data-jio-captcha-uid') || element.getAttribute('data-captcha-uid');
|
||||
if (uid && instances[uid] && instances[uid].scene === scene) return instances[uid];
|
||||
}
|
||||
if (!element) return scope ? null : (candidates.length === 1 ? candidates[0] : null);
|
||||
@@ -113,7 +113,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
window.AKSRTCaptcha = Object.freeze({
|
||||
window.JioCaptcha = Object.freeze({
|
||||
verify: verify,
|
||||
collect: collect,
|
||||
reset: reset,
|
||||
@@ -122,17 +122,17 @@
|
||||
});
|
||||
|
||||
function scan() {
|
||||
var mounts = document.querySelectorAll('[data-aksrt-captcha-config]');
|
||||
var mounts = document.querySelectorAll('[data-jio-captcha-config]');
|
||||
Array.prototype.forEach.call(mounts, function (mount) {
|
||||
if (mount.dataset.aksrtCaptchaBound) return;
|
||||
if (mount.dataset.jioCaptchaBound) return;
|
||||
var config;
|
||||
try {
|
||||
config = JSON.parse(mount.getAttribute('data-aksrt-captcha-config'));
|
||||
config = JSON.parse(mount.getAttribute('data-jio-captcha-config'));
|
||||
} catch (_) {
|
||||
return;
|
||||
}
|
||||
if (!config || !config.scene || !config.uid || !config.vid) return;
|
||||
mount.dataset.aksrtCaptchaBound = '1';
|
||||
mount.dataset.jioCaptchaBound = '1';
|
||||
initMount(config, mount);
|
||||
});
|
||||
}
|
||||
@@ -143,7 +143,7 @@
|
||||
if (!box || !hField) return;
|
||||
|
||||
var container = box.closest('form') || mount;
|
||||
mount.setAttribute('data-aksrt-captcha-uid', C.uid);
|
||||
mount.setAttribute('data-jio-captcha-uid', C.uid);
|
||||
var verified = false;
|
||||
var pending = [];
|
||||
var refreshingChallenge = null;
|
||||
@@ -157,7 +157,7 @@
|
||||
if (typeof readyCheck === 'function' && readyCheck()) return Promise.resolve();
|
||||
if (loaders[key]) return loaders[key];
|
||||
loaders[key] = new Promise(function (resolveLoad, rejectLoad) {
|
||||
var existing = document.querySelector('script[data-aksrt-sdk="' + key + '"]');
|
||||
var existing = document.querySelector('script[data-jio-sdk="' + key + '"]');
|
||||
if (existing) {
|
||||
if (typeof readyCheck === 'function' && readyCheck()) { resolveLoad(); return; }
|
||||
existing.addEventListener('load', resolveLoad, { once: true });
|
||||
@@ -167,7 +167,7 @@
|
||||
var script = document.createElement('script');
|
||||
script.src = src;
|
||||
script.async = true;
|
||||
script.setAttribute('data-aksrt-sdk', key);
|
||||
script.setAttribute('data-jio-sdk', key);
|
||||
script.onload = resolveLoad;
|
||||
script.onerror = function () { rejectLoad(new Error(key + ' load failed')); };
|
||||
document.head.appendChild(script);
|
||||
@@ -208,7 +208,7 @@
|
||||
if (!response.ok || !body || body.success === false) throw new Error(body.message || 'challenge refresh failed');
|
||||
var data = body.data || body;
|
||||
if (!data.challenge) throw new Error('challenge missing');
|
||||
setField('aksrt_captcha_challenge', data.challenge);
|
||||
setField('jio_captcha_challenge', data.challenge);
|
||||
});
|
||||
}).catch(function () {
|
||||
showTip('无法刷新人机验证会话,请刷新页面重试', '#e74c3c');
|
||||
@@ -220,7 +220,7 @@
|
||||
|
||||
function clearProviderTokens() {
|
||||
TOKEN_FIELDS.forEach(function (name) {
|
||||
if (name === 'captcha_verified' || name === 'aksrt_captcha_challenge' || name === 'aksrt_captcha_proof') return;
|
||||
if (name === 'captcha_verified' || name === 'jio_captcha_challenge' || name === 'jio_captcha_proof') return;
|
||||
Array.prototype.forEach.call(container.querySelectorAll('input[name="' + name + '"]'), function (field) {
|
||||
field.remove();
|
||||
});
|
||||
@@ -231,7 +231,7 @@
|
||||
verified = false;
|
||||
releaseRunLock(instance);
|
||||
hField.value = '0';
|
||||
setField('aksrt_captcha_proof', '');
|
||||
setField('jio_captcha_proof', '');
|
||||
clearProviderTokens();
|
||||
try { providerReset(); } catch (_) {}
|
||||
refreshChallenge();
|
||||
@@ -269,7 +269,7 @@
|
||||
if (!response.ok || !body || body.success === false) throw new Error(body.message || '人机验证失败');
|
||||
var data = body.data || body;
|
||||
if (!data.proof) throw new Error('人机验证凭证缺失');
|
||||
setField('aksrt_captcha_proof', data.proof);
|
||||
setField('jio_captcha_proof', data.proof);
|
||||
clearProviderTokens();
|
||||
completeVerification();
|
||||
});
|
||||
@@ -322,10 +322,10 @@
|
||||
collect: collectFields,
|
||||
reset: resetVerificationState,
|
||||
verify: function () {
|
||||
var challengeField = container.querySelector('input[name="aksrt_captcha_challenge"]');
|
||||
var challengeField = container.querySelector('input[name="jio_captcha_challenge"]');
|
||||
var preparation = challengeField && challengeField.value ? Promise.resolve() : refreshChallenge();
|
||||
return preparation.then(function () {
|
||||
challengeField = container.querySelector('input[name="aksrt_captcha_challenge"]');
|
||||
challengeField = container.querySelector('input[name="jio_captcha_challenge"]');
|
||||
if (!challengeField || !challengeField.value) {
|
||||
showTip('人机验证会话未就绪,请稍后重试', '#e74c3c');
|
||||
return false;
|
||||
@@ -394,7 +394,7 @@
|
||||
sitekey: C.cf.site_key,
|
||||
theme: C.cf.theme,
|
||||
size: C.cf.size,
|
||||
action: 'aksrt-verify',
|
||||
action: 'jio-verify',
|
||||
cdata: C.scene,
|
||||
callback: function (token) {
|
||||
if (!verifying) return;
|
||||
@@ -418,21 +418,21 @@
|
||||
|
||||
function createModal() {
|
||||
modal = document.createElement('div');
|
||||
modal.className = 'aksrt-captcha-modal-overlay';
|
||||
modal.innerHTML = '<div class="aksrt-captcha-modal-backdrop"></div>' +
|
||||
'<div class="aksrt-captcha-modal-box"><div class="aksrt-captcha-modal-header">' +
|
||||
'<span class="aksrt-captcha-modal-title">人机验证</span>' +
|
||||
'<button type="button" class="aksrt-captcha-modal-close">×</button></div>' +
|
||||
'<div class="aksrt-captcha-modal-body"><p class="aksrt-captcha-modal-hint">请完成验证后继续操作</p>' +
|
||||
'<div id="modalWidget_' + C.uid + '" class="aksrt-captcha-modal-widget"></div></div></div></div>';
|
||||
modal.className = 'jio-captcha-modal-overlay';
|
||||
modal.innerHTML = '<div class="jio-captcha-modal-backdrop"></div>' +
|
||||
'<div class="jio-captcha-modal-box"><div class="jio-captcha-modal-header">' +
|
||||
'<span class="jio-captcha-modal-title">人机验证</span>' +
|
||||
'<button type="button" class="jio-captcha-modal-close">×</button></div>' +
|
||||
'<div class="jio-captcha-modal-body"><p class="jio-captcha-modal-hint">请完成验证后继续操作</p>' +
|
||||
'<div id="modalWidget_' + C.uid + '" class="jio-captcha-modal-widget"></div></div></div></div>';
|
||||
document.body.appendChild(modal);
|
||||
var cancel = function () {
|
||||
verifying = false;
|
||||
closeModal();
|
||||
cancelPending('已取消验证');
|
||||
};
|
||||
modal.querySelector('.aksrt-captcha-modal-backdrop').addEventListener('click', cancel);
|
||||
modal.querySelector('.aksrt-captcha-modal-close').addEventListener('click', cancel);
|
||||
modal.querySelector('.jio-captcha-modal-backdrop').addEventListener('click', cancel);
|
||||
modal.querySelector('.jio-captcha-modal-close').addEventListener('click', cancel);
|
||||
renderWidget();
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', scan);
|
||||
else setTimeout(scan, 0);
|
||||
|
||||
// AJAX 注入新内容后由 auto_fun 重扫(dataset.aksrtCaptchaBound 标记保证幂等)。
|
||||
// AJAX 注入新内容后由 auto_fun 重扫(dataset.jioCaptchaBound 标记保证幂等)。
|
||||
if (window.jQuery) window.jQuery(document).on('auto_fun', scan);
|
||||
|
||||
if (window.MutationObserver) {
|
||||
|
||||
Reference in new issue
Block a user