Update MessageUtilities.plugin.js
This commit is contained in:
parent
65d46fee30
commit
fd6c50e99d
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
var MessageUtilities = (_ => {
|
var MessageUtilities = (_ => {
|
||||||
var firedEvents = [];
|
var firedEvents = [];
|
||||||
var clickMap = ["CLICK", "DBLCLICK"];
|
const clickMap = ["CLICK", "DBLCLICK"];
|
||||||
var settings = {}, bindings = {}, toasts = {};
|
var settings = {}, bindings = {}, toasts = {};
|
||||||
|
|
||||||
return class MessageUtilities {
|
return class MessageUtilities {
|
||||||
getName () {return "MessageUtilities";}
|
getName () {return "MessageUtilities";}
|
||||||
|
|
||||||
getVersion () {return "1.7.5";}
|
getVersion () {return "1.7.6";}
|
||||||
|
|
||||||
getAuthor () {return "DevilBro";}
|
getAuthor () {return "DevilBro";}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ var MessageUtilities = (_ => {
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
this.changelog = {
|
this.changelog = {
|
||||||
"fixed":[["Context Menu Hints","No longer adds hints on submenu items"]]
|
"improved":[["Search Results","Now works in search results"]]
|
||||||
};
|
};
|
||||||
|
|
||||||
this.patchedModules = {
|
this.patchedModules = {
|
||||||
|
@ -172,10 +172,10 @@ var MessageUtilities = (_ => {
|
||||||
if (this.started) return;
|
if (this.started) return;
|
||||||
BDFDB.PluginUtils.init(this);
|
BDFDB.PluginUtils.init(this);
|
||||||
|
|
||||||
BDFDB.ListenerUtils.add(this, document, "click", BDFDB.dotCN.message, e => {
|
BDFDB.ListenerUtils.add(this, document, "click", BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsgroupcozy, e => {
|
||||||
this.onClick(e, 0, "onSglClick");
|
this.onClick(e, 0, "onSglClick");
|
||||||
});
|
});
|
||||||
BDFDB.ListenerUtils.add(this, document, "dblclick", BDFDB.dotCN.message, e => {
|
BDFDB.ListenerUtils.add(this, document, "dblclick", BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsgroupcozy, e => {
|
||||||
this.onClick(e, 1, "onDblClick");
|
this.onClick(e, 1, "onDblClick");
|
||||||
});
|
});
|
||||||
BDFDB.ListenerUtils.add(this, document, "keydown", e => {
|
BDFDB.ListenerUtils.add(this, document, "keydown", e => {
|
||||||
|
@ -250,6 +250,7 @@ var MessageUtilities = (_ => {
|
||||||
}
|
}
|
||||||
|
|
||||||
onClick (e, click, name) {
|
onClick (e, click, name) {
|
||||||
|
console.log(e);
|
||||||
if (!firedEvents.includes(name)) {
|
if (!firedEvents.includes(name)) {
|
||||||
firedEvents.push(name);
|
firedEvents.push(name);
|
||||||
let priorityAction = null;
|
let priorityAction = null;
|
||||||
|
@ -403,7 +404,7 @@ var MessageUtilities = (_ => {
|
||||||
}
|
}
|
||||||
|
|
||||||
getMessageData (target) {
|
getMessageData (target) {
|
||||||
let messageDiv = BDFDB.DOMUtils.getParent(BDFDB.dotCN.message, target);
|
let messageDiv = BDFDB.DOMUtils.getParent(BDFDB.dotCNC.message + BDFDB.dotCN.searchresultsgroupcozy, 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, "message");
|
let message = instance && BDFDB.ReactUtils.findValue(instance, "message");
|
||||||
|
|
Loading…
Reference in New Issue