Skip to content

Commit

Permalink
[SWIF-263] [Toast message 'Sign In' text highlighted and Entire Toast…
Browse files Browse the repository at this point in the history
… Message made Clickable]
  • Loading branch information
zakialvi-e64 committed Nov 28, 2023
1 parent f9a2177 commit 25df7eb
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,35 +100,38 @@ export default class Transcription extends Plugin {
}

// If the user is still null, prompt them to sign in
if (this.user == null) {
const notice = new Notice("Transcription: You are signed out. Please click to Sign In", 16 * 1000);
// if (this.user == null) {
// const notice = new Notice("Transcription: You are signed out. Please click to Sign In", 16 * 1000);

notice.noticeEl.addEventListener('click', () => {
window.open(SWIFTINK_AUTH_CALLBACK, '_blank');
});
// notice.noticeEl.addEventListener('click', () => {
// window.open(SWIFTINK_AUTH_CALLBACK, '_blank');
// });


}
// }

// if (this.user == null) {
// const noticeContent = document.createDocumentFragment();
if (this.user == null) {
const noticeContent = document.createDocumentFragment();

// // Create the text node
// const textNode = document.createTextNode("Transcription: You are signed out. Please ");
// Create the text node
const textNode = document.createTextNode("Transcription: You are signed out. Please ");

// // Create the hyperlink
// const signInLink = document.createElement('a');
// signInLink.href = SWIFTINK_AUTH_CALLBACK;
// signInLink.target = '_blank';
// signInLink.textContent = 'Sign In';
// Create the hyperlink
const signInLink = document.createElement('a');
//signInLink.href = SWIFTINK_AUTH_CALLBACK;
signInLink.target = '_blank';
signInLink.textContent = 'Sign In';

// // Append the text and link to the document fragment
// noticeContent.appendChild(textNode);
// noticeContent.appendChild(signInLink);
// Append the text and link to the document fragment
noticeContent.appendChild(textNode);
noticeContent.appendChild(signInLink);

// // Create the notice with the content
// new Notice(noticeContent, 16 * 1000);
// }
// Create the notice with the content
const notice = new Notice(noticeContent, 16 * 1000);
notice.noticeEl.addEventListener('click', () => {
window.open(SWIFTINK_AUTH_CALLBACK, '_blank');
});
}



Expand Down

0 comments on commit 25df7eb

Please sign in to comment.