diff --git a/docs/content/data.ndtl b/docs/content/data.ndtl index e18d934..42ab377 100644 --- a/docs/content/data.ndtl +++ b/docs/content/data.ndtl @@ -4052,4 +4052,19 @@ ANTI-FRAGILITY LINK > https://www.youtube.com/watch?v=uWYYbRxWS7Q&index=1&list=WL > https://en.wikipedia.org/wiki/Antifragility - TAGS : antifragile \ No newline at end of file + 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 \ No newline at end of file diff --git a/docs/logic/view.js b/docs/logic/view.js index 3e5ceb0..bc6f370 100644 --- a/docs/logic/view.js +++ b/docs/logic/view.js @@ -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 += `
`; - - 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,22 +171,22 @@ function View() if (SETTINGS.SHOWTYPE) { entry += `
`; - if (typeof value.TYPE !== 'undefined') + if (this.isDefined(value.TYPE)) + { + if (typeof value.TYPE == 'object') { - if (typeof value.TYPE == 'object') + // This entry has an array of types + for (var i = 0; i < value.TYPE.length; i++) { - // This entry has an array of types - for (var i = 0; i < value.TYPE.length; i++) - { - entry += this.doTypeIcon(value.TYPE[i]); - } - } - else - { - // This entry has a single type entry += this.doTypeIcon(value.TYPE[i]); } } + else + { + // This entry has a single type + entry += this.doTypeIcon(value.TYPE[i]); + } + } entry += `
`; //griditem-typecontainer } @@ -199,7 +202,7 @@ function View() // AUTHOR if (SETTINGS.SHOWAUTH) { - if (typeof value.AUTH !== 'undefined') + if (this.isDefined(value.AUTH)) { entry += `
${value.AUTH}
`; } @@ -208,7 +211,7 @@ function View() // TAGS if (SETTINGS.SHOWTAGS) { - if (typeof value.TAGS !== 'undefined') + if (this.isDefined(value.TAGS)) { entry += `
`; 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 += `
`; 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 += `
${value.PROG}
`; } @@ -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 += `
`; if (SETTINGS.SHOWOVERLAY) @@ -307,57 +310,47 @@ function View() this.doTypeIcon = function(type, count) { let result = ``; - if (type == 'article') + switch (type) { - result += ``; - } - else if (type == 'podcast') - { - result += ``; - } - else if (type == 'video') - { - result += ``; - } - else if (type == 'list') - { - result += ``; - } - else if (type == 'book') - { - result += ``; - } - else if (type == 'game') - { - result += ``; - } - else if (type == 'service') - { - result += ``; - } - else if (type == 'lecture') - { - result += ``; - } - else if (type == 'quote') - { - result += ``; - } - else if (type == 'tool') - { - result += ``; - } - else if (type == 'music') - { - result += ``; - } - else if (type == 'image') - { - result += ``; - } - else if (type == 'encyclopedia') - { - result += ``; + case 'article': + result += ``; + break; + case 'podcast': + result += ``; + break; + case 'video': + result += ``; + break; + case 'list': + result += ``; + break; + case 'book': + result += ``; + break; + case 'game': + result += ``; + break; + case 'service': + result += ``; + break; + case 'lecture': + result += ``; + break; + case 'quote': + result += ``; + break; + case 'tool': + result += ``; + break; + case 'music': + result += ``; + break; + case 'image': + result += ``; + break; + case 'encyclopedia': + result += ``; + break; } result += ``; return result; diff --git a/docs/logic/wrap.js b/docs/logic/wrap.js index 1bee90b..f35b114 100644 --- a/docs/logic/wrap.js +++ b/docs/logic/wrap.js @@ -34,7 +34,6 @@ function Wrap() this.database[this.keys[i]].DIID = i; } - console.log(this.database); } this.filter = function(target)