Remove BetterDiscord

This commit is contained in:
kageru 2020-06-02 11:09:37 +02:00
parent 9e12149fdf
commit 5df0be31a3
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2
33 changed files with 0 additions and 15457 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
{
"currentVersionInfo": {
"version": "0.1.2",
"hasShownChangelog": true
}
}

View File

@ -1,141 +0,0 @@
//META{"name":"AccountDetailsPlus","displayName":"AccountDetailsPlus","website":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/AccountDetailsPlus","source":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/AccountDetailsPlus/AccountDetailsPlus.plugin.js"}*//
var AccountDetailsPlus = (() => {
const config = {"info":{"name":"AccountDetailsPlus","authors":[{"name":"Zerebos","discord_id":"249746236008169473","github_username":"rauenzi","twitter_username":"ZackRauen"}],"version":"0.1.2","description":"Lets you view popout, nickname and more from your account panel at the bottom. Support Server: bit.ly/ZeresServer","github":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/AccountDetailsPlus","github_raw":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/AccountDetailsPlus/AccountDetailsPlus.plugin.js"},"defaultConfig":[{"type":"category","id":"popout","name":"User Popout","collapsible":true,"shown":false,"settings":[{"type":"switch","id":"avatar","name":"Avatar","note":"Opens your popout when clicking your avatar.","value":true},{"type":"switch","id":"username","name":"Username","note":"Opens your popout when clicking your username.","value":true}]},{"type":"category","id":"statusPicker","name":"Status Picker","collapsible":true,"shown":false,"settings":[{"type":"switch","id":"avatar","name":"Avatar","note":"Opens your popout when right clicking your avatar.","value":true},{"type":"switch","id":"username","name":"Username","note":"Opens your popout when right clicking your username.","value":true}]},{"type":"category","id":"nickname","name":"Nickname","collapsible":true,"shown":false,"settings":[{"type":"dropdown","id":"showNickname","name":"Name Shown","value":true,"options":[{"label":"Username","value":false},{"label":"Nickname","value":true}]},{"type":"switch","id":"oppositeOnHover","name":"Opposite On Hover","note":"Shows the opposite on hover. e.g. if you are showing nickname, hovering will show your username.","value":true}]}],"changelog":[{"title":"Bugs Squashed","type":"fixed","items":["Fixed that one issue where it didn't work."]}],"main":"index.js"};
return !global.ZeresPluginLibrary ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.authors.map(a => a.name).join(", ");}
getDescription() {return config.info.description;}
getVersion() {return config.info.version;}
load() {window.BdApi.alert("Library Missing",`The library plugin needed for ${config.info.name} is missing.<br /><br /> <a href="https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js" target="_blank">Click here to download the library!</a>`);}
start() {}
stop() {}
} : (([Plugin, Api]) => {
const plugin = (Plugin, Api) => {
const {PluginUtilities, DiscordModules, DiscordSelectors, ReactTools, DOMTools} = Api;
return class AccountDetailsPlus extends Plugin {
constructor() {
super();
this.usernameCSS = `.container-iksrDt .nameTag-26T3kW { cursor: pointer; }`;
this.popoutOpen = false;
}
async onStart() {
await new Promise(resolve => setTimeout(resolve, 1000));
this.FluxContainer = DiscordModules.UserPopout;
this.currentUser = DiscordModules.UserStore.getCurrentUser();
this.popoutWrapper = ReactTools.getReactProperty(document.querySelector(DiscordSelectors.AccountDetails.container + " .inner-1W0Bkn"), "return.return.return.return.return.return.return.stateNode");
this.originalRender = this.popoutWrapper.props.render;
this.activateShit();
}
onStop() {
this.popoutWrapper.props.render = this.originalRender;
PluginUtilities.removeStyle(this.getName() + "-css");
DOMTools.off(".AccountDetailsPlus");
this.saveSettings();
}
activateShit() {
document.querySelector(DiscordSelectors.AccountDetails.container + DiscordSelectors.AccountDetails.nameTag).off("." + this.getName());
document.querySelector(DiscordSelectors.AccountDetails.container + " .inner-1W0Bkn").off("." + this.getName());
this.usernameCSS = DiscordSelectors.AccountDetails.container + DiscordSelectors.AccountDetails.nameTag + "{ cursor: pointer; }";
PluginUtilities.removeStyle(this.getName() + "-css");
DOMTools.off(document, "mousemove." + this.getName());
document.querySelector(DiscordSelectors.AccountDetails.container.descend(".username")).textContent = this.currentUser.username;
if (this.settings.nickname.showNickname || this.settings.nickname.oppositeOnHover) {
DOMTools.on(document, "mousemove." + this.getName(), (e) => { this.adjustNickname(e); });
}
if (this.settings.popout.username) {
PluginUtilities.addStyle(this.getName() + "-css", this.usernameCSS);
document.querySelector(DiscordSelectors.AccountDetails.container + DiscordSelectors.AccountDetails.nameTag).on("mousedown." + this.getName(), () => { this.popoutOpen = this.popoutWrapper.state.isOpen; });
document.querySelector(DiscordSelectors.AccountDetails.container + DiscordSelectors.AccountDetails.nameTag).on("click." + this.getName(), (e) => { if (!this.popoutOpen) this.showUserPopout(e); });
}
if (this.settings.popout.avatar) {
document.querySelector(DiscordSelectors.AccountDetails.container + DiscordSelectors.AccountDetails.nameTag).on("mousedown." + this.getName(), () => { this.popoutOpen = this.popoutWrapper.state.isOpen; });
document.querySelector(DiscordSelectors.AccountDetails.container + " .inner-1W0Bkn").on("click." + this.getName(), (e) => { if (!this.popoutOpen) this.showUserPopout(e); });
}
if (this.settings.statusPicker.username) {
document.querySelector(DiscordSelectors.AccountDetails.container + DiscordSelectors.AccountDetails.nameTag).on("mousedown." + this.getName(), () => { this.popoutOpen = this.popoutWrapper.state.isOpen; });
document.querySelector(DiscordSelectors.AccountDetails.container + DiscordSelectors.AccountDetails.nameTag).on("contextmenu." + this.getName(), (e) => {
if (!this.popoutOpen) this.showStatusPicker(e);
});
}
if (this.settings.statusPicker.avatar) {
document.querySelector(DiscordSelectors.AccountDetails.container + " .inner-1W0Bkn").on("mousedown." + this.getName(), () => { this.popoutOpen = this.popoutWrapper.state.isOpen; });
document.querySelector(DiscordSelectors.AccountDetails.container + " .inner-1W0Bkn").on("contextmenu." + this.getName(), (e) => {
if (!this.popoutOpen) this.showStatusPicker(e);
});
}
}
adjustNickname(e) {
if (!e || !e.target || !(e.target instanceof Element)) return;
let accountDetails = document.querySelector(DiscordSelectors.AccountDetails.container);
if (!accountDetails) return;
let isHovering = accountDetails.contains(e.target);
let nameElement = accountDetails.querySelector(".username");
let nick = DiscordModules.GuildMemberStore.getNick(DiscordModules.SelectedGuildStore.getGuildId(), this.currentUser.id);
nick = nick ? nick : this.currentUser.username;
if (isHovering && this.settings.nickname.oppositeOnHover) {
if (this.settings.nickname.showNickname) nameElement.textContent = this.currentUser.username;
else if (!this.settings.nickname.showNickname) nameElement.textContent = nick;
}
else {
if (this.settings.nickname.showNickname) nameElement.textContent = nick;
else nameElement.textContent = this.currentUser.username;
}
}
setRender(renderer, options = {}) {
this.popoutWrapper.props.render = renderer;
Object.assign(this.popoutWrapper.props, options);
}
showStatusPicker(e) {
e.preventDefault();
e.stopPropagation();
this.setRender(this.originalRender, {position: "top-left", animationType: "spring"});
this.popoutWrapper.toggle(e);
}
showUserPopout(e) {
e.preventDefault();
e.stopPropagation();
var element = document.querySelector(DiscordSelectors.AccountDetails.container);
// e.target = e.currentTarget = e.toElement = e.delegateTarget = document.querySelector(DiscordSelectors.AccountDetails.container);
this.setRender((props) => {
let guild = DiscordModules.SelectedGuildStore.getGuildId();
let channel = DiscordModules.SelectedChannelStore.getChannelId();
return DiscordModules.React.createElement(this.FluxContainer, Object.assign({}, props, {
user: this.currentUser,
guildId: guild,
channelId: channel
}));
}, {position: "top-left", animationType: "default"});
this.popoutWrapper.toggle(Object.assign({}, e, {
target: element,
toElement: element,
currentTarget: element,
delegateTarget: element
}));
}
getSettingsPanel() {
const panel = this.buildSettingsPanel();
panel.addListener(this.updateSettings.bind(this));
return panel.getElement();
}
};
};
return plugin(Plugin, Api);
})(global.ZeresPluginLibrary.buildPlugin(config));
})();

View File

@ -1,3 +0,0 @@
{
"config": "{\"version\":1,\"direcotry\":\"none\"}"
}

View File

@ -1,150 +0,0 @@
//META{"name":"BetterCustomCSS"}*//
/*globals BdApi*/
'use strict';
var BetterCustomCSS = function () {};
BetterCustomCSS.prototype.getAuthor = function () {
return "kosshi";
};
BetterCustomCSS.prototype.getName = function () {
return "BetterCustomCSS";
};
BetterCustomCSS.prototype.getDescription = function () {
return "Lets you edit CSS live with your favorite text editor. Like Custom CSS but better.";
};
BetterCustomCSS.prototype.getVersion = function () {
return "0.1.0";
};
BetterCustomCSS.prototype.start = function () {
let settings = this.loadSettings();
let fs = require('fs');
if(this.accessSync(settings.direcotry)){
let elem = document.createElement("style");
elem.id = "bettercustomcss";
document.head.appendChild(elem);
this.watcher = fs.watch(settings.direcotry, {}, this.appendFile.bind(this));
this.appendFile();
}
};
BetterCustomCSS.prototype.stop = function () {
if( document.getElementById('bettercustomcss') ){
this.watcher.close();
document.head.removeChild( document.getElementById('bettercustomcss') );
}
};
BetterCustomCSS.prototype.appendFile = function () {
let settings = this.loadSettings();
let fs = require('fs');
fs.readFile(settings.direcotry, "utf8", (err, file)=>{
if(err){
BdApi.getCore().alert(
"BetterCustomCSS Error",
"Failed to read '"+settings.direcotry+"'. The plugin will be disabled. Go to the plugin settings and set the path correctly. This usually happens when the file is deleted or renamed."
);
this.stop();
return;
}
document.getElementById('bettercustomcss').innerHTML = file;
});
};
BetterCustomCSS.prototype.load = function () {};
BetterCustomCSS.prototype.unload = function () {};
BetterCustomCSS.prototype.onMessage = function () {};
BetterCustomCSS.prototype.onSwitch = function () {};
BetterCustomCSS.prototype.accessSync = function(dir){
var fs = require('fs');
try {
fs.accessSync(dir, fs.F_OK);
return true;
} catch (e) {
return false;
}
};
BetterCustomCSS.prototype.observer = function () {};
BetterCustomCSS.prototype.saveSettings = function (button) {
var settings = this.loadSettings();
var dir = document.getElementById('qs_directory').value;
var plugin = BdApi.getPlugin('BetterCustomCSS');
var err = document.getElementById('qs_err');
if( plugin.accessSync(dir) ){
settings.direcotry = dir;
bdPluginStorage.set(this.getName(), 'config', JSON.stringify(settings));
plugin.stop();
plugin.start();
err.innerHTML = "";
button.innerHTML = "Saved and applied!";
} else {
err.innerHTML = "Error: Invalid directory!";
return;
}
setTimeout(()=>{button.innerHTML = "Save and apply";},1000);
};
BetterCustomCSS.prototype.settingsVersion = 1;
BetterCustomCSS.prototype.defaultSettings = function () {
return {
version: this.settingsVersion,
direcotry: "none"
};
};
BetterCustomCSS.prototype.resetSettings = function (button) {
var settings = this.defaultSettings();
bdPluginStorage.set(this.getName(), 'config', JSON.stringify(settings));
this.stop();
this.start();
button.innerHTML = "Settings resetted!";
setTimeout(function(){button.innerHTML = "Reset settings";},1000);
};
BetterCustomCSS.prototype.loadSettings = function() {
// Loads settings from localstorage
var settings = (bdPluginStorage.get(this.getName(), 'config')) ? JSON.parse(bdPluginStorage.get(this.getName(), 'config')) : {version:"0"};
if(settings.version != this.settingsVersion){
console.log('['+this.getName()+'] Settings were outdated/invalid/nonexistent. Using default settings.');
settings = this.defaultSettings();
bdPluginStorage.set(this.getName(), 'config', JSON.stringify(settings));
}
return settings;
};
BetterCustomCSS.prototype.import = function (string) {
bdPluginStorage.set(this.getName(), 'config', string);
this.stop();
this.start();
}
BetterCustomCSS.prototype.getSettingsPanel = function () {
var settings = this.loadSettings();
var html = "<h3>Settings Panel</h3><br>";
html += "BetterCustomCSS css file directory<br>";
html += "<input id='qs_directory' type='text' value=" + (settings.direcotry) + " style='width:100% !important;'> <br><br>";
html +="<br><button onclick=BdApi.getPlugin('"+this.getName()+"').saveSettings(this)>Save and apply</button>";
html +="<button onclick=BdApi.getPlugin('"+this.getName()+"').resetSettings(this)>Reset settings</button> <br><br>";
html += "<p style='color:red' id='qs_err'></p>";
html += "How to use:";
html += "<br>1) Create a CSS file that you want to use.";
html += "<br>2) Set the directory setting to the file. (eg C:/Users/youruser/Desktop/theme.css)";
html += "<br>3) The file will be now loaded to the DOM. The plugin attempts to reload the file when it is edited.";
html += "<br>4) You can now open the file in your favorite text editor, edit it, and see the results instantly after saving the file.";
return html;
};

