From 3a2729aec1dd279fb6e3fd0a84ef77e21663d7c0 Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Thu, 19 Dec 2024 20:46:38 -0500 Subject: [PATCH 01/11] CTRL+D and CTRL+X Enable auto date insertion with ctrl+d and ability to delete the note with ctrl+x. Also added the Command+shift+* for MacOS bullet --- nullboard.html | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/nullboard.html b/nullboard.html index 0e1aca1..71b8b04 100644 --- a/nullboard.html +++ b/nullboard.html @@ -4704,6 +4704,24 @@

Auto-backup

return false; } + // ctrl + D for auto date insert + if (isNote && ev.ctrlKey && ev.keyCode == '68') + { + var have = this.value; + var want = '[' + new Date().toLocaleDateString() + '] ' + have; + $this.val(want); + this.selectionStart = this.selectionEnd = pos + 2; + return false; + } + + // ctrl + X to delete note + if (isNote && ev.ctrlKey && ev.keyCode == '88') + { + stopEditing($this, false, false); + deleteNote( $(this).closest('.note') ); + return false; + } + // tab if (ev.keyCode == 9) { @@ -4779,7 +4797,7 @@

Auto-backup

} // ctrl-shift-8 - if (isNote && ev.key == '*' && ev.ctrlKey) + if (isNote && ev.key == '*' && ev.ctrlKey || isNote && ev.key == '8' && ev.metaKey && ev.shiftKey) { var have = this.value; var pos = this.selectionStart; From 9cef496ab243130ce86ffe39e2e7e8839af42dd2 Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Thu, 19 Dec 2024 20:51:20 -0500 Subject: [PATCH 02/11] Remove unneeded code. --- nullboard.html | 1 - 1 file changed, 1 deletion(-) diff --git a/nullboard.html b/nullboard.html index 71b8b04..01584d7 100644 --- a/nullboard.html +++ b/nullboard.html @@ -4710,7 +4710,6 @@

Auto-backup

var have = this.value; var want = '[' + new Date().toLocaleDateString() + '] ' + have; $this.val(want); - this.selectionStart = this.selectionEnd = pos + 2; return false; } From 4c3c6ae436a9b8ad3e0e5bbeff7deae8caa0083b Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Thu, 19 Dec 2024 21:16:16 -0500 Subject: [PATCH 03/11] Move cursor to end of line after insert. --- nullboard.html | 1 + 1 file changed, 1 insertion(+) diff --git a/nullboard.html b/nullboard.html index 01584d7..dbbc1a9 100644 --- a/nullboard.html +++ b/nullboard.html @@ -4710,6 +4710,7 @@

Auto-backup

var have = this.value; var want = '[' + new Date().toLocaleDateString() + '] ' + have; $this.val(want); + this.selectionStart = this.selectionEnd = this.value.length; return false; } From fcacb53e3b27463e8fc8ccc8ff374b3ec51a44f2 Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Thu, 19 Dec 2024 22:35:00 -0500 Subject: [PATCH 04/11] Add the ability to insert an indent (4 spaces) with Alt+RightArrow --- nullboard.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nullboard.html b/nullboard.html index dbbc1a9..1c5e032 100644 --- a/nullboard.html +++ b/nullboard.html @@ -4722,6 +4722,16 @@

Auto-backup

