From ca6edcc273a0376ad6cd9727147c217795885230 Mon Sep 17 00:00:00 2001 From: yellowsink Date: Sat, 10 Feb 2024 14:50:45 +0000 Subject: [PATCH] deploy: b08334baddf2147cc0564290c7ebc966f2ac4d27 --- invidivizer/plugin.js | 2 +- invidivizer/plugin.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/invidivizer/plugin.js b/invidivizer/plugin.js index ef328ae..c0f710d 100644 --- a/invidivizer/plugin.js +++ b/invidivizer/plugin.js @@ -1 +1 @@ -(()=>{var _=Object.create;var a=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of g(t))!v.call(e,r)&&r!==n&&a(e,r,{get:()=>t[r],enumerable:!(s=S(t,r))||s.enumerable});return e};var c=(e,t,n)=>(n=e!=null?_(x(e)):{},u(t||!e||!e.__esModule?a(n,"default",{value:e,enumerable:!0}):n,e)),y=e=>u(a({},"__esModule",{value:!0}),e);var o=T((F,d)=>{d.exports=shelter.solidWeb});var R={};$(R,{onUnload:()=>H,settings:()=>P});var f=c(o(),1),l=c(o(),1),p=c(o(),1),E=c(o(),1),C=(0,f.template)('',2),{plugin:{store:i},observeDom:I,flux:{dispatcher:h,storesFlat:{SelectedChannelStore:w}},util:{reactFiberWalker:D,getFiber:G},ui:{Header:z,HeaderTags:M,TextBox:N}}=shelter;i.instance??="invidious.slipfox.xyz";var b=["MESSAGE_CREATE","MESSAGE_UPDATE","UPDATE_CHANNEL_DIMENSIONS"];function A(e){if(!i.instance||(e.type==="MESSAGE_CREATE"||e.type==="MESSAGE_UPDATE")&&e.message.channel_id!==w.getChannelId())return;let t=I('[id^="chat-messages-"] article:not([data-invidivizer])',n=>{n.dataset.invidivizer="1",t();let s=D(G(n),"embed",!0)?.memoizedProps?.embed?.url;if(typeof s!="string"||!s.startsWith("https://www.youtube.com"))return;let r=s.match(/v=([a-zA-Z0-9-_]+)/);r?.[1]&&(n.style.display="none",n.insertAdjacentElement("afterend",(()=>{let m=C.cloneNode(!0);return(0,E.effect)(()=>(0,p.setAttribute)(m,"src",`https://${i.instance}/embed/${r[1]}`)),m})()))});setTimeout(t,1e3)}for(let e of b)h.subscribe(e,A);function H(){for(let e of b)h.unsubscribe(e,A)}var P=()=>[(0,l.createComponent)(z,{get tag(){return M.H3},children:"Invidious Instance"}),(0,l.createComponent)(N,{placeholder:"my.instance.com",get value(){return i.instance},onInput:e=>i.instance=e})];return y(R);})(); +(()=>{var _=Object.create;var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of S(t))!x.call(e,s)&&s!==n&&a(e,s,{get:()=>t[s],enumerable:!(i=g(t,s))||i.enumerable});return e};var c=(e,t,n)=>(n=e!=null?_(v(e)):{},u(t||!e||!e.__esModule?a(n,"default",{value:e,enumerable:!0}):n,e)),y=e=>u(a({},"__esModule",{value:!0}),e);var o=T((F,f)=>{f.exports=shelter.solidWeb});var R={};$(R,{onUnload:()=>H,settings:()=>P});var d=c(o(),1),l=c(o(),1),p=c(o(),1),E=c(o(),1),C=(0,d.template)('',2),{plugin:{store:r},observeDom:I,flux:{dispatcher:h,storesFlat:{SelectedChannelStore:w}},util:{reactFiberWalker:D,getFiber:G},ui:{Header:z,HeaderTags:M,TextBox:N}}=shelter;r.instance==="invidious.slipfox.xyz"&&!r.sfmigrate&&(r.sfmigrate=1,r.instance=null);r.instance??="inv.n8pjl.ca";var b=["MESSAGE_CREATE","MESSAGE_UPDATE","UPDATE_CHANNEL_DIMENSIONS"];function A(e){if(!r.instance||(e.type==="MESSAGE_CREATE"||e.type==="MESSAGE_UPDATE")&&e.message.channel_id!==w.getChannelId())return;let t=I('[id^="chat-messages-"] article:not([data-invidivizer])',n=>{n.dataset.invidivizer="1",t();let i=D(G(n),"embed",!0)?.memoizedProps?.embed?.url;if(typeof i!="string"||!i.startsWith("https://www.youtube.com"))return;let s=i.match(/v=([a-zA-Z0-9-_]+)/);s?.[1]&&(n.style.display="none",n.insertAdjacentElement("afterend",(()=>{let m=C.cloneNode(!0);return(0,E.effect)(()=>(0,p.setAttribute)(m,"src",`https://${r.instance}/embed/${s[1]}`)),m})()))});setTimeout(t,1e3)}for(let e of b)h.subscribe(e,A);function H(){for(let e of b)h.unsubscribe(e,A)}var P=()=>[(0,l.createComponent)(z,{get tag(){return M.H3},children:"Invidious Instance"}),(0,l.createComponent)(N,{placeholder:"my.instance.com",get value(){return r.instance},onInput:e=>r.instance=e})];return y(R);})(); diff --git a/invidivizer/plugin.json b/invidivizer/plugin.json index 1921641..edc797b 100644 --- a/invidivizer/plugin.json +++ b/invidivizer/plugin.json @@ -1 +1 @@ -{"name":"Invidivizer","author":"Yellowsink","description":"Replaces Youtube embeds with invidious embeds in Discord","hash":"0324f12fcbe5d5a21860f3b4b25bca84"} \ No newline at end of file +{"name":"Invidivizer","author":"Yellowsink","description":"Replaces Youtube embeds with invidious embeds in Discord","hash":"3794bcd9dda0f9643006f4b49a389a8e"} \ No newline at end of file