diff --git a/archive.php b/archive.php index 526b081..f7737c6 100644 --- a/archive.php +++ b/archive.php @@ -3,10 +3,9 @@ need('public/include.php'); ?> - - + - + diff --git a/assets/css/joe.archive.css b/assets/css/joe.archive.min.css similarity index 100% rename from assets/css/joe.archive.css rename to assets/css/joe.archive.min.css diff --git a/assets/css/joe.archive.scss b/assets/css/joe.archive.min.scss similarity index 100% rename from assets/css/joe.archive.scss rename to assets/css/joe.archive.min.scss diff --git a/assets/css/joe.global.css b/assets/css/joe.global.min.css similarity index 100% rename from assets/css/joe.global.css rename to assets/css/joe.global.min.css diff --git a/assets/css/joe.global.scss b/assets/css/joe.global.min.scss similarity index 100% rename from assets/css/joe.global.scss rename to assets/css/joe.global.min.scss diff --git a/assets/css/joe.index.css b/assets/css/joe.index.min.css similarity index 100% rename from assets/css/joe.index.css rename to assets/css/joe.index.min.css diff --git a/assets/css/joe.index.scss b/assets/css/joe.index.min.scss similarity index 100% rename from assets/css/joe.index.scss rename to assets/css/joe.index.min.scss diff --git a/assets/css/joe.live.css b/assets/css/joe.live.min.css similarity index 100% rename from assets/css/joe.live.css rename to assets/css/joe.live.min.css diff --git a/assets/css/joe.live.scss b/assets/css/joe.live.min.scss similarity index 100% rename from assets/css/joe.live.scss rename to assets/css/joe.live.min.scss diff --git a/assets/css/joe.mode.css b/assets/css/joe.mode.min.css similarity index 100% rename from assets/css/joe.mode.css rename to assets/css/joe.mode.min.css diff --git a/assets/css/joe.mode.scss b/assets/css/joe.mode.min.scss similarity index 100% rename from assets/css/joe.mode.scss rename to assets/css/joe.mode.min.scss diff --git a/assets/css/joe.normalize.css b/assets/css/joe.normalize.min.css similarity index 100% rename from assets/css/joe.normalize.css rename to assets/css/joe.normalize.min.css diff --git a/assets/css/joe.normalize.scss b/assets/css/joe.normalize.min.scss similarity index 100% rename from assets/css/joe.normalize.scss rename to assets/css/joe.normalize.min.scss diff --git a/assets/css/joe.post.css b/assets/css/joe.post.min.css similarity index 100% rename from assets/css/joe.post.css rename to assets/css/joe.post.min.css diff --git a/assets/css/joe.post.scss b/assets/css/joe.post.min.scss similarity index 100% rename from assets/css/joe.post.scss rename to assets/css/joe.post.min.scss diff --git a/assets/css/joe.responsive.css b/assets/css/joe.responsive.min.css similarity index 100% rename from assets/css/joe.responsive.css rename to assets/css/joe.responsive.min.css diff --git a/assets/css/joe.responsive.scss b/assets/css/joe.responsive.min.scss similarity index 100% rename from assets/css/joe.responsive.scss rename to assets/css/joe.responsive.min.scss diff --git a/assets/css/joe.video.css b/assets/css/joe.video.min.css similarity index 100% rename from assets/css/joe.video.css rename to assets/css/joe.video.min.css diff --git a/assets/css/joe.video.scss b/assets/css/joe.video.min.scss similarity index 100% rename from assets/css/joe.video.scss rename to assets/css/joe.video.min.scss diff --git a/assets/css/joe.wallpaper.css b/assets/css/joe.wallpaper.min.css similarity index 100% rename from assets/css/joe.wallpaper.css rename to assets/css/joe.wallpaper.min.css diff --git a/assets/css/joe.wallpaper.scss b/assets/css/joe.wallpaper.min.scss similarity index 100% rename from assets/css/joe.wallpaper.scss rename to assets/css/joe.wallpaper.min.scss diff --git a/assets/js/joe.archive.min.js b/assets/js/joe.archive.min.js new file mode 100644 index 0000000..f8fcb77 --- /dev/null +++ b/assets/js/joe.archive.min.js @@ -0,0 +1 @@ +document.addEventListener("DOMContentLoaded",function(){var t=$(".joe_archive__list").attr("data-wow");"off"!==t&&t&&new WOW({boxClass:"wow",animateClass:"animated ".concat(t),offset:0,mobile:!0,live:!0,scrollContainer:null}).init()}); \ No newline at end of file diff --git a/assets/js/joe.extend.js b/assets/js/joe.extend.min.js similarity index 100% rename from assets/js/joe.extend.js rename to assets/js/joe.extend.min.js diff --git a/assets/js/joe.global.min.js b/assets/js/joe.global.min.js new file mode 100644 index 0000000..67da51c --- /dev/null +++ b/assets/js/joe.global.min.js @@ -0,0 +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(`https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/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:"https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/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 diff --git a/assets/js/joe.index.min.js b/assets/js/joe.index.min.js new file mode 100644 index 0000000..1b3ae11 --- /dev/null +++ b/assets/js/joe.index.min.js @@ -0,0 +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 diff --git a/assets/js/joe.live.min.js b/assets/js/joe.live.min.js new file mode 100644 index 0000000..42a4e78 --- /dev/null +++ b/assets/js/joe.live.min.js @@ -0,0 +1 @@ +document.addEventListener("DOMContentLoaded",()=>{function a(){function a(){$.ajax({url:"https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/json/joe.live.json",success(a){const t=a[n.index];$(".joe_live__type-title .text").html(t.name);let e='
  • 全部
  • ';t.list.forEach(a=>e+=`
  • ${a.name}
  • `),$(".joe_live__type-list").html(e),$(".joe_live__type-list .item").first().click()}})}function t(){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 t="";a.data.datas.forEach(a=>{t+=`\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(t),n.totalPage=a.data.totalPage,e()},complete:()=>n.isLoading=!1})}function e(){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"),t())}),a(),$(".joe_live__pagination").on("click",".joe_live__pagination-item",function(){const a=$(this).attr("data-page");a&&!n.isLoading&&(n.page=Number(a),t())})}const t=new URLSearchParams(window.location.search);t.get("profileRoom")||a()}); \ No newline at end of file diff --git a/assets/js/joe.post&page.min.js b/assets/js/joe.post&page.min.js new file mode 100644 index 0000000..1fc6291 --- /dev/null +++ b/assets/js/joe.post&page.min.js @@ -0,0 +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)}),new ClipboardJS(".joe_detail__article-copy").on("success",()=>Qmsg.success("复制成功!")),$(".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()}$(".joe_mp3__player").each((e,t)=>new Plyr(t,{settings:[],iconUrl:"https://cdn.jsdelivr.net/npm/plyr@3.6.4/dist/plyr.svg"}))}),window.addEventListener("load",function(){$(".joe_detail__article-hide i").on("click",function(){const e=$(".joe_comment").offset().top-$(".joe_header").height()-15;window.scrollTo({top:e,behavior:"smooth"})});{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.video.min.js b/assets/js/joe.video.min.js new file mode 100644 index 0000000..4cccaae --- /dev/null +++ b/assets/js/joe.video.min.js @@ -0,0 +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 diff --git a/assets/js/joe.wallpaper.min.js b/assets/js/joe.wallpaper.min.js new file mode 100644 index 0000000..c377ce4 --- /dev/null +++ b/assets/js/joe.wallpaper.min.js @@ -0,0 +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 diff --git a/core/factory.php b/core/factory.php index 77ba315..75be86b 100644 --- a/core/factory.php +++ b/core/factory.php @@ -9,9 +9,9 @@ class Editor { public static function edit() { - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; if (Helper::options()->JPasteUpload === "on") { ?> - + diff --git a/functions.php b/functions.php index 513bc28..3301260 100644 --- a/functions.php +++ b/functions.php @@ -18,8 +18,8 @@ function themeConfig($form) } catch (Exception $e) { } ?> - - + +
    diff --git a/index.php b/index.php index 0462ec6..6378451 100644 --- a/index.php +++ b/index.php @@ -13,11 +13,11 @@ need('public/include.php'); ?> - + - + diff --git a/library/debug.html b/library/debug.html index 6bb527c..52f92d4 100644 --- a/library/debug.html +++ b/library/debug.html @@ -1 +1,15 @@ -Document \ No newline at end of file + + + + + + + Document + + + + + + + \ No newline at end of file diff --git a/live.php b/live.php index 2c6a29a..3b1f6de 100644 --- a/live.php +++ b/live.php @@ -14,9 +14,8 @@ need('public/include.php'); ?> - - - + + diff --git a/page.php b/page.php index 8b9c642..554251f 100644 --- a/page.php +++ b/page.php @@ -9,7 +9,7 @@ - + diff --git a/post.php b/post.php index 1908762..e66d04f 100644 --- a/post.php +++ b/post.php @@ -6,17 +6,16 @@ - + - +
    need('public/header.php'); ?> -
    • @@ -35,7 +34,6 @@
    • 正文
    -
    @@ -51,7 +49,6 @@
    need('public/aside.php'); ?>
    - need('public/footer.php'); ?>
    diff --git a/public/copyright.php b/public/copyright.php index 17093f0..2efc02a 100644 --- a/public/copyright.php +++ b/public/copyright.php @@ -17,7 +17,6 @@ 本文链接: permalink() ?> - (转载时请注明本文出处及文章链接)
    diff --git a/public/include.php b/public/include.php index f105349..30a9cbe 100644 --- a/public/include.php +++ b/public/include.php @@ -16,10 +16,10 @@ header(); ?> - - - - + + + + options->JAside_Weather_Key) : ?> @@ -33,8 +33,8 @@ - - + + options->JCursorEffects && $this->options->JCursorEffects !== 'off') : ?> diff --git a/typecho/config/joe.config.css b/typecho/config/css/joe.config.min.css similarity index 100% rename from typecho/config/joe.config.css rename to typecho/config/css/joe.config.min.css diff --git a/typecho/config/joe.config.scss b/typecho/config/css/joe.config.min.scss similarity index 100% rename from typecho/config/joe.config.scss rename to typecho/config/css/joe.config.min.scss diff --git a/typecho/config/joe.config.js b/typecho/config/js/joe.config.min.js similarity index 100% rename from typecho/config/joe.config.js rename to typecho/config/js/joe.config.min.js diff --git a/typecho/editor/joe.editor.css b/typecho/editor/css/joe.editor.min.css similarity index 100% rename from typecho/editor/joe.editor.css rename to typecho/editor/css/joe.editor.min.css diff --git a/typecho/editor/joe.editor.scss b/typecho/editor/css/joe.editor.min.scss similarity index 100% rename from typecho/editor/joe.editor.scss rename to typecho/editor/css/joe.editor.min.scss diff --git a/typecho/editor/joe.editor.js b/typecho/editor/joe.editor.js deleted file mode 100644 index 94c710e..0000000 --- a/typecho/editor/joe.editor.js +++ /dev/null @@ -1,232 +0,0 @@ -$(function () { - $('#wmd-editarea textarea').attr('placeholder', '请输入文章内容...(开启粘贴上传功能后,支持图片粘贴上传哦~)'); - $('#wmd-button-bar .wmd-edittab').remove(); - $('#wmd-button-row .wmd-spacer').remove(); - $('#wmd-button-row #wmd-code-button').remove(); - $('#wmd-fullscreen-button').on('click', function () { - $('.fullscreen #text').css('top', $('.fullscreen #wmd-button-bar').outerHeight()); - }); - /* 增加自定义功能 */ - const items = [ - { - title: '回复可见', - id: 'wmd-hide-button', - svg: '' - }, - { - title: '网易云歌单', - id: 'wmd-mlist-button', - svg: '' - }, - { - title: '网易云音乐', - id: 'wmd-music-button', - svg: '' - }, - { - title: 'BiliBili视频', - id: 'wmd-bili-button', - svg: '' - }, - { - title: 'DPlayer视频', - id: 'wmd-dplayer-button', - svg: '' - }, - { - title: 'HTML代码', - id: 'wmd-html-button', - svg: '' - }, - { - title: 'H1 ~ H6标题', - id: 'wmd-title-button', - svg: '' - }, - { - title: '表格', - id: 'wmd-table-button', - svg: '' - }, - { - title: '删除线', - id: 'wmd-delete-button', - svg: '' - }, - { - title: '代码段', - id: 'wmd-snippet-button', - svg: '' - }, - { - title: '行内代码', - id: 'wmd-code-button', - svg: '' - }, - { - title: '任务列表', - id: 'wmd-task-button', - svg: '' - }, - { - title: '默认卡片', - id: 'wmd-card-button', - svg: '' - }, - { - title: '消息提示', - id: 'wmd-message-button', - svg: '' - }, - { - title: '居中标题', - id: 'wmd-mtitle-button', - svg: '' - }, - { - title: '便条按钮', - id: 'wmd-anote-button', - svg: '' - }, - { - title: '多彩按钮', - id: 'wmd-abtn-button', - svg: '' - }, - { - title: '点击复制', - id: 'wmd-copy-button', - svg: '' - }, - { - title: '插入音乐', - id: 'wmd-mp3-button', - svg: '' - }, - { - title: '缩进空格', - id: 'wmd-nbsp-button', - svg: '' - } - ]; - - /* 用于设置插入到文章的短代码内容 */ - function getInsertTextById(id) { - let str = ''; - switch (id) { - case 'wmd-hide-button': - str = `\n\n{hide}${$('#text').selectionRange() ? $('#text').selectionRange() : '回复可见'}{/hide}\n\n`; - break; - case 'wmd-mlist-button': - str = `\n\n{music-list id="网易云歌单ID" /}\n\n`; - break; - case 'wmd-music-button': - str = `\n\n{music id="网易云音乐ID" /}\n\n`; - break; - case 'wmd-bili-button': - str = `\n\n{bilibili bvid="哔哩哔哩的Bvid" /}\n\n`; - break; - case 'wmd-dplayer-button': - str = `\n\n{dplayer src="M3U8或MP4地址" /}\n\n`; - break; - case 'wmd-html-button': - str = `\n\n!!!\nHello Joe\n\n!!!\n\n`; - break; - case 'wmd-title-button': - str = `\n\n# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n\n`; - break; - case 'wmd-table-button': - str = `\n\n| 左对齐 | 右对齐 | 居中对齐 |\n| :-----| ----: | :----: |\n| 单元格 | 单元格 | 单元格 |\n\n`; - break; - case 'wmd-delete-button': - str = `~~${$('#text').selectionRange() ? $('#text').selectionRange() : '删除线'}~~`; - break; - case 'wmd-snippet-button': - str = `\n\n\`\`\`php\necho 'Hello Joe';\n\`\`\`\n\n`; - break; - case 'wmd-code-button': - str = ` \`${$('#text').selectionRange() ? $('#text').selectionRange() : '行内代码'}\` `; - break; - case 'wmd-task-button': - str = `{x} 任务已完成\n{ } 任务未完成`; - break; - case 'wmd-card-button': - str = `\n\n{card-default width="100%" label="卡片标题"}${$('#text').selectionRange() ? $('#text').selectionRange() : '卡片内容'}{/card-default}\n\n`; - break; - case 'wmd-message-button': - str = `\n\n{message type="success|info|warning|error"}${$('#text').selectionRange() ? $('#text').selectionRange() : '提示内容'}{/message}\n\n`; - break; - case 'wmd-mtitle-button': - str = `\n\n{mtitle}${$('#text').selectionRange() ? $('#text').selectionRange() : '居中标题'}{/mtitle}\n\n`; - break; - case 'wmd-anote-button': - str = `{anote icon="Font Awesome图标" href="跳转地址" type="secondary|success|warning|error|info"}${$('#text').selectionRange() ? $('#text').selectionRange() : '便条按钮'}{/anote}`; - break; - case 'wmd-abtn-button': - str = `{abtn icon="Font Awesome图标" color="颜色值" href="跳转地址" radius="圆角(半圆17.5px)"}${$('#text').selectionRange() ? $('#text').selectionRange() : '多彩按钮'}{/abtn}`; - break; - case 'wmd-copy-button': - str = `{copy text="文本文本"}${$('#text').selectionRange() ? $('#text').selectionRange() : '点击复制'}{/copy}`; - break; - case 'wmd-mp3-button': - str = `\n\n{mp3 src="音乐地址" /}\n\n`; - break; - case 'wmd-nbsp-button': - str = '  '; - break; - } - return str; - } - /* 此处无需修改 */ - items.forEach(_ => { - let item = $(`
  • ${_.svg}
  • `); - item.on('mousedown', () => $('#text').insertContent(getInsertTextById(_.id))); - $('#wmd-button-row').append(item); - }); - $.ajax({ - url: 'https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/json/joe.owo.json', - success(res) { - let barStr = ''; - let scrollStr = ''; - for (let key in res) { - barStr += `
    ${key}
    `; - scrollStr += ` -
      - ${res[key].container.map(_ => `
    • ${_.icon}
    • `).join('')} -
    - `; - } - $('#wmd-button-row').append(` -
  • -
    - -
    -
    - ${scrollStr} -
    ${barStr}
    -
    -
  • - `); - $(document).on('click', function () { - $('.joe_owo__contain .box').removeClass('show'); - }); - $('.joe_owo__contain .seat').on('click', function (e) { - e.stopPropagation(); - $(this).siblings('.box').toggleClass('show'); - }); - $('.joe_owo__contain .box .bar .item').on('click', function (e) { - e.stopPropagation(); - $(this).addClass('active').siblings().removeClass('active'); - const scrollIndx = '.joe_owo__contain .box .scroll[data-index="' + $(this).attr('data-index') + '"]'; - $(scrollIndx).show().siblings('.scroll').hide(); - }); - /* 点击表情,向文本框插入内容 */ - $('.joe_owo__contain .scroll .item').on('click', function () { - const text = $(this).attr('data-text'); - $('#text').insertContent(text); - }); - /* 默认激活第一个 */ - $('.joe_owo__contain .box .bar .item').first().click(); - } - }); -}); diff --git a/typecho/editor/js/joe.editor.js b/typecho/editor/js/joe.editor.js new file mode 100644 index 0000000..1558567 --- /dev/null +++ b/typecho/editor/js/joe.editor.js @@ -0,0 +1,241 @@ +$(function () { + $('#wmd-editarea textarea').attr('placeholder', '请输入文章内容...(开启粘贴上传功能后,支持图片粘贴上传哦~)'); + $('#wmd-button-bar .wmd-edittab').remove(); + $('#wmd-button-row .wmd-spacer').remove(); + $('#wmd-button-row #wmd-code-button').remove(); + $('#wmd-button-row #wmd-more-button').remove(); + $('#wmd-fullscreen-button').on('click', function () { + $('.fullscreen #text').css('top', $('.fullscreen #wmd-button-bar').outerHeight()); + }); + /* 增加自定义功能 */ + const items = [ + { + title: '回复可见', + id: 'wmd-hide-button', + svg: '' + }, + { + title: '网易云歌单', + id: 'wmd-mlist-button', + svg: '' + }, + { + title: '网易云音乐', + id: 'wmd-music-button', + svg: '' + }, + { + title: 'BiliBili视频', + id: 'wmd-bili-button', + svg: '' + }, + { + title: 'DPlayer视频', + id: 'wmd-dplayer-button', + svg: '' + }, + { + title: 'HTML代码', + id: 'wmd-html-button', + svg: '' + }, + { + title: 'H1 ~ H6标题', + id: 'wmd-title-button', + svg: '' + }, + { + title: '表格', + id: 'wmd-table-button', + svg: '' + }, + { + title: '删除线', + id: 'wmd-delete-button', + svg: '' + }, + { + title: '代码段', + id: 'wmd-snippet-button', + svg: '' + }, + { + title: '行内代码', + id: 'wmd-code-button', + svg: '' + }, + { + title: '任务列表', + id: 'wmd-task-button', + svg: '' + }, + { + title: '默认卡片', + id: 'wmd-card-button', + svg: '' + }, + { + title: '消息提示', + id: 'wmd-message-button', + svg: '' + }, + { + title: '居中标题', + id: 'wmd-mtitle-button', + svg: '' + }, + { + title: '便条按钮', + id: 'wmd-anote-button', + svg: '' + }, + { + title: '多彩按钮', + id: 'wmd-abtn-button', + svg: '' + }, + { + title: '点击复制', + id: 'wmd-copy-button', + svg: '' + }, + { + title: '插入音乐', + id: 'wmd-mp3-button', + svg: '' + }, + { + title: '缩进空格', + id: 'wmd-nbsp-button', + svg: '' + }, + // { + // title: '时间轴', + // id: 'wmd-timeline-button', + // svg: '' + // } + ]; + + /* 用于设置插入到文章的短代码内容 */ + function getInsertTextById(id) { + let str = ''; + switch (id) { + case 'wmd-hide-button': + str = `\n\n{hide}${$('#text').selectionRange() ? $('#text').selectionRange() : '回复可见'}{/hide}\n\n`; + break; + case 'wmd-mlist-button': + str = `\n\n{music-list id="网易云歌单ID" /}\n\n`; + break; + case 'wmd-music-button': + str = `\n\n{music id="网易云音乐ID" /}\n\n`; + break; + case 'wmd-bili-button': + str = `\n\n{bilibili bvid="哔哩哔哩的Bvid" /}\n\n`; + break; + case 'wmd-dplayer-button': + str = `\n\n{dplayer src="M3U8或MP4地址" /}\n\n`; + break; + case 'wmd-html-button': + str = `\n\n!!!\nHello Joe\n\n!!!\n\n`; + break; + case 'wmd-title-button': + str = `\n\n# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n\n`; + break; + case 'wmd-table-button': + str = `\n\n| 左对齐 | 右对齐 | 居中对齐 |\n| :-----| ----: | :----: |\n| 单元格 | 单元格 | 单元格 |\n\n`; + break; + case 'wmd-delete-button': + str = `~~${$('#text').selectionRange() ? $('#text').selectionRange() : '删除线'}~~`; + break; + case 'wmd-snippet-button': + str = `\n\n\`\`\`php\necho 'Hello Joe';\n\`\`\`\n\n`; + break; + case 'wmd-code-button': + str = ` \`${$('#text').selectionRange() ? $('#text').selectionRange() : '行内代码'}\` `; + break; + case 'wmd-task-button': + str = `{x} 任务已完成\n{ } 任务未完成`; + break; + case 'wmd-card-button': + str = `\n\n{card-default width="100%" label="卡片标题"}${$('#text').selectionRange() ? $('#text').selectionRange() : '卡片内容'}{/card-default}\n\n`; + break; + case 'wmd-message-button': + str = `\n\n{message type="success|info|warning|error"}${$('#text').selectionRange() ? $('#text').selectionRange() : '提示内容'}{/message}\n\n`; + break; + case 'wmd-mtitle-button': + str = `\n\n{mtitle}${$('#text').selectionRange() ? $('#text').selectionRange() : '居中标题'}{/mtitle}\n\n`; + break; + case 'wmd-anote-button': + str = `{anote icon="Font Awesome图标" href="跳转地址" type="secondary|success|warning|error|info"}${$('#text').selectionRange() ? $('#text').selectionRange() : '便条按钮'}{/anote}`; + break; + case 'wmd-abtn-button': + str = `{abtn icon="Font Awesome图标" color="颜色值" href="跳转地址" radius="圆角(半圆17.5px)"}${$('#text').selectionRange() ? $('#text').selectionRange() : '多彩按钮'}{/abtn}`; + break; + case 'wmd-copy-button': + str = `{copy text="文本文本"}${$('#text').selectionRange() ? $('#text').selectionRange() : '点击复制'}{/copy}`; + break; + case 'wmd-mp3-button': + str = `\n\n{mp3 src="音乐地址" /}\n\n`; + break; + case 'wmd-nbsp-button': + str = ' '; + break; + case 'wmd-timeline-button': + str = '\n\n{timeline}\n {timeline-item}内容内容{/timeline-item}\n {timeline-item}内容内容{/timeline-item}\n{/timeline}\n\n'; + break; + } + return str; + } + /* 此处无需修改 */ + items.forEach(_ => { + let item = $(`
  • ${_.svg}
  • `); + item.on('mousedown', () => $('#text').insertContent(getInsertTextById(_.id))); + $('#wmd-button-row').append(item); + }); + $.ajax({ + url: 'https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/json/joe.owo.json', + success(res) { + let barStr = ''; + let scrollStr = ''; + for (let key in res) { + barStr += `
    ${key}
    `; + scrollStr += ` +
      + ${res[key].container.map(_ => `
    • ${_.icon}
    • `).join('')} +
    + `; + } + $('#wmd-button-row').append(` +
  • +
    + +
    +
    + ${scrollStr} +
    ${barStr}
    +
    +
  • + `); + $(document).on('click', function () { + $('.joe_owo__contain .box').removeClass('show'); + }); + $('.joe_owo__contain .seat').on('click', function (e) { + e.stopPropagation(); + $(this).siblings('.box').toggleClass('show'); + }); + $('.joe_owo__contain .box .bar .item').on('click', function (e) { + e.stopPropagation(); + $(this).addClass('active').siblings().removeClass('active'); + const scrollIndx = '.joe_owo__contain .box .scroll[data-index="' + $(this).attr('data-index') + '"]'; + $(scrollIndx).show().siblings('.scroll').hide(); + }); + /* 点击表情,向文本框插入内容 */ + $('.joe_owo__contain .scroll .item').on('click', function () { + const text = $(this).attr('data-text'); + $('#text').insertContent(text); + }); + /* 默认激活第一个 */ + $('.joe_owo__contain .box .bar .item').first().click(); + } + }); +}); diff --git a/typecho/editor/js/joe.editor.min.js b/typecho/editor/js/joe.editor.min.js new file mode 100644 index 0000000..42aca60 --- /dev/null +++ b/typecho/editor/js/joe.editor.min.js @@ -0,0 +1 @@ +$(function(){function t(t){let c="";switch(t){case"wmd-hide-button":c=`\n\n{hide}${$("#text").selectionRange()?$("#text").selectionRange():"回复可见"}{/hide}\n\n`;break;case"wmd-mlist-button":c='\n\n{music-list id="网易云歌单ID" /}\n\n';break;case"wmd-music-button":c='\n\n{music id="网易云音乐ID" /}\n\n';break;case"wmd-bili-button":c='\n\n{bilibili bvid="哔哩哔哩的Bvid" /}\n\n';break;case"wmd-dplayer-button":c='\n\n{dplayer src="M3U8或MP4地址" /}\n\n';break;case"wmd-html-button":c='\n\n!!!\nHello Joe\n\n!!!\n\n';break;case"wmd-title-button":c="\n\n# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n\n";break;case"wmd-table-button":c="\n\n| 左对齐 | 右对齐 | 居中对齐 |\n| :-----| ----: | :----: |\n| 单元格 | 单元格 | 单元格 |\n\n";break;case"wmd-delete-button":c=`~~${$("#text").selectionRange()?$("#text").selectionRange():"删除线"}~~`;break;case"wmd-snippet-button":c="\n\n```php\necho 'Hello Joe';\n```\n\n";break;case"wmd-code-button":c=` \`${$("#text").selectionRange()?$("#text").selectionRange():"行内代码"}\` `;break;case"wmd-task-button":c="{x} 任务已完成\n{ } 任务未完成";break;case"wmd-card-button":c=`\n\n{card-default width="100%" label="卡片标题"}${$("#text").selectionRange()?$("#text").selectionRange():"卡片内容"}{/card-default}\n\n`;break;case"wmd-message-button":c=`\n\n{message type="success|info|warning|error"}${$("#text").selectionRange()?$("#text").selectionRange():"提示内容"}{/message}\n\n`;break;case"wmd-mtitle-button":c=`\n\n{mtitle}${$("#text").selectionRange()?$("#text").selectionRange():"居中标题"}{/mtitle}\n\n`;break;case"wmd-anote-button":c=`{anote icon="Font Awesome图标" href="跳转地址" type="secondary|success|warning|error|info"}${$("#text").selectionRange()?$("#text").selectionRange():"便条按钮"}{/anote}`;break;case"wmd-abtn-button":c=`{abtn icon="Font Awesome图标" color="颜色值" href="跳转地址" radius="圆角(半圆17.5px)"}${$("#text").selectionRange()?$("#text").selectionRange():"多彩按钮"}{/abtn}`;break;case"wmd-copy-button":c=`{copy text="文本文本"}${$("#text").selectionRange()?$("#text").selectionRange():"点击复制"}{/copy}`;break;case"wmd-mp3-button":c='\n\n{mp3 src="音乐地址" /}\n\n';break;case"wmd-nbsp-button":c=" ";break;case"wmd-timeline-button":c="\n\n{timeline}\n {timeline-item}内容内容{/timeline-item}\n {timeline-item}内容内容{/timeline-item}\n{/timeline}\n\n"}return c}$("#wmd-editarea textarea").attr("placeholder","请输入文章内容...(开启粘贴上传功能后,支持图片粘贴上传哦~)"),$("#wmd-button-bar .wmd-edittab").remove(),$("#wmd-button-row .wmd-spacer").remove(),$("#wmd-button-row #wmd-code-button").remove(),$("#wmd-button-row #wmd-more-button").remove(),$("#wmd-fullscreen-button").on("click",function(){$(".fullscreen #text").css("top",$(".fullscreen #wmd-button-bar").outerHeight())});const c=[{title:"回复可见",id:"wmd-hide-button",svg:''},{title:"网易云歌单",id:"wmd-mlist-button",svg:''},{title:"网易云音乐",id:"wmd-music-button",svg:''},{title:"BiliBili视频",id:"wmd-bili-button",svg:''},{title:"DPlayer视频",id:"wmd-dplayer-button",svg:''},{title:"HTML代码",id:"wmd-html-button",svg:''},{title:"H1 ~ H6标题",id:"wmd-title-button",svg:''},{title:"表格",id:"wmd-table-button",svg:''},{title:"删除线",id:"wmd-delete-button",svg:''},{title:"代码段",id:"wmd-snippet-button",svg:''},{title:"行内代码",id:"wmd-code-button",svg:''},{title:"任务列表",id:"wmd-task-button",svg:''},{title:"默认卡片",id:"wmd-card-button",svg:''},{title:"消息提示",id:"wmd-message-button",svg:''},{title:"居中标题",id:"wmd-mtitle-button",svg:''},{title:"便条按钮",id:"wmd-anote-button",svg:''},{title:"多彩按钮",id:"wmd-abtn-button",svg:''},{title:"点击复制",id:"wmd-copy-button",svg:''},{title:"插入音乐",id:"wmd-mp3-button",svg:''},{title:"缩进空格",id:"wmd-nbsp-button",svg:''}];c.forEach(c=>{let n=$(`
  • ${c.svg}
  • `);n.on("mousedown",()=>$("#text").insertContent(t(c.id))),$("#wmd-button-row").append(n)}),$.ajax({url:"https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/json/joe.owo.json",success(t){let c="",n="";for(let e in t)c+=`
    ${e}
    `,n+=`\n
      \n ${t[e].container.map(t=>`
    • ${t.icon}
    • `).join("")} \n
    \n `;$("#wmd-button-row").append(`\n
  • \n
    \n \n
    \n
    \n ${n}\n
    ${c}
    \n
    \n
  • \n `),$(document).on("click",function(){$(".joe_owo__contain .box").removeClass("show")}),$(".joe_owo__contain .seat").on("click",function(t){t.stopPropagation(),$(this).siblings(".box").toggleClass("show")}),$(".joe_owo__contain .box .bar .item").on("click",function(t){t.stopPropagation(),$(this).addClass("active").siblings().removeClass("active");const c='.joe_owo__contain .box .scroll[data-index="'+$(this).attr("data-index")+'"]';$(c).show().siblings(".scroll").hide()}),$(".joe_owo__contain .scroll .item").on("click",function(){const t=$(this).attr("data-text");$("#text").insertContent(t)}),$(".joe_owo__contain .box .bar .item").first().click()}})}); \ No newline at end of file diff --git a/typecho/editor/joe.extend.js b/typecho/editor/js/joe.extend.min.js similarity index 100% rename from typecho/editor/joe.extend.js rename to typecho/editor/js/joe.extend.min.js diff --git a/video.php b/video.php index d4ed421..d30816a 100644 --- a/video.php +++ b/video.php @@ -14,9 +14,8 @@ need('public/include.php'); ?> - - - + + diff --git a/wallpaper.php b/wallpaper.php index faf0ab1..9f1dffd 100644 --- a/wallpaper.php +++ b/wallpaper.php @@ -14,9 +14,8 @@ need('public/include.php'); ?> - - - + +