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
@@ -65,7 +65,7 @@ function runtime({ completed = false } = {}) {
|
||||
}
|
||||
map(selector, elements) { this.queries.set(selector, elements); return this; }
|
||||
closest(selector) {
|
||||
if (selector === '[data-aksrt-dialog-close]' && this.attrs['data-aksrt-dialog-close'] !== undefined) return this;
|
||||
if (selector === '[data-jio-dialog-close]' && this.attrs['data-jio-dialog-close'] !== undefined) return this;
|
||||
return null;
|
||||
}
|
||||
focus() { doc.activeElement = this; }
|
||||
@@ -76,11 +76,11 @@ function runtime({ completed = false } = {}) {
|
||||
|
||||
function fragment({ readOnly = false, initiallyChecked = false } = {}) {
|
||||
const part = new Element();
|
||||
const title = new Element({ id: 'aksrt-ban-dialog-title', autofocus: '' });
|
||||
const closeIcon = new Element({ 'data-aksrt-dialog-close': '' });
|
||||
const closeFooter = new Element({ 'data-aksrt-dialog-close': '' });
|
||||
part.map('#aksrt-ban-dialog-title', title)
|
||||
.map('[data-aksrt-dialog-close]', [closeIcon, closeFooter]);
|
||||
const title = new Element({ id: 'jio-ban-dialog-title', autofocus: '' });
|
||||
const closeIcon = new Element({ 'data-jio-dialog-close': '' });
|
||||
const closeFooter = new Element({ 'data-jio-dialog-close': '' });
|
||||
part.map('#jio-ban-dialog-title', title)
|
||||
.map('[data-jio-dialog-close]', [closeIcon, closeFooter]);
|
||||
const controls = [closeIcon, closeFooter];
|
||||
let form = null;
|
||||
let radios = [];
|
||||
@@ -92,31 +92,31 @@ function runtime({ completed = false } = {}) {
|
||||
new Element({ type: 'radio', value: 'reject', required: '', checked: initiallyChecked }),
|
||||
];
|
||||
note = new Element({ name: 'note', value: 'old note', 'data-required-error': 'Please enter a nonblank rejection reason' });
|
||||
const label = new Element({ 'data-aksrt-ban-note-label': '', 'data-optional': 'Optional note', 'data-required': 'Reject reason required' });
|
||||
submit = new Element({ 'data-aksrt-ban-submit': '', 'data-idle-label': 'Choose decision', 'data-approve-label': 'Confirm approval', 'data-reject-label': 'Confirm rejection', 'data-busy-label': 'Submitting' });
|
||||
const label = new Element({ 'data-jio-ban-note-label': '', 'data-optional': 'Optional note', 'data-required': 'Reject reason required' });
|
||||
submit = new Element({ 'data-jio-ban-submit': '', 'data-idle-label': 'Choose decision', 'data-approve-label': 'Confirm approval', 'data-reject-label': 'Confirm rejection', 'data-busy-label': 'Submitting' });
|
||||
controls.push(submit);
|
||||
form = new Element();
|
||||
form.dataset = {};
|
||||
form.elements = { radios, note };
|
||||
form.map('input[type="radio"]', radios)
|
||||
.map('textarea[name="note"]', note)
|
||||
.map('[data-aksrt-ban-note-label]', label)
|
||||
.map('[data-aksrt-ban-submit]', submit);
|
||||
.map('[data-jio-ban-note-label]', label)
|
||||
.map('[data-jio-ban-submit]', submit);
|
||||
form.reportValidity = () => {
|
||||
const hasRequiredRadio = radios.some((radio) => radio.required);
|
||||
const radioValid = !hasRequiredRadio || radios.some((radio) => radio.checked);
|
||||
return radioValid && !note.validity && (!note.required || note.value.trim() !== '');
|
||||
};
|
||||
part.map('form[data-aksrt-ban-review]', form);
|
||||
part.map('form[data-jio-ban-review]', form);
|
||||
}
|
||||
part.map('[data-aksrt-ban-submit], [data-aksrt-dialog-close]', controls);
|
||||
part.map('[data-jio-ban-submit], [data-jio-dialog-close]', controls);
|
||||
return { part, form, radios, note, submit, title, closeIcon, closeFooter };
|
||||
}
|
||||
|
||||
const root = new Element();
|
||||
const window = new Element();
|
||||
doc.documentElement = new Element();
|
||||
doc.querySelector = (selector) => selector === '.aksrt-ban-page' ? root : null;
|
||||
doc.querySelector = (selector) => selector === '.jio-ban-page' ? root : null;
|
||||
doc.getElementById = (id) => ids.get(id) || null;
|
||||
const dialog = new Element();
|
||||
const originalDialogQuery = dialog.querySelector.bind(dialog);
|
||||
@@ -125,7 +125,7 @@ function runtime({ completed = false } = {}) {
|
||||
dialog.querySelectorAll = (selector) => dialog.currentContent ? dialog.currentContent.querySelectorAll(selector) : originalDialogQueryAll(selector);
|
||||
dialog.showModal = () => {
|
||||
dialog.open = true;
|
||||
const title = dialog.querySelector('#aksrt-ban-dialog-title');
|
||||
const title = dialog.querySelector('#jio-ban-dialog-title');
|
||||
if (title) title.focus();
|
||||
};
|
||||
dialog.close = () => {
|
||||
@@ -133,20 +133,20 @@ function runtime({ completed = false } = {}) {
|
||||
dialog.open = false;
|
||||
dialog.fire('close');
|
||||
};
|
||||
ids.set('aksrt-ban-dialog', dialog);
|
||||
ids.set('jio-ban-dialog', dialog);
|
||||
|
||||
const opener = new Element({ 'data-aksrt-ban-view': 'report-1' });
|
||||
const readonlyOpener = new Element({ 'data-aksrt-ban-view': 'report-2' });
|
||||
const opener = new Element({ 'data-jio-ban-view': 'report-1' });
|
||||
const readonlyOpener = new Element({ 'data-jio-ban-view': 'report-2' });
|
||||
const templates = new Map();
|
||||
templates.set('aksrt-ban-detail-report-1', {
|
||||
templates.set('jio-ban-detail-report-1', {
|
||||
content: { cloneNode: () => fragment().part },
|
||||
});
|
||||
templates.set('aksrt-ban-detail-report-2', {
|
||||
templates.set('jio-ban-detail-report-2', {
|
||||
content: { cloneNode: () => fragment({ readOnly: true }).part },
|
||||
});
|
||||
ids.set('aksrt-ban-detail-report-1', templates.get('aksrt-ban-detail-report-1'));
|
||||
ids.set('aksrt-ban-detail-report-2', templates.get('aksrt-ban-detail-report-2'));
|
||||
root.map('[data-aksrt-ban-view]', [opener, readonlyOpener]);
|
||||
ids.set('jio-ban-detail-report-1', templates.get('jio-ban-detail-report-1'));
|
||||
ids.set('jio-ban-detail-report-2', templates.get('jio-ban-detail-report-2'));
|
||||
root.map('[data-jio-ban-view]', [opener, readonlyOpener]);
|
||||
|
||||
vm.runInNewContext(fs.readFileSync(path.join(rootDir, 'assets/js/admin-user-ban.js'), 'utf8'), { document: doc, window });
|
||||
return { doc, window, root, dialog, opener, readonlyOpener };
|
||||
@@ -155,15 +155,15 @@ function runtime({ completed = false } = {}) {
|
||||
function openReview(runtimeState, button = runtimeState.opener) {
|
||||
button.fire('click');
|
||||
const frame = runtimeState.dialog.currentContent;
|
||||
const form = frame.querySelector('form[data-aksrt-ban-review]');
|
||||
const form = frame.querySelector('form[data-jio-ban-review]');
|
||||
return {
|
||||
frame,
|
||||
form,
|
||||
radios: form.querySelectorAll('input[type="radio"]'),
|
||||
note: form.querySelector('textarea[name="note"]'),
|
||||
label: form.querySelector('[data-aksrt-ban-note-label]'),
|
||||
submit: form.querySelector('[data-aksrt-ban-submit]'),
|
||||
closeButtons: frame.querySelectorAll('[data-aksrt-ban-submit], [data-aksrt-dialog-close]').filter((button) => button.attrs['data-aksrt-dialog-close'] !== undefined),
|
||||
label: form.querySelector('[data-jio-ban-note-label]'),
|
||||
submit: form.querySelector('[data-jio-ban-submit]'),
|
||||
closeButtons: frame.querySelectorAll('[data-jio-ban-submit], [data-jio-dialog-close]').filter((button) => button.attrs['data-jio-dialog-close'] !== undefined),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -172,12 +172,12 @@ test('opening review clears choices, focuses the dialog, and locks page scrollin
|
||||
const review = openReview(r);
|
||||
|
||||
assert.equal(r.dialog.open, true);
|
||||
assert.equal(r.doc.activeElement, review.frame.querySelector('#aksrt-ban-dialog-title'));
|
||||
assert.equal(r.doc.activeElement, review.frame.querySelector('#jio-ban-dialog-title'));
|
||||
assert.deepEqual(review.radios.map((radio) => radio.checked), [false, false]);
|
||||
assert.equal(review.note.value, '');
|
||||
assert.equal(review.submit.disabled, true);
|
||||
assert.equal(review.label.textContent, 'Optional note');
|
||||
assert.equal(r.doc.documentElement.classList.contains('aksrt-ban-modal-open'), true);
|
||||
assert.equal(r.doc.documentElement.classList.contains('jio-ban-modal-open'), true);
|
||||
});
|
||||
|
||||
test('reject decisions require a nonblank trimmed note before submission', () => {
|
||||
@@ -225,12 +225,12 @@ test('submission blocks duplicate posts and closing until pageshow restores stat
|
||||
assert.equal(review.form.getAttribute('aria-busy'), null);
|
||||
assert.equal(review.submit.disabled, false);
|
||||
assert.ok(review.closeButtons.every((button) => !button.disabled));
|
||||
assert.equal(r.doc.documentElement.classList.contains('aksrt-ban-modal-open'), true);
|
||||
assert.equal(r.doc.documentElement.classList.contains('jio-ban-modal-open'), true);
|
||||
|
||||
r.dialog.fire('click', { target: review.closeButtons[0] });
|
||||
assert.equal(r.dialog.open, false);
|
||||
assert.equal(r.dialog.currentContent, null);
|
||||
assert.equal(r.doc.documentElement.classList.contains('aksrt-ban-modal-open'), false);
|
||||
assert.equal(r.doc.documentElement.classList.contains('jio-ban-modal-open'), false);
|
||||
assert.equal(r.doc.activeElement, r.opener);
|
||||
});
|
||||
|
||||
@@ -239,10 +239,10 @@ test('completed records open read-only without a form or submit controls', () =>
|
||||
r.readonlyOpener.fire('click');
|
||||
|
||||
assert.equal(r.dialog.open, true);
|
||||
assert.equal(r.dialog.querySelector('form[data-aksrt-ban-review]'), null);
|
||||
assert.equal(r.dialog.querySelector('[data-aksrt-ban-submit]'), null);
|
||||
assert.ok(r.dialog.querySelector('[data-aksrt-dialog-close]'));
|
||||
r.dialog.fire('click', { target: r.dialog.querySelector('[data-aksrt-dialog-close]') });
|
||||
assert.equal(r.dialog.querySelector('form[data-jio-ban-review]'), null);
|
||||
assert.equal(r.dialog.querySelector('[data-jio-ban-submit]'), null);
|
||||
assert.ok(r.dialog.querySelector('[data-jio-dialog-close]'));
|
||||
r.dialog.fire('click', { target: r.dialog.querySelector('[data-jio-dialog-close]') });
|
||||
assert.equal(r.dialog.open, false);
|
||||
assert.equal(r.doc.activeElement, r.readonlyOpener);
|
||||
});
|
||||
@@ -256,5 +256,5 @@ test('backdrop closes only when the pointer starts and ends outside the dialog',
|
||||
r.dialog.fire('pointerdown', { clientX: 0, clientY: 0 });
|
||||
r.dialog.fire('click', { clientX: 0, clientY: 0 });
|
||||
assert.equal(r.dialog.open, false);
|
||||
assert.equal(r.doc.documentElement.classList.contains('aksrt-ban-modal-open'), false);
|
||||
assert.equal(r.doc.documentElement.classList.contains('jio-ban-modal-open'), false);
|
||||
});
|
||||
Reference in new issue
Block a user