From daee8c70f59b97603e4199fc2779b51659899134 Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Wed, 29 May 2024 22:07:10 +1000 Subject: [PATCH] chore: deprecate truncated-titles --- src/extensions/truncated-titles/client.mjs | 66 ------------------ src/extensions/truncated-titles/mod.json | 33 --------- .../truncated-titles/truncated-titles.jpg | Bin 5770 -> 0 bytes 3 files changed, 99 deletions(-) delete mode 100644 src/extensions/truncated-titles/client.mjs delete mode 100644 src/extensions/truncated-titles/mod.json delete mode 100644 src/extensions/truncated-titles/truncated-titles.jpg diff --git a/src/extensions/truncated-titles/client.mjs b/src/extensions/truncated-titles/client.mjs deleted file mode 100644 index b0fe2d6..0000000 --- a/src/extensions/truncated-titles/client.mjs +++ /dev/null @@ -1,66 +0,0 @@ -/** - * notion-enhancer: truncated titles - * (c) 2021 admiraldus (https://github.com/admiraldus) - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -export default async function ({ web, components }, db) { - const enhanceTableTitles = await db.get(['tables']), - enhanceTimelineItems = await db.get(['timelines']), - tableCellSelector = '.notion-table-view-header-cell', - tableTitleSelector = `${tableCellSelector} div[style*="text-overflow"]`, - timelineItemSelector = '.notion-timeline-item', - $elements = []; - - const addTooltips = () => { - if (enhanceTableTitles) { - document.querySelectorAll(tableTitleSelector).forEach(($tableTitle) => { - if ($elements.includes($tableTitle)) return; - - if ($tableTitle.scrollWidth > $tableTitle.clientWidth) { - components.addTooltip( - $tableTitle.parentElement.parentElement.parentElement, - web.html`${web.escape($tableTitle.innerText)}`, - 750 - ); - $elements.push($tableTitle); - } - }); - } - - if (enhanceTimelineItems) { - document.querySelectorAll(timelineItemSelector).forEach(($timelineItem) => { - const $title = $timelineItem.nextElementSibling.firstElementChild; - $title.style.position = 'absolute'; - $title.style.left = $timelineItem.style.left; - - if ($elements.includes($timelineItem)) return; - $elements.push($timelineItem); - - $title.style.width = $timelineItem.clientWidth + 'px'; - $title.firstElementChild.firstElementChild.style.maxWidth = - $timelineItem.clientWidth + 'px'; - $timelineItem.addEventListener('mouseover', (event) => { - $title.style.width = '100%'; - $title.firstElementChild.firstElementChild.style.maxWidth = '400px'; - }); - $timelineItem.addEventListener('mouseout', async (event) => { - if (!$timelineItem.matches(':hover')) { - $title.style.width = $timelineItem.clientWidth + 'px'; - $title.firstElementChild.firstElementChild.style.maxWidth = - $timelineItem.clientWidth + 'px'; - } - }); - }); - } - }; - - await web.whenReady(); - addTooltips(); - web.addDocumentObserver(addTooltips, [ - tableCellSelector, - timelineItemSelector, - `${timelineItemSelector} + div > :first-child`, - ]); -} diff --git a/src/extensions/truncated-titles/mod.json b/src/extensions/truncated-titles/mod.json deleted file mode 100644 index eb2cf39..0000000 --- a/src/extensions/truncated-titles/mod.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "truncated titles", - "id": "1794c0bd-7b96-46ad-aa0b-fc4bd76fc7fb", - "version": "0.2.0", - "description": "see the full text of a truncated title on hover.", - "preview": "truncated-titles.jpg", - "tags": ["extension", "layout"], - "authors": [ - { - "name": "admiraldus", - "homepage": "https://github.com/admiraldus", - "avatar": "https://raw.githubusercontent.com/admiraldus/admiraldus/main/module.gif" - } - ], - "js": { - "client": ["client.mjs"] - }, - "css": {}, - "options": [ - { - "type": "toggle", - "key": "tables", - "label": "table titles", - "value": true - }, - { - "type": "toggle", - "key": "timelines", - "label": "timeline items", - "value": true - } - ] -} diff --git a/src/extensions/truncated-titles/truncated-titles.jpg b/src/extensions/truncated-titles/truncated-titles.jpg deleted file mode 100644 index 94a1cdbf1a3bfbeaa6548ebb9d77e7af0f1c94d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5770 zcmb_<1yq#XyYD+e*D!>n5<`b{3d|r3HN*e{Qc}`LBN(6{DIhH=A^8!Clpr8Tmr{a& zlyrj#(wss4zVCm|T4$|$@4EZhYw!1|chB1M?BD*q=U>ie0GK*j4Gn-mAix4A!1)Al z9e{wr7aiB2xQ<7N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