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 */
.griditem-date,
.griditem-note,
.griditem-quote,
.griditem-term,
@ -489,6 +490,7 @@ article:hover .griditem-type {
float: left;
clear: both;
}
article:hover .griditem-date,
article:hover .griditem-note,
article:hover .griditem-quote,
article:hover .griditem-term,
@ -501,6 +503,7 @@ article:hover .griditem-prog {
color: var(--color-item);
}
.griditem-image .griditem-link,
.griditem-image .griditem-date,
.griditem-image .griditem-note,
.griditem-image .griditem-quote,
.griditem-image .griditem-term,

View File

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

View File

@ -179,6 +179,12 @@ function View()
}
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
if (SETTINGS.SHOWAUTH && this.isDefined(value.AUTH))
{

View File

@ -14,33 +14,33 @@ function Wrap()
{
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);
this.database[this.keys[i]].TAGS = this.commaSplit(value.TAGS);
this.database[this.keys[i]].TYPE = this.commaSplit(value.TYPE);
this.database[this.keys[i]].PROJ = this.commaSplit(value.PROJ);
entry.AUTH = this.commaSplit(entry.AUTH);
entry.TAGS = this.commaSplit(entry.TAGS);
entry.TYPE = this.commaSplit(entry.TYPE);
entry.PROJ = this.commaSplit(entry.PROJ);
// 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
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);
}
}
}