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
+30
-30
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* AKSRT front-end article submit (write/post page).
|
||||
* Jio front-end article submit (write/post page).
|
||||
* Handles TinyMCE content, featured cover, pay box, draft/submit AJAX.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
/* global notyf */
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var cfg = window.aksrtSubmitData || {};
|
||||
var cfg = window.jioSubmitData || {};
|
||||
var i18n = cfg.i18n || {};
|
||||
var ajaxUrl = cfg.ajaxUrl || '/wp-admin/admin-ajax.php';
|
||||
var nonce = cfg.nonce || '';
|
||||
@@ -91,11 +91,11 @@
|
||||
featuredOptions: {},
|
||||
|
||||
init: function () {
|
||||
this.form = document.getElementById('aksrt-submit-form');
|
||||
if (!this.form || this.form.getAttribute('data-aksrt-submit-ready') === '1') {
|
||||
this.form = document.getElementById('jio-submit-form');
|
||||
if (!this.form || this.form.getAttribute('data-jio-submit-ready') === '1') {
|
||||
return;
|
||||
}
|
||||
this.form.setAttribute('data-aksrt-submit-ready', '1');
|
||||
this.form.setAttribute('data-jio-submit-ready', '1');
|
||||
this.bindDirty();
|
||||
this.bindAutoHeight();
|
||||
this.bindSubmitButtons();
|
||||
@@ -151,9 +151,9 @@
|
||||
},
|
||||
|
||||
bindTagActive: function () {
|
||||
qsa('.aksrt-submit-tag input, .newpost-filter-tags input').forEach(function (input) {
|
||||
qsa('.jio-submit-tag input, .newpost-filter-tags input').forEach(function (input) {
|
||||
var sync = function () {
|
||||
var tag = input.closest('.aksrt-submit-tag, .tag-list');
|
||||
var tag = input.closest('.jio-submit-tag, .tag-list');
|
||||
if (tag) {
|
||||
tag.classList.toggle('is-active', input.checked);
|
||||
tag.classList.toggle('active', input.checked);
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
bindSubmitButtons: function () {
|
||||
var self = this;
|
||||
qsa('.aksrt-submit-btn', this.form).forEach(function (btn) {
|
||||
qsa('.jio-submit-btn', this.form).forEach(function (btn) {
|
||||
btn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (self.isSubmitting) {
|
||||
@@ -182,7 +182,7 @@
|
||||
|
||||
collectPayload: function (action) {
|
||||
var data = serializeForm(this.form);
|
||||
data.action = action === 'posts_draft' ? 'aksrt_save_draft' : 'aksrt_submit_post';
|
||||
data.action = action === 'posts_draft' ? 'jio_save_draft' : 'jio_submit_post';
|
||||
data._nonce = nonce || data._nonce || '';
|
||||
data.post_content = getEditorContent();
|
||||
data.post_title = data.post_title || ((qs('#submit-title') && qs('#submit-title').value) || '');
|
||||
@@ -204,11 +204,11 @@
|
||||
submit: function (btn, action) {
|
||||
var self = this;
|
||||
if (action !== 'posts_draft') {
|
||||
var captcha = window.AKSRTCaptcha;
|
||||
if (captcha && !btn.dataset.aksrtCaptchaReady) {
|
||||
var captcha = window.JioCaptcha;
|
||||
if (captcha && !btn.dataset.jioCaptchaReady) {
|
||||
captcha.run('front_submit', this.form).then(function (payload) {
|
||||
if (payload === null) return;
|
||||
btn.dataset.aksrtCaptchaReady = '1';
|
||||
btn.dataset.jioCaptchaReady = '1';
|
||||
self.submit(btn, action);
|
||||
}).catch(function () {
|
||||
captcha.reset('front_submit', self.form);
|
||||
@@ -216,12 +216,12 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
delete btn.dataset.aksrtCaptchaReady;
|
||||
delete btn.dataset.jioCaptchaReady;
|
||||
}
|
||||
this.isSubmitting = true;
|
||||
var toastId = action === 'posts_draft'
|
||||
? 'aksrt-front-submit-draft-toast'
|
||||
: 'aksrt-front-submit-publish-toast';
|
||||
? 'jio-front-submit-draft-toast'
|
||||
: 'jio-front-submit-publish-toast';
|
||||
var original = btn.innerHTML;
|
||||
btn.disabled = true;
|
||||
btn.innerHTML =
|
||||
@@ -263,7 +263,7 @@
|
||||
}
|
||||
}
|
||||
if (d.time) {
|
||||
var timeEl = qs('.aksrt-submit-modified-time');
|
||||
var timeEl = qs('.jio-submit-modified-time');
|
||||
if (timeEl) {
|
||||
timeEl.textContent = '';
|
||||
var timeBadge = document.createElement('span');
|
||||
@@ -273,7 +273,7 @@
|
||||
}
|
||||
}
|
||||
if (d.url) {
|
||||
var view = qs('.aksrt-submit-view-btn');
|
||||
var view = qs('.jio-submit-view-btn');
|
||||
if (view) {
|
||||
view.textContent = '';
|
||||
var previewLink = document.createElement('a');
|
||||
@@ -319,15 +319,15 @@
|
||||
self.isSubmitting = false;
|
||||
})
|
||||
.finally(function () {
|
||||
if (action !== 'posts_draft' && window.AKSRTCaptcha) {
|
||||
window.AKSRTCaptcha.reset('front_submit', self.form);
|
||||
if (action !== 'posts_draft' && window.JioCaptcha) {
|
||||
window.JioCaptcha.reset('front_submit', self.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
bindDraftDelete: function () {
|
||||
document.addEventListener('click', function (e) {
|
||||
var btn = e.target.closest('.aksrt-submit-drafts__delete');
|
||||
var btn = e.target.closest('.jio-submit-drafts__delete');
|
||||
if (!btn) {
|
||||
return;
|
||||
}
|
||||
@@ -339,21 +339,21 @@
|
||||
if (!window.confirm(i18n.confirmDelete || 'Delete?')) {
|
||||
return;
|
||||
}
|
||||
var toastId = 'aksrt-front-submit-delete-draft-toast';
|
||||
var toastId = 'jio-front-submit-delete-draft-toast';
|
||||
btn.disabled = true;
|
||||
notyf(i18n.deleting || '正在删除草稿…', 'load', '', toastId);
|
||||
fetch(ajaxUrl, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
|
||||
body: toFormBody({ action: 'aksrt_delete_draft', _nonce: nonce, draft_id: id }),
|
||||
body: toFormBody({ action: 'jio_delete_draft', _nonce: nonce, draft_id: id }),
|
||||
})
|
||||
.then(function (r) {
|
||||
return r.json();
|
||||
})
|
||||
.then(function (res) {
|
||||
if (res && res.success) {
|
||||
var item = btn.closest('.aksrt-submit-drafts__item');
|
||||
var item = btn.closest('.jio-submit-drafts__item');
|
||||
if (item) {
|
||||
item.remove();
|
||||
}
|
||||
@@ -371,7 +371,7 @@
|
||||
},
|
||||
|
||||
loadFeaturedFromDom: function () {
|
||||
var box = qs('.featured-edit, .aksrt-submit-featured');
|
||||
var box = qs('.featured-edit, .jio-submit-featured');
|
||||
if (!box) {
|
||||
return;
|
||||
}
|
||||
@@ -468,17 +468,17 @@
|
||||
},
|
||||
|
||||
openMediaPicker: function (options) {
|
||||
if (!window.AksrtSubmitMedia || typeof window.AksrtSubmitMedia.open !== 'function') {
|
||||
if (!window.JioSubmitMedia || typeof window.JioSubmitMedia.open !== 'function') {
|
||||
notyf(i18n.mediaPickerUnavailable || '媒体选择器加载失败,请刷新页面后重试', 'danger');
|
||||
return false;
|
||||
}
|
||||
window.AksrtSubmitMedia.open(options);
|
||||
window.JioSubmitMedia.open(options);
|
||||
return true;
|
||||
},
|
||||
|
||||
bindFeatured: function () {
|
||||
var self = this;
|
||||
var box = qs('.featured-edit, .aksrt-submit-featured');
|
||||
var box = qs('.featured-edit, .jio-submit-featured');
|
||||
if (!box) {
|
||||
return;
|
||||
}
|
||||
@@ -624,7 +624,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
window.aksrtSubmitPayDownloads.init({
|
||||
window.jioSubmitPayDownloads.init({
|
||||
root: box,
|
||||
notify: notyf,
|
||||
markDirty: function () {
|
||||
@@ -636,5 +636,5 @@
|
||||
|
||||
};
|
||||
|
||||
jQuery(document).off('auto_fun.aksrt-front-submit').on('auto_fun.aksrt-front-submit', function () { App.init(); });
|
||||
jQuery(document).off('auto_fun.jio-front-submit').on('auto_fun.jio-front-submit', function () { App.init(); });
|
||||
})();
|
||||
Reference in new issue
Block a user