2018-05-14 12:42:48 +00:00
|
|
|
exports.manifest = {
|
2018-05-13 18:17:49 +00:00
|
|
|
author: "Cynosphere, Jiiks",
|
|
|
|
name: "Double Click Edit",
|
2018-05-14 12:42:48 +00:00
|
|
|
description: "Double click messages to edit them."
|
2018-05-13 18:17:49 +00:00
|
|
|
}
|
|
|
|
exports.start = function(){
|
|
|
|
document.addEventListener("dblclick", ev => {
|
|
|
|
let target = ev.target;
|
2018-05-21 17:02:05 +00:00
|
|
|
if(target && target.className && target.className.includes("markup")) {
|
2018-05-13 18:17:49 +00:00
|
|
|
let msg = target;
|
|
|
|
let opt = msg.parentNode.querySelector(".btn-option");
|
|
|
|
opt.click();
|
|
|
|
let options = document.querySelectorAll(".option-popout .btn-item");
|
|
|
|
for(i in options){
|
|
|
|
let o = options[i];
|
|
|
|
if(o.innerHTML == "Edit") o.click();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|