mirror of
https://github.com/TangentFoxy/memex.git
synced 2024-11-22 04:54:23 +00:00
Refactoring.
This commit is contained in:
parent
6dba742ed0
commit
233a24b317
@ -4053,3 +4053,18 @@ ANTI-FRAGILITY
|
||||
> https://www.youtube.com/watch?v=uWYYbRxWS7Q&index=1&list=WL
|
||||
> https://en.wikipedia.org/wiki/Antifragility
|
||||
TAGS : antifragile
|
||||
|
||||
METAPHASES
|
||||
DATE : 12018-10-30
|
||||
TYPE : music
|
||||
AUTH : kodedninja
|
||||
LINK : https://0x22.bandcamp.com/album/metaphases
|
||||
TAGS : ambient, calm
|
||||
|
||||
ORKL
|
||||
DATE : 12018-10-29
|
||||
TYPE : tool
|
||||
AUTH : kodedninja
|
||||
LINK : https://github.com/kodedninja/orkl
|
||||
NOTE : reference for memex loading (spinner)
|
||||
TAGS : p2p, dat, blog
|
@ -78,14 +78,18 @@ function View()
|
||||
imgLoad.on( 'always', function() { parent.msnry.layout(); } );
|
||||
}
|
||||
|
||||
this.isDefined = function(value)
|
||||
{
|
||||
return (typeof value !== 'undefined');
|
||||
}
|
||||
|
||||
this.buildEntry = function(db, key)
|
||||
{
|
||||
let value = db[key];
|
||||
|
||||
let itemClass = "griditem";
|
||||
if (SETTINGS.WIDEGRIDITEM)
|
||||
{
|
||||
if (typeof value.WIDE !== 'undefined' && value.WIDE)
|
||||
if (this.isDefined(value.WIDE) && value.WIDE)
|
||||
{
|
||||
itemClass += " griditem-wide";
|
||||
}
|
||||
@ -100,7 +104,7 @@ function View()
|
||||
|
||||
if (SETTINGS.SHOWIMAG)
|
||||
{
|
||||
if (typeof value.TYPE !== 'undefined' && value.TYPE == 'image')
|
||||
if (this.isDefined(value.TYPE) && value.TYPE == 'image')
|
||||
{
|
||||
itemClass += " griditem-image";
|
||||
}
|
||||
@ -110,11 +114,10 @@ function View()
|
||||
|
||||
// ITEM DIV
|
||||
entry += `<div class="${itemClass}" id="${SETTINGS.GRIDITEMIDBASE + value.DIID}">`;
|
||||
|
||||
if (typeof value.LINK !== 'undefined')
|
||||
if (this.isDefined(value.LINK))
|
||||
{
|
||||
var idUrl = "url";
|
||||
if (typeof value.SEEN !== 'undefined')
|
||||
if (this.isDefined(value.SEEN))
|
||||
{
|
||||
if (value.SEEN == "true")
|
||||
{
|
||||
@ -147,7 +150,7 @@ function View()
|
||||
// LINK END
|
||||
if (SETTINGS.SHOWLINK)
|
||||
{
|
||||
if (typeof value.LINK !== 'undefined')
|
||||
if (this.isDefined(value.LINK))
|
||||
{
|
||||
if (typeof value.LINK == 'object')
|
||||
{
|
||||
@ -168,7 +171,7 @@ function View()
|
||||
if (SETTINGS.SHOWTYPE)
|
||||
{
|
||||
entry += `<div class="griditem-typecontainer">`;
|
||||
if (typeof value.TYPE !== 'undefined')
|
||||
if (this.isDefined(value.TYPE))
|
||||
{
|
||||
if (typeof value.TYPE == 'object')
|
||||
{
|
||||
@ -199,7 +202,7 @@ function View()
|
||||
// AUTHOR
|
||||
if (SETTINGS.SHOWAUTH)
|
||||
{
|
||||
if (typeof value.AUTH !== 'undefined')
|
||||
if (this.isDefined(value.AUTH))
|
||||
{
|
||||
entry += `<div class="griditem-auth"><i class="fas fa-user textIcon"></i>${value.AUTH}</div>`;
|
||||
}
|
||||
@ -208,7 +211,7 @@ function View()
|
||||
// TAGS
|
||||
if (SETTINGS.SHOWTAGS)
|
||||
{
|
||||
if (typeof value.TAGS !== 'undefined')
|
||||
if (this.isDefined(value.TAGS))
|
||||
{
|
||||
entry += `<div class="griditem-tags"><i class="fas fa-tag textIcon"></i>`;
|
||||
for (var i = 0; i < value.TAGS.length; i++)
|
||||
@ -224,9 +227,9 @@ function View()
|
||||
}
|
||||
|
||||
// PROJECT
|
||||
{
|
||||
if (SETTINGS.SHOWPROJ)
|
||||
if (typeof value.PROJ !== 'undefined')
|
||||
{
|
||||
if (this.isDefined(value.PROJ))
|
||||
{
|
||||
entry += `<div class="griditem-proj"><i class="fas fa-leaf textIcon"></i>`;
|
||||
for (var i = 0; i < value.PROJ.length; i++)
|
||||
@ -244,7 +247,7 @@ function View()
|
||||
// TERM
|
||||
if (SETTINGS.SHOWTERM)
|
||||
{
|
||||
if (typeof value.TERM !== 'undefined')
|
||||
if (this.isDefined(value.TERM))
|
||||
{
|
||||
entry += this.buildArrayElement(value.TERM, "griditem-term", "fas fa-ribbon textIcon");
|
||||
}
|
||||
@ -253,7 +256,7 @@ function View()
|
||||
// NOTE
|
||||
if (SETTINGS.SHOWNOTE)
|
||||
{
|
||||
if (typeof value.NOTE !== 'undefined')
|
||||
if (this.isDefined(value.NOTE))
|
||||
{
|
||||
entry += this.buildArrayElement(value.NOTE, "griditem-note", "fas fa-sticky-note textIcon");
|
||||
}
|
||||
@ -262,7 +265,7 @@ function View()
|
||||
// QUOTE
|
||||
if (SETTINGS.SHOWQOTE)
|
||||
{
|
||||
if (typeof value.QOTE !== 'undefined')
|
||||
if (this.isDefined(value.QOTE))
|
||||
{
|
||||
entry += this.buildArrayElement(value.QOTE, "griditem-quote", "fas fa-comment textIcon");
|
||||
}
|
||||
@ -271,7 +274,7 @@ function View()
|
||||
// PROGRESS
|
||||
if (SETTINGS.SHOWPROG)
|
||||
{
|
||||
if (typeof value.PROG !== 'undefined')
|
||||
if (this.isDefined(value.PROG))
|
||||
{
|
||||
entry += `<div class="griditem-prog"><i class="fas fa-clock textIcon"></i>${value.PROG}</div>`;
|
||||
}
|
||||
@ -284,9 +287,9 @@ function View()
|
||||
// IMAGE
|
||||
if (SETTINGS.SHOWIMAG)
|
||||
{
|
||||
if (typeof value.TYPE !== 'undefined' && value.TYPE == 'image')
|
||||
if (this.isDefined(value.TYPE) && value.TYPE == 'image')
|
||||
{
|
||||
if (typeof value.FILE !== 'undefined')
|
||||
if (this.isDefined(value.FILE))
|
||||
{
|
||||
entry += `<div class="image">`;
|
||||
if (SETTINGS.SHOWOVERLAY)
|
||||
@ -307,57 +310,47 @@ function View()
|
||||
this.doTypeIcon = function(type, count)
|
||||
{
|
||||
let result = `<a class="griditem-type" href='#type-${String(type)}'>`;
|
||||
if (type == 'article')
|
||||
switch (type)
|
||||
{
|
||||
case 'article':
|
||||
result += `<i class="griditem-typeicon far fa-newspaper"></i>`;
|
||||
}
|
||||
else if (type == 'podcast')
|
||||
{
|
||||
break;
|
||||
case 'podcast':
|
||||
result += `<i class="griditem-typeicon fas fa-podcast"></i>`;
|
||||
}
|
||||
else if (type == 'video')
|
||||
{
|
||||
break;
|
||||
case 'video':
|
||||
result += `<i class="griditem-typeicon fas fa-tv"></i>`;
|
||||
}
|
||||
else if (type == 'list')
|
||||
{
|
||||
break;
|
||||
case 'list':
|
||||
result += `<i class="griditem-typeicon fas fa-file-alt"></i>`;
|
||||
}
|
||||
else if (type == 'book')
|
||||
{
|
||||
break;
|
||||
case 'book':
|
||||
result += `<i class="griditem-typeicon fas fa-book-open"></i>`;
|
||||
}
|
||||
else if (type == 'game')
|
||||
{
|
||||
break;
|
||||
case 'game':
|
||||
result += `<i class="griditem-typeicon fas fa-gamepad"></i>`;
|
||||
}
|
||||
else if (type == 'service')
|
||||
{
|
||||
break;
|
||||
case 'service':
|
||||
result += `<i class="griditem-typeicon fas fa-server"></i>`;
|
||||
}
|
||||
else if (type == 'lecture')
|
||||
{
|
||||
break;
|
||||
case 'lecture':
|
||||
result += `<i class="griditem-typeicon fas fa-chalkboard-teacher"></i>`;
|
||||
}
|
||||
else if (type == 'quote')
|
||||
{
|
||||
break;
|
||||
case 'quote':
|
||||
result += `<i class="griditem-typeicon fas fa-comment"></i>`;
|
||||
}
|
||||
else if (type == 'tool')
|
||||
{
|
||||
break;
|
||||
case 'tool':
|
||||
result += `<i class="griditem-typeicon fas fa-wrench"></i>`;
|
||||
}
|
||||
else if (type == 'music')
|
||||
{
|
||||
break;
|
||||
case 'music':
|
||||
result += `<i class="griditem-typeicon fas fa-music"></i>`;
|
||||
}
|
||||
else if (type == 'image')
|
||||
{
|
||||
break;
|
||||
case 'image':
|
||||
result += `<i class="griditem-typeicon fas fa-image"></i>`;
|
||||
}
|
||||
else if (type == 'encyclopedia')
|
||||
{
|
||||
break;
|
||||
case 'encyclopedia':
|
||||
result += `<i class="griditem-typeicon fas fa-globe"></i>`;
|
||||
break;
|
||||
}
|
||||
result += `</a>`;
|
||||
return result;
|
||||
|
@ -34,7 +34,6 @@ function Wrap()
|
||||
|
||||
this.database[this.keys[i]].DIID = i;
|
||||
}
|
||||
console.log(this.database);
|
||||
}
|
||||
|
||||
this.filter = function(target)
|
||||
|
Loading…
Reference in New Issue
Block a user