View File

@ -1,57 +0,0 @@
{
"currentVersionInfo": {
"version": "2.3.1",
"hasShownChangelog": true
},
"settings": {
"toolbar": {
"bold": true,
"italic": true,
"underline": true,
"strikethrough": true,
"code": true,
"codeblock": true,
"superscript": true,
"smallcaps": true,
"fullwidth": true,
"upsidedown": true,
"varied": true,
"leet": false,
"thicc": false
},
"formats": {
"superscript": true,
"smallcaps": true,
"fullwidth": true,
"upsidedown": true,
"varied": true,
"leet": false,
"thicc": false
},
"wrappers": {
"superscript": "^^",
"smallcaps": "%%",
"fullwidth": "##",
"upsidedown": "&&",
"varied": "||",
"leet": "++",
"thicc": "$$"
},
"formatting": {
"fullWidthMap": true,
"reorderUpsidedown": true,
"fullwidth": true
},
"plugin": {
"hoverOpen": true,
"chainFormats": true,
"closeOnSend": true
},
"style": {
"icons": true,
"rightSide": true,
"toolbarOpacity": 1,
"fontSize": 85
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +0,0 @@
{
"currentVersionInfo": {
"version": "0.7.6",
"hasShownChangelog": true
}
}

View File

@ -1,267 +0,0 @@
//META{"name":"BetterRoleColors","displayName":"BetterRoleColors","website":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/BetterRoleColors","source":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/BetterRoleColors/BetterRoleColors.plugin.js"}*//
var BetterRoleColors = (() => {
const config = {"info":{"name":"BetterRoleColors","authors":[{"name":"Zerebos","discord_id":"249746236008169473","github_username":"rauenzi","twitter_username":"ZackRauen"}],"version":"0.7.6","description":"Adds server-based role colors to typing, voice, popouts, modals and more! Support Server: bit.ly/ZeresServer","github":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/BetterRoleColors","github_raw":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/BetterRoleColors/BetterRoleColors.plugin.js"},"defaultConfig":[{"type":"category","id":"modules","name":"Module Settings","collapsible":true,"shown":true,"settings":[{"type":"switch","id":"typing","name":"Typing","note":"Toggles colorizing of typing notifications.","value":true},{"type":"switch","id":"voice","name":"Voice","note":"Toggles colorizing of voice users.","value":true},{"type":"switch","id":"mentions","name":"Mentions","note":"Toggles colorizing of user mentions in chat.","value":true},{"type":"switch","id":"botTags","name":"Bot Tags","note":"Toggles coloring the background of bot tags to match role.","value":true},{"type":"switch","id":"memberList","name":"Memberlist Headers","note":"Toggles coloring role names in the member list.","value":true}]},{"type":"category","id":"popouts","name":"Popout Options","collapsible":true,"shown":false,"settings":[{"type":"switch","id":"username","name":"Username","note":"Toggles coloring on the username in popouts.","value":false},{"type":"switch","id":"discriminator","name":"Discriminator","note":"Toggles coloring on the discriminator in popouts.","value":false},{"type":"switch","id":"nickname","name":"Nickname","note":"Toggles coloring on the nickname in popouts.","value":true},{"type":"switch","id":"fallback","name":"Enable Fallback","note":"If nickname is on and username is off, enabling this will automatically color the username.","value":true}]},{"type":"category","id":"modals","name":"Modal Options","collapsible":true,"shown":false,"settings":[{"type":"switch","id":"username","name":"Username","note":"Toggles coloring on the username in modals.","value":true},{"type":"switch","id":"discriminator","name":"Discriminator","note":"Toggles coloring on the discriminator in modals.","value":false}]},{"type":"category","id":"auditLog","name":"Audit Log Options","collapsible":true,"shown":false,"settings":[{"type":"switch","id":"username","name":"Username","note":"Toggles coloring on the username in audit log.","value":true},{"type":"switch","id":"discriminator","name":"Discriminator","note":"Toggles coloring on the discriminator in audit log.","value":false}]},{"type":"category","id":"account","name":"Account Details Options","collapsible":true,"shown":false,"settings":[{"type":"switch","id":"username","name":"Username","note":"Toggles coloring on the username in account details.","value":true},{"type":"switch","id":"discriminator","name":"Discriminator","note":"Toggles coloring on the discriminator in account details.","value":false}]},{"type":"category","id":"mentions","name":"Mention Options","collapsible":true,"shown":false,"settings":[{"type":"switch","id":"changeOnHover","name":"Hover Color","note":"Turning this on adjusts the color on hover to match role color, having it off defers to your theme.","value":true}]}],"changelog":[{"title":"What's New?","items":["Role headers in the memberlist now match the role color! (You can turn this off in settings)"]}],"main":"index.js"};
return !global.ZeresPluginLibrary ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.authors.map(a => a.name).join(", ");}
getDescription() {return config.info.description;}
getVersion() {return config.info.version;}
load() {window.BdApi.alert("Library Missing",`The library plugin needed for ${config.info.name} is missing.<br /><br /> <a href="https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js" target="_blank">Click here to download the library!</a>`);}
start() {}
stop() {}
} : (([Plugin, Api]) => {
const plugin = (Plugin, Api) => {
const {DiscordSelectors, WebpackModules, DiscordModules, PluginUtilities, Patcher, ColorConverter, ReactTools} = Api;
const ReactDOM = DiscordModules.ReactDOM;
const GuildMemberStore = DiscordModules.GuildMemberStore;
const SelectedGuildStore = DiscordModules.SelectedGuildStore;
const UserStore = DiscordModules.UserStore;
const RelationshipStore = DiscordModules.RelationshipStore;
const PopoutWrapper = WebpackModules.getByProps("Positions", "Animations");
const VoiceUser = WebpackModules.find(m => typeof(m) === "function" && m.List);
const UserPopout = DiscordModules.UserPopout;
const UserModal = DiscordModules.UserProfileModal;
const AuditLogItem = WebpackModules.getByPrototypes("renderPermissionUpdate");
const TypingUsers = WebpackModules.findByDisplayName("FluxContainer(TypingUsers)");
return class BetterRoleColors extends Plugin {
constructor() {
super();
this.cancels = [];
}
onStart() {
this.patchVoiceUsers();
this.patchMentions();
this.patchAccountDetails();
this.patchUserPopouts();
this.patchUserModals();
this.patchAuditLog();
this.patchTypingUsers();
this.patchMemberList();
}
onStop() {
Patcher.unpatchAll();
for (const cancel of this.cancels) cancel();
}
getSettingsPanel() {
return this.buildSettingsPanel().getElement();
}
patchAccountDetails() {
const colorize = () => {
if (!this.settings.account.username && !this.settings.account.discriminator) return;
const account = document.querySelector(DiscordSelectors.AccountDetails.accountDetails);
if (!account) return;
const member = GuildMemberStore.getMember(SelectedGuildStore.getGuildId(), UserStore.getCurrentUser().id);
const color = member && member.colorString ? member.colorString : "";
if (this.settings.account.username) account.querySelector(".username").style.setProperty("color", color, "important");
if (this.settings.account.discriminator) {
account.querySelector(".discriminator").style.setProperty("color", color, "important");
account.querySelector(".discriminator").style.setProperty("opacity", "1");
}
};
PluginUtilities.addOnSwitchListener(colorize);
this.cancels.push(() => {
PluginUtilities.removeOnSwitchListener(colorize);
const account = document.querySelector(DiscordSelectors.AccountDetails.accountDetails);
account.querySelector(".username").style.setProperty("color", "");
account.querySelector(".discriminator").style.setProperty("color", "");
account.querySelector(".discriminator").style.setProperty("opacity", "");
});
colorize();
}
filterTypingUsers(typingUsers) {
if (!typingUsers) return [];
return Object.keys(typingUsers).filter((e) => {
return e != UserStore.getCurrentUser().id;
}).filter((e) => {
return !RelationshipStore.isBlocked(e);
}).map((e) => {
return UserStore.getUser(e);
}).filter(function(e) {
return e != null;
});
}
patchTypingUsers() {
const brc = this;
Patcher.after(TypingUsers.prototype, "componentDidUpdate", (thisObject) => {
if (!brc.settings.modules.typing) return;
setImmediate(() => {
const typingUsers = this.filterTypingUsers(Object.assign({}, thisObject.state.typingUsers));
document.querySelectorAll(DiscordSelectors.Typing.typing.descend("strong")).forEach((elem, index) => {
if (!typingUsers[index]) return;
const member = GuildMemberStore.getMember(SelectedGuildStore.getGuildId(), typingUsers[index].id);
if (!member) return;
elem.style.setProperty("color", member.colorString ? member.colorString : "");
});
});
});
}
patchVoiceUsers() {
const brc = this;
const voiceUserMount = function() {
if (!brc.settings.modules.voice) return;
if (!this || !this.props || !this.props.user) return;
const member = GuildMemberStore.getMember(SelectedGuildStore.getGuildId(), this.props.user.id);
if (!member || !member.colorString) return;
const elem = ReactDOM.findDOMNode(this);
elem.querySelector("[class*=\"name\"]").style.setProperty("color", member.colorString);
};
Patcher.after(VoiceUser.prototype, "componentDidMount", (thisObject) => {
const bound = voiceUserMount.bind(thisObject); bound();
});
}
patchMentions() {
const brc = this;
const mentionMount = function() {
if (!brc.settings.modules.mentions) return;
if (!this || !this.props || !this.props.children || !this.props.children.props || this.props.children.props.className != "mention") return;
const props = this.props.render().props;
if (!props || !props.user) return;
const member = GuildMemberStore.getMember(SelectedGuildStore.getGuildId(), props.user.id);
if (!member || !member.colorString) return;
const elem = ReactDOM.findDOMNode(this);
elem.style.setProperty("color", member.colorString, "important");
elem.style.setProperty("background", ColorConverter.rgbToAlpha(member.colorString,0.1), "important");
if (!brc.settings.mentions.changeOnHover) return;
elem.addEventListener("mouseenter", (e) =>{
e.target.style.setProperty("color", "#FFFFFF", "important");
e.target.style.setProperty("background", ColorConverter.rgbToAlpha(member.colorString,0.7), "important");
});
elem.addEventListener("mouseleave", (e) => {
e.target.style.setProperty("color", member.colorString, "important");
e.target.style.setProperty("background", ColorConverter.rgbToAlpha(member.colorString,0.1), "important");
});
};
Patcher.after(PopoutWrapper.prototype, "componentDidMount", (thisObject) => {
const bound = mentionMount.bind(thisObject); bound();
});
}
patchUserPopouts() {
const brc = this;
const popoutMount = function() {
if (!brc.settings.popouts.username && !brc.settings.popouts.discriminator && !brc.settings.popouts.nickname) return;
if (!this || !this.props || !this.props.user) return;
const member = GuildMemberStore.getMember(SelectedGuildStore.getGuildId(), this.props.user.id);
if (!member || !member.colorString) return;
const elem = ReactDOM.findDOMNode(this);
const hasNickname = Boolean(this.state.nickname);
if (brc.settings.popouts.username || (!hasNickname && brc.settings.popouts.fallback)) elem.querySelector(".username").style.setProperty("color", member.colorString, "important");
if (brc.settings.popouts.discriminator) elem.querySelector(".discriminator").style.setProperty("color", member.colorString, "important");
if (brc.settings.popouts.nickname && hasNickname) elem.querySelector(DiscordSelectors.UserPopout.headerName).style.setProperty("color", member.colorString, "important");
};
Patcher.after(UserPopout.prototype, "componentDidMount", (thisObject) => {
const bound = popoutMount.bind(thisObject); bound();
});
}
patchUserModals() {
const brc = this;
const modalMount = function() {
if (!brc.settings.modals.username && !brc.settings.modals.discriminator) return;
if (!this || !this.props || !this.props.user) return;
const member = GuildMemberStore.getMember(SelectedGuildStore.getGuildId(), this.props.user.id);
if (!member || !member.colorString) return;
const elem = ReactDOM.findDOMNode(this);
if (brc.settings.modals.username) elem.querySelector(".username").style.setProperty("color", member.colorString, "important");
if (brc.settings.modals.discriminator) elem.querySelector(".discriminator").style.setProperty("color", member.colorString, "important");
};
Patcher.after(UserModal.prototype, "componentDidMount", (thisObject) => {
const bound = modalMount.bind(thisObject); bound();
});
}
patchAuditLog() {
const brc = this;
const auditlogMount = function() {
if (!brc.settings.auditLog.username && !brc.settings.auditLog.discriminator) return;
if (!this || !this.props || !this.props.log || !this.props.log.user) return;
const elem = ReactDOM.findDOMNode(this);
const hooks = elem.querySelectorAll(DiscordSelectors.AuditLog.userHook);
const member = GuildMemberStore.getMember(this._reactInternalFiber.return.memoizedProps.guildId, this.props.log.user.id);
if (member && member.colorString) {
if (member.colorString && brc.settings.auditLog.username) hooks[0].children[0].style.color = member.colorString;
if (member.colorString && brc.settings.auditLog.discriminator) { hooks[0].querySelector(DiscordSelectors.AuditLog.discrim).style.color = member.colorString;hooks[0].querySelector(DiscordSelectors.AuditLog.discrim).style.opacity = 1;}
}
if (hooks.length < 2 || this.props.log.targetType != "USER") return;
const member2 = GuildMemberStore.getMember(this._reactInternalFiber.return.memoizedProps.guildId, this.props.log.target.id);
if (!member2 || !member2.colorString) return;
if (brc.settings.auditLog.username) hooks[1].children[0].style.color = member2.colorString;
if (brc.settings.auditLog.discriminator) { hooks[1].querySelector(DiscordSelectors.AuditLog.discrim).style.color = member2.colorString;hooks[1].querySelector(DiscordSelectors.AuditLog.discrim).style.opacity = 1;}
};
Patcher.after(AuditLogItem.prototype, "componentDidMount", (thisObject) => {
const bound = auditlogMount.bind(thisObject); bound();
});
}
getMemberGroup() {
return new Promise(resolve => {
const memberList = document.querySelector(DiscordSelectors.MemberList.membersWrap);
if (memberList) {resolve(ReactTools.getOwnerInstance(memberList, {include: ["ChannelMembers"]}).constructor);}
else {
const channel = WebpackModules.find(m => m.prototype && m.prototype.renderEmptyChannel);
const unpatch = Patcher.before(channel.prototype, "componentDidUpdate", (t) => {
const elem = DiscordModules.ReactDOM.findDOMNode(t);
if (!elem) return;
const memberList = elem.querySelector(DiscordSelectors.MemberList.membersWrap);
if (!memberList) return;
unpatch();
resolve(ReactTools.getOwnerInstance(memberList, {include: ["ChannelMembers"]}).constructor);
});
}
});
}
forceUpdateMemberList() {
const memberList = document.querySelector(DiscordSelectors.MemberList.membersWrap);
if (memberList) ReactTools.getOwnerInstance(memberList, {include: ["ChannelMembers"]}).forceUpdate();
}
async patchMemberList() {
const MemberList = await this.getMemberGroup();
Patcher.after(MemberList.prototype, "render", (memberList) => {
if (memberList.renderSection.__patched) return;
Patcher.after(memberList, "renderSection", (_, __, section) => {
if (!this.settings.modules.memberList) return;
const guild = DiscordModules.GuildStore.getGuild(memberList.props.channel.guild_id);
if (!guild) return;
const roleColor = guild.roles[section.props.id] ? guild.roles[section.props.id].colorString : "";
if (!roleColor) return;
const originalType = section.type;
section.type = function() {
const label = originalType(...arguments);
label.props.style = {color: roleColor};
return label;
};
return section;
});
memberList.renderSection.__patched = true;
});
this.forceUpdateMemberList();
}
};
};
return plugin(Plugin, Api);
})(global.ZeresPluginLibrary.buildPlugin(config));
})();

View File

@ -1,6 +0,0 @@
{
"currentVersionInfo": {
"version": "0.0.3",
"hasShownChangelog": true
}
}

View File

@ -1,47 +0,0 @@
//META{"name":"DoNotTrack","displayName":"DoNotTrack","website":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/DoNotTrack","source":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/DoNotTrack/DoNotTrack.plugin.js"}*//
var DoNotTrack = (() => {
const config = {"info":{"name":"DoNotTrack","authors":[{"name":"Zerebos","discord_id":"249746236008169473","github_username":"rauenzi","twitter_username":"ZackRauen"}],"version":"0.0.3","description":"Stops Discord from tracking everything you do like Sentry and Analytics. Support Server: bit.ly/ZeresServer","github":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/DoNotTrack","github_raw":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/DoNotTrack/DoNotTrack.plugin.js"},"changelog":[{"title":"What's New?","items":["Use only local lib loading."]}],"main":"index.js"};
return !global.ZeresPluginLibrary ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.authors.map(a => a.name).join(", ");}
getDescription() {return config.info.description;}
getVersion() {return config.info.version;}
load() {window.BdApi.alert("Library Missing",`The library plugin needed for ${config.info.name} is missing.<br /><br /> <a href="https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js" target="_blank">Click here to download the library!</a>`);}
start() {}
stop() {}
} : (([Plugin, Api]) => {
const plugin = (Plugin, Api) => {
const {Patcher, WebpackModules} = Api;
return class DoNotTrack extends Plugin {
onStart() {
const Analytics = WebpackModules.getByProps("AnalyticEventConfigs");
Patcher.instead(Analytics.default, "track", () => {});
const Warning = WebpackModules.getByProps("consoleWarning");
Patcher.instead(Warning, "consoleWarning", () => {});
const MethodWrapper = WebpackModules.getByProps("wrapMethod");
Patcher.instead(MethodWrapper, "wrapMethod", () => {});
const Sentry = WebpackModules.getByProps("_originalConsoleMethods", "_wrappedBuiltIns");
Sentry.uninstall();
Patcher.instead(Sentry, "_breadcrumbEventHandler", () => () => {});
Patcher.instead(Sentry, "captureBreadcrumb", () => {});
Patcher.instead(Sentry, "_makeRequest", () => {});
Patcher.instead(Sentry, "_sendProcessedPayload", () => {});
Patcher.instead(Sentry, "_send", () => {});
Object.assign(window.console, Sentry._originalConsoleMethods);
}
onStop() {
Patcher.unpatchAll();
}
};
};
return plugin(Plugin, Api);
})(global.ZeresPluginLibrary.buildPlugin(config));
})();

