Skip to main content

New Commit: url updates

Repository: Hestenb62/_legacy_backup

Author: Hesten Berger

Commit Message: url updates

URL: https://github.com/Hestenb62/_legacy_backup/commit/10e5203ac0a962802c7182a8da882721847d674c

Code Changes:

diff --git a/assets/css/components/fixed-tools.css b/assets/css/components/fixed-tools.css
index 6d53392..b424321 100644
--- a/assets/css/components/fixed-tools.css
+++ b/assets/css/components/fixed-tools.css
@@ -985,6 +985,17 @@
     transform: translateY(-1px);
   }
 
+  .math-chip-btn mjx-container {
+    margin: 0 !important;
+    vertical-align: middle !important;
+  }
+
+  .math-chip-btn mjx-container svg {
+    max-height: 1.45em;
+    width: auto;
+    vertical-align: middle;
+  }
+
   .math-preview-header {
     display: flex;
     justify-content: space-between;
@@ -1119,6 +1130,60 @@
     }
   }
 
+  /* ==========================================================================
+     Scratchpad Isolated Print Layout Standard (@media print)
+     ========================================================================== */
+  @media print {
+    body.printing-scratchpad > *:not(#scratchpad-panel) {
+      display: none !important;
+    }
+    body.printing-scratchpad #scratchpad-panel {
+      position: static !important;
+      display: block !important;
+      background: transparent !important;
+      box-shadow: none !important;
+      width: 100% !important;
+      max-width: 100% !important;
+      height: auto !important;
+      padding: 0 !important;
+      margin: 0 !important;
+      z-index: 1 !important;
+    }
+    body.printing-scratchpad .scratchpad-backdrop,
+    body.printing-scratchpad .scratchpad-notebook-bar,
+    body.printing-scratchpad .scratchpad-header-actions,
+    body.printing-scratchpad .scratchpad-tabs-bar,
+    body.printing-scratchpad .scratchpad-format-bar,
+    body.printing-scratchpad .scratchpad-search-wrap,
+    body.printing-scratchpad .scratchpad-typography-bar,
+    body.printing-scratchpad .scratchpad-templates-bar,
+    body.printing-scratchpad .scratchpad-canvas-ribbon,
+    body.printing-scratchpad .scratchpad-math-palette,
+    body.printing-scratchpad .scratchpad-footer {
+      display: none !important;
+    }
+    body.printing-scratchpad .scratchpad-content {
+      box-shadow: none !important;
+      border: none !important;
+      width: 100% !important;
+      max-width: 100% !important;
+      height: auto !important;
+      padding: 0 !important;
+      background: #ffffff !important;
+      color: #000000 !important;
+    }
+    body.printing-scratchpad .scratchpad-notes-area {
+      border: none !important;
+      box-shadow: none !important;
+      font-size: 11pt !important;
+      color: #000000 !important;
+      height: auto !important;
+      resize: none !important;
+      overflow: visible !important;
+      background: transparent !important;
+    }
+  }
+
   /* Citation Panel Overlay */
   .citation-panel-overlay {
     position: fixed;
diff --git a/assets/js/scratchpad-studio.js b/assets/js/scratchpad-studio.js
index ac4025b..071b37d 100644
--- a/assets/js/scratchpad-studio.js
+++ b/assets/js/scratchpad-studio.js
@@ -35,6 +35,7 @@
   // State Management
   let notebook = [];
   let activeNoteId = null;
+  let currentTab = 'notes'; // 'notes', 'whiteboard', 'math'
   let saveDebounceTimer = null;
   let mathjaxDebounceTimer = null;
 
@@ -601,7 +602,10 @@
 
     dom.mathjaxPreview.innerHTML = previewHtml;
 
-    // Trigger universal MathJax rendering standard
+    // Trigger universal MathJax rendering standard with clean re-typeset cache
+    if (window.MathJax && window.MathJax.typesetClear && dom.mathjaxPreview) {
+      try { window.MathJax.typesetClear([dom.mathjaxPreview]); } catch (e) {}
+    }
     if (window.ensureMathJax) {
       window.ensureMathJax(dom.mathjaxPreview);
     } else if (window.MathJax && window.MathJax.typesetPromise) {
@@ -624,6 +628,7 @@
   // Tab Navigation & Window Modes
   // =========================================================================
   function switchTab(mode) {
+    currentTab = mode;
     const tabs = [
       { id: 'notes', tab: dom.tabNotes, pane: dom.paneNotes },
       { id: 'whiteboard', tab: dom.tabWhiteboard, pane: dom.paneWhiteboard },
@@ -648,6 +653,9 @@
     if (mode === 'whiteboard') {
       setTimeout(resizeCanvas, 100);
     } else if (mode === 'math') {
+      if (window.ensureMathJax && dom.paneMath) {
+        window.ensureMathJax(dom.paneMath);
+      }
       renderMathJaxPreview();
     }
 
@@ -700,6 +708,10 @@
       if (dom.textarea) dom.textarea.focus();
     }, 150);
 
+    if (window.ensureMathJax) {
+      window.ensureMathJax();
+    }
+
     if (window.HLSound && window.HLSound.playToggle) window.HLSound.playToggle();
     announceStatus('Scratchpad opened.');
   }
@@ -936,6 +948,540 @@
     } catch (e) {}
   }
 
