Update PersonalPins.plugin.js
This commit is contained in:
parent
16d1222afc
commit
39d7b2d3da
|
@ -5,11 +5,15 @@ class PersonalPins {
|
||||||
|
|
||||||
getDescription () {return "Similar to normal pins. Lets you save messages as notes for yourself.";}
|
getDescription () {return "Similar to normal pins. Lets you save messages as notes for yourself.";}
|
||||||
|
|
||||||
getVersion () {return "1.7.4";}
|
getVersion () {return "1.7.5";}
|
||||||
|
|
||||||
getAuthor () {return "DevilBro";}
|
getAuthor () {return "DevilBro";}
|
||||||
|
|
||||||
initConstructor () {
|
initConstructor () {
|
||||||
|
this.changelog = {
|
||||||
|
"improved":[["Copy Button","Pressing the copy button in a note that contains files will now add the filelinks to the copied text"]]
|
||||||
|
};
|
||||||
|
|
||||||
this.labels = {};
|
this.labels = {};
|
||||||
|
|
||||||
this.patchModules = {
|
this.patchModules = {
|
||||||
|
@ -453,12 +457,14 @@ class PersonalPins {
|
||||||
});
|
});
|
||||||
message.querySelector(BDFDB.dotCN.messagespopoutjumpbutton + ".copy").addEventListener("click", e => {
|
message.querySelector(BDFDB.dotCN.messagespopoutjumpbutton + ".copy").addEventListener("click", e => {
|
||||||
let clipboard = require("electron").clipboard;
|
let clipboard = require("electron").clipboard;
|
||||||
if (noteData.content) clipboard.write({text: noteData.content});
|
if (noteData.content) {
|
||||||
|
let text = noteData.content;
|
||||||
|
for (let file of message.querySelectorAll(BDFDB.dotCN.filenamelink)) text += ("\n" + file.href);
|
||||||
|
clipboard.write({text});
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
let image = message.querySelector(BDFDB.dotCNS.imagewrapper + "img");
|
let image = message.querySelector(BDFDB.dotCNS.imagewrapper + "img");
|
||||||
if (image) {
|
if (image) require("request")({url: image.src, encoding: null}, (error, response, buffer) => {
|
||||||
// stolen from Image2Clipboard
|
|
||||||
require("request")({url: image.src, encoding: null}, (error, response, buffer) => {
|
|
||||||
if (buffer) {
|
if (buffer) {
|
||||||
let platform = require("process").platform;
|
let platform = require("process").platform;
|
||||||
if (platform === "win32" || platform === "darwin") {
|
if (platform === "win32" || platform === "darwin") {
|
||||||
|
@ -473,7 +479,6 @@ class PersonalPins {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,6 +506,7 @@ class PersonalPins {
|
||||||
pins[guild_id] = pins[guild_id] || {}
|
pins[guild_id] = pins[guild_id] || {}
|
||||||
pins[guild_id][channel.id] = pins[guild_id][channel.id] || {}
|
pins[guild_id][channel.id] = pins[guild_id][channel.id] || {}
|
||||||
if (!pins[guild_id][channel.id][message.id + "_" + pos]) {
|
if (!pins[guild_id][channel.id][message.id + "_" + pos]) {
|
||||||
|
for (let spoiler of messagediv.querySelectorAll(BDFDB.dotCN.spoilerhidden)) spoiler.click();
|
||||||
let channelname = channel.name;
|
let channelname = channel.name;
|
||||||
if (!channelname && channel.recipients.length > 0) {
|
if (!channelname && channel.recipients.length > 0) {
|
||||||
for (let dmuser_id of channel.recipients) {
|
for (let dmuser_id of channel.recipients) {
|
||||||
|
|
Loading…
Reference in New Issue