generated from moonlight-mod/sample-extension
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Media Tweaks in a basic form as work check-in
Only has Image URLs and No GIF Autosend implemented currently, but options for Video Filenames and Inline Mosaic Playback.
- Loading branch information
1 parent
e24ff51
commit 1bef541
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Patch } from "@moonlight-mod/types"; | ||
|
||
export const patches: Patch[] = [ | ||
// Image URLs | ||
{ | ||
find: "allowLinks:!!", | ||
replace: { | ||
match: /,(\(null!=.\?.:.\)\.embeds\)\),)/, | ||
replacement: (_, orig) => | ||
`,moonlight.getConfigOption("mediaTweaks","imageUrls")??true?{}:${orig}` | ||
} | ||
}, | ||
|
||
// No GIF Autosend | ||
{ | ||
find: ".TOGGLE_GIF_PICKER,handler:", | ||
replace: { | ||
match: /.{1,2}===.\..\.CREATE_FORUM_POST/, | ||
replacement: (orig: string) => | ||
`(moonlight.getConfigOption("mediaTweaks","noGifAutosend")??true?true:${orig})` | ||
} | ||
} | ||
]; | ||
|
||
//export const webpackModules: Record<string, ExtensionWebpackModule> = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"id": "mediaTweaks", | ||
"version": "1.0.0", | ||
"meta": { | ||
"name": "Media Tweaks", | ||
"tagline": "Various tweaks to images and videos. Every feature togglable.", | ||
"authors": [ | ||
"Cynosphere" | ||
], | ||
"tags": [ | ||
"qol", | ||
"chat" | ||
], | ||
"source": "https://github.com/Cynosphere/moonlight-extensions" | ||
}, | ||
"settings": { | ||
"imageUrls": { | ||
"displayName": "Image URLs", | ||
"type": "boolean", | ||
"default": true | ||
}, | ||
"noGifAutosend": { | ||
"displayName": "No GIF Autosend", | ||
"description": "Puts the URL in the textbox when clicking a GIF instead of automatically sending it", | ||
"type": "boolean", | ||
"default": true | ||
}, | ||
"videoFilenames": { | ||
"displayName": "Video Filenames", | ||
"type": "boolean", | ||
"default": true | ||
}, | ||
"inlineMosaicPlayback": { | ||
"displayName": "Inline Mosaic Playback", | ||
"description": "Allows videos in a media mosaic to be played inline instead of playing in a modal", | ||
"type": "boolean", | ||
"default": true | ||
} | ||
}, | ||
"apiLevel": 2 | ||
} |