From 7344bff617efa2f219c4955bcacd98f4c075ba7c Mon Sep 17 00:00:00 2001 From: j m <1406993111@qq.com> Date: Fri, 27 Dec 2024 08:00:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=89=93=E5=BC=80=E7=94=BB?= =?UTF-8?q?=E5=BB=8A=E4=B8=8D=E6=94=B9=E5=8F=98URL=E9=81=BF=E5=85=8Dpjax?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/common.js | 2 +- src/js/mew-custom.js | 2 +- templates/assets/js/common.min.js | 4 ++-- templates/assets/js/mew-custom.min.js | 2 +- templates/photos.html | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/common.js b/src/js/common.js index 5a99bc9..b212c21 100644 --- a/src/js/common.js +++ b/src/js/common.js @@ -61,7 +61,7 @@ const commonContext = { // 用链接和标题包装图像 $('.main-content img:not(.not-gallery)').each(function () { if ($(this).parents('[data-fancybox],mew-photos').length === 0) { - $(this).wrap(`
${this.alt}
` : ''}${this.alt}
`:""}${this.alt}
`:""}`)})},initMode(){let t=localStorage.getItem("night")||!1;const n=e=>{e?$("html").addClass("color-scheme-dark").removeClass("color-scheme-light").addClass("night"):$("html").addClass("color-scheme-light").removeClass("color-scheme-dark").removeClass("night"),localStorage.setItem("night",e),t=e};$("#toggle-mode").on("click",()=>n("true"!==t.toString())),"system"===DreamConfig.default_theme?window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>n(e.matches)):n("true"===t.toString())},initNavbar(){var t=$(".navbar-nav a"),e=$(".panel-side-menu .link");let n=0;var{href:a,pathname:i}=location;if(i&&"/"!==i)for(let e=0;e${this.innerHTML}
${i}${this.options.title||"我分享了一个网站"}
${i}${t}`,this.drawComplete()}}),customElements.define("mew-video",class extends i{init(){this.options={src:this.getAttribute("src"),type:this.getAttribute("type"),autoplay:this.hasAttribute("autoplay")&&"false"!==this.getAttribute("autoplay"),controls:"false"!==this.getAttribute("controls"),loop:this.hasAttribute("loop")&&"false"!==this.getAttribute("loop"),muted:this.hasAttribute("muted")&&"false"!==this.getAttribute("muted"),preload:this.hasAttribute("preload")&&"false"!==this.getAttribute("preload"),poster:this.getAttribute("poster"),width:/^\d{1,3}%$/.test(this.getAttribute("width"))?this.getAttribute("width"):"100%"},this.innerHTML=``,this.drawComplete()}}),customElements.define("mew-photos",class t extends i{init(){$.fn.justifiedGallery?this.render():t.prototype.load?t.prototype.await.push(()=>this.render()):(t.prototype.load=!0,t.prototype.await=[],new Promise(t=>{Utils.cachedScript("https://unpkg.com/justifiedGallery@3.8.1/dist/js/jquery.justifiedGallery.min.js").done(()=>t()).fail(()=>t())}).then(()=>{this.render(),t.prototype.await&&t.prototype.await.forEach(t=>t())}))}render(){this.options={captions:this.hasAttribute("captions")&&"false"!==this.getAttribute("captions"),margins:this.getAttribute("margins")||"4"},$(this).find("img").each((t,i)=>{$(i).wrap(``)}),$(this).justifiedGallery({captions:this.options.captions,margins:this.options.margins}),this.drawComplete()}}),customElements.define("mew-raw",class extends i{init(){var t=this.innerHTML;this.innerHTML="",this.attachShadow({mode:"closed"}).innerHTML=t,this.drawComplete()}})})})(); \ No newline at end of file +${this.innerHTML}
${i}${this.options.title||"我分享了一个网站"}
${i}${t}`,this.drawComplete()}}),customElements.define("mew-video",class extends i{init(){this.options={src:this.getAttribute("src"),type:this.getAttribute("type"),autoplay:this.hasAttribute("autoplay")&&"false"!==this.getAttribute("autoplay"),controls:"false"!==this.getAttribute("controls"),loop:this.hasAttribute("loop")&&"false"!==this.getAttribute("loop"),muted:this.hasAttribute("muted")&&"false"!==this.getAttribute("muted"),preload:this.hasAttribute("preload")&&"false"!==this.getAttribute("preload"),poster:this.getAttribute("poster"),width:/^\d{1,3}%$/.test(this.getAttribute("width"))?this.getAttribute("width"):"100%"},this.innerHTML=``,this.drawComplete()}}),customElements.define("mew-photos",class t extends i{init(){$.fn.justifiedGallery?this.render():t.prototype.load?t.prototype.await.push(()=>this.render()):(t.prototype.load=!0,t.prototype.await=[],new Promise(t=>{Utils.cachedScript("https://unpkg.com/justifiedGallery@3.8.1/dist/js/jquery.justifiedGallery.min.js").done(()=>t()).fail(()=>t())}).then(()=>{this.render(),t.prototype.await&&t.prototype.await.forEach(t=>t())}))}render(){this.options={captions:this.hasAttribute("captions")&&"false"!==this.getAttribute("captions"),margins:this.getAttribute("margins")||"4"},$(this).find("img").each((t,i)=>{$(i).wrap(``)}),$(this).justifiedGallery({captions:this.options.captions,margins:this.options.margins}),this.drawComplete()}}),customElements.define("mew-raw",class extends i{init(){var t=this.innerHTML;this.innerHTML="",this.attachShadow({mode:"closed"}).innerHTML=t,this.drawComplete()}})})})(); \ No newline at end of file diff --git a/templates/photos.html b/templates/photos.html index 9b76d8d..340b8a0 100644 --- a/templates/photos.html +++ b/templates/photos.html @@ -11,7 +11,7 @@