Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions chrome/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ function toLocalISOString(date) {
function addArticleToTree(title, url, parentUrl) {
// If there's no parent, this is a root article
if (!parentUrl) {
articlesTree[url] = articlesTree[url] || { title, children: {} };
articlesTree[url] = articlesTree[url] || { title, url, children: {} };
} else {
// Recursively search for the parent node in the tree
const parentNode = findParentNode(articlesTree, parentUrl);
if (parentNode) {
// Add the article under its parent
parentNode.children[url] = parentNode.children[url] || { title, children: {} };
parentNode.children[url] = parentNode.children[url] || { title, url, children: {} };
} else {
// If the parent node is not found, treat it as a root article
articlesTree[url] = articlesTree[url] || { title, children: {} };
articlesTree[url] = articlesTree[url] || { title, url, children: {} };
}
}
// Save the updated tree to storage
Expand Down
19 changes: 11 additions & 8 deletions chrome/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,17 @@ document.addEventListener('DOMContentLoaded', function() {
.attr("fill", d => d.children ? "#555" : "#999")
.attr("r", 2.5);

node.append("text")
.attr("dy", "0.31em")
.attr("x", d => d.children ? -6 : 6)
.attr("text-anchor", d => d.children ? "end" : "start")
.text(d => d.data.title)
.attr("fill", "black") // Set the text color
.clone(true).lower()
.attr("stroke", "white"); // Remove the stroke or set to a contrasting color if needed
node.append("a")
.attr("xlink:href", d => d.data.url || null)
.attr("target", "_blank") // Opens link in a new tab
.append("text")
.attr("dy", "0.31em")
.attr("x", d => d.children ? -6 : 6)
.attr("text-anchor", d => d.children ? "end" : "start")
.text(d => d.data.title)
.attr("fill", "black") // Set the text color
.clone(true).lower()
.attr("stroke", "white"); // Remove the stroke or set to a contrasting color if needed


// Add this SVG to your popup
Expand Down
6 changes: 3 additions & 3 deletions firefox/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ function toLocalISOString(date) {
function addArticleToTree(title, url, parentUrl) {
// If there's no parent, this is a root article
if (!parentUrl) {
articlesTree[url] = articlesTree[url] || { title, children: {} };
articlesTree[url] = articlesTree[url] || { title, url, children: {} };
} else {
// Recursively search for the parent node in the tree
const parentNode = findParentNode(articlesTree, parentUrl);
if (parentNode) {
// Add the article under its parent
parentNode.children[url] = parentNode.children[url] || { title, children: {} };
parentNode.children[url] = parentNode.children[url] || { title, url, children: {} };
} else {
// If the parent node is not found, treat it as a root article
articlesTree[url] = articlesTree[url] || { title, children: {} };
articlesTree[url] = articlesTree[url] || { title, url, children: {} };
}
}
// Save the updated tree to storage
Expand Down
19 changes: 11 additions & 8 deletions firefox/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,17 @@ document.addEventListener('DOMContentLoaded', function() {
.attr("fill", d => d.children ? "#555" : "#999")
.attr("r", 2.5);

node.append("text")
.attr("dy", "0.31em")
.attr("x", d => d.children ? -6 : 6)
.attr("text-anchor", d => d.children ? "end" : "start")
.text(d => d.data.title)
.attr("fill", "black") // Set the text color
.clone(true).lower()
.attr("stroke", "white"); // Remove the stroke or set to a contrasting color if needed
node.append("a")
.attr("xlink:href", d => d.data.url || null)
.attr("target", "_blank") // Opens link in a new tab
.append("text")
.attr("dy", "0.31em")
.attr("x", d => d.children ? -6 : 6)
.attr("text-anchor", d => d.children ? "end" : "start")
.text(d => d.data.title)
.attr("fill", "black") // Set the text color
.clone(true).lower()
.attr("stroke", "white"); // Remove the stroke or set to a contrasting color if needed


// Add this SVG to your popup
Expand Down