View File

@ -1,6 +0,0 @@
{
"currentVersionInfo": {
"version": "1.0.8",
"hasShownChangelog": true
}
}

View File

@ -1,95 +0,0 @@
//META { "name": "HighlightSelf", "website": "https://inve1951.github.io/BetterDiscordStuff/" } *//
var HighlightSelf;
HighlightSelf = function () {
var MessageComponents, UserStore, cancel, css, getOwnerInstance, install;
class HighlightSelf {
getName() {
return "Highlight Self";
}
getDescription() {
return "Highlights your own username in message headers.";
}
getAuthor() {
return "square";
}
getVersion() {
return "1.1.0";
}
load() {
return window.SuperSecretSquareStuff != null ? window.SuperSecretSquareStuff : window.SuperSecretSquareStuff = new Promise(function (c, r) {
return require("request").get("https://raw.githubusercontent.com/Inve1951/BetterDiscordStuff/master/plugins/0circle.plugin.js", function (err, res, body) {
if (err || 200 !== (res != null ? res.statusCode : void 0)) {
return r(err != null ? err : res);
}
Object.defineProperties(window.SuperSecretSquareStuff, {
libLoaded: {
value: c
},
code: {
value: body
}
});
return (0, eval)(body);
});
});
}
async start() {
({ getOwnerInstance } = await SuperSecretSquareStuff);
if (!install()) {
this.onSwitch = install;
}
return BdApi.injectCSS("css_highlightSelf", css);
}
stop() {
if (cancel) {
cancel();
cancel = null;
}
return BdApi.clearCSS("css_highlightSelf");
}
};
MessageComponents = UserStore = cancel = getOwnerInstance = null;
install = function () {
var i, len, n, ref;
MessageComponents || (MessageComponents = BDV2.WebpackModules.find(function (m) {
return m.MessageUsername;
}));
UserStore || (UserStore = BDV2.WebpackModules.findByUniqueProperties(["getCurrentUser"]));
if (!(MessageComponents && UserStore)) {
return false;
}
delete this.onSwitch;
cancel = Utils.monkeyPatch(MessageComponents.MessageUsername.prototype, "render", {
after: function ({ returnValue, thisObject }) {
var props, ref;
({ props } = returnValue.props.children);
if (UserStore.getCurrentUser() === thisObject.props.message.author && !((ref = props.className) != null ? ref.endsWith(" highlight-self") : void 0)) {
return props.className = props.className ? props.className + " highlight-self" : "highlight-self";
}
}
});
try {
ref = document.querySelectorAll(".message-1PNnaP h2 > span");
for (i = 0, len = ref.length; i < len; i++) {
n = ref[i];
getOwnerInstance(n).forceUpdate();
}
} catch (error) {}
return true;
};
css = ".highlight-self .username-_4ZSMR {\n text-decoration: underline;\n}";
return HighlightSelf;
}.call(this);

View File

@ -1,6 +0,0 @@
{
"currentVersionInfo": {
"version": "0.1.3",
"hasShownChangelog": true
}
}

View File

