This commit is contained in:
Mirco Wittrien 2021-01-09 17:27:37 +01:00
parent 819f65d609
commit ee0bb32855
2 changed files with 9 additions and 19 deletions

View File

@ -1079,8 +1079,8 @@
"SearchPopout": {"props": ["datePicker", "searchResultChannelIconBackground"]}, "SearchPopout": {"props": ["datePicker", "searchResultChannelIconBackground"]},
"SearchPopoutWrap": {"props": ["container", "queryContainer"]}, "SearchPopoutWrap": {"props": ["container", "queryContainer"]},
"SearchResults": {"props": ["noResults", "searchResultsWrap"]}, "SearchResults": {"props": ["noResults", "searchResultsWrap"]},
"SearchResultsElements": {"props": ["resultsBlocked", "channelSeparator"]}, "SearchResultsElements": {"props": ["totalResults", "tab"]},
"SearchResultsMessage": {"props": ["after", "messageGroupCozy"]}, "SearchResultsMessage": {"props": ["message", "searchResult"]},
"Select": {"props": ["select", "error", "errorMessage"]}, "Select": {"props": ["select", "error", "errorMessage"]},
"SettingsCloseButton": {"props": ["closeButton", "keybind"]}, "SettingsCloseButton": {"props": ["closeButton", "keybind"]},
"SettingsItems": {"props": ["labelRow", "note"]}, "SettingsItems": {"props": ["labelRow", "note"]},
@ -2439,15 +2439,9 @@
"searchpopoutsearchresultchanneliconbackground": ["SearchPopout", "searchResultChannelIconBackground"], "searchpopoutsearchresultchanneliconbackground": ["SearchPopout", "searchResultChannelIconBackground"],
"searchpopoutselected": ["SearchPopout", "selected"], "searchpopoutselected": ["SearchPopout", "selected"],
"searchpopoutuser": ["SearchPopout", "user"], "searchpopoutuser": ["SearchPopout", "user"],
"searchresultsafter": ["SearchResultsMessage", "after"],
"searchresultsalt": ["SearchResults", "alt"],
"searchresultsbefore": ["SearchResultsMessage", "before"],
"searchresultschannelname": ["SearchResultsElements", "channelName"], "searchresultschannelname": ["SearchResultsElements", "channelName"],
"searchresultschannelSeparator": ["SearchResultsElements", "channelSeparator"], "searchresultsmessage": ["SearchResultsMessage", "message"],
"searchresultsexpanded": ["SearchResultsMessage", "expanded"], "searchresultsresult": ["SearchResultsMessage", "searchResult"],
"searchresultsgroupcozy": ["SearchResultsMessage", "messageGroupCozy"],
"searchresultshit": ["SearchResultsMessage", "hit"],
"searchresultssibling": ["SearchResultsMessage", "sibling"],
"searchresultswrap": ["SearchResults", "searchResultsWrap"], "searchresultswrap": ["SearchResults", "searchResultsWrap"],
"select": ["Select", "select"], "select": ["Select", "select"],
"selectwrapper": ["BDFDB", "selectWrapper"], "selectwrapper": ["BDFDB", "selectWrapper"],

View File

@ -14,16 +14,12 @@ module.exports = (_ => {
"info": { "info": {
"name": "MessageUtilities", "name": "MessageUtilities",
"author": "DevilBro", "author": "DevilBro",
"version": "1.8.1", "version": "1.8.2",
"description": "Offer a number of useful message options. Remap the keybindings in the settings" "description": "Offer a number of useful message options. Remap the keybindings in the settings"
}, },
"changeLog": { "changeLog": {
"added": {
"Replies": "Added option for replies",
"Quotes": "Now requires CustomQuoter plugin since Discord replaces Quotes with Replies"
},
"fixed": { "fixed": {
"Settings": "Fixed Settings" "Search Results": "Fixed for search results"
} }
} }
}; };
@ -108,10 +104,10 @@ module.exports = (_ => {
} }
onStart () { onStart () {
BDFDB.ListenerUtils.add(this, document, "click", BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsgroupcozy, e => { BDFDB.ListenerUtils.add(this, document, "click", BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsmessage, e => {
if (!BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagetoolbarbutton, e.target)) this.onClick(e, 0, "onSglClick"); if (!BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagetoolbarbutton, e.target)) this.onClick(e, 0, "onSglClick");
}); });
BDFDB.ListenerUtils.add(this, document, "dblclick", BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsgroupcozy, e => { BDFDB.ListenerUtils.add(this, document, "dblclick", BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsmessage, e => {
if (!BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagetoolbarbutton, e.target)) this.onClick(e, 1, "onDblClick"); if (!BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagetoolbarbutton, e.target)) this.onClick(e, 1, "onDblClick");
}); });
BDFDB.ListenerUtils.add(this, document, "keydown", e => { BDFDB.ListenerUtils.add(this, document, "keydown", e => {
@ -431,7 +427,7 @@ module.exports = (_ => {
} }
getMessageData (target) { getMessageData (target) {
let messageDiv = BDFDB.DOMUtils.getParent(BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsgroupcozy, target); let messageDiv = BDFDB.DOMUtils.getParent(BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsmessage, target);
if (messageDiv && messageDiv.querySelector(BDFDB.dotCN.textarea)) return {messageDiv: null, message: null}; if (messageDiv && messageDiv.querySelector(BDFDB.dotCN.textarea)) return {messageDiv: null, message: null};
let instance = BDFDB.ReactUtils.getInstance(messageDiv); let instance = BDFDB.ReactUtils.getInstance(messageDiv);
let message = instance && (BDFDB.ReactUtils.findValue(instance, "baseMessage") || BDFDB.ReactUtils.findValue(instance, "message")); let message = instance && (BDFDB.ReactUtils.findValue(instance, "baseMessage") || BDFDB.ReactUtils.findValue(instance, "message"));