plugins
This commit is contained in:
26
.config/BetterDiscord/plugins/0BDFDB.config.json
Normal file
26
.config/BetterDiscord/plugins/0BDFDB.config.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"all": {
|
||||
"changeLogs": {
|
||||
"BDFDB": "3.0.7",
|
||||
"CreationDate": "1.4.6",
|
||||
"EditRoles": "1.1.4",
|
||||
"ImageUtilities": "5.1.4",
|
||||
"NotificationSounds": "3.7.6",
|
||||
"PinDMs": "1.9.7",
|
||||
"PluginRepo": "2.4.5"
|
||||
},
|
||||
"choices": {
|
||||
"toastPosition": "right"
|
||||
},
|
||||
"general": {
|
||||
"shareData": true,
|
||||
"showToasts": true,
|
||||
"showSupportBadges": true,
|
||||
"useChromium": false
|
||||
},
|
||||
"hashes": {
|
||||
"0BDFDB.data.json": "05d61fe50fa9df357b274a55feb4d7d0e35056f6",
|
||||
"0BDFDB.raw.css": "a1c4a8b6f28c4765c6af2853ddf13a35922a2b9e"
|
||||
}
|
||||
}
|
||||
}
|
||||
5552
.config/BetterDiscord/plugins/0BDFDB.data.json
Normal file
5552
.config/BetterDiscord/plugins/0BDFDB.data.json
Normal file
File diff suppressed because it is too large
Load Diff
8463
.config/BetterDiscord/plugins/0BDFDB.plugin.js
Normal file
8463
.config/BetterDiscord/plugins/0BDFDB.plugin.js
Normal file
File diff suppressed because it is too large
Load Diff
1634
.config/BetterDiscord/plugins/0BDFDB.raw.css
Normal file
1634
.config/BetterDiscord/plugins/0BDFDB.raw.css
Normal file
File diff suppressed because it is too large
Load Diff
6315
.config/BetterDiscord/plugins/0PluginLibrary.plugin.js
Normal file
6315
.config/BetterDiscord/plugins/0PluginLibrary.plugin.js
Normal file
File diff suppressed because it is too large
Load Diff
199
.config/BetterDiscord/plugins/DiscordFreeEmojis.plugin.js
Normal file
199
.config/BetterDiscord/plugins/DiscordFreeEmojis.plugin.js
Normal file
@@ -0,0 +1,199 @@
|
||||
/**
|
||||
* @name FreeEmojis
|
||||
* @version 1.7
|
||||
* @description Link emojis if you don't have nitro! Type them out or use the emoji picker!
|
||||
* @author An0
|
||||
* @source https://github.com/An00nymushun/DiscordFreeEmojis
|
||||
* @updateUrl https://raw.githubusercontent.com/An00nymushun/DiscordFreeEmojis/main/DiscordFreeEmojis.plugin.js
|
||||
*/
|
||||
|
||||
/*@cc_on
|
||||
@if (@_jscript)
|
||||
var shell = WScript.CreateObject("WScript.Shell");
|
||||
var fs = new ActiveXObject("Scripting.FileSystemObject");
|
||||
var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins");
|
||||
var pathSelf = WScript.ScriptFullName;
|
||||
shell.Popup("It looks like you've mistakenly tried to run me directly. \\n(Don't do that!)", 0, "I'm a plugin for BetterDiscord", 0x30);
|
||||
if (fs.GetParentFolderName(pathSelf) === fs.GetAbsolutePathName(pathPlugins)) {
|
||||
shell.Popup("I'm in the correct folder already.", 0, "I'm already installed", 0x40);
|
||||
} else if (!fs.FolderExists(pathPlugins)) {
|
||||
shell.Popup("I can't find the BetterDiscord plugins folder.\\nAre you sure it's even installed?", 0, "Can't install myself", 0x10);
|
||||
} else if (shell.Popup("Should I copy myself to BetterDiscord's plugins folder for you?", 0, "Do you need some help?", 0x34) === 6) {
|
||||
fs.CopyFile(pathSelf, fs.BuildPath(pathPlugins, fs.GetFileName(pathSelf)), true);
|
||||
// Show the user where to put plugins in the future
|
||||
shell.Exec("explorer " + pathPlugins);
|
||||
shell.Popup("I'm installed!", 0, "Successfully installed", 0x40);
|
||||
}
|
||||
WScript.Quit();
|
||||
@else @*/
|
||||
|
||||
|
||||
var FreeEmojis = (() => {
|
||||
|
||||
'use strict';
|
||||
|
||||
const BaseColor = "#0cf";
|
||||
|
||||
var Discord;
|
||||
var Utils = {
|
||||
Log: (message) => { console.log(`%c[FreeEmojis] %c${message}`, `color:${BaseColor};font-weight:bold`, "") },
|
||||
Warn: (message) => { console.warn(`%c[FreeEmojis] %c${message}`, `color:${BaseColor};font-weight:bold`, "") },
|
||||
Error: (message) => { console.error(`%c[FreeEmojis] %c${message}`, `color:${BaseColor};font-weight:bold`, "") },
|
||||
Webpack: () => {
|
||||
let webpackExports;
|
||||
|
||||
if(typeof BdApi !== "undefined" && BdApi?.findModuleByProps && BdApi?.findModule) {
|
||||
return { findModule: BdApi.findModule, findModuleByUniqueProperties: (props) => BdApi.findModuleByProps.apply(null, props) };
|
||||
}
|
||||
else if(Discord.window.webpackChunkdiscord_app != null) {
|
||||
Discord.window.webpackChunkdiscord_app.push([
|
||||
['__extra_id__'],
|
||||
{},
|
||||
req => webpackExports = req
|
||||
]);
|
||||
}
|
||||
else if(Discord.window.webpackJsonp != null) {
|
||||
webpackExports = typeof(Discord.window.webpackJsonp) === 'function' ?
|
||||
Discord.window.webpackJsonp(
|
||||
[],
|
||||
{ '__extra_id__': (module, _export_, req) => { _export_.default = req } },
|
||||
[ '__extra_id__' ]
|
||||
).default :
|
||||
Discord.window.webpackJsonp.push([
|
||||
[],
|
||||
{ '__extra_id__': (_module_, exports, req) => { _module_.exports = req } },
|
||||
[ [ '__extra_id__' ] ]
|
||||
]);
|
||||
}
|
||||
else return null;
|
||||
|
||||
delete webpackExports.m['__extra_id__'];
|
||||
delete webpackExports.c['__extra_id__'];
|
||||
|
||||
const findModule = (filter) => {
|
||||
for(let i in webpackExports.c) {
|
||||
if(webpackExports.c.hasOwnProperty(i)) {
|
||||
let m = webpackExports.c[i].exports;
|
||||
|
||||
if(!m) continue;
|
||||
|
||||
if(m.__esModule && m.default) m = m.default;
|
||||
|
||||
if(filter(m)) return m;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const findModuleByUniqueProperties = (propNames) => findModule(module => propNames.every(prop => module[prop] !== undefined));
|
||||
|
||||
return { findModule, findModuleByUniqueProperties };
|
||||
}
|
||||
};
|
||||
|
||||
var Initialized = false;
|
||||
var searchHook;
|
||||
var parseHook;
|
||||
var getEmojiUnavailableReasonHook;
|
||||
function Init()
|
||||
{
|
||||
Discord = { window: (typeof(unsafeWindow) !== 'undefined') ? unsafeWindow : window };
|
||||
|
||||
const webpackUtil = Utils.Webpack();
|
||||
if(webpackUtil == null) { Utils.Error("Webpack not found."); return 0; }
|
||||
const { findModule, findModuleByUniqueProperties } = webpackUtil;
|
||||
|
||||
let emojisModule = findModuleByUniqueProperties([ 'getDisambiguatedEmojiContext', 'searchWithoutFetchingLatest' ]);
|
||||
if(emojisModule == null) { Utils.Error("emojisModule not found."); return 0; }
|
||||
|
||||
let messageEmojiParserModule = findModuleByUniqueProperties([ 'parse', 'parsePreprocessor', 'unparse' ]);
|
||||
if(messageEmojiParserModule == null) { Utils.Error("messageEmojiParserModule not found."); return 0; }
|
||||
|
||||
let emojiPermissionsModule = findModuleByUniqueProperties([ 'getEmojiUnavailableReason' ]);
|
||||
if(emojiPermissionsModule == null) { Utils.Error("emojiPermissionsModule not found."); return 0; }
|
||||
|
||||
searchHook = Discord.original_searchWithoutFetchingLatest = emojisModule.searchWithoutFetchingLatest;
|
||||
emojisModule.searchWithoutFetchingLatest = function() { return searchHook.apply(this, arguments); };
|
||||
|
||||
parseHook = Discord.original_parse = messageEmojiParserModule.parse;
|
||||
messageEmojiParserModule.parse = function() { return parseHook.apply(this, arguments); };
|
||||
|
||||
getEmojiUnavailableReasonHook = Discord.original_getEmojiUnavailableReason = emojiPermissionsModule.getEmojiUnavailableReason;
|
||||
emojiPermissionsModule.getEmojiUnavailableReason = function() { return getEmojiUnavailableReasonHook.apply(this, arguments); };
|
||||
|
||||
|
||||
Utils.Log("initialized");
|
||||
Initialized = true;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function Start() {
|
||||
if(!Initialized && Init() !== 1) return;
|
||||
|
||||
const { original_parse, original_getEmojiUnavailableReason } = Discord;
|
||||
|
||||
searchHook = function() {
|
||||
let result = Discord.original_searchWithoutFetchingLatest.apply(this, arguments);
|
||||
console.log({result, arguments})
|
||||
result.unlocked.push(...result.locked);
|
||||
result.locked = [];
|
||||
return result;
|
||||
}
|
||||
|
||||
function replaceEmoji(parseResult, emoji) {
|
||||
parseResult.content = parseResult.content.replace(`<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>`, emoji.url.split("?")[0] + "?size=48");
|
||||
}
|
||||
|
||||
parseHook = function() {
|
||||
let result = original_parse.apply(this, arguments);
|
||||
|
||||
if(result.invalidEmojis.length !== 0) {
|
||||
for(let emoji of result.invalidEmojis) {
|
||||
replaceEmoji(result, emoji);
|
||||
}
|
||||
result.invalidEmojis = [];
|
||||
}
|
||||
let validNonShortcutEmojis = result.validNonShortcutEmojis;
|
||||
for (let i = 0; i < validNonShortcutEmojis.length; i++) {
|
||||
const emoji = validNonShortcutEmojis[i];
|
||||
if(!emoji.available) {
|
||||
replaceEmoji(result, emoji);
|
||||
validNonShortcutEmojis.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
getEmojiUnavailableReasonHook = function() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function Stop() {
|
||||
if(!Initialized) return;
|
||||
|
||||
searchHook = Discord.original_searchWithoutFetchingLatest;
|
||||
parseHook = Discord.original_parse;
|
||||
getEmojiUnavailableReasonHook = Discord.original_getEmojiUnavailableReason;
|
||||
}
|
||||
|
||||
return function() { return {
|
||||
getName: () => "DiscordFreeEmojis",
|
||||
getShortName: () => "FreeEmojis",
|
||||
getDescription: () => "Link emojis if you don't have nitro! Type them out or use the emoji picker!",
|
||||
getVersion: () => "1.7",
|
||||
getAuthor: () => "An0",
|
||||
|
||||
start: Start,
|
||||
stop: Stop
|
||||
}};
|
||||
|
||||
})();
|
||||
|
||||
module.exports = FreeEmojis;
|
||||
|
||||
/*@end @*/
|
||||
208
.config/BetterDiscord/plugins/DiscordFreeEmojis64px.plugin.js
Normal file
208
.config/BetterDiscord/plugins/DiscordFreeEmojis64px.plugin.js
Normal file
@@ -0,0 +1,208 @@
|
||||
/**
|
||||
* @name FreeEmojis
|
||||
* @author An0
|
||||
* @version 1.6
|
||||
* @description Link emojis if you don't have nitro! Type them out or use the emoji picker! [64px]
|
||||
* @source https://github.com/An00nymushun/DiscordFreeEmojis
|
||||
* @updateUrl https://raw.githubusercontent.com/An00nymushun/DiscordFreeEmojis/master/DiscordFreeEmojis64px.plugin.js
|
||||
*/
|
||||
|
||||
/*@cc_on
|
||||
@if (@_jscript)
|
||||
var shell = WScript.CreateObject("WScript.Shell");
|
||||
var fs = new ActiveXObject("Scripting.FileSystemObject");
|
||||
var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins");
|
||||
var pathSelf = WScript.ScriptFullName;
|
||||
shell.Popup("It looks like you've mistakenly tried to run me directly. \\n(Don't do that!)", 0, "I'm a plugin for BetterDiscord", 0x30);
|
||||
if (fs.GetParentFolderName(pathSelf) === fs.GetAbsolutePathName(pathPlugins)) {
|
||||
shell.Popup("I'm in the correct folder already.", 0, "I'm already installed", 0x40);
|
||||
} else if (!fs.FolderExists(pathPlugins)) {
|
||||
shell.Popup("I can't find the BetterDiscord plugins folder.\\nAre you sure it's even installed?", 0, "Can't install myself", 0x10);
|
||||
} else if (shell.Popup("Should I copy myself to BetterDiscord's plugins folder for you?", 0, "Do you need some help?", 0x34) === 6) {
|
||||
fs.CopyFile(pathSelf, fs.BuildPath(pathPlugins, fs.GetFileName(pathSelf)), true);
|
||||
// Show the user where to put plugins in the future
|
||||
shell.Exec("explorer " + pathPlugins);
|
||||
shell.Popup("I'm installed!", 0, "Successfully installed", 0x40);
|
||||
}
|
||||
WScript.Quit();
|
||||
@else @*/
|
||||
|
||||
|
||||
var FreeEmojis = (() => {
|
||||
|
||||
'use strict';
|
||||
|
||||
const BaseColor = "#0cf";
|
||||
|
||||
var Discord;
|
||||
var Utils = {
|
||||
Log: (message) => { console.log(`%c[FreeEmojis] %c${message}`, `color:${BaseColor};font-weight:bold`, "") },
|
||||
Warn: (message) => { console.warn(`%c[FreeEmojis] %c${message}`, `color:${BaseColor};font-weight:bold`, "") },
|
||||
Error: (message) => { console.error(`%c[FreeEmojis] %c${message}`, `color:${BaseColor};font-weight:bold`, "") },
|
||||
Webpack: () => {
|
||||
let webpackExports;
|
||||
|
||||
if(typeof BdApi !== "undefined" && BdApi?.findModuleByProps && BdApi?.findModule) {
|
||||
return { findModule: BdApi.findModule, findModuleByUniqueProperties: (props) => BdApi.findModuleByProps.apply(null, props) };
|
||||
}
|
||||
else if(Discord.window.webpackChunkdiscord_app != null) {
|
||||
Discord.window.webpackChunkdiscord_app.push([
|
||||
['__extra_id__'],
|
||||
{},
|
||||
req => webpackExports = req
|
||||
]);
|
||||
}
|
||||
else if(Discord.window.webpackJsonp != null) {
|
||||
webpackExports = typeof(Discord.window.webpackJsonp) === 'function' ?
|
||||
Discord.window.webpackJsonp(
|
||||
[],
|
||||
{ '__extra_id__': (module, _export_, req) => { _export_.default = req } },
|
||||
[ '__extra_id__' ]
|
||||
).default :
|
||||
Discord.window.webpackJsonp.push([
|
||||
[],
|
||||
{ '__extra_id__': (_module_, exports, req) => { _module_.exports = req } },
|
||||
[ [ '__extra_id__' ] ]
|
||||
]);
|
||||
}
|
||||
else return null;
|
||||
|
||||
delete webpackExports.m['__extra_id__'];
|
||||
delete webpackExports.c['__extra_id__'];
|
||||
|
||||
const findModule = (filter) => {
|
||||
for(let i in webpackExports.c) {
|
||||
if(webpackExports.c.hasOwnProperty(i)) {
|
||||
let m = webpackExports.c[i].exports;
|
||||
|
||||
if(!m) continue;
|
||||
|
||||
if(m.__esModule && m.default) m = m.default;
|
||||
|
||||
if(filter(m)) return m;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const findModuleByUniqueProperties = (propNames) => findModule(module => propNames.every(prop => module[prop] !== undefined));
|
||||
|
||||
return { findModule, findModuleByUniqueProperties };
|
||||
}
|
||||
};
|
||||
|
||||
var Initialized = false;
|
||||
var searchHook;
|
||||
var parseHook;
|
||||
var useEmojiSelectHandlerHook;
|
||||
function Init()
|
||||
{
|
||||
Discord = { window: (typeof(unsafeWindow) !== 'undefined') ? unsafeWindow : window };
|
||||
|
||||
const webpackUtil = Utils.Webpack();
|
||||
if(webpackUtil == null) { Utils.Error("Webpack not found."); return 0; }
|
||||
const { findModule, findModuleByUniqueProperties } = webpackUtil;
|
||||
|
||||
let emojisModule = findModuleByUniqueProperties([ 'getDisambiguatedEmojiContext', 'searchWithoutFetchingLatest' ]);
|
||||
if(emojisModule == null) { Utils.Error("emojisModule not found."); return 0; }
|
||||
|
||||
let messageEmojiParserModule = findModuleByUniqueProperties([ 'parse', 'parsePreprocessor', 'unparse' ]);
|
||||
if(messageEmojiParserModule == null) { Utils.Error("messageEmojiParserModule not found."); return 0; }
|
||||
|
||||
let emojiPickerModule = findModuleByUniqueProperties([ 'useEmojiSelectHandler' ]);
|
||||
if(emojiPickerModule == null) { Utils.Error("emojiPickerModule not found."); return 0; }
|
||||
|
||||
searchHook = Discord.original_searchWithoutFetchingLatest = emojisModule.searchWithoutFetchingLatest;
|
||||
emojisModule.searchWithoutFetchingLatest = function() { return searchHook.apply(this, arguments); };
|
||||
|
||||
parseHook = Discord.original_parse = messageEmojiParserModule.parse;
|
||||
messageEmojiParserModule.parse = function() { return parseHook.apply(this, arguments); };
|
||||
|
||||
useEmojiSelectHandlerHook = Discord.original_useEmojiSelectHandler = emojiPickerModule.useEmojiSelectHandler;
|
||||
emojiPickerModule.useEmojiSelectHandler = function() { return useEmojiSelectHandlerHook.apply(this, arguments); };
|
||||
|
||||
Utils.Log("initialized");
|
||||
Initialized = true;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function Start() {
|
||||
if(!Initialized && Init() !== 1) return;
|
||||
|
||||
const { original_parse, original_useEmojiSelectHandler } = Discord;
|
||||
|
||||
searchHook = function() {
|
||||
let result = Discord.original_searchWithoutFetchingLatest.apply(this, arguments);
|
||||
result.unlocked.push(...result.locked);
|
||||
result.locked = [];
|
||||
return result;
|
||||
}
|
||||
|
||||
function replaceEmoji(parseResult, emoji) {
|
||||
parseResult.content = parseResult.content.replace(`<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>`, emoji.url.split("?")[0] + "?size=64");
|
||||
}
|
||||
|
||||
parseHook = function() {
|
||||
let result = original_parse.apply(this, arguments);
|
||||
|
||||
if(result.invalidEmojis.length !== 0) {
|
||||
for(let emoji of result.invalidEmojis) {
|
||||
replaceEmoji(result, emoji);
|
||||
}
|
||||
result.invalidEmojis = [];
|
||||
}
|
||||
let validNonShortcutEmojis = result.validNonShortcutEmojis;
|
||||
for (let i = 0; i < validNonShortcutEmojis.length; i++) {
|
||||
const emoji = validNonShortcutEmojis[i];
|
||||
if(!emoji.available) {
|
||||
replaceEmoji(result, emoji);
|
||||
validNonShortcutEmojis.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
useEmojiSelectHandlerHook = function(args) {
|
||||
const { onSelectEmoji, closePopout } = args;
|
||||
const originalHandler = original_useEmojiSelectHandler.apply(this, arguments);
|
||||
return function(data, state) {
|
||||
if(state.toggleFavorite)
|
||||
return originalHandler.apply(this, arguments);
|
||||
|
||||
const emoji = data.emoji;
|
||||
if(emoji != null) {
|
||||
onSelectEmoji(emoji, state.isFinalSelection);
|
||||
if(state.isFinalSelection) closePopout();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
function Stop() {
|
||||
if(!Initialized) return;
|
||||
|
||||
searchHook = Discord.original_searchWithoutFetchingLatest;
|
||||
parseHook = Discord.original_parse;
|
||||
useEmojiSelectHandlerHook = Discord.original_useEmojiSelectHandler;
|
||||
}
|
||||
|
||||
return function() { return {
|
||||
getName: () => "DiscordFreeEmojis",
|
||||
getShortName: () => "FreeEmojis",
|
||||
getDescription: () => "Link emojis if you don't have nitro! Type them out or use the emoji picker! [64px]",
|
||||
getVersion: () => "1.6",
|
||||
getAuthor: () => "An0",
|
||||
|
||||
start: Start,
|
||||
stop: Stop
|
||||
}};
|
||||
|
||||
})();
|
||||
|
||||
module.exports = FreeEmojis;
|
||||
|
||||
/*@end @*/
|
||||
@@ -2,7 +2,7 @@
|
||||
* @name ImageUtilities
|
||||
* @author DevilBro
|
||||
* @authorId 278543574059057154
|
||||
* @version 5.1.0
|
||||
* @version 5.1.4
|
||||
* @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)
|
||||
* @invite Jx3TjNS
|
||||
* @donate https://www.paypal.me/MircoWittrien
|
||||
@@ -138,6 +138,7 @@ module.exports = (_ => {
|
||||
}
|
||||
componentDidUpdate() {
|
||||
if ((!this.props.attachment || !this.props.attachment.size) && !this.props.loaded) {
|
||||
BDFDB.DOMUtils.addClass(BDFDB.DOMUtils.getParent(BDFDB.dotCN.imagemosaiconebyonegridsingle, BDFDB.ReactUtils.findDOMNode(this)), BDFDB.disCN._imageutilitiesimagedetailsadded);
|
||||
this.props.loaded = true;
|
||||
this.props.attachment = BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(this, `${BDFDB.ReactUtils.instanceKey}.return`), "attachment", {up: true});
|
||||
BDFDB.ReactUtils.forceUpdate(this);
|
||||
@@ -276,6 +277,14 @@ module.exports = (_ => {
|
||||
};
|
||||
|
||||
this.css = `
|
||||
${BDFDB.dotCNS._imageutilitiesimagedetailsadded + BDFDB.dotCN.imagewrapper} {
|
||||
border-radius: 8px; !important;
|
||||
height: calc(100% - 1rem - 16px) !important;
|
||||
max-height: unset !important;
|
||||
}
|
||||
${BDFDB.dotCNS._imageutilitiesimagedetailsadded + BDFDB.dotCN.imagealttextcontainer} {
|
||||
bottom: calc(1rem + 16px) !important;
|
||||
}
|
||||
${BDFDB.dotCN._imageutilitiesimagedetails} {
|
||||
display: inline-flex;
|
||||
font-weight: 500;
|
||||
@@ -694,7 +703,7 @@ module.exports = (_ => {
|
||||
|
||||
onMessageContextMenu (e) {
|
||||
if (!e.instance.props.message || !e.instance.props.channel || !e.instance.props.target) return;
|
||||
if (e.instance.props.attachment) this.injectItem(e, [e.instance.props.attachment.url], null, true);
|
||||
if (e.instance.props.attachment) this.injectItem(e, [{original: e.instance.props.attachment.url, file: e.instance.props.attachment.proxy_url}], null, true);
|
||||
else {
|
||||
const target = e.instance.props.target.tagName == "A" && BDFDB.DOMUtils.containsClass(e.instance.props.target, BDFDB.disCN.imageoriginallink) && e.instance.props.target.parentElement.querySelector("img, video") || e.instance.props.target;
|
||||
if (target.tagName == "A" && e.instance.props.message.embeds && e.instance.props.message.embeds[0] && (e.instance.props.message.embeds[0].type == "image" || e.instance.props.message.embeds[0].type == "video" || e.instance.props.message.embeds[0].type == "gifv")) this.injectItem(e, [target.href], null, true);
|
||||
@@ -1161,9 +1170,10 @@ module.exports = (_ => {
|
||||
processLazyImage (e) {
|
||||
if (e.node) {
|
||||
if (e.instance.props.resized) {
|
||||
for (let selector of ["embedfull", "embedinlinemedia", "embedgridcontainer"]) {
|
||||
for (let selector of ["embedfull", "embedinlinemedia", "embedgridcontainer", "imagemosaicattachmentscontainer", "imagemosaiconebyonegridsingle"]) {
|
||||
let parent = BDFDB.DOMUtils.getParent(BDFDB.dotCN[selector], e.node);
|
||||
if (parent) parent.style.setProperty("max-width", "unset", "important");
|
||||
if (parent) parent.style.setProperty("max-height", "unset", "important");
|
||||
}
|
||||
for (let ele of [e.node.style.getPropertyValue("width") && e.node, ...e.node.querySelectorAll("[style*='width:']")].filter(n => n)) {
|
||||
ele.style.setProperty("width", e.instance.props.width + "px");
|
||||
@@ -1177,10 +1187,13 @@ module.exports = (_ => {
|
||||
BDFDB.ReactUtils.forceUpdate(e.instance);
|
||||
}
|
||||
}
|
||||
if (e.methodname == "componentWillUnmount" && BDFDB.DOMUtils.getParent(BDFDB.dotCN.imagemodal, e.node)) {
|
||||
firstViewedImage = null;
|
||||
viewedImage = null;
|
||||
this.cleanupListeners("Gallery");
|
||||
if (e.methodname == "componentWillUnmount" && BDFDB.DOMUtils.getParent(BDFDB.dotCNC.imagemodal + BDFDB.dotCN.modalcarouselmodal, e.node)) {
|
||||
BDFDB.TimeUtils.clear(viewedImageTimeout);
|
||||
viewedImageTimeout = BDFDB.TimeUtils.timeout(_ => {
|
||||
firstViewedImage = null;
|
||||
viewedImage = null;
|
||||
this.cleanupListeners("Gallery");
|
||||
}, 1000);
|
||||
}
|
||||
if (e.methodname == "componentDidMount" && BDFDB.DOMUtils.getParent(BDFDB.dotCNC.imagemodal + BDFDB.dotCN.modalcarouselmodal, e.node)) {
|
||||
BDFDB.TimeUtils.clear(viewedImageTimeout);
|
||||
@@ -1293,7 +1306,7 @@ module.exports = (_ => {
|
||||
}
|
||||
else {
|
||||
let reactInstance = BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`);
|
||||
if (this.settings.rescaleSettings.imageViewer != "NONE" && BDFDB.ReactUtils.findOwner(reactInstance, {name: "ImageModal", up: true})) {
|
||||
if (this.settings.rescaleSettings.imageViewer != "NONE" && e.instance.props.className && e.instance.props.className.indexOf(BDFDB.disCN.imagemodalimage) > -1) {
|
||||
let aRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCN.appmount));
|
||||
let ratio = Math.min((aRects.width * (this.settings.viewerSettings.galleryMode ? 0.8 : 1) - 20) / e.instance.props.width, (aRects.height - (this.settings.viewerSettings.details ? 280 : 100)) / e.instance.props.height);
|
||||
ratio = this.settings.rescaleSettings.imageViewer == "ORIGINAL" && ratio > 1 ? 1 : ratio;
|
||||
@@ -1308,7 +1321,7 @@ module.exports = (_ => {
|
||||
e.instance.props.resized = true;
|
||||
}
|
||||
}
|
||||
if (this.settings.rescaleSettings.messages != "NONE" && (!e.instance.props.className || e.instance.props.className.indexOf(BDFDB.disCN.embedthumbnail) == -1) && (!e.instance.props.containerClassName || e.instance.props.containerClassName.indexOf(BDFDB.disCN.embedthumbnail) == -1 && e.instance.props.containerClassName.indexOf(BDFDB.disCN.embedvideoimagecomponent) == -1) && BDFDB.ReactUtils.findOwner(reactInstance, {name: "LazyImageZoomable", up: true})) {
|
||||
if (this.settings.rescaleSettings.messages != "NONE" && (!e.instance.props.className || e.instance.props.className.indexOf(BDFDB.disCN.embedthumbnail) == -1) && (!e.instance.props.containerClassName || e.instance.props.containerClassName.indexOf(BDFDB.disCN.embedthumbnail) == -1 && e.instance.props.containerClassName.indexOf(BDFDB.disCN.embedvideoimagecomponent) == -1) && BDFDB.ReactUtils.findOwner(reactInstance, {name: "LazyImageZoomable", up: true}) && (e.instance.props.mediaLayoutType != "MOSAIC" || (BDFDB.ReactUtils.findValue(reactInstance, "attachments", {up: true}) || []).length < 2)) {
|
||||
let aRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCN.appmount));
|
||||
let mRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCNC.messageaccessory + BDFDB.dotCN.messagecontents));
|
||||
let mwRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCN.messagewrapper));
|
||||
@@ -1338,7 +1351,7 @@ module.exports = (_ => {
|
||||
|
||||
processLazyImageZoomable (e) {
|
||||
if (!e.instance.props.original || e.instance.props.src.indexOf("https://media.discordapp.net/attachments") != 0) return;
|
||||
if (this.settings.detailsSettings.tooltip) {
|
||||
if (this.settings.detailsSettings.tooltip || this.settings.detailsSettings.footnote && e.instance.props.mediaLayoutType == "MOSAIC" && (BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`), "attachments", {up: true}) || []).length > 1) {
|
||||
const attachment = BDFDB.ReactUtils.findValue(e.instance, "attachment", {up: true});
|
||||
if (attachment) {
|
||||
const onMouseEnter = e.returnvalue.props.onMouseEnter;
|
||||
@@ -1355,7 +1368,7 @@ module.exports = (_ => {
|
||||
}, "Error in onMouseEnter of LazyImageZoomable!");
|
||||
}
|
||||
}
|
||||
if (this.settings.detailsSettings.footnote && (e.instance.props.className || "").indexOf(BDFDB.disCN.embedmedia) == -1 && (e.instance.props.className || "").indexOf(BDFDB.disCN.embedthumbnail) == -1) {
|
||||
if (this.settings.detailsSettings.footnote && (e.instance.props.className || "").indexOf(BDFDB.disCN.embedmedia) == -1 && (e.instance.props.className || "").indexOf(BDFDB.disCN.embedthumbnail) == -1 && (e.instance.props.mediaLayoutType != "MOSAIC" || (BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(e, `instance.${BDFDB.ReactUtils.instanceKey}`), "attachments", {up: true}) || []).length < 2)) {
|
||||
e.returnvalue = BDFDB.ReactUtils.createElement("div", {
|
||||
children: [
|
||||
e.returnvalue,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"all": {
|
||||
"cached": "2 7 8 9 11 14 15 17 28 29 30 59 60 61 62 63 64 65 66 67 68 70 71 73 74 75 76 77 80 81 82 83 85 86 87 88 89 91 92 93 94 95 96 97 98 99 100 101 102 104 105 106 108 109 110 111 116 120 122 126 127 131 132 133 134 137 138 139 146 157 158 159 160 162 164 171 173 176 179 181 182 183 184 185 186 188 189 190 193 195 196 197 200 201 220 228 234 237 238 240 245 247 253 262 272 274 278 284 287 291 292 293 295 301 306 312 314 317 318 323 331 336 337 338 340 344 349 350 351 352 353 354 356 364 366 368 377 379 381 382 383 390 395 401 404 420 421 429 438 442 476 479 489 509 518 520 523 525 535 538 539 547 554 566 577 579 589 592 593 598 599 606 608 611 614 620 621 627 638 644 645 669 670 671 679 686 692 693 694 699 708 760 762 772 798 802 805 806 807 819 827 843",
|
||||
"cached": "2 7 8 9 11 14 15 17 28 29 30 59 60 61 62 63 64 65 66 67 68 70 71 73 74 75 76 77 80 81 82 83 85 86 87 88 89 91 92 93 94 95 96 97 98 99 100 101 102 104 105 106 108 109 110 111 116 120 122 126 127 131 132 133 134 137 138 139 146 157 158 159 160 162 164 171 173 176 179 181 182 183 184 185 186 188 189 190 193 195 196 197 200 201 220 228 234 237 238 240 245 247 253 262 272 274 278 284 287 291 292 293 295 301 306 312 314 317 318 323 331 336 337 338 340 344 349 350 351 352 353 354 356 364 366 368 377 379 381 382 383 390 395 401 404 420 421 429 438 442 476 479 489 509 518 520 523 525 535 538 539 547 554 566 577 579 589 592 593 598 599 606 608 611 614 620 621 627 638 644 645 669 670 671 679 686 692 693 694 699 708 760 762 772 798 802 805 806 807 819 827 843 856 859 867",
|
||||
"filters": {
|
||||
"updated": true,
|
||||
"outdated": true,
|
||||
|
||||
6
.config/BetterDiscord/plugins/Simply-Nitro.config.json
Normal file
6
.config/BetterDiscord/plugins/Simply-Nitro.config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"currentVersionInfo": {
|
||||
"version": "1.3.7",
|
||||
"hasShownChangelog": true
|
||||
}
|
||||
}
|
||||
6310
.config/BetterDiscord/plugins/gh-redirect?id=9
Normal file
6310
.config/BetterDiscord/plugins/gh-redirect?id=9
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user