Browse Source

lazygit

main
Gregory Leeman 1 month ago
parent
commit
2a1c896bf4
  1. 27
      workflowy-helper/main.js
  2. 40
      workflowy-helper/style.css

27
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();

40
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;
}

Loading…
Cancel
Save