return false; } + // Alt/Option + Right to Indent + if (isNote && ev.altKey && ev.key == 'ArrowRight') + { + var have = this.value; + var want = have + ' '; //4 spaces is a TAB + $this.val(want); + this.selectionStart = this.selectionEnd = this.value.length; + return false; + } + // tab if (ev.keyCode == 9) { From e6417dbd59128a3647b596201de3f5c503f4a34b Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Fri, 20 Dec 2024 12:12:15 -0500 Subject: [PATCH 05/11] Added the ability to auto change the appearance of the note if the date is past due from today. This assumes the 'due date' is catured in the note in between [] notation. --- nullboard.html | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/nullboard.html b/nullboard.html index 1c5e032..18985d4 100644 --- a/nullboard.html +++ b/nullboard.html @@ -473,7 +473,7 @@ box-shadow: 0 1px 2px #bbb, 0 0 1px #ddd; position: relative; } - + .board .note.dragging, .board .note.dragging.raw { background: #CED4DA; @@ -632,6 +632,11 @@ padding-bottom: 6px; } + .board .note.overdue { + background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2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NzUsMS43NUMxMy43NSw5LjcxMiwxMy43MTEsOS45MjIsMTMuNjMzLDEwLjEyNXoiLz48L3N2Zz4=")no-repeat, linear-gradient(to right, #ffffff, #f5071f); + background-position: right; + } + .board .note.collapsed .text, .note-dragster.collapsed .text { max-height: calc( var(--lh) * 1px ); @@ -3372,6 +3377,12 @@

Auto-backup

