diff --git a/glance-system/glance-helper.yaml b/glance-system/glance-helper.yaml index 4304b9f..8d495c8 100644 --- a/glance-system/glance-helper.yaml +++ b/glance-system/glance-helper.yaml @@ -64,16 +64,17 @@ data: return False @APP.get("/notes") - def notes_widget(key: str = "", user: str = "default"): - """Serve the notes widget HTML page for a specific user.""" + def notes_widget(key: str = "", user: str = "default", accent: str = "ffffff"): + """Serve the notes widget HTML page for a specific user with optional theme.""" expected_key = os.environ.get("GLANCE_HELPER_KEY", "") if key != expected_key: return Response(content="Unauthorized", status_code=401) - # Sanitize user for display safe_user = re.sub(r'[^a-zA-Z0-9_-]', '', user) or "default" + # Sanitize accent color (hex only, default to white) + safe_accent = re.sub(r'[^a-fA-F0-9]', '', accent)[:6] or "ffffff" + current_notes = load_notes(safe_user) - # Escape for safe HTML embedding escaped_notes = current_notes.replace("&", "&").replace("<", "<").replace(">", ">").replace('"', """) html = f""" @@ -82,35 +83,39 @@ data: @@ -159,7 +168,7 @@ data: }}); if (response.ok) {{ lastSaved = content; - updateStatus('Saved', 'saved'); + updateStatus('Saved ✓', 'saved'); setTimeout(() => updateStatus(''), 2000); }} else {{ updateStatus('Save failed', 'error'); diff --git a/glance-system/glance-orsi.yaml b/glance-system/glance-orsi.yaml index 34c396a..4cc2aef 100644 --- a/glance-system/glance-orsi.yaml +++ b/glance-system/glance-orsi.yaml @@ -592,7 +592,8 @@ data: - size: small widgets: - type: iframe - source: https://glance-helper.dooplex.hu/notes?key=oplQqnLnJK2vErRVYJpvVUcSDBOSbCHZSbsYY2bwSifgTMfT&user=orsi + css-class: iframe-no-tint + source: https://glance-helper.dooplex.hu/notes?key=...&user=orsi&accent=e292ff height: 250 title: Quick Notes - type: bookmarks