@ -1,589 +0,0 @@
//META{"name":"PermissionsViewer","displayName":"PermissionsViewer","website":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/PermissionsViewer","source":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/PermissionsViewer/PermissionsViewer.plugin.js"}*//
var PermissionsViewer = (() => {
const config = {"info":{"name":"PermissionsViewer","authors":[{"name":"Zerebos","discord_id":"249746236008169473","github_username":"rauenzi","twitter_username":"ZackRauen"}],"version":"0.1.3","description":"Allows you to view a user's permissions. Thanks to Noodlebox for the idea! Support Server: bit.ly/ZeresServer","github":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/PermissionsViewer","github_raw":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/PermissionsViewer/PermissionsViewer.plugin.js"},"changelog":[{"title":"Bug Fixes","type":"fixes","items":["Permissions button showing in DMs","Owner pseudo-role having no permissions"]}],"defaultConfig":[{"type":"switch","id":"contextMenus","name":"Context Menus","note":"Toggles colorizing of typing notifications.","value":true},{"type":"switch","id":"popouts","name":"Popouts","note":"Toggles colorizing of typing notifications.","value":true}],"strings":{"es":{"contextMenuLabel":"Permisos","popoutLabel":"Permisos","modal":{"header":"Permisos de ${name}","rolesLabel":"Roles","permissionsLabel":"Permisos","owner":"@propietario"},"settings":{"popouts":{"name":"Mostrar en Popouts","note":"Mostrar los permisos de usuario en popouts como los roles."},"contextMenus":{"name":"Botón de menú contextual","note":"Añadir un botón para ver permisos en los menús contextuales."}}},"pt":{"contextMenuLabel":"Permissões","popoutLabel":"Permissões","modal":{"header":"Permissões de ${name}","rolesLabel":"Cargos","permissionsLabel":"Permissões","owner":"@dono"},"settings":{"popouts":{"name":"Mostrar em Popouts","note":"Mostrar as permissões em popouts como os cargos."},"contextMenus":{"name":"Botão do menu de contexto","note":"Adicionar um botão parar ver permissões ao menu de contexto."}}},"de":{"contextMenuLabel":"Berechtigungen","popoutLabel":"Berechtigungen","modal":{"header":"${name}s Berechtigungen","rolesLabel":"Rollen","permissionsLabel":"Berechtigungen","owner":"@eigentümer"},"settings":{"popouts":{"name":"In Popouts anzeigen","note":"Zeigt die Gesamtberechtigungen eines Benutzers in seinem Popup ähnlich den Rollen an."},"contextMenus":{"name":"Kontextmenü-Schaltfläche","note":"Fügt eine Schaltfläche hinzu, um die Berechtigungen mithilfe von Kontextmenüs anzuzeigen."}}},"en":{"contextMenuLabel":"Permissions","popoutLabel":"Permissions","modal":{"header":"${name}'s Permissions","rolesLabel":"Roles","permissionsLabel":"Permissions","owner":"@owner"},"settings":{"popouts":{"name":"Show In Popouts","note":"Shows a user's total permissions in their popout similar to roles."},"contextMenus":{"name":"Context Menu Button","note":"Adds a button to view the permissions modal to select context menus."}}}},"main":"index.js"};
return !global.ZeresPluginLibrary ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.authors.map(a => a.name).join(", ");}
getDescription() {return config.info.description;}
getVersion() {return config.info.version;}
load() {window.BdApi.alert("Library Missing",`The library plugin needed for ${config.info.name} is missing.<br /><br /> <a href="https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js" target="_blank">Click here to download the library!</a>`);}
start() {}
stop() {}
} : (([Plugin, Api]) => {
const plugin = (Plugin, Api) => {
const {Patcher, DiscordModules, PluginUtilities, Toasts, DiscordClasses, DiscordSelectors, Utilities, DOMTools, ReactTools, ContextMenu, ColorConverter} = Api;
const GuildStore = DiscordModules.GuildStore;
const SelectedGuildStore = DiscordModules.SelectedGuildStore;
const MemberStore = DiscordModules.GuildMemberStore;
const UserStore = DiscordModules.UserStore;
const DiscordPerms = Object.assign({}, DiscordModules.DiscordConstants.Permissions);
if (DiscordPerms.SEND_TSS_MESSAGES) {
DiscordPerms.SEND_TTS_MESSAGES = DiscordPerms.SEND_TSS_MESSAGES;
delete DiscordPerms.SEND_TSS_MESSAGES;
}
if (DiscordPerms.MANAGE_GUILD) {
DiscordPerms.MANAGE_SERVER = DiscordPerms.MANAGE_GUILD;
delete DiscordPerms.MANAGE_GUILD;
}
return class PermissionsViewer extends Plugin {
constructor() {
super();
this.css = `.member-perms-header {
display: flex;
justify-content: space-between;
}
.member-perms {
display: flex;
flex-wrap: wrap;
margin-top: 2px;
max-height: 160px;
overflow-y: auto;
}
.member-perms .member-perm .perm-circle {
border-radius: 50%;
height: 12px;
margin-right: 4px;
width: 12px;
}
.member-perms .member-perm .name {
margin-right: 4px;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.perm-details-button {
cursor: pointer;
height: 12px;
}
.perm-details {
display: flex;
justify-content: flex-end;
}
.member-perm-details {
cursor: pointer;
}
.member-perm-details-button {
fill: #72767d;
height: 10px;
}
/* Modal */
@keyframes permissions-backdrop {
to { opacity: 0.85; }
}
@keyframes permissions-modal-wrapper {
to { transform: scale(1); opacity: 1; }
}
@keyframes permissions-backdrop-closing {
to { opacity: 0; }
}
@keyframes permissions-modal-wrapper-closing {
to { transform: scale(0.7); opacity: 0; }
}
#permissions-modal-wrapper .callout-backdrop {
animation: permissions-backdrop 250ms ease;
animation-fill-mode: forwards;
opacity: 0;
background-color: rgb(0, 0, 0);
transform: translateZ(0px);
}
#permissions-modal-wrapper.closing .callout-backdrop {
animation: permissions-backdrop-closing 200ms linear;
animation-fill-mode: forwards;
animation-delay: 50ms;
opacity: 0.85;
}
#permissions-modal-wrapper.closing .modal-wrapper {
animation: permissions-modal-wrapper-closing 250ms cubic-bezier(0.19, 1, 0.22, 1);
animation-fill-mode: forwards;
opacity: 1;
transform: scale(1);
}
#permissions-modal-wrapper .modal-wrapper {
animation: permissions-modal-wrapper 250ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
animation-fill-mode: forwards;
transform: scale(0.7);
transform-origin: 50% 50%;
display: flex;
align-items: center;
box-sizing: border-box;
contain: content;
justify-content: center;
top: 0;
left: 0;
bottom: 0;
right: 0;
opacity: 0;
pointer-events: none;
position: absolute;
user-select: none;
z-index: 1000;
}
#permissions-modal-wrapper .modal-body {
background-color: #36393f;
height: 440px;
width: auto;
/*box-shadow: 0 0 0 1px rgba(32,34,37,.6), 0 2px 10px 0 rgba(0,0,0,.2);*/
flex-direction: row;
overflow: hidden;
display: flex;
flex: 1;
contain: layout;
position: relative;
}
#permissions-modal-wrapper #permissions-modal {
display: flex;
contain: layout;
flex-direction: column;
pointer-events: auto;
border: 1px solid rgba(28,36,43,.6);
border-radius: 5px;
box-shadow: 0 2px 10px 0 rgba(0,0,0,.2);
overflow: hidden;
}
#permissions-modal-wrapper .header {
background-color: #35393e;
box-shadow: 0 2px 3px 0 rgba(0,0,0,.2);
padding: 12px 20px;
z-index: 1;
color: #fff;
font-size: 16px;
font-weight: 700;
line-height: 19px;
}
.role-side, .perm-side {
flex-direction: column;
padding-left: 6px;
}
.role-scroller, .perm-scroller {
contain: layout;
flex: 1;
min-height: 1px;
overflow-y: scroll;
}
#permissions-modal-wrapper .scroller-title {
color: #fff;
padding: 8px 0 4px 4px;
margin-right: 8px;
border-bottom: 1px solid rgba(0,0,0,0.3);
display: none;
}
#permissions-modal-wrapper .role-side {
width: auto;
min-width: 150px;
background: #2f3136;
flex: 0 0 auto;
overflow: hidden;
display: flex;
height: 100%;
min-height: 1px;
position: relative;
}
#permissions-modal-wrapper .role-scroller {
contain: layout;
flex: 1;
min-height: 1px;
overflow-y: scroll;
padding-top: 8px;
}
#permissions-modal-wrapper .role-item {
display: flex;
border-radius: 2px;
padding: 6px;
margin-bottom: 5px;
cursor: pointer;
color: #dcddde;
}
#permissions-modal-wrapper .role-item:hover {
background-color: rgba(0,0,0,0.1);
}
#permissions-modal-wrapper .role-item.selected {
background-color: rgba(0,0,0,0.2);
}
#permissions-modal-wrapper .perm-side {
width: 250px;
background-color: #36393f;
flex: 0 0 auto;
display: flex;
height: 100%;
min-height: 1px;
position: relative;
padding-left: 10px;
}
#permissions-modal-wrapper .perm-item {
box-shadow: inset 0 -1px 0 rgba(79,84,92,.3);
box-sizing: border-box;
height: 44px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex-direction: row;
justify-content: flex-start;
align-items: center;
display: flex;
}
#permissions-modal-wrapper .perm-item.allowed svg {
fill: #43B581;
}
#permissions-modal-wrapper .perm-item.denied svg {
fill: #F04747;
}
#permissions-modal-wrapper .perm-name {
display: inline;
flex: 1;
font-size: 16px;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
user-select: text;
color: #dcddde;
margin-left: 10px;
}
.member-perms::-webkit-scrollbar-thumb, .member-perms::-webkit-scrollbar-track,
#permissions-modal-wrapper *::-webkit-scrollbar-thumb, #permissions-modal-wrapper *::-webkit-scrollbar-track {
background-clip: padding-box;
border-radius: 7.5px;
border-style: solid;
border-width: 3px;
visibility: hidden;
}
.member-perms:hover::-webkit-scrollbar-thumb, .member-perms:hover::-webkit-scrollbar-track,
#permissions-modal-wrapper *:hover::-webkit-scrollbar-thumb, #permissions-modal-wrapper *:hover::-webkit-scrollbar-track {
visibility: visible;
}
.member-perms::-webkit-scrollbar-track,
#permissions-modal-wrapper *::-webkit-scrollbar-track {
border-width: initial;
background-color: transparent;
border: 2px solid transparent;
}
.member-perms::-webkit-scrollbar-thumb,
#permissions-modal-wrapper *::-webkit-scrollbar-thumb {
border: 2px solid transparent;
border-radius: 4px;
cursor: move;
background-color: rgba(32,34,37,.6);
}
.member-perms::-webkit-scrollbar,
#permissions-modal-wrapper *::-webkit-scrollbar {
height: 8px;
width: 8px;
}`;
this.listHTML = `<div id="permissions-popout">
<div class="member-perms-header \${bodyTitle}">
<div class="member-perms-title">\${label}</div>
<span class="perm-details">
<svg name="Details" viewBox="0 0 24 24" class="perm-details-button" fill="currentColor">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
</svg>
</span>
</div>
<ul class="member-perms \${root} \${rolesList} \${endBodySection}"></ul>
</div>`;
this.itemHTML = `<li class="member-perm \${role}">
<div class="perm-circle \${roleCircle}"></div>
<div class="name \${roleName}"></div>
</li>`;
this.modalHTML = `<div id="permissions-modal-wrapper">
<div class="callout-backdrop \${backdrop}"></div>
<div class="modal-wrapper \${modal}">
<div id="permissions-modal" class="\${inner}">
<div class="header"><div class="title">\${header}</div></div>
<div class="modal-body">
<div class="role-side">
<span class="scroller-title role-list-title">\${rolesLabel}</span>
<div class="role-scroller">
</div>
</div>
<div class="perm-side">
<span class="scroller-title perm-list-title">\${permissionsLabel}</span>
<div class="perm-scroller">
</div>
</div>
</div>
</div>
</div>
</div>`;
this.modalItem = `<div class="perm-item"><span class="perm-name"></span></div>`;
this.modalButton = `<div class="role-item"><span class="role-name"></span></div>`;
this.modalButtonUser = `<div class="role-item"><div class="wrapper-2F3Zv8 xsmall-3afG_L"><div class="image-33JSyf xsmall-3afG_L" style="background-image: url('\${avatarUrl}');"></div></div><span class="role-name marginLeft8-1YseBe"></span></div>`;
this.permAllowedIcon = `<svg height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>`;
this.permDeniedIcon = `<svg height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"/></svg>`;
this.contextObserver = new MutationObserver((changes) => {
for (let change in changes) this.observeContextMenus(changes[change]);
});
this.cancelUserPopout = () => {};
}
onStart() {
PluginUtilities.addStyle(this.getName(), this.css);
this.listHTML = Utilities.formatTString(this.listHTML, DiscordClasses.UserPopout);
this.listHTML = Utilities.formatTString(this.listHTML, DiscordClasses.PopoutRoles);
this.itemHTML = Utilities.formatTString(this.itemHTML, DiscordClasses.PopoutRoles);
this.modalHTML = Utilities.formatTString(this.modalHTML, DiscordClasses.Backdrop);
this.modalHTML = Utilities.formatTString(this.modalHTML, DiscordClasses.Modals);
if (this.settings.popouts) this.bindPopouts();
if (this.settings.contextMenus) this.bindContextMenus();
}
onStop() {
PluginUtilities.removeStyle(this.getName());
this.unbindPopouts();
this.unbindContextMenus();
}
bindPopouts() {
let pViewer = this;
let UserPopout = DiscordModules.UserPopout;
let popoutMount = function() {
const user = this.state.guildMember;
const guild = this.state.guild;
const name = this.state.nickname ? this.state.nickname : this.props.user.username;
if (!user || !guild || !name) return;
const userRoles = user.roles.slice(0);
userRoles.push(guild.id);
userRoles.reverse();
let perms = 0;
const permBlock = DOMTools.createElement(Utilities.formatTString(pViewer.listHTML, {label: pViewer.strings.popoutLabel}));
const memberPerms = permBlock.find(".member-perms");
const strings = DiscordModules.Strings;
for (let r = 0; r < userRoles.length; r++) {
const role = userRoles[r];
perms = perms | guild.roles[role].permissions;
for (let perm in DiscordPerms) {
var permName = strings[perm];
const hasPerm = (perms & DiscordPerms[perm]) == DiscordPerms[perm];
if (hasPerm && !memberPerms.find(`[data-name="${permName}"]`)) {
const element = DOMTools.createElement(pViewer.itemHTML);
let roleColor = guild.roles[role].colorString;
element.find(".name").textContent = permName;
element.setAttribute("data-name", permName);
if (!roleColor) roleColor = "#B9BBBE";
element.find(".perm-circle").css("background-color", ColorConverter.rgbToAlpha(roleColor, 1));
element.css("border-color", ColorConverter.rgbToAlpha(roleColor, 0.6));
memberPerms.prepend(element);
}
}
}
const popout = DiscordModules.ReactDOM.findDOMNode(this);
permBlock.find(".perm-details").on("click", () => {
pViewer.showModal(pViewer.createModalUser(name, user, guild));
});
permBlock.insertAfter(popout.querySelector(DiscordSelectors.UserPopout.rolesList));
};
this.cancelUserPopout = Patcher.after(UserPopout.prototype, "componentDidMount", (thisObject) => {
let bound = popoutMount.bind(thisObject); bound();
});
}
unbindPopouts() {
this.cancelUserPopout();
}
bindContextMenus() {
this.contextObserver.observe(document.querySelector("#app-mount"), {childList: true, subtree: true});
}
unbindContextMenus() {
this.contextObserver.disconnect();
}
observeContextMenus(e) {
if (!e.addedNodes.length || !(e.addedNodes[0] instanceof Element) || !e.addedNodes[0].classList) return;
const elem = e.addedNodes[0];
const isContextMenu = elem.matches(DiscordSelectors.ContextMenu.contextMenu);
if (!isContextMenu) return;
const contextMenu = elem;
const memberContext = ReactTools.getReactProperty(contextMenu, "return.return.return.return.memoizedProps.user");
const messageUser = ReactTools.getReactProperty(contextMenu, "return.return.return.return.memoizedProps.guildId");
let menuItem = null;
if (memberContext || messageUser) menuItem = this.userContextMenu(contextMenu, memberContext.id);
let isGuildContext = ReactTools.getReactProperty(contextMenu, "return.memoizedProps.type") == "GUILD_ICON_BAR";
if (isGuildContext) menuItem = this.guildContextMenu(contextMenu, ReactTools.getReactProperty(contextMenu, "return.memoizedProps.guild"));
let isChannelContext = ReactTools.getReactProperty(contextMenu, "return.memoizedProps.type");
if (isChannelContext && isChannelContext.startsWith("CHANNEL_")) menuItem = this.channelContextMenu(contextMenu, ReactTools.getReactProperty(contextMenu, "return.memoizedProps.channel"), ReactTools.getReactProperty(contextMenu, "return.memoizedProps.guild"));
if (!menuItem) return;
contextMenu.find(DiscordSelectors.ContextMenu.item).after(menuItem.getElement());
ContextMenu.updateDiscordMenu(contextMenu);
}
channelContextMenu(contextMenu, channel, guild) {
return new ContextMenu.TextItem(this.strings.contextMenuLabel, {callback: () => {
contextMenu.style.display = "none";
if (!Object.keys(channel.permissionOverwrites).length) return Toasts.info(`#${channel.name} has no permission overrides`);
this.showModal(this.createModalChannel(channel.name, channel, guild));
}});
}
guildContextMenu(contextMenu, guild) {
return new ContextMenu.TextItem(this.strings.contextMenuLabel, {callback: () => {
contextMenu.style.display = "none";
this.showModal(this.createModalGuild(guild.name, guild));
}});
}
userContextMenu(contextMenu, id) {
const guildId = SelectedGuildStore.getGuildId();
const guild = GuildStore.getGuild(guildId);
if (!guild) return null;
const user = MemberStore.getMember(guildId, id);
const name = user.nick ? user.nick : UserStore.getUser(user.userId).username;
if (!user || !name) return null;
return new ContextMenu.TextItem(this.strings.contextMenuLabel, {callback: () => {
contextMenu.style.display = "none";
this.showModal(this.createModalUser(name, user, guild));
}});
}
showModal(modal) {
const popout = document.querySelector("[class*=\"userPopout-\"]");
if (popout) popout.style.display = "none";
const app = document.querySelector("[class*=\"app-\"]");
if (app) app.append(modal);
else document.querySelector("#app-mount").append(modal);
}
createModalChannel(name, channel, guild) {
return this.createModal(`#${name}`, channel.permissionOverwrites, guild.roles, true);
}
createModalUser(name, user, guild) {
const userRoles = user.roles.slice(0);
const guildRoles = JSON.parse(JSON.stringify(guild.roles));
userRoles.push(guild.id);
userRoles.sort((a, b) => {return guildRoles[b].position - guildRoles[a].position;});
if (user.userId == guild.ownerId) {
userRoles.push(user.userId);
guildRoles[user.userId] = {name: this.strings.modal.owner, permissions: DiscordModules.Permissions.ALL};
}
return this.createModal(name, userRoles, guildRoles);
}
createModalGuild(name, guild) {
return this.createModal(name, guild.roles);
}
createModal(title, displayRoles, referenceRoles, isOverride = false) {
if (!referenceRoles) referenceRoles = displayRoles;
const modal = DOMTools.createElement(Utilities.formatTString(Utilities.formatTString(this.modalHTML, this.strings.modal), {name: title}));
modal.find(".callout-backdrop").on("click", () => {
modal.addClass("closing");
setTimeout(() => { modal.remove(); }, 300);
});
const strings = DiscordModules.Strings;
for (const r in displayRoles) {
const role = Array.isArray(displayRoles) ? displayRoles[r] : r;
let item = DOMTools.createElement(!isOverride || displayRoles[role].type == "role" ? this.modalButton : Utilities.formatTString(this.modalButtonUser, {avatarUrl: UserStore.getUser(role).avatarURL}));
if (!isOverride || displayRoles[role].type == "role") item.css("color", referenceRoles[role].colorString);
else item.css("color", MemberStore.getMember(DiscordModules.SelectedGuildStore.getGuildId(), role).colorString);
if (isOverride) item.find(".role-name").textContent = displayRoles[role].type == "role" ? referenceRoles[role].name : UserStore.getUser(role).username;
else item.find(".role-name").textContent = referenceRoles[role].name;
modal.find(".role-scroller").append(item);
item.on("click", () => {
modal.findAll(".role-item.selected").forEach(e => e.removeClass("selected"));
item.addClass("selected");
let allowed = isOverride ? displayRoles[role].allow : referenceRoles[role].permissions;
let denied = isOverride ? displayRoles[role].deny : null;
let permList = modal.find(".perm-scroller");
permList.innerHTML = "";
for (let perm in DiscordPerms) {
let element = DOMTools.createElement(this.modalItem);
let permAllowed = (allowed & DiscordPerms[perm]) == DiscordPerms[perm];
let permDenied = isOverride ? (denied & DiscordPerms[perm]) == DiscordPerms[perm] : !permAllowed;
if (!permAllowed && !permDenied) continue;
if (permAllowed) {
element.addClass("allowed");
element.prepend(DOMTools.createElement(this.permAllowedIcon));
}
if (permDenied) {
element.addClass("denied");
element.prepend(DOMTools.createElement(this.permDeniedIcon));
}
element.find(".perm-name").textContent = strings[perm];
permList.append(element);
}
});
}
modal.find(".role-item").click();
return modal;
}
getSettingsPanel() {
const panel = this.buildSettingsPanel();
panel.addListener(() => {
this.unbindPopouts();
this.unbindContextMenus();
if (this.settings.popouts) this.bindPopouts();
if (this.settings.contextMenu) this.bindContextMenus();
});
return panel.getElement();
}
};
};
return plugin(Plugin, Api);
})(global.ZeresPluginLibrary.buildPlugin(config));
})();

