chore(branding): remove leftover upstream theme identifiers

The theme was renamed Zibll/子比 → AKSRT → Jio, but upstream branding
survived the sweeps in CSS classes, the SVG sprite prefix, a persisted
widget field ID, JS events, admin Vue class names, test infrastructure
and docblocks.

Renames:
- zib-widget / zib-widget-wrap / zib-slider → jio-widget-box /
  jio-widget-box-wrap / jio-slider-box (jio-widget is taken by the modern
  widget shell, jio-box-* by the card primitives)
- zib-partners-scroll + zps-* → jio-partners-scroll + jps-*
- zib-combo-info-card + zci-* → jio-combo-info-card + jci-*
- zibsvg- → jiosvg-, including the exported picker helpers and the
  fa-zibsvg- family-prefix guard
- zibpay_type → pay_type; the dual-read fallback in PostQuery collapses
  to a single key
- [zibajax="submit"] dropped (no PHP emitter); zib_ajax.success →
  jio_ajax.success
- aks-* admin Vue classes → jio-*
- zib_palette() → palette()

User-facing vendor traces are gone: the floating "more" button default no
longer ships a zibll.com link or 子比主题 marketing copy, the notice
widget ships no preset promo entries, and the four 官网教程 links are
removed from the post-list admin schema.

Test infrastructure renamed to neutral names (docker-compose.reference.yml,
Caddyfile, article-baseline.json, modern-widgets-contract.test.cjs) with
their DB/volume/env/slug identifiers following.

Kept intentionally, documented in tests/fixtures/README.md: the golden
fixture reference fingerprint (a SHA-256 record of an external directory,
read by validate-widget-golden / generate-widget-golden-fixture /
audit-widget-system), the doesNotMatch guards that prove the old tokens are
gone, and the reference theme's own meta key in the visual fixtures.

No backward-compat or data migration: saved widget configs holding old
icon keys or the old field ID silently lose them, per the project's
rewrite-over-compatibility rule.

Verified: 132/132 node contract tests, php tests/widget-system/run.php
(146 assertions), audit-admin-contracts, audit-psr4-paths and
validate-widget-golden all green; tracked bundles regenerated and in sync.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-02 00:06:54 +08:00
1 parent 42cc64106d
commit 427968a721
188 files changed
+915 -967

No files matched your search

