From 90f7b91466da9e0c4d70036fcf880ffad9f28e26 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Tue, 20 Aug 2024 22:31:51 +0200 Subject: [PATCH] Delete web/rules/public/js/main.js --- web/rules/public/js/main.js | 47 ------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 web/rules/public/js/main.js diff --git a/web/rules/public/js/main.js b/web/rules/public/js/main.js deleted file mode 100644 index e93a1539a..000000000 --- a/web/rules/public/js/main.js +++ /dev/null @@ -1,47 +0,0 @@ -$(document).ready(function() { - - $('.metadata-values').hide(); - - $('#metadataSelect').change(function() { - $('.metadata-values').hide(); - const selectedMetadata = $(this).val(); - $('#' + selectedMetadata + 'Values').show(); - }); - - $('#searchButton').click(function() { - const selectedMetadata = $('#metadataSelect').val(); - const selectedValueDropdownId = selectedMetadata + 'Values'; - const selectedValue = $('#' + selectedValueDropdownId).val(); - - console.log(`Filtering on [${selectedMetadata}] with value [${selectedValue}]`); - - $('.rule-card').hide(); - - if (selectedMetadata && selectedValue) { - - if (selectedMetadata === 'author') { - - $('.rule-card').each(function() { - - const authorContent = $(this).find('.card-author').text(); - if (authorContent.includes(selectedValue)) { - $(this).show(); - } - }); - - } else if (selectedMetadata === "namespace") { - $(`.rule-card[data-${selectedMetadata}^="${selectedValue}"]`).show(); - - } else if (selectedMetadata === "mbc") { - $(`.rule-card[data-${selectedMetadata}*="${selectedValue}"]`).show(); - } else if (selectedMetadata === "attck") { - $(`.rule-card[data-attck*="${selectedValue}"]`).show(); - } else { - $(`.rule-card[data-${selectedMetadata}="${selectedValue}"]`).show(); - } - - } else { - $('.rule-card').show(); - } -}); -});