View File

@ -1,6 +0,0 @@
{
"currentVersionInfo": {
"version": "0.1.3",
"hasShownChangelog": true
}
}

View File

@ -1,189 +0,0 @@
//META{"name":"RoleMembers","displayName":"RoleMembers","website":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/RoleMembers","source":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/RoleMembers/RoleMembers.plugin.js"}*//
var RoleMembers = (() => {
const config = {"info":{"name":"RoleMembers","authors":[{"name":"Zerebos","discord_id":"249746236008169473","github_username":"rauenzi","twitter_username":"ZackRauen"}],"version":"0.1.3","description":"Allows you to see the members of each role on a server. Support Server: bit.ly/ZeresServer","github":"https://github.com/rauenzi/BetterDiscordAddons/tree/master/Plugins/RoleMembers","github_raw":"https://raw.githubusercontent.com/rauenzi/BetterDiscordAddons/master/Plugins/RoleMembers/RoleMembers.plugin.js"},"changelog":[{"title":"Sorry","type":"fixes","items":["I keep breaking shit, hopefully this time it's fixed."]}],"main":"index.js"};
return !global.ZeresPluginLibrary ? class {
getName() {return config.info.name;}
getAuthor() {return config.info.authors.map(a => a.name).join(", ");}
getDescription() {return config.info.description;}
getVersion() {return config.info.version;}
load() {window.BdApi.alert("Library Missing",`The library plugin needed for ${config.info.name} is missing.<br /><br /> <a href="https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js" target="_blank">Click here to download the library!</a>`);}
start() {}
stop() {}
} : (([Plugin, Api]) => {
const plugin = (Plugin, Api) => {
const {ContextMenu, Popouts, DiscordModules, DiscordSelectors, DiscordClasses, ReactTools, Utilities} = Api;
const from = arr => arr && arr.length > 0 && Object.assign(...arr.map( ([k, v]) => ({[k]: v}) ));
const filter = (obj, predicate) => from(Object.entries(obj).filter((o) => {return predicate(o[1]);}));
const GuildStore = DiscordModules.GuildStore;
const SelectedGuildStore = DiscordModules.SelectedGuildStore;
const PopoutStack = DiscordModules.PopoutStack;
const GuildMemberStore = DiscordModules.GuildMemberStore;
const UserStore = DiscordModules.UserStore;
const ImageResolver = DiscordModules.ImageResolver;
return class RoleMembers extends Plugin {
constructor() {
super();
this.popout = `<div class="\${className} popout-role-members" style="margin-top: 0;">
<div class="popoutList-T9CKZQ guildSettingsAuditLogsUserFilterPopout-3Jg5NE elevationBorderHigh-2WYJ09 role-members-popout">
<div class="flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY flex-1O1GKY directionRow-3v3tfG justifyStart-2NDFzi alignStretch-DpGPf3 noWrap-3jynv6 searchBar-1MOL6S popoutListInput-1l9TUI size14-3iUx6q" style="flex: 1 1 auto;">
<input class="input-3Xdcic flexChild-faoVW3" value="" placeholder="Search Members — \${memberCount}" style="flex: 1 1 auto;">
<div class="searchBarIcon-18QaPq flexChild-faoVW3">
<i class="icon-1S6UIr eyeGlass-2cMHx7 visible-3bFCH-"></i>
<i class="icon-1S6UIr clear--Eywng"></i>
</div>
</div>
<div class="divider-3573oO divider-faSUbd marginTop8-1DLZ1n marginBottom8-AtZOdT"></div>
<div class="scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerTrack-1ZIpsv">
<div class="scroller-2FKFPG scroller-2CvAgC role-members">
</div>
</div>
</div>
</div>`;
this.item = `<div class="flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY flex-1O1GKY directionRow-3v3tfG justifyStart-2NDFzi alignCenter-1dQNNs noWrap-3jynv6 selectableItem-1MP3MQ role-member" style="flex: 1 1 auto; height: auto;">
<div class="flex-1xMQg5 flex-1O1GKY horizontal-1ae9ci horizontal-2EEEnY flex-1O1GKY directionRow-3v3tfG justifyStart-2NDFzi alignCenter-1dQNNs noWrap-3jynv6 selectableItemLabel-1RKQjD"
style="flex: 1 1 auto;">
<div class="avatar-16XVId small-5Os1Bb flexChild-faoVW3">
<div class="image-33JSyf" style="flex: 0 1 auto; background-image: url(&quot;\${avatar_url}&quot;);"></div>
</div>
<div class="userText-1WdPps" style="flex: 1 1 auto;">
<span class="username">\${username}</span><span class="discriminator-3tYCOD">\${discriminator}</span>
</div>
</div>
</div>`;
this.contextObserver = new MutationObserver((changes) => {
for (let change in changes) this.observeContextMenus(changes[change]);
});
}
onStart() {
this.contextObserver.observe(document.querySelector("#app-mount"), {childList: true, subtree: true});
$(document).on("click." + this.getName(), ".mention", (e) => {
let isRoleMention = ReactTools.getReactProperty(e.target, "return.memoizedState") == null || ReactTools.getReactProperty(e.target, "return.memoizedState.isOpen") === undefined;
if (!isRoleMention) return;
let currentServer = SelectedGuildStore.getGuildId();
let roles = GuildStore.getGuild(currentServer).roles;
let name = e.target.textContent.slice(1);
let role = filter(roles, r => r.name == name);
if (!role) return;
role = role[Object.keys(role)[0]];
this.showRolePopout(e.target, currentServer, role.id);
});
}
onStop() {
$(".popout-role-members").remove();
$("*").off("." + this.getName());
$(document).off("click." + this.getName(), ".mention");
this.contextObserver.disconnect();
}
showPopout(popout, target) {
popout.appendTo(document.querySelector(DiscordSelectors.Popouts.popouts));
const maxWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
const maxHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
let offset = target.getBoundingClientRect();
if (offset.right + popout.outerHeight() >= maxWidth) {
popout[0].addClass(DiscordClasses.Popouts.popoutLeft);
popout.css("left", Math.round(offset.left - popout.outerWidth() - 20));
popout.animate({left: Math.round(offset.left - popout.outerWidth() - 10)}, 100);
}
else {
popout[0].addClass(DiscordClasses.Popouts.popoutRight);
popout.css("left", offset.right + 10);
popout.animate({left: offset.right}, 100);
}
if (offset.top + popout.outerHeight() >= maxHeight) popout.css("top", Math.round(maxHeight - popout.outerHeight()));
else popout.css("top", offset.top);
let listener = document.addEventListener("click", (e) => {
let target = $(e.target);
if (!target.hasClass("popout-role-members") && !target.parents(".popout-role-members").length) popout.remove(), document.removeEventListener("click", listener);
});
}
observeContextMenus(e) {
if (!e.addedNodes.length || !(e.addedNodes[0] instanceof Element) || !e.addedNodes[0].classList) return;
let elem = e.addedNodes[0];
let context = elem.matches(DiscordSelectors.ContextMenu.contextMenu) ? elem : elem.querySelector(DiscordSelectors.ContextMenu.contextMenu);
if (!context) return;
let isGuildContext = ReactTools.getReactProperty(context, "return.memoizedProps.type") == "GUILD_ICON_BAR";
if (!isGuildContext) return;
let guildId = ReactTools.getReactProperty(context, "return.memoizedProps.guild.id");
let roles = GuildStore.getGuild(guildId).roles;
let roleItems = [];
for (let roleId in roles) {
//if (roleId == guildId) continue;
let role = roles[roleId];
let item = new ContextMenu.TextItem(role.name, {
callback: (event) => {
event.stopPropagation();
$(".popout-role-members").remove();
this.showRolePopout(item.element, guildId, role.id);
// $(context).hide();
}
});
if (role.colorString) item.element.css("color", role.colorString);
roleItems.push(item);
}
let subMenu = new ContextMenu.SubMenuItem("Role Members", new ContextMenu.Menu(true).addItems(...roleItems));
$(context).children(DiscordSelectors.ContextMenu.itemGroup).first().append(subMenu.element);
ContextMenu.updateDiscordMenu(context);
}
showRolePopout(target, guildId, roleId) {
let roles = GuildStore.getGuild(guildId).roles;
let role = roles[roleId];
let members = GuildMemberStore.getMembers(guildId);
if (guildId != roleId) members = members.filter(m => m.roles.includes(role.id));
let popout = $(Utilities.formatTString(this.popout, {className: DiscordClasses.Popouts.popout.add(DiscordClasses.Popouts.noArrow), memberCount: members.length}));
let searchInput = popout.find("input");
searchInput.on("keyup", () => {
let items = popout[0].querySelectorAll(".role-member");
for (let i = 0, len = items.length; i < len; i++) {
let search = searchInput.val().toLowerCase();
let item = items[i];
let username = item.querySelector(".username").textContent.toLowerCase();
if (!username.includes(search)) item.style.display = "none";
else item.style.display = "";
}
});
let scroller = popout.find(".role-members");
for (let member of members) {
let user = UserStore.getUser(member.userId);
let elem = $(Utilities.formatTString(this.item, {username: user.username, discriminator: "#" + user.discriminator, avatar_url: ImageResolver.getUserAvatarURL(user)}));
elem.on("click", () => {
PopoutStack.close("role-members");
elem.addClass("popout-open");
if (elem.hasClass("popout-open")) Popouts.showUserPopout(elem[0], user, {guild: guildId});
});
scroller.append(elem);
}
this.showPopout(popout, target);
searchInput.focus();
}
};
};
return plugin(Plugin, Api);
})(global.ZeresPluginLibrary.buildPlugin(config));
})();

