fix(widgets): restore single-card reference UI for search and quote widgets
The 搜索框 and 一言 sidebar widgets fell into the generic renderer branch, so they rendered a .jio-panel card wrapping a second bespoke card (.jio-widget-search / .jio-widget-quote). In-article 一言 also used divergent modifier classes and an extra hover rule. - search: render through the shared jio_get_search_box() (legacy keyword, history and category pickers) inside one reference card, mirroring the reference widget's markup and title default 「搜索」 - quote: render the reference .yiyan-box card itself as the click root; the shell now emits only the reference widget-container/title wrapper - article 一言: adopt the reference class lists for header, footer and the standalone after-article box; drop the invented yiyan--* modifiers and the duplicate hover/opacity rules - client: fill .cn/.en in the reference order (first line .cn, second .en) and drop the stale window.JioYiyan bridge plus the dead qv-yiyan.php AJAX path in runtime main.js - schema: replace the ad-hoc search_style radio with the reference switches (keywords, history, input category, more_cats) and default title - assets: enqueue assets/js/yiyan.js through the quote widget's asset list Tests: widget-system suite 820/821 (the one failure is the pre-existing frontend-lifecycle theme-init stub); new search/quote card contracts pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1549d5b25d
commit
f80ca1e27d
19 files changed
+276
-182
No files matched your search
@@ -4463,41 +4463,7 @@ jQuery(document).ready(function () {
|
||||
.delay(1e3, function () {
|
||||
jQuery(this).remove(), jQuery('#qj_dh_css').remove();
|
||||
});
|
||||
/*一言功能*/
|
||||
function yiyan_nr(n) {
|
||||
var yylink = _win.uri + '/yiyan/qv-yiyan.php',
|
||||
y_nr;
|
||||
jQuery.ajax({
|
||||
type: 'POST',
|
||||
url: yylink,
|
||||
}).done(function (i) {
|
||||
var lines = i
|
||||
.replace(/\r\n|\r/g, '/&/')
|
||||
.trim()
|
||||
.split('/&/');
|
||||
if (lines) {
|
||||
var type = n.attr('type');
|
||||
if (type) {
|
||||
y_nr = type === 'en' ? lines[0] : lines[1];
|
||||
} else {
|
||||
y_nr = '<div class="cn">' + lines[0] + '</div><div class="en">' + lines[1] + '</div>';
|
||||
}
|
||||
n.html(y_nr);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery('.yiyan').each(function () {
|
||||
yiyan_nr(jQuery(this));
|
||||
}),
|
||||
setInterval(function () {
|
||||
jQuery('.yiyan').each(function () {
|
||||
yiyan_nr(jQuery(this));
|
||||
});
|
||||
}, 3e4);
|
||||
jQuery('.yiyan').on('click', function () {
|
||||
yiyan_nr(jQuery(this));
|
||||
});
|
||||
/*一言功能由 assets/js/yiyan.js 单独负责([data-jio-yiyan])*/
|
||||
|
||||
/*文章目录由 Jio section-navs 按需入队,legacy 不再重复加载。*/
|
||||
|
||||
|
||||
Reference in new issue
Block a user