Commit c5fc30b9 authored by ransome1's avatar ransome1
Browse files

Merge branch 'master' into develop

parents 3ed3f1d6 d679c71d
# sleek
## Help wanted
Amazing feature requests, major and minor bug reports are piling up, and great discussions are ongoing. I want to thank you for supporting this project. but I also need to admit that I'm overwhelmed by the sheer amount of work. Please understand that sleek is FOSS and I'm not aiming to earn money with it, so my time on the project is limited. If you are skilled in HTML, CSS, JavaScript, the Electron framework, writing Playwright test cases, improving UX/UI or if you're able to maintain sleek for one of the distribution channels, please check in with me <a href="https://github.com/ransome1/sleek/discussions/388">here</a> or check the <a href="https://github.com/ransome1/sleek/issues">issue list</a> and start working on bugs and feature requests.
Amazing feature requests, major and minor bug reports are piling up, and great discussions are ongoing. I want to thank you for supporting this project. But I also need to admit that I'm overwhelmed by the sheer amount of work. Please understand that sleek is FOSS and I'm not aiming to earn money with it, so my time on the project is limited. If you are skilled in HTML, CSS, JavaScript, the Electron framework, writing Playwright test cases, improving UX/UI or if you're able to maintain sleek for one of the distribution channels, please check in with me <a href="https://github.com/ransome1/sleek/discussions/388">here</a> or check the <a href="https://github.com/ransome1/sleek/issues">issue list</a> and start working on bugs and feature requests.
## sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. It's available for Windows, MacOS and Linux
+ [Screenshots](#screenshots)
......
name: sleek
base: core18
version: "1.2.0"
version: "1.2.1"
summary: todo.txt manager for Linux, free and open-source (FOSS)
description: |
sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. Stripped down to only the most necessary features, and with a clean and simple interface, sleek aims to help you focus on getting things done.
......
......@@ -12294,12 +12294,15 @@ input.is-medium.input {
width: auto;
cursor: pointer;
color: #5a5a5a;
/*a {
font-size: 1.1em;
font-family: FreeSansBold;
height: auto;
padding: 0.15em 0.5em;
}*/
}
#todoTable .cell.text a {
font-size: 1.1em;
font-family: FreeSansBold;
height: auto;
padding: 0.15em 0.5em;
#todoTable .cell.text span.linkText {
color: hsl(217deg, 71%, 53%);
}
#todoTable .cell.text a.button.priority {
font-size: 0.9em;
......
This diff is collapsed.
......@@ -503,6 +503,22 @@
</td>
</tr>
</table>
<table id="getPageTitlesRow" class="settings">
<tr>
<th colspan="100%" id="getPageTitlesHeadline">Replace links with website titles</th>
</tr>
<tr>
<td id="getPageTitlesBody">Description text</td>
<td>
<span class="toggle">
<label class="switch" for="getPageTitles">
<input type="checkbox" id="getPageTitles" class="toggle" tabindex="0">
<span class="slider round"></span>
</label>
</span>
</td>
</tr>
</table>
<table class="settings">
<tr>
<th colspan="100%" id="zoomHeadline"></th>
......@@ -849,7 +865,7 @@
<p><button id="btnMessageLogging" tabindex="-1"><i class="fas fa-cog"></i>&nbsp;<span id="messageLoggingButton"></span></button></p>
</div>
</article>
<article class="message fixed review" data="support">
<article class="message fixed review" data="support" id="messageSupport">
<div class="message-header">
<p>sleek <i class="fas fa-heart"></i> you</p>
<button class="delete" role="cancel" data-message="support"></button>
......
......@@ -24,12 +24,26 @@ marked.setOptions({
xhtml: false,
baseUrl: "https://"
});
const renderer = {
link(href, title, text) {
return `${text} <a href="${href}" target="_blank"><i class="fas fa-external-link-alt"></i></a>`;
}
};
marked.use({ renderer });
// const renderer = {
// link(href, title, text) {
// return `${text} <a href="${href}" target="_blank"><i class="fas fa-external-link-alt"></i></a>`;
// }
// };
// // Override function
// const walkTokens = (token) => {
// if(token.type !== "link") return false;
// console.log(token.text)
// //return `${token.text} <a href="${token.href}" target="_blank"><i class="fas fa-external-link-alt"></i></a>`;
// // link(href, text) {
// // console.log(href)
// // //temp(href);
// // return `${text} <a href="${href}" target="_blank"><i class="fas fa-external-link-alt"></i></a>`;
// // }
// };
// marked.use({ renderer, walkTokens });
// TODO: check if this still works
export function jumpToItem(item) {
......
......@@ -2,7 +2,7 @@
import { _paq } from "./matomo.mjs";
import { handleError } from "./helper.mjs";
import { showModal } from "./content.mjs";
import { userData, translations } from "../render.js";
import { userData, appData, translations } from "../render.js";
const btnMessageLogging = document.getElementById("btnMessageLogging");
const messages = document.getElementById("messages");
......@@ -12,6 +12,10 @@ const messageGenericMessage = document.getElementById("messageGenericMessage");
const messageLoggingBody = document.getElementById("messageLoggingBody");
const messageLoggingButton = document.getElementById("messageLoggingButton");
const messageLoggingTitle = document.getElementById("messageLoggingTitle");
const messageSupport = document.getElementById("messageSupport");
// Apple doesn't like other stores to be mentioned so it is being surpressed on the Mac App Store build
if(appData.channel === "Mac App Store") messageSupport.classList.add("is-hidden");
messageLoggingBody.innerHTML = translations.messageLoggingBody;
messageLoggingButton.innerHTML = translations.settings;
......
......@@ -37,6 +37,7 @@ const todoTableBodyCellTextTemplate = document.createElement("div");
const todoTableBodyRowTemplate = document.createElement("div");
const todoTableWrapper = document.getElementById("todoTableWrapper");
let
linkId,
clusterCounter = 0,
clusterSize = Math.ceil(window.innerHeight/32), // 32 being the pixel height of one todo in compact mode
clusterThreshold = clusterSize;
......@@ -72,6 +73,18 @@ todoTableWrapper.onscroll = function(event) {
}
}
// receives a page title and if found replaces the link with it
function getAndsetPageTitle(linkId, href) {
const pageBody = fetch(href);
pageBody.then(response => response.text()).then(async data => {
const regExp = new RegExp("<title[^>]*>(.*?)</title>");
const pageTitle = regExp.exec(data);
const linkElement = await document.getElementById("linkId" + linkId);
if(!linkElement || !pageTitle) return false;
linkElement.innerHTML = pageTitle[1];
})
}
async function generateTodoTxtObjects(fileContent) {
try {
......@@ -370,8 +383,20 @@ function generateTableRow(todo) {
// adds priority to the text cell
if(todo.priority && (sortBy !== "priority" || userData.sortByFile)) todoTableBodyCellText.innerHTML = `<a class="priority button ${todo.priority}">${todo.priority}</a>`;
const renderer = {
link(href, title, text) {
const linkId = Math.random().toString(36).slice(2);
if(userData.getPageTitles) getAndsetPageTitle(linkId, text);
return `<span id="linkId${linkId}" class="linkText">${text}</span> <a href="${href}" target="_blank"><i class="fas fa-external-link-alt"></i></a>`;
}
};
marked.use({ renderer });
// parse text string through markdown parser
todoTableBodyCellText.innerHTML += "<span class=\"text\">" + marked.parseInline(todo.text) + "</span>";
todoTableBodyCellText.innerHTML += "<span class=\"text\">" + marked.parse(todo.text) + "</span>";
// replace line feed character with a space
todoTableBodyCellText.innerHTML = todoTableBodyCellText.innerHTML.replaceAll(String.fromCharCode(16)," ");
......
......@@ -335,6 +335,7 @@ function getUserData() {
if(typeof userData.data.language != "string") userData.data.language = app.getLocale().substr(0,2);
if(typeof userData.data.autoUpdate != "boolean") userData.data.autoUpdate = false;
if(typeof userData.data.theme != "string") userData.set("theme", "system");
if(typeof userData.data.getPageTitles != "boolean") userData.data.getPageTitles = true;
//TODO remove this after 1.1.7 has been fully distributed
const indexOfDueString = userData.data.sortBy.indexOf("dueString");
......
......@@ -103,11 +103,14 @@
width: auto;
cursor: pointer;
color: $dark-grey;
a {
/*a {
font-size: 1.1em;
font-family: FreeSansBold;
height: auto;
padding: 0.15em 0.5em;
}*/
span.linkText {
color: $has-text-link;
}
a.button.priority {
font-size: 0.9em;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment