Skip to content

Commit

Permalink
Build 0.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ransome1 committed Jan 23, 2021
1 parent 0655019 commit 5810c6c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 26 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ You can find binaries for Windows, MacOS and Linux on the <a href="https://githu
- Open file: CMD/CTRL + o
- Open settings: CMD/CTRL + ,
- Toggle side bar: CMD/CTRL + b
- Set priorities in add/edit todo window: CTRL+SHIFT+[A-Z]

### Used libraries
- Electron: https://github.com/electron/electron
Expand Down
2 changes: 1 addition & 1 deletion flatpak/com.github.ransome1.sleek.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<developer_name>Robin Ahle</developer_name>
<content_rating type="oars-1.0" />
<releases>
<release version="0.8.3" date="2021-01-18"/>
<release version="0.8.4" date="2021-01-23"/>
</releases>
<url type="homepage">https://github.com/ransome1/sleek</url>

Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sleek
base: core18
version: '0.8.3'
version: '0.8.4'
summary: A todo app based on todo.txt, free and open-source
description: |
sleek offers a clean and simple interface that can be used with mouse and keyboard, keyboard only or touch devices. You will use an easy to understand but powerful syntax to create todos. According to the concept of todo.txt you can add contexts to your todos or assign them to projects you're working on. Priorities can be set and if you add due dates sleek will send you notifications just in time.
Expand Down
3 changes: 2 additions & 1 deletion src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ nav {
#recurrencePicker .card .content #recurrencePickerDecrease,
#recurrencePicker .card .content #recurrencePickerIncrease,
#recurrencePicker .card .content #recurrencePickerSpinner {
font-size: 1.25em; }
font-size: 1.25em;
padding: .5em; }
#recurrencePicker .card .content #recurrencePickerSpinner {
width: 2em; }
#recurrencePicker .card label {
Expand Down
4 changes: 0 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ <h1 id="noResultContainerHeadline" class="title is-1"></h1>
<div class="content">
<div class="control has-icons-right">
<input id="modalFormInput" class="input is-medium" type="text" tabindex="300">
<!--<textarea id="modalFormInput" class="input is-medium" type="text" tabindex="300" style="height: 100px;"></textarea>-->
<!--<a href="#" id="modalFormInputHelp" class="icon is-right" tabindex="-1">
<i class="fas fa-question-circle"></i>
</a>-->
<a href="#" id="modalFormInputResize" class="icon is-right" tabindex="-1" data-input-type="input">
<i class="fas fa-expand-alt"></i>
</a>
Expand Down
34 changes: 15 additions & 19 deletions src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ dueDatePickerInput.addEventListener('changeDate', function (e, details) {
// we only update the object if there is a date selected. In case of a refresh it would throw an error otherwise
if(e.detail.date) {
// generate the object on what is written into input, so we don't overwrite previous inputs of user
item.currentTemp = new TodoTxtItem(modalFormInput.value, [ new DueExtension(), new RecExtension() ]);
item.currentTemp.due = new Date(e.detail.date);
item.currentTemp.dueString = new Date(e.detail.date.getTime() - (e.detail.date.getTimezoneOffset() * 60000 )).toISOString().split("T")[0];
modalFormInput.value = item.currentTemp.toString();
let todo = new TodoTxtItem(modalFormInput.value, [ new DueExtension(), new RecExtension() ]);
todo.due = new Date(e.detail.date);
todo.dueString = new Date(e.detail.date.getTime() - (e.detail.date.getTimezoneOffset() * 60000 )).toISOString().split("T")[0];
modalFormInput.value = todo.toString();
// adjust size of inut
dueDatePickerInput.setAttribute("size", dueDatePickerInput.value.length);
// clean up as we don#t need it anymore
item.currentTemp = null;
todo = null;
// if suggestion box was open, it needs to be closed
suggestionContainer.classList.remove("is-active");
suggestionContainer.blur();
Expand Down Expand Up @@ -509,10 +509,6 @@ modalFormInputResize.onclick = function () {
modalFormInput.onfocus = function () {
suggestionContainer.classList.remove("is-active");
};
modalFormInput.onblur = function () {
//console.log(suggestionContainer.hasFocus());
//suggestionContainer.classList.remove("is-active");
};
modalBackground.forEach(function(el) {
el.onclick = function() {
clearModal();
Expand Down Expand Up @@ -842,7 +838,7 @@ function parseDataFromFile() {
// TODO: Reuse these later
items.complete = items.objects.filter(function(item) { return item.complete === true });
items.incomplete = items.objects.filter(function(item) { return item.complete === false });
// remove empty objects liek from empty lines in file
// remove empty objects like from empty lines in file
items.objects = items.objects.filter(function(item) { return item.toString() != "" });
if(items.objects.length>0) {
// if settings modal is open and archiving has been completed (will trigger this function) the buttons needs to be disabled until another completed todo is added
Expand Down Expand Up @@ -1458,8 +1454,6 @@ function generateTodoData(searchString) {
noResultContainer.classList.add("is-active");
return Promise.resolve("Info: No results to search input or filter selection");
}
// sort items according to todo.txt logic
sortItems(items.objectsFiltered);
// produce an object where priority a to z + null is key
items.objectsFiltered = items.objectsFiltered.reduce((r, a) => {
r[a.priority] = [...r[a.priority] || [], a];
Expand All @@ -1472,6 +1466,15 @@ function generateTodoData(searchString) {
// nodes need to be created to add them to the outer fragment
// this creates a divider row for the priorities
if(items.objectsFiltered[priority][0]!="null") tableContainerContent.appendChild(document.createRange().createContextualFragment("<div class=\"flex-table priority\" role=\"rowgroup\"><div class=\"flex-row\" role=\"cell\">" + items.objectsFiltered[priority][0] + "</div></div>"))
// sort items according to todo.txt logic
// second start dates
items.objectsFiltered[priority][1].sort(function(a, b) {
return b.date - a.date;
});
// first due dates
items.objectsFiltered[priority][1].sort(function(a, b) {
return a.due - b.due;
});
// TODO: that's ugly, refine this
for (let item in items.objectsFiltered[priority][1]) {
let todo = items.objectsFiltered[priority][1][item];
Expand Down Expand Up @@ -2004,13 +2007,6 @@ function showForm(todo, templated) {
console.log(error);
}
}
function sortItems(items) {
// first step of sorting items: the youngest to the top
items.sort((a, b) => b.date - a.date);
// array is sorted so the due date is desc
items.sort((a, b) => a.due - b.due);
return;
}
function showResultStats() {
// we show some information on filters if any are set
if(items.objectsFiltered.length!=items.objects.length) {
Expand Down
1 change: 1 addition & 0 deletions src/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,7 @@ nav {
#recurrencePickerIncrease,
#recurrencePickerSpinner {
font-size: 1.25em;
padding: .5em;
}
#recurrencePickerSpinner {
width: 2em;
Expand Down

0 comments on commit 5810c6c

Please sign in to comment.