View File

@ -1,6 +0,0 @@
{
"currentVersionInfo": {
"version": "1.2.2",
"hasShownChangelog": true
}
}

View File

@ -1,84 +0,0 @@
//META{"name":"copyCode"}*//
var copyCode = function() {};
copyCode.prototype.inject = function() {
setTimeout(function(){
$("code.hljs").each(function() {
if (!$(this).find('.copybutton').length) {
$(this).css({
"position": "relative"
});
var button = $("<button>Copy</button>").addClass("copybutton").css({
"color": "#839496",
"border": "2px solid #282b30",
"background-color": "#2e3136",
"position": "absolute",
"right": "0",
"bottom": "0"
});
button.click(function() {
$(this).hide();
var text = $(this).parent()[0];
var range = document.createRange();
range.selectNode(text);
window.getSelection().addRange(range);
try {
document.execCommand('copy');
} catch (err) {
console.log(err);
}
window.getSelection().removeAllRanges();
$(this).show();
});
$(this).append(button);
}
});
}, 100);
};
copyCode.prototype.observer = function(e) {
this.inject();
};
copyCode.prototype.start = function() {
this.inject();
};
copyCode.prototype.load = function() {};
copyCode.prototype.enable = function() {};
copyCode.prototype.onSwitch = function() {};
copyCode.prototype.onMessage = function() {};
copyCode.prototype.getSettingsPanel = function() {
return "";
};
copyCode.prototype.getName = function() {
return "Copy Code Plugin";
};
copyCode.prototype.getDescription = function() {
return "Copies Code from Code Blocks with a Button";
};
copyCode.prototype.getVersion = function() {
return "2.0";
};
copyCode.prototype.getAuthor = function() {
return "Finicalmist";
};
copyCode.prototype.remove = function() {
$("code.hljs").css({
"position": ""
});
$(".copybutton").remove();
};
copyCode.prototype.stop = function() {};
copyCode.prototype.unload = function() {};
copyCode.prototype.disable = function() {};

View File

@ -1,48 +0,0 @@
//META{"name":"dblClickEdit"}*//
var dblClickEdit = function () {};
dblClickEdit.prototype.handler = function(e) {
const message = e.target.closest('[class^=messageCozy]') || e.target.closest('[class^=messageCompact]');
if (!message) return;
const btn = message.querySelector('[class^=buttonContainer] [class^=button-]');
if (!btn) return;
btn.click();
const popup = document.querySelector('[class^=container][role=menu]');
if (!popup) return;
const rii = popup[Object.keys(popup).find(k => k.startsWith('__reactInternal'))];
if (!rii || !rii.memoizedProps || !rii.memoizedProps.children || !rii.memoizedProps.children[1] || !rii.memoizedProps.children[1].props || !rii.memoizedProps.children[1].props.onClick) return;
rii.memoizedProps.children[1].props.onClick();
};
dblClickEdit.prototype.onMessage = function () {
};
dblClickEdit.prototype.onSwitch = function () {
};
dblClickEdit.prototype.start = function () {
document.addEventListener('dblclick', this.handler);
};
dblClickEdit.prototype.load = function () {};
dblClickEdit.prototype.unload = function () {
document.removeEventListener('dblclick', this.handler);
};
dblClickEdit.prototype.stop = function () {
document.removeEventListener('dblclick', this.handler);
};
dblClickEdit.prototype.getSettingsPanel = function () {
return "";
};
dblClickEdit.prototype.getName = function () {
return "Double click edit";
};
dblClickEdit.prototype.getDescription = function () {
return "Double click messages to edit them";
};
dblClickEdit.prototype.getVersion = function () {
return "0.2.1";
};
dblClickEdit.prototype.getAuthor = function () {
return "Jiiks";
};

File diff suppressed because one or more lines are too long

View File

@ -1,295 +0,0 @@
//META{"name":"GreenText","displayName":"GreenText","website":"https://github.com/Arashiryuu","source":"https://github.com/Arashiryuu/crap/blob/master/greenText.plugin.js"}*//
/*@cc_on
@if (@_jscript)
// Offer to self-install for clueless users that try to run this directly.
var shell = WScript.CreateObject('WScript.Shell');
var fs = new ActiveXObject('Scripting.FileSystemObject');
var pathPlugins = shell.ExpandEnvironmentStrings('%APPDATA%\\BetterDiscord\\plugins');
var pathSelf = WScript.ScriptFullName;
// Put the user at ease by addressing them in the first person
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.\nJust reload Discord with Ctrl+R.', 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!\nJust reload Discord with Ctrl+R.', 0, 'Successfully installed', 0x40);
}
WScript.Quit();
@else@*/
var GreenText = (() => {
/* Setup */
const config = {
main: 'index.js',
info: {
name: 'GreenText',
authors: [
{
name: 'Arashiryuu',
discord_id: '238108500109033472',
github_username: 'Arashiryuu',
twitter_username: ''
}
],
version: '1.0.8',
description: 'Turns sentences beginning with "\>" green.',
github: 'https://github.com/Arashiryuu',
github_raw: 'https://raw.githubusercontent.com/Arashiryuu/crap/master/greenText.plugin.js'
},
changelog: [
{
title: 'Updated',
type: 'improved',
items: ['Compact mode improvements.']
}
]
};
/* Utility */
const log = function() {
/**
* @type {Array}
*/
const args = Array.prototype.slice.call(arguments);
args.unshift(`%c[${config.info.name}]`, 'color: #3A71C1; font-weight: 700;');
return console.log.apply(this, args);
};
const err = function() {
/**
* @type {Array}
*/
const args = Array.prototype.slice.call(arguments);
args.unshift(`%c[${config.info.name}]`, 'color: #3A71C1; font-weight: 700;');
return console.error.apply(this, args);
};
/* Build */
const buildPlugin = ([Plugin, Api]) => {
const { Toasts, Logger, DOMTools, WebpackModules, DiscordSelectors } = Api;
return class GreenText extends Plugin {
constructor() {
super();
this._css;
this.regex = /^&gt;\S?.+|^>\S?.+/igm;
this.css = `
${DiscordSelectors.Messages.message.value.trim()} #GreenText {
color: #709900 !important;
transition: all 200ms ease;
}
${DiscordSelectors.Messages.message.value.trim()} #GreenText:hover {
font-weight: bold;
}
`;
this.switchList = [
'app',
DiscordSelectors.TitleWrap.chat.value.split('.')[1],
WebpackModules.getByProps('messages', 'messagesWrapper').messagesWrapper
];
this.messageList = [
DiscordSelectors.Messages.container.value.slice(2),
DiscordSelectors.Messages.message.value.slice(2)
];
}
/* Methods */
onStart() {
this.injectCSS();
this.run();
Toasts.info(`${this.name} ${this.version} has started!`, { icon: true, timeout: 2e3 });
}
onStop() {
this.removeCSS();
Toasts.info(`${this.name} ${this.version} has stopped!`, { icon: true, timeout: 2e3 });
}
run() {
const messages = document.querySelectorAll(`.${WebpackModules.getByProps('markup').markup}`);
if (this.isCompact()) {
for (const message of messages) {
const textNodes = Array.from(message.childNodes).filter((node) => node.nodeType === 3);
for (const node of textNodes) {
const matches = node.data.match(this.regex);
if (!matches || !matches.length) continue;
const data = node.data.split('\n');
const replaceNodes = data.reduce((arr, text) => {
if (text.match(this.regex)) {
const el = DOMTools.parseHTML(`<span id="GreenText">${text}\n</span>`);
arr.push(el);
return arr;
}
arr.push(document.createTextNode(`${text}\n`));
return arr;
}, []);
if (!replaceNodes[0].id) replaceNodes[0].data = `${replaceNodes[0].data.trim()}\n`;
if (!replaceNodes[replaceNodes.length - 1].id) replaceNodes[replaceNodes.length - 1].data = `${replaceNodes[replaceNodes.length - 1].data.trim()}`;
node.replaceWith(...replaceNodes);
}
}
}
for (const message of messages) {
const matches = message.innerHTML.match(this.regex);
if (!matches || !matches.length) continue;
const html = message.innerHTML;
message.innerHTML = html.replace(this.regex, '<span id="GreenText">$&</span>');
}
}
injectCSS() {
const s = DOMTools.parseHTML(`<style id="GreenTextCSS" type="text/css">${this.css}</style>`);
DOMTools.appendTo(s, document.head);
}
removeCSS() {
const e = document.getElementById('GreenTextCSS');
if (!e) return;
e.remove();
}
isCompact() {
const message = document.querySelector(`.${WebpackModules.getByProps('markup').markup}`);
if (!message) return false;
return message.classList.contains(WebpackModules.getByProps('isCompact').isCompact);
}
/* Observer */
observer({ addedNodes }) {
if (addedNodes.length && addedNodes[0].classList && this.switchList.includes(addedNodes[0].classList[0])) {
this.run();
} else if (addedNodes.length && addedNodes[0].classList && this.messageList.includes(addedNodes[0].classList[addedNodes[0].classList.length - 1])) {
this.run();
}
}
/* Setters */
set css(style = '') {
return this._css = style.split(/\s+/g).join(' ').trim();
}
/* Getters */
get [Symbol.toStringTag]() {
return 'Plugin';
}
get css() {
return this._css;
}
get name() {
return config.info.name;
}
get short() {
let string = '';
for (let i = 0, len = config.info.name.length; i < len; i++) {
const char = config.info.name[i];
if (char === char.toUpperCase()) string += char;
}
return string;
}
get author() {
return config.info.authors.map((author) => author.name).join(', ');
}
get version() {
return config.info.version;
}
get description() {
return config.info.description;
}
}
};
/* Finalize */
return !global.ZeresPluginLibrary
? class {
getName() {
return this.name.replace(/\s+/g, '');
}
getAuthor() {
return this.author;
}
getVersion() {
return this.version;
}
getDescription() {
return this.description;
}
stop() {
Logger.log('Stopped!');
}
load() {
window.BdApi.alert('Missing Library', `The library plugin needed for ${config.info.name} is missing.<br /><br /> <a href="https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js" target="_blank">Click here to download the library!</a>`);
}
start() {
Logger.log('Started!');
}
/* Getters */
get [Symbol.toStringTag]() {
return 'Plugin';
}
get name() {
return config.info.name;
}
get short() {
let string = '';
for (let i = 0, len = config.info.name.length; i < len; i++) {
const char = config.info.name[i];
if (char === char.toUpperCase()) string += char;
}
return string;
}
get author() {
return config.info.authors.map((author) => author.name).join(', ');
}
get version() {
return config.info.version;
}
get description() {
return config.info.description;
}
}
: buildPlugin(global.ZeresPluginLibrary.buildPlugin(config));
})();
/*@end@*/

