From fef547f3cc977e93cee643322deb1dc8c1f01d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20BRY?= Date: Fri, 22 Sep 2023 11:30:23 +0200 Subject: [PATCH] Search task by command --- js/filters.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/filters.js b/js/filters.js index 13358a1..e3227cd 100644 --- a/js/filters.js +++ b/js/filters.js @@ -37,6 +37,11 @@ monetaFilters.filter('taskfilter', function ($filter) { return S(task.name).latinise().toLowerCase().contains(title); } + function match_command(task, command) + { + return S(task.command).latinise().toLowerCase().contains(command); + } + function xor(a,b) { return ( a || b ) && !( a && b ); @@ -74,6 +79,12 @@ monetaFilters.filter('taskfilter', function ($filter) { if (xor(negate, !match_title(task, item))) return; } + else if (item.lastIndexOf('command:', 0) === 0) + { + item = item.substr(8); + if (xor(negate, !match_command(task, item))) + return; + } else if (item.lastIndexOf('enabled:', 0) === 0) { item = item.substr(8);