Add date to entries.

This commit is contained in:
kor 2018-11-03 20:23:26 +13:00
parent 438acf0fd1
commit e8855ff976
4 changed files with 23 additions and 13 deletions

View File

@ -474,6 +474,7 @@ article:hover .griditem-type {
} }
/* NOTE, QUOTE, TERM, TAGS, AUTH, PROG */ /* NOTE, QUOTE, TERM, TAGS, AUTH, PROG */
.griditem-date,
.griditem-note, .griditem-note,
.griditem-quote, .griditem-quote,
.griditem-term, .griditem-term,
@ -489,6 +490,7 @@ article:hover .griditem-type {
float: left; float: left;
clear: both; clear: both;
} }
article:hover .griditem-date,
article:hover .griditem-note, article:hover .griditem-note,
article:hover .griditem-quote, article:hover .griditem-quote,
article:hover .griditem-term, article:hover .griditem-term,
@ -501,6 +503,7 @@ article:hover .griditem-prog {
color: var(--color-item); color: var(--color-item);
} }
.griditem-image .griditem-link, .griditem-image .griditem-link,
.griditem-image .griditem-date,
.griditem-image .griditem-note, .griditem-image .griditem-note,
.griditem-image .griditem-quote, .griditem-image .griditem-quote,
.griditem-image .griditem-term, .griditem-image .griditem-term,

View File

@ -9,6 +9,7 @@ const SETTINGS =
GRIDITEMIDBASE: 'item', GRIDITEMIDBASE: 'item',
SHOWUPPER: true, SHOWUPPER: true,
SHOWTITLE: true, SHOWTITLE: true,
SHOWDATE: true,
SHOWAUTH: true, SHOWAUTH: true,
SHOWTYPE: true, SHOWTYPE: true,
SHOWLINK: true, SHOWLINK: true,

View File

@ -179,6 +179,12 @@ function View()
} }
entry += `<div class="${lowerClass}" ${onclickImage}>`; entry += `<div class="${lowerClass}" ${onclickImage}>`;
// TIME
if (SETTINGS.SHOWDATE && this.isDefined(value.DATE))
{
entry += `<time class="griditem-date"><i title="date" class="fas fa-clock textIcon"></i>${value.DATE}</time>`;
}
// AUTHOR // AUTHOR
if (SETTINGS.SHOWAUTH && this.isDefined(value.AUTH)) if (SETTINGS.SHOWAUTH && this.isDefined(value.AUTH))
{ {

View File

@ -14,33 +14,33 @@ function Wrap()
{ {
for (let i = 0; i < this.keys.length; i++) for (let i = 0; i < this.keys.length; i++)
{ {
let value = this.database[this.keys[i]]; let entry = this.database[this.keys[i]];
this.database[this.keys[i]].AUTH = this.commaSplit(value.AUTH); entry.AUTH = this.commaSplit(entry.AUTH);
this.database[this.keys[i]].TAGS = this.commaSplit(value.TAGS); entry.TAGS = this.commaSplit(entry.TAGS);
this.database[this.keys[i]].TYPE = this.commaSplit(value.TYPE); entry.TYPE = this.commaSplit(entry.TYPE);
this.database[this.keys[i]].PROJ = this.commaSplit(value.PROJ); entry.PROJ = this.commaSplit(entry.PROJ);
// LINK // LINK
if (typeof value.LINK == 'object') if (typeof entry.LINK == 'object')
{ {
for (let l = 0; l < value.LINK.length; l++) for (let l = 0; l < entry.LINK.length; l++)
{ {
if (value.LINK[l].substr(0,2) == '> ') if (entry.LINK[l].substr(0,2) == '> ')
{ {
value.LINK[l] = value.LINK[l].substr(2,value.LINK[l].length-1); entry.LINK[l] = entry.LINK[l].substr(2,entry.LINK[l].length-1);
} }
} }
} }
// FILE // FILE
if (typeof value.FILE == 'object') if (typeof entry.FILE == 'object')
{ {
for (let f = 0; f < value.FILE.length; f++) for (let f = 0; f < entry.FILE.length; f++)
{ {
if (value.FILE[f].substr(0,2) == '> ') if (entry.FILE[f].substr(0,2) == '> ')
{ {
value.FILE[f] = value.FILE[f].substr(2,value.FILE[f].length-1); entry.FILE[f] = entry.FILE[f].substr(2,entry.FILE[f].length-1);
} }
} }
} }