From f0dcabe6b8a3ca1c994ba0d1b508bc8228363bb7 Mon Sep 17 00:00:00 2001 From: inportb Date: Mon, 1 May 2023 17:19:52 -0400 Subject: [PATCH] Improved unmarked tag detection --- htdocs/ViewSchedule.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/ViewSchedule.vue b/htdocs/ViewSchedule.vue index 07da916..c29aff6 100644 --- a/htdocs/ViewSchedule.vue +++ b/htdocs/ViewSchedule.vue @@ -97,14 +97,19 @@ methods: { strHashHSL, gettags(row) { - var res = {}, matches; + var res = {}, re, matches; if((row.RESOURCENAME) && (matches = row.RESOURCENAME.replace(/\W+/g, '-').replace(/^-+|-+$/g, ''))) res[matches.toLowerCase()] = matches; if(row.WALKIN != '0') res['walkin'] = 'WALKIN'; if(row.CANCELLED != '0') res['cancelled'] = 'CANCELLED'; else if(row.NOSHOW != '0') res['noshow'] = 'NOSHOW'; else if(row.CHECKOUT) res['checkedout'] = 'CHECKEDOUT'; else if(row.CHECKIN) res['checkedin'] = 'CHECKEDIN'; - if((row.NOTE) && (matches = row.NOTE.match(/#[0-9a-z][\w-]*/gi))) matches.reduce((acc, val) => (acc[val.substring(1).toLowerCase()] = val.substring(1), acc), res); + if(row.NOTE) { + re = /#([0-9a-z][\w-]*)/gi; + while(matches = re.exec(row.NOTE)) res[matches[1].toLowerCase()] = matches[1]; + re = /Dr[\.\s]*\b([a-z][\w-]*)/gi; + while(matches = re.exec(row.NOTE)) res[matches[1].toLowerCase()] = matches[1]; + } return res; }, filter_conj(tags) {