Skip to content

Commit f172a1a

Browse files
committed
Append signature to note while adding connection
- Also removed unneeded `.DS_STORE` file from `icons/` directory
1 parent a01c4b3 commit f172a1a

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

content.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,19 @@ const _setCaretPosition = (elem, caretPos) => {
2525

2626
// Add signature when message box is focused
2727
document.addEventListener('focus', function (event) {
28-
var activeElement = document.activeElement,
29-
isMessageBox = activeElement.classList.contains('msg-form__contenteditable');
28+
let activeElement = document.activeElement,
29+
isConnectNoteBox = activeElement.matches('textarea.connect-button-send-invite__custom-message'),
30+
isMessageBox = activeElement.matches('div.msg-form__contenteditable'),
31+
shouldAppendSignature = (isConnectNoteBox || isMessageBox) && !activeElement.textContent.trim();
3032

31-
if (isMessageBox && !activeElement.textContent.trim()) {
33+
if (shouldAppendSignature) {
3234
chrome.storage.local.get(['linkedinsignature'], function (item) {
3335
if (item.linkedinsignature.enabled) {
34-
activeElement.innerHTML = modifySignatureToHTML(item.linkedinsignature.text);
36+
if (isMessageBox) {
37+
activeElement.innerHTML = modifySignatureToHTML(item.linkedinsignature.text);
38+
} else if (isConnectNoteBox) {
39+
activeElement.value = item.linkedinsignature.text;
40+
}
3541
_setCaretPosition(activeElement, 0);
3642
activeElement.click();
3743
}
@@ -45,7 +51,6 @@ let darkModeListener = (isDarkMode) => {
4551
type: "themeChange",
4652
mode: isDarkMode.matches ? 'dark' : 'light',
4753
});
48-
4954
}
5055
// MediaQueryList
5156
const darkModePreference = window.matchMedia("(prefers-color-scheme: dark)");

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "SignatureSync: Pro Signatures",
1010
"short_name": "SignatureSync",
1111
"description": "Simplify your messaging with SignatureSync, the tool that automates your signatures, ensuring a professional touch every time.",
12-
"version": "3.1.1",
12+
"version": "3.1.2",
1313
"icons": {
1414
"16": "icons/light/icon16.png",
1515
"32": "icons/light/icon32.png",

0 commit comments

Comments
 (0)