parent
a257926609
commit
2c9793202d
1 changed files with 5 additions and 7 deletions
|
@ -65,9 +65,7 @@ const settings = definePluginSettings({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function openImage(url?: string) {
|
function openImage(url: string) {
|
||||||
if (!url) return;
|
|
||||||
|
|
||||||
const format = url.startsWith("/") ? "png" : settings.store.format;
|
const format = url.startsWith("/") ? "png" : settings.store.format;
|
||||||
|
|
||||||
const u = new URL(url, window.location.href);
|
const u = new URL(url, window.location.href);
|
||||||
|
@ -173,12 +171,12 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
// Make pfps clickable and add pointer cursor
|
// Make pfps clickable
|
||||||
{
|
{
|
||||||
find: ".AVATAR_DECORATION_STATUS_ROUND_16;",
|
find: "onAddFriend:function",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /memo\(.{0,50}(?=let{statusColor:\i,status:\i,...\i}=(\i),)/,
|
match: /\{src:(\i)(?=,avatarDecoration)/,
|
||||||
replace: (m, props) => `${m}${props}.onClick=()=>$self.openImage(${props}.src);${props}.style={cursor:${props}.src?"pointer":void 0};`
|
replace: "{src:$1,onClick:()=>$self.openImage($1)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Make banners clickable
|
// Make banners clickable
|
||||||
|
|
Loading…
Reference in a new issue