+3 -3
View File
@@ -1,6 +1,6 @@
/**
* 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" /
* SVG sprite and inline custom SVG values ("fa fas fa-star" / "jiosvg-key" /
* "customsvg-<svg>").
*
* Any admin screen: call jio_icon_picker_assets() (PHP) and render fields
@@ -62,7 +62,7 @@
value = String(value || '').trim();
if (!value) return '';
if (value.indexOf('customsvg-') === 0) return cleanSvg(value.slice(10));
if (value.indexOf('zibsvg-') === 0) {
if (value.indexOf('jiosvg-') === 0) {
const key = value.slice(7).replace(/[^a-zA-Z0-9_-]/g, '');
return key ? `<svg class="icon" aria-hidden="true"><use xlink:href="#icon-${key}"></use></svg>` : '';
}
@@ -101,7 +101,7 @@
// Style-class-only preview: immune to the .fa family override in FA5's css.
$grid.append(itemButton(value, name, `<i class="${group.id} fa-${escapeText(name)}" aria-hidden="true"></i>`));
} else if (group.type === 'svg') {
const value = `zibsvg-${name}`;
const value = `jiosvg-${name}`;
const key = escapeText(name).replace(/[^a-zA-Z0-9_-]/g, '');
$grid.append(itemButton(value, name, `<svg class="icon" aria-hidden="true"><use xlink:href="#icon-${key}"></use></svg>`));
}
+2 -2
View File
@@ -357,8 +357,8 @@
if (link.closest("[data-jio-ajax-list='off']")) return;
// The canonical pagination engine exclusively owns these controls.
if (link.closest("[data-jio-pagination], .jio-comment-pagination")) return;
// 排序菜单与 pane 触发器是 runtime post_ajax 管线(zib_ajax_option_menu /
// zib_index_tab 契约)的专属控件,这里不能并行处理造成双请求。
// 排序菜单与 pane 触发器是 runtime post_ajax 管线(option-menu /
// index-tab 契约)的专属控件,这里不能并行处理造成双请求。
if (link.closest(".ajax-option, .post_ajax_trigger")) return;
var href = link.getAttribute("href") || link.getAttribute("ajax-href") || link.getAttribute("data-jio-ajax-url");
+1 -1
View File
@@ -51,7 +51,7 @@
}
// 文章骨架:与 runtime/main.js 的 .ajax-next 处理器、jio_render_placeholder()
// 同源同款(1:1 对齐参考主题 zib_get_post_placeholder)。刻意不写 ajax-item:
// 同源同款(1:1 对齐 post placeholder 契约)。刻意不写 ajax-item:
// 否则会被 inject() / find('.ajax-item') 当成真实条目删除或定位。
var CARD_ITEM =
'<div class="posts-item card"><div class="item-thumbnail">' +
+1 -1
View File
@@ -239,7 +239,7 @@
canvas.height = height;
var ctx = canvas.getContext('2d');
var imgHeight = height / 2; // rebate 分支:顶部主图占上半屏
// 站点名走「周」前缀,与参考主题 zib__('week_prefix') 一致。
// 站点名走「周」前缀。
var weekLabel = '周' + '日一二三四五六'.charAt(new Date().getDay());
// 推荐人标签:参考主题 tags = `推荐人: {昵称}`,缺昵称时整层不画。
var tags = referrerName ? '推荐人: ' + String(referrerName) : '';
+3 -3
View File
@@ -337,7 +337,7 @@
closeChargeModal();
}
});
// Zibll data-for/data-value 选中模型:余额档位(.vip-product.product-box)
// data-for/data-value 选中模型:余额档位(.vip-product.product-box)
// 选中变化不产生 change 事件(隐藏 input 由程序赋值),需显式重置幂等键。
var customInput = modal.querySelector('input[name="custom_price"]');
function selectProduct(value) {
@@ -621,7 +621,7 @@
});
}
// ===== 购买积分(Zibll points-pay modal 1:1:商品/自定义 + 余额/卡密支付) =====
// ===== 购买积分(points-pay modal:商品/自定义 + 余额/卡密支付) =====
function initPointsPay() {
var modal = document.querySelector('[data-jio-points-pay-modal]');
if (!modal || modal.dataset.jioPointsPayInitialized === '1') return;
@@ -665,7 +665,7 @@
if (e.key === 'Escape' && modal.classList.contains('in')) closePointsModal();
});
// Zibll data-for/data-value 选中模型:积分商品档位。
// data-for/data-value 选中模型:积分商品档位。
function selectProduct(value) {
modal.querySelectorAll('[data-for="points_product"]').forEach(function (el) {
el.classList.toggle('active', el.getAttribute('data-value') === value);
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* Jio Enhancements — 全局 UI 增强
*
* 图片灯箱由 assets/js/runtime/imgbox.js(Miniimgbox,zibll 风格)唯一负责,
* 图片灯箱由 assets/js/runtime/imgbox.js(Miniimgbox)唯一负责,
* 此文件仅保留滚动方向感知的 legacy class 同步。
*
* @package Jio
+17 -18
View File
@@ -64,7 +64,7 @@
return "";
}
// 会员图标(Zibll zibpay_get_vip_icon:vip_N.svg 或自定义 img_icon)。
// 会员图标:vip_N.svg 或自定义 img_icon。
function vipIcon(levelInfo) {
if (levelInfo && levelInfo.img_icon) {
var img = node("img", "img-icon");
@@ -76,7 +76,7 @@
return node("i", "fa fas fa-gem");
}
// 价格行(Zibll:mark 小号 px12 前缀 + 数字;原价 original-price.relative)。
// 价格行:mark 小号 px12 前缀 + 数字;原价 original-price.relative。
function priceRow(mark, priceLabel, showLabel) {
var row = node("div", "flex abl gap6");
var price = node("div", "product-price c-red");
@@ -120,10 +120,10 @@
input.checked = index === 0;
append(label, input);
// Zibll 套餐卡:zib-widget vip-product relative text-center product-box
// 套餐卡:jio-widget-box vip-product relative text-center product-box
// (右上 tag + 价格行 + 时长 badge,无标题行)。
var product = node("div", "zib-widget vip-product relative text-center product-box");
// 标签颜色取后台「标签颜色」配置,未配置时回退参考主题默认的 jb-yellow。
var product = node("div", "jio-widget-box vip-product relative text-center product-box");
// 标签颜色取后台「标签颜色」配置,未配置时回退默认的 jb-yellow。
if (item.discount_tag) append(product, htmlNode("div", "abs-right vip-tag badg " + (item.tag_class || "jb-yellow"), item.discount_tag));
append(product, priceRow(mark, item.price_label || "", item.show_price_label || ""));
if (item.days_label) append(product, node("div", "muted-2-color c-blue em09 p2-10 badg radius", item.days_label));
@@ -135,11 +135,11 @@
function renderMethods(parent, methods, cardPass, wallet) {
methods = Array.isArray(methods) ? methods : [];
if (!methods.length) return; // 无可用支付方式:由按钮区渲染 Zibll 同款 badg 提示。
if (!methods.length) return; // 无可用支付方式:由按钮区渲染 badg 提示。
wallet = wallet || {};
var defaultMethod = text(methods[0].id || "balance");
// 支付方式选择行(Zibll zibpay_get_initiate_pay_input 同构:
// 支付方式选择行(与余额充值/购买积分弹窗同构:
// .payment-method-radio.hollow-radio + logo 图 + data-for 选中模型;
// 与余额充值/购买积分弹窗完全一致的组件)。
if (methods.length > 1) {
@@ -163,7 +163,7 @@
append(parent, row);
}
// 我的余额盒(Zibll user_balance_box 同构:选中余额渠道时显示)。
// 我的余额盒(选中余额渠道时显示)。
if (methods.some(function (m) { return text(m.id) === "balance"; })) {
var balanceBox = node("div", "mb10 muted-box padding-h10");
balanceBox.setAttribute("data-controller", "payment_method");
@@ -180,7 +180,7 @@
append(parent, balanceBox);
}
// 卡密盒(Zibll password_box 同构:mb10 padding-h10 padding-w6 +
// 卡密盒(mb10 padding-h10 padding-w6 +
// data-controller="payment_method" 契约 + form-control 输入)。
if (cardPass) {
var box = node("div", "mb10 padding-h10 padding-w6");
@@ -372,7 +372,7 @@
modal.setAttribute("data-jio-vip-modal", "");
if (view.version && view.version.catalog) modal.setAttribute("data-jio-vip-version", view.version.catalog);
// 关闭按钮(Zibll 原版内联 SVG close 图标)。
// 关闭按钮(内联 SVG close 图标)。
var close = document.createElement("button");
close.type = "button";
close.className = "close";
@@ -388,7 +388,7 @@
close.appendChild(closeSvg);
append(modal, close);
// 用户信息(Zibll:list-inline user-box)。
// 用户信息(list-inline user-box)。
var userBox = node("ul", "list-inline user-box");
var avatarItem = node("li");
var avatarWrap = node("div", "avatar-img");
@@ -412,7 +412,7 @@
append(userBox, userInfo);
append(modal, userBox);
// 会员缩略卡 tabs(Zibll vip-cardminis:vip-card.vip-cardmini + active-icon 勾)。
// 会员缩略卡 tabs(vip-cardminis:vip-card.vip-cardmini + active-icon 勾)。
var tabs = node("ul", "flex jsb mt10 mb20 vip-cardminis gutters-5");
var content = node("div", "tab-content mt10");
var activeIndex = -1;
@@ -455,7 +455,7 @@
append(tabItem, activeIcon);
append(tabs, tabItem);
// pane(Zibll tab-pane fade active in)。
// pane(tab-pane fade active in)。
var pane = node("div", "tab-pane fade jio-vip-pane" + (active ? " active in" : ""));
pane.id = tabId;
pane.hidden = !active;
@@ -463,7 +463,7 @@
form.setAttribute("onsubmit", "return false;");
var row = node("div", "pay-vip-form-row");
// 左侧会员信息(Zibll zibpay_get_pay_vip_info_box)。
// 会员信息卡(v-info 区块)。
var info = node("div", "text-center pay-vip-info");
var iconbox = node("div", "v-iconbox mb10 flex jc gap10");
var vicon = node("div", "v-icon flex jc");
@@ -487,7 +487,7 @@
renderProducts(products, group.items, wallet.mark);
var points = catalog.points_exchange || {};
if (allowed.points_exchange !== false && points.enabled && Array.isArray(points.packages) && points.packages.length) {
// 参考主题 zibpay_get_pay_uservip_modal 的积分兑换入口:
// 积分兑换入口:
// btn-block but mb10 padding-lg c-green mini-radius + points-color 图标 +
// fa-angle-right;点击开服务端静态兑换弹窗(不再跳转用户中心)。
var pointsLink = node("a", "btn-block but mb10 padding-lg c-green mini-radius");
@@ -508,9 +508,8 @@
var noMethod = methods.length === 0;
var reason = actionReason(reasons[actionName]);
var canPurchase = actionAllowed && !noMethod;
// 按钮字样对齐参考主题:会员弹窗即 zibpay_get_initiate_pay_input(4)
// 默认文案「立即支付」(开通/续费场景一致);无可用支付方式时渲染
// Zibll 同款 badg 提示,而非禁用按钮。
// 按钮字样对齐会员弹窗默认文案「立即支付」(开通/续费场景一致);无可用支付方式时渲染
// badg 提示,而非禁用按钮。
if (noMethod) {
append(products, node("span", "badg px12 c-yellow-2", "暂时无法支付,请与客服联系"));
} else {
+16 -16
View File
@@ -3703,11 +3703,11 @@ _win.bd.on('click', '.single-pay-tabbar', function () {
/**wp-ajax-action */
_win.bd.on('submit', '[ajax-submit]', function () {
var _this = jQuery(this);
var but = _this.attr('ajax-submit') || '.wp-ajax-submit,[zibajax="submit"]';
var but = _this.attr('ajax-submit') || '.wp-ajax-submit';
return _this.find(but).click(), !1;
});
_win.bd.on('click', '.wp-ajax-submit,[zibajax="submit"]', function () {
_win.bd.on('click', '.wp-ajax-submit', function () {
var _this = jQuery(this);
var confirm_text = _this.attr('data-confirm');
if (confirm_text && !confirm(confirm_text)) {
@@ -3776,7 +3776,7 @@ function jio_ajax(_this, data, success, noty, no_loading) {
notyf(n.msg, ys);
}
_this.attr('disabled', false).html(_text).trigger('zib_ajax.success', n); //完成
_this.attr('disabled', false).html(_text).trigger('jio_ajax.success', n); //完成
jQuery.isFunction(success) && success(n, _this, data);
if (n.hide_modal) {
@@ -3795,7 +3795,7 @@ function jio_ajax(_this, data, success, noty, no_loading) {
}
//AJAX执行完成后自动切换到下一个tab
_win.bd.on('zib_ajax.success', '[next-tab]', function (e, n) {
_win.bd.on('jio_ajax.success', '[next-tab]', function (e, n) {
var _next = jQuery(this).attr('next-tab');
if (_next && n && !n.error) {
jQuery('a[href="#' + _next + '"]').tab('show');
@@ -3940,14 +3940,14 @@ function partners_scroll_init() {
* 然后让 CSS 动画精确按照"一组宽度"进行位移,达成无缝无断层循环
*/
function init(widget) {
if (!widget || widget.dataset.zpsReady === '1') return;
var speed = parseFloat(widget.style.getPropertyValue('--zps-speed')) || 3;
var rows = widget.querySelectorAll('[data-zps-row]');
if (!widget || widget.dataset.jpsReady === '1') return;
var speed = parseFloat(widget.style.getPropertyValue('--jps-speed')) || 3;
var rows = widget.querySelectorAll('[data-jps-row]');
rows.forEach(function (row) {
var track = row.querySelector('[data-zps-track]');
var track = row.querySelector('[data-jps-track]');
if (!track) return;
var seed = track.querySelector('.zps-group');
var seed = track.querySelector('.jps-group');
if (!seed) return;
/**
@@ -3956,7 +3956,7 @@ function partners_scroll_init() {
*/
var setup = function () {
//先移除之前克隆的额外 group,保留最原始的那一组作为基准
var extras = track.querySelectorAll('.zps-group.zps-clone');
var extras = track.querySelectorAll('.jps-group.jps-clone');
extras.forEach(function (el) {
el.remove();
});
@@ -3974,21 +3974,21 @@ function partners_scroll_init() {
//克隆到目标数量(当前只有 1 份种子 group,需要再克隆 copies - 1 份)
for (var i = 1; i < copies; i++) {
var clone = seed.cloneNode(true);
clone.classList.add('zps-clone');
clone.classList.add('jps-clone');
clone.setAttribute('aria-hidden', 'true');
track.appendChild(clone);
}
//精确位移:每次循环移动"一组宽度",保证内容完美对齐
track.style.setProperty('--zps-shift', '-' + groupWidth + 'px');
track.style.setProperty('--jps-shift', '-' + groupWidth + 'px');
//按"每 100px 所需秒数"计算动画时长,让视觉滚动速度与卡片数量无关
var duration = (groupWidth / 100) * speed;
if (duration < 4) duration = 4;
track.style.setProperty('--zps-duration', duration.toFixed(2) + 's');
track.style.setProperty('--jps-duration', duration.toFixed(2) + 's');
//显示出来(避免闪烁)
track.setAttribute('data-zps-ready', '1');
track.setAttribute('data-jps-ready', '1');
};
//初次执行
@@ -4016,11 +4016,11 @@ function partners_scroll_init() {
});
});
widget.dataset.zpsReady = '1';
widget.dataset.jpsReady = '1';
}
function initAll() {
document.querySelectorAll('.zib-partners-scroll').forEach(init);
document.querySelectorAll('.jio-partners-scroll').forEach(init);
}
initAll();
+1 -1
View File
@@ -1 +1 @@
(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('<div class="notyn"></div>'),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('<div class="noty1"'+idAttribute+'><div class="notyf '+type+'">'+message+"</div></div>"),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"jio-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("jio-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.JioModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.jioData||window2.jio||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/jio/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&&(result["CoLine truncated
(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('<div class="notyn"></div>'),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('<div class="noty1"'+idAttribute+'><div class="notyf '+type+'">'+message+"</div></div>"),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"jio-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("jio-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.JioModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.jioData||window2.jio||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/jio/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&&(result["CoLine truncated
+1 -1
View File
@@ -82,7 +82,7 @@
box.appendChild(titleBody);
}
var widget = document.createElement('div');
widget.className = 'zib-widget';
widget.className = 'jio-widget-box';
var nav = document.createElement('div');
nav.className = 'posts-nav-lists scroll-y mini-scrollbar list-unstyled';
var list = document.createElement('ul');
+21 -21
View File
@@ -1,20 +1,20 @@
/**
* Jio User Ban — 前台“禁封/解封用户”弹窗
*
* 1:1 复刻参考主题 Zibll 前台禁封能力:
* - zib_get_edit_user_ban_link → [data-jio-ban] 委托入口(三点菜单内)
* - zib_get_set_user_ban_modal → REST /user-ban/modal 拉取弹窗内容
* - zib_ajax_set_user_ban → REST /user-ban/set 提交
* - zib_get_ban_info_modal → [data-jio-ban-info](查看禁封状态)
* - zib_get_user_ban_appeal_modal → [data-jio-ban-appeal](禁封申诉)
* - zib_get_ban_log_modal → [data-jio-ban-log](禁封记录)
* - zib_user_ban_appeal(wp-ajax) → admin-ajax jio_ban_appeal_submit 提交
* 前台用户禁封能力:
* - 编辑禁封链接 → [data-jio-ban] 委托入口(三点菜单内)
* - 禁封弹窗内容 → REST /user-ban/modal 拉取
* - 禁封提交 → REST /user-ban/set
* - 查看禁封状态弹窗 → [data-jio-ban-info]
* - 禁封申诉弹窗 → [data-jio-ban-appeal]
* - 禁封记录弹窗 → [data-jio-ban-log]
* - 禁封申诉提交 → admin-ajax jio_ban_appeal_submit
*
* 弹窗经 JioModalRuntime.openRemote 打开(与参考主题 refresh_modal 每次刷新
* 同语义):桌面 600px 宽(参考主题未传 data-class → Bootstrap .modal-dialog
* 弹窗经 JioModalRuntime.openRemote 打开(每次刷新同语义):桌面 600px 宽
* (未传 data-class → Bootstrap .modal-dialog
* 默认宽 600px)/ min-height 360px(data-height=360 → .modal-content 初始高度),
* 移动端底部抽屉(mobileBottom)。提交成功语义与参考主题 zib_ajax_set_user_ban
* 返回值一致:禁封 → reload:true(整页刷新),解封 → hide_modal:true(仅关闭弹窗)。
* 移动端底部抽屉(mobileBottom)。提交成功语义:
* 禁封 → reload:true(整页刷新),解封 → hide_modal:true(仅关闭弹窗)。
*
* @package Jio
*/
@@ -33,7 +33,7 @@
|| '/wp-admin/admin-ajax.php';
var MODAL_HEIGHT = 360;
// 参考主题 data_class='modal-mini' + data-height=240:400px 宽、初始高 240。
// data_class='modal-mini' + data-height=240:400px 宽、初始高 240。
var MINI_MODAL_HEIGHT = 240;
function ajaxUrl() {
@@ -64,7 +64,7 @@
});
}
// 查看禁封状态弹窗(参考主题 zib_get_ban_info_modal / user_ban_info_modal)。
// 查看禁封状态弹窗。
function openInfoModal(userId) {
openRemoteModal({
url: API_ROOT + '/user-ban/info-modal',
@@ -78,7 +78,7 @@
});
}
// 禁封申诉弹窗(参考主题 zib_get_user_ban_appeal_modal;表单走 admin-ajax)。
// 禁封申诉弹窗(表单走 admin-ajax)。
function openAppealModal(userId) {
openRemoteModal({
url: API_ROOT + '/user-ban/appeal-modal',
@@ -95,7 +95,7 @@
});
}
// 禁封记录弹窗(参考主题 zib_get_ban_log_modal)。
// 禁封记录弹窗。
function openLogModal(userId) {
openRemoteModal({
url: API_ROOT + '/user-ban/log-modal',
@@ -114,7 +114,7 @@
if (!form || form.dataset.jioAppealBound === '1') return;
form.dataset.jioAppealBound = '1';
// autoHeight 仅对显式声明 autoHeight/maxHeight 的文本框生效:
// 申诉说明框(1:1 参考主题)为 rows=3 自然高度 + 容器滚动,
// 申诉说明框为 rows=3 自然高度 + 容器滚动,
// 无 maxHeight 时执行 grow 会被压成 0px。
Array.prototype.forEach.call(
form.querySelectorAll('textarea[autoHeight], textarea[maxHeight]'),
@@ -219,7 +219,7 @@
.then(function (result) {
if (result && result.success) {
notyf(result.message || '操作成功', 'success');
// 参考主题 zib_ajax_set_user_ban 返回值语义:
// 提交返回值语义:
// 禁封 → reload:true(整页刷新,入口按钮状态随页面重渲染);
// 解封 → hide_modal:true(仅关闭弹窗)。
if (window.JioModalRuntime && typeof window.JioModalRuntime.close === 'function') {
@@ -242,9 +242,9 @@
}
function bindAutoHeight(textarea) {
// 1:1 复刻参考主题 textarea[autoHeight] 行为(input/focus 触发):
// textarea[autoHeight] 行为(input/focus 触发):
// 高度 = scrollHeight + 上下边框;超过 maxHeight 属性则锁定 maxHeight 并
// 打开自身滚动条(参考主题 main.js autoHeight 同语义)。
// 打开自身滚动条(main.js autoHeight 同语义)。
if (!textarea || textarea.dataset.jioAutoHeight === '1') return;
textarea.dataset.jioAutoHeight = '1';
var grow = function () {
@@ -291,7 +291,7 @@
}
/**
* 收起封面三点菜单面板(参考主题 author_header_drop_lists 菜单项点击后
* 收起封面三点菜单面板(作者头部下拉菜单项点击后
* 不自动收起,需手动关闭;评论区与文章作者下拉由各自脚本点击项后自动收起)。
*/
function closeCoverMenu(trigger) {