View File

@ -1,28 +0,0 @@
//META{"name":"linkProfilePicture"}*//
class linkProfilePicture {
getName(){return "Link-Profile-Picture"}
getDescription(){return "Lets you click users' avatars on their profile page to view a bigger version in your browser."}
getVersion(){return "1.0.3"}
getAuthor(){return "square"}
load(){}
start(){}
stop(){}
observer(mutation){
var x, i = 0,
ref = mutation.addedNodes,
wrapper, a, pic, url;
while(x = ref[i++]) if("DIV" === x.nodeName && 0 === x.className.indexOf("modal-") && (wrapper = x.querySelector(".avatar-3EQepX.profile-ZOdGIb")) &&
(pic = wrapper.querySelector(".image-33JSyf")) && (url = pic.style.backgroundImage.match(/https.+(?:webp|png|gif)/))){
a = document.createElement("a");
a.href = url[0] + "?size=2048"; // returns biggest version (can be smaller than 2048); if the pic is blurry it's due to the original or what discord did to it
a.target = "_blank"; a.rel = "noreferrer";
wrapper.insertBefore(a, pic);
a.appendChild(pic);
break;
}
}
}

View File

@ -1,783 +0,0 @@
//META{"name":"p_no_send_scroll"}*//
/*@cc_on
@if (@_jscript)
// Offer to self-install for clueless users that try to run this directly.
var shell = WScript.CreateObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");
var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins");
var pathSelf = WScript.ScriptFullName;
// Put the user at ease by addressing them in the first person
shell.Popup("It looks like you tried to run me directly. This is not desired behavior! It will work now, but likely will not work with other plugins. Even worse, with other untrusted plugins it may lead computer virus infection!", 0, "I'm a plugin for BetterDiscord", 0x30);
if (fs.GetParentFolderName(pathSelf) === fs.GetAbsolutePathName(pathPlugins)) {
shell.Popup("I'm in the correct folder already.\nJust reload Discord with Ctrl+R.", 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!\nJust reload Discord with Ctrl+R.", 0, "Successfully installed", 0x40);
}
WScript.Quit();
@else @*/
var p_no_send_scroll =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(15);
/***/ }),
/* 1 */,
/* 2 */,
/* 3 */
/***/ (function(module, exports) {
/**
* BetterDiscord Plugin Base Class
* Copyright (c) 2015-present Jiiks - https://jiiks.net
* All rights reserved.
* https://github.com/Jiiks/BetterDiscordApp - https://betterdiscord.net
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
class Plugin {
constructor(props) {
this.props = props;
}
get authors() {
return this.props.authors;
}
get version() {
return this.props.version;
}
get name() {
return this.props.name;
}
get description() {
return this.props.description;
}
get reloadable() {
return this.props.reloadable;
}
get permissions() {
return this.props.permissions;
}
get storage() {
return this.internal.storage;
}
get settings() {
return this.storage.settings;
}
saveSettings() {
this.storage.save();
this.onSave(this.settings);
}
getSetting(id) {
let setting = this.storage.settings.find(setting => { return setting.id === id; });
if (setting && setting.value !== undefined) return setting.value;
}
get enabled() {
return this.getSetting("enabled");
}
}
module.exports = Plugin;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
/**
* BetterDiscord Plugin Api
* Copyright (c) 2015-present Jiiks - https://jiiks.net
* All rights reserved.
* https://github.com/Jiiks/BetterDiscordApp - https://betterdiscord.net
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const Logger = __webpack_require__(5);
const Api = __webpack_require__(6);
class PluginApi {
constructor(props) {
this.props = props;
}
log(message, level) {
Logger.log(this.props.name, message, level);
}
injectStyle(id, css) {
Api.injectStyle(id, css);
}
removeStyle(id) {
Api.removeStyle(id);
}
injectScript(id, script) {
Api.injectScript(id, script);
}
removeScript(id) {
Api.removeScript(id);
}
}
module.exports = PluginApi;
/***/ }),
/* 5 */
/***/ (function(module, exports) {
/**
* BetterDiscord Logger Module
* Copyright (c) 2015-present Jiiks - https://jiiks.net
* All rights reserved.
* https://github.com/Jiiks/BetterDiscordApp - https://betterdiscord.net
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
class Logger {
static log(moduleName, message, level = 'log') {
level = this.parseLevel(level);
console[level]('[%cBetter%cDiscord:%s] %s', 'color: #3E82E5', '', `${moduleName}${level === 'debug' ? '|DBG' : ''}`, message);
}
static logObject(moduleName, message, object, level) {
if (message) this.log(moduleName, message, level);
console.log(object);
}
static debug(moduleName, message, level, force) {
if (!force) { if (!window.BetterDiscord || !window.BetterDiscord.debug) return; }
this.log(moduleName, message, 'debug', true);
}
static debugObject(moduleName, message, object, level, force) {
if (!force) { if (!window.BetterDiscord || !window.BetterDiscord.debug) return; }
if (message) this.debug(moduleName, message, level, force);
console.debug(object);
}
static parseLevel(level) {
return {
'log': 'log',
'warn': 'warn',
'err': 'error',
'error': 'error',
'debug': 'debug',
'dbg': 'debug',
'info': 'info'
}[level];
}
}
module.exports = Logger;
/***/ }),
/* 6 */
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
/**
* BetterDiscord Plugin Storage
* Copyright (c) 2015-present Jiiks - https://jiiks.net
* All rights reserved.
* https://github.com/Jiiks/BetterDiscordApp - https://betterdiscord.net
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const Utils = __webpack_require__(6);
class PluginStorage {
constructor(path, defaults) {
this.path = `${path}/settings.json`;
this.defaultConfig = defaults;
this.load();
}
load() {
this.settings = JSON.parse(JSON.stringify(this.defaultConfig));
const loadSettings = Utils.tryParse(Utils.readFileSync(this.path));
if (loadSettings) {
Object.keys(loadSettings).map(key => {
this.setSetting(key, loadSettings[key]);
});
}
if (!this.getSetting('enabled')) this.setSetting('enabled', false);
}
save() {
const reduced = this.settings.reduce((result, item) => { result[item.id] = item.value; return result; }, {});
Utils.writeFileSync(this.path, JSON.stringify(reduced));
}
getSetting(id) {
const setting = this.settings.find(setting => setting.id === id);
if (!setting) return null;
return setting.value;
}
setSetting(id, value) {
const setting = this.settings.find(setting => setting.id === id);
if (!setting) {
this.settings.push({ id, value });
} else {
setting.value = value;
}
this.save();
}
setSettings(settings) {
this.settings = settings;
}
}
module.exports = PluginStorage;
/***/ }),
/* 8 */,
/* 9 */,
/* 10 */,
/* 11 */,
/* 12 */,
/* 13 */,
/* 14 */,
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
const v1transpile_version = 6;
module.exports = class {
constructor() {
const config = __webpack_require__(16);
if (!window.v1transpile || window.v1transpile.version < v1transpile_version) {
window.v1transpile = window.v1transpile || {};
window.v1transpile.version = v1transpile_version;
window.v1transpile.Plugin = window.v1transpile.Plugin || __webpack_require__(3);
window.v1transpile.PluginApi = window.v1transpile.PluginApi || __webpack_require__(4);
window.v1transpile.PluginStorage = window.v1transpile.PluginStorage || __webpack_require__(7);
window.v1transpile.Settings = window.v1transpile.Settings || {
/**
* Create and return a new top-level settings panel
* @author noodlebox
* @return {jQuery}
*/
topPanel() {
return $("<form>").addClass("form").css("width", "100%");
},
/**
* Create and return a container for control groups
* @author noodlebox
* @return {jQuery}
*/
controlGroups() {
return $("<div>").addClass("control-groups");
},
/**
* Create and return a flexible control group
* @author noodlebox
* @param {object} settings Settings object
* @param {Element|jQuery|string} settings.label an element or something JQuery-ish or, if string, use as plain text
* @return {jQuery}
*/
controlGroup(settings) {
const group = $("<div>").addClass("control-group");
if (typeof settings.label === "string") {
group.append($("<label>").text(settings.label));
} else if (settings.label !== undefined) {
group.append($("<label>").append(settings.label));
}
return group;
},
/**
* Create and return a group of checkboxes
* @author noodlebox
* @param {object} settings Settings object
* @param {object[]} settings.items an array of settings objects to be passed to checkbox()
* @param {function(state)} settings.callback called with the current state, when it changes state is an array of boolean values
* @return {jQuery}
*/
checkboxGroup(settings) {
settings = $.extend({
items: [],
callback: $.noop,
}, settings);
const state = settings.items.map(item => item.checked === true);
function onClick(i, itemState) {
if (settings.items[i].callback !== undefined) {
settings.items[i].callback(itemState);
}
state[i] = itemState;
settings.callback(state);
}
const group = $("<ul>").addClass("checkbox-group");
group.append(settings.items.map(function(item, i) {
return checkbox($.extend({}, item, {
callback: onClick.bind(undefined, i),
}));
}));
return group;
},
/**
* Create and return a checkbox
* @author noodlebox
* @param {object} settings Settings object
* @param {Element|jQuery|string} settings.label an element or something JQuery-ish or, if string, use as plain text
* @param {Element|jQuery|string} settings.help an element or something JQuery-ish or, if string, use as plain text
* @param {boolean} settings.checked
* @param {boolean} settings.disabled
* @param {function(state)} settings.callback called with the current state, when it changes state is a boolean
* @return {jQuery}
*/
checkbox(settings) {
settings = $.extend({
checked: false,
disabled: false,
callback: $.noop,
}, settings);
const input = $("<input>").attr("type", "checkbox")
.prop("checked", settings.checked)
.prop("disabled", settings.disabled);
const inner = $("<div>").addClass("checkbox-inner")
.append(input)
.append($("<span>"));
const outer = $("<div>").addClass("checkbox").append(inner);
if (settings.disabled) {
outer.addClass("disabled");
}
if (typeof settings.label === "string") {
outer.append($("<span>").text(settings.label));
} else if (settings.label !== undefined) {
outer.append($("<span>").append(settings.label));
}
outer.on("click.kawaiiSettings", function() {
if (!input.prop("disabled")) {
const checked = !input.prop("checked");
input.prop("checked", checked);
settings.callback(checked);
}
});
const item = $("<li>").append(outer);
let help;
if (typeof settings.help === "string") {
help = $("<div>").text(settings.help);
} else if (settings.help !== undefined) {
help = $("<div>").append(settings.help);
}
if (help !== undefined) {
help.appendTo(item)
.addClass("help-text")
.css("margin-top", "-3px")
.css("margin-left", "27px");
}
return item;
},
/**
* Create and return an input
* @author samogot
* @param {object} settings Settings object
* @param {Element|jQuery|string} settings.label an element or something JQuery-ish or, if string, use as plain text
* @param {Element|jQuery|string} settings.help an element or something JQuery-ish or, if string, use as plain text
* @param {boolean} settings.value
* @param {boolean} settings.disabled
* @param {function(state)} settings.callback called with the current state, when it changes. state is a string
* @return {jQuery}
*/
input(settings) {
settings = $.extend({
value: '',
disabled: false,
callback: $.noop,
}, settings);
const input = $("<input>").attr("type", "text")
.prop("value", settings.value)
.prop("disabled", settings.disabled);
const inner = $("<div>").addClass("input-inner")
.append(input)
.append($("<span>"));
const outer = $("<div>").addClass("input").append(inner);
if (settings.disabled) {
outer.addClass("disabled");
}
if (typeof settings.label === "string") {
outer.append($("<span>").text(settings.label));
} else if (settings.label !== undefined) {
outer.append($("<span>").append(settings.label));
}
input.on("change.kawaiiSettings", function() {
if (!input.prop("disabled")) {
const value = input.val();
settings.callback(value);
}
});
const item = $("<li>").append(outer);
let help;
if (typeof settings.help === "string") {
help = $("<div>").text(settings.help);
} else if (settings.help !== undefined) {
help = $("<div>").append(settings.help);
}
if (help !== undefined) {
help.appendTo(item)
.addClass("help-text")
.css("margin-top", "-3px")
.css("margin-left", "27px");
}
return item;
}
};
window.v1transpile.PluginApi.prototype.injectStyle = (id, css) => BdApi.injectCSS(id, css);
window.v1transpile.PluginApi.prototype.removeStyle = (id) => BdApi.clearCSS(id);
window.v1transpile.PluginStorage.prototype.load = function() {
this.settings = JSON.parse(JSON.stringify(this.defaultConfig));
this.path = this.path.replace('/settings.json', '');
if (!window.BdApi) {
return;
}
try {
const loadSettings = BdApi.getData(this.path, "settings");
if (loadSettings) {
Object.keys(loadSettings).map(key => {
this.setSetting(key, loadSettings[key]);
});
}
} catch (err) {
console.warn(this.path, ":", "unable to load settings:", err);
}
};
window.v1transpile.PluginStorage.prototype.save = function() {
const reduced = this.settings.reduce((result, item) => {
result[item.id] = item.value;
return result;
}, {});
try {
BdApi.setData(this.path, "settings", reduced);
} catch (err) {
console.warn(this.path, ":", "unable to save settings:", err);
}
};
window.v1transpile.Vendor = window.v1transpile.Vendor || {
get jQuery() {
return window.jQuery;
},
get $() {
return window.jQuery;
},
get React() {
return window.BDV2.react;
},
get ReactDOM() {
return window.BDV2.reactDom;
},
moment: {}
};
}
const storage = new window.v1transpile.PluginStorage(config.info.name.replace(/\s+/g, '_').toLowerCase(), config.defaultSettings);
const BD = {
Api: new window.v1transpile.PluginApi(config.info),
Storage: storage,
Events: {},
Renderer: {}
};
const plugin = __webpack_require__(17)(window.v1transpile.Plugin, BD, window.v1transpile.Vendor, true);
this.pluginInstance = new plugin(config.info);
this.pluginInstance.internal = {
storage,
path: ''
};
}
start() {
this.pluginInstance.onStart();
this.pluginInstance.storage.load();
}
stop() {
this.pluginInstance.onStop();
}
load() {
}
unload() {
}
getName() {
return this.pluginInstance.name
}
getDescription() {
return this.pluginInstance.description
}
getVersion() {
return this.pluginInstance.version
}
getAuthor() {
return this.pluginInstance.authors.join(', ')
}
getSettingsPanel() {
if (this.pluginInstance.storage.settings.length === 0)
return '';
const Settings = window.v1transpile.Settings;
const panel = Settings.topPanel();
const filterControls = Settings.controlGroups().appendTo(panel);
const Control = Settings.controlGroup({label: this.pluginInstance.name + " settings"})
.appendTo(filterControls);
const saveAndReload = () => {
this.pluginInstance.storage.save();
if (window.pluginCookie && window.pluginCookie[this.pluginInstance.name]) {
this.pluginInstance.onStop();
Promise.resolve().then(() => {
}).then(() => {
this.pluginInstance.onStart();
});
}
};
for (let item of this.pluginInstance.storage.settings) {
let input;
switch (item.type) {
case 'bool':
input = Settings.checkbox({
label: item.text,
help: item.description,
checked: item.value,
callback: state => {
this.pluginInstance.storage.setSetting(item.id, state);
saveAndReload();
},
});
break;
case 'text':
input = Settings.input({
label: item.text,
help: item.description,
value: item.value,
callback: state => {
this.pluginInstance.storage.setSetting(item.id, state);
saveAndReload();
},
});
break;
}
if (input)
Control.append(input)
}
return panel[0];
}
};
/***/ }),
/* 16 */
/***/ (function(module, exports) {
module.exports = {
"info": {
"name": "No send scroll",
"authors": [
"Samogot"
],
"version": "1.3",
"description": "Disables scroll to bottom on sending message",
"repository": "https://github.com/samogot/betterdiscord-plugins.git",
"homepage": "https://github.com/samogot/betterdiscord-plugins/tree/master/v2/No%20send%20scroll",
"reloadable": true
},
"defaultSettings": [],
"permissions": []
};
/***/ }),
/* 17 */
/***/ (function(module, exports) {
module.exports = (Plugin, BD) => {
const {Api} = BD;
const minDIVersion = '1.0';
if (!window.DiscordInternals) {
const message = `Lib Discord Internals v${minDIVersion} or higher not found! Please install or upgrade that utility plugin. See install instructions here https://goo.gl/kQ7UMV`;
Api.log(message, 'warn');
return (class EmptyStubPlugin extends Plugin {
onStart() {
Api.log(message, 'warn');
alert(message);
return false;
}
onStop() {
return true;
}
});
}
class V2Plugin extends Plugin {
onStart() {
const {monkeyPatch, WebpackModules, ReactComponents} = window.DiscordInternals;
const MessageActions = WebpackModules.findByUniqueProperties(['jumpToMessage', '_sendMessage']);
ReactComponents.get('Messages', Messages => {
this.cancelGlobalPatch = monkeyPatch(MessageActions, '_sendMessage', {
before: () => {
const cancel = monkeyPatch(Messages.prototype, 'componentDidUpdate', {
instead: ({callOriginalMethod, thisObject}) => {
if (thisObject.state && thisObject.state.messages && !thisObject.state.messages.hasMoreAfter && !thisObject.isAtBottom()) {
thisObject.state.messages.hasMoreAfter = true;
callOriginalMethod();
thisObject.state.messages.hasMoreAfter = false;
}
else callOriginalMethod();
}
});
setTimeout(cancel, 1000);
}
});
});
return true;
}
onStop() {
this.cancelGlobalPatch();
return true;
}
}
return V2Plugin;
};
/***/ })
/******/ ]);
/*@end @*/

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
//META{"name":"Beard_material_design_theme_addon","description":"User popouts upgraded for Beard's material design theme","author":"mrmaple240, Snow-Pyon & Zerebos (rauenzi)","version":"1.0.5"}*//{}
@import url("https://rawgit.com/Snow-Pyon/BDStuff/master/themes/BMDAddon/import/BMDAddon.css");

