Skip to content

Commit 6469eec

Browse files
committed
added NotebookLM link
1 parent 9f46821 commit 6469eec

5 files changed

Lines changed: 64 additions & 19 deletions

File tree

src/core/settings.ts

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,33 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
607607
containerEl.addClass("excalidraw-settings");
608608
this.containerEl.empty();
609609

610+
// ------------------------------------------------
611+
// Search and Settings to Clipboard
612+
// ------------------------------------------------
613+
614+
const search = new ContentSearcher(containerEl);
615+
616+
617+
const notebookLM = search.getSearchBarWrapper().createDiv("setting-item-description excalidraw-settings-links-container");
618+
notebookLM.createEl("a",{
619+
href: "https://notebooklm.google.com/notebook/42d76a2f-c11d-4002-9286-1683c43d0ab0",
620+
attr: {
621+
"aria-label": t("NOTEBOOKLM_LINK_ARIA"),
622+
"style": "margin: auto;"
623+
}},
624+
(a)=> {
625+
//Lucide: message-circle-question-mark
626+
a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-circle-question-mark-icon lucide-message-circle-question-mark"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/></svg>${
627+
t("NOTEBOOKLM_LINK_TEXT")
628+
}`;
629+
}
630+
);
631+
632+
633+
// ------------------------------------------------
634+
// Promo links
635+
// ------------------------------------------------
636+
610637
const coffeeDiv = containerEl.createDiv("coffee");
611638
coffeeDiv.addClass("ex-coffee-div");
612639
const coffeeLink = coffeeDiv.createEl("a", {
@@ -665,13 +692,6 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
665692
});
666693
});
667694

668-
// ------------------------------------------------
669-
// Search and Settings to Clipboard
670-
// ------------------------------------------------
671-
672-
const searcher = new ContentSearcher(containerEl);
673-
containerEl.prepend(searcher.getSearchBarWrapper());
674-
675695
// ------------------------------------------------
676696
// Saving
677697
// ------------------------------------------------

src/lang/locale/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ export default {
201201

202202

203203
//settings.ts
204+
NOTEBOOKLM_LINK_ARIA: "Ask NotebookLM for help about the plugin. This model is pre-loaded with all my video transcripts, release notes and other helpful content. Chat with NotebookLM to explore my 250+ videos and the Excalidraw documentation.",
205+
NOTEBOOKLM_LINK_TEXT: "Learn the Plugin. Access the NotebookLM knowledgebase.",
204206
LINKS_BUGS_ARIA: "Report bugs and raise feature requsts on the plugin's GitHub page",
205207
LINKS_BUGS: "Report Bugs",
206208
LINKS_YT_ARIA: "Check out my YouTube channel to learn about Visual Thinking and Excalidraw",

src/shared/Dialogs/ScriptInstallPrompt.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ export class ScriptInstallPrompt extends Modal {
2020
this.contentDiv = document.createElement("div");
2121
this.contentEl.appendChild(this.contentDiv);
2222

23-
const searcher = new ContentSearcher(this.contentDiv);
24-
this.contentEl.prepend(searcher.getSearchBarWrapper());
23+
new ContentSearcher(this.contentDiv);
2524

2625
this.containerEl.classList.add("excalidraw-scriptengine-install");
2726
try {

src/shared/components/ContentSearcher.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class ContentSearcher {
1616
this.contentDiv = contentDiv;
1717
this.createSearchElements();
1818
this.setupEventListeners();
19+
contentDiv.prepend(this.getSearchBarWrapper());
1920
}
2021

2122
/**
@@ -239,12 +240,32 @@ export class ContentSearcher {
239240

240241
const nextActiveHighlight = highlights[nextActiveIndex];
241242
nextActiveHighlight.classList.add("active-highlight");
242-
nextActiveHighlight.scrollIntoView({
243-
behavior: "smooth",
244-
block: "nearest",
245-
});
243+
244+
// Expand all parent details elements
245+
this.expandParentDetails(nextActiveHighlight);
246+
247+
// Use setTimeout to ensure DOM has time to update after expanding details
248+
setTimeout(() => {
249+
nextActiveHighlight.scrollIntoView({
250+
behavior: "smooth",
251+
block: "nearest",
252+
});
253+
}, 100);
246254

247255
// Update the hit count
248256
this.hitCount.textContent = `${nextActiveIndex + 1} / ${highlights.length}`;
249257
}
258+
259+
/**
260+
* Expand all parent <details> elements to make the element visible
261+
*/
262+
private expandParentDetails(element: HTMLElement): void {
263+
let parent = element.parentElement;
264+
while (parent) {
265+
if (parent.tagName === "DETAILS") {
266+
parent.setAttribute("open", "");
267+
}
268+
parent = parent.parentElement;
269+
}
270+
}
250271
}

styles.css

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -622,12 +622,15 @@ textarea.excalidraw-wysiwyg, .excalidraw input {
622622
}
623623

624624
.excalidraw-settings-links-container {
625-
display: flex; /* Align SVG and text horizontally */
626-
align-items: center; /* Center SVG and text vertically */
627-
text-decoration: none; /* Remove underline from links */
628-
color: inherit; /* Inherit text color */
629-
text-align: center;
630-
gap: 0.3em;
625+
align-items: center;
626+
color: inherit;
627+
display: flex;
628+
gap: .3em;
629+
text-align: center;
630+
text-decoration: none;
631+
flex-wrap: wrap;
632+
justify-content: center;
633+
flex-direction: row;
631634
}
632635

633636
.excalidraw-settings-links-container a {

0 commit comments

Comments
 (0)