From 8b0c2cc066dafc27134d487a196ce4cf273345e2 Mon Sep 17 00:00:00 2001 From: kor Date: Fri, 10 Aug 2018 03:38:34 +1200 Subject: [PATCH] Add support tags with spaces by lcb931023. --- docs/content/data.ndtl | 2 +- docs/logic/view.js | 2 +- docs/logic/wrap.js | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/content/data.ndtl b/docs/content/data.ndtl index 4bf6c42..13e13f0 100644 --- a/docs/content/data.ndtl +++ b/docs/content/data.ndtl @@ -1709,7 +1709,7 @@ RANGITOTO FILE : 12018-07-19_wide.jpg TYPE : image WIDE : true - TAGS : log + TAGS : log, test test MQTT PERS : autophagy diff --git a/docs/logic/view.js b/docs/logic/view.js index 15fc2d1..5ab04bc 100644 --- a/docs/logic/view.js +++ b/docs/logic/view.js @@ -231,7 +231,7 @@ function View() entry += `
`; for (var i = 0; i < value.TAGS.length; i++) { - entry += `${value.TAGS[i]}`; + entry += `${value.TAGS[i]}`; if (i+1 != value.TAGS.length) { entry += `, `; diff --git a/docs/logic/wrap.js b/docs/logic/wrap.js index 4ee3409..6e0cd4a 100644 --- a/docs/logic/wrap.js +++ b/docs/logic/wrap.js @@ -76,6 +76,7 @@ function Wrap() if (splitTarget[0] == 'tag') { // TAG + var tagDecoded = decodeURI(splitTarget[1]); for (i = 0; i < this.keys.length; i++) { let value = this.database[this.keys[i]]; @@ -83,7 +84,7 @@ function Wrap() { for (var t = 0; t < value.TAGS.length; t++) { - if (value.TAGS[t] == splitTarget[1]) + if (value.TAGS[t] == tagDecoded) { tempDatabase[this.keys[i]] = this.database[this.keys[i]]; } @@ -94,13 +95,14 @@ function Wrap() else if (splitTarget[0] == 'type') { // TYPE + var tagDecoded = decodeURI(splitTarget[1]); var tempDatabase = {} for (i = 0; i < this.keys.length; i++) { let value = this.database[this.keys[i]]; if (typeof value.TYPE !== 'undefined') { - if (value.TYPE == splitTarget[1]) + if (value.TYPE == tagDecoded) { tempDatabase[this.keys[i]] = this.database[this.keys[i]]; }