From 0f3541a116e2f126d2ae6dff4e1f10c3b807e6f6 Mon Sep 17 00:00:00 2001 From: Banana Date: Sun, 31 Jan 2021 17:14:11 +0100 Subject: [PATCH] fixing bug #3 --- CHANGELOG | 1 + TODO | 2 +- webclient/view/default/ui/js/suggest-tag.js | 19 ++++++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index db4913f..c16af1d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ * IMDB Tool. Order of save to field now A-Z * Documentation for tools * Documentation for tool imdbweb grabber. Default config added. + * Fixed bug #3 1.0 - Castle 20210106 * First usable version diff --git a/TODO b/TODO index 90acd52..3fa8dee 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,7 @@ * Mass edit of entries * User and groupmanagement: Check where a user or group is used! * Better error handling and display while adding / update and delete -* stats overview page. amount of entries. file and db storage. Version info and where to find it. +* stats overview page. amount of entries. file / cache and db storage. Version info and where to find it. * Export of an entry, collection or everything. Stored on disk. * Import of the export diff --git a/webclient/view/default/ui/js/suggest-tag.js b/webclient/view/default/ui/js/suggest-tag.js index 6f5cc7c..24b3912 100644 --- a/webclient/view/default/ui/js/suggest-tag.js +++ b/webclient/view/default/ui/js/suggest-tag.js @@ -34,7 +34,9 @@ function addTag(e,targetStartString) { let listBox = document.getElementById(targetStartString + '-listbox'); let newTagTemplate = document.getElementById(targetStartString + '-template'); - if(saveInput && listBox && elem && newTagTemplate) { + let checkString = _checkForSpaceString(elem.value,'nospace'); + + if(saveInput && listBox && elem && newTagTemplate && checkString) { let toAdd = elem.value; let newSaveValue = _appendToCommaString(saveInput.value,toAdd); @@ -135,3 +137,18 @@ function _fillTagTemplate(el,newTagString,targetStartString) { return el; } + +/** + * simple check if the string is empty or contains whitespace chars + * + * @param string + * @returns boolean + * @private + */ +function _checkForSpaceString(stringTocheck) { + let check = stringTocheck.replace(/\s/gm,''); + if(check === stringTocheck && check.length > 0) { + return true; + } + return false; +} -- 2.39.5