From b4c9ad07d142d7dd3fc92a5b77632987952ad4fd Mon Sep 17 00:00:00 2001 From: Gregory Leeman Date: Sat, 15 Feb 2025 23:30:47 +0000 Subject: [PATCH] lazygit --- workflowy-helper/main.js | 132 +--- workflowy-helper/style.css | 1262 +++------------------------------- workflowy-helper/~main.js | 294 ++++++++ workflowy-helper/~style.css | 1297 +++++++++++++++++++++++++++++++++++ 4 files changed, 1699 insertions(+), 1286 deletions(-) create mode 100644 workflowy-helper/~main.js create mode 100644 workflowy-helper/~style.css diff --git a/workflowy-helper/main.js b/workflowy-helper/main.js index 6c8470b..4c9a724 100644 --- a/workflowy-helper/main.js +++ b/workflowy-helper/main.js @@ -1,7 +1,7 @@ (function() { 'use strict'; - // update nodes {{{ + // helpers {{{ function describeTimeElementDate(element) { // {{{ @@ -85,59 +85,16 @@ } // }}} - - function createImages(node, imgSrcs) { // {{{ - var inject = node.querySelector('.inject'); - if (inject === null) { - var inject = document.createElement("div"); - inject.className = 'inject'; - node.appendChild(inject); - } - var imgs = inject.querySelectorAll('img'); - if (imgs.length != imgSrcs.length) { - inject.innerHTML = ''; - imgSrcs.forEach(imgSrc => { - var img = document.createElement("img"); - img.src = imgSrc; - img.style.display = "none"; - - img.onload = function () { - const maxDimension = 100; - const aspectRatio = img.naturalWidth / img.naturalHeight; - - if (aspectRatio > 1) { - img.style.width = `${maxDimension}px`; - img.style.height = `${maxDimension / aspectRatio}px`; - } else { - img.style.height = `${maxDimension}px`; - img.style.width = `${maxDimension * aspectRatio}px`; - } - img.style.display = "block"; - }; - - img.onclick = function () { - // open link in new tab - window.open(imgSrc, '_blank'); - }; - - inject.appendChild(img); - }); - } - } - + // }}} - function updateProject(projectNode) { // {{{ - + function updateProject(projectNode) { removeClassesStartingWith(projectNode, "backlinked"); removeClassesStartingWith(projectNode, "link"); removeClassesStartingWith(projectNode, "tag"); removeClassesStartingWith(projectNode, "time"); - const names = []; const notes = []; - const breadcrumbNodes = []; - for (let i = 0; i < projectNode.children.length; i++) { const child = projectNode.children[i]; if (child.classList.contains('name')) { @@ -146,49 +103,27 @@ if (child.classList.contains('notes')) { notes.push(child); } - if (child.classList.contains('_1zok2')) { - breadcrumbNodes.push(child.querySelector('.breadcrumbs')); - } } - [notes, names].forEach(function(ns) { if (ns.length > 0) { - const n = ns[0]; - const text = safeGetContent(n, ".content > .innerContentContainer"); - - if (text.startsWith("!")) { - const links = n.querySelectorAll('a.contentLink'); - const imgSrcs = []; - for (var i = 0; i < links.length; i++) { - var link = links[i]; - link.textContent = "link"; - var imgSrc = link.href; - imgSrcs.push(imgSrc); - } - if (imgSrcs.length > 0) { - createImages(n, imgSrcs); - } - } - const tags = n.querySelectorAll('.contentTag'); tags.forEach(tag => { - var tagText = safeGetContent(tag, ".contentTagText").trim(); if (tagText !== "") { projectNode.classList.add("tagged"); projectNode.classList.add("tagged-" + tagText); - + tag.classList.add("tag"); + tag.classList.add("tag-" + tagText); } }); - const links = n.querySelectorAll('.contentLink'); links.forEach(link => { - link.spellcheck = false; + // link.spellcheck = false; const nonLetterRegex = /[^a-zA-Z0-9]/g; var linkFull = link.innerText.trim().replace(nonLetterRegex, ''); - if (linkFull.startsWith("x") || linkFull.startsWith("y") || linkFull.startsWith("z")) { + if (linkFull.startsWith("x")) { var className = "linked-" + linkFull; var linkClassName = "link-" + linkFull; projectNode.classList.add("linked"); @@ -197,27 +132,19 @@ link.classList.add(linkClassName); } }); - const times = n.querySelectorAll('time'); times.forEach(time => { var relatives = describeTimeElementDate(time); projectNode.classList.add("timed"); + time.classList.add("time"); relatives.forEach(relative => { projectNode.classList.add("timed-" + relative); + time.classList.add("time-" + relative); }); }); - - if (isIosSafari()) { - const content = n.querySelector('.content'); - removeKeyboard(content); - } - } }); - } - - // }}} function updateAll() { const projectNodes = document.querySelectorAll('.project'); @@ -250,45 +177,4 @@ updateAll(); - // }}} - - // hide keyboard on iOS Safari {{{ - - function isIosSafari() { - const ua = navigator.userAgent; - return ( - /iPhone|iPad|iPod/.test(ua) && - /Safari/.test(ua) - ); - } - - - function removeKeyboard(contentElement) { - if (!('allowEditing' in contentElement)) { - contentElement.allowEditing = false; - } - - contentElement.addEventListener('focus', (e) => { - if (!contentElement.allowEditing) { - e.preventDefault(); - contentElement.blur(); - } - }); - - contentElement.addEventListener('dblclick', (e) => { - contentElement.allowEditing = true; - - // Small delay to ensure focus is handled correctly - setTimeout(() => { - contentElement.focus(); - }, 0); - }); - - contentElement.addEventListener('blur', () => { - contentElement.allowEditing = false; - }); - } - - // }}} - })(); diff --git a/workflowy-helper/style.css b/workflowy-helper/style.css index 6e9321f..105a085 100644 --- a/workflowy-helper/style.css +++ b/workflowy-helper/style.css @@ -1,7 +1,3 @@ -/* ------------------------------------------------------------------------- */ -/* colors */ -/* ------------------------------------------------------------------------- */ - :root { --grey: rgb(158, 161, 162); --white: rgb(255, 255, 255); @@ -44,35 +40,34 @@ body { color: var(--grey) !important; } +.link, +.contentTag { + color: var(--dark-grey) !important; + font-weight: normal !important; +} +.homeButton > svg { + display: none; +} +.homeButton::after { + content: "✞"; + font-size: 2em; +} +.header > :first-child { + display: none !important; +} -/* ------------------------------------------------------------------------- */ -/* breadcrumbs */ -/* ------------------------------------------------------------------------- */ - -/* .project:not(.boardCard) > ._sht4m8 { */ -/* z-index: 2; */ -/* position: absolute; */ -/* right: -20px; */ -/* /1* padding-left: 10px; *1/ */ -/* top: 6px; */ -/* justify-content: flex-end; */ -/* } */ -.project.boardCard > ._1zok2 { - right: 0; - top: 6px; - width: 100%; - justify-content: flex-end; - margin-left: 10px; - margin-bottom: 3px; +.metaMatches * .innerContentContainer, +.contentMatch { + background: none !important; } -.project > .text-sm { +.project > .text-sm, +.paragraph { margin: 0; } - .project .breadcrumbs { position: absolute; top: 5px; @@ -80,1219 +75,160 @@ body { z-index: 20; border-radius: 3px } - .project .breadcrumbs > a, .project .breadcrumbs > svg { display: none; } - -/* .project.linked * .breadcrumbs > a:nth-child(5) { */ -/* display: initial !important; */ -/* padding: 0; */ -/* } */ - .project * .breadcrumbs > a:last-child { font-size: 0; display: initial !important; - padding: 0; - padding-left: 3px; - padding-right: 3px; - margin-right: 3px; } - .project * .breadcrumbs > a:last-child::after { font-size: 15px; content: ">"; } -.breadcrumbs > .menu { - display: none !important; -} - +/* l0 {{{ */ -.homeButton > svg { - display: none; -} -.homeButton::after { - content: "✞"; - font-size: 2em; -} - -/* ------------------------------------------------------------------------- */ -/* categories */ -/* ------------------------------------------------------------------------- */ - -.linked > .name > .content::before { - margin-right: 4px; -} -.linked > .name > .content:after { - margin-left: 4px; -} -.linked > .name .innerContentContainer:after { - margin-left: 4px; -} - - -.linked-xbucket > .name > .content::before { - content: 'ðŸŠĢ ' -} - -.linked-xbucket > .name .innerContentContainer, -.linked-xbucket > .notes .innerContentContainer { - color: var(--white) !important; -} - -.linked-xbucket > .name .content { - font-weight: bold; - /* border-bottom: 1px solid var(--dark-grey) !important; */ - /* border-bottom: 1px dashed var(--grey) !important; */ - /* border-bottom: 1px solid var(--grey) !important; */ -} - -.linked-xgoal > .name > .content { +.linked-xHOTSPOT > .name .innerContentContainer { font-weight: bold; - font-style: italic; -} -.linked-xgoal > .name .innerContentContainer, -.linked-xgoal > .notes .innerContentContainer { - color: var(--yellow) !important; -} -.linked-xgoal.linked-xstory > .name .innerContentContainer, -.linked-xgoal.linked-xstory > .notes .innerContentContainer { - color: var(--blue) !important; -} -.linked-xgoal.linked-xstory > .name > .content::before { - content: '✒ïļ '; -} -.linked-xgoal.linked-xresponsibility > .name .innerContentContainer, -.linked-xgoal.linked-xresponsibility > .notes .innerContentContainer { - color: var(--red) !important; } -.linked-xgoal.linked-xresponsibility > .name > .content::before { - content: '🊜'; -} -.linked-xgoal.linked-x2025 > .name > .content::before { - content: '🎉 2025'; - color: var(--magenta) !important; - font-style: normal !important; -} -.linked-xgoal.linked-x29 > .name > .content::before { - content: '🎁 29'; - color: var(--cyan) !important; - font-style: normal !important; -} -.linked-xgoal.linked-x2026 > .name > .content::before { - content: '🎉 2026'; - color: var(--orange) !important; - font-style: normal !important; -} -.linked-xgoal.linked-x30 > .name > .content::before { - content: '🎁 30'; - color: var(--green) !important; - font-style: normal !important; -} -.linked-xgoal.linked-x2027 > .name > .content::before { - content: '🎉 2027'; - color: var(--red) !important; - font-style: normal !important; -} -.linked-xgoal.linked-x35 > .name > .content::before { - content: '🎁 35'; - color: var(--violet) !important; - font-style: normal !important; -} -.linked-xgoal.linked-x40 > .name > .content::before { - content: '🎁 40'; - color: var(--blue) !important; - font-style: normal !important; +.linked-xHOTSPOT > .name .innerContentContainer, +.linked-xHOTSPOT > .notes .innerContentContainer { + color: var(--white); } -/* .linked-xreason.linked-xfuture > .name > .content::before { */ -/* content: '🏝ïļ'; */ -/* } */ - -/* .linked-xreason.linked-xfuture > .name .innerContentContainer, */ -/* .linked-xreason.linked-xfuture > .notes .innerContentContainer { */ -/* color: var(--yellow) !important; */ -/* } */ +/* }}} */ -/* .linked-xreason.linked-xfuture > .name .content { */ -/* font-weight: bold; */ -/* font-style: italic; */ -/* } */ +/* l1 {{{ */ -/* .linked-xreason.linked-xstory > .name > .content::before { */ -/* content: '✒ïļ '; */ -/* } */ - -/* .linked-xreason.linked-xstory > .name .innerContentContainer, */ -/* .linked-xreason.linked-xstory > .notes .innerContentContainer { */ -/* color: var(--cyan) !important; */ -/* } */ - -/* .linked-xreason.linked-xstory > .name .content { */ -/* font-weight: bold; */ -/* font-style: italic; */ -/* } */ - -.linked-xvisualisation.linked-xtarget > .name > .content::before { - content: 'ðŸŽŊ '; -} - -.linked-xvisualisation.linked-xtarget > .name .innerContentContainer, -.linked-xvisualisation.linked-xtarget > .notes .innerContentContainer { - color: var(--red) !important; -} - -.linked-xvisualisation.linked-xtarget > .name .content { +.linked-xGOAL > .name .innerContentContainer { font-weight: bold; - font-style: italic; -} - -.linked-xvisualisation.linked-xprocess > .name > .content::before { - content: '🏃 '; } - -.linked-xvisualisation.linked-xprocess > .name .innerContentContainer, -.linked-xvisualisation.linked-xprocess > .notes .innerContentContainer { - color: var(--red) !important; +.linked-xGOAL > .name .innerContentContainer, +.linked-xGOAL > .notes .innerContentContainer { + color: var(--yellow); } -.linked-xvisualisation.linked-xprocess > .name .content { +.linked-xRESPONSIBILITY > .name .innerContentContainer { font-weight: bold; - font-style: italic; } - -.linked-xvisualisation.linked-xplan > .name > .content::before { - content: '📝 '; +.linked-xRESPONSIBILITY > .name .innerContentContainer, +.linked-xRESPONSIBILITY > .notes .innerContentContainer { + color: var(--red); } -.linked-xvisualisation.linked-xplan > .name .innerContentContainer, -.linked-xvisualisation.linked-xplan > .notes .innerContentContainer { - color: var(--red) !important; -} - -.linked-xvisualisation.linked-xplan > .name .content { +.linked-xSTORY > .name .innerContentContainer { font-weight: bold; - font-style: italic; -} - -.linked-xproject, .linked-xbucket, .linked-xhotspot, .linked-xgoal { - border: 1px solid; - border-radius: 10px; - padding: 0 5px 5px 5px; - margin-top: 5px; -} -.linked-xproject.collapsed { - padding-bottom: 2px; -} - - -.linked-xproject > .children, -.linked-xbucket > .children, -.linked-xhotspot > .children, -.linked-xgoal > .children { - border-left: none; -} - -.linked-xhotspot { - border-color: var(--white) !important; } - -.linked-xgoal { - border-color: var(--yellow) !important; -} - -.linked-xgoal.linked-xstory { - border-color: var(--blue) !important; -} - -.linked-xgoal.linked-xresponsibility { - border-color: var(--red) !important; -} - -.linked-xproject.linked-xbackground { - border-color: var(--orange) !important; -} - -.linked-xproject.linked-xactive { - border-color: var(--magenta) !important; -} - -.linked-xproject.linked-xstalled { - border-color: var(--cyan) !important; -} - -.linked-xproject.linked-xarchive { - border-color: var(--dark-grey) !important; -} - -.linked-xproject.linked-xsomeday { - border-color: var(--violet) !important; +.linked-xSTORY > .name .innerContentContainer, +.linked-xSTORY > .notes .innerContentContainer { + color: var(--blue); } - -.linked-xproject > .name .content { +.linked-xSOMEDAY > .name .innerContentContainer { font-weight: bold; - /* border-bottom: 1px solid; */ - /* border-bottom: 1px dashed var(--dark-grey) !important; */ - /* border-bottom: 1px solid var(--dark-grey) !important; */ -} - -.linked-xproject.linked-xactive > .name > .content::before { - content: 'ðŸ”Ĩ'; -} - -.linked-xproject.linked-xactive > .name > .content { - border-color: var(--magenta) !important; -} - -.linked-xproject.linked-xactive > .name .innerContentContainer, -.linked-xproject.linked-xactive > .notes .innerContentContainer { - color: var(--magenta) !important; -} - -.linked-xproject.linked-xblocked > .name > .content::before { - content: 'ðŸšŦ'; -} - -.linked-xproject.linked-xblocked > .name > .content { - border-color: var(--red) !important; -} - -.linked-xproject.linked-xblocked > .name .innerContentContainer, -.linked-xproject.linked-xblocked > .notes .innerContentContainer { - color: var(--red) !important; } - - -.linked-xproject.linked-xplant > .name > .content::before { - content: 'ðŸŠī '; -} - -.linked-xproject.linked-xplant > .name > .content { - border-color: var(--orange) !important; -} - -.linked-xproject.linked-xplant > .name .innerContentContainer, -.linked-xproject.linked-xplant > .notes .innerContentContainer { - color: var(--orange) !important; -} - -.linked-xproject.linked-xbackground > .name > .content::before { - content: '🊑'; -} - -.linked-xproject.linked-xbackground > .name > .content { - border-color: var(--orange) !important; -} - -.linked-xproject.linked-xbackground > .name .innerContentContainer, -.linked-xproject.linked-xbackground > .notes .innerContentContainer { - color: var(--orange) !important; -} - -.linked-xproject.linked-xstalled > .name > .content::before { - content: '❄ïļ'; +.linked-xSOMEDAY > .name .innerContentContainer, +.linked-xSOMEDAY > .notes .innerContentContainer { + color: var(--violet); } -.linked-xproject.linked-xstalled > .name > .content { - border-color: var(--cyan) !important; -} +/* }}} */ -.linked-xproject.linked-xstalled > .name .innerContentContainer, -.linked-xproject.linked-xstalled > .notes .innerContentContainer { - color: var(--cyan) !important; -} +/* l2 {{{ */ -.linked-xproject.linked-xsomeday > .name > .content::before { - content: 'ðŸ”Ū'; +.linked-xVISUALISATION > .name .innerContentContainer { + font-weight: bold; } - -.linked-xproject.linked-xsomeday > .name > .content { - border-color: var(--violet) !important; +.linked-xVISUALISATION > .name .innerContentContainer, +.linked-xVISUALISATION > .notes .innerContentContainer { + color: var(--red); } -.linked-xproject.linked-xsomeday > .name .innerContentContainer, -.linked-xproject.linked-xsomeday > .notes .innerContentContainer { - color: var(--violet) !important; +.linked-xPROJECT > .name .innerContentContainer { + font-weight: bold; } - -.linked-xproject.linked-xarchive > .name > .content::before { - content: '🗄ïļ'; +.linked-xPROJECT.tagged-ACTIVE > .name .innerContentContainer, +.linked-xPROJECT.tagged-ACTIVE > .notes .innerContentContainer { + color: var(--magenta); } - -.linked-xproject.linked-xarchive > .name , -.linked-xproject.linked-xarchive > .notes * { - color: var(--dark-grey) !important; - text-decoration-color: var(--dark-grey) !important; +.linked-xPROJECT.tagged-ACTIVE.tagged-PLANT > .name .innerContentContainer, +.linked-xPROJECT.tagged-ACTIVE.tagged-PLANT > .notes .innerContentContainer { + color: var(--orange); } - -.linked-xproject.linked-xarchive > .name .innerContentContainer::before { - position: absolute; - width: 100%; - height: 2px; - bottom: calc(50% - 2px); - left: 0; - content: ''; - z-index: 2; - background: var(--dark-grey); +.linked-xPROJECT.tagged-WAITING > .name .innerContentContainer, +.linked-xPROJECT.tagged-WAITING > .notes .innerContentContainer { + color: var(--cyan); } +/* }}} */ -.linked-xproject.linked-xarchive > .name > .bullet * { - color: var(--grey) !important; -} +/* l3 {{{ */ -.linked-xproject.linked-xarchive > .name .content { - border-color: var(--dark-grey) !important; +.linked-xHABIT > .name .innerContentContainer, +.linked-xHABIT > .notes .innerContentContainer { + color: var(--orange); } -.link::after{ - margin-left: 4px; +.linked-xTASK.tagged-READY > .name .innerContentContainer, +.linked-xTASK.tagged-READY > .notes .innerContentContainer { + color: var(--blue); } - -.linked-xsprint > .name > .content::before { - content: '👟'; +.linked-xTASK.tagged-DAILY > .name .innerContentContainer, +.linked-xTASK.tagged-DAILY > .notes .innerContentContainer, +.linked-xTASK.tagged-WEEKLY > .name .innerContentContainer, +.linked-xTASK.tagged-WEEKLY > .notes .innerContentContainer, +.linked-xTASK.tagged-MONTHLY > .name .innerContentContainer, +.linked-xTASK.tagged-MONTHLY > .notes .innerContentContainer, +.linked-xTASK.tagged-IRREGULAR > .name .innerContentContainer, +.linked-xTASK.tagged-IRREGULAR > .notes .innerContentContainer { + color: var(--green); } - -.linked-xsprint > .name .innerContentContainer, -.linked-xsprint > .notes .innerContentContainer { - color: var(--violet) !important; - font-style: italic; +.linked-xTASK.tagged-WAITING > .name .innerContentContainer, +.linked-xTASK.tagged-WAITING > .notes .innerContentContainer { + color: var(--cyan); } -.linked-xsprint > .name .innerContentContainer { - font-weight: bold; +.linked-xTASK.tagged-BLOCKED > .name .innerContentContainer, +.linked-xTASK.tagged-BLOCKED > .notes .innerContentContainer { + color: var(--red); } - -.linked-xsprint > .name > .content:before, -.linked-xsprint > .name .innerContentContainer:after, -.linked-xsprint > .name .contentTag { - font-style: normal !important; +.linked-xTASK.tagged-MAYBE > .name .innerContentContainer, +.linked-xTASK.tagged-MAYBE > .notes .innerContentContainer { + color: var(--violet); } -.linked-xtask.linked-xnext > .name > .content::before { - content: '➡ïļ' -} +/* }}} */ -.linked-xtask.linked-xnext > .name .innerContentContainer, -.linked-xtask.linked-xnext > .notes .innerContentContainer { +.tag-DAILY { color: var(--blue) !important; } - -.linked-xtask.linked-xwaiting > .name > .content::before { - content: 'âģ'; -} - -.linked-xtask.linked-xwaiting > .name .innerContentContainer, -.linked-xtask.linked-xwaiting > .notes .innerContentContainer { - color: var(--cyan) !important; -} - -.linked-xtask.linked-xmaybe > .name > .content::before { - content: '☁ïļ'; -} - -.linked-xtask.linked-xmaybe > .name .innerContentContainer, -.linked-xtask.linked-xmaybe > .notes .innerContentContainer { - color: var(--violet) !important; -} - -.linked-xtask.linked-xscheduled > .name > .content::before { - content: '📅'; -} - -.linked-xtask.linked-xscheduled > .name .innerContentContainer, -.linked-xtask.linked-xscheduled > .notes .innerContentContainer { - color: var(--red) !important; -} - -.linked-xtask.linked-xrepeat > .name > .content::before { - content: 'â™ŧïļ'; -} - -.linked-xtask.linked-xhabit > .name > .content::before { - content: '🎒'; -} - - -/* .linked-xtask.linked-xhabit > .name > .content::before { */ -/* filter: hue-rotate(260deg) */ -/* } */ - -.linked-xtask.linked-xrepeat > .name .innerContentContainer, -.linked-xtask.linked-xrepeat > .notes .innerContentContainer { +.tag-WEEKLY { color: var(--green) !important; } - -.linked-xtask.linked-xhabit > .name .innerContentContainer, -.linked-xtask.linked-xhabit > .notes .innerContentContainer { - color: var(--orange) !important; -} - -/* ------------------------------------------------------------------------- */ -/* tags */ -/* ------------------------------------------------------------------------- */ - -.contentTag.explosive, -.contentTag[data-val].exoplosive { - font-weight: normal; - background: none; - color: var(--dark-grey) !important; - font-style: normal !important; -} - -.linked > .name > .content:before { - font-style: normal !important; -} - -.linked .contentTag.explosive::hover { - color: var(--white) !important; -} - -/* ------------------------------------------------------------------------- */ -/* bullets */ -/* ------------------------------------------------------------------------- */ - -.half-open.tagged-a > .name > .bullet, -.collapsed.tagged-a > .name > .bullet, -.tagged-a > .name > .bullet { - background-color: var(--red) !important; -} - -.half-open.tagged-b > .name > .bullet, -.collapsed.tagged-b > .name > .bullet, -.tagged-b > .name > .bullet { - background-color: var(--blue) !important; -} - -.half-open.tagged-c > .name > .bullet, -.collapsed.tagged-c > .name > .bullet, -.tagged-c > .name > .bullet { - background-color: var(--green) !important; -} - -.half-open.tagged-d > .name > .bullet, -.collapsed.tagged-d > .name > .bullet, -.tagged-d > .name > .bullet { - background-color: var(--violet) !important; -} - -/* ------------------------------------------------------------------------- */ -/* done */ -/* ------------------------------------------------------------------------- */ - -.innerContentContainer { - position: relative; -} - -/* .done > .name > .content, */ -/* .done > .notes > .content, */ - -time > span { - text-decoration: none !important; -} - -.linked.tagged-done > .name > .content, -.linked.tagged-done > .notes > .content, -.linked.tagged-done > .name time > span, -.linked.tagged-missed > .name > .content, -.linked.tagged-missed > .notes > .content, -.linked.tagged-missed > .name time > span, -.linked.tagged-na > .name > .content, -.linked.tagged-na > .notes > .content, -.linked.tagged-na > .name time > span { - /* opacity: 0.5 !important; */ - /* text-decoration: none !important; */ - text-decoration: line-through !important; - text-decoration-thickness: 2px !important; -} - -.monolith-pill .content-wrapper { - font-size: 1em !important; - line-height: initial !important; -} - -.linked.tagged-done > .name > .content, -.linked.tagged-done > .name time > span { - text-decoration-color: var(--green) !important; -} - -.linked.tagged-missed > .name > .content, -.linked.tagged-missed > .name time > span { - text-decoration-color: var(--red) !important; -} - -.linked.tagged-na > .name > .content, -.linked.tagged-na > .name time > span { - text-decoration-color: var(--blue) !important; -} - -.done > .notes > .content, -.done > .name > .content { - opacity: 0.5 !important; -} - -.done ._149jwz0 { - opacity: 1 !important; -} - -/* .linked.done > .name .innerContentContainer::before, */ -/* .linked.tagged-done > .name .innerContentContainer::before, */ -/* .linked.tagged-missed > .name .innerContentContainer::before, */ -/* .linked.tagged-na > .name .innerContentContainer::before { */ -/* position: absolute; */ -/* width: 100%; */ -/* height: 2px; */ -/* bottom: calc(50% - 2px); */ -/* left: 0; */ -/* content: ''; */ -/* z-index: 2; */ -/* } */ - -/* .linked.done.tagged-done > .name .innerContentContainer::before, */ -/* .linked.done.tagged-missed > .name .innerContentContainer::before, */ -/* .linked.done.tagged-na > .name .innerContentContainer::before { */ -/* opacity: 0; */ -/* } */ - -/* .linked.done > .name .innerContentContainer::before { */ -/* background: var(--grey); */ -/* } */ - -/* .linked.tagged-done > .name .innerContentContainer::before { */ -/* background: var(--green); */ -/* } */ - -/* .linked.tagged-missed > .name .innerContentContainer::before { */ -/* background: var(--red) !important; */ -/* } */ - -/* .linked.tagged-na > .name .innerContentContainer::before { */ -/* background: var(--blue) !important; */ -/* } */ - -.linked.tagged-underway > .name > .content::after { - color: var(--blue) !important; - content: '←'; -} - -.linked.tagged-1p > .name .innerContentContainer::after { +.tag-MONTHLY { color: var(--cyan) !important; - content: '1'; -} - -.linked.tagged-2p > .name .innerContentContainer::after { - color: var(--blue) !important; - content: '2'; } - -.linked.tagged-3p > .name .innerContentContainer::after { - color: var(--orange) !important; - content: '3'; -} - -.linked.tagged-5p > .name .innerContentContainer::after { - color: var(--yellow) !important; - content: '5'; -} - -.linked.tagged-8p > .name .innerContentContainer::after { +.tag-IRREGULAR { color: var(--violet) !important; - content: '8'; -} - -.linked.tagged-13p > .name .innerContentContainer::after { - color: var(--magenta) !important; - content: '13'; -} - -.linked.tagged-21p > .name .innerContentContainer::after { - color: var(--red) !important; - content: '21'; -} - -/* ------------------------------------------------------------------------- */ -/* dates */ -/* ------------------------------------------------------------------------- */ - -.timed-today:not(.linked) > .name time > .content-wrapper, -.timed-today:not(.linked) > .notes time > .content-wrapper { - background-color: var(--white) !important; - color: var(--black) !important; } -.linked.timed-yesterday:not(.done) time > .content-wrapper, -.linked.timed-yesterday:not(.tagged-done) time > .content-wrapper, -.linked.timed-late:not(.done) time > .content-wrapper, -.linked.timed-late:not(.tagged-done) time > .content-wrapper { - color: var(--red) !important; +.tag-RELAX { + color: var(--yellow) !important; } -.linked.timed-yesterday.done time > .content-wrapper, -.linked.timed-yesterday.tagged-done time > .content-wrapper, -.linked.timed-today.done time > .content-wrapper, -.linked.timed-today.tagged-done time > .content-wrapper, -.linked.timed-late.done time > .content-wrapper, -.linked.timed-late.tagged-done time > .content-wrapper { +.linked > .name .time > .content-wrapper { color: var(--grey) !important; } -.linked.timed-tomorrow time > .content-wrapper { - color: var(--violet) !important; -} - -.linked.timed-future time > .content-wrapper { - color: var(--cyan) !important; -} - -.linked.timed-today time > .content-wrapper { +.linked > .name .time-today > .content-wrapper { color: var(--yellow) !important; } -.fullMatch .monolith-pill .content-wrapper { - box-shadow: none !important; -} - -.monolith-pill .content-wrapper { - border-radius: 10px; - color: var(--white) !important; - text-decoration-color: var(--grey) !important; -} - -/* .done time span, */ -/* time span { */ -/* text-decoration: none !important; */ -/* } */ - - -/* ------------------------------------------------------------------------- */ -/* header2/inject */ -/* ------------------------------------------------------------------------- */ - -#tooltip { - max-width: 400px; - max-height: 400px; - border: 1px solid white; - background-color: var(--white); -} - -.inject { - /* margin-left: 24px; */ - display: flex; - gap: 5px; - flex-wrap: wrap; -} -.inject > img { - border-radius: 4px; - border: 1px solid var(--dark-grey); - cursor: pointer; -} -.inject > img:hover { - border-color: var(--white); -} -.root > .inject { - margin-left: 0; -} - - - -/* - * -.header2 > .name * { - font-weight: initial; -} - -.header2 > .name > .bullet { - opacity: 1 !important; - color: var(--white) !important; -} - -.header2:not(.root) > .name * { - font-size: 15px !important; -} - -.header2 { - margin-top: 0 !important; - margin-bottom: 0 !important; -} - -.root * .header2 > .name > .content { - line-height: 24px !important; -} - -.header2 > .children { - width: 800px; - display: flex; - flex-wrap: wrap; - height: 100%; - overflow-x: auto; - overflow-y: auto; - -webkit-column-break-inside:avoid; -} - -.header2 > .children > .project { - display: flex; - flex-direction: column; - height: 150px !important; - width: 125px !important; - overflow-y: hidden; - overflow-x: hidden; - border: 1px solid var(--gray7); - border-left: 3px solid var(--gray7); - box-sizing: initial; - margin: 4px; - background-color: var(--gray7) !important; - border-radius: 4px; - padding: 3px 7px 7px 7px; -} - -.header2 > .children > .project:hover { - border-color: var(--gray5); -} - -.header2 > .children > .project > * { - margin-left: 25px; - padding-left: 0; - width: initial; -} - -.header2 > .name { - padding-top: 0 !important; - margin-bottom: 0 !important; -} - -.header2 > .children > .project > .name > .content, -.header2 > .children > .project > .name > .content > .innerContentContainer { - font-size: .9em; - text-wrap: nowrap; - overflow: hidden; - text-overflow: ellipsis; - width: 100%; -} - -.header2 > .children > .project > .notes > .content, -.header2 > .children > .project > .notes > .content > .innerContentContainer { - display: none; -} - - -.header2 > .children > .project > .inject { - min-height: 0; - flex-shrink: 2; - flex-grow: 2; - margin-left: 0 -} - -.header2 > .children > .project > .notes { - margin-bottom: 0; -} - -.inject > img, -.inject > video { - max-width: 150px; - max-height: 150px; -} - -.root > .inject > img, -.root > .inject > video { - max-width: 800px; - max-height: 800px; -} - -.header2 > .children > .project > .inject > img, -.header2 > .children > .project > .inject > video { - width: 100%; - height: 100%; - object-fit: contain; - border: 1px solid var(--grey); -} - -.header2 > .children > .project > .name > .bullet { - left: -25px; - top: 4px; -} -.header2 > .children > .project > .name > .expand, -.header2 > .children > .project > .name > .menu { - display: none; -} -.header2 > .children .contentLink[href^="https://images"] { - font-size: 0; -} -.header2 > .children .contentLink[href^="https://images"]::after { - content: "↗ïļŽ"; - font-size: initial; -} - -.header2 > .children > .project > .inject:after, -.header2 > .children > .project > .inject:before { - position: absolute; - bottom: 12px; - left: 12px; - z-index: 99; - color: var(--white); - text-shadow: - 1px 1px 0 #000, - -1px 1px 0 #000, - -1px -1px 0 #000, - 1px -1px 0 #000; - font-family: Segoe UI Symbol; -} - -.header2 > .children > .project > .inject:before { - left: initial; - right: 14px; -} - -/* ------------------------------------------------------------------------- */ -/* tag/links */ -/* ------------------------------------------------------------------------- */ - -a.contentLink[href] { - color: var(--blue); -} - -span.colored.bc-red, -span.colored.bc-gray, -span.colored.bc-orange, -span.colored.bc-yellow, -span.colored.bc-green, -span.colored.bc-blue, -span.colored.bc-purple, -span.colored.bc-teal, -span.colored.bc-sky, -span.colored.bc-pink { - border-radius: 5px; - padding: 0 4px 0 4px; - /* padding-left: 4px; */ - /* padding-right: 4px; */ -} - -span.contentTag[data-val] { - padding: 0 2px 0 2px; - background: var(--dark-grey); -} - -span.colored.bc-red, -span.colored.bc-red > a, -span.colored.bc-gray, -span.colored.bc-gray > a, -span.colored.bc-orange, -span.colored.bc-orange > a, -span.colored.bc-yellow, -span.colored.bc-yellow > a, -span.colored.bc-green, -span.colored.bc-green > a, -span.colored.bc-blue, -span.colored.bc-blue > a, -span.colored.bc-purple, -span.colored.bc-purple > a, -span.colored.bc-teal, -span.colored.bc-teal > a, -span.colored.bc-sky, -span.colored.bc-sky > a, -span.colored.bc-pink, -span.colored.bc-pink > a, -span.contentTag[data-val] { - color: var(--black) !important; -} -span.contentTag[data-val] { - padding: 0 2px 0 2px; +.linked > .name .time-tomorrow > .content-wrapper { + color: var(--violet) !important; } -span.colored.c-red > a { +.linked > .name .time-late > .content-wrapper { color: var(--red) !important; } -span.cologray.c-gray > a { - color: var(--grey) !important; -} -span.colored.c-orange > a { - color: var(--orange) !important; -} -span.colored.c-yellow > a { - color: var(--yellow) !important; -} -span.colored.c-green > a { - color: var(--green) !important; -} -span.colored.c-blue > a { - color: var(--blue) !important; -} -span.colored.c-purple > a { - color: var(--purple) !important; -} -span.colored.c-teal > a { - color: var(--teal) !important; -} -span.colored.c-sky > a { - color: var(--sky) !important; -} -span.colored.c-pink > a { - color: var(--pink) !important; -} - -.contentLink.link { - font-weight: normal !important; - color: var(--dark-grey) !important; - font-style: normal !important; -} - -/* ------------------------------------------------------------------------- */ -/* linked */ -/* ------------------------------------------------------------------------- */ - -.linked-xproject > .name + .notes > .content { - display: block; - overflow: visible; - max-height: none; -} - -/* .mainTreeRoot > .children > .project > .name:not(.name--focused) + .notes > .content:not(.active), */ - -.references .linked-xproject:not(.open) > .name:not(.name--focused) + .notes > .content:not(.active) , -.references .linked-xproject.open.half-open > .name:not(.name--focused):not(.fullMatch) + .notes > .content:not(.active) { - /* display: none; */ - max-height: 0; - display: -webkit-box; - overflow: hidden; -} - -.linked.done time > .content-wrapper, -.tagged-done time > .content-wrapper { - color: var(--white) !important; -} - -/* .linked.open > .notes > .content, */ -/* .linked.matches.half-open > .notes > .content { */ -/* max-height: none; */ -/* display: block; */ -/* } */ - -/* ------------------------------------------------------------------------- */ -/* spacing/sizing */ -/* ------------------------------------------------------------------------- */ - -.references:not(:first-of-type) { - margin-top: 24px !important; -} - -.root:not(.board) > .children, -.root:not(.board) > .name { - max-width: 800px; -} - -body { - font-size: 15px !important; -} - -.mainTreeRoot > .name { - height: 0 !important; -} - -.page { - margin-top: 48px !important; - padding-top: 56px !important; - padding-bottom: 56px !important; - margin-left: 0; - margin-right: 0; -} - -.pageContainer { - max-width: 100vw !important; - overflow-x: hidden; -} - -div._1vs75eu { - height: initial !important; -} - -.root * .paragraph > .name > .content, -.root * .header2 > .name > .content, -.root * .header1 > .name > .content { - line-height: 24px !important; -} - -.paragraph { - margin: 0 !important; -} - -/* ------------------------------------------------------------------------- */ -/* header1 */ -/* ------------------------------------------------------------------------- */ - -.header1 > .name > .bullet, -.half-open.header1 > .name > .bullet, -.collapsed.header1 > .name > .bullet, -.header2 > .name > .bullet, -.half-open.header2 > .name > .bullet, -.collapsed.header2 > .name > .bullet { - opacity: 1; - color: var(--white); -} - -.header1, .header2, .paragraph { - margin-bottom: 0 !important; -} - -.paragraph { - margin-top: 0 !important; -} - -.header1:not(.root) > .name *, -.header2:not(.root) > .name * { - font-size: 15px !important; -} - -.header1 > .name, -.header2 > .name { - font-weight: initial !important; - margin-top: 0 !important; -} - -div:last-of-type .header1:last-of-type, -div:last-of-type .header2:last-of-type { - margin-bottom: 24px !important; -} - -.children .header1 > .name > .content { - border-bottom: 1px solid var(--white); -} -.children .header2 > .name > .content { - border-bottom: 1px solid var(--dark-grey) !important; -} - -/* ------------------------------------------------------------------------- */ -/* misc */ -/* ------------------------------------------------------------------------- */ - -.metaMatches * .innerContentContainer, -.contentMatch { - background: none !important; -} - -.header > :first-child { - display: none !important; -} - - -/* ------------------------------------------------------------------------- */ -/* color fixes */ -/* ------------------------------------------------------------------------- */ - -/* span.span.colored.c-gray, span.colored.c-gray > *, span.colored.c-gray * { */ -/* color: var(--white) !important; */ -/* text-decoration-color: var(--white) !important; */ -/* } */ -/* span.span.colored.c-yellow, span.colored.c-yellow > *, span.colored.c-yellow * { */ -/* color: var(--yellow) !important; */ -/* text-decoration-color: var(--yellow) !important; */ -/* } */ -/* span.span.colored.c-red, span.colored.c-red > *, span.colored.c-red * { */ -/* color: var(--red) !important; */ -/* text-decoration-color: var(--red) !important; */ -/* } */ -/* span.span.colored.c-green, span.colored.c-green > *, span.colored.c-green * { */ -/* color: var(--green) !important; */ -/* text-decoration-color: var(--green) !important; */ -/* } */ -/* span.span.colored.c-sky, span.colored.c-sky > *, span.colored.c-sky * { */ -/* color: var(--blue) !important; */ -/* text-decoration-color: var(--blue) !important; */ -/* } */ -/* span.span.colored.c-teal, span.colored.c-teal > *, span.colored.c-teal * { */ -/* color: var(--cyan) !important; */ -/* text-decoration-color: var(--cyan) !important; */ -/* } */ -/* span.span.colored.c-pink, span.colored.c-pink > *, span.colored.c-pink * { */ -/* color: var(--magenta) !important; */ -/* text-decoration-color: var(--magenta) !important; */ -/* } */ -/* span.span.colored.c-purple, span.colored.c-purple > *, span.colored.c-purple * { */ -/* color: var(--violet) !important; */ -/* text-decoration-color: var(--violet) !important; */ -/* } */ - -/* .project.open:not(.linked) > .name, */ -/* .project.half-open:not(.linked) > .name, */ -.project.collapsed:not(.linked) > .name, -.project.open:not(.linked) > .name, -.root > .name { - color: var(--white) !important; -} - -.project.references { - margin-top: 0 !important; -} - -.matching-node { - display: none !important; -} - -/* .paragraph { */ -/* font-style: initial !important; */ -/* font-family: palatino, serif !important; */ -/* font-size: 1.2rem !important; */ -/* } */ - -/* .paragraph > .name .monolith-pill .content-wrapper { */ -/* font-size: 1.2rem !important; */ -/* } */ - -.notes * i { - font-family: monospace !important; - font-style: initial !important; -} - -.tagged-5s > .name > .content::after { - content: "★★★★★" !important; - color: var(--yellow); -} -.tagged-4s > .name > .content::after { - content: "★★★★☆" !important; - color: var(--white); -} -.tagged-3s > .name > .content::after { - content: "★★★☆☆" !important; - color: var(--white); -} -.tagged-2s > .name > .content::after { - content: "★★☆☆☆" !important; - color: var(--white); -} -.tagged-1s > .name > .content::after { - content: "★☆☆☆☆" !important; - color: var(--white); -} -.tagged-0s > .name > .content::after { - content: "☆☆☆☆☆" !important; - color: var(--white); -} -.tagged-next > .name > .content::after { - content: "â–ķïļŽâ–ķïļŽ" !important; - color: var(--blue); -} -.tagged-running > .name > .content::after { - content: "â–ķïļŽ" !important; - color: var(--cyan); -} -.tagged-replay > .name > .content::after { - content: "â†ŧ" !important; - color: var(--green); -} - -.contentTag { - text-decoration: underline !important; -} - -/* .imageLink { */ -/* font-size: 0; */ -/* margin-right: 4px; */ -/* } */ -/* .imageLink::before { */ -/* content: "li"; */ -/* font-size: initial; */ -/* } */ -/* .imageLink::after { */ -/* content: "nk"; */ -/* font-size: initial; */ -/* } */ diff --git a/workflowy-helper/~main.js b/workflowy-helper/~main.js new file mode 100644 index 0000000..6c8470b --- /dev/null +++ b/workflowy-helper/~main.js @@ -0,0 +1,294 @@ +(function() { + 'use strict'; + + // update nodes {{{ + + function describeTimeElementDate(element) { // {{{ + + if (!(element instanceof HTMLTimeElement)) { + return "unknown"; + } + + const startYear = element.getAttribute('startyear'); + const startMonth = element.getAttribute('startmonth'); + const startDay = element.getAttribute('startday'); + + if (!startYear || !startMonth || !startDay || isNaN(startYear) || isNaN(startMonth) || isNaN(startDay)) { + return 'Invalid date attributes on the