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
+20
-20
@@ -1,11 +1,11 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var config = window.aksrtWidgets || {};
|
||||
var config = window.jioWidgets || {};
|
||||
var reducedMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
|
||||
function once(el, key) {
|
||||
var name = 'aksrt' + key;
|
||||
var name = 'jio' + key;
|
||||
if (el.dataset[name]) return false;
|
||||
el.dataset[name] = '1';
|
||||
return true;
|
||||
@@ -35,24 +35,24 @@
|
||||
}
|
||||
|
||||
function initVideo(el) {
|
||||
// 幂等标记落在 data-aksrt-widget-video;data-aksrt-video 是
|
||||
// AksrtVideoPlayer 的自动初始化契约,被扫到会在容器里再挂一个无源播放器。
|
||||
// 幂等标记落在 data-jio-widget-video;data-jio-video 是
|
||||
// JioVideoPlayer 的自动初始化契约,被扫到会在容器里再挂一个无源播放器。
|
||||
if (!once(el, 'WidgetVideo')) return;
|
||||
var fallback = el.querySelector('video');
|
||||
if (fallback) {
|
||||
fallback.addEventListener('error', function () {
|
||||
var message = el.querySelector('.aksrt-widget-media-error');
|
||||
var message = el.querySelector('.jio-widget-media-error');
|
||||
if (message) message.hidden = false;
|
||||
});
|
||||
}
|
||||
function mountPlayer(event) {
|
||||
if (typeof window.DPlayer !== 'function' || el.aksrtPlayer) return;
|
||||
if (typeof window.DPlayer !== 'function' || el.jioPlayer) return;
|
||||
if (event) event.preventDefault();
|
||||
var holder = document.createElement('div');
|
||||
holder.className = 'aksrt-widget-video__player';
|
||||
holder.className = 'jio-widget-video__player';
|
||||
el.insertBefore(holder, fallback || el.firstChild);
|
||||
try {
|
||||
el.aksrtPlayer = new window.DPlayer({
|
||||
el.jioPlayer = new window.DPlayer({
|
||||
container: holder,
|
||||
autoplay: el.dataset.autoplay === '1' && !reducedMotion,
|
||||
video: {
|
||||
@@ -61,7 +61,7 @@
|
||||
type: videoType(el.dataset.videoUrl || '')
|
||||
}
|
||||
});
|
||||
if (el.dataset.muted === '1' && el.aksrtPlayer.video) el.aksrtPlayer.video.muted = true;
|
||||
if (el.dataset.muted === '1' && el.jioPlayer.video) el.jioPlayer.video.muted = true;
|
||||
if (fallback) fallback.hidden = true;
|
||||
} catch (error) {
|
||||
holder.remove();
|
||||
@@ -76,12 +76,12 @@
|
||||
|
||||
function initQuote(figure) {
|
||||
if (!once(figure, 'Quote')) return;
|
||||
if (window.AksrtYiyan) window.AksrtYiyan.init(figure);
|
||||
if (window.JioYiyan) window.JioYiyan.init(figure);
|
||||
}
|
||||
|
||||
function errorMarkup(page, append) {
|
||||
var i18n = config.i18n || {};
|
||||
return '<div class="aksrt-widget-request-error" role="alert"><span>' + (i18n.error || '加载失败,请重试。') + '</span><button type="button" data-widget-retry data-retry-page="' + page + '" data-retry-append="' + (append ? '1' : '0') + '">' + (i18n.retry || '重试') + '</button></div>';
|
||||
return '<div class="jio-widget-request-error" role="alert"><span>' + (i18n.error || '加载失败,请重试。') + '</span><button type="button" data-widget-retry data-retry-page="' + page + '" data-retry-append="' + (append ? '1' : '0') + '">' + (i18n.retry || '重试') + '</button></div>';
|
||||
}
|
||||
|
||||
function itemsUrl(widget, instance, page, segment) {
|
||||
@@ -104,7 +104,7 @@
|
||||
}
|
||||
|
||||
function fallbackLoader() {
|
||||
var text = (window.aksrtData && aksrtData.ajaxLoading) || '加载中...';
|
||||
var text = (window.jioData && jioData.ajaxLoading) || '加载中...';
|
||||
var node = document.createElement('div');
|
||||
node.className = 'post_ajax_loader';
|
||||
node.setAttribute('role', 'status');
|
||||
@@ -148,7 +148,7 @@
|
||||
var instance = owner.dataset.instance || container.dataset.instance;
|
||||
var segment = container.dataset.segment || owner.dataset.segment || '';
|
||||
if (!widget || !instance || !config.restUrl || container.dataset.loading === '1') return;
|
||||
container.querySelectorAll(':scope > .aksrt-widget-request-error').forEach(function (error) { error.remove(); });
|
||||
container.querySelectorAll(':scope > .jio-widget-request-error').forEach(function (error) { error.remove(); });
|
||||
setBusy(container, true);
|
||||
var previous = [];
|
||||
if (!append) {
|
||||
@@ -286,7 +286,7 @@
|
||||
function initFaq(faq) {
|
||||
if (!once(faq, 'Faq')) return;
|
||||
faq.addEventListener('click', function (event) {
|
||||
var button = event.target.closest('.aksrt-faq__item > button');
|
||||
var button = event.target.closest('.jio-faq__item > button');
|
||||
if (!button) return;
|
||||
var expanded = button.getAttribute('aria-expanded') === 'true';
|
||||
button.setAttribute('aria-expanded', expanded ? 'false' : 'true');
|
||||
@@ -296,7 +296,7 @@
|
||||
var search = faq.querySelector('input[type="search"]');
|
||||
if (search) search.addEventListener('input', function () {
|
||||
var needle = search.value.trim().toLowerCase();
|
||||
faq.querySelectorAll('.aksrt-faq__item').forEach(function (item) { item.hidden = needle && String(item.dataset.search || '').toLowerCase().indexOf(needle) === -1; });
|
||||
faq.querySelectorAll('.jio-faq__item').forEach(function (item) { item.hidden = needle && String(item.dataset.search || '').toLowerCase().indexOf(needle) === -1; });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -356,16 +356,16 @@
|
||||
|
||||
function scan(root) {
|
||||
var scope = root || document;
|
||||
scope.querySelectorAll('.aksrt-widget-video[data-video-url]').forEach(initVideo);
|
||||
scope.querySelectorAll('.aksrt-widget-quote').forEach(initQuote);
|
||||
scope.querySelectorAll('.jio-widget-video[data-video-url]').forEach(initVideo);
|
||||
scope.querySelectorAll('.jio-widget-quote').forEach(initQuote);
|
||||
if (scope.matches && scope.matches('[data-widget-items]')) initItems(scope);
|
||||
scope.querySelectorAll('[data-widget-items]').forEach(initItems);
|
||||
scope.querySelectorAll('.widget-tab-post').forEach(initTabs);
|
||||
scope.querySelectorAll('.aksrt-faq').forEach(initFaq);
|
||||
scope.querySelectorAll('.aksrt-feature-intro').forEach(initFeatures);
|
||||
scope.querySelectorAll('.jio-faq').forEach(initFaq);
|
||||
scope.querySelectorAll('.jio-feature-intro').forEach(initFeatures);
|
||||
scope.querySelectorAll('[data-count-up]').forEach(initCount);
|
||||
scope.querySelectorAll('.widget-slider-graphic').forEach(measureSliderGraphic);
|
||||
if (typeof window.VanillaTilt !== 'undefined') scope.querySelectorAll('[data-aksrt-tilt]').forEach(function (el) { if (once(el, 'Tilt')) window.VanillaTilt.init(el); });
|
||||
if (typeof window.VanillaTilt !== 'undefined') scope.querySelectorAll('[data-jio-tilt]').forEach(function (el) { if (once(el, 'Tilt')) window.VanillaTilt.init(el); });
|
||||
}
|
||||
|
||||
function ready() {
|
||||
|
||||
Reference in new issue
Block a user