From 93bfd92d7acebb37d6a83c72c622254b7cba982b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E6=81=92?= <2323333339@qq.com> Date: Fri, 26 Mar 2021 15:27:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/joe.global.js | 4 +- assets/js/joe.global.min.js | 2 +- assets/js/joe.index.js | 193 ++++++++++++++-------------- assets/js/joe.index.min.js | 2 +- assets/js/joe.leaving.js | 3 + assets/js/joe.leaving.min.js | 2 +- assets/js/joe.live.js | 2 + assets/js/joe.live.min.js | 2 +- assets/js/joe.post&page.js | 6 +- assets/js/joe.post&page.min.js | 2 +- assets/js/joe.short.js | 89 ++++++------- assets/js/joe.short.min.js | 2 +- assets/js/joe.video.js | 3 + assets/js/joe.video.min.js | 2 +- assets/js/joe.wallpaper.js | 2 + assets/js/joe.wallpaper.min.js | 2 +- core/function.php | 2 +- core/short.php | 39 ++++-- package.json | 2 +- typecho/write/js/joe.write.chunk.js | 5 +- typecho/write/js/joe.write.js | 5 +- 21 files changed, 195 insertions(+), 176 deletions(-) diff --git a/assets/js/joe.global.js b/assets/js/joe.global.js index e03fdb1..57248cc 100644 --- a/assets/js/joe.global.js +++ b/assets/js/joe.global.js @@ -170,6 +170,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'aside_ranking' }, success(res) { $('.joe_aside__item.ranking .joe_aside__item-title .text').html(res.title); @@ -322,7 +323,7 @@ document.addEventListener('DOMContentLoaded', () => { url, type: 'POST', data: { author, mail, text, parent }, - datatype: 'text', + dataType: 'text', success(res) { let arr = [], str = ''; @@ -449,6 +450,7 @@ document.addEventListener('DOMContentLoaded', () => { if ($('.joe_owo__contain').length > 0 && $('.joe_owo__target').length > 0) { $.ajax({ url: '/usr/themes/Joe/assets/json/joe.owo.json', + dataType: 'json', success(res) { let barStr = ''; let scrollStr = ''; diff --git a/assets/js/joe.global.min.js b/assets/js/joe.global.min.js index bf12ec8..fe8398c 100644 --- a/assets/js/joe.global.min.js +++ b/assets/js/joe.global.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",()=>{const changeURLArg=(url,arg,arg_val)=>{let pattern=arg+"=([^&]*)",replaceText=arg+"="+arg_val;if(url.match(pattern)){let tmp="/("+arg+"=)([^&]*)/gi";return url.replace(eval(tmp),replaceText)}return url.match("[?]")?url+"&"+replaceText:url+"?"+replaceText};localStorage.getItem("data-night")?($(".joe_action_item.mode .icon-1").addClass("active"),$(".joe_action_item.mode .icon-2").removeClass("active")):($("html").removeAttr("data-night"),$(".joe_action_item.mode .icon-1").removeClass("active"),$(".joe_action_item.mode .icon-2").addClass("active")),$(".joe_action_item.mode").on("click",()=>{localStorage.getItem("data-night")?($(".joe_action_item.mode .icon-1").removeClass("active"),$(".joe_action_item.mode .icon-2").addClass("active"),$("html").removeAttr("data-night"),localStorage.removeItem("data-night")):($(".joe_action_item.mode .icon-1").addClass("active"),$(".joe_action_item.mode .icon-2").removeClass("active"),$("html").attr("data-night","night"),localStorage.setItem("data-night","night"))}),Joe.IS_MOBILE||"off"===Joe.DYNAMIC_BACKGROUND||!Joe.DYNAMIC_BACKGROUND||Joe.WALLPAPER_BACKGROUND_PC||$.getScript(`/usr/themes/Joe/assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`),$(".joe_header__above-search .input").on("click",t=>{t.stopPropagation(),$(".joe_header__above-search .result").addClass("active")}),$(document).on("click",function(){$(".joe_header__above-search .result").removeClass("active")}),$(document).on("scroll",function(){$(".joe_header__above-search .result").removeClass("active")}),$(".joe_dropdown").each(function(t,e){const o=$(this).find(".joe_dropdown__menu"),a=$(e).attr("trigger")||"click",n=$(e).attr("placement")||$(this).height()||0;o.css("top",n),"hover"===a?$(this).hover(()=>$(this).addClass("active"),()=>$(this).removeClass("active")):($(this).on("click",function(t){$(this).toggleClass("active"),$(document).one("click",()=>$(this).removeClass("active")),t.stopPropagation()}),o.on("click",t=>t.stopPropagation()))});{const t=()=>(document.documentElement.scrollTop||document.body.scrollTop)>300?$(".joe_action_item.scroll").addClass("active"):$(".joe_action_item.scroll").removeClass("active");t(),$(window).on("scroll",()=>t()),$(".joe_action_item.scroll").on("click",()=>window.scrollTo({top:0,behavior:"smooth"}))}if(0!==$(".joe_aside__item.timelife").length){let t=[{title:"今日已经过去",endTitle:"小时",num:0,percent:"0%"},{title:"这周已经过去",endTitle:"天",num:0,percent:"0%"},{title:"本月已经过去",endTitle:"天",num:0,percent:"0%"},{title:"今年已经过去",endTitle:"个月",num:0,percent:"0%"}];{let e=+new Date,o=new Date((new Date).toLocaleDateString()).getTime(),a=(e-o)/1e3/60/60,n=a/24*100;t[0].num=parseInt(a),t[0].percent=parseInt(n)+"%"}{let e={0:7,1:1,2:2,3:3,4:4,5:5,6:6},o=e[(new Date).getDay()],a=o/7*100;t[1].num=parseInt(o),t[1].percent=parseInt(a)+"%"}{let e=(new Date).getFullYear(),o=(new Date).getDate(),a=(new Date).getMonth()+1,n=new Date(e,a,0).getDate(),i=o/n*100;t[2].num=o,t[2].percent=parseInt(i)+"%"}{let e=(new Date).getMonth()+1,o=e/12*100;t[3].num=e,t[3].percent=parseInt(o)+"%"}let e="";t.forEach((t,o)=>{e+=`\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t${t.title}\n\t\t\t\t\t\t\t\t${t.num}\n\t\t\t\t\t\t\t\t${t.endTitle}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
${t.percent}
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
`}),$(".joe_aside__item.timelife .joe_aside__item-contain").html(e)}if(0!==$(".joe_aside__item.weather").length){const t=$(".joe_aside__item.weather").attr("data-key"),e=$(".joe_aside__item.weather").attr("data-style"),o={1:"FFFFFF",2:"4A4A4A",3:"FFFFFF"};window.WIDGET={CONFIG:{layout:2,width:"220",height:"270",background:e,dataColor:o[e],language:"zh",key:t}},$.getScript("https://apip.weatherdt.com/standard/static/js/weather-standard.js?v=2.0")}0!==$(".joe_aside__item.ranking").length&&$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"aside_ranking"},success(t){$(".joe_aside__item.ranking .joe_aside__item-title .text").html(t.title);let e="";1===t.code?t.data.forEach((t,o)=>{e+=`\n\t\t\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\t\t${o+1}\n\t\t\t\t\t\t\t\t\t\t${t.title}\n\t\t\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t`}):e+='
  • 数据抓取异常!
  • ',$(".joe_aside__item.ranking .joe_aside__item-contain").html(e)}}),$(".joe_aside__item:last-child").css("top",$(".joe_header").height()+15),"off"!==Joe.LIVE2D&&Joe.LIVE2D&&$.getScript("https://cdn.jsdelivr.net/npm/live2d-widget@3.1.4/lib/L2Dwidget.min.js",()=>{L2Dwidget.init({model:{jsonPath:Joe.LIVE2D,scale:1},mobile:{show:!1},display:{position:"right",width:160,height:200,hOffset:70,vOffset:0}})});{const t=()=>{let t=$(window).scrollTop(),e=$(document).height(),o=$(window).height(),a=parseInt(t/(e-o)*100);a<=0&&(a=0),a>=100&&(a=100),$(".joe_header__below-progress").css("width",a+"%")};t(),$(window).on("scroll",()=>t())}$(".joe_comment__respond-type .item").on("click",function(){$(this).addClass("active").siblings().removeClass("active"),"draw"===$(this).attr("data-type")?($(".joe_comment__respond-form .body .draw").show().siblings().hide(),$("#joe_comment_draw").prop("width",$(".joe_comment__respond-form .body").width()),$(".joe_comment__respond-form").attr("data-type","draw")):($(".joe_comment__respond-form .body .text").show().siblings().hide(),$(".joe_comment__respond-form").attr("data-type","text"))}),0!==$("#joe_comment_draw").length&&(window.sketchpad=new Sketchpad({element:"#joe_comment_draw",height:300,penSize:5,color:"303133"}),$(".joe_comment__respond-form .body .draw .icon-undo").on("click",()=>window.sketchpad.undo()),$(".joe_comment__respond-form .body .draw .icon-animate").on("click",()=>window.sketchpad.animate(10)),$(".joe_comment__respond-form .body .draw .line li").on("click",function(){window.sketchpad.penSize=$(this).attr("data-line"),$(this).addClass("active").siblings().removeClass("active")}),$(".joe_comment__respond-form .body .draw .color li").on("click",function(){window.sketchpad.color=$(this).attr("data-color"),$(this).addClass("active").siblings().removeClass("active")}));{const t=$(".joe_comment__respond");$(".joe_comment__reply").on("click",function(){const e=$(this).attr("data-coid"),o=$("#"+$(this).attr("data-id"));t.find(".joe_comment__respond-form").attr("data-coid",e),o.append(t),$(".joe_comment__respond-type .item[data-type='text']").click(),$(".joe_comment__cancle").show(),window.scrollTo({top:o.offset().top-$(".joe_header").height()-15,behavior:"smooth"})}),$(".joe_comment__cancle").on("click",function(){t.find(".joe_comment__respond-form").removeAttr("data-coid"),$(".joe_comment__cancle").hide(),$(".joe_comment__title").after(t),$(".joe_comment__respond-type .item[data-type='text']").click(),window.scrollTo({top:$(".joe_comment").offset().top-$(".joe_header").height()-15,behavior:"smooth"})})}{let t=!1;$(".joe_comment__respond-form").on("submit",function(e){e.preventDefault();const o=$(".joe_comment__respond-form").attr("action")+"?time="+ +new Date,a=$(".joe_comment__respond-form").attr("data-type"),n=$(".joe_comment__respond-form").attr("data-coid"),i=$(".joe_comment__respond-form .head input[name='author']").val(),s=$(".joe_comment__respond-form .head input[name='mail']").val();let r=$(".joe_comment__respond-form .body textarea[name='text']").val();if(""===i.trim())return Qmsg.info("请输入昵称!");if(!/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(s))return Qmsg.info("请输入正确的邮箱!");if("text"===a&&""===r.trim())return Qmsg.info("请输入评论内容!");if("draw"===a){const t=$("#joe_comment_draw")[0].toDataURL("image/webp",.1);r="{!{"+t+"}!} "}t||(t=!0,$(".joe_comment__respond-form .foot .submit button").html("发送中..."),$.ajax({url:o,type:"POST",data:{author:i,mail:s,text:r,parent:n},datatype:"text",success(e){let o=[],a="";o=$(e).contents(),Array.from(o).forEach(t=>{"container"===t.parentNode.className&&(a=t)}),/Joe/.test(e)?window.location.href=changeURLArg(location.href,"scroll","joe_comment"):(Qmsg.warning(a.textContent.trim()||""),t=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"))}}))})}if(Joe.DOCUMENT_TITLE){const t=document.title;document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?document.title=Joe.DOCUMENT_TITLE:document.title=t})}$(".joe_header__above-slideicon").on("click",function(){$(".joe_header__searchout").removeClass("active"),$(".joe_header__slideout").hasClass("active")?($("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__slideout").removeClass("active")):($("body").css("overflow","hidden"),$(".joe_header__mask").addClass("active slideout"),$(".joe_header__slideout").addClass("active"))}),$(".joe_header__above-searchicon").on("click",function(){$(".joe_header__slideout").removeClass("active"),$(".joe_header__searchout").hasClass("active")?($("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__searchout").removeClass("active")):($("body").css("overflow","hidden"),$(".joe_header__mask").addClass("active"),$(".joe_header__searchout").addClass("active"))}),$(".joe_header__mask").on("click",function(){$("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__searchout").removeClass("active"),$(".joe_header__slideout").removeClass("active")}),$(".joe_header__slideout-menu .current").parents(".panel-body").show().siblings(".panel").addClass("in"),$(".joe_header__slideout-menu .panel").on("click",function(){const t=$(this).parent().parent();t.find(".panel").not($(this)).removeClass("in"),t.find(".panel-body").not($(this).siblings(".panel-body")).stop().hide("fast"),$(this).toggleClass("in").siblings(".panel-body").stop().toggle("fast")});{const t=()=>{const t=new Date(Joe.BIRTHDAY),e=+new Date,o=e-t.getTime();let a=o/864e5,n=Math.floor(a),i=24*(a-n),s=Math.floor(i),r=60*(i-s),c=Math.floor(r),d=60*(r-c),l=Math.floor(d);a=String(n).padStart(2,0),i=String(s).padStart(2,0),r=String(c).padStart(2,0),d=String(l).padStart(2,0),$(".joe_run__day").html(a),$(".joe_run__hour").html(i),$(".joe_run__minute").html(r),$(".joe_run__second").html(d)};Joe.BIRTHDAY&&/(\d{4})\/(\d{1,2})\/(\d{1,2}) (\d{1,2})\:(\d{1,2})\:(\d{1,2})/.test(Joe.BIRTHDAY)&&(t(),setInterval(t,1e3))}$(".joe_owo__contain").length>0&&$(".joe_owo__target").length>0&&$.ajax({url:"/usr/themes/Joe/assets/json/joe.owo.json",success(t){let e="",o="";for(let a in t)e+=`
    ${a}
    `,o+=`\n \n `;$(".joe_owo__contain").html(`\n
    OωO
    \n
    \n ${o}\n
    ${e}
    \n
    \n `),$(document).on("click",function(){$(".joe_owo__contain .box").stop().slideUp("fast")}),$(".joe_owo__contain .seat").on("click",function(t){t.stopPropagation(),$(this).siblings(".box").stop().slideToggle("fast")}),$(".joe_owo__contain .box .bar .item").on("click",function(t){t.stopPropagation(),$(this).addClass("active").siblings().removeClass("active");const e='.joe_owo__contain .box .scroll[data-index="'+$(this).attr("data-index")+'"]';$(e).show().siblings(".scroll").hide()}),$(".joe_owo__contain .scroll .item").on("click",function(){const t=$(this).attr("data-text");$(".joe_owo__target").insertContent(t)}),$(".joe_owo__contain .box .bar .item").first().click()}});{let t=Joe.MOTTO;t||(t="有钱终成眷属,没钱亲眼目睹"),t.includes("http")?$.ajax({url:t,dataType:"text",success:t=>$(".joe_motto").html(t)}):$(".joe_motto").html(t)}}); \ No newline at end of file +document.addEventListener("DOMContentLoaded",()=>{const changeURLArg=(url,arg,arg_val)=>{let pattern=arg+"=([^&]*)",replaceText=arg+"="+arg_val;if(url.match(pattern)){let tmp="/("+arg+"=)([^&]*)/gi";return url.replace(eval(tmp),replaceText)}return url.match("[?]")?url+"&"+replaceText:url+"?"+replaceText};localStorage.getItem("data-night")?($(".joe_action_item.mode .icon-1").addClass("active"),$(".joe_action_item.mode .icon-2").removeClass("active")):($("html").removeAttr("data-night"),$(".joe_action_item.mode .icon-1").removeClass("active"),$(".joe_action_item.mode .icon-2").addClass("active")),$(".joe_action_item.mode").on("click",()=>{localStorage.getItem("data-night")?($(".joe_action_item.mode .icon-1").removeClass("active"),$(".joe_action_item.mode .icon-2").addClass("active"),$("html").removeAttr("data-night"),localStorage.removeItem("data-night")):($(".joe_action_item.mode .icon-1").addClass("active"),$(".joe_action_item.mode .icon-2").removeClass("active"),$("html").attr("data-night","night"),localStorage.setItem("data-night","night"))}),Joe.IS_MOBILE||"off"===Joe.DYNAMIC_BACKGROUND||!Joe.DYNAMIC_BACKGROUND||Joe.WALLPAPER_BACKGROUND_PC||$.getScript(`/usr/themes/Joe/assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`),$(".joe_header__above-search .input").on("click",t=>{t.stopPropagation(),$(".joe_header__above-search .result").addClass("active")}),$(document).on("click",function(){$(".joe_header__above-search .result").removeClass("active")}),$(document).on("scroll",function(){$(".joe_header__above-search .result").removeClass("active")}),$(".joe_dropdown").each(function(t,e){const o=$(this).find(".joe_dropdown__menu"),a=$(e).attr("trigger")||"click",n=$(e).attr("placement")||$(this).height()||0;o.css("top",n),"hover"===a?$(this).hover(()=>$(this).addClass("active"),()=>$(this).removeClass("active")):($(this).on("click",function(t){$(this).toggleClass("active"),$(document).one("click",()=>$(this).removeClass("active")),t.stopPropagation()}),o.on("click",t=>t.stopPropagation()))});{const t=()=>(document.documentElement.scrollTop||document.body.scrollTop)>300?$(".joe_action_item.scroll").addClass("active"):$(".joe_action_item.scroll").removeClass("active");t(),$(window).on("scroll",()=>t()),$(".joe_action_item.scroll").on("click",()=>window.scrollTo({top:0,behavior:"smooth"}))}if(0!==$(".joe_aside__item.timelife").length){let t=[{title:"今日已经过去",endTitle:"小时",num:0,percent:"0%"},{title:"这周已经过去",endTitle:"天",num:0,percent:"0%"},{title:"本月已经过去",endTitle:"天",num:0,percent:"0%"},{title:"今年已经过去",endTitle:"个月",num:0,percent:"0%"}];{let e=+new Date,o=new Date((new Date).toLocaleDateString()).getTime(),a=(e-o)/1e3/60/60,n=a/24*100;t[0].num=parseInt(a),t[0].percent=parseInt(n)+"%"}{let e={0:7,1:1,2:2,3:3,4:4,5:5,6:6},o=e[(new Date).getDay()],a=o/7*100;t[1].num=parseInt(o),t[1].percent=parseInt(a)+"%"}{let e=(new Date).getFullYear(),o=(new Date).getDate(),a=(new Date).getMonth()+1,n=new Date(e,a,0).getDate(),i=o/n*100;t[2].num=o,t[2].percent=parseInt(i)+"%"}{let e=(new Date).getMonth()+1,o=e/12*100;t[3].num=e,t[3].percent=parseInt(o)+"%"}let e="";t.forEach((t,o)=>{e+=`\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t${t.title}\n\t\t\t\t\t\t\t\t${t.num}\n\t\t\t\t\t\t\t\t${t.endTitle}\n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t
    ${t.percent}
    \n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t
    `}),$(".joe_aside__item.timelife .joe_aside__item-contain").html(e)}if(0!==$(".joe_aside__item.weather").length){const t=$(".joe_aside__item.weather").attr("data-key"),e=$(".joe_aside__item.weather").attr("data-style"),o={1:"FFFFFF",2:"4A4A4A",3:"FFFFFF"};window.WIDGET={CONFIG:{layout:2,width:"220",height:"270",background:e,dataColor:o[e],language:"zh",key:t}},$.getScript("https://apip.weatherdt.com/standard/static/js/weather-standard.js?v=2.0")}0!==$(".joe_aside__item.ranking").length&&$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"aside_ranking"},success(t){$(".joe_aside__item.ranking .joe_aside__item-title .text").html(t.title);let e="";1===t.code?t.data.forEach((t,o)=>{e+=`\n\t\t\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\t\t${o+1}\n\t\t\t\t\t\t\t\t\t\t${t.title}\n\t\t\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t`}):e+='
  • 数据抓取异常!
  • ',$(".joe_aside__item.ranking .joe_aside__item-contain").html(e)}}),$(".joe_aside__item:last-child").css("top",$(".joe_header").height()+15),"off"!==Joe.LIVE2D&&Joe.LIVE2D&&$.getScript("https://cdn.jsdelivr.net/npm/live2d-widget@3.1.4/lib/L2Dwidget.min.js",()=>{L2Dwidget.init({model:{jsonPath:Joe.LIVE2D,scale:1},mobile:{show:!1},display:{position:"right",width:160,height:200,hOffset:70,vOffset:0}})});{const t=()=>{let t=$(window).scrollTop(),e=$(document).height(),o=$(window).height(),a=parseInt(t/(e-o)*100);a<=0&&(a=0),a>=100&&(a=100),$(".joe_header__below-progress").css("width",a+"%")};t(),$(window).on("scroll",()=>t())}$(".joe_comment__respond-type .item").on("click",function(){$(this).addClass("active").siblings().removeClass("active"),"draw"===$(this).attr("data-type")?($(".joe_comment__respond-form .body .draw").show().siblings().hide(),$("#joe_comment_draw").prop("width",$(".joe_comment__respond-form .body").width()),$(".joe_comment__respond-form").attr("data-type","draw")):($(".joe_comment__respond-form .body .text").show().siblings().hide(),$(".joe_comment__respond-form").attr("data-type","text"))}),0!==$("#joe_comment_draw").length&&(window.sketchpad=new Sketchpad({element:"#joe_comment_draw",height:300,penSize:5,color:"303133"}),$(".joe_comment__respond-form .body .draw .icon-undo").on("click",()=>window.sketchpad.undo()),$(".joe_comment__respond-form .body .draw .icon-animate").on("click",()=>window.sketchpad.animate(10)),$(".joe_comment__respond-form .body .draw .line li").on("click",function(){window.sketchpad.penSize=$(this).attr("data-line"),$(this).addClass("active").siblings().removeClass("active")}),$(".joe_comment__respond-form .body .draw .color li").on("click",function(){window.sketchpad.color=$(this).attr("data-color"),$(this).addClass("active").siblings().removeClass("active")}));{const t=$(".joe_comment__respond");$(".joe_comment__reply").on("click",function(){const e=$(this).attr("data-coid"),o=$("#"+$(this).attr("data-id"));t.find(".joe_comment__respond-form").attr("data-coid",e),o.append(t),$(".joe_comment__respond-type .item[data-type='text']").click(),$(".joe_comment__cancle").show(),window.scrollTo({top:o.offset().top-$(".joe_header").height()-15,behavior:"smooth"})}),$(".joe_comment__cancle").on("click",function(){t.find(".joe_comment__respond-form").removeAttr("data-coid"),$(".joe_comment__cancle").hide(),$(".joe_comment__title").after(t),$(".joe_comment__respond-type .item[data-type='text']").click(),window.scrollTo({top:$(".joe_comment").offset().top-$(".joe_header").height()-15,behavior:"smooth"})})}{let t=!1;$(".joe_comment__respond-form").on("submit",function(e){e.preventDefault();const o=$(".joe_comment__respond-form").attr("action")+"?time="+ +new Date,a=$(".joe_comment__respond-form").attr("data-type"),n=$(".joe_comment__respond-form").attr("data-coid"),i=$(".joe_comment__respond-form .head input[name='author']").val(),s=$(".joe_comment__respond-form .head input[name='mail']").val();let r=$(".joe_comment__respond-form .body textarea[name='text']").val();if(""===i.trim())return Qmsg.info("请输入昵称!");if(!/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(s))return Qmsg.info("请输入正确的邮箱!");if("text"===a&&""===r.trim())return Qmsg.info("请输入评论内容!");if("draw"===a){const t=$("#joe_comment_draw")[0].toDataURL("image/webp",.1);r="{!{"+t+"}!} "}t||(t=!0,$(".joe_comment__respond-form .foot .submit button").html("发送中..."),$.ajax({url:o,type:"POST",data:{author:i,mail:s,text:r,parent:n},dataType:"text",success(e){let o=[],a="";o=$(e).contents(),Array.from(o).forEach(t=>{"container"===t.parentNode.className&&(a=t)}),/Joe/.test(e)?window.location.href=changeURLArg(location.href,"scroll","joe_comment"):(Qmsg.warning(a.textContent.trim()||""),t=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"))}}))})}if(Joe.DOCUMENT_TITLE){const t=document.title;document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?document.title=Joe.DOCUMENT_TITLE:document.title=t})}$(".joe_header__above-slideicon").on("click",function(){$(".joe_header__searchout").removeClass("active"),$(".joe_header__slideout").hasClass("active")?($("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__slideout").removeClass("active")):($("body").css("overflow","hidden"),$(".joe_header__mask").addClass("active slideout"),$(".joe_header__slideout").addClass("active"))}),$(".joe_header__above-searchicon").on("click",function(){$(".joe_header__slideout").removeClass("active"),$(".joe_header__searchout").hasClass("active")?($("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__searchout").removeClass("active")):($("body").css("overflow","hidden"),$(".joe_header__mask").addClass("active"),$(".joe_header__searchout").addClass("active"))}),$(".joe_header__mask").on("click",function(){$("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__searchout").removeClass("active"),$(".joe_header__slideout").removeClass("active")}),$(".joe_header__slideout-menu .current").parents(".panel-body").show().siblings(".panel").addClass("in"),$(".joe_header__slideout-menu .panel").on("click",function(){const t=$(this).parent().parent();t.find(".panel").not($(this)).removeClass("in"),t.find(".panel-body").not($(this).siblings(".panel-body")).stop().hide("fast"),$(this).toggleClass("in").siblings(".panel-body").stop().toggle("fast")});{const t=()=>{const t=new Date(Joe.BIRTHDAY),e=+new Date,o=e-t.getTime();let a=o/864e5,n=Math.floor(a),i=24*(a-n),s=Math.floor(i),r=60*(i-s),c=Math.floor(r),d=60*(r-c),l=Math.floor(d);a=String(n).padStart(2,0),i=String(s).padStart(2,0),r=String(c).padStart(2,0),d=String(l).padStart(2,0),$(".joe_run__day").html(a),$(".joe_run__hour").html(i),$(".joe_run__minute").html(r),$(".joe_run__second").html(d)};Joe.BIRTHDAY&&/(\d{4})\/(\d{1,2})\/(\d{1,2}) (\d{1,2})\:(\d{1,2})\:(\d{1,2})/.test(Joe.BIRTHDAY)&&(t(),setInterval(t,1e3))}$(".joe_owo__contain").length>0&&$(".joe_owo__target").length>0&&$.ajax({url:"/usr/themes/Joe/assets/json/joe.owo.json",dataType:"json",success(t){let e="",o="";for(let a in t)e+=`
    ${a}
    `,o+=`\n \n `;$(".joe_owo__contain").html(`\n
    OωO
    \n
    \n ${o}\n
    ${e}
    \n
    \n `),$(document).on("click",function(){$(".joe_owo__contain .box").stop().slideUp("fast")}),$(".joe_owo__contain .seat").on("click",function(t){t.stopPropagation(),$(this).siblings(".box").stop().slideToggle("fast")}),$(".joe_owo__contain .box .bar .item").on("click",function(t){t.stopPropagation(),$(this).addClass("active").siblings().removeClass("active");const e='.joe_owo__contain .box .scroll[data-index="'+$(this).attr("data-index")+'"]';$(e).show().siblings(".scroll").hide()}),$(".joe_owo__contain .scroll .item").on("click",function(){const t=$(this).attr("data-text");$(".joe_owo__target").insertContent(t)}),$(".joe_owo__contain .box .bar .item").first().click()}});{let t=Joe.MOTTO;t||(t="有钱终成眷属,没钱亲眼目睹"),t.includes("http")?$.ajax({url:t,dataType:"text",success:t=>$(".joe_motto").html(t)}):$(".joe_motto").html(t)}}); \ No newline at end of file diff --git a/assets/js/joe.index.js b/assets/js/joe.index.js index e264b29..f961db5 100644 --- a/assets/js/joe.index.js +++ b/assets/js/joe.index.js @@ -1,29 +1,29 @@ document.addEventListener('DOMContentLoaded', () => { - /* 激活轮播图功能 */ - { - if ($('.joe_index__banner .swiper-container').length !== 0) { - let direction = 'horizontal'; - if (!Joe.IS_MOBILE && $('.joe_index__banner-recommend .item').length === 2) direction = 'vertical'; - new Swiper('.swiper-container', { - keyboard: false, - direction, - loop: true, - autoplay: true, - mousewheel: true, - pagination: { el: '.swiper-pagination' }, - navigation: { - nextEl: '.swiper-button-next', - prevEl: '.swiper-button-prev' - } - }); - } - } + /* 激活轮播图功能 */ + { + if ($('.joe_index__banner .swiper-container').length !== 0) { + let direction = 'horizontal'; + if (!Joe.IS_MOBILE && $('.joe_index__banner-recommend .item').length === 2) direction = 'vertical'; + new Swiper('.swiper-container', { + keyboard: false, + direction, + loop: true, + autoplay: true, + mousewheel: true, + pagination: { el: '.swiper-pagination' }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev' + } + }); + } + } - /* 初始化首页列表功能 */ - { - const getListMode = _ => { - if (_.mode === 'default') { - return ` + /* 初始化首页列表功能 */ + { + const getListMode = _ => { + if (_.mode === 'default') { + return `
  • @@ -51,8 +51,8 @@ document.addEventListener('DOMContentLoaded', () => {
  • `; - } else if (_.mode === 'single') { - return ` + } else if (_.mode === 'single') { + return `
  • @@ -82,8 +82,8 @@ document.addEventListener('DOMContentLoaded', () => {
  • `; - } else if (_.mode === 'multiple') { - return ` + } else if (_.mode === 'multiple') { + return `
  • @@ -94,12 +94,12 @@ document.addEventListener('DOMContentLoaded', () => {
    ${_.image - .map((item, index) => { - if (index < 3) { - return `${_.title}`; - } - }) - .join('')} + .map((item, index) => { + if (index < 3) { + return `${_.title}`; + } + }) + .join('')}
  • `; - } else { - return ` + } else { + return `
  • @@ -139,67 +139,68 @@ document.addEventListener('DOMContentLoaded', () => {
  • `; - } - }; - let queryData = { page: 1, pageSize: 12, type: 'created' }; - const initDom = () => { - $('.joe_index__list .joe_list').html(''); - $('.joe_load').show(); - let activeItem = $('.joe_index__title-title .item[data-type="' + queryData.type + '"]'); - let activeLine = $('.joe_index__title-title .line'); - activeItem.addClass('active').siblings().removeClass('active'); - activeLine.css({ left: activeItem.position().left, width: activeItem.width() }); - }; - const pushDom = () => { - return new Promise((reslove, reject) => { - $('.joe_load').attr('loading', true); - $('.joe_load').html('loading...'); - $('.joe_index__list .joe_list__loading').show(); - $.ajax({ - url: Joe.BASE_API, - type: 'POST', - data: { routeType: 'publish_list', page: queryData.page, pageSize: queryData.pageSize, type: queryData.type }, - success(res) { - if (res.data.length === 0) { - $('.joe_load').removeAttr('loading'); - $('.joe_load').html('查看更多'); - $('.joe_load').hide(); - $('.joe_index__list .joe_list__loading').hide(); - return Qmsg.warning('没有更多内容了'); - } - res.data.forEach(_ => $('.joe_index__list .joe_list').append(getListMode(_))); - $('.joe_load').removeAttr('loading'); - $('.joe_load').html('查看更多'); - $('.joe_index__list .joe_list__loading').hide(); - reslove(res.data.length > 0 ? res.data.length - 1 : 0); - } - }); - }); - }; - initDom(); - pushDom(); + } + }; + let queryData = { page: 1, pageSize: 12, type: 'created' }; + const initDom = () => { + $('.joe_index__list .joe_list').html(''); + $('.joe_load').show(); + let activeItem = $('.joe_index__title-title .item[data-type="' + queryData.type + '"]'); + let activeLine = $('.joe_index__title-title .line'); + activeItem.addClass('active').siblings().removeClass('active'); + activeLine.css({ left: activeItem.position().left, width: activeItem.width() }); + }; + const pushDom = () => { + return new Promise((reslove, reject) => { + $('.joe_load').attr('loading', true); + $('.joe_load').html('loading...'); + $('.joe_index__list .joe_list__loading').show(); + $.ajax({ + url: Joe.BASE_API, + type: 'POST', + dataType: 'json', + data: { routeType: 'publish_list', page: queryData.page, pageSize: queryData.pageSize, type: queryData.type }, + success(res) { + if (res.data.length === 0) { + $('.joe_load').removeAttr('loading'); + $('.joe_load').html('查看更多'); + $('.joe_load').hide(); + $('.joe_index__list .joe_list__loading').hide(); + return Qmsg.warning('没有更多内容了'); + } + res.data.forEach(_ => $('.joe_index__list .joe_list').append(getListMode(_))); + $('.joe_load').removeAttr('loading'); + $('.joe_load').html('查看更多'); + $('.joe_index__list .joe_list__loading').hide(); + reslove(res.data.length > 0 ? res.data.length - 1 : 0); + } + }); + }); + }; + initDom(); + pushDom(); - $('.joe_index__title-title .item').on('click', async function () { - if ($(this).attr('data-type') === queryData.type) return; - queryData = { page: 1, pageSize: 12, type: $(this).attr('data-type') }; - initDom(); - pushDom(); - }); + $('.joe_index__title-title .item').on('click', async function () { + if ($(this).attr('data-type') === queryData.type) return; + queryData = { page: 1, pageSize: 12, type: $(this).attr('data-type') }; + initDom(); + pushDom(); + }); - $('.joe_load').on('click', async function () { - if ($(this).attr('loading')) return; - queryData.page++; - let length = await pushDom(); - length = $('.joe_index__list .joe_list .joe_list__item').length - length; - const queryElement = `.joe_index__list .joe_list .joe_list__item:nth-child(${length})`; - const offset = $(queryElement).offset().top - $('.joe_header').height(); - window.scrollTo({ top: offset - 15, behavior: 'smooth' }); - }); - } + $('.joe_load').on('click', async function () { + if ($(this).attr('loading')) return; + queryData.page++; + let length = await pushDom(); + length = $('.joe_index__list .joe_list .joe_list__item').length - length; + const queryElement = `.joe_index__list .joe_list .joe_list__item:nth-child(${length})`; + const offset = $(queryElement).offset().top - $('.joe_header').height(); + window.scrollTo({ top: offset - 15, behavior: 'smooth' }); + }); + } - /* 激活列表特效 */ - { - const wow = $('.joe_index__list').attr('data-wow'); - if (wow !== 'off' && wow) new WOW({ boxClass: 'wow', animateClass: `animated ${wow}`, offset: 0, mobile: true, live: true, scrollContainer: null }).init(); - } + /* 激活列表特效 */ + { + const wow = $('.joe_index__list').attr('data-wow'); + if (wow !== 'off' && wow) new WOW({ boxClass: 'wow', animateClass: `animated ${wow}`, offset: 0, mobile: true, live: true, scrollContainer: null }).init(); + } }); diff --git a/assets/js/joe.index.min.js b/assets/js/joe.index.min.js index 1b3ae11..3f721ec 100644 --- a/assets/js/joe.index.min.js +++ b/assets/js/joe.index.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",()=>{if(0!==$(".joe_index__banner .swiper-container").length){let l="horizontal";Joe.IS_MOBILE||2!==$(".joe_index__banner-recommend .item").length||(l="vertical"),new Swiper(".swiper-container",{keyboard:!1,direction:l,loop:!0,autoplay:!0,mousewheel:!0,pagination:{el:".swiper-pagination"},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})}{const l=l=>"default"===l.mode?`\n
  • \n
    \n \n ${l.title}\n \n \n \n
    \n \n 置顶${l.title}\n \n ${l.abstract}\n
    \n
      \n
    • ${l.created}
    • \n
    • ${l.views} 阅读
    • \n
    • ${l.commentsNum} 评论
    • \n
    • ${l.agree} 点赞
    • \n
    \n \n
    \n
    \n
  • \n `:"single"===l.mode?`\n
  • \n
    \n
    \n \n 置顶${l.title}\n \n
    \n
      \n
    • ${l.created}
    • \n
    • ${l.views} 阅读
    • \n
    • ${l.commentsNum} 评论
    • \n
    • ${l.agree} 点赞
    • \n
    \n \n
    \n
    \n \n ${l.title}\n \n \n \n
    \n ${l.abstract}\n
    \n
  • \n `:"multiple"===l.mode?`\n
  • \n
    \n
    \n \n 置顶${l.title}\n \n ${l.abstract}\n
    \n \n ${l.image.map((e,t)=>{if(t<3)return`${l.title}`}).join("")}\n \n
    \n \n \n
    \n
  • \n `:`\n
  • \n
    \n
    \n \n 置顶${l.title}\n \n ${l.abstract}\n
    \n
      \n
    • ${l.created}
    • \n
    • ${l.views} 阅读
    • \n
    • ${l.commentsNum} 评论
    • \n
    • ${l.agree} 点赞
    • \n
    \n \n
    \n
    \n
  • \n `;let e={page:1,pageSize:12,type:"created"};const t=()=>{$(".joe_index__list .joe_list").html(""),$(".joe_load").show();let l=$('.joe_index__title-title .item[data-type="'+e.type+'"]'),t=$(".joe_index__title-title .line");l.addClass("active").siblings().removeClass("active"),t.css({left:l.position().left,width:l.width()})},i=()=>new Promise((t,i)=>{$(".joe_load").attr("loading",!0),$(".joe_load").html("loading..."),$(".joe_index__list .joe_list__loading").show(),$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"publish_list",page:e.page,pageSize:e.pageSize,type:e.type},success(e){if(0===e.data.length)return $(".joe_load").removeAttr("loading"),$(".joe_load").html("查看更多"),$(".joe_load").hide(),$(".joe_index__list .joe_list__loading").hide(),Qmsg.warning("没有更多内容了");e.data.forEach(e=>$(".joe_index__list .joe_list").append(l(e))),$(".joe_load").removeAttr("loading"),$(".joe_load").html("查看更多"),$(".joe_index__list .joe_list__loading").hide(),t(e.data.length>0?e.data.length-1:0)}})});t(),i(),$(".joe_index__title-title .item").on("click",async function(){$(this).attr("data-type")!==e.type&&(e={page:1,pageSize:12,type:$(this).attr("data-type")},t(),i())}),$(".joe_load").on("click",async function(){if($(this).attr("loading"))return;e.page++;let l=await i();l=$(".joe_index__list .joe_list .joe_list__item").length-l;const t=`.joe_index__list .joe_list .joe_list__item:nth-child(${l})`,a=$(t).offset().top-$(".joe_header").height();window.scrollTo({top:a-15,behavior:"smooth"})})}{const l=$(".joe_index__list").attr("data-wow");"off"!==l&&l&&new WOW({boxClass:"wow",animateClass:`animated ${l}`,offset:0,mobile:!0,live:!0,scrollContainer:null}).init()}}); \ No newline at end of file +document.addEventListener("DOMContentLoaded",()=>{if(0!==$(".joe_index__banner .swiper-container").length){let l="horizontal";Joe.IS_MOBILE||2!==$(".joe_index__banner-recommend .item").length||(l="vertical"),new Swiper(".swiper-container",{keyboard:!1,direction:l,loop:!0,autoplay:!0,mousewheel:!0,pagination:{el:".swiper-pagination"},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})}{const l=l=>"default"===l.mode?`\n
  • \n
    \n \n ${l.title}\n \n \n \n
    \n \n 置顶${l.title}\n \n ${l.abstract}\n
    \n
      \n
    • ${l.created}
    • \n
    • ${l.views} 阅读
    • \n
    • ${l.commentsNum} 评论
    • \n
    • ${l.agree} 点赞
    • \n
    \n \n
    \n
    \n
  • \n `:"single"===l.mode?`\n
  • \n
    \n
    \n \n 置顶${l.title}\n \n
    \n
      \n
    • ${l.created}
    • \n
    • ${l.views} 阅读
    • \n
    • ${l.commentsNum} 评论
    • \n
    • ${l.agree} 点赞
    • \n
    \n \n
    \n
    \n \n ${l.title}\n \n \n \n
    \n ${l.abstract}\n
    \n
  • \n `:"multiple"===l.mode?`\n
  • \n
    \n
    \n \n 置顶${l.title}\n \n ${l.abstract}\n
    \n \n ${l.image.map((e,t)=>{if(t<3)return`${l.title}`}).join("")}\n \n
    \n \n \n
    \n
  • \n `:`\n
  • \n
    \n
    \n \n 置顶${l.title}\n \n ${l.abstract}\n
    \n
      \n
    • ${l.created}
    • \n
    • ${l.views} 阅读
    • \n
    • ${l.commentsNum} 评论
    • \n
    • ${l.agree} 点赞
    • \n
    \n \n
    \n
    \n
  • \n `;let e={page:1,pageSize:12,type:"created"};const t=()=>{$(".joe_index__list .joe_list").html(""),$(".joe_load").show();let l=$('.joe_index__title-title .item[data-type="'+e.type+'"]'),t=$(".joe_index__title-title .line");l.addClass("active").siblings().removeClass("active"),t.css({left:l.position().left,width:l.width()})},i=()=>new Promise((t,i)=>{$(".joe_load").attr("loading",!0),$(".joe_load").html("loading..."),$(".joe_index__list .joe_list__loading").show(),$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"publish_list",page:e.page,pageSize:e.pageSize,type:e.type},success(e){if(0===e.data.length)return $(".joe_load").removeAttr("loading"),$(".joe_load").html("查看更多"),$(".joe_load").hide(),$(".joe_index__list .joe_list__loading").hide(),Qmsg.warning("没有更多内容了");e.data.forEach(e=>$(".joe_index__list .joe_list").append(l(e))),$(".joe_load").removeAttr("loading"),$(".joe_load").html("查看更多"),$(".joe_index__list .joe_list__loading").hide(),t(e.data.length>0?e.data.length-1:0)}})});t(),i(),$(".joe_index__title-title .item").on("click",async function(){$(this).attr("data-type")!==e.type&&(e={page:1,pageSize:12,type:$(this).attr("data-type")},t(),i())}),$(".joe_load").on("click",async function(){if($(this).attr("loading"))return;e.page++;let l=await i();l=$(".joe_index__list .joe_list .joe_list__item").length-l;const t=`.joe_index__list .joe_list .joe_list__item:nth-child(${l})`,a=$(t).offset().top-$(".joe_header").height();window.scrollTo({top:a-15,behavior:"smooth"})})}{const l=$(".joe_index__list").attr("data-wow");"off"!==l&&l&&new WOW({boxClass:"wow",animateClass:`animated ${l}`,offset:0,mobile:!0,live:!0,scrollContainer:null}).init()}}); \ No newline at end of file diff --git a/assets/js/joe.leaving.js b/assets/js/joe.leaving.js index cccc44e..85b4912 100644 --- a/assets/js/joe.leaving.js +++ b/assets/js/joe.leaving.js @@ -10,6 +10,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'baidu_record', site: window.location.href }, success(res) { if (res.data && res.data === '已收录') { @@ -23,6 +24,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'baidu_push', domain: encodeURI(window.location.hostname), @@ -55,6 +57,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'handle_views', cid }, success(res) { if (res.code !== 1) return; diff --git a/assets/js/joe.leaving.min.js b/assets/js/joe.leaving.min.js index 77a98f0..56612f0 100644 --- a/assets/js/joe.leaving.min.js +++ b/assets/js/joe.leaving.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",()=>{const e=e=>window.btoa(unescape(encodeURIComponent(e))),o=e=>decodeURIComponent(escape(window.atob(e))),t=$(".joe_detail").attr("data-cid");$.ajax({url:Joe.BASE_API,type:"POST",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('未收录,推送中...');const e=setTimeout(function(){$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"baidu_push",domain:encodeURI(window.location.hostname),url:encodeURI(window.location.href)},success(e){e.error?$("#Joe_Baidu_Record").html('推送失败,请检查!'):$("#Joe_Baidu_Record").html('推送成功!')}}),clearTimeout(e)},1e3)}else{const e=`https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;$("#Joe_Baidu_Record").html(`未收录,提交收录`)}}});{let a=localStorage.getItem(e("views"))?JSON.parse(o(localStorage.getItem(e("views")))):[];const n=a.includes(t);n||$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"handle_views",cid:t},success(o){if(1!==o.code)return;$("#Joe_Article_Views").html(`${o.data.views} 阅读`),a.push(t);const n=e("views"),i=e(JSON.stringify(a));localStorage.setItem(n,i)}})}{let e=100;const o=["#F8D800","#0396FF","#EA5455","#7367F0","#32CCBC","#F6416C","#28C76F","#9F44D3","#F55555","#736EFE","#E96D71","#DE4313","#D939CD","#4C83FF","#F072B6","#C346C2","#5961F9","#FD6585","#465EFB","#FFC600","#FA742B","#5151E5","#BB4E75","#FF52E5","#49C628","#00EAFF","#F067B4","#F067B4","#ff9a9e","#00f2fe","#4facfe","#f093fb","#6fa3ef","#bc99c4","#46c47c","#f9bb3c","#e8583d","#f68e5f"],t=(e,o)=>Math.floor(Math.random()*(o-e+1))+e,a=$(".joe_detail__leaving-list").width(),n=$(".joe_detail__leaving-list").height(),i=["20px 300px","20px 400px","20px 500px","30px 300px","30px 400px","30px 500px","40px 300px","40px 400px","40px 500px"],l=["300px 20px","400px 20px","500px 20px","300px 30px","400px 30px","500px 30px","300px 40px","400px 40px","500px 40px"];$(".joe_detail__leaving-list .item").each((c,s)=>{const d=t(1,99),r=o[t(0,o.length-1)],p=Math.ceil($(s).width()),h=Math.ceil($(s).height()),x=t(0,n-h),u=t(0,a-p);$(s).css({display:"block",zIndex:d,background:r,top:x,left:u,borderTopLeftRadius:l[t(0,l.length-1)],borderTopRightRadius:i[t(0,i.length-1)],borderBottomLeftRadius:i[t(0,i.length-1)],borderBottomRightRadius:i[t(0,i.length-1)]}),$(s).draggabilly({containment:!0}),$(s).on("dragStart",o=>{e++,$(s).css({zIndex:e})})})}$(".joe_comment .joe_pagination a").each((e,o)=>{const t=$(o).attr("href");t&&t.includes("#")&&$(o).attr("href",t.replace("#comments","?scroll=joe_comment"))})}),window.addEventListener("load",function(){{const e=new URLSearchParams(location.search).get("scroll");if(e){const o=$(".joe_header").height();let t=null;if(t=$("#"+e).length>0?$("#"+e):$("."+e),t&&t.length>0){const e=t.offset().top-o-15;window.scrollTo({top:e,behavior:"smooth"})}}}}); \ No newline at end of file +document.addEventListener("DOMContentLoaded",()=>{const e=e=>window.btoa(unescape(encodeURIComponent(e))),o=e=>decodeURIComponent(escape(window.atob(e))),t=$(".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('未收录,推送中...');const e=setTimeout(function(){$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_push",domain:encodeURI(window.location.hostname),url:encodeURI(window.location.href)},success(e){e.error?$("#Joe_Baidu_Record").html('推送失败,请检查!'):$("#Joe_Baidu_Record").html('推送成功!')}}),clearTimeout(e)},1e3)}else{const e=`https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;$("#Joe_Baidu_Record").html(`未收录,提交收录`)}}});{let a=localStorage.getItem(e("views"))?JSON.parse(o(localStorage.getItem(e("views")))):[];const n=a.includes(t);n||$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"handle_views",cid:t},success(o){if(1!==o.code)return;$("#Joe_Article_Views").html(`${o.data.views} 阅读`),a.push(t);const n=e("views"),i=e(JSON.stringify(a));localStorage.setItem(n,i)}})}{let e=100;const o=["#F8D800","#0396FF","#EA5455","#7367F0","#32CCBC","#F6416C","#28C76F","#9F44D3","#F55555","#736EFE","#E96D71","#DE4313","#D939CD","#4C83FF","#F072B6","#C346C2","#5961F9","#FD6585","#465EFB","#FFC600","#FA742B","#5151E5","#BB4E75","#FF52E5","#49C628","#00EAFF","#F067B4","#F067B4","#ff9a9e","#00f2fe","#4facfe","#f093fb","#6fa3ef","#bc99c4","#46c47c","#f9bb3c","#e8583d","#f68e5f"],t=(e,o)=>Math.floor(Math.random()*(o-e+1))+e,a=$(".joe_detail__leaving-list").width(),n=$(".joe_detail__leaving-list").height(),i=["20px 300px","20px 400px","20px 500px","30px 300px","30px 400px","30px 500px","40px 300px","40px 400px","40px 500px"],l=["300px 20px","400px 20px","500px 20px","300px 30px","400px 30px","500px 30px","300px 40px","400px 40px","500px 40px"];$(".joe_detail__leaving-list .item").each((c,s)=>{const d=t(1,99),r=o[t(0,o.length-1)],p=Math.ceil($(s).width()),h=Math.ceil($(s).height()),x=t(0,n-h),u=t(0,a-p);$(s).css({display:"block",zIndex:d,background:r,top:x,left:u,borderTopLeftRadius:l[t(0,l.length-1)],borderTopRightRadius:i[t(0,i.length-1)],borderBottomLeftRadius:i[t(0,i.length-1)],borderBottomRightRadius:i[t(0,i.length-1)]}),$(s).draggabilly({containment:!0}),$(s).on("dragStart",o=>{e++,$(s).css({zIndex:e})})})}$(".joe_comment .joe_pagination a").each((e,o)=>{const t=$(o).attr("href");t&&t.includes("#")&&$(o).attr("href",t.replace("#comments","?scroll=joe_comment"))})}),window.addEventListener("load",function(){{const e=new URLSearchParams(location.search).get("scroll");if(e){const o=$(".joe_header").height();let t=null;if(t=$("#"+e).length>0?$("#"+e):$("."+e),t&&t.length>0){const e=t.offset().top-o-15;window.scrollTo({top:e,behavior:"smooth"})}}}}); \ No newline at end of file diff --git a/assets/js/joe.live.js b/assets/js/joe.live.js index c2320b2..c192ecd 100644 --- a/assets/js/joe.live.js +++ b/assets/js/joe.live.js @@ -26,6 +26,7 @@ document.addEventListener('DOMContentLoaded', () => { function renderLiveType() { $.ajax({ url: '/usr/themes/Joe/assets/json/joe.live.json', + dataType: 'json', success(res) { const item = res[queryData.index]; $('.joe_live__type-title .text').html(item.name); @@ -43,6 +44,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'huya_list', page: queryData.page, diff --git a/assets/js/joe.live.min.js b/assets/js/joe.live.min.js index df6dd14..bba2a34 100644 --- a/assets/js/joe.live.min.js +++ b/assets/js/joe.live.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",()=>{function a(){function a(){$.ajax({url:"/usr/themes/Joe/assets/json/joe.live.json",success(a){const e=a[n.index];$(".joe_live__type-title .text").html(e.name);let t='
  • 全部
  • ';e.list.forEach(a=>t+=`
  • ${a.name}
  • `),$(".joe_live__type-list").html(t),$(".joe_live__type-list .item").first().click()}})}function e(){window.scrollTo({top:0,behavior:"smooth"}),n.isLoading=!0,$(".joe_live__list").html(""),$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"huya_list",page:n.page,gameId:n.gameId},success(a){if(1!==a.code)return;let e="";a.data.datas.forEach(a=>{e+=`\n \n
    \n ${a.recommendTagName}\n ${a.introduction}\n
    \n
    \n
    \n \n ${a.nick}\n
    \n
    ${a.nick}
    \n

    ${a.introduction}

    \n
    \n \n ${i(a.totalCount)}\n ${a.gameFullName}\n
    \n
    \n
    \n `}),$(".joe_live__list").html(e),n.totalPage=a.data.totalPage,t()},complete:()=>n.isLoading=!1})}function t(){let a="";1!=n.page&&(a+=`\n \t\t
  • 首页
  • \n \t\t
  • \n \n \t\t
  • \n \t\t
  • ${n.page-1}
  • \n \t`),a+=`
  • ${n.page}
  • `,n.page!=n.totalPage&&(a+=`\n \t\t
  • ${n.page+1}
  • \n \t\t
  • \n \n \t\t
  • \n \t`),n.page末页`),$(".joe_live__pagination").html(a)}function i(a=0){return a>=1e4?Math.round(a/1e3)/10+"万":a}let n={page:1,gameId:"",index:0,isLoading:!1,totalPage:0};$(".joe_live__type-title .icon").on("click",function(){n.isLoading||(3===n.index&&(n.index=0),n.index++,a())}),$(".joe_live__type-list").on("click",".item",function(){n.isLoading||($(this).addClass("active").siblings().removeClass("active"),n.page=1,n.gameId=$(this).attr("data-gameId"),e())}),a(),$(".joe_live__pagination").on("click",".joe_live__pagination-item",function(){const a=$(this).attr("data-page");a&&!n.isLoading&&(n.page=Number(a),e())})}const e=new URLSearchParams(window.location.search);e.get("profileRoom")||a()}); \ No newline at end of file +document.addEventListener("DOMContentLoaded",()=>{function a(){function a(){$.ajax({url:"/usr/themes/Joe/assets/json/joe.live.json",dataType:"json",success(a){const e=a[n.index];$(".joe_live__type-title .text").html(e.name);let t='
  • 全部
  • ';e.list.forEach(a=>t+=`
  • ${a.name}
  • `),$(".joe_live__type-list").html(t),$(".joe_live__type-list .item").first().click()}})}function e(){window.scrollTo({top:0,behavior:"smooth"}),n.isLoading=!0,$(".joe_live__list").html(""),$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"huya_list",page:n.page,gameId:n.gameId},success(a){if(1!==a.code)return;let e="";a.data.datas.forEach(a=>{e+=`\n \n
    \n ${a.recommendTagName}\n ${a.introduction}\n
    \n
    \n
    \n \n ${a.nick}\n
    \n
    ${a.nick}
    \n

    ${a.introduction}

    \n
    \n \n ${i(a.totalCount)}\n ${a.gameFullName}\n
    \n
    \n
    \n `}),$(".joe_live__list").html(e),n.totalPage=a.data.totalPage,t()},complete:()=>n.isLoading=!1})}function t(){let a="";1!=n.page&&(a+=`\n \t\t
  • 首页
  • \n \t\t
  • \n \n \t\t
  • \n \t\t
  • ${n.page-1}
  • \n \t`),a+=`
  • ${n.page}
  • `,n.page!=n.totalPage&&(a+=`\n \t\t
  • ${n.page+1}
  • \n \t\t
  • \n \n \t\t
  • \n \t`),n.page末页`),$(".joe_live__pagination").html(a)}function i(a=0){return a>=1e4?Math.round(a/1e3)/10+"万":a}let n={page:1,gameId:"",index:0,isLoading:!1,totalPage:0};$(".joe_live__type-title .icon").on("click",function(){n.isLoading||(3===n.index&&(n.index=0),n.index++,a())}),$(".joe_live__type-list").on("click",".item",function(){n.isLoading||($(this).addClass("active").siblings().removeClass("active"),n.page=1,n.gameId=$(this).attr("data-gameId"),e())}),a(),$(".joe_live__pagination").on("click",".joe_live__pagination-item",function(){const a=$(this).attr("data-page");a&&!n.isLoading&&(n.page=Number(a),e())})}const e=new URLSearchParams(window.location.search);e.get("profileRoom")||a()}); \ No newline at end of file diff --git a/assets/js/joe.post&page.js b/assets/js/joe.post&page.js index 303e38c..6557f60 100644 --- a/assets/js/joe.post&page.js +++ b/assets/js/joe.post&page.js @@ -10,6 +10,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'baidu_record', site: window.location.href }, success(res) { if (res.data && res.data === '已收录') { @@ -23,6 +24,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'baidu_push', domain: encodeURI(window.location.hostname), @@ -80,6 +82,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'handle_views', cid }, success(res) { if (res.code !== 1) return; @@ -107,6 +110,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'handle_agree', cid, type: flag ? 'disagree' : 'agree' }, success(res) { if (res.code !== 1) return; @@ -161,7 +165,7 @@ document.addEventListener('DOMContentLoaded', () => { cid, protectPassword }, - datatype: 'text', + dataType: 'text', success(res) { let arr = [], str = ''; diff --git a/assets/js/joe.post&page.min.js b/assets/js/joe.post&page.min.js index ff64ebf..100f8fe 100644 --- a/assets/js/joe.post&page.min.js +++ b/assets/js/joe.post&page.min.js @@ -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",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('未收录,推送中...');const e=setTimeout(function(){$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"baidu_push",domain:encodeURI(window.location.hostname),url:encodeURI(window.location.href)},success(e){e.error?$("#Joe_Baidu_Record").html('推送失败,请检查!'):$("#Joe_Baidu_Record").html('推送成功!')}}),clearTimeout(e)},1e3)}else{const e=`https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;$("#Joe_Baidu_Record").html(`未收录,提交收录`)}}}),Prism.highlightAll(),$("pre[class*='language-']").each(function(e,t){let a=$(t).find("code[class*='language-']").text(),o=$('');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($(``))}),$(".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",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",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"),c=e(JSON.stringify(o));localStorage.setItem(i,c)},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"})}}}}); \ No newline at end of file +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('未收录,推送中...');const e=setTimeout(function(){$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"baidu_push",domain:encodeURI(window.location.hostname),url:encodeURI(window.location.href)},success(e){e.error?$("#Joe_Baidu_Record").html('推送失败,请检查!'):$("#Joe_Baidu_Record").html('推送成功!')}}),clearTimeout(e)},1e3)}else{const e=`https://ziyuan.baidu.com/linksubmit/url?sitename=${encodeURI(window.location.href)}`;$("#Joe_Baidu_Record").html(`未收录,提交收录`)}}}),Prism.highlightAll(),$("pre[class*='language-']").each(function(e,t){let a=$(t).find("code[class*='language-']").text(),o=$('');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($(``))}),$(".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"})}}}}); \ No newline at end of file diff --git a/assets/js/joe.short.js b/assets/js/joe.short.js index 770afb0..f2b693b 100644 --- a/assets/js/joe.short.js +++ b/assets/js/joe.short.js @@ -1,13 +1,42 @@ document.addEventListener('DOMContentLoaded', () => { - /* - * - * - * * - * 开放类组件 - * * - * - * - */ + /* 网易云音乐 - 单首 - 已测试 √ */ + class JoeMusic extends HTMLElement { + constructor() { + super(); + this.options = { + id: this.getAttribute('id'), + width: this.getAttribute('width') || '100%', + height: this.getAttribute('height') || '86px', + autoplay: this.getAttribute('autoplay') ? 1 : 0 + }; + this.render(); + } + get template() { + return ` + +
    + +
    + `; + } + render() { + this.innerHTML = ''; + this._shadowRoot = this.attachShadow({ mode: 'closed' }); + if (this.options.id) this._shadowRoot.innerHTML = this.template; + else this._shadowRoot.innerHTML = '网易云歌曲ID未填写!'; + } + } + window.customElements.define('joe-music', JoeMusic); /* 便条按钮 */ class JoeAnote extends HTMLElement { @@ -205,9 +234,7 @@ document.addEventListener('DOMContentLoaded', () => { } window.customElements.define('joe-show', JoeShow); /* 时间轴 */ - class JoeTimeline extends HTMLElement { - - } + class JoeTimeline extends HTMLElement {} /* * * @@ -218,44 +245,6 @@ document.addEventListener('DOMContentLoaded', () => { * */ - /* 网易云音乐 - 单首 */ - class JoeMusic extends HTMLElement { - constructor() { - super(); - this.options = { - id: this.getAttribute('id'), - width: this.getAttribute('width') || '100%', - height: this.getAttribute('height') || '86px', - autoplay: this.getAttribute('autoplay') ? 1 : 0 - }; - this.render(); - } - get template() { - return ` - -
    - -
    - `; - } - render() { - this.innerHTML = ''; - this._shadowRoot = this.attachShadow({ mode: 'closed' }); - if (this.options.id) this._shadowRoot.innerHTML = this.template; - else this._shadowRoot.innerHTML = '网易云歌曲ID未填写!'; - } - } - window.customElements.define('joe-music', JoeMusic); /* 网易云音乐 - 歌单 */ class JoeMlist extends HTMLElement { constructor() { diff --git a/assets/js/joe.short.min.js b/assets/js/joe.short.min.js index 03a7cfb..8ebc884 100644 --- a/assets/js/joe.short.min.js +++ b/assets/js/joe.short.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",()=>{class t extends HTMLElement{constructor(){super(),this.options={icon:this.getAttribute("icon")||"fa-download",href:this.getAttribute("href")||"#",type:/^secondary$|^success$|^warning$|^error$|^info$/.test(this.getAttribute("type"))?this.getAttribute("type"):"secondary",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"标签按钮"},this.render()}get template(){return`\n \n ${this.options.content}\n \n `}render(){this.innerHTML=this.template}}window.customElements.define("joe-anote",t);class e extends HTMLElement{constructor(){super(),this.options={icon:this.getAttribute("icon")||"",color:this.getAttribute("color")||"#ff6800",href:this.getAttribute("href")||"#",radius:this.getAttribute("radius")||"17.5px",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"多彩按钮"},this.render()}get template(){return`\n \n ${this.options.content}\n \n `}render(){this.innerHTML=this.template}}window.customElements.define("joe-abtn",e);class i extends HTMLElement{constructor(){super(),this.options={src:this.getAttribute("src"),player:this.getAttribute("player")},this.render()}get template(){return`\n \n `}render(){this.options.src?this.innerHTML=this.template:this.innerHTML="播放地址未填写!"}}window.customElements.define("joe-dplayer",i);class n extends HTMLElement{constructor(){super(),this.options={bvid:this.getAttribute("bvid")},this.render()}get template(){return`\n \n `}render(){this.options.bvid?this.innerHTML=this.template:this.innerHTML="Bvid未填写!"}}window.customElements.define("joe-bilibili",n);class s extends HTMLElement{constructor(){super(),this.options={content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"居中标题"},this.render()}get template(){return`\n
    \n ${this.options.content} \n
    \n `}render(){this.innerHTML=this.template}}window.customElements.define("joe-mtitle",s);class o extends HTMLElement{constructor(){super(),this.options={text:this.getAttribute("text")||"默认文本",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"点击复制"},this.render()}get template(){return`${this.options.content}`}render(){this.innerHTML=this.template,this.event()}event(){this.$copy=this.querySelector(".joe_detail__article-copy"),new ClipboardJS(this.$copy,{text:()=>this.options.text}).on("success",()=>Qmsg.success("复制成功!"))}}window.customElements.define("joe-copy",o);class r extends HTMLElement{constructor(){super(),this.options={type:/^success$|^info$|^warning$|^error$/.test(this.getAttribute("type"))?this.getAttribute("type"):"info",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"提示内容"},this.render()}get template(){return`\n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t
    ${this.options.content}
    \n\t\t\t\t
    \n\t\t\t`}render(){this.innerHTML=this.template}}window.customElements.define("joe-message",r);class a extends HTMLElement{constructor(){super(),this.options={width:this.getAttribute("width")||"100%",label:this.getAttribute("label")||"默认标题",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"默认内容"},this.render()}get template(){return`\n
    \n
    ${this.options.label}
    \n
    ${this.options.content}
    \n
    \n `}render(){this.innerHTML=this.template}}window.customElements.define("joe-card",a);class h extends HTMLElement{constructor(){super(),this.options={content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"默认隐藏的内容"},this.render()}render(){this.innerHTML=this.options.content}}window.customElements.define("joe-show",h);class l extends HTMLElement{constructor(){super(),this.options={id:this.getAttribute("id"),width:this.getAttribute("width")||"100%",height:this.getAttribute("height")||"86px",autoplay:this.getAttribute("autoplay")?1:0},this.render()}get template(){return`\n \n
    \n \n
    \n `}render(){this.innerHTML="",this._shadowRoot=this.attachShadow({mode:"closed"}),this.options.id?this._shadowRoot.innerHTML=this.template:this._shadowRoot.innerHTML="网易云歌曲ID未填写!"}}window.customElements.define("joe-music",l);class c extends HTMLElement{constructor(){super(),this.options={id:this.getAttribute("id"),width:this.getAttribute("width")||"100%",height:this.getAttribute("height")||"450px",autoplay:this.getAttribute("autoplay")?1:0},this.render()}get template(){return`\n \n
    \n \n
    \n `}render(){this.innerHTML="",this._shadowRoot=this.attachShadow({mode:"closed"}),this.options.id?this._shadowRoot.innerHTML=this.template:this._shadowRoot.innerHTML="网易云歌单ID未填写!"}}window.customElements.define("joe-mlist",c);class d extends HTMLElement{constructor(){super(),this.render()}get template(){return'\n \n
    \n 此处内容作者设置了 回复 可见\n
    \n '}render(){this.innerHTML="",this._shadowRoot=this.attachShadow({mode:"closed"}),this._shadowRoot.innerHTML=this.template,this.event()}event(){this.$button=this._shadowRoot.querySelector("i"),this.$button.addEventListener("click",()=>{const t=$(".joe_comment").offset().top-$(".joe_header").height()-15;window.scrollTo({top:t,behavior:"smooth"})})}}window.customElements.define("joe-hide",d)}); \ No newline at end of file +document.addEventListener("DOMContentLoaded",()=>{class t extends HTMLElement{constructor(){super(),this.options={id:this.getAttribute("id"),width:this.getAttribute("width")||"100%",height:this.getAttribute("height")||"86px",autoplay:this.getAttribute("autoplay")?1:0},this.render()}get template(){return`\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t`}render(){this.innerHTML="",this._shadowRoot=this.attachShadow({mode:"closed"}),this.options.id?this._shadowRoot.innerHTML=this.template:this._shadowRoot.innerHTML="网易云歌曲ID未填写!"}}window.customElements.define("joe-music",t);class e extends HTMLElement{constructor(){super(),this.options={icon:this.getAttribute("icon")||"fa-download",href:this.getAttribute("href")||"#",type:/^secondary$|^success$|^warning$|^error$|^info$/.test(this.getAttribute("type"))?this.getAttribute("type"):"secondary",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"标签按钮"},this.render()}get template(){return`\n \n ${this.options.content}\n \n `}render(){this.innerHTML=this.template}}window.customElements.define("joe-anote",e);class i extends HTMLElement{constructor(){super(),this.options={icon:this.getAttribute("icon")||"",color:this.getAttribute("color")||"#ff6800",href:this.getAttribute("href")||"#",radius:this.getAttribute("radius")||"17.5px",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"多彩按钮"},this.render()}get template(){return`\n \n ${this.options.content}\n \n `}render(){this.innerHTML=this.template}}window.customElements.define("joe-abtn",i);class n extends HTMLElement{constructor(){super(),this.options={src:this.getAttribute("src"),player:this.getAttribute("player")},this.render()}get template(){return`\n \n `}render(){this.options.src?this.innerHTML=this.template:this.innerHTML="播放地址未填写!"}}window.customElements.define("joe-dplayer",n);class s extends HTMLElement{constructor(){super(),this.options={bvid:this.getAttribute("bvid")},this.render()}get template(){return`\n \n `}render(){this.options.bvid?this.innerHTML=this.template:this.innerHTML="Bvid未填写!"}}window.customElements.define("joe-bilibili",s);class o extends HTMLElement{constructor(){super(),this.options={content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"居中标题"},this.render()}get template(){return`\n
    \n ${this.options.content} \n
    \n `}render(){this.innerHTML=this.template}}window.customElements.define("joe-mtitle",o);class r extends HTMLElement{constructor(){super(),this.options={text:this.getAttribute("text")||"默认文本",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"点击复制"},this.render()}get template(){return`${this.options.content}`}render(){this.innerHTML=this.template,this.event()}event(){this.$copy=this.querySelector(".joe_detail__article-copy"),new ClipboardJS(this.$copy,{text:()=>this.options.text}).on("success",()=>Qmsg.success("复制成功!"))}}window.customElements.define("joe-copy",r);class a extends HTMLElement{constructor(){super(),this.options={type:/^success$|^info$|^warning$|^error$/.test(this.getAttribute("type"))?this.getAttribute("type"):"info",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"提示内容"},this.render()}get template(){return`\n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t
    ${this.options.content}
    \n\t\t\t\t
    \n\t\t\t`}render(){this.innerHTML=this.template}}window.customElements.define("joe-message",a);class h extends HTMLElement{constructor(){super(),this.options={width:this.getAttribute("width")||"100%",label:this.getAttribute("label")||"默认标题",content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"默认内容"},this.render()}get template(){return`\n
    \n
    ${this.options.label}
    \n
    ${this.options.content}
    \n
    \n `}render(){this.innerHTML=this.template}}window.customElements.define("joe-card",h);class l extends HTMLElement{constructor(){super(),this.options={content:this.innerHTML.trim().replace(/^(
    )|(
    )$/g,"")||"默认隐藏的内容"},this.render()}render(){this.innerHTML=this.options.content}}window.customElements.define("joe-show",l);class c extends HTMLElement{constructor(){super(),this.options={id:this.getAttribute("id"),width:this.getAttribute("width")||"100%",height:this.getAttribute("height")||"450px",autoplay:this.getAttribute("autoplay")?1:0},this.render()}get template(){return`\n \n
    \n \n
    \n `}render(){this.innerHTML="",this._shadowRoot=this.attachShadow({mode:"closed"}),this.options.id?this._shadowRoot.innerHTML=this.template:this._shadowRoot.innerHTML="网易云歌单ID未填写!"}}window.customElements.define("joe-mlist",c);class d extends HTMLElement{constructor(){super(),this.render()}get template(){return'\n \n
    \n 此处内容作者设置了 回复 可见\n
    \n '}render(){this.innerHTML="",this._shadowRoot=this.attachShadow({mode:"closed"}),this._shadowRoot.innerHTML=this.template,this.event()}event(){this.$button=this._shadowRoot.querySelector("i"),this.$button.addEventListener("click",()=>{const t=$(".joe_comment").offset().top-$(".joe_header").height()-15;window.scrollTo({top:t,behavior:"smooth"})})}}window.customElements.define("joe-hide",d)}); \ No newline at end of file diff --git a/assets/js/joe.video.js b/assets/js/joe.video.js index 0ada94a..edd12cc 100644 --- a/assets/js/joe.video.js +++ b/assets/js/joe.video.js @@ -15,6 +15,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'maccms_list' }, success(res) { if (res.code !== 1) return $('.joe_video__type-list').html(`
  • ${res.data}
  • `); @@ -42,6 +43,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'maccms_list', ac: 'videolist', t: queryData.t, pg: queryData.pg, wd: queryData.wd }, success(res) { if (res.code !== 1) return $('.joe_video__list-item').css('display', 'block').html('

    数据加载失败!请检查!

    '); @@ -115,6 +117,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'maccms_list', ac: 'detail', diff --git a/assets/js/joe.video.min.js b/assets/js/joe.video.min.js index 4cccaae..d8b0682 100644 --- a/assets/js/joe.video.min.js +++ b/assets/js/joe.video.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",()=>{function t(){function t(){window.scrollTo({top:0,behavior:"smooth"}),$(".joe_video__list-item").css("display","").html(""),o=!0,$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"maccms_list",ac:"videolist",t:i.t,pg:i.pg,wd:i.wd},success(t){if(1!==t.code)return $(".joe_video__list-item").css("display","block").html('

    数据加载失败!请检查!

    ');if(t.data.list.length){let e="";t.data.list.forEach(t=>{e+=`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t${t.vod_year}\n\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t\t${t.vod_name}\n\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t

    ${t.vod_name}

    \n\t\t\t\t\t\t\t\t
    `}),$(".joe_video__list-item").html(e)}else $(".joe_video__list-item").css("display","block").html('

    暂无数据!

    ');a=t.data.pagecount,e()},complete:()=>o=!1})}function e(){if(0==a)return $(".joe_video__pagination").hide();$(".joe_video__pagination").show();let t="";1!=i.pg&&(t+=`\n \t\t
  • 首页
  • \n \t\t
  • \n \n \t\t
  • \n \t\t
  • ${i.pg-1}
  • \n \t`),t+=`
  • ${i.pg}
  • `,i.pg!=a&&(t+=`\n \t\t
  • ${i.pg+1}
  • \n \t\t
  • \n \n \t\t
  • \n \t`),i.pg末页`),$(".joe_video__pagination").html(t)}let i={pg:"",t:"",wd:""},a="",o=!1;$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"maccms_list"},success(t){if(1!==t.code)return $(".joe_video__type-list").html(`
  • ${t.data}
  • `);if(!t.data.class.length)return $(".joe_video__type-list").html('
  • 暂无数据!
  • ');let e='
  • 全部
  • ';t.data.class.forEach(t=>e+=`
  • ${t.type_name}
  • `),$(".joe_video__type-list").html(e),$(".joe_video__type-list .item").first().click()}}),$(".joe_video__type-list").on("click",".item",function(){const e=$(this).attr("data-t");o||($(this).addClass("active").siblings().removeClass("active"),i.pg=1,i.t=e,i.wd="",$(".joe_video__list-search input").val(""),t())}),$(".joe_video__pagination").on("click",".joe_video__pagination-item",function(){const e=$(this).attr("data-pg");e&&!o&&(i.pg=Number(e),t())});const s=()=>{const e=$(".joe_video__list-search input").val();o||(i.pg=1,i.t="",i.wd=e,$(".joe_video__type-list .item").first().addClass("active").siblings().removeClass("active"),t())};$(".joe_video__list-search .button").on("click",s),$(".joe_video__list-search .input").on("keyup",t=>13===t.keyCode&&s())}function e(){const t=$(".joe_video__player-play").attr("data-player");$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"maccms_list",ac:"detail",ids:o},success(t){if(1!==t.code)return $(".joe_video__detail-info").html(`

    ${t.data}

    `);if(!t.data.list.length)return $(".joe_video__detail-info").html('

    数据抓取异常!请检查!

    ');const e=t.data.list[0];$(".joe_video__detail-info").html(`\n\t\t\t\t\t
    \n\t\t\t\t\t\t${e.vod_name}\n\t\t\t\t\t\t${e.vod_year}\n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t
    ${e.vod_name+(e.vod_remarks?" - "+e.vod_remarks:"")}
    \n\t\t\t\t\t\t
    类型:${e.vod_class||"未知"}
    \n\t\t\t\t\t\t
    主演:${e.vod_actor||"未知"}
    \n\t\t\t\t\t\t
    导演:${e.vod_director||"未知"}
    \n\t\t\t\t\t\t
    简介:${i(e)}
    \n\t\t\t\t\t
    \n\t\t\t\t`),$(".joe_video__player .joe_video__contain-title").html("正在播放:"+e.vod_name);let a=t=>{let e="",i=t.split("#");return i.forEach(t=>e+=`
  • ${t.split("$")[0]||""}
  • `),e},o=e.vod_play_from.split("$$$"),s=e.vod_play_url.split("$$$"),l=new Map;o.forEach((t,e)=>l.set(t,s[e]||[]));let d="",n=0;for(let[t,e]of l)n++,d+=`\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
    播放线路 ${n}
    \n\t\t\t\t\t\t\t
      ${a(e)}
    \n\t\t\t\t\t\t
    \n\t\t\t\t\t`;$(".joe_video__player").after(d),$(".joe_video__source").first().find(".joe_video__source-list .item").first().click()}}),$(document).on("click",".joe_video__source-list .item",function(){$(".joe_video__source-list .item").removeClass("active"),$(this).addClass("active");const e=$(this).attr("data-src")||$(this).html();$(".joe_video__player-play").attr({src:t+e});const i=$(".joe_video__player").offset().top-$(".joe_header").height()-15;window.scrollTo({top:i,behavior:"smooth"})})}function i(t){return t.vod_content?t.vod_content.replace(/<[^>]+>/g,""):t.vod_blurb?t.vod_blurb.replace(/<[^>]+>/g,""):"暂无简介"}const a=new URLSearchParams(window.location.search),o=a.get("vod_id");o?e():t()}); \ No newline at end of file +document.addEventListener("DOMContentLoaded",()=>{function t(){function t(){window.scrollTo({top:0,behavior:"smooth"}),$(".joe_video__list-item").css("display","").html(""),o=!0,$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"maccms_list",ac:"videolist",t:i.t,pg:i.pg,wd:i.wd},success(t){if(1!==t.code)return $(".joe_video__list-item").css("display","block").html('

    数据加载失败!请检查!

    ');if(t.data.list.length){let e="";t.data.list.forEach(t=>{e+=`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t${t.vod_year}\n\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t\t${t.vod_name}\n\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t

    ${t.vod_name}

    \n\t\t\t\t\t\t\t\t
    `}),$(".joe_video__list-item").html(e)}else $(".joe_video__list-item").css("display","block").html('

    暂无数据!

    ');a=t.data.pagecount,e()},complete:()=>o=!1})}function e(){if(0==a)return $(".joe_video__pagination").hide();$(".joe_video__pagination").show();let t="";1!=i.pg&&(t+=`\n \t\t
  • 首页
  • \n \t\t
  • \n \n \t\t
  • \n \t\t
  • ${i.pg-1}
  • \n \t`),t+=`
  • ${i.pg}
  • `,i.pg!=a&&(t+=`\n \t\t
  • ${i.pg+1}
  • \n \t\t
  • \n \n \t\t
  • \n \t`),i.pg末页`),$(".joe_video__pagination").html(t)}let i={pg:"",t:"",wd:""},a="",o=!1;$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"maccms_list"},success(t){if(1!==t.code)return $(".joe_video__type-list").html(`
  • ${t.data}
  • `);if(!t.data.class.length)return $(".joe_video__type-list").html('
  • 暂无数据!
  • ');let e='
  • 全部
  • ';t.data.class.forEach(t=>e+=`
  • ${t.type_name}
  • `),$(".joe_video__type-list").html(e),$(".joe_video__type-list .item").first().click()}}),$(".joe_video__type-list").on("click",".item",function(){const e=$(this).attr("data-t");o||($(this).addClass("active").siblings().removeClass("active"),i.pg=1,i.t=e,i.wd="",$(".joe_video__list-search input").val(""),t())}),$(".joe_video__pagination").on("click",".joe_video__pagination-item",function(){const e=$(this).attr("data-pg");e&&!o&&(i.pg=Number(e),t())});const s=()=>{const e=$(".joe_video__list-search input").val();o||(i.pg=1,i.t="",i.wd=e,$(".joe_video__type-list .item").first().addClass("active").siblings().removeClass("active"),t())};$(".joe_video__list-search .button").on("click",s),$(".joe_video__list-search .input").on("keyup",t=>13===t.keyCode&&s())}function e(){const t=$(".joe_video__player-play").attr("data-player");$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"maccms_list",ac:"detail",ids:o},success(t){if(1!==t.code)return $(".joe_video__detail-info").html(`

    ${t.data}

    `);if(!t.data.list.length)return $(".joe_video__detail-info").html('

    数据抓取异常!请检查!

    ');const e=t.data.list[0];$(".joe_video__detail-info").html(`\n\t\t\t\t\t
    \n\t\t\t\t\t\t${e.vod_name}\n\t\t\t\t\t\t${e.vod_year}\n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t
    ${e.vod_name+(e.vod_remarks?" - "+e.vod_remarks:"")}
    \n\t\t\t\t\t\t
    类型:${e.vod_class||"未知"}
    \n\t\t\t\t\t\t
    主演:${e.vod_actor||"未知"}
    \n\t\t\t\t\t\t
    导演:${e.vod_director||"未知"}
    \n\t\t\t\t\t\t
    简介:${i(e)}
    \n\t\t\t\t\t
    \n\t\t\t\t`),$(".joe_video__player .joe_video__contain-title").html("正在播放:"+e.vod_name);let a=t=>{let e="",i=t.split("#");return i.forEach(t=>e+=`
  • ${t.split("$")[0]||""}
  • `),e},o=e.vod_play_from.split("$$$"),s=e.vod_play_url.split("$$$"),l=new Map;o.forEach((t,e)=>l.set(t,s[e]||[]));let d="",n=0;for(let[t,e]of l)n++,d+=`\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
    播放线路 ${n}
    \n\t\t\t\t\t\t\t
      ${a(e)}
    \n\t\t\t\t\t\t
    \n\t\t\t\t\t`;$(".joe_video__player").after(d),$(".joe_video__source").first().find(".joe_video__source-list .item").first().click()}}),$(document).on("click",".joe_video__source-list .item",function(){$(".joe_video__source-list .item").removeClass("active"),$(this).addClass("active");const e=$(this).attr("data-src")||$(this).html();$(".joe_video__player-play").attr({src:t+e});const i=$(".joe_video__player").offset().top-$(".joe_header").height()-15;window.scrollTo({top:i,behavior:"smooth"})})}function i(t){return t.vod_content?t.vod_content.replace(/<[^>]+>/g,""):t.vod_blurb?t.vod_blurb.replace(/<[^>]+>/g,""):"暂无简介"}const a=new URLSearchParams(window.location.search),o=a.get("vod_id");o?e():t()}); \ No newline at end of file diff --git a/assets/js/joe.wallpaper.js b/assets/js/joe.wallpaper.js index bf4981a..29e943f 100644 --- a/assets/js/joe.wallpaper.js +++ b/assets/js/joe.wallpaper.js @@ -5,6 +5,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'wallpaper_type' }, success(res) { if (res.code !== 1) return $('.joe_wallpaper__type-list').html('
  • 壁纸抓取失败!请联系作者!
  • '); @@ -30,6 +31,7 @@ document.addEventListener('DOMContentLoaded', () => { $.ajax({ url: Joe.BASE_API, type: 'POST', + dataType: 'json', data: { routeType: 'wallpaper_list', cid: queryData.cid, diff --git a/assets/js/joe.wallpaper.min.js b/assets/js/joe.wallpaper.min.js index c377ce4..021d283 100644 --- a/assets/js/joe.wallpaper.min.js +++ b/assets/js/joe.wallpaper.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",()=>{function t(){window.scrollTo({top:0,behavior:"smooth"}),$(".joe_wallpaper__list").html(""),l=!0,$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"wallpaper_list",cid:e.cid,start:e.start,count:e.count},success(t){if(1!==t.code)return l=!1;l=!1;let e="";t.data.forEach(t=>{e+=`\n \n 壁纸\n `}),$(".joe_wallpaper__list").html(e),i=t.total,a()}})}function a(){let t="";e.start/e.count!=0&&(t+=`\n
  • 首页
  • \n
  • \n \n
  • \n
  • ${Math.ceil(e.start/e.count)}
  • \n `),t+=`
  • ${Math.ceil(e.start/e.count)+1}
  • `,e.start!=i-e.count&&(t+=`\n
  • ${Math.ceil(e.start/e.count)+2}
  • \n
  • \n \n
  • \n `),e.start末页`),$(".joe_wallpaper__pagination").html(t)}let l=!1,e={cid:-999,start:-999,count:48},i=-999;$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"wallpaper_type"},success(t){if(1!==t.code)return $(".joe_wallpaper__type-list").html('
  • 壁纸抓取失败!请联系作者!
  • ');if(!t.data.length)return $(".joe_wallpaper__type-list").html('
  • 暂无数据!
  • ');let a="";t.data.forEach(t=>a+=`
  • ${t.name}
  • `),$(".joe_wallpaper__type-list").html(a),$(".joe_wallpaper__type-list .item").first().click()}}),$(".joe_wallpaper__type-list").on("click",".item",function(){const a=$(this).attr("data-cid");l||($(this).addClass("active").siblings().removeClass("active"),e.cid=a,e.start=0,t())}),$(".joe_wallpaper__pagination").on("click",".joe_wallpaper__pagination-item",function(){const a=$(this).attr("data-start");a&&!l&&(e.start=Number(a),t())})}); \ No newline at end of file +document.addEventListener("DOMContentLoaded",()=>{function t(){window.scrollTo({top:0,behavior:"smooth"}),$(".joe_wallpaper__list").html(""),l=!0,$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"wallpaper_list",cid:e.cid,start:e.start,count:e.count},success(t){if(1!==t.code)return l=!1;l=!1;let e="";t.data.forEach(t=>{e+=`\n \n 壁纸\n `}),$(".joe_wallpaper__list").html(e),i=t.total,a()}})}function a(){let t="";e.start/e.count!=0&&(t+=`\n
  • 首页
  • \n
  • \n \n
  • \n
  • ${Math.ceil(e.start/e.count)}
  • \n `),t+=`
  • ${Math.ceil(e.start/e.count)+1}
  • `,e.start!=i-e.count&&(t+=`\n
  • ${Math.ceil(e.start/e.count)+2}
  • \n
  • \n \n
  • \n `),e.start末页`),$(".joe_wallpaper__pagination").html(t)}let l=!1,e={cid:-999,start:-999,count:48},i=-999;$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"wallpaper_type"},success(t){if(1!==t.code)return $(".joe_wallpaper__type-list").html('
  • 壁纸抓取失败!请联系作者!
  • ');if(!t.data.length)return $(".joe_wallpaper__type-list").html('
  • 暂无数据!
  • ');let a="";t.data.forEach(t=>a+=`
  • ${t.name}
  • `),$(".joe_wallpaper__type-list").html(a),$(".joe_wallpaper__type-list .item").first().click()}}),$(".joe_wallpaper__type-list").on("click",".item",function(){const a=$(this).attr("data-cid");l||($(this).addClass("active").siblings().removeClass("active"),e.cid=a,e.start=0,t())}),$(".joe_wallpaper__pagination").on("click",".joe_wallpaper__pagination-item",function(){const a=$(this).attr("data-start");a&&!l&&(e.start=Number(a),t())})}); \ No newline at end of file diff --git a/core/function.php b/core/function.php index e3f91b4..065a739 100644 --- a/core/function.php +++ b/core/function.php @@ -2,7 +2,7 @@ /* 获取主题当前版本号 */ function _getVersion() { - return "6.1.1"; + return "6.1.2"; }; /* 判断是否是手机 */ diff --git a/core/short.php b/core/short.php index 7ed03f2..53d7168 100644 --- a/core/short.php +++ b/core/short.php @@ -2,10 +2,31 @@ function _parseContent($post, $login) { - /* 优先判断文章内是否有回复可见的内容 */ $content = $post->content; - /* 过滤表情 */ $content = _parseReply($content); + + /* 已测试 √ */ + if (strpos($content, '{x}') !== false || strpos($content, '{ }') !== false) { + $content = strtr($content, array( + "{x}" => '', + "{ }" => '' + )); + } + + + + + + + /* 过滤网易云音乐 - */ + if (strpos($content, '{music') !== false) { + $content = preg_replace('/{music-list(.*)\/}/SU', '', $content); + $content = preg_replace('/{music(.*)\/}/SU', '', $content); + } + + + + /* 过滤默认卡片 */ if (strpos($content, '{card-default') !== false) { $content = preg_replace('/{card-default(.*)}/SU', '', $content); @@ -21,18 +42,8 @@ function _parseContent($post, $login) $content = strtr($content, array("{hide}" => "", "{/hide}" => "")); } } - /* 过滤网易云音乐 */ - if (strpos($content, '{music') !== false) { - $content = preg_replace('/{music-list(.*)\/}/SU', '', $content); - $content = preg_replace('/{music(.*)\/}/SU', '', $content); - } - /* 过滤完成任务勾选 */ - if (strpos($content, '{x}') !== false || strpos($content, '{ }') !== false) { - $content = strtr($content, array( - "{x}" => '', - "{ }" => '' - )); - } + + /* 过滤dplayer播放器 */ if (strpos($content, '{dplayer') !== false) { $player = Helper::options()->JCustomPlayer ? Helper::options()->JCustomPlayer : '/usr/themes/Joe/library/player.php?url='; diff --git a/package.json b/package.json index 678b4c2..987c3dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typecho-joe-next", - "version": "6.1.1", + "version": "6.1.2", "description": "A Theme Of Typecho", "main": "index.php", "keywords": [ diff --git a/typecho/write/js/joe.write.chunk.js b/typecho/write/js/joe.write.chunk.js index eb6ab74..dc09a7f 100644 --- a/typecho/write/js/joe.write.chunk.js +++ b/typecho/write/js/joe.write.chunk.js @@ -13516,7 +13516,7 @@ if (selection === '') this._setCursor(cm, cursor + str.length + 1); cm.focus(); } - handleFullScreen(cm, el) { + handleFullScreen(el) { el.toggleClass('active'); $('body').toggleClass('fullscreen'); $('.cm-container').toggleClass('fullscreen'); @@ -13943,6 +13943,7 @@ data: formData, contentType: false, processData: false, + dataType: 'json', xhr: () => { const xhr = $.ajaxSettings.xhr(); if (!xhr.upload) return; @@ -14038,7 +14039,7 @@ e.preventDefault(); switch (item.type) { case 'fullScreen': - super.handleFullScreen(this.cm, el); + super.handleFullScreen(el); break; case 'publish': super.handlePublish(); diff --git a/typecho/write/js/joe.write.js b/typecho/write/js/joe.write.js index cac7f30..6849b90 100644 --- a/typecho/write/js/joe.write.js +++ b/typecho/write/js/joe.write.js @@ -51,7 +51,7 @@ class JoeAction { if (selection === '') this._setCursor(cm, cursor + str.length + 1); cm.focus(); } - handleFullScreen(cm, el) { + handleFullScreen(el) { el.toggleClass('active'); $('body').toggleClass('fullscreen'); $('.cm-container').toggleClass('fullscreen'); @@ -478,6 +478,7 @@ class Joe extends JoeAction { data: formData, contentType: false, processData: false, + dataType: 'json', xhr: () => { const xhr = $.ajaxSettings.xhr(); if (!xhr.upload) return; @@ -573,7 +574,7 @@ class Joe extends JoeAction { e.preventDefault(); switch (item.type) { case 'fullScreen': - super.handleFullScreen(this.cm, el); + super.handleFullScreen(el); break; case 'publish': super.handlePublish();