Add entry's file link display.

This commit is contained in:
kor 2018-10-30 03:41:42 +13:00
parent 9140181553
commit 83f54dc2db
3 changed files with 53 additions and 1 deletions

View File

@ -388,13 +388,21 @@ body {
} }
/* NOTE, QUOTE, TERM, TAGS, AUTH, PROG */ /* NOTE, QUOTE, TERM, TAGS, AUTH, PROG */
.griditem-note, .griditem-quote, .griditem-term, .griditem-tags, .griditem-proj, .griditem-auth, .griditem-prog { .griditem-note,
.griditem-quote,
.griditem-term,
.griditem-tags,
.griditem-proj,
.griditem-auth,
.griditem-file,
.griditem-prog {
opacity: var(--alpha-idle); opacity: var(--alpha-idle);
padding-top: var(--size-item-elem-padding); padding-top: var(--size-item-elem-padding);
color: var(--color-item); color: var(--color-item);
font-size: var(--size-font-body); font-size: var(--size-font-body);
float: left; float: left;
clear: both; clear: both;
word-break:break-all;
} }
.griditem:hover .griditem-note, .griditem:hover .griditem-note,
.griditem:hover .griditem-quote, .griditem:hover .griditem-quote,
@ -402,6 +410,7 @@ body {
.griditem:hover .griditem-tags, .griditem:hover .griditem-tags,
.griditem:hover .griditem-proj, .griditem:hover .griditem-proj,
.griditem:hover .griditem-auth, .griditem:hover .griditem-auth,
.griditem:hover .griditem-file,
.griditem:hover .griditem-prog { .griditem:hover .griditem-prog {
opacity: var(--alpha-enabled); opacity: var(--alpha-enabled);
color: var(--color-item); color: var(--color-item);
@ -413,10 +422,20 @@ body {
.griditem-image .griditem-tags, .griditem-image .griditem-tags,
.griditem-image .griditem-proj, .griditem-image .griditem-proj,
.griditem-image .griditem-auth, .griditem-image .griditem-auth,
.griditem-image .griditem-file,
.griditem-image .griditem-prog { .griditem-image .griditem-prog {
color: var(--color-image); color: var(--color-image);
} }
.griditem-file-link {
color: var(--color-item);
text-decoration: none;
}
.griditem-file-link:hover {
text-decoration: underline;
}
/* IMAGE */ /* IMAGE */
.griditem-image .griditem-containerlower { .griditem-image .griditem-containerlower {
display: none; display: none;

View File

@ -26,6 +26,7 @@ function View()
SHOWTERM: true, SHOWTERM: true,
SHOWPROG: true, SHOWPROG: true,
SHOWIMAG: true, SHOWIMAG: true,
SHOWFILE: true,
SHOWOVERLAY: true SHOWOVERLAY: true
} }
@ -280,6 +281,26 @@ function View()
} }
} }
// FILE
if (SETTINGS.SHOWFILE)
{
if (this.isDefined(value.FILE))
{
if (typeof value.FILE == 'object')
{
for (var i = 0; i < value.FILE.length; i++)
{
entry += `<div class="griditem-file"><i class="fas fa-folder-open textIcon"></i><a class="griditem-file-link" href="content/media/${value.FILE[i]}">${value.FILE[i]}</a></div>`;
}
}
else
{
// single
entry += `<div class="griditem-file"><i class="fas fa-folder-open textIcon"></i><a class="griditem-file-link" href="content/media/${value.FILE}">${value.FILE}</a></div>`;
}
}
}
// LOWER CONTENT END // LOWER CONTENT END
entry += `</div>`; entry += `</div>`;
} }

View File

@ -32,6 +32,18 @@ function Wrap()
} }
} }
// FILE
if (typeof value.FILE == 'object')
{
for (let f = 0; f < value.FILE.length; f++)
{
if (value.FILE[f].substr(0,2) == '> ')
{
value.FILE[f] = value.FILE[f].substr(2,value.FILE[f].length-1);
}
}
}
this.database[this.keys[i]].DIID = i; this.database[this.keys[i]].DIID = i;
} }
} }