进行了一些小修复

This commit is contained in:
kate522 committed 2026-08-26 16:32:18 +08:00
1 parent 992af2119d
commit 2cb78edabb
26 files changed
+2091 -2383

No files matched your search

+27 -10
View File
@@ -110,6 +110,7 @@
this.bindLeaveWarning();
this.bindAi();
this.bindTagActive();
this.bindDropSelect();
this.loadFeaturedFromDom();
},
@@ -160,11 +161,12 @@
},
bindTagActive: function () {
qsa('.aksrt-submit-tag input').forEach(function (input) {
qsa('.aksrt-submit-tag input, .newpost-filter-tags input').forEach(function (input) {
var sync = function () {
var tag = input.closest('.aksrt-submit-tag');
var tag = input.closest('.aksrt-submit-tag, .tag-list');
if (tag) {
tag.classList.toggle('is-active', input.checked);
tag.classList.toggle('active', input.checked);
}
};
input.addEventListener('change', sync);
@@ -172,6 +174,18 @@
});
},
bindDropSelect: function () {
qsa('.term-select-box [data-toggle-class="open"]').forEach(function (button) {
button.addEventListener('click', function () {
var box = button.closest('.drop-select');
if (!box) return;
var open = !box.classList.contains('open');
box.classList.toggle('open', open);
button.setAttribute('aria-expanded', open ? 'true' : 'false');
});
});
},
bindSubmitButtons: function () {
var self = this;
qsa('.aksrt-submit-btn', this.form).forEach(function (btn) {
@@ -393,11 +407,7 @@
setFeatured: function (type, data) {
this.featured = { type: type || '', data: data || {} };
var typeInput = qs('[data-featured-type]');
var jsonInput = qs('[data-featured-json]');
if (typeInput) {
typeInput.value = type || '';
}
if (jsonInput) {
jsonInput.value = JSON.stringify(this.featured);
}
@@ -412,6 +422,13 @@
}
var t = this.featured.type;
var d = this.featured.data || {};
var box = qs('.featured-edit');
if (box) {
box.classList.remove('featured-loaded', 'image', 'slide', 'video');
if (t && t !== 'close') {
box.classList.add('featured-loaded', t);
}
}
var html = '';
if (t === 'image' && d.url) {
html = '<img src="' + d.url + '" alt="">';
@@ -419,15 +436,15 @@
html =
'<img src="' +
d[0].url +
'" alt=""><span class="aksrt-submit-featured__badge"><i class="fa fas fa-image"></i></span>';
'" alt=""><span class="featured-type-badge"><i class="fa fas fa-image"></i></span>';
} else if (t === 'video') {
html =
(d.pic
? '<img src="' + d.pic + '" alt="">'
: '<div class="aksrt-submit-featured__video-placeholder"><i class="fa fas fa-play"></i></div>') +
'<span class="aksrt-submit-featured__badge"><i class="fa fas fa-video"></i></span>';
: '<div class="featured-video-placeholder"><i class="fa fas fa-play"></i></div>') +
'<span class="featured-type-badge"><i class="fa fas fa-video"></i></span>';
} else {
html = '<div class="aksrt-submit-featured__empty"><i class="fa fas fa-image"></i><span>Cover</span></div>';
html = '<div class="featured-empty"><i class="fa fas fa-image"></i><span>设置文章封面</span></div>';
}
preview.innerHTML = html;
var clearBtn = qs('[data-featured-action="close"]');