From 119497bb01e9b0aec37a7929e77a699e7ed2731c Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Sun, 24 Oct 2021 22:27:52 +0200 Subject: [PATCH] added winix_frame_is ezc winix function --- winixd/templates/templates.cpp | 1 + winixd/templates/templates.h | 1 + winixd/templates/winix.cpp | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/winixd/templates/templates.cpp b/winixd/templates/templates.cpp index e36971b..7fd853d 100644 --- a/winixd/templates/templates.cpp +++ b/winixd/templates/templates.cpp @@ -644,6 +644,7 @@ void Templates::CreateFunctions() ezc_functions.Insert("winix_locale_tab_id", winix_locale_tab_id); ezc_functions.Insert("winix_locale_tab_name", winix_locale_tab_name); ezc_functions.Insert("winix_is_htmx_request", winix_is_htmx_request); + ezc_functions.Insert("winix_frame_is", winix_frame_is); ezc_functions.Insert("lang", lang); diff --git a/winixd/templates/templates.h b/winixd/templates/templates.h index 0eda625..ef9e293 100644 --- a/winixd/templates/templates.h +++ b/winixd/templates/templates.h @@ -537,6 +537,7 @@ namespace TemplatesFunctions void winix_locale_tab_id(Info & i); void winix_locale_tab_name(Info & i); void winix_is_htmx_request(Info & i); + void winix_frame_is(Info & i); void lang(Info & i); // defined in winix.cpp - MOVE ME to a better place diff --git a/winixd/templates/winix.cpp b/winixd/templates/winix.cpp index fcaf57b..baf7141 100644 --- a/winixd/templates/winix.cpp +++ b/winixd/templates/winix.cpp @@ -381,6 +381,12 @@ void winix_is_htmx_request(Info & i) } +void winix_frame_is(Info & i) +{ + i.res = cur->request->frame == i.par; +} + + void lang(Info & i) { i.res = !i.par.empty();