+  // =========================================================================
+  // Scratchpad-Only Formatted Printing Engine
+  // =========================================================================
+  function hasCanvasDrawing() {
+    if (!canvas || !ctx) return false;
+    try {
+      const d = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
+      for (let i = 3; i < d.length; i += 40) {
+        if (d[i] > 0) return true;
+      }
+    } catch (e) {}
+    return false;
+  }
+
+  function formatInlineForPrint(str) {
+    return str
+      .replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
+      .replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g, '<em>$1</em>')
+      .replace(/`([^`]+)`/g, '<code class="print-code-inline">$1</code>');
+  }
+
+  function formatMarkdownForPrint(md) {
+    if (!md || !md.trim()) {
+      return '<p style="color: #64748b; font-style: italic;">No written notes recorded for this notebook page.</p>';
+    }
+
+    let safe = md
+      .replace(/&/g, '&amp;')
+      .replace(/</g, '&lt;')
+      .replace(/>/g, '&gt;');
+
+    // Fenced Code Blocks
+    safe = safe.replace(/```([\s\S]*?)```/g, (match, code) => {
+      return `<pre class="print-code-block"><code>${code.trim()}</code></pre>`;
+    });
+
+    const lines = safe.split('\n');
+    let inList = false;
+    let inNumberedList = false;
+    let html = '';
+
+    const closeLists = () => {
+      if (inList) { html += '</ul>\n'; inList = false; }
+      if (inNumberedList) { html += '</ol>\n'; inNumberedList = false; }
+    };
+
+    for (let i = 0; i < lines.length; i++) {
+      const line = lines[i].trim();
+
+      if (!line) {
+        closeLists();
+        continue;
+      }
+
+      if (line.startsWith('<pre class="print-code-block">')) {
+        closeLists();
+        html += line + '\n';
+        continue;
+      }
+
+      if (/^###\s+(.+)$/.test(line)) {
+        closeLists();
+        html += `<h3>${formatInlineForPrint(line.replace(/^###\s+/, ''))}</h3>\n`;
+        continue;
+      }
+      if (/^##\s+(.+)$/.test(line)) {
+        closeLists();
+        html += `<h2>${formatInlineForPrint(line.replace(/^##\s+/, ''))}</h2>\n`;
+        continue;
+      }
+      if (/^#\s+(.+)$/.test(line)) {
+        closeLists();
+        html += `<h1>${formatInlineForPrint(line.replace(/^#\s+/, ''))}</h1>\n`;
+        continue;
+      }
+
+      if (/^(\-{3,}|\*{3,}|_{3,})$/.test(line)) {
+        closeLists();
+        html += '<hr class="print-divider">\n';
+        continue;
+      }
+
+      if (/^[\*\-\+]\s+(.+)$/.test(line)) {
+        if (inNumberedList) { html += '</ol>\n'; inNumberedList = false; }
+        if (!inList) { html += '<ul class="print-list">\n'; inList = true; }
+        const item = line.replace(/^[\*\-\+]\s+/, '');
+        html += `<li>${formatInlineForPrint(item)}</li>\n`;
+        continue;
+      }
+
+      if (/^\d+\.\s+(.+)$/.test(line)) {
+        if (inList) { html += '</ul>\n'; inList = false; }
+        if (!inNumberedList) { html += '<ol class="print-list">\n'; inNumberedList = true; }
+        const item = line.replace(/^\d+\.\s+/, '');
+        html += `<li>${formatInlineForPrint(item)}</li>\n`;
+        continue;
+      }
+
+      if (/^(&gt;|>)\s*(.+)$/.test(line)) {
+        closeLists();
+        const quoteText = line.replace(/^(&gt;|>)\s*/, '');
+        html += `<blockquote class="print-quote">${formatInlineForPrint(quoteText)}</blockquote>\n`;
+        continue;
+      }
+
+      closeLists();
+      html += `<p>${formatInlineForPrint(line)}</p>\n`;
+    }
+
+    closeLists();
+    return html;
+  }
+
+  function printScratchpad() {
+    const cur = getActiveNote();
+    const noteTitle = (cur && cur.title) ? cur.title : 'Study Notes';
+    const rawContent = dom.textarea ? dom.textarea.value : '';
+    const templateKey = (cur && cur.template) ? cur.template : '';
+    const templateLabel = templateKey ? templateKey.toUpperCase() : '';
+    
+    const wordCount = rawContent.trim() ? rawContent.trim().split(/\s+/).length : 0;
+    const charCount = rawContent.length;
+    
+    const dateStr = new Date().toLocaleDateString('en-US', {
+      weekday: 'long',
+      year: 'numeric',
+      month: 'long',
+      day: 'numeric'
+    });
+    const timeStr = new Date().toLocaleTimeString('en-US', {
+      hour: '2-digit',
+      minute: '2-digit'
+    });
+
+    const activeTab = (typeof currentTab !== 'undefined' && currentTab) ? currentTab : (dom.tabWhiteboard && dom.tabWhiteboard.classList.contains('active') ? 'whiteboard' : (dom.tabMath && dom.tabMath.classList.contains('active') ? 'math' : 'notes'));
+    const isWhiteboardTab = activeTab === 'whiteboard';
+    const isMathTab = activeTab === 'math';
+    
+    // Check canvas drawing
+    let canvasDataUrl = null;
+    if (hasCanvasDrawing()) {
+      try {
+        canvasDataUrl = canvas.toDataURL('image/png');
+      } catch (e) {}
+    } else if (cur && cur.canvasData) {
+      canvasDataUrl = cur.canvasData;
+    }
+
+    const formattedNotesHtml = formatMarkdownForPrint(rawContent);
+
+    // MathJax rendered block if math tab or if math equations detected
+    let mathHtml = '';
+    if (dom.mathjaxPreview && (isMathTab || /(\$\$[\s\S]+?\$\$|\$[^\$\n]+?\$|\\\[[\s\S]+?\\\]|\\\([^\n]+?\\\))/.test(rawContent))) {
+      const renderTargets = dom.mathjaxPreview.querySelectorAll('.mathjax-render-target');
+      if (renderTargets.length > 0) {
+        mathHtml = `
+          <div class="print-math-section">
+            <h3 class="print-section-title"><span class="print-icon">∑</span> Mathematical Equations &amp; Formulas</h3>
+            <div class="print-math-grid">
+        `;

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": { + ...