View File

@ -1,25 +0,0 @@
/*//META{"name":"Nox","description":"A theme for Discord loosely based on Google's Material Design Guidelines.","author":"Lilian Tedone & Zerebos","version":"1.0.0","update_url":"https://raw.githubusercontent.com/rauenzi/Nox/master/release/Nox.theme.css"}*//**/
/*
* Copyright (c) 2016-2017 Lilian Tedone, 2017-2019 Zack Rauen
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
@import url(https://rauenzi.github.io/Nox/release/import.css);

View File

@ -1,3 +0,0 @@
//META{"name":"Radial_Status","description":"Changes status dot to a circle. Support Server: bit.ly/ZeresServer","author":"Zerebos","version":"2.0.0"}*//{}
@import url(https://rawgit.com/rauenzi/BetterDiscordAddons/master/Themes/RadialStatus/import/RadialStatus.css);

View File

@ -1,78 +0,0 @@
/*//META{"name":"Right-aligned Nicks","description":"Nicknames are right-aligned","author":"FichteFoll","version":"0.2.2"}*//
/**
* Nicks are right-aligned, where possible (i.e. compact layout).
* Space for timestamps is also reduced.
*
* Requires compact mode for obvious reasons.
*
* Nicknames that are too long for the associated space
* are collapsed with an ellipse.
* You can adjust the width of the username column
* with a variable in your user css
* or yell at the people until they pick a shorter nick.
*
*/
/* Variables for configuration. You can override these in your user css. */
:root {
/* ch as unit makes the most sense here,
* but doesn't work properly with calculating offset of the .accessory div */
--username-width: 7.3rem;
--timestamp-width: 3rem;
--header-offset: calc(0.3rem + 0.3em); /* first 0.3em from margin-left on timestamp */
/*--username-width: 13ch;
--timestamp-width: 9ch;*/ /* use `6ch` for 24h timestamps */
}
[class*=containerCompact-] { /* accessory */
padding-left: calc(70px - var(--timestamp-default-width) + var(--timestamp-width) + var(--username-width) );
position: relative;
}
[class*=containerCompact-] [class*=timestampCompactBase-] {
float: left;
top: 1.5ex;
width: var(--timestamp-width);
/*text-align: center;*/
}
/*.headerCompact-3wRt2W {*/
[class*=headerCompact-] {
position: absolute;
left: 0;
padding-bottom: 1px; /* for on-hover underline on border; user_style.css */
}
/*.containerCompact-3V0ioj .usernameWrapper-1S-G5O {*/
[class*=headerCompact-] > span {
display: inline-block;
text-align: right;
width: var(--username-width);
overflow: hidden;
text-overflow: ellipsis;
}
[class*=markup-][class*=isCompact-] {
margin-left: 0 !important;
padding-left: calc(var(--username-width) + var(--timestamp-width) + var(--header-offset)) !important;
text-indent: 0;
}
/*.containerCompact-3bB5aN {*/
[class*=containerCompact-][class*=content-] ~ [class*=containerCompact-] {
padding-left: calc(var(--username-width) + var(--timestamp-width) + var(--header-offset) + 0rem);
}
[class*=containerCompact-][class*=container-] [class*=isMentioned-] [class*=markup-] {
/*padding: 0;*/
/*margin: 0;*/
border-right: solid #FAA61A;
border-width: 0 2px;
}
/* Material theme sets this */
.container-1YxwTf h2 {
margin-left: 0;
}

View File

@ -1,31 +0,0 @@
/*//META{"name":"Compact-User-List","description":"Makes the user list look much like the server list.","author":"square","version":"1.0.1"}*//
.channel-members-wrap {
min-width: initial;
}
.channel-members-wrap .channel-members {
width: 78px;
padding: 0 0 18px 10px;
}
.channel-members h2 {
padding: 0;
margin: 9px 0 1px 0;
text-align: center;
word-wrap: break-word;
}
.member.member-status {
padding: 0 4px;
padding-top: 8px;
}
.member.member-status .avatar-small {
width: 50px;
height: 50px;
background-size: 50px 50px;
}
.member.member-status .member-inner {
display: none;
}
.channel-members::-webkit-scrollbar {
max-width: 10px;
}

View File

@ -1,38 +0,0 @@
/* //META{ "name": "Show-URLs", "description": "Shows a link's URL in bottom left corner much like a browser does.", "author": "square", "version": "1.0.3"} *//**/
.chat-3bRxxu .messagesWrapper-3lZDfY {
z-index: unset;
}
.messages-3amgkR a:after,
.topic-2QX7LI a:after
{
content: attr(href);
position: fixed;
bottom: 0;
left: 0;
background: white;
color: black;
font-size: 13.5px;
line-height: 16.5px;
font-weight: 500;
padding: 1px 3px 2px 3px;
max-width: calc(100% - 240px);
transition: opacity .44s linear;
pointer-events: none;
opacity: 0;
z-index: 42;
}
.messages-3amgkR a:hover:after,
.topic-2QX7LI a:hover:after
{
opacity: 1;
animation: fade .44s 10s forwards;
}
@keyframes fade {
to{ opacity: 0; }
}
/* not being restrictive on which <a/> tags are to be handled breaks scrollbars */

View File

@ -1,84 +0,0 @@
/* Don't embold greentext on hover (why in the fuck?) */
[class*=message-] #GreenText:hover {
font-weight: normal !important;
}
html, [class*=isCompact-]:not(code) {
font-family: Lato !important;
}
.emoji.jumboable {
margin-top: -0.3em !important;
width: 42px !important;
height: 42px !important;
vertical-align: baseline !important;
}
code {
font-family: Hack !important;
}
/* prevent follow-up timestamps from being hidden (currently hardcoded for dark mode) */
.theme-dark [class*=timestampVisibleOnHover-] {
color: hsla(0,0%,100%,.2);
}
/* Nox theme adjustments */
/* https://github.com/rauenzi/Nox */
:root {
--nox-level1: hsl(0, 0%, 17%);
}
[class*=attachButton-] {
width: 50px;
}
[class*=textArea-] {
padding: 16px 0 16px 50px !important;
}
[class*=usernameWrapper-] [class*=username-]:hover {
border-bottom: 1px solid;
}
[class*=containerCompact-][class*=container-][class*=isMentioned-] [class*=markup-],
.containerCompact-3V0ioj.container-1YxwTf .isMentioned-N-h9aa .markup-2BOw-j {
border-left-width: 2px;
}
/* TODO: check if the following can be removed */
[class*=containerCompactBounded-] {
padding: 0;
margin: 0 !important;
}
[class*=divider-] {
height: 30px;
}
[class*=divider-] > span {
background: hsl(0, 0%, 25%) !important;
}
[class*=divider-][class*=dividerRed-] > span {
background: hsl(358, 22%, 30%) !important;
}
[class*=channels-] [class*=scrollerWrap-] {
box-shadow: none;
}
/*[class*=container-] {*/
/*.da-container {*/
.container-1YxwTf {
background: none;
}
[class*="members-"] [class*="member-"] {
padding: 0 !important;
}
/* hide stupid buttons */
[class*="channelTextArea-"] button[tabindex="2"],
[class*="channelTextArea-"] button[tabindex="3"]{
display:none;
}