From: Banana Date: Sun, 31 Jan 2021 16:14:11 +0000 (+0100) Subject: fixing bug #3 X-Git-Tag: 1.1~20 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=0f3541a116e2f126d2ae6dff4e1f10c3b807e6f6;p=bibliotheca-php.git fixing bug #3 --- 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; +}