Skip to main content

New Commit: Add study note action to highlight toolbar Introduces an "Add Note" button in the reader highlight toolbar. The new action captures the current text selection, prompts for a note, appends a formatted entry (book/chapter/time) to Quick Notes with existing autosave behavior (or localStorage fallback), and marks the selected text with a green note highlight that surfaces the note on interaction.

Repository: Hestenb62/_legacy_backup

Author: Hesten Berger

Commit Message: Add study note action to highlight toolbar Introduces an "Add Note" button in the reader highlight toolbar. The new action captures the current text selection, prompts for a note, appends a formatted entry (book/chapter/time) to Quick Notes with existing autosave behavior (or localStorage fallback), and marks the selected text with a green note highlight that surfaces the note on interaction.

URL: https://github.com/Hestenb62/_legacy_backup/commit/42623da30722aae0d200a8ac9ff236c9d73ea4dd

Code Changes:

diff --git a/library/read/reader.js b/library/read/reader.js
index bb13ec0..8c69d5d 100644
--- a/library/read/reader.js
+++ b/library/read/reader.js
@@ -55,6 +55,7 @@ document.addEventListener("DOMContentLoaded", () => {
     // Highlight Toolbar Elements
     const hlToolbar = document.getElementById("highlight-toolbar");
     const hlMarkBtn = document.getElementById("hl-btn-mark");
+    const hlNoteBtn = document.getElementById("hl-btn-note");
     const hlCopyBtn = document.getElementById("hl-btn-copy");
 
     // --- Settings Panel Toggle ---
@@ -427,6 +428,59 @@ document.addEventListener("DOMContentLoaded", () => {
                 setTimeout(() => hlCopyBtn.innerHTML = originalHTML, 1500);
             });
         });
+
+        if (hlNoteBtn) {
+            hlNoteBtn.addEventListener("click", () => {
+                if (!currentRange) return;
+                const selectedText = currentRange.toString().trim();
+                if (!selectedText) return;
+
+                const noteText = prompt(`Add a study note for: "${selectedText.substring(0, 30)}${selectedText.length > 30 ? '...' : ''}"`);
+                if (noteText === null) return; // user cancelled
+
+                const bookTitle = window.BOOK_METADATA ? window.BOOK_METADATA.title : 'Book';
+                const chapterNum = window.BOOK_METADATA ? window.BOOK_METADATA.chapterNum : 1;
+
+                // Format note entry to append
+                const timeStr = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
+                const noteEntry = `\n\n[Note - ${bookTitle}, Ch ${chapterNum} @ ${timeStr}]\n"${selectedText}"\nNote: ${noteText}\n`;
+
+                const notesArea = document.getElementById("quick-notes-area");
+                if (notesArea) {
+                    notesArea.value = (notesArea.value + noteEntry).trim();
+                    // Dispatch input event to trigger the existing debounce auto-save
+                    notesArea.dispatchEvent(new Event('input'));
+                } else {
+                    // Fallback to direct local storage save if not loaded
+                    try {
+                        const existing = localStorage.getItem("hl_scratchpad") || "";
+                        localStorage.setItem("hl_scratchpad", (existing + noteEntry).trim());
+                    } catch (e) {}
+                }
+
+                // Surround contents with a soft green highlight representing the note
+                try {
+                    const mark = document.createElement("mark");
+                    mark.style.backgroundColor = "rgba(74, 222, 128, 0.4)"; // Soft green
+                    mark.style.borderRadius = "0.25rem";
+                    mark.style.padding = "0 0.25rem";
+                    mark.style.cursor = "pointer";
+                    mark.title = `Note: ${noteText}`;
+
+                    // Show note on click
+                    mark.addEventListener("click", () => {
+                        alert(`Study Note:\n"${selectedText}"\n\nNote Details:\n${noteText}`);
+                    });
+
+                    currentRange.surroundContents(mark);
+                    window.getSelection().removeAllRanges();
+                } catch (e) {
+                    console.log("Boundary crossed highlighting for note", e);
+                }
+
+                hlToolbar.classList.add("hidden");
+            });
+        }
     }
 
     // --- Vocabulary Study Guide Modal & Flashcards & Quiz Router ---
