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
@@ -1,16 +1,16 @@
|
||||
/**
|
||||
* AKSRT universal icon picker — shared admin modal for FA5, the built-in
|
||||
* Jio universal icon picker — shared admin modal for FA5, the built-in
|
||||
* SVG sprite and inline custom SVG values ("fa fas fa-star" / "zibsvg-key" /
|
||||
* "customsvg-<svg>").
|
||||
*
|
||||
* Any admin screen: call aksrt_icon_picker_assets() (PHP) and render fields
|
||||
* via aksrt_icon_picker_field(); interaction is fully delegated, so lazy
|
||||
* Any admin screen: call jio_icon_picker_assets() (PHP) and render fields
|
||||
* via jio_icon_picker_field(); interaction is fully delegated, so lazy
|
||||
* loaded widget forms and repeater rows work without re-init.
|
||||
*/
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
const config = window.aksrtIconPicker || {};
|
||||
const config = window.jioIconPicker || {};
|
||||
const i18n = config.i18n || {};
|
||||
|
||||
const state = {
|
||||
@@ -24,11 +24,11 @@
|
||||
};
|
||||
|
||||
function modal() {
|
||||
return $('#aksrt-modal-icon');
|
||||
return $('#jio-modal-icon');
|
||||
}
|
||||
|
||||
function setBusy(busy) {
|
||||
modal().find('.aksrt-icon-modal__loading').each((_i, el) => { el.hidden = !busy; });
|
||||
modal().find('.jio-icon-modal__loading').each((_i, el) => { el.hidden = !busy; });
|
||||
}
|
||||
|
||||
/* Custom SVG cleanup — strip authoring leftovers, keep pure vector markup. */
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
function seedSessionCustom() {
|
||||
$('input.aksrt-icon-picker__value').each(function () {
|
||||
$('input.jio-icon-picker__value').each(function () {
|
||||
const value = String(this.value || '').trim();
|
||||
if (value.indexOf('customsvg-') !== 0) return;
|
||||
const svg = value.slice(10);
|
||||
@@ -82,7 +82,7 @@
|
||||
}
|
||||
|
||||
function itemButton(value, name, innerHtml) {
|
||||
return $('<button type="button" class="aksrt-icon-picker__item" role="option">')
|
||||
return $('<button type="button" class="jio-icon-picker__item" role="option">')
|
||||
.attr({ 'data-value': value, 'data-name': name, title: name })
|
||||
.html(innerHtml);
|
||||
}
|
||||
@@ -90,11 +90,11 @@
|
||||
function buildGrids(groups) {
|
||||
state.tabs = [];
|
||||
state.grids = {};
|
||||
const $wrap = modal().find('.aksrt-icon-modal__grids').empty();
|
||||
const $wrap = modal().find('.jio-icon-modal__grids').empty();
|
||||
|
||||
groups.forEach((group) => {
|
||||
state.tabs.push(group);
|
||||
const $grid = $('<div class="aksrt-icon-modal__grid" data-grid="' + escapeText(group.id) + '" hidden></div>');
|
||||
const $grid = $('<div class="jio-icon-modal__grid" data-grid="' + escapeText(group.id) + '" hidden></div>');
|
||||
(group.icons || []).forEach((name) => {
|
||||
if (group.type === 'fa') {
|
||||
const value = `fa ${group.id} fa-${name}`;
|
||||
@@ -109,13 +109,13 @@
|
||||
$wrap.append($grid);
|
||||
state.grids[group.id] = $grid;
|
||||
|
||||
const $tab = $('<button type="button" class="button aksrt-icon-modal__tab" role="tab">').attr('data-tab', group.id).text(group.title || group.id);
|
||||
modal().find('.aksrt-icon-modal__tabs').append($tab);
|
||||
const $tab = $('<button type="button" class="button jio-icon-modal__tab" role="tab">').attr('data-tab', group.id).text(group.title || group.id);
|
||||
modal().find('.jio-icon-modal__tabs').append($tab);
|
||||
});
|
||||
}
|
||||
|
||||
function buildSessionGrid() {
|
||||
const $session = modal().find('.aksrt-icon-modal__grid--session');
|
||||
const $session = modal().find('.jio-icon-modal__grid--session');
|
||||
$session.empty();
|
||||
state.sessionCustom.forEach((svg) => {
|
||||
$session.append(itemButton('customsvg-' + svg, 'customsvg', cleanSvg(svg)));
|
||||
@@ -124,42 +124,42 @@
|
||||
|
||||
function showTab(tabId) {
|
||||
state.activeTab = tabId;
|
||||
modal().find('.aksrt-icon-modal__tab').each(function () {
|
||||
modal().find('.jio-icon-modal__tab').each(function () {
|
||||
this.classList.toggle('is-active', this.dataset.tab === tabId);
|
||||
});
|
||||
$.each(state.grids, (id, $grid) => { $grid[0].hidden = id !== tabId; });
|
||||
const isCustom = tabId === 'custom';
|
||||
modal().find('.aksrt-icon-modal__custom').each((_i, el) => { el.hidden = !isCustom; });
|
||||
modal().find('.aksrt-icon-modal__search').each((_i, el) => { el.hidden = isCustom; });
|
||||
modal().find('.jio-icon-modal__custom').each((_i, el) => { el.hidden = !isCustom; });
|
||||
modal().find('.jio-icon-modal__search').each((_i, el) => { el.hidden = isCustom; });
|
||||
applySearch();
|
||||
}
|
||||
|
||||
function applySearch() {
|
||||
if (state.activeTab === 'custom') return;
|
||||
const needle = String(modal().find('.aksrt-icon-modal__search').val() || '').trim().toLowerCase();
|
||||
const needle = String(modal().find('.jio-icon-modal__search').val() || '').trim().toLowerCase();
|
||||
const $grid = state.grids[state.activeTab];
|
||||
if (!$grid) return;
|
||||
let visible = 0;
|
||||
$grid.find('.aksrt-icon-picker__item').each(function () {
|
||||
$grid.find('.jio-icon-picker__item').each(function () {
|
||||
const show = !needle || String(this.dataset.name || '').toLowerCase().indexOf(needle) !== -1;
|
||||
this.hidden = !show;
|
||||
if (show) visible++;
|
||||
});
|
||||
$grid.find('.aksrt-icon-picker__empty').remove();
|
||||
if (!visible) $grid.append('<div class="aksrt-icon-picker__empty">' + escapeText(i18n.empty || 'No icons found.') + '</div>');
|
||||
$grid.find('.jio-icon-picker__empty').remove();
|
||||
if (!visible) $grid.append('<div class="jio-icon-picker__empty">' + escapeText(i18n.empty || 'No icons found.') + '</div>');
|
||||
}
|
||||
|
||||
function refreshPicker($picker, value) {
|
||||
const $preview = $picker.find('.aksrt-icon-picker__preview').first();
|
||||
const $preview = $picker.find('.jio-icon-picker__preview').first();
|
||||
$preview.html(previewMarkup(value)).toggleClass('hidden', !value);
|
||||
$picker.find('.aksrt-icon-picker__remove').first().toggleClass('hidden', !value);
|
||||
$picker.find('.jio-icon-picker__remove').first().toggleClass('hidden', !value);
|
||||
}
|
||||
|
||||
function select(value) {
|
||||
modal().addClass('hidden');
|
||||
const $picker = state.$target;
|
||||
if (!$picker || !$picker.length) return;
|
||||
$picker.find('input.aksrt-icon-picker__value').val(value).trigger('change');
|
||||
$picker.find('input.jio-icon-picker__value').val(value).trigger('change');
|
||||
refreshPicker($picker, value);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
.catch(() => {
|
||||
state.loading = false;
|
||||
setBusy(false);
|
||||
modal().find('.aksrt-icon-modal__error').each((_i, el) => {
|
||||
modal().find('.jio-icon-modal__error').each((_i, el) => {
|
||||
el.hidden = false;
|
||||
el.textContent = i18n.loadError || 'Failed to load icons.';
|
||||
});
|
||||
@@ -195,34 +195,34 @@
|
||||
buildSessionGrid();
|
||||
ensureCatalog();
|
||||
if (state.loaded) showTab(state.activeTab);
|
||||
modal().find('.aksrt-icon-modal__search').trigger('focus');
|
||||
modal().find('.jio-icon-modal__search').trigger('focus');
|
||||
}
|
||||
|
||||
$(document)
|
||||
.on('click', '.aksrt-icon-picker__choose', function () {
|
||||
open($(this).closest('[data-aksrt-icon-picker]'));
|
||||
.on('click', '.jio-icon-picker__choose', function () {
|
||||
open($(this).closest('[data-jio-icon-picker]'));
|
||||
})
|
||||
.on('click', '.aksrt-icon-picker__remove', function () {
|
||||
const $picker = $(this).closest('[data-aksrt-icon-picker]');
|
||||
$picker.find('input.aksrt-icon-picker__value').val('').trigger('change');
|
||||
.on('click', '.jio-icon-picker__remove', function () {
|
||||
const $picker = $(this).closest('[data-jio-icon-picker]');
|
||||
$picker.find('input.jio-icon-picker__value').val('').trigger('change');
|
||||
refreshPicker($picker, '');
|
||||
})
|
||||
.on('change', 'input.aksrt-icon-picker__value', function () {
|
||||
refreshPicker($(this).closest('[data-aksrt-icon-picker]'), String(this.value || '').trim());
|
||||
.on('change', 'input.jio-icon-picker__value', function () {
|
||||
refreshPicker($(this).closest('[data-jio-icon-picker]'), String(this.value || '').trim());
|
||||
})
|
||||
.on('click', '[data-aksrt-icon-close]', () => modal().addClass('hidden'))
|
||||
.on('click', '[data-jio-icon-close]', () => modal().addClass('hidden'))
|
||||
.on('keydown', (e) => { if (e.key === 'Escape') modal().addClass('hidden'); })
|
||||
.on('click', '.aksrt-icon-modal__tab', function () { showTab(this.dataset.tab); })
|
||||
.on('input', '.aksrt-icon-modal__search', applySearch)
|
||||
.on('click', '.aksrt-icon-picker__item', function () {
|
||||
.on('click', '.jio-icon-modal__tab', function () { showTab(this.dataset.tab); })
|
||||
.on('input', '.jio-icon-modal__search', applySearch)
|
||||
.on('click', '.jio-icon-picker__item', function () {
|
||||
const value = String(this.dataset.value || '');
|
||||
if (value) select(value);
|
||||
})
|
||||
.on('input', '.aksrt-icon-modal__custom textarea', function () {
|
||||
modal().find('.aksrt-icon-modal__custom-preview').html(cleanSvg(this.value));
|
||||
.on('input', '.jio-icon-modal__custom textarea', function () {
|
||||
modal().find('.jio-icon-modal__custom-preview').html(cleanSvg(this.value));
|
||||
})
|
||||
.on('click', '.aksrt-icon-modal__custom-actions .button', function () {
|
||||
const $custom = modal().find('.aksrt-icon-modal__custom');
|
||||
.on('click', '.jio-icon-modal__custom-actions .button', function () {
|
||||
const $custom = modal().find('.jio-icon-modal__custom');
|
||||
const svg = cleanSvg($custom.find('textarea').val());
|
||||
if (!svg) {
|
||||
window.alert(i18n.customEmpty || 'Invalid SVG.');
|
||||
@@ -234,6 +234,6 @@
|
||||
}
|
||||
select('customsvg-' + svg);
|
||||
$custom.find('textarea').val('');
|
||||
$custom.find('.aksrt-icon-modal__custom-preview').html('');
|
||||
$custom.find('.jio-icon-modal__custom-preview').html('');
|
||||
});
|
||||
})(jQuery);
|
||||
Reference in new issue
Block a user