Skip to content
Open
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
126 changes: 124 additions & 2 deletions nullboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,15 @@
padding-bottom: 6px;
}

.board .note.overdue {
background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgYmFzZVByb2ZpbGU9InRpbnkiIGhlaWdodD0iMjRweCIgaWQ9IkxheWVyXzEiIHZlcnNpb249IjEuMiIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PHBhdGggZD0iTTIxLjE3MSwxNS4zOThsLTUuOTEyLTkuODU0QzE0LjQ4Myw0LjI1MSwxMy4yOTYsMy41MTEsMTIsMy41MTFzLTIuNDgzLDAuNzQtMy4yNTksMi4wMzFsLTUuOTEyLDkuODU2ICBjLTAuNzg2LDEuMzA5LTAuODcyLDIuNzA1LTAuMjM1LDMuODNDMy4yMywyMC4zNTQsNC40NzIsMjEsNiwyMWgxMmMxLjUyOCwwLDIuNzctMC42NDYsMy40MDYtMS43NzEgIEMyMi4wNDMsMTguMTA0LDIxLjk1NywxNi43MDgsMjEuMTcxLDE1LjM5OHogTTEyLDE3LjU0OWMtMC44NTQsMC0xLjU1LTAuNjk1LTEuNTUtMS41NDljMC0wLjg1NSwwLjY5NS0xLjU1MSwxLjU1LTEuNTUxICBzMS41NSwwLjY5NiwxLjU1LDEuNTUxQzEzLjU1LDE2Ljg1NCwxMi44NTQsMTcuNTQ5LDEyLDE3LjU0OXogTTEzLjYzMywxMC4xMjVjLTAuMDExLDAuMDMxLTEuNDAxLDMuNDY4LTEuNDAxLDMuNDY4ICBjLTAuMDM4LDAuMDk0LTAuMTMsMC4xNTYtMC4yMzEsMC4xNTZzLTAuMTkzLTAuMDYyLTAuMjMxLTAuMTU2bC0xLjM5MS0zLjQzOEMxMC4yODksOS45MjIsMTAuMjUsOS43MTIsMTAuMjUsOS41ICBjMC0wLjk2NSwwLjc4NS0xLjc1LDEuNzUtMS43NXMxLjc1LDAuNzg1LDEuNzUsMS43NUMxMy43NSw5LjcxMiwxMy43MTEsOS45MjIsMTMuNjMzLDEwLjEyNXoiLz48L3N2Zz4=")no-repeat, linear-gradient(to right, #ffffff, #f5071f);
background-position: right;
}

.board .note.strike {
text-decoration: line-through;
}

.board .note.collapsed .text,
.note-dragster.collapsed .text {
max-height: calc( var(--lh) * 1px );
Expand Down Expand Up @@ -1137,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 {
Expand Down Expand Up @@ -1552,6 +1576,7 @@
<div class=bulk>
<a href=# class=view-about>About</a>
<a href=# class=view-license>License</a>
<a href=# class=view-keyboardshortcuts>Keyboard Shortcuts</a>
<a href=https://nullboard.io/changes target=_blank class=view-changes>Changes</a>
<a href=https://nullboard.io/github target=_blank>Github</a>
<a href=https://nullboard.io/twitter target=_blank>Twitter</a>
Expand Down Expand Up @@ -1667,6 +1692,24 @@ <h1>Nullboard</h1>
<div></div>
</div>

<div class=keyboardshortcuts>
<h1>Keyboard Shortcuts</h1>
<a href=#> [Tab] = Cycles through notes </a> <br>
<a href=#> [Control + Enter] = New note below </a> <br>
<a href=#> [Control + Shift + Enter] = Note above </a> <br>
<a href=#> [Control + D] = Due date stamp </a> <br>
<a href=#> [Control + S] = Date stamp </a> <br>
<a href=#> [Control + X] = Delete note </a> <br>
<a href=#> [Control + *] = • (Windows)</a> <br>
<a href=#> [Command + Shift + 8] = • (MacOS)</a> <br>
<a href=#> [Alt/Option + R] = Toggle raw mode </a> <br>
<a href=#> [Alt/Option + UpArrow] = Collapse </a> <br>
<a href=#> [Alt/Option + DownArrow] = Expand </a> <br>
<a href=#> [Alt/Option + RightArrow] = Indent </a> <br>
<a href=#> [Command] or [CapsLock] = Show links </a> <br>
</div>


<div class=license>
</div>

Expand Down Expand Up @@ -3270,6 +3313,20 @@ <h3>Auto-backup</h3>
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.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');

//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');
$note.addClass('strike');
}
else
$note.removeClass('strike');
});
});

Expand Down Expand Up @@ -3372,6 +3429,18 @@ <h3>Auto-backup</h3>
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.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');

//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');
$n.addClass('strike');
}

if (n.raw) $n.addClass('raw');
if (n.min) $n.addClass('collapsed');
$l_notes.append($n);
Expand Down Expand Up @@ -4157,6 +4226,14 @@ <h3>Auto-backup</h3>
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.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');
else
$item.removeClass('overdue');

updatePageTitle();
saveBoard();
}
Expand All @@ -4183,7 +4260,7 @@ <h3>Auto-backup</h3>
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');
Expand Down Expand Up @@ -4704,6 +4781,45 @@ <h3>Auto-backup</h3>
return false;
}

// 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;
var want = '[' + new Date().toLocaleDateString() + '] ' + have;
$this.val(want);
this.selectionStart = this.selectionEnd = this.value.length;
return false;
}

// 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);
deleteNote( $(this).closest('.note') );
return false;
}

// alt/option + rightarrow to tab
if (isNote && ev.altKey && ev.key == 'ArrowRight')
{
var have = this.value;
var pos = this.selectionStart;
var want = have.substr(0, pos) + '\u0009' + have.substr(this.selectionEnd);
$this.val(want);
this.selectionStart = this.selectionEnd = pos + 1;
return false;
}

// tab
if (ev.keyCode == 9)
{
Expand Down Expand Up @@ -4779,7 +4895,7 @@ <h3>Auto-backup</h3>
}

// 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;
Expand Down Expand Up @@ -5068,6 +5184,12 @@ <h3>Auto-backup</h3>
return false;
});

$('.view-keyboardshortcuts').click(function(){
var $div = $('tt .keyboardshortcuts').clone();
showOverlay($div);
return false;
});

$('.view-license').click(function(){

var $div = $('tt .license').clone();
Expand Down