Working again
This commit is contained in:
parent
7b99b7d7f1
commit
0d81028a3c
|
@ -2,35 +2,29 @@
|
|||
|
||||
var dblClickEdit = function () {};
|
||||
|
||||
dblClickEdit.prototype.handler = function(e) {
|
||||
const message = e.target.closest('[class^=messageCozy]');
|
||||
if (!message) return;
|
||||
const btn = message.querySelector('[class^=buttonContainer] [class^=button-]');
|
||||
if (!btn) return;
|
||||
btn.click();
|
||||
for (let btn of [...document.querySelectorAll(`[role=menu] [type=button]`)]) { if (btn.innerText && btn.innerText.includes('Edit')) btn.click(); }
|
||||
};
|
||||
|
||||
dblClickEdit.prototype.onMessage = function () {
|
||||
};
|
||||
dblClickEdit.prototype.onSwitch = function () {
|
||||
};
|
||||
dblClickEdit.prototype.start = function () {
|
||||
$(document).on("dblclick.dce", function(e) {
|
||||
var target = $(e.target);
|
||||
if(target.parents(".message-1PNnaP").length > 0) {
|
||||
var msg = target.parents(".message-1PNnaP").first();
|
||||
var opt = msg.find(".button-3Jq0g9");
|
||||
opt.click();
|
||||
|
||||
$.each($(".popout-3sVMXz .button-38aScr"), (index, value) => {
|
||||
var option = $(value);
|
||||
if(option.text() === "Edit") {
|
||||
option.click();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
document.addEventListener('dblclick', this.handler);
|
||||
};
|
||||
|
||||
dblClickEdit.prototype.load = function () {};
|
||||
dblClickEdit.prototype.unload = function () {
|
||||
$(document).off("dblclick.dce");
|
||||
document.removeEventListener('dblclick', this.handler);
|
||||
};
|
||||
dblClickEdit.prototype.stop = function () {
|
||||
$(document).off("dblclick.dce");
|
||||
document.removeEventListener('dblclick', this.handler);
|
||||
};
|
||||
dblClickEdit.prototype.getSettingsPanel = function () {
|
||||
return "";
|
||||
|
|
Loading…
Reference in New Issue