2016-04-06 01:46:22 +02:00
|
|
|
//META{"name":"dblClickEdit"}*//
|
|
|
|
|
|
|
|
var dblClickEdit = function () {};
|
|
|
|
|
2018-08-07 07:32:14 +02:00
|
|
|
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(); }
|
|
|
|
};
|
|
|
|
|
2016-04-06 01:46:22 +02:00
|
|
|
dblClickEdit.prototype.onMessage = function () {
|
|
|
|
};
|
|
|
|
dblClickEdit.prototype.onSwitch = function () {
|
|
|
|
};
|
|
|
|
dblClickEdit.prototype.start = function () {
|
2018-08-07 07:32:14 +02:00
|
|
|
document.addEventListener('dblclick', this.handler);
|
2016-04-06 01:46:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
dblClickEdit.prototype.load = function () {};
|
|
|
|
dblClickEdit.prototype.unload = function () {
|
2018-08-07 07:32:14 +02:00
|
|
|
document.removeEventListener('dblclick', this.handler);
|
2016-04-06 01:46:22 +02:00
|
|
|
};
|
|
|
|
dblClickEdit.prototype.stop = function () {
|
2018-08-07 07:32:14 +02:00
|
|
|
document.removeEventListener('dblclick', this.handler);
|
2016-04-06 01:46:22 +02:00
|
|
|
};
|
|
|
|
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 () {
|
2018-08-07 07:34:12 +02:00
|
|
|
return "0.2.0";
|
2016-04-06 01:46:22 +02:00
|
|
|
};
|
|
|
|
dblClickEdit.prototype.getAuthor = function () {
|
|
|
|
return "Jiiks";
|
2018-04-23 21:42:20 +02:00
|
|
|
};
|