diff --git a/library/read/reader_template.php b/library/read/reader_template.php
index 0ee73da..871178c 100644
--- a/library/read/reader_template.php
+++ b/library/read/reader_template.php
@@ -222,6 +222,8 @@ include ABSPATH . 'src/header.php';
 <div id="highlight-toolbar" class="hidden">
     <button id="hl-btn-mark" class="hl-btn"><i class="fas fa-highlighter text-yellow-400"></i> Mark</button>
     <div class="hl-divider"></div>
+    <button id="hl-btn-note" class="hl-btn"><i class="fas fa-sticky-note text-green-400"></i> Add Note</button>
+    <div class="hl-divider"></div>
     <button id="hl-btn-copy" class="hl-btn"><i class="fas fa-copy text-blue-400"></i> Copy</button>
 </div>
 

Popular Posts

New Commit: fixed theme issues

Repository: Hestenb62/_legacy_backup Author: Hesten Berger Commit Message: fixed theme issues URL: https://github.com/Hestenb62/_legacy_backup/commit/498741f8c633ecaf6e7e594bb0aed02c47e69b39 Code Changes: diff --git a/assessment/index.php b/assessment/index.php index 822865b..5e8b706 100644 --- a/assessment/index.php +++ b/assessment/index.php @@ -264,7 +264,7 @@ include '../src/header.php'; </div> <!-- Hint Modal (Inline) --> - <div id="hintText" class="hint-box" style="display: none;"> + <div id="hintText" class="hint-box hidden"> <strong>Hint:</strong> <span id="hint-content"></span> </div> </div> diff --git a/assets/css/pages/assessment.css b/assets/css/pages/assessment.css index b57e964..7eb0d74 100644 --- a/assets/c...

New Commit: added arura mesh

Repository: Hestenb62/_legacy_backup Author: Hesten Berger Commit Message: added arura mesh URL: https://github.com/Hestenb62/_legacy_backup/commit/d8a9c63f2df943f6e40651985fb1c273c5809dd4 Code Changes: diff --git a/assets/css/level-style.css b/assets/css/level-style.css index ed8b60b..49cddf7 100644 --- a/assets/css/level-style.css +++ b/assets/css/level-style.css @@ -100,6 +100,8 @@ h1, h2, h3, h4 { padding: 4rem 1rem 3rem 1rem; background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%); border-bottom: 1px solid var(--glass-border); + position: relative; + overflow: hidden; } .hero-inner { @@ -111,6 +113,78 @@ h1, h2, h3, h4 { flex-wrap: wrap; gap: 1.5rem; animation: fadeUp 0.6s ease-out; + position: relative; + z-index: 2; +} + +/* Aurora Mesh Background for Level Hero */ +.level-aurora-bg { + position: absolute; + inset: 0; + overflow: hidden; + pointer-events: none; + z-index: 1; +} + +....

New Commit: Add JSON lesson migration and renderer scaffold Introduces a first-pass migration pipeline from PHP lesson files to structured JSON with `migrate_lessons.php`, and adds a generated `assets/data/lessons.json` catalog containing extracted metadata plus manual-migration placeholders for complex interactive content. Adds a new universal `src/lesson_renderer.php` to render lessons from JSON, along with initial component templates (`interactive-ladder` and `teacher-concepts`) for modular block rendering. Also includes `audit_report.html` documenting current security, accessibility, and architecture findings that motivated the move toward a template-driven lesson system.

Repository: Hestenb62/_legacy_backup Author: Hesten Berger Commit Message: Add JSON lesson migration and renderer scaffold Introduces a first-pass migration pipeline from PHP lesson files to structured JSON with , and adds a generated catalog containing extracted metadata plus manual-migration placeholders for complex interactive content. Adds a new universal to render lessons from JSON, along with initial component templates ( and ) for modular block rendering. Also includes documenting current security, accessibility, and architecture findings that motivated the move toward a template-driven lesson system. URL: https://github.com/Hestenb62/_legacy_backup/commit/f0c974b613ed65b7edcb712abb88bfae61ef0df5 Code Changes: diff --git a/assets/data/lessons.json b/assets/data/lessons.json new file mode 100644 index 0000000..0389666 --- /dev/null +++ b/assets/data/lessons.json @@ -0,0 +1,2835 @@ +{ + "lessons": { + "k-ela-m1-a-1": { + ...