Skip to content

Commit

Permalink
Optimized the table rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
ransome committed Nov 6, 2020
1 parent 86de128 commit 2f0540b
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 81 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sleek",
"productName": "sleek",
"version": "0.0.3",
"version": "0.0.4",
"description": "sleek is a simple todo manager based on the concept of todo.txt. That means you will use a simple but powerful syntax to add contexts and projects to your todos, you will prioritize them or set due dates and according to this you will be able to filter your todos. There is no native cloud integration in sleek. But as sleek writes your data to a local text file you can put or sync this file anywhere you need. That also means that if you don't have sleek at hand or if you don't like sleek anymore you can just edit the todo.txt file with any text editor or other todo.txt app.",
"synopsis": "A simple todo manager based on the concept of todo.txt",
"category": "ProjectManagement",
Expand Down
15 changes: 9 additions & 6 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ nav ul li.logo {

/* TABLE */

#todoTable .hero-body {
padding: 1.5em;
}

#todoTable {
width: 100%;
display: none;
Expand Down Expand Up @@ -306,6 +310,11 @@ nav ul li.logo {
margin-right: auto;
}

.flex-table .flex-row[role="cell"].spacer {
width: .5em;
background: transparent;
}

.flex-table .flex-row[role="cell"].priority {
width: .5em;
background: hsl(0, 0%, 86%);
Expand Down Expand Up @@ -629,10 +638,4 @@ input:checked + .slider:before {
padding: 1em!important;
}

/* TODO TABLE */

#todoTable .hero-body {
padding: 1.5em;
}

}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const createWindow = () => {
Menu.setApplicationMenu(menu)

// Open the DevTools.
mainWindow.webContents.openDevTools();
//mainWindow.webContents.openDevTools();

// Store user data: save size after resize
mainWindow.on('resize', () => {
Expand Down
20 changes: 20 additions & 0 deletions src/js/jsTodoExtensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,31 @@ DueExtension.prototype.parsingFunction = function(line) {
return [null, null, null];
};

function IdExtension() {
// Set the name, this will be the property name on the TodoTxtItem.
this.name = "id";
};

IdExtension.prototype = new TodoTxtExtension();
IdExtension.prototype.parsingFunction = function(line) {
// We don't have to use a regex, but it's handy for extracting the content.
var IdRegex = /\bid:([0-9a-fA-F]{6}|[0-9a-fA-F]{3})\b/;
var match = IdRegex.exec(line);
if( match !== null ) {
// The return format is [ <value of property>, <line with addon removed>, <string of the value> ]
return [match[1], line.replace(IdRegex, ''), match[1]];
}
// Return nulls if not found.
return [null, null, null];
};


// Exported functions for node
(function(exports){

exports.TodoTxtExtension = TodoTxtExtension;
exports.HiddenExtension = HiddenExtension;
exports.DueExtension = DueExtension;
exports.IdExtension = IdExtension;

})(typeof exports === 'undefined' ? window : exports);
Loading

0 comments on commit 2f0540b

Please sign in to comment.