This commit is contained in:
杜恒 2021-05-07 10:26:04 +08:00
parent 976049b119
commit c52402ec25
15 changed files with 109 additions and 113 deletions

View File

@ -44,7 +44,7 @@ document.addEventListener('DOMContentLoaded', () => {
/* 动态背景 */ /* 动态背景 */
{ {
if (!Joe.IS_MOBILE && Joe.DYNAMIC_BACKGROUND !== 'off' && Joe.DYNAMIC_BACKGROUND && !Joe.WALLPAPER_BACKGROUND_PC) { if (!Joe.IS_MOBILE && Joe.DYNAMIC_BACKGROUND !== 'off' && Joe.DYNAMIC_BACKGROUND && !Joe.WALLPAPER_BACKGROUND_PC) {
$.getScript(`/usr/themes/Joe/assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`); $.getScript(window.Joe.THEME_URL + `assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`);
} }
} }
@ -500,16 +500,17 @@ document.addEventListener('DOMContentLoaded', () => {
{ {
if ($('.joe_owo__contain').length > 0 && $('.joe_owo__target').length > 0) { if ($('.joe_owo__contain').length > 0 && $('.joe_owo__target').length > 0) {
$.ajax({ $.ajax({
url: '/usr/themes/Joe/assets/json/joe.owo.json', url: window.Joe.THEME_URL + 'assets/json/joe.owo.json',
dataType: 'json', dataType: 'json',
success(res) { success(res) {
let barStr = ''; let barStr = '';
let scrollStr = ''; let scrollStr = '';
for (let key in res) { for (let key in res) {
barStr += `<div class="item" data-index="${res[key].index}">${key}</div>`; const item = res[key];
barStr += `<div class="item" data-type="${key}">${key}</div>`;
scrollStr += ` scrollStr += `
<ul class="scroll" data-index="${res[key].index}"> <ul class="scroll" data-type="${key}">
${res[key].container.map(_ => `<li class="item" data-text="${_.data}">${_.icon}</li>`).join('')} ${item.map(_ => `<li class="item" data-text="${_.data}">${key === '颜文字' ? `${_.icon}` : `<img src="${window.Joe.THEME_URL + _.icon}" alt="${_.data}"/>`}</li>`).join('')}
</ul> </ul>
`; `;
} }
@ -530,15 +531,13 @@ document.addEventListener('DOMContentLoaded', () => {
$('.joe_owo__contain .box .bar .item').on('click', function (e) { $('.joe_owo__contain .box .bar .item').on('click', function (e) {
e.stopPropagation(); e.stopPropagation();
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active');
const scrollIndx = '.joe_owo__contain .box .scroll[data-index="' + $(this).attr('data-index') + '"]'; const scrollIndx = '.joe_owo__contain .box .scroll[data-type="' + $(this).attr('data-type') + '"]';
$(scrollIndx).show().siblings('.scroll').hide(); $(scrollIndx).show().siblings('.scroll').hide();
}); });
/* 点击表情,向文本框插入内容 */
$('.joe_owo__contain .scroll .item').on('click', function () { $('.joe_owo__contain .scroll .item').on('click', function () {
const text = $(this).attr('data-text'); const text = $(this).attr('data-text');
$('.joe_owo__target').insertContent(text); $('.joe_owo__target').insertContent(text);
}); });
/* 默认激活第一个 */
$('.joe_owo__contain .box .bar .item').first().click(); $('.joe_owo__contain .box .bar .item').first().click();
} }
}); });

File diff suppressed because one or more lines are too long

View File

@ -1,60 +1,60 @@
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const p = new URLSearchParams(window.location.search); const p = new URLSearchParams(window.location.search);
if (!p.get('profileRoom')) initLiveList(); if (!p.get('profileRoom')) initLiveList();
function initLiveList() { function initLiveList() {
let queryData = { let queryData = {
page: 1, page: 1,
gameId: '', gameId: '',
index: 0, index: 0,
isLoading: false, isLoading: false,
totalPage: 0 totalPage: 0
}; };
$('.joe_live__type-title .icon').on('click', function () { $('.joe_live__type-title .icon').on('click', function () {
if (queryData.isLoading) return; if (queryData.isLoading) return;
if (queryData.index === 3) queryData.index = 0; if (queryData.index === 3) queryData.index = 0;
queryData.index++; queryData.index++;
renderLiveType(); renderLiveType();
}); });
$('.joe_live__type-list').on('click', '.item', function () { $('.joe_live__type-list').on('click', '.item', function () {
if (queryData.isLoading) return; if (queryData.isLoading) return;
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active');
queryData.page = 1; queryData.page = 1;
queryData.gameId = $(this).attr('data-gameId'); queryData.gameId = $(this).attr('data-gameId');
renderLiveList(); renderLiveList();
}); });
renderLiveType(); renderLiveType();
function renderLiveType() { function renderLiveType() {
$.ajax({ $.ajax({
url: '/usr/themes/Joe/assets/json/joe.live.json', url: window.Joe.THEME_URL + 'assets/json/joe.live.json',
dataType: 'json', dataType: 'json',
success(res) { success(res) {
const item = res[queryData.index]; const item = res[queryData.index];
$('.joe_live__type-title .text').html(item.name); $('.joe_live__type-title .text').html(item.name);
let htmlStr = '<li class="item animated swing" data-gameId="">全部</li>'; let htmlStr = '<li class="item animated swing" data-gameId="">全部</li>';
item.list.forEach(_ => (htmlStr += `<li class="item animated swing" data-gameId="${_.gameId}">${_.name}</li>`)); item.list.forEach(_ => (htmlStr += `<li class="item animated swing" data-gameId="${_.gameId}">${_.name}</li>`));
$('.joe_live__type-list').html(htmlStr); $('.joe_live__type-list').html(htmlStr);
$('.joe_live__type-list .item').first().click(); $('.joe_live__type-list .item').first().click();
} }
}); });
} }
function renderLiveList() { function renderLiveList() {
window.scrollTo({ top: 0, behavior: 'smooth' }); window.scrollTo({ top: 0, behavior: 'smooth' });
queryData.isLoading = true; queryData.isLoading = true;
$('.joe_live__list').html(''); $('.joe_live__list').html('');
$.ajax({ $.ajax({
url: Joe.BASE_API, url: Joe.BASE_API,
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
data: { data: {
routeType: 'huya_list', routeType: 'huya_list',
page: queryData.page, page: queryData.page,
gameId: queryData.gameId gameId: queryData.gameId
}, },
success(res) { success(res) {
if (res.code !== 1) return; if (res.code !== 1) return;
let htmlStr = ''; let htmlStr = '';
res.data.datas.forEach(_ => { res.data.datas.forEach(_ => {
htmlStr += ` htmlStr += `
<a target="_blank" rel="noopener noreferrer nofollow" class="joe_live__list-item animated bounceIn" href="${window.location.href + '?profileRoom=' + _.profileRoom + '&title=' + _.nick}"> <a target="_blank" rel="noopener noreferrer nofollow" class="joe_live__list-item animated bounceIn" href="${window.location.href + '?profileRoom=' + _.profileRoom + '&title=' + _.nick}">
<div class="thumb"> <div class="thumb">
<i class="recommendTagName" style="display: ${_.recommendTagName ? '' : 'none'}">${_.recommendTagName}</i> <i class="recommendTagName" style="display: ${_.recommendTagName ? '' : 'none'}">${_.recommendTagName}</i>
@ -75,46 +75,46 @@ document.addEventListener('DOMContentLoaded', () => {
</div> </div>
</a> </a>
`; `;
}); });
$('.joe_live__list').html(htmlStr); $('.joe_live__list').html(htmlStr);
queryData.totalPage = res.data.totalPage; queryData.totalPage = res.data.totalPage;
initPagination(); initPagination();
}, },
complete: () => (queryData.isLoading = false) complete: () => (queryData.isLoading = false)
}); });
} }
function initPagination() { function initPagination() {
let htmlStr = ''; let htmlStr = '';
if (queryData.page != 1) { if (queryData.page != 1) {
htmlStr += ` htmlStr += `
<li class="joe_live__pagination-item" data-page="1">首页</li> <li class="joe_live__pagination-item" data-page="1">首页</li>
<li class="joe_live__pagination-item" data-page="${queryData.page - 1}"> <li class="joe_live__pagination-item" data-page="${queryData.page - 1}">
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z"/><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312.512zm-564.224-63.488c0-3.584 0-7.68.512-11.264h-.512v-714.24h.512c-.512-3.584-.512-7.168-.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-.512 11.264h.512v714.24h-.512c.512 3.584.512 7.168.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"/></svg> <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z"/><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312.512zm-564.224-63.488c0-3.584 0-7.68.512-11.264h-.512v-714.24h.512c-.512-3.584-.512-7.168-.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-.512 11.264h.512v714.24h-.512c.512 3.584.512 7.168.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"/></svg>
</li> </li>
<li class="joe_live__pagination-item" data-page="${queryData.page - 1}">${queryData.page - 1}</li> <li class="joe_live__pagination-item" data-page="${queryData.page - 1}">${queryData.page - 1}</li>
`; `;
} }
htmlStr += `<li class="joe_live__pagination-item active">${queryData.page}</li>`; htmlStr += `<li class="joe_live__pagination-item active">${queryData.page}</li>`;
if (queryData.page != queryData.totalPage) { if (queryData.page != queryData.totalPage) {
htmlStr += ` htmlStr += `
<li class="joe_live__pagination-item" data-page="${queryData.page + 1}">${queryData.page + 1}</li> <li class="joe_live__pagination-item" data-page="${queryData.page + 1}">${queryData.page + 1}</li>
<li class="joe_live__pagination-item" data-page="${queryData.page + 1}"> <li class="joe_live__pagination-item" data-page="${queryData.page + 1}">
<svg class="next" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z"/><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312.512zm-564.224-63.488c0-3.584 0-7.68.512-11.264h-.512v-714.24h.512c-.512-3.584-.512-7.168-.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-.512 11.264h.512v714.24h-.512c.512 3.584.512 7.168.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"/></svg> <svg class="next" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z"/><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312.512zm-564.224-63.488c0-3.584 0-7.68.512-11.264h-.512v-714.24h.512c-.512-3.584-.512-7.168-.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-.512 11.264h.512v714.24h-.512c.512 3.584.512 7.168.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"/></svg>
</li> </li>
`; `;
} }
if (queryData.page < queryData.totalPage) htmlStr += `<li class="joe_live__pagination-item" data-page="${queryData.totalPage}">末页</li>`; if (queryData.page < queryData.totalPage) htmlStr += `<li class="joe_live__pagination-item" data-page="${queryData.totalPage}">末页</li>`;
$('.joe_live__pagination').html(htmlStr); $('.joe_live__pagination').html(htmlStr);
} }
$('.joe_live__pagination').on('click', '.joe_live__pagination-item', function () { $('.joe_live__pagination').on('click', '.joe_live__pagination-item', function () {
const page = $(this).attr('data-page'); const page = $(this).attr('data-page');
if (!page || queryData.isLoading) return; if (!page || queryData.isLoading) return;
queryData.page = Number(page); queryData.page = Number(page);
renderLiveList(); renderLiveList();
}); });
function parseNum(num = 0) { function parseNum(num = 0) {
if (num >= 10000) return Math.round(num / 1000) / 10 + '万'; if (num >= 10000) return Math.round(num / 1000) / 10 + '万';
return num; return num;
} }
} }
}); });

File diff suppressed because one or more lines are too long

View File

@ -63,7 +63,7 @@ document.addEventListener('DOMContentLoaded', () => {
/* 激活图片预览功能 */ /* 激活图片预览功能 */
{ {
$('.joe_detail__article img:not(img.owo_image)').each(function () { $('.joe_detail__article img:not(img.owo_image)').each(function () {
$(this).wrap($(`<span data-fancybox="Joe" href="${$(this).attr('src')}"></span>`)); $(this).wrap($(`<span style="display: block;" data-fancybox="Joe" href="${$(this).attr('src')}"></span>`));
}); });
} }

View File

@ -1 +1 @@
document.addEventListener("DOMContentLoaded",()=>{const e=e=>window.btoa(unescape(encodeURIComponent(e))),t=e=>decodeURIComponent(escape(window.atob(e))),a=$(".joe_detail").attr("data-cid");$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_record",site:window.location.href},success(e){if(e.data&&"已收录"===e.data)$("#Joe_Baidu_Record").css("color","#67C23A"),$("#Joe_Baidu_Record").html("已收录");else if(Joe.BAIDU_PUSH){$("#Joe_Baidu_Record").html('<span style="color: #E6A23C">未收录,推送中...</span>');const e=setTimeout(function(){$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_push",domain:window.location.protocol+"//"+window.location.hostname,url:encodeURI(window.location.href)},success(e){e.data.error?$("#Joe_Baidu_Record").html('<span style="color: #F56C6C">推送失败,请检查!</span>'):$("#Joe_Baidu_Record").html('<span style="color: #67C23A">推送成功!</span>')}}),clearTimeout(e)},1e3)}else{const e=`https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;$("#Joe_Baidu_Record").html(`<a target="_blank" href="${e}" rel="noopener noreferrer nofollow" style="color: #F56C6C">未收录,提交收录</a>`)}}}),Prism.highlightAll(),$("pre[class*='language-']").each(function(e,t){let a=$(t).find("code[class*='language-']").text(),o=$('<span class="copy"><i class="fa fa-clone"></i></span>');new ClipboardJS(o[0],{text:()=>a}).on("success",()=>Qmsg.success("复制成功!")),$(t).append(o)}),$(".joe_detail__article img:not(img.owo_image)").each(function(){$(this).wrap($(`<span data-fancybox="Joe" href="${$(this).attr("src")}"></span>`))}),$(".joe_detail__article a:not(.joe_detail__article-anote)").each(function(){$(this).attr({target:"_blank",rel:"noopener noreferrer nofollow"})});{let o=localStorage.getItem(e("views"))?JSON.parse(t(localStorage.getItem(e("views")))):[];const i=o.includes(a);i||$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"handle_views",cid:a},success(t){if(1!==t.code)return;$("#Joe_Article_Views").html(`${t.data.views} 阅读`),o.push(a);const i=e("views"),s=e(JSON.stringify(o));localStorage.setItem(i,s)}})}{let o=localStorage.getItem(e("agree"))?JSON.parse(t(localStorage.getItem(e("agree")))):[];o.includes(a)?$(".joe_detail__agree .icon-1").addClass("active"):$(".joe_detail__agree .icon-2").addClass("active");let i=!1;$(".joe_detail__agree .icon").on("click",function(){if(i)return;i=!0,o=localStorage.getItem(e("agree"))?JSON.parse(t(localStorage.getItem(e("agree")))):[];let s=o.includes(a);$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"handle_agree",cid:a,type:s?"disagree":"agree"},success(t){if(1!==t.code)return;if($(".joe_detail__agree .text").html(t.data.agree),s){const e=o.findIndex(e=>e===a);o.splice(e,1),$(".joe_detail__agree .icon-1").removeClass("active"),$(".joe_detail__agree .icon-2").addClass("active"),$(".joe_detail__agree .icon").removeClass("active")}else o.push(a),$(".joe_detail__agree .icon-2").removeClass("active"),$(".joe_detail__agree .icon-1").addClass("active"),$(".joe_detail__agree .icon").addClass("active");const i=e("agree"),n=e(JSON.stringify(o));localStorage.setItem(i,n)},complete(){i=!1}})})}$(".joe_comment .joe_pagination a").each((e,t)=>{const a=$(t).attr("href");a&&a.includes("#")&&$(t).attr("href",a.replace("#comments","?scroll=joe_comment"))});{let e=!1;$(".joe_detail__article-protected").on("submit",function(t){t.preventDefault();const o=$(this).attr("action")+"&time="+ +new Date,i=$(this).find('input[type="password"]').val();if(""===i.trim())return Qmsg.info("请输入访问密码!");e||(e=!0,$.ajax({url:o,type:"POST",data:{cid:a,protectPassword:i},dataType:"text",success(t){let a=[],o="";a=$(t).contents(),Array.from(a).forEach(e=>{"container"===e.parentNode.className&&(o=e)}),/Joe/.test(t)?location.reload():(Qmsg.warning(o.textContent.trim()||""),e=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"))}}))})}if($(".joe_detail__article-video").length>0){const e=$(".joe_detail__article-video .play iframe").attr("data-player");$(".joe_detail__article-video .episodes .item").on("click",function(){$(this).addClass("active").siblings().removeClass("active");const t=$(this).attr("data-src");$(".joe_detail__article-video .play iframe").attr({src:e+t})}),$(".joe_detail__article-video .episodes .item").first().click()}}),window.addEventListener("load",function(){{const e=new URLSearchParams(location.search).get("scroll");if(e){const t=$(".joe_header").height();let a=null;if(a=$("#"+e).length>0?$("#"+e):$("."+e),a&&a.length>0){const e=a.offset().top-t-15;window.scrollTo({top:e,behavior:"smooth"})}}}}); document.addEventListener("DOMContentLoaded",()=>{const e=e=>window.btoa(unescape(encodeURIComponent(e))),t=e=>decodeURIComponent(escape(window.atob(e))),a=$(".joe_detail").attr("data-cid");$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_record",site:window.location.href},success(e){if(e.data&&"已收录"===e.data)$("#Joe_Baidu_Record").css("color","#67C23A"),$("#Joe_Baidu_Record").html("已收录");else if(Joe.BAIDU_PUSH){$("#Joe_Baidu_Record").html('<span style="color: #E6A23C">未收录,推送中...</span>');const e=setTimeout(function(){$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_push",domain:window.location.protocol+"//"+window.location.hostname,url:encodeURI(window.location.href)},success(e){e.data.error?$("#Joe_Baidu_Record").html('<span style="color: #F56C6C">推送失败,请检查!</span>'):$("#Joe_Baidu_Record").html('<span style="color: #67C23A">推送成功!</span>')}}),clearTimeout(e)},1e3)}else{const e=`https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;$("#Joe_Baidu_Record").html(`<a target="_blank" href="${e}" rel="noopener noreferrer nofollow" style="color: #F56C6C">未收录,提交收录</a>`)}}}),Prism.highlightAll(),$("pre[class*='language-']").each(function(e,t){let a=$(t).find("code[class*='language-']").text(),o=$('<span class="copy"><i class="fa fa-clone"></i></span>');new ClipboardJS(o[0],{text:()=>a}).on("success",()=>Qmsg.success("复制成功!")),$(t).append(o)}),$(".joe_detail__article img:not(img.owo_image)").each(function(){$(this).wrap($(`<span style="display: block;" data-fancybox="Joe" href="${$(this).attr("src")}"></span>`))}),$(".joe_detail__article a:not(.joe_detail__article-anote)").each(function(){$(this).attr({target:"_blank",rel:"noopener noreferrer nofollow"})});{let o=localStorage.getItem(e("views"))?JSON.parse(t(localStorage.getItem(e("views")))):[];const i=o.includes(a);i||$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"handle_views",cid:a},success(t){if(1!==t.code)return;$("#Joe_Article_Views").html(`${t.data.views} 阅读`),o.push(a);const i=e("views"),s=e(JSON.stringify(o));localStorage.setItem(i,s)}})}{let o=localStorage.getItem(e("agree"))?JSON.parse(t(localStorage.getItem(e("agree")))):[];o.includes(a)?$(".joe_detail__agree .icon-1").addClass("active"):$(".joe_detail__agree .icon-2").addClass("active");let i=!1;$(".joe_detail__agree .icon").on("click",function(){if(i)return;i=!0,o=localStorage.getItem(e("agree"))?JSON.parse(t(localStorage.getItem(e("agree")))):[];let s=o.includes(a);$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"handle_agree",cid:a,type:s?"disagree":"agree"},success(t){if(1!==t.code)return;if($(".joe_detail__agree .text").html(t.data.agree),s){const e=o.findIndex(e=>e===a);o.splice(e,1),$(".joe_detail__agree .icon-1").removeClass("active"),$(".joe_detail__agree .icon-2").addClass("active"),$(".joe_detail__agree .icon").removeClass("active")}else o.push(a),$(".joe_detail__agree .icon-2").removeClass("active"),$(".joe_detail__agree .icon-1").addClass("active"),$(".joe_detail__agree .icon").addClass("active");const i=e("agree"),n=e(JSON.stringify(o));localStorage.setItem(i,n)},complete(){i=!1}})})}$(".joe_comment .joe_pagination a").each((e,t)=>{const a=$(t).attr("href");a&&a.includes("#")&&$(t).attr("href",a.replace("#comments","?scroll=joe_comment"))});{let e=!1;$(".joe_detail__article-protected").on("submit",function(t){t.preventDefault();const o=$(this).attr("action")+"&time="+ +new Date,i=$(this).find('input[type="password"]').val();if(""===i.trim())return Qmsg.info("请输入访问密码!");e||(e=!0,$.ajax({url:o,type:"POST",data:{cid:a,protectPassword:i},dataType:"text",success(t){let a=[],o="";a=$(t).contents(),Array.from(a).forEach(e=>{"container"===e.parentNode.className&&(o=e)}),/Joe/.test(t)?location.reload():(Qmsg.warning(o.textContent.trim()||""),e=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"))}}))})}if($(".joe_detail__article-video").length>0){const e=$(".joe_detail__article-video .play iframe").attr("data-player");$(".joe_detail__article-video .episodes .item").on("click",function(){$(this).addClass("active").siblings().removeClass("active");const t=$(this).attr("data-src");$(".joe_detail__article-video .play iframe").attr({src:e+t})}),$(".joe_detail__article-video .episodes .item").first().click()}}),window.addEventListener("load",function(){{const e=new URLSearchParams(location.search).get("scroll");if(e){const t=$(".joe_header").height();let a=null;if(a=$("#"+e).length>0?$("#"+e):$("."+e),a&&a.length>0){const e=a.offset().top-t-15;window.scrollTo({top:e,behavior:"smooth"})}}}});

File diff suppressed because one or more lines are too long

View File

@ -69,9 +69,9 @@ function themeInit($self)
/* 增加自定义SiteMap功能 */ /* 增加自定义SiteMap功能 */
if (Helper::options()->JSiteMap && Helper::options()->JSiteMap !== 'off') { if (Helper::options()->JSiteMap && Helper::options()->JSiteMap !== 'off') {
if ($self->request->getRequestUri() == "/sitemap.xml" || $self->request->getRequestUri() == "/index.php/sitemap.xml") { if (strpos($self->request->getRequestUri(), 'sitemap.xml') !== false) {
$self->setThemeFile("library/sitemap.php");
$self->response->setStatus(200); $self->response->setStatus(200);
$self->setThemeFile("library/sitemap.php");
} }
} }
} }

View File

@ -2,7 +2,7 @@
/* 获取主题当前版本号 */ /* 获取主题当前版本号 */
function _getVersion() function _getVersion()
{ {
return "6.8.3"; return "6.8.4";
}; };
/* 判断是否是手机 */ /* 判断是否是手机 */

View File

@ -67,14 +67,14 @@ function _parseReply($text)
$text = preg_replace_callback( $text = preg_replace_callback(
'/\:\:\(\s*(呵呵|哈哈|吐舌|太开心|笑眼|花心|小乖|乖|捂嘴笑|滑稽|你懂的|不高兴|怒|汗|黑线|泪|真棒|喷|惊哭|阴险|鄙视|酷|啊|狂汗|what|疑问|酸爽|呀咩爹|委屈|惊讶|睡觉|笑尿|挖鼻|吐|犀利|小红脸|懒得理|勉强|爱心|心碎|玫瑰|礼物|彩虹|太阳|星星月亮|钱币|茶杯|蛋糕|大拇指|胜利|haha|OK|沙发|手纸|香蕉|便便|药丸|红领巾|蜡烛|音乐|灯泡|开心|钱|咦|呼|冷|生气|弱|吐血|狗头)\s*\)/is', '/\:\:\(\s*(呵呵|哈哈|吐舌|太开心|笑眼|花心|小乖|乖|捂嘴笑|滑稽|你懂的|不高兴|怒|汗|黑线|泪|真棒|喷|惊哭|阴险|鄙视|酷|啊|狂汗|what|疑问|酸爽|呀咩爹|委屈|惊讶|睡觉|笑尿|挖鼻|吐|犀利|小红脸|懒得理|勉强|爱心|心碎|玫瑰|礼物|彩虹|太阳|星星月亮|钱币|茶杯|蛋糕|大拇指|胜利|haha|OK|沙发|手纸|香蕉|便便|药丸|红领巾|蜡烛|音乐|灯泡|开心|钱|咦|呼|冷|生气|弱|吐血|狗头)\s*\)/is',
function ($match) { function ($match) {
return '<img class="owo_image lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="/usr/themes/Joe/assets/owo/paopao/' . str_replace('%', '', urlencode($match[1])) . '_2x.png" alt="表情"/>'; return '<img class="owo_image lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="' . Helper::options()->themeUrl . '/assets/owo/paopao/' . str_replace('%', '', urlencode($match[1])) . '_2x.png" alt="表情"/>';
}, },
$text $text
); );
$text = preg_replace_callback( $text = preg_replace_callback(
'/\:\@\(\s*(高兴|小怒|脸红|内伤|装大款|赞一个|害羞|汗|吐血倒地|深思|不高兴|无语|亲亲|口水|尴尬|中指|想一想|哭泣|便便|献花|皱眉|傻笑|狂汗|吐|喷水|看不见|鼓掌|阴暗|长草|献黄瓜|邪恶|期待|得意|吐舌|喷血|无所谓|观察|暗地观察|肿包|中枪|大囧|呲牙|抠鼻|不说话|咽气|欢呼|锁眉|蜡烛|坐等|击掌|惊喜|喜极而泣|抽烟|不出所料|愤怒|无奈|黑线|投降|看热闹|扇耳光|小眼睛|中刀)\s*\)/is', '/\:\@\(\s*(高兴|小怒|脸红|内伤|装大款|赞一个|害羞|汗|吐血倒地|深思|不高兴|无语|亲亲|口水|尴尬|中指|想一想|哭泣|便便|献花|皱眉|傻笑|狂汗|吐|喷水|看不见|鼓掌|阴暗|长草|献黄瓜|邪恶|期待|得意|吐舌|喷血|无所谓|观察|暗地观察|肿包|中枪|大囧|呲牙|抠鼻|不说话|咽气|欢呼|锁眉|蜡烛|坐等|击掌|惊喜|喜极而泣|抽烟|不出所料|愤怒|无奈|黑线|投降|看热闹|扇耳光|小眼睛|中刀)\s*\)/is',
function ($match) { function ($match) {
return '<img class="owo_image lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="/usr/themes/Joe/assets/owo/aru/' . str_replace('%', '', urlencode($match[1])) . '_2x.png" alt="表情"/>'; return '<img class="owo_image lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="' . Helper::options()->themeUrl . '/assets/owo/aru/' . str_replace('%', '', urlencode($match[1])) . '_2x.png" alt="表情"/>';
}, },
$text $text
); );

View File

@ -91,9 +91,5 @@ function _parseContent($post, $login)
$content = preg_replace('/{copy([^}]*)\/}/SU', '<joe-copy $1></joe-copy>', $content); $content = preg_replace('/{copy([^}]*)\/}/SU', '<joe-copy $1></joe-copy>', $content);
} }
echo $content; echo $content;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "typecho-joe-next", "name": "typecho-joe-next",
"version": "6.8.3", "version": "6.8.4",
"description": "A Theme Of Typecho", "description": "A Theme Of Typecho",
"main": "index.php", "main": "index.php",
"keywords": [ "keywords": [

View File

@ -4,7 +4,7 @@
<div class="play"> <div class="play">
<div class="title">播放预览</div> <div class="title">播放预览</div>
<div class="box"> <div class="box">
<iframe allowfullscreen="true" data-player="<?php echo $this->options->JCustomPlayer ? $this->options->JCustomPlayer : '/usr/themes/Joe/library/player.php?url=' ?>"></iframe> <iframe allowfullscreen="true" data-player="<?php $this->options->JCustomPlayer ? $this->options->JCustomPlayer() : Helper::options()->themeUrl('library/player.php?url=') ?>"></iframe>
</div> </div>
</div> </div>
<div class="episodes"> <div class="episodes">

View File

@ -15,8 +15,9 @@
detectIE() && (alert('当前站点不支持IE浏览器或您开启了兼容模式请使用其他浏览器访问或关闭兼容模式。'), (location.href = 'https://www.baidu.com')) detectIE() && (alert('当前站点不支持IE浏览器或您开启了兼容模式请使用其他浏览器访问或关闭兼容模式。'), (location.href = 'https://www.baidu.com'))
localStorage.getItem("data-night") && document.querySelector("html").setAttribute("data-night", "night"); localStorage.getItem("data-night") && document.querySelector("html").setAttribute("data-night", "night");
window.Joe = { window.Joe = {
THEME_URL: `<?php Helper::options()->themeUrl() ?>`,
LIVE2D: `<?php $this->options->JLive2d() ?>`, LIVE2D: `<?php $this->options->JLive2d() ?>`,
BASE_API: `<?php echo $this->options->rewrite == 0 ? '/index.php/joe/api' : '/joe/api' ?>`, BASE_API: `<?php echo $this->options->rewrite == 0 ? Helper::options()->rootUrl . '/index.php/joe/api' : Helper::options()->rootUrl . '/joe/api' ?>`,
DYNAMIC_BACKGROUND: `<?php $this->options->JDynamic_Background() ?>`, DYNAMIC_BACKGROUND: `<?php $this->options->JDynamic_Background() ?>`,
WALLPAPER_BACKGROUND_PC: `<?php $this->options->JWallpaper_Background_PC() ?>`, WALLPAPER_BACKGROUND_PC: `<?php $this->options->JWallpaper_Background_PC() ?>`,
IS_MOBILE: /windows phone|iphone|android/gi.test(window.navigator.userAgent), IS_MOBILE: /windows phone|iphone|android/gi.test(window.navigator.userAgent),

View File

@ -32,7 +32,7 @@
</div> </div>
<div class="joe_video__player joe_video__contain"> <div class="joe_video__player joe_video__contain">
<div class="joe_video__contain-title">正在播放:</div> <div class="joe_video__contain-title">正在播放:</div>
<iframe allowfullscreen="true" class="joe_video__player-play" data-player="<?php echo $this->options->JCustomPlayer ? $this->options->JCustomPlayer : '/usr/themes/Joe/library/player.php?url=' ?>"></iframe> <iframe allowfullscreen="true" class="joe_video__player-play" data-player="<?php $this->options->JCustomPlayer ? $this->options->JCustomPlayer() : Helper::options()->themeUrl('library/player.php?url=') ?>"></iframe>
</div> </div>
<?php else : ?> <?php else : ?>
<div class="joe_video__type joe_video__contain"> <div class="joe_video__type joe_video__contain">