Add handling and display of project field for entries.

This commit is contained in:
kor 2018-10-30 02:45:34 +13:00
parent 6fe4747acb
commit 6dba742ed0
4 changed files with 52 additions and 11 deletions

View File

@ -388,7 +388,7 @@ body {
}
/* NOTE, QUOTE, TERM, TAGS, AUTH, PROG */
.griditem-note, .griditem-quote, .griditem-term, .griditem-tags, .griditem-auth, .griditem-prog {
.griditem-note, .griditem-quote, .griditem-term, .griditem-tags, .griditem-proj, .griditem-auth, .griditem-prog {
opacity: var(--alpha-idle);
padding-top: var(--size-item-elem-padding);
color: var(--color-item);
@ -400,6 +400,7 @@ body {
.griditem:hover .griditem-quote,
.griditem:hover .griditem-term,
.griditem:hover .griditem-tags,
.griditem:hover .griditem-proj,
.griditem:hover .griditem-auth,
.griditem:hover .griditem-prog {
opacity: var(--alpha-enabled);
@ -410,6 +411,7 @@ body {
.griditem-image .griditem-quote,
.griditem-image .griditem-term,
.griditem-image .griditem-tags,
.griditem-image .griditem-proj,
.griditem-image .griditem-auth,
.griditem-image .griditem-prog {
color: var(--color-image);

View File

@ -3872,7 +3872,6 @@ WHY WATER BATTERIES
SBS 100F
DATE : 12018-10-22
TYPE : list
NOTE
> Recommended operating temperature range for optimum life and performance is 20°C to 25°C
- On constant voltage float charge systems the design life expectancy is 10+ years at 25°C and 15+ years at 20°C
@ -3964,6 +3963,7 @@ LUGS (TERMINALS)
TRACER BN COMMS
DATE : 12018-10-23
TYPE : tool
LINK
> https://github.com/danieloneill/EpsolarServer
> https://github.com/jaminNZx/Tracer-RS485-Modbus-Blynk
@ -4010,6 +4010,7 @@ VAN ELECTRICAL GUIDES
> https://www.parkedinparadise.com/electrical/
PROJ : Van
TAGS : electronics
TYPE : list
BATTERY BANK WIRING
LINK : http://www.smartgauge.co.uk/batt_con.html

View File

@ -20,6 +20,7 @@ function View()
SHOWLINK: true,
SHOWLOWER: true,
SHOWTAGS: true,
SHOWPROJ: true,
SHOWNOTE: true,
SHOWQOTE: true,
SHOWTERM: true,
@ -213,7 +214,25 @@ function View()
for (var i = 0; i < value.TAGS.length; i++)
{
entry += `<a class="griditem-taglink" href="#tag-${value.TAGS[i]}">${value.TAGS[i]}</a>`;
if (i+1 != value.TAGS.length)
if (i + 1 != value.TAGS.length)
{
entry += `, `;
}
};
entry += `</div>`;
}
}
// PROJECT
{
if (SETTINGS.SHOWPROJ)
if (typeof value.PROJ !== 'undefined')
{
entry += `<div class="griditem-proj"><i class="fas fa-leaf textIcon"></i>`;
for (var i = 0; i < value.PROJ.length; i++)
{
entry += `<a class="griditem-taglink" href="#proj-${value.PROJ[i]}">${value.PROJ[i]}</a>`;
if (i + 1 != value.PROJ.length)
{
entry += `, `;
}

View File

@ -61,15 +61,34 @@ function Wrap()
if (splitTarget[0] == 'tag')
{
// TAG
var tagDecoded = decodeURI(splitTarget[1]);
for (i = 0; i < this.keys.length; i++)
let tagRequest = decodeURI(splitTarget[1]);
for (let i = 0; i < this.keys.length; i++)
{
let value = this.database[this.keys[i]];
if (typeof value.TAGS !== 'undefined')
{
for (var t = 0; t < value.TAGS.length; t++)
for (let t = 0; t < value.TAGS.length; t++)
{
if (value.TAGS[t] == tagDecoded)
if (value.TAGS[t] == tagRequest)
{
tempDatabase[this.keys[i]] = this.database[this.keys[i]];
}
}
}
}
}
if (splitTarget[0] == 'proj')
{
// PROJECT
let projectRequest = decodeURI(splitTarget[1]);
for (let i = 0; i < this.keys.length; i++)
{
let value = this.database[this.keys[i]];
if (typeof value.PROJ !== 'undefined')
{
for (let p = 0; p < value.PROJ.length; p++)
{
if (value.PROJ[p] == projectRequest)
{
tempDatabase[this.keys[i]] = this.database[this.keys[i]];
}
@ -80,8 +99,8 @@ function Wrap()
else if (splitTarget[0] == 'type')
{
// TYPE
var typeRequest = decodeURI(splitTarget[1]);
for (i = 0; i < this.keys.length; i++)
let typeRequest = decodeURI(splitTarget[1]);
for (let i = 0; i < this.keys.length; i++)
{
let value = this.database[this.keys[i]];
if (typeof value.TYPE !== 'undefined')
@ -111,8 +130,8 @@ function Wrap()
else if (splitTarget[0] == 'done')
{
// DONE
var doneValue = decodeURI(splitTarget[1]);
for (i = 0; i < this.keys.length; i++)
let doneValue = decodeURI(splitTarget[1]);
for (let i = 0; i < this.keys.length; i++)
{
let value = this.database[this.keys[i]];
if (doneValue == 'true')