href.1712150016841.js 1.7 KB

1
  1. import{E as e,y as n}from"./index.1712150016841.js";import{a as i}from"./dialog.1712150016841.js";const t={"tab://setting":()=>{e.emit("openController")},"tab://addSearchEngine":(n={})=>{n.size={width:window.innerWidth<500?"380px":"600px",height:"400px",top:window.innerHeight>700?"260px":"15vh"},n.component="addSearchEngine",e.emit("openPlugin",n)},"tab://addicon":(n={})=>{n.full=!1,n.size={width:window.innerWidth<500?"calc(100% - 15px)":"1000px",height:window.innerWidth>500?"550px":window.innerHeight-200+"px"},n.component="addicon",e.emit("openPlugin",n)},"tab://editAll":(e={})=>{setTimeout((()=>{n.state.editStatus=!0}),100)},"tab://background":(n={})=>{n.full=!1,n.size={width:window.innerWidth<500?"calc(100% - 15px)":"1000px",height:window.innerWidth>500?"550px":window.innerHeight-200+"px"},n.component="background",e.emit("openPlugin",n)}};window.openCard=function(e){let{width:n=null,height:t=null,minHeight:o=null,minWidth:d=null,custom:l={},origin:r={}}=e;l||(l={});const{width:a=(window.innerWidth<1250?850:1200),height:s=(window.innerHeight<750?550:700)}=l;new i({width:null==n?a:n,height:null==t?s:t,title:e.name,ico:e.src,url:e.url,minHeight:o,minWidth:d,custom:l,origin:r}).open()};const o=e=>{n.state.moveStatus=!1,window.openCard({name:e.name,src:e.src,url:e.window})},d=(e,i=0)=>{const t=n.getters.find(e);if(t){const{app:e=0,custom:n={}}=t;if(1===e){let e="";e=(/^http/.test(t.url),t.url),window.openCard({name:t.name,src:t.src,url:e,origin:t,custom:n})}else r(t.url)}},l=e=>{let n=document.createElement("a");n.href=e,n.target="_blank",n.click(),n.remove()},r=(e,i=!1)=>{if(t[e])t[e]();else if(i)l(e);else if(n.state.config.openType.linkOpen)l(e);else{let n=document.createElement("a");n.href=e,n.click(),n.remove()}};export{t as C,r as a,o as b,l as o,d as r};