diff --git a/public/js/add_content.js b/public/js/add_content.js index 4daef46b852189768efca1bca02fdfcc1b2d7f93..0af27c8ad1301dd64c2b3cadce4092bae7e12f9c 100644 --- a/public/js/add_content.js +++ b/public/js/add_content.js @@ -1,6 +1,8 @@ -var urlKeyword, urlParams; +var urlKeyword, urlAuthor, urlParams; urlParams = new URLSearchParams(window.location.search); urlKeyword = urlParams.get('keyword'); +urlAuthor = urlParams.get('author'); + function addcontent(item) { var lang_cont_person = "" var lang_keywords = "" @@ -8,9 +10,11 @@ function addcontent(item) { if (item === undefined) { - } else if (urlKeyword == null || (item.item.keywords.includes(urlKeyword))) { + } else if ((urlKeyword == null || item.item.keywords.includes(urlKeyword)) && + (urlAuthor == null || + item.item.author.firstName.toLowerCase().includes(urlAuthor.toLowerCase()) || + item.item.author.lastName.toLowerCase().includes(urlAuthor.toLowerCase()))) { - // Prepare YouTube Link // var array_contains_youtube = true