list.notes.forEach(function(n){ var $n = $ndiv.clone(); setText( $n.find('.text'), n.text ); + + //Search for overdue dates and highlight them red via a new class 'overdue' + var noteDate = new Date(n.text.split('[').pop().split(']')[0]).toLocaleDateString(); + var todayDate = new Date().toLocaleDateString(); + if (new Date(todayDate).getTime() > new Date(noteDate).getTime()) $n.addClass('overdue'); + if (n.raw) $n.addClass('raw'); if (n.min) $n.addClass('collapsed'); $l_notes.append($n); @@ -4157,6 +4168,14 @@

Auto-backup

if ($item.parent().hasClass('board')) NB.board.title = text_now; + //Search for overdue dates and highlight them red via a new class 'overdue' (when editing a note) + var noteDate = new Date(text_now.split('[').pop().split(']')[0]).toLocaleDateString(); + var todayDate = new Date().toLocaleDateString(); + if (new Date(todayDate).getTime() > new Date(noteDate).getTime()) + $item.addClass('overdue'); + else + $item.removeClass('overdue'); + updatePageTitle(); saveBoard(); } From b088f87487d0a9e14f28b2d907e5a5e282e6d2a3 Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Fri, 20 Dec 2024 14:30:05 -0500 Subject: [PATCH 06/11] Final update that removed the overdue coloring if the note is moved into a list named 'done' or 'complete' --- nullboard.html | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/nullboard.html b/nullboard.html index 18985d4..1f56a72 100644 --- a/nullboard.html +++ b/nullboard.html @@ -473,7 +473,7 @@ box-shadow: 0 1px 2px #bbb, 0 0 1px #ddd; position: relative; } - + .board .note.dragging, .board .note.dragging.raw { background: #CED4DA; @@ -3275,6 +3275,16 @@

Auto-backup

var n = l.addNote( getText($note.find('.text')) ); n.raw = $note.hasClass('raw'); n.min = $note.hasClass('collapsed'); + + //Search for overdue dates and highlight them red via a new class 'overdue' + var noteDate = new Date(n.text.split('[').pop().split(']')[0]).toLocaleDateString(); + var todayDate = new Date().toLocaleDateString(); + if (new Date(todayDate).getTime() > new Date(noteDate).getTime()) $note.addClass('overdue'); + + //remove the coloring if its in a list with "done" or "complete" + var listTitle = $note.closest('.list, .head').find('.text').attr('_text'); + if (listTitle.toLowerCase().includes("done") || listTitle.toLowerCase().includes("complete")) + $note.removeClass('overdue') }); }); @@ -3377,12 +3387,16 @@

Auto-backup

list.notes.forEach(function(n){ var $n = $ndiv.clone(); setText( $n.find('.text'), n.text ); - + //Search for overdue dates and highlight them red via a new class 'overdue' var noteDate = new Date(n.text.split('[').pop().split(']')[0]).toLocaleDateString(); var todayDate = new Date().toLocaleDateString(); if (new Date(todayDate).getTime() > new Date(noteDate).getTime()) $n.addClass('overdue'); + //remove the coloring if its in a list with "done" or "complete" + if (list.title.toLowerCase().includes("done") || list.title.toLowerCase().includes("complete")) + $n.removeClass('overdue') + if (n.raw) $n.addClass('raw'); if (n.min) $n.addClass('collapsed'); $l_notes.append($n); From cead3078b8f80a249f50eb32e556786e2af0fd0b Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Fri, 20 Dec 2024 16:49:56 -0500 Subject: [PATCH 07/11] Fixed bug with multiple "[ ]" in text. Only look for the date in the first found. --- nullboard.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nullboard.html b/nullboard.html index 1f56a72..ff810cf 100644 --- a/nullboard.html +++ b/nullboard.html @@ -3277,7 +3277,7 @@

Auto-backup

n.min = $note.hasClass('collapsed'); //Search for overdue dates and highlight them red via a new class 'overdue' - var noteDate = new Date(n.text.split('[').pop().split(']')[0]).toLocaleDateString(); + var noteDate = new Date(n.text.substring(0, n.text.indexOf(']')).split('[').pop().split(']')[0]).toLocaleDateString(); var todayDate = new Date().toLocaleDateString(); if (new Date(todayDate).getTime() > new Date(noteDate).getTime()) $note.addClass('overdue'); @@ -3389,7 +3389,7 @@

Auto-backup

setText( $n.find('.text'), n.text ); //Search for overdue dates and highlight them red via a new class 'overdue' - var noteDate = new Date(n.text.split('[').pop().split(']')[0]).toLocaleDateString(); + var noteDate = new Date(n.text.substring(0, n.text.indexOf(']')).split('[').pop().split(']')[0]).toLocaleDateString(); var todayDate = new Date().toLocaleDateString(); if (new Date(todayDate).getTime() > new Date(noteDate).getTime()) $n.addClass('overdue'); @@ -4183,7 +4183,7 @@

Auto-backup

NB.board.title = text_now; //Search for overdue dates and highlight them red via a new class 'overdue' (when editing a note) - var noteDate = new Date(text_now.split('[').pop().split(']')[0]).toLocaleDateString(); + var noteDate = new Date(text_now.substring(0, text_now.indexOf(']')).split('[').pop().split(']')[0]).toLocaleDateString(); var todayDate = new Date().toLocaleDateString(); if (new Date(todayDate).getTime() > new Date(noteDate).getTime()) $item.addClass('overdue'); From f88f85980986c6e7fcc145c16274032e0dde63b9 Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Sun, 22 Dec 2024 01:22:18 -0500 Subject: [PATCH 08/11] Fixed the tab code to add actual tab character and added the timestamp code (for non due date items) --- nullboard.html | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/nullboard.html b/nullboard.html index ff810cf..207eae3 100644 --- a/nullboard.html +++ b/nullboard.html @@ -4737,7 +4737,7 @@

Auto-backup

return false; } - // ctrl + D for auto date insert + // ctrl + d for auto due date insert (any date in the [] will update the note ui if past due -- defaults to today) if (isNote && ev.ctrlKey && ev.keyCode == '68') { var have = this.value; @@ -4747,7 +4747,17 @@

Auto-backup

return false; } - // ctrl + X to delete note + // ctrl + s for auto stamp date (stamps the current date and will not affect note ui if past due) + if (isNote && ev.ctrlKey && ev.keyCode == '83') + { + var have = this.value; + var want = new Date().toLocaleDateString() + ': ' + have; + $this.val(want); + this.selectionStart = this.selectionEnd = this.value.length; + return false; + } + + // ctrl + x to delete note if (isNote && ev.ctrlKey && ev.keyCode == '88') { stopEditing($this, false, false); @@ -4755,13 +4765,14 @@

Auto-backup

return false; } - // Alt/Option + Right to Indent + // alt/option + rightarrow to tab if (isNote && ev.altKey && ev.key == 'ArrowRight') { var have = this.value; - var want = have + ' '; //4 spaces is a TAB + var pos = this.selectionStart; + var want = have.substr(0, pos) + '\u0009' + have.substr(this.selectionEnd); $this.val(want); - this.selectionStart = this.selectionEnd = this.value.length; + this.selectionStart = this.selectionEnd = pos + 1; return false; } From 1ca14e88651385bc8be18808014a072d0d0f80e6 Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Wed, 8 Jan 2025 22:23:01 -0500 Subject: [PATCH 09/11] Add a strikethrough visual when in the done or complete lane --- nullboard.html | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/nullboard.html b/nullboard.html index 207eae3..64c845a 100644 --- a/nullboard.html +++ b/nullboard.html @@ -637,6 +637,10 @@ background-position: right; } + .board .note.strike { + text-decoration: line-through; + } + .board .note.collapsed .text, .note-dragster.collapsed .text { max-height: calc( var(--lh) * 1px ); @@ -3283,8 +3287,12 @@

Auto-backup

//remove the coloring if its in a list with "done" or "complete" var listTitle = $note.closest('.list, .head').find('.text').attr('_text'); - if (listTitle.toLowerCase().includes("done") || listTitle.toLowerCase().includes("complete")) - $note.removeClass('overdue') + if (listTitle.toLowerCase().includes("done") || listTitle.toLowerCase().includes("complete")){ + $note.removeClass('overdue'); + $note.addClass('strike'); + } + else + $note.removeClass('strike'); }); }); @@ -3394,8 +3402,10 @@

Auto-backup

if (new Date(todayDate).getTime() > new Date(noteDate).getTime()) $n.addClass('overdue'); //remove the coloring if its in a list with "done" or "complete" - if (list.title.toLowerCase().includes("done") || list.title.toLowerCase().includes("complete")) - $n.removeClass('overdue') + if (list.title.toLowerCase().includes("done") || list.title.toLowerCase().includes("complete")){ + $n.removeClass('overdue'); + $n.addClass('strike'); + } if (n.raw) $n.addClass('raw'); if (n.min) $n.addClass('collapsed'); From df39a7137830305eb0e232b4ac1c99db94d339bf Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Thu, 9 Jan 2025 10:45:54 -0500 Subject: [PATCH 10/11] Added menu for keyboard shortcuts --- nullboard.html | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/nullboard.html b/nullboard.html index 64c845a..90eabf2 100644 --- a/nullboard.html +++ b/nullboard.html @@ -1146,6 +1146,21 @@ padding-right: 10px; } + .overlay > div.keyboardshortcuts { + text-align: center; + padding: 50px 50px; + position: relative; + } + + .overlay > div.keyboardshortcuts div { + position: absolute; + bottom: -30px; + left: 0; + width: 100%; + color: #fff9; + } + + /***/ .overlay .backup-conf { @@ -1561,6 +1576,7 @@
About License + Keyboard Shortcuts Changes Github Twitter @@ -1676,6 +1692,24 @@

Nullboard

+ + +
@@ -5150,6 +5184,12 @@

Auto-backup

return false; }); + $('.view-keyboardshortcuts').click(function(){ + var $div = $('tt .keyboardshortcuts').clone(); + showOverlay($div); + return false; + }); + $('.view-license').click(function(){ var $div = $('tt .license').clone(); From aa73bf51d1acdac51acc349a9a32b012f20aef6e Mon Sep 17 00:00:00 2001 From: Dustin Sterkenburg Date: Thu, 9 Jan 2025 17:31:24 -0500 Subject: [PATCH 11/11] Add keyboard shortcut for links on mac to include command key. --- nullboard.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nullboard.html b/nullboard.html index 90eabf2..74d67a7 100644 --- a/nullboard.html +++ b/nullboard.html @@ -4260,7 +4260,7 @@

Auto-backup

function setRevealState(ev) { var raw = ev.originalEvent; - var do_reveal = raw.getModifierState && (raw.getModifierState( 'CapsLock' ) || raw.getModifierState( 'Control' )); + var do_reveal = raw.getModifierState && (raw.getModifierState( 'CapsLock' ) || raw.getModifierState( 'Control' ) || raw.getModifierState( 'Meta' )); if (do_reveal) $('body').addClass('reveal'); else $('body').removeClass('reveal');