Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a3544f8df | |||
| ee5c1a2b5b | |||
| 9c26bece1b | |||
| 101189a077 |
@@ -2,11 +2,16 @@
|
||||
|
||||
> 基于原作者v1.2.5代码修改
|
||||
|
||||
#### v1.2.5-4
|
||||
1. 修复侧边栏测速异常、拖拽片刻图片异常、手机端文章目录异常、页面提示异常
|
||||
2. 优化多种场景下的提示、衔接、样式
|
||||
3. 新增片刻删除提示框及删除动画
|
||||
|
||||
#### v1.2.5-3
|
||||
1. 朋友圈支持根据作者筛选内容(需同步更新插件)
|
||||
2. 支持前台弹窗登入登出
|
||||
2. 附录页面功能补全
|
||||
3. 对线路切换、加载异常等情况进行了深度优化
|
||||
3. 附录页面功能补全
|
||||
4. 对线路切换、加载异常等情况进行了深度优化
|
||||
|
||||
#### v1.2.5-2
|
||||
1. 添加侧边栏、页面、文章等HTML内容块
|
||||
|
||||
@@ -304,6 +304,15 @@
|
||||
0 var(--pixar-button-depth) 0 var(--pixar-ui-dark);
|
||||
}
|
||||
|
||||
.pixar-notice-btn-close:disabled,
|
||||
.pixar-notice-btn-confirm:disabled {
|
||||
cursor: not-allowed;
|
||||
transform: translateY(var(--pixar-button-depth));
|
||||
box-shadow:
|
||||
0 0 0 var(--pixar-ui-green-shadow),
|
||||
0 var(--pixar-button-depth) 0 var(--pixar-ui-dark);
|
||||
}
|
||||
|
||||
.pixar-notice-btn-close {
|
||||
background: var(--pixar-ui-red);
|
||||
box-shadow:
|
||||
@@ -324,3 +333,253 @@
|
||||
.pixar-notice-btn-close:hover {
|
||||
border-color: var(--pixar-ui-red-border) !important;
|
||||
}
|
||||
|
||||
/* 按钮禁用样式 */
|
||||
.push_item:disabled {
|
||||
background: #c7d4ce;
|
||||
cursor: not-allowed;
|
||||
color: #f0fdf4;
|
||||
}
|
||||
|
||||
/* 删除确认弹窗样式 */
|
||||
.moments-modal-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 1999;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
animation: momentsFadeIn 0.2s ease;
|
||||
}
|
||||
|
||||
.moments-card-widget {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
background-color: #ffffff;
|
||||
text-align: left;
|
||||
border-radius: 0.5rem;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
||||
animation: momentsSlideUp 0.3s ease;
|
||||
}
|
||||
|
||||
.moments-card-header {
|
||||
padding: 1.5rem;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.moments-header-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.moments-icon-wrapper {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #fee2e2;
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
.moments-icon-wrapper svg {
|
||||
color: #dc2626;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
}
|
||||
|
||||
.moments-text-content {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.moments-title-text {
|
||||
color: #111827;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.5rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.moments-message-text {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0;
|
||||
color: #6b7280;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.25rem;
|
||||
}
|
||||
|
||||
.moments-button-group {
|
||||
margin-top: 1rem;
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
.moments-btn-confirm {
|
||||
flex: 1;
|
||||
display: inline-flex;
|
||||
padding: 0.5rem 1rem;
|
||||
background-color: #dc2626;
|
||||
color: #ffffff;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5rem;
|
||||
font-weight: 500;
|
||||
justify-content: center;
|
||||
border-radius: 0.375rem;
|
||||
border-width: 1px;
|
||||
border-color: transparent;
|
||||
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.moments-btn-confirm:hover {
|
||||
background-color: #b91c1c;
|
||||
}
|
||||
|
||||
.moments-btn-cancel {
|
||||
flex: 1;
|
||||
display: inline-flex;
|
||||
padding: 0.5rem 1rem;
|
||||
background-color: #ffffff;
|
||||
color: #374151;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5rem;
|
||||
font-weight: 500;
|
||||
justify-content: center;
|
||||
border-radius: 0.375rem;
|
||||
border: 1px solid #d1d5db;
|
||||
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.moments-btn-cancel:hover {
|
||||
background-color: #f3f4f6;
|
||||
}
|
||||
|
||||
.moments-btn-confirm:disabled {
|
||||
background-color: #fecaca;
|
||||
cursor: not-allowed;
|
||||
box-shadow: none;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.moments-btn-cancel:disabled,
|
||||
.push_close:disabled {
|
||||
background-color: #e7f0e5;
|
||||
color: #9ca3af;
|
||||
border-color: #e7f0e5;
|
||||
cursor: not-allowed;
|
||||
box-shadow: none;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* --- 追加:黄色警告模式 --- */
|
||||
.theme-yellow .moments-icon-wrapper {
|
||||
background-color: #fef3c7;
|
||||
}
|
||||
|
||||
.theme-yellow .moments-icon-wrapper svg {
|
||||
color: #d97706;
|
||||
}
|
||||
|
||||
.theme-yellow .moments-btn-confirm {
|
||||
background-color: #d97706;
|
||||
}
|
||||
|
||||
.theme-yellow .moments-btn-confirm:hover {
|
||||
background-color: #b45309;
|
||||
}
|
||||
|
||||
/* --- 追加:绿色确认模式 --- */
|
||||
.theme-green .moments-icon-wrapper {
|
||||
background-color: #d1fae5;
|
||||
}
|
||||
|
||||
.theme-green .moments-icon-wrapper svg {
|
||||
color: #059669;
|
||||
}
|
||||
|
||||
.theme-green .moments-btn-confirm {
|
||||
background-color: #059669;
|
||||
}
|
||||
|
||||
.theme-green .moments-btn-confirm:hover {
|
||||
background-color: #047857;
|
||||
}
|
||||
|
||||
/* --- 追加:红色保持默认,这里只是为了统一命名,可不加 --- */
|
||||
.theme-red .moments-icon-wrapper {
|
||||
background-color: #fee2e2;
|
||||
}
|
||||
|
||||
.theme-red .moments-icon-wrapper svg {
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
.theme-red .moments-btn-confirm {
|
||||
background-color: #dc2626;
|
||||
}
|
||||
|
||||
@keyframes momentsFadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes momentsSlideUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(10px);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* --- 删除动画 --- */
|
||||
/* 飘散消失动画 (持续 0.8s) */
|
||||
.moments-delete-disperse {
|
||||
animation: momentsDeleteDisperse 0.8s ease-in forwards;
|
||||
transform-origin: center bottom;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@keyframes momentsDeleteDisperse {
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: translateY(0) rotate(0deg) scale(1);
|
||||
filter: blur(0);
|
||||
}
|
||||
|
||||
20% {
|
||||
opacity: 0.9;
|
||||
transform: translateY(-10px) rotate(2deg) scale(1.02);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: translateY(-120px) rotate(-8deg) scale(0.6);
|
||||
filter: blur(3px);
|
||||
}
|
||||
}
|
||||
@@ -5977,7 +5977,7 @@ a.change i.ri-refresh-line {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
top: 485px;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
background-color: var(--toc-color);
|
||||
color: #fff;
|
||||
|
||||
@@ -143,9 +143,10 @@ login_loginBtn.addEventListener('click', async () => {
|
||||
if (finalUrl.includes('/uc')) {
|
||||
cocoMessage.success('署名成功,正在跳转...');
|
||||
login_loginBtn.textContent = '跳转中...';
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 800);
|
||||
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||
$.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||
$.cookie('load_type', 'login', { path: '/', domain: 'anian.cc' });
|
||||
window.location.reload();
|
||||
} else if (finalUrl.includes('error=invalid-credential')) {
|
||||
cocoMessage.warning('署名人与心上锁不匹配');
|
||||
fetchCSRFToken();
|
||||
@@ -181,6 +182,8 @@ document.addEventListener("keydown", function (e) {
|
||||
|
||||
// 退出登录
|
||||
async function customLogout() {
|
||||
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', true);
|
||||
let closeLoading = cocoMessage.loading('退出登录中...');
|
||||
try {
|
||||
const getResponse = await fetch('/logout', { credentials: 'include' });
|
||||
const htmlText = await getResponse.text();
|
||||
@@ -189,6 +192,8 @@ async function customLogout() {
|
||||
const logoutCsrfToken = doc.querySelector('input[name="_csrf"]')?.value;
|
||||
if (!logoutCsrfToken) {
|
||||
cocoMessage.error('页面未找到 CSRF 令牌');
|
||||
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', false);
|
||||
closeLoading();
|
||||
return;
|
||||
}
|
||||
const postResponse = await fetch('/logout', {
|
||||
@@ -202,20 +207,26 @@ async function customLogout() {
|
||||
})
|
||||
});
|
||||
if (postResponse.ok) {
|
||||
closeLoading();
|
||||
cocoMessage.success('您已成功退出登录');
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 800);
|
||||
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||
$.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||
$.cookie('load_type', 'logout', { path: '/', domain: 'anian.cc' });
|
||||
window.location.reload();
|
||||
} else {
|
||||
closeLoading();
|
||||
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', false);
|
||||
throw new Error('退出请求被拒绝');
|
||||
}
|
||||
} catch (err) {
|
||||
closeLoading();
|
||||
$('.pixar-notice-btn-confirm, .pixar-notice-btn-close').prop('disabled', false);
|
||||
console.error('Logout Error:', err);
|
||||
cocoMessage.error('退出失败,请手动刷新页面');
|
||||
}
|
||||
}
|
||||
|
||||
function showPixarCard() {
|
||||
function open_logout_box() {
|
||||
const wrapper = document.getElementById("pixarNoticeWrapper");
|
||||
wrapper.style.display = "flex";
|
||||
}
|
||||
@@ -229,7 +240,16 @@ function confirmPixarAction() {
|
||||
customLogout();
|
||||
}
|
||||
|
||||
|
||||
// 打开确认模态框
|
||||
function openModal(title, msg, type) {
|
||||
var modal = $('#momentsDeleteModal');
|
||||
var card = modal.find('.moments-card-widget');
|
||||
modal.find('.moments-title-text').text(title);
|
||||
modal.find('.moments-message-text').text(msg);
|
||||
card.removeClass('theme-red theme-yellow theme-green').addClass('theme-' + type);
|
||||
$('.moments-btn-cancel, .moments-btn-confirm').prop('disabled', false);
|
||||
modal.fadeIn(200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+61
-74
@@ -383,13 +383,7 @@ $(document).on('click', '.wp_get_media_list li', function () {
|
||||
//删除图片/视频(保留事件冒泡修复)
|
||||
$(document).on('click', '.topic-img-de', function (e) {
|
||||
e.stopPropagation();
|
||||
|
||||
var msg = "确认删除此媒体文件?";
|
||||
if (confirm(msg)) {
|
||||
$(this).parent().remove();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
$(this).parent().remove();
|
||||
var num = $('.add_img_box .t_media_item').length;
|
||||
if (num < 9) {
|
||||
$("a.up_img_btn").show();
|
||||
@@ -606,9 +600,8 @@ $(document).on('click', '.loca_text', function () {
|
||||
//发布更新瞬间
|
||||
let isSubmittingMoment = false;
|
||||
$(document).on('click', '.push_item', function () {
|
||||
|
||||
if (isSubmittingMoment) return false;
|
||||
|
||||
let closeLoading = null;
|
||||
var content = $("#topic_content").val();
|
||||
var catname = $(".t_cat_toogle span").text();
|
||||
var loca = $(".loca_text").text();
|
||||
@@ -669,7 +662,8 @@ $(document).on('click', '.push_item', function () {
|
||||
pushData.metadata.annotations = { mylocal: loca };
|
||||
}
|
||||
|
||||
cocoMessage.info("发布中..");
|
||||
closeLoading = cocoMessage.loading('正在发布...');
|
||||
$('.push_close, .push_item').prop('disabled', true);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -677,10 +671,16 @@ $(document).on('click', '.push_item', function () {
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(pushData),
|
||||
success() {
|
||||
closeLoading?.()
|
||||
cocoMessage.success('发布成功!');
|
||||
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||
$.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||
$.cookie('load_type', 'create', { path: '/', domain: 'anian.cc' });
|
||||
location.reload();
|
||||
},
|
||||
error() {
|
||||
$('.push_close, .push_item').prop('disabled', false);
|
||||
closeLoading?.()
|
||||
cocoMessage.error('发布失败!');
|
||||
release();
|
||||
}
|
||||
@@ -717,7 +717,8 @@ $(document).on('click', '.push_item', function () {
|
||||
updateData.metadata.annotations = { mylocal: loca };
|
||||
}
|
||||
|
||||
cocoMessage.info("更新中..");
|
||||
closeLoading = cocoMessage.loading('正在更新...');
|
||||
$('.push_close, .push_item').prop('disabled', true);
|
||||
|
||||
$.ajax({
|
||||
type: "PUT",
|
||||
@@ -725,11 +726,17 @@ $(document).on('click', '.push_item', function () {
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(updateData),
|
||||
success() {
|
||||
closeLoading?.()
|
||||
cocoMessage.success('更新成功!');
|
||||
const currentScrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||
$.cookie('scrollParam', currentScrollTop, { path: '/', domain: 'anian.cc' });
|
||||
$.cookie('load_type', 'update', { path: '/', domain: 'anian.cc' });
|
||||
location.reload();
|
||||
},
|
||||
error() {
|
||||
closeLoading?.()
|
||||
cocoMessage.error('更新失败!');
|
||||
$('.push_close, .push_item').prop('disabled', false);
|
||||
release();
|
||||
}
|
||||
});
|
||||
@@ -1052,8 +1059,6 @@ $(document).on('click', '#t_pagination a', function () {
|
||||
const currentPage = parseInt(href.match(/\d+/)[0]);
|
||||
const $pagingArea = $('#t_pagination .post-paging');
|
||||
const originalPagingHtml = $pagingArea.html();
|
||||
const isauto_loading = window.isAutoLoading
|
||||
if (window.isAutoLoading) window.isAutoLoading = false;
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
@@ -1075,13 +1080,9 @@ $(document).on('click', '#t_pagination a', function () {
|
||||
} else {
|
||||
$("#t_pagination a").hide();
|
||||
}
|
||||
if (isauto_loading) {
|
||||
if (window.scroll_param > result.offset().top - 58) {
|
||||
$body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
||||
} else {
|
||||
window.forceStopLoading = true;
|
||||
}
|
||||
} else $body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
||||
if (!window.scroll_param || (!window.loadMoreTimeout && window.scroll_param > result.offset().top - 58)) {
|
||||
$body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
||||
} else window.forceStopLoading = true;
|
||||
getMomentAudio();
|
||||
initAgree();
|
||||
lazyLoadInstance.update();
|
||||
@@ -1214,8 +1215,6 @@ $(document).on('click', '#p_pagination a', function () {
|
||||
const $pagingArea = $('#p_pagination .post-paging');
|
||||
const originalPagingHtml = $pagingArea.html();
|
||||
const targetOffsetTop = $('#p_pagination a').offset().top;
|
||||
const isauto_loading = window.isAutoLoading
|
||||
if (window.isAutoLoading) window.isAutoLoading = false;
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: href,
|
||||
@@ -1234,13 +1233,9 @@ $(document).on('click', '#p_pagination a', function () {
|
||||
} else {
|
||||
$("#p_pagination a").hide(); //如果没有下一页了,隐藏
|
||||
}
|
||||
if (isauto_loading) {
|
||||
if (window.scroll_param > targetOffsetTop - 358) {
|
||||
$body.animate({ scrollTop: targetOffsetTop - 358 }, 500);
|
||||
} else {
|
||||
window.forceStopLoading = true;
|
||||
}
|
||||
} else $body.animate({ scrollTop: targetOffsetTop - 358 }, 500);
|
||||
if (!window.scroll_param || (!window.loadMoreTimeout && window.scroll_param > targetOffsetTop - 358)) {
|
||||
$body.animate({ scrollTop: targetOffsetTop - 358 }, 500);
|
||||
} else window.forceStopLoading = true;
|
||||
pix.initGalleryPhotos();
|
||||
$.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
||||
} else {
|
||||
@@ -1492,8 +1487,6 @@ $('body').on('click', '#pagination a', function () {
|
||||
const originalPagingHtml = $pagingArea.html();
|
||||
var href = $(this).attr('data');
|
||||
const currentPage = parseInt(href.match(/\d+/)[0]);
|
||||
const isauto_loading = window.isAutoLoading
|
||||
if (window.isAutoLoading) window.isAutoLoading = false;
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: href,
|
||||
@@ -1519,13 +1512,9 @@ $('body').on('click', '#pagination a', function () {
|
||||
} else {
|
||||
$("#pagination a").hide(); //如果没有下一页了,隐藏
|
||||
}
|
||||
if (isauto_loading) {
|
||||
if (window.scroll_param > result.offset().top - 58) {
|
||||
$body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
||||
} else {
|
||||
window.forceStopLoading = true;
|
||||
}
|
||||
} else $body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
||||
if (!window.scroll_param || (!window.loadMoreTimeout && window.scroll_param > result.offset().top - 58)) {
|
||||
$body.animate({ scrollTop: result.offset().top - 58 }, 500);
|
||||
} else window.forceStopLoading = true;
|
||||
initAgree()
|
||||
lazyLoadInstance.update();
|
||||
$.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
||||
@@ -1548,8 +1537,6 @@ $('body').on('click', '.arc_pagenav a', function () {
|
||||
const $pagingArea = $('.arc_pagenav');
|
||||
const originalPagingHtml = $pagingArea.html();
|
||||
const postListElement = document.getElementById("post_item");
|
||||
const isauto_loading = window.isAutoLoading
|
||||
if (window.isAutoLoading) window.isAutoLoading = false;
|
||||
var href = $(this).attr('data');
|
||||
const currentPage = parseInt(href.match(/\d+/)[0]);
|
||||
|
||||
@@ -1579,15 +1566,10 @@ $('body').on('click', '.arc_pagenav a', function () {
|
||||
} else {
|
||||
$(".arc_pagenav a").hide(); //如果没有下一页了,隐藏
|
||||
}
|
||||
|
||||
$('.arc_pagenav .uk-spinner').remove();
|
||||
if (isauto_loading) {
|
||||
if (window.scroll_param > post.offset().top - 58) {
|
||||
$body.animate({ scrollTop: post.offset().top - 58 }, 500);
|
||||
} else {
|
||||
window.forceStopLoading = true;
|
||||
}
|
||||
} else $body.animate({ scrollTop: post.offset().top - 58 }, 500);
|
||||
if (!window.scroll_param || (!window.loadMoreTimeout && window.scroll_param > post.offset().top - 58)) {
|
||||
$body.animate({ scrollTop: post.offset().top - 58 }, 500);
|
||||
} else window.forceStopLoading = true;
|
||||
initAgree()
|
||||
lazyLoadInstance.update();
|
||||
$.cookie('page', currentPage, { path: '/', domain: 'anian.cc' });
|
||||
@@ -2319,7 +2301,7 @@ function anian_renderLunarUI() {
|
||||
try {
|
||||
const cookieVal = anian_getCookie(cookieName);
|
||||
if (cookieVal) data = JSON.parse(cookieVal);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
|
||||
if (data) {
|
||||
doRender(data);
|
||||
@@ -2622,11 +2604,11 @@ if (location.hostname === "anian.cc") {
|
||||
|
||||
anianxSpeedMainLine.addEventListener("click", () => {
|
||||
if (anianxSpeedGlobalLock) return;
|
||||
anianxSpeedMoveArrow(anianxSpeedMainLine);
|
||||
anianxSpeedGlobalLock = true;
|
||||
if (anianxSpeedMainLine.classList.contains("anianx-fixed")) {
|
||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
||||
anianxSpeedBubbleText.innerText = "当前为主线路";
|
||||
anianxSpeedMoveArrow(anianxSpeedMainLine);
|
||||
anianxSpeedGlobalLock = false;
|
||||
} else {
|
||||
anianxSpeedBubbleText.classList.add("anianx-loading");
|
||||
@@ -2642,11 +2624,11 @@ anianxSpeedMainLine.addEventListener("click", () => {
|
||||
|
||||
anianxSpeedSubLine.addEventListener("click", () => {
|
||||
if (anianxSpeedGlobalLock) return;
|
||||
anianxSpeedMoveArrow(anianxSpeedSubLine);
|
||||
anianxSpeedGlobalLock = true;
|
||||
if (anianxSpeedSubLine.classList.contains("anianx-fixed")) {
|
||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
||||
anianxSpeedBubbleText.innerText = "当前为副线路";
|
||||
anianxSpeedMoveArrow(anianxSpeedSubLine);
|
||||
anianxSpeedGlobalLock = false;
|
||||
} else {
|
||||
anianxSpeedBubbleText.classList.add("anianx-loading");
|
||||
@@ -2662,10 +2644,10 @@ anianxSpeedSubLine.addEventListener("click", () => {
|
||||
|
||||
anianxSpeedTestLine.addEventListener("click", () => {
|
||||
if (anianxSpeedGlobalLock) return;
|
||||
anianxSpeedMoveArrow(anianxSpeedTestLine);
|
||||
anianxSpeedGlobalLock = true;
|
||||
anianxSpeedBubbleText.classList.add("anianx-loading");
|
||||
anianxSpeedBubbleText.innerText = "测速中";
|
||||
anianxSpeedMoveArrow(anianxSpeedTestLine);
|
||||
anianxSpeedTestWithTimeout(7500).then(result => {
|
||||
anianxSpeedBubbleText.classList.remove("anianx-loading");
|
||||
anianxSpeedBubbleText.innerText = result;
|
||||
@@ -2744,7 +2726,7 @@ function initTagSwitch() {
|
||||
|
||||
// 1. 定义一个全局标志位,用于外部强制终止
|
||||
window.forceStopLoading = false;
|
||||
window.isAutoLoading = false;
|
||||
window.loadMoreTimeout = false;
|
||||
function loadMultiplePages(pageCount) {
|
||||
return new Promise((resolve) => {
|
||||
let loadedCount = 0;
|
||||
@@ -2772,9 +2754,6 @@ function loadMultiplePages(pageCount) {
|
||||
|
||||
const $pager = $btn.closest('.post-paging');
|
||||
const oldHref = $btn.attr('data');
|
||||
|
||||
window.isAutoLoading = true;
|
||||
|
||||
const pageStartTime = Date.now();
|
||||
$btn.trigger('click'); // 加载更多
|
||||
|
||||
@@ -2786,8 +2765,9 @@ function loadMultiplePages(pageCount) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
if (now - pageStartTime > 2000) {
|
||||
if (now - pageStartTime > 3000) {
|
||||
clearInterval(waitInterval);
|
||||
window.loadMoreTimeout = true;
|
||||
resolve(); // 解决 Promise,触发后续滚动
|
||||
return;
|
||||
}
|
||||
@@ -2813,13 +2793,18 @@ function loadMultiplePages(pageCount) {
|
||||
}
|
||||
|
||||
function initjump() {
|
||||
let closeLoading = null;
|
||||
const page = $.cookie('page');
|
||||
const scrollParam = $.cookie('scrollParam');
|
||||
const loadType = $.cookie('load_type')
|
||||
$.removeCookie('scrollParam', { path: '/', domain: 'anian.cc' });
|
||||
$.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
||||
$.removeCookie('load_type', { path: '/', domain: 'anian.cc' });
|
||||
window.scroll_param = scrollParam;
|
||||
if (scrollParam && !isNaN(scrollParam)) {
|
||||
closeLoading = cocoMessage.loading('自动恢复原线路内容中...');
|
||||
}
|
||||
initTagSwitch().then(() => {
|
||||
const page = $.cookie('page');
|
||||
const scrollParam = $.cookie('scrollParam');
|
||||
$.removeCookie('scrollParam', { path: '/', domain: 'anian.cc' });
|
||||
$.removeCookie('page', { path: '/', domain: 'anian.cc' });
|
||||
window.scroll_param = scrollParam;
|
||||
|
||||
const loadPageTask = () => {
|
||||
if (page && !isNaN(page)) {
|
||||
const targetPage = Number(page) - 1;
|
||||
@@ -2827,28 +2812,30 @@ function initjump() {
|
||||
}
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
if (scrollParam && !isNaN(scrollParam)) {
|
||||
const closeLoading = cocoMessage.loading('自动恢复原线路内容中...');
|
||||
loadPageTask().then(() => {
|
||||
// 执行滚动逻辑
|
||||
closeLoading?.()
|
||||
const recordScroll = Number(scrollParam);
|
||||
const maxScroll = document.documentElement.scrollHeight - window.innerHeight;
|
||||
const scrollDistance = Math.min(recordScroll, maxScroll);
|
||||
|
||||
$('html, body').animate({ scrollTop: scrollDistance }, 500);
|
||||
|
||||
if (recordScroll > maxScroll && (recordScroll - maxScroll) > 200) {
|
||||
closeLoading();
|
||||
cocoMessage.warning('请手动加载原线路内容');
|
||||
} else if (loadType === 'create') {
|
||||
cocoMessage.success('发布成功!');
|
||||
} else if (loadType === 'update') {
|
||||
cocoMessage.success('更新成功!');
|
||||
} else if (loadType === 'login') {
|
||||
cocoMessage.success('登录成功!');
|
||||
} else if (loadType === 'logout') {
|
||||
cocoMessage.success('登出成功!');
|
||||
} else {
|
||||
const msg = location.hostname === "anian.cc" ? '主线路' : (location.hostname === "www.anian.cc" ? '副线路' : '测试线路');
|
||||
closeLoading();
|
||||
cocoMessage.success(`已成功切换至${msg}`);
|
||||
cocoMessage.success('已成功切换至${msg}');
|
||||
}
|
||||
});
|
||||
}).catch(() => closeLoading?.());
|
||||
}
|
||||
});
|
||||
}).catch(() => closeLoading?.());
|
||||
}
|
||||
|
||||
|
||||
@@ -2926,7 +2913,7 @@ function initBlog() {
|
||||
syncFooterWithAudioState(),
|
||||
highlightMenu(),
|
||||
initializeMomentFold()
|
||||
// nextBanner()
|
||||
// nextBanner()
|
||||
|
||||
}
|
||||
|
||||
|
||||
+160
-142
@@ -1,13 +1,13 @@
|
||||
main_content = $('.moment_type_main');
|
||||
function remove_image_temp(){
|
||||
if(!$('.image_edit_temp .add_img_box').length > 0){
|
||||
function remove_image_temp() {
|
||||
if (!$('.image_edit_temp .add_img_box').length > 0) {
|
||||
var temp = $('.add_img_box');
|
||||
$('.image_edit_temp').html(temp);
|
||||
}
|
||||
main_content.empty();
|
||||
}
|
||||
|
||||
function back_image_temp(){
|
||||
function back_image_temp() {
|
||||
var temp = $('.add_img_box');
|
||||
main_content.html(temp);
|
||||
$('.image_edit_temp').empty();
|
||||
@@ -58,7 +58,7 @@ $('body').on('click', '.edit_content .push_card', function () {
|
||||
}
|
||||
});
|
||||
|
||||
function card_post(card_url){
|
||||
function card_post(card_url) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: `/apis/api.console.halo.run/v1alpha1/posts?keyword=${card_url}&labelSelector=content.halo.run%2Fdeleted%3Dfalse&page=1&size=20`,
|
||||
@@ -68,12 +68,12 @@ function card_post(card_url){
|
||||
success: function (data) {
|
||||
$('.edit_card_box .edit_content input').val('');
|
||||
if (data.total > 0) {
|
||||
if(data.total>1){
|
||||
if (data.total > 1) {
|
||||
cocoMessage.error('当前搜索的文章有多个无法选择');
|
||||
}else{
|
||||
} else {
|
||||
var item = data.items[0]
|
||||
$('.show_card').show();
|
||||
$('.card_sortble').append(getcard(item.post.metadata.name,item.post.spec.cover,item.post.spec.title,'post'));
|
||||
$('.card_sortble').append(getcard(item.post.metadata.name, item.post.spec.cover, item.post.spec.title, 'post'));
|
||||
cocoMessage.success('已生成卡片');
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ function card_post(card_url){
|
||||
}
|
||||
|
||||
|
||||
function edit_page(card_url){
|
||||
function edit_page(card_url) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: `/apis/api.console.halo.run/v1alpha1/singlepages?keyword=${card_url}&labelSelector=content.halo.run%2Fdeleted%3Dfalse&page=1&size=20`,
|
||||
@@ -96,12 +96,12 @@ function edit_page(card_url){
|
||||
success: function (data) {
|
||||
$('.edit_card_box .edit_content input').val('');
|
||||
if (data.total > 0) {
|
||||
if(data.total>1){
|
||||
if (data.total > 1) {
|
||||
cocoMessage.error('当前搜索的页面有多个无法选择');
|
||||
}else{
|
||||
} else {
|
||||
var item = data.items[0]
|
||||
$('.show_card').show();
|
||||
$('.card_sortble').append(getcard(item.page.metadata.name,item.page.spec.cover,item.page.spec.title,'page'));
|
||||
$('.card_sortble').append(getcard(item.page.metadata.name, item.page.spec.cover, item.page.spec.title, 'page'));
|
||||
cocoMessage.success('已生成卡片');
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ function edit_page(card_url){
|
||||
});
|
||||
}
|
||||
|
||||
function getcard(name,cover,title,type){
|
||||
function getcard(name, cover, title, type) {
|
||||
|
||||
return `<div class="moment_card_item" pid="${name}" type="${type}">
|
||||
<a>
|
||||
@@ -127,31 +127,25 @@ function getcard(name,cover,title,type){
|
||||
</div>`
|
||||
}
|
||||
|
||||
$(document).on('click', '.de_card', function() {
|
||||
var msg = "确认删除此卡片?";
|
||||
$(document).on('click', '.de_card', function () {
|
||||
var num = $('.moment_card_item').length;
|
||||
if (confirm(msg)==true){
|
||||
$(this).parents('.moment_card_item').remove();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(num == 1){
|
||||
$(this).parents('.moment_card_item').remove();
|
||||
if (num == 1) {
|
||||
$(".show_card").hide();
|
||||
}
|
||||
});
|
||||
|
||||
//图文编辑 返回图文编辑区域
|
||||
$('body').on('click', '.moment_image_type a', function() {
|
||||
$('body').on('click', '.moment_image_type a', function () {
|
||||
back_image_temp();
|
||||
$('.push_item').attr('type','image');
|
||||
$('.push_item').attr('type', 'image');
|
||||
});
|
||||
|
||||
//发布音乐--------------------------------------------------------------
|
||||
$('body').on('click', '.moment_audio_type a', function() {
|
||||
$('.push_item').attr('type','audio');
|
||||
$('body').on('click', '.moment_audio_type a', function () {
|
||||
$('.push_item').attr('type', 'audio');
|
||||
main_content = $('.moment_type_main');
|
||||
if($('.add_audio_box').length > 0){
|
||||
if ($('.add_audio_box').length > 0) {
|
||||
return false;
|
||||
}
|
||||
remove_image_temp();
|
||||
@@ -180,57 +174,57 @@ $('body').on('click', '.moment_audio_type a', function() {
|
||||
});
|
||||
|
||||
//音乐和视频上传
|
||||
$(document).on('change','#moment_img_up',function(){
|
||||
if($('#moment_img_up').val() == '')
|
||||
$(document).on('change', '#moment_img_up', function () {
|
||||
if ($('#moment_img_up').val() == '')
|
||||
return;
|
||||
var f = this.files[0];
|
||||
var formData = new FormData();
|
||||
formData.append('file',f);
|
||||
formData.append('file', f);
|
||||
const policyName = Theme.moments.policy_name;
|
||||
const groupName = Theme.moments.group_name;
|
||||
policyName && formData.append('policyName',policyName)
|
||||
groupName && formData.append('groupName',groupName)
|
||||
policyName && formData.append('policyName', policyName)
|
||||
groupName && formData.append('groupName', groupName)
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: `${Theme.moments.attachments_upload_api}`,
|
||||
dataType: 'json',
|
||||
dataType: 'json',
|
||||
data: formData,
|
||||
processData : false,
|
||||
contentType : false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('上传中...');
|
||||
$('.m_media_left i').remove();
|
||||
$('.m_media_left').append("<div class='up_loading' uk-spinner='ratio: .6'></div>");
|
||||
var imged = $('.m_media_left img');
|
||||
if(imged.length > 0){
|
||||
if (imged.length > 0) {
|
||||
imged.remove();
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
success: function (data) {
|
||||
var thum = data.metadata.annotations["storage.halo.run/uri"] || data.metadata.annotations["storage.halo.run/external-link"]
|
||||
$('.m_media_left .up_loading').remove();
|
||||
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="'+thum+'">');
|
||||
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="' + thum + '">');
|
||||
cocoMessage.success('上传成功');
|
||||
$('input#moment_video_url').val(thum)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('body').on('click', '.audio_choose a', function() {
|
||||
$('body').on('click', '.audio_choose a', function () {
|
||||
var text = '# 请插入封面,歌名以及歌曲外链';
|
||||
var type = $(this).attr('au_type');
|
||||
if(type != 'local'){
|
||||
if (type != 'local') {
|
||||
var text = '# 请输入歌曲ID';
|
||||
}
|
||||
$('.edit_audio_box .tips').text(text);
|
||||
});
|
||||
|
||||
//发布视频--------------------------------------------------------------
|
||||
$('body').on('click', '.moment_video_type a', function() {
|
||||
$('.push_item').attr('type','video');
|
||||
$('body').on('click', '.moment_video_type a', function () {
|
||||
$('.push_item').attr('type', 'video');
|
||||
main_content = $('.moment_type_main');
|
||||
if($('.add_video_box').length > 0){
|
||||
if ($('.add_video_box').length > 0) {
|
||||
return false;
|
||||
}
|
||||
remove_image_temp();
|
||||
@@ -265,10 +259,10 @@ $('body').on('click', '.moment_video_type a', function() {
|
||||
|
||||
});
|
||||
|
||||
$('body').on('click', '.video_choose a', function() {
|
||||
$('body').on('click', '.video_choose a', function () {
|
||||
var text = '# 请上传视频或填写视频外链';
|
||||
var type = $(this).attr('vi_type');
|
||||
if(type == 'bili'){
|
||||
if (type == 'bili') {
|
||||
var text = '# 请输入B站视频bvid';
|
||||
}
|
||||
$('.edit_video_box .tips').text(text);
|
||||
@@ -279,75 +273,91 @@ $('body').on('click', '.video_choose a', function() {
|
||||
|
||||
//});
|
||||
|
||||
//删除片刻文章
|
||||
$('body').on('click', '.control_delete_post', function() {
|
||||
var pid = $(this).parent().attr('pid');
|
||||
//删除片刻
|
||||
// 全局变量暂存当前要删除的 ID
|
||||
window.currentDeletePid = null;
|
||||
|
||||
var msg = "确定删除瞬间?";
|
||||
if (confirm(msg)==true){
|
||||
$.ajax({
|
||||
type: 'DELETE',
|
||||
dataType: 'json',
|
||||
url: `/apis/${Theme.moments.api}/v1alpha1/moments/`+pid,
|
||||
contentType: "application/json",
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('处理中..');
|
||||
},
|
||||
success: function (data) {
|
||||
cocoMessage.success('删除成功');
|
||||
setTimeout(()=>{
|
||||
$(`#post-${pid}`)[0].remove()
|
||||
},1000)
|
||||
},
|
||||
error: function (request) {
|
||||
if(request.status){
|
||||
cocoMessage.error('瞬间不存在或已删除');
|
||||
}else{
|
||||
cocoMessage.error('删除失败');
|
||||
}
|
||||
console.log(request)
|
||||
},
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
// 删除片刻文章 - 打开弹窗
|
||||
$('body').on('click', '.control_delete_post', function () {
|
||||
window.currentDeletePid = $(this).parent().attr('pid');
|
||||
openModal('删除确认', '确定删除瞬间?该条数据将被永久移除。', 'red');
|
||||
});
|
||||
|
||||
// 点击取消按钮 - 关闭弹窗
|
||||
$('body').on('click', '#momentsCancelDeleteBtn', function (e) {
|
||||
$('#momentsDeleteModal').fadeOut(200);
|
||||
window.currentDeletePid = null;
|
||||
});
|
||||
|
||||
// 点击确认删除 - 执行 AJAX
|
||||
$('body').on('click', '#momentsConfirmDeleteBtn', function () {
|
||||
var pid = window.currentDeletePid;
|
||||
if (!pid) return;
|
||||
let closeLoading = cocoMessage.loading('正在删除...');
|
||||
$('.moments-btn-cancel, .moments-btn-confirm').prop('disabled', true);
|
||||
$.ajax({
|
||||
type: 'DELETE',
|
||||
dataType: 'json',
|
||||
url: `/apis/${Theme.moments.api}/v1alpha1/moments/` + pid,
|
||||
contentType: "application/json",
|
||||
success: function (data) {
|
||||
$('#momentsDeleteModal').fadeOut(200);
|
||||
closeLoading?.()
|
||||
cocoMessage.success('删除成功');
|
||||
window.currentDeletePid = null;
|
||||
const $post = $(`#post-${pid}`);
|
||||
if (!$post.length) return;
|
||||
$post.addClass('moments-delete-disperse');
|
||||
setTimeout(() => $post.remove(), 800);
|
||||
},
|
||||
error: function (request) {
|
||||
if (request.status) {
|
||||
closeLoading?.()
|
||||
cocoMessage.error('瞬间不存在或已删除');
|
||||
} else {
|
||||
closeLoading?.()
|
||||
cocoMessage.error('删除失败');
|
||||
}
|
||||
console.log(request)
|
||||
$('.moments-btn-cancel, .moments-btn-confirm').prop('disabled', false);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
//置顶片刻
|
||||
$('body').on('click', '.sticky_btn', function() {
|
||||
$('body').on('click', '.sticky_btn', function () {
|
||||
var pid = $(this).parent().attr('pid');
|
||||
var stick = $(this).hasClass('stick');
|
||||
if(stick){
|
||||
if (stick) {
|
||||
var state = 'stick';
|
||||
} else {
|
||||
var state = 'unstick';
|
||||
}
|
||||
var msg = "确定执行此操作?";
|
||||
if (confirm(msg)==true){
|
||||
if (confirm(msg) == true) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: Theme.ajaxurl,
|
||||
data: {
|
||||
'action':'stick_moment',
|
||||
pid:pid,
|
||||
state:state
|
||||
'action': 'stick_moment',
|
||||
pid: pid,
|
||||
state: state
|
||||
},
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('处理中..');
|
||||
},
|
||||
success: function (data) {
|
||||
if(data.state == '1'){
|
||||
if (data.state == '1') {
|
||||
cocoMessage.success(data.msg);
|
||||
if(data.type == 'stick'){
|
||||
var post_item = $('#post-'+pid+'.moment_item');
|
||||
if (data.type == 'stick') {
|
||||
var post_item = $('#post-' + pid + '.moment_item');
|
||||
post_item.remove();
|
||||
$('.moment_list').prepend(post_item.prop('outerHTML'));
|
||||
$('#post-'+pid+'.moment_item').find('.post_footer_meta .right').prepend('<span class="sticky_icon"><i class="ri-fire-line"></i> TOP</span>');
|
||||
$('#post-'+pid+'.moment_item').find('.post_control').remove();
|
||||
$('#post-' + pid + '.moment_item').find('.post_footer_meta .right').prepend('<span class="sticky_icon"><i class="ri-fire-line"></i> TOP</span>');
|
||||
$('#post-' + pid + '.moment_item').find('.post_control').remove();
|
||||
} else {
|
||||
$('#post-'+pid+'.moment_item').find('.sticky_icon').remove();
|
||||
$('#post-' + pid + '.moment_item').find('.sticky_icon').remove();
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -362,46 +372,48 @@ $('body').on('click', '.sticky_btn', function() {
|
||||
});
|
||||
|
||||
//编辑片刻
|
||||
$('body').on('click', '.control_edit_post', function() {
|
||||
$(".loca_text").empty().attr("state",'0');
|
||||
$('body').on('click', '.control_edit_post', function () {
|
||||
$('.push_close, .push_item').prop('disabled', true);
|
||||
let closeLoading = null;
|
||||
$(".loca_text").empty().attr("state", '0');
|
||||
$(".loca_text").attr("uk-tooltip", "title:获取位置; pos: top; offset:2;");
|
||||
$('.moment_image_type a').click();
|
||||
$('#topic_content').val('');
|
||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
|
||||
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
|
||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible', 'PUBLIC');
|
||||
$(".simi a").children().css({ "background": "#e3efe7", "color": "#66c187" });
|
||||
$('.t_media_item').remove();
|
||||
$('#moment_audio_api').remove();
|
||||
var pid = $(this).parent().attr('pid');
|
||||
$('.push_item').html('<i class="ri-edit-box-line"></i>更新');
|
||||
$('.push_item').attr('pid',pid).attr('action','update')
|
||||
$('.push_item').attr('pid', pid).attr('action', 'update')
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: `/apis/${Theme.moments.api}/v1alpha1/moments/`+pid,
|
||||
url: `/apis/${Theme.moments.api}/v1alpha1/moments/` + pid,
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('数据拉取中');
|
||||
closeLoading = cocoMessage.loading('数据拉取中...');
|
||||
//$('.t_form').before('<div class="edit_overlay"></div>');
|
||||
},
|
||||
success: function (data) {
|
||||
$('.push_item').attr('version',data.metadata.version)
|
||||
$('.push_item').attr('owner',data.spec.owner)
|
||||
$('.push_item').attr('releaseTime',data.spec.releaseTime)
|
||||
$('.push_item').attr('version', data.metadata.version)
|
||||
$('.push_item').attr('owner', data.spec.owner)
|
||||
$('.push_item').attr('releaseTime', data.spec.releaseTime)
|
||||
//发布状态
|
||||
if(data.spec.visible == 'PRIVATE'){
|
||||
$(".simi a").html('<i class="ri-lock-line"></i>').attr('visible','PRIVATE');
|
||||
$(".simi a").children().css({"background":"#ddd","color":"#c6c6c6"});
|
||||
if (data.spec.visible == 'PRIVATE') {
|
||||
$(".simi a").html('<i class="ri-lock-line"></i>').attr('visible', 'PRIVATE');
|
||||
$(".simi a").children().css({ "background": "#ddd", "color": "#c6c6c6" });
|
||||
} else {
|
||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
|
||||
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
|
||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible', 'PUBLIC');
|
||||
$(".simi a").children().css({ "background": "#e3efe7", "color": "#66c187" });
|
||||
}
|
||||
var medium = data.spec.content.medium;
|
||||
var tags = data.spec.tags
|
||||
if(medium.length > 0){
|
||||
if (medium.length > 0) {
|
||||
var type = medium[0].type;
|
||||
}
|
||||
let content = data.spec.content.html;
|
||||
if(content == null){
|
||||
if (content == null) {
|
||||
content = '';
|
||||
}else{
|
||||
} else {
|
||||
|
||||
// 创建一个新的HTML解析器对象
|
||||
var parser = new DOMParser();
|
||||
@@ -423,16 +435,15 @@ $('body').on('click', '.control_edit_post', function() {
|
||||
}
|
||||
|
||||
$('#topic_content').val(content);
|
||||
if(tags.length > 0){
|
||||
if (tags.length > 0) {
|
||||
$('.t_cat_toogle span').text(tags[0]);
|
||||
}
|
||||
|
||||
if(data.metadata.annotations?.mylocal!=null && data.metadata.annotations?.mylocal!='') {
|
||||
if (data.metadata.annotations?.mylocal != null && data.metadata.annotations?.mylocal != '') {
|
||||
$('.loca_text').text(data.metadata.annotations?.mylocal);
|
||||
}
|
||||
|
||||
switch(type)
|
||||
{
|
||||
switch (type) {
|
||||
case "PHOTO":
|
||||
//if(data.moment_data.length > 0){ 文字片刻没有数据
|
||||
edit_image(data);
|
||||
@@ -448,35 +459,42 @@ $('body').on('click', '.control_edit_post', function() {
|
||||
edit_video(data);
|
||||
break;
|
||||
}
|
||||
cocoMessage.success('拉取完成');
|
||||
closeLoading();
|
||||
cocoMessage.success('数据拉取完成');
|
||||
$('.push_close, .push_item').prop('disabled', false);
|
||||
},
|
||||
error: function () {
|
||||
closeLoading();
|
||||
cocoMessage.error('数据拉取失败');
|
||||
$('.push_close').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//发布片刻重置
|
||||
$('body').on('click', '.normal_edit,.center .mobile_edit', function() {
|
||||
$('.push_item').attr('action','push').html('<i class="ri-send-plane-2-line"></i>发布');
|
||||
$('body').on('click', '.normal_edit,.center .mobile_edit', function () {
|
||||
$('.push_item').attr('action', 'push').html('<i class="ri-send-plane-2-line"></i>发布');
|
||||
$('.moment_image_type a').click();
|
||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
|
||||
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
|
||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible', 'PUBLIC');
|
||||
$(".simi a").children().css({ "background": "#e3efe7", "color": "#66c187" });
|
||||
$('#topic_content').val('');
|
||||
$(".loca_text").empty().attr("state",'0');
|
||||
$(".loca_text").empty().attr("state", '0');
|
||||
$('#set_local, [name="set_local"]').val('');
|
||||
$('.t_media_item').remove();
|
||||
$('.t_cat_toogle span').text('叽里咕噜');
|
||||
});
|
||||
|
||||
//编辑片刻类型(已兼容图片+视频)------------------------------------------------------------------------------
|
||||
function edit_image(data){
|
||||
function edit_image(data) {
|
||||
var m_data = data.spec.content.medium;
|
||||
$('.t_media_item').remove();
|
||||
$('.moment_image_type a').click();
|
||||
|
||||
if(m_data && m_data.length > 0){
|
||||
if (m_data && m_data.length > 0) {
|
||||
// reverse() 是为了配合 prepend,确保显示顺序与发布时一致
|
||||
var new_data = [...m_data].reverse();
|
||||
|
||||
$.each(new_data, function(index, value) {
|
||||
$.each(new_data, function (index, value) {
|
||||
var src = value.url;
|
||||
var type = value.originType || ""; // 获取 MIME 类型
|
||||
var mediaInnerHtml = '';
|
||||
@@ -485,9 +503,9 @@ function edit_image(data){
|
||||
// 1. 检查 MIME 类型是否以 video/ 开头
|
||||
// 2. 检查文件名后缀是否为常见的视频格式(防止 originType 丢失的情况)
|
||||
var isVideo = type.startsWith('video/') ||
|
||||
src.toLowerCase().endsWith('.mp4') ||
|
||||
src.toLowerCase().endsWith('.webm') ||
|
||||
src.toLowerCase().endsWith('.mov');
|
||||
src.toLowerCase().endsWith('.mp4') ||
|
||||
src.toLowerCase().endsWith('.webm') ||
|
||||
src.toLowerCase().endsWith('.mov');
|
||||
|
||||
if (isVideo) {
|
||||
// 如果是视频,使用 video 标签预览
|
||||
@@ -508,24 +526,24 @@ function edit_image(data){
|
||||
}
|
||||
}
|
||||
|
||||
function edit_video(data){
|
||||
function edit_video(data) {
|
||||
var m_data = data.spec.content.medium[0];
|
||||
var type = m_data.originType;
|
||||
//var url = m_data.url;
|
||||
$('.moment_video_type a').click();
|
||||
|
||||
var add = setInterval(function() {
|
||||
if(type != 'video/bili'){
|
||||
var add = setInterval(function () {
|
||||
if (type != 'video/bili') {
|
||||
var url = m_data.url;
|
||||
|
||||
$('input#moment_video_url').val(url);
|
||||
if(url !== ''){
|
||||
if (url !== '') {
|
||||
$('.m_media_left i').remove();
|
||||
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="'+url+'">');
|
||||
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="' + url + '">');
|
||||
}
|
||||
|
||||
} else if(type == 'video/bili') {
|
||||
if($('.video_choose').length > 0){
|
||||
} else if (type == 'video/bili') {
|
||||
if ($('.video_choose').length > 0) {
|
||||
var bvid = m_data.url;
|
||||
UIkit.switcher('.video_choose').show(1);
|
||||
$('input#moment_video_bili').val(bvid);
|
||||
@@ -533,26 +551,26 @@ function edit_video(data){
|
||||
|
||||
}
|
||||
|
||||
if($('.edit_video_box').length == 1){
|
||||
if ($('.edit_video_box').length == 1) {
|
||||
clearInterval(add);
|
||||
}
|
||||
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function edit_audio(data){
|
||||
function edit_audio(data) {
|
||||
var m_data = data.spec.content.medium[0];
|
||||
var type = m_data.originType;
|
||||
$('.moment_audio_type a').click();
|
||||
var add = setInterval(function() {
|
||||
if(type == 'audio/netease' || type == 'audio/tencent' || type == 'audio/kugou' || type == 'audio/kuwo'){
|
||||
var add = setInterval(function () {
|
||||
if (type == 'audio/netease' || type == 'audio/tencent' || type == 'audio/kugou' || type == 'audio/kuwo') {
|
||||
var result = type.substring(type.indexOf("audio/") + 6);
|
||||
if($('.audio_choose').length > 0){
|
||||
if ($('.audio_choose').length > 0) {
|
||||
var n_id = m_data.url;
|
||||
var index = $('.audio_choose li.'+result+'').index();
|
||||
var index = $('.audio_choose li.' + result + '').index();
|
||||
UIkit.switcher('.audio_choose').show(index);
|
||||
$('.edit_audio_box .tips').text('# 请输入歌曲ID');
|
||||
$('.'+result+'_audio').append('<input type="text" placeholder="歌曲ID" name="moment_audio_api" id="moment_audio_api" class="required" required="required">');
|
||||
$('.' + result + '_audio').append('<input type="text" placeholder="歌曲ID" name="moment_audio_api" id="moment_audio_api" class="required" required="required">');
|
||||
$('input#moment_audio_api').val(n_id);
|
||||
}
|
||||
} else {
|
||||
@@ -562,7 +580,7 @@ function edit_audio(data){
|
||||
$('.edit_audio_box .tips').text('# 请插入歌曲外链');
|
||||
$('input#moment_audio_url').val(url);
|
||||
}
|
||||
if($('.edit_audio_box').length == 1){
|
||||
if ($('.edit_audio_box').length == 1) {
|
||||
clearInterval(add);
|
||||
}
|
||||
|
||||
@@ -574,15 +592,15 @@ function edit_card(data) {
|
||||
$('.card_sortble .moment_card_item').remove();
|
||||
$('.moment_card_type a').click();
|
||||
var pid = data.metadata.name;
|
||||
var card_list = $("#post-"+pid+"").find('.moment_card_item');
|
||||
var add = setInterval(function() {
|
||||
var card_list = $("#post-" + pid + "").find('.moment_card_item');
|
||||
var add = setInterval(function () {
|
||||
$('.show_card').show();
|
||||
$.each(m_data, function(index, value) {
|
||||
$.each(m_data, function (index, value) {
|
||||
var srcValue = card_list.eq(index).find('img').attr('src');
|
||||
var h4Text = card_list.eq(index).find('h4').text();
|
||||
$('.card_sortble').append(getcard(value.url,srcValue,h4Text,value.originType));
|
||||
var h4Text = card_list.eq(index).find('h4').text();
|
||||
$('.card_sortble').append(getcard(value.url, srcValue, h4Text, value.originType));
|
||||
});
|
||||
if($('.edit_card_box').length == 1){
|
||||
if ($('.edit_card_box').length == 1) {
|
||||
clearInterval(add);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
+2
-1
@@ -3541,7 +3541,8 @@ iframe[uk-cover] {
|
||||
.uk-sortable-drag {
|
||||
position: fixed !important;
|
||||
z-index: 1050 !important;
|
||||
pointer-events: none
|
||||
width: auto !important;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.uk-sortable-placeholder {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<th:block th:fragment="footer">
|
||||
<th:block th:with="customJsVersion='1.2.5-3'">
|
||||
<th:block th:with="customJsVersion='1.2.5-4'">
|
||||
|
||||
<!-- 奇遇容器 -->
|
||||
<div class="center-img-container" id="centerImgContainer">
|
||||
@@ -41,7 +41,8 @@
|
||||
<div class="pixar-notice-image-area">
|
||||
<p class="pixar-notice-caption">
|
||||
您确定要退出登录吗?<br>
|
||||
退出后您仍能以访客身份翻阅本日记簿...
|
||||
请注意!<br>
|
||||
未保存的内容将会被清空!
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -64,6 +65,33 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 删除确认弹窗 -->
|
||||
<div class="moments-modal-overlay" id="momentsDeleteModal" style="display: none;">
|
||||
<div class="moments-card-widget">
|
||||
<div class="moments-card-header">
|
||||
<!-- 新增这一层包裹 -->
|
||||
<div class="moments-header-row">
|
||||
<div class="moments-icon-wrapper">
|
||||
<svg aria-hidden="true" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"
|
||||
fill="none">
|
||||
<path
|
||||
d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"
|
||||
stroke-linejoin="round" stroke-linecap="round"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="moments-text-content">
|
||||
<span class="moments-title-text"></span>
|
||||
<p class="moments-message-text"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="moments-button-group">
|
||||
<button class="moments-btn-confirm" type="button" id="momentsConfirmDeleteBtn">确认</button>
|
||||
<button class="moments-btn-cancel" type="button" id="momentsCancelDeleteBtn">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script th:if="${pluginFinder.available('plugin-douban')}"
|
||||
th:src="@{/plugins/plugin-douban/assets/static/db.min.js(v=${customJsVersion})}" class="pjax"></script>
|
||||
<script th:src="@{/assets/libs/axios/axios.min.js(v=${customJsVersion})}" id="axios.min-js"></script>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-3'}">
|
||||
<th:block th:fragment="head" th:with="customJsVersion=${'1.2.5-4'}">
|
||||
<th:block th:replace="~{'modules/variables/msg'}" />
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="user_pannel round12" uk-dropdown="mode: click;toggle:#top_ava;pos:bottom-right;animation:uk-animation-slide-top-small">
|
||||
<div class="inner">
|
||||
<a href="/console" target="_blank" pjax="exclude"><i class="ri-function-line"></i>管理面板</a>
|
||||
<a class="logout" href="javascript:void(0);" onclick="showPixarCard()"><i class="ri-logout-circle-r-line"></i>退出登录</a>
|
||||
<a class="logout" href="javascript:void(0);" onclick="open_logout_box()"><i class="ri-logout-circle-r-line"></i>退出登录</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -47,7 +47,7 @@
|
||||
<div class="user_pannel round12" uk-dropdown="mode: click;toggle:#top_ava2;pos:bottom-right;animation:uk-animation-slide-top-small">
|
||||
<div class="inner">
|
||||
<a href="/console" target="_blank" pjax="exclude"><i class="ri-function-line"></i>管理面板</a>
|
||||
<a class="logout" href="javascript:void(0);" onclick="showPixarCard()"><i class="ri-logout-circle-r-line"></i>退出登录</a>
|
||||
<a class="logout" href="javascript:void(0);" onclick="open_logout_box()"><i class="ri-logout-circle-r-line"></i>退出登录</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<div class="form_footer">
|
||||
<div class="admin_tool">
|
||||
<a href="/console" target="_blank"><i class="ri-function-line"></i> 管理</a>
|
||||
<a class="logout" href="javascript:void(0);" onclick="showPixarCard()"><i class="ri-logout-circle-r-line"></i> 登出</a>
|
||||
<a class="logout" href="javascript:void(0);" onclick="open_logout_box()"><i class="ri-logout-circle-r-line"></i> 登出</a>
|
||||
</div>
|
||||
<div class="moment_sure">
|
||||
<button class="uk-modal-close push_close">取消</button>
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ spec:
|
||||
issues: "https://github.com/chengzhongxue/halo-theme-pix/issues"
|
||||
settingName: "theme-pix-setting"
|
||||
configMapName: "theme-pix-configMap"
|
||||
version: "1.2.5-3"
|
||||
version: "1.2.5-4"
|
||||
require: ">=2.20.0"
|
||||
customTemplates:
|
||||
page:
|
||||
|
||||
Reference in New Issue
Block a user