From 2a1c896bf4d54c3ad31dab747d8d70271bf5754a Mon Sep 17 00:00:00 2001 From: Gregory Leeman Date: Sun, 6 Apr 2025 17:40:18 +0100 Subject: [PATCH] lazygit --- workflowy-helper/main.js | 27 +++++++++++++++++++++++++ workflowy-helper/style.css | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/workflowy-helper/main.js b/workflowy-helper/main.js index 5c2d598..b2e3b7e 100644 --- a/workflowy-helper/main.js +++ b/workflowy-helper/main.js @@ -135,6 +135,7 @@ removeClassesStartingWith(projectNode, "time"); const names = []; const notes = []; + const text = []; for (let i = 0; i < projectNode.children.length; i++) { const child = projectNode.children[i]; if (child.classList.contains('name')) { @@ -143,11 +144,37 @@ if (child.classList.contains('notes')) { notes.push(child); } + if (child.classList.contains('leading-s')) { + text.push(child); + } } + const hotspots = ["admin", "art","mind","health","social","church","career","work"] + text.forEach(function(t) { + const breadcrumb = t.querySelector('.breadcrumbs'); + if (breadcrumb !== null) { + const breadcrumbs = breadcrumb.querySelectorAll('a'); + breadcrumbs.forEach(bc => { + var text = bc.innerText.trim(); + if (hotspots.some(hotspot => text.includes(hotspot))) { + const hotspot = hotspots.find(hotspot => text.includes(hotspot)); + projectNode.classList.add(`hotspot-${hotspot}`); + } + }); + } + }); [notes, names].forEach(function(ns) { if (ns.length > 0) { const n = ns[0]; const text = safeGetContent(n, ".content > .innerContentContainer"); + if (hotspots.some(hotspot => text.includes(hotspot))) { + const hotspot = hotspots.find(hotspot => text.includes(hotspot)); + projectNode.classList.add(`hotspot-${hotspot}`); + const children = projectNode.querySelectorAll('.project'); + children.forEach(child => { + console.log(child); + child.classList.add(`hotspot-${hotspot}`); + }); + } const tags = n.querySelectorAll('.contentTag'); tags.forEach(tag => { var tagText = safeGetContent(tag, ".contentTagText").trim(); diff --git a/workflowy-helper/style.css b/workflowy-helper/style.css index d2e8860..0adcf44 100644 --- a/workflowy-helper/style.css +++ b/workflowy-helper/style.css @@ -407,3 +407,43 @@ body::-webkit-scrollbar { .timed-late > .children > .project:not(.timed) { opacity: .5 !important; } + +.hotspot-admin > .name .innerContentContainer::after { + content: "✏️"; + margin-left: 4px; +} + +.hotspot-mind > .name .innerContentContainer::after { + content: "🧠"; + margin-left: 4px; +} + +.hotspot-health > .name .innerContentContainer::after { + content: "💪"; + margin-left: 4px; +} + +.hotspot-art > .name .innerContentContainer::after { + content: "🎨"; + margin-left: 4px; +} + +.hotspot-social > .name .innerContentContainer::after { + content: "👥"; + margin-left: 4px; +} + +.hotspot-career > .name .innerContentContainer::after { + content: "💻"; + margin-left: 4px; +} + +.hotspot-church > .name .innerContentContainer::after { + content: "☦️"; + margin-left: 4px; +} + +.hotspot-work > .name .innerContentContainer::after { + content: "💼"; + margin-left: 4px; +}