From a0dfbbb8910e7873c6f72932bb04ced828955180 Mon Sep 17 00:00:00 2001 From: joe-mac-m3 <thunyathep.s@outlook.com> Date: Tue, 20 May 2025 11:51:50 +0200 Subject: [PATCH] add filter --- public/js/add_content.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/js/add_content.js b/public/js/add_content.js index 4daef46..0af27c8 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 -- GitLab