// ==UserScript== // @name V2EX Polish - 体验更现代化的 V2EX // @namespace LeoKu(https://leoku.top) // @version 1.2.4 // @description 一款专为 V2EX 用户设计的浏览器插件,提供了丰富的扩展功能,让原生页面焕然一新! // @author LeoKu // @match https://*.v2ex.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=v2ex.com // @grant none // @license MIT // @downloadURL none // ==/UserScript== "use strict";var y=(o,t)=>()=>(o&&(t=o(o=0)),t);var Jo,Qo,To,Yo,Qe,_o,io,q=y(()=>{"use strict";Jo="V2EX_Polish",Qo=[{title:"\u5C0F\u9EC4\u8138",list:["\u{1F600}","\u{1F601}","\u{1F602}","\u{1F923}","\u{1F605}","\u{1F60A}","\u{1F60B}","\u{1F618}","\u{1F970}","\u{1F617}","\u{1F929}","\u{1F914}","\u{1F928}","\u{1F610}","\u{1F611}","\u{1F644}","\u{1F60F}","\u{1F62A}","\u{1F62B}","\u{1F971}","\u{1F61C}","\u{1F612}","\u{1F614}","\u{1F628}","\u{1F630}","\u{1F631}","\u{1F975}","\u{1F621}","\u{1F973}","\u{1F97A}","\u{1F92D}","\u{1F9D0}","\u{1F913}","\u{1F62D}","\u{1F911}","\u{1F92E}"]},{title:"\u624B\u52BF",list:["\u{1F64B}","\u{1F64E}","\u{1F645}","\u{1F647}","\u{1F937}","\u{1F90F}","\u{1F449}","\u270C\uFE0F","\u{1F918}","\u{1F919}","\u{1F44C}","\u{1F90C}","\u{1F44D}","\u{1F44E}","\u{1F44B}","\u{1F91D}","\u{1F64F}","\u{1F44F}"]},{title:"\u5E86\u795D",list:["\u2728","\u{1F389}","\u{1F38A}"]},{title:"\u5176\u4ED6",list:["\u{1F47B}","\u{1F921}","\u{1F414}","\u{1F440}","\u{1F4A9}","\u{1F434}","\u{1F984}","\u{1F427}","\u{1F436}","\u{1F412}","\u{1F648}","\u{1F649}","\u{1F64A}","\u{1F435}"]}],To=250,Yo=550,Qe=60*60*1e3,_o=["3107b9ef8b316f3","442b04f26eefc8a","59cfebe717c09e4","60605aad4a62882","6c65ab1d3f5452a","83e123737849aa9","9311f6be1c10160","c4a4a563f698595","81be04b9e4a08ce"],io={openInNewTab:!1,autoCheckIn:{enabled:!0},nestedReply:{display:"align"}}});var Zo,Y,Ko,ao,ot,tt,et,nt,rt,co,it,at,ct,lt,st,pt,I=y(()=>{"use strict";Zo=` `,Y=` `,Ko=` `,ao=` `,ot=` `,tt=` `,et=` `,nt=` `,rt=` `,co=` `,it=` `,at=` `,ct=` `,lt=` `,st=` `,pt=` `});var se={};var dt=y(()=>{"use strict";q();I();$("#Top .site-nav .tools > .top").addClass("v2p-hover-btn");{let o=$("#Rightbar .light-toggle").addClass("v2p-color-mode-toggle"),t=o.find("> img");t.prop("alt")==="Light"&&(o.prop("title","\u4F7F\u7528\u6DF1\u8272\u4E3B\u9898"),t.replaceWith(pt)),t.prop("alt")==="Dark"&&(o.prop("title","\u4F7F\u7528\u6D45\u8272\u4E3B\u9898"),t.replaceWith(st))}{let o=$(`
`);$(` `).prependTo(o),$("#Bottom .content").append(o)}});function vt(o){return typeof o=="object"&&o!==null}function Ao(o,t){let n={};for(let e in o)vt(o[e])&&vt(t[e])?n[e]=Ao(o[e],t[e]):Reflect.has(t,e)?n[e]=t[e]:n[e]=o[e];for(let e in t)Reflect.has(o,e)||(n[e]=t[e]);return n}var ft=y(()=>{"use strict"});function mt(){let o=window.navigator.userAgent.toLowerCase(),t=/(macintosh|macintel|macppc|mac68k|macos)/i,n=/(win32|win64|windows|wince)/i,e=/(iphone|ipad|ipod)/i,r=null;return t.test(o)?r="macos":e.test(o)?r="ios":n.test(o)?r="windows":o.includes("android")?r="android":o.includes("linux")&&(r="linux"),r}function lo(o,{format:t="YMD"}={}){let n=new Date(o.toString().length===10?o*1e3:o),e=n.getFullYear().toString(),r=(n.getMonth()+1).toString().padStart(2,"0"),i=n.getDate().toString().padStart(2,"0"),c=`${e}-${r}-${i}`;if(t==="YMDHMS"){let a=n.getHours().toString().padStart(2,"0"),l=n.getMinutes().toString().padStart(2,"0"),s=n.getSeconds().toString().padStart(2,"0");return`${c} ${a}:${l}:${s}`}return c}function so(){return new Promise(o=>{if(typeof chrome>"u"||typeof chrome.storage>"u")return o(void 0);chrome.storage.sync.get("api",t=>{o(t["api"]?.pat)})})}function _(){return new Promise(o=>{if(typeof chrome>"u"||typeof chrome.storage>"u")return o(io);chrome.storage.sync.get("options",t=>{let n=t["options"];o(n?Ao(io,n):io)})})}function po(o){return o.replace(/[<>&"'']/g,t=>{switch(t){case"<":return"<";case">":return">";case"&":return"&";case'"':return""";case"'":return"'";default:return t}})}var B=y(()=>{"use strict";q();ft()});function E(o){let{children:t,className:n="",type:e="button",tag:r="button"}=o,i=$(`<${r} class="normal button ${n}">${t}${r}>`);return r==="button"&&i.prop("type",e),i}var vo=y(()=>{"use strict"});function fo(o){let{root:t,title:n,onOpen:e,onClose:r,onMount:i}=o,c=$('\u8BE5\u4E3B\u9898\u6CA1\u6709\u6B63\u6587\u5185\u5BB9