From 7926ae66946e7cd10e84aa539b5a0e29d7a5a78a Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 21 Dec 2025 18:51:28 -0500 Subject: [PATCH] Update samy.ps1 --- samy.ps1 | 54 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/samy.ps1 b/samy.ps1 index ed6d9ec..3caa9dd 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -843,27 +843,51 @@ $Global:SamyTasks | ForEach-Object { $html = " $labelText" if ($_.SubOptions) { - $subHtml = ( - $_.SubOptions | - ForEach-Object { - $subLabel = Escape-HtmlText ([string]$_.Label) - $subTaskIdClass = Escape-HtmlAttr ([string]$taskId) - $subValueAttr = Escape-HtmlAttr ([string]$_.Value) + $subHtml = ( + $_.SubOptions | ForEach-Object { - "" + $type = if ($_.PSObject.Properties.Name -contains 'Type' -and $_.Type) { + [string]$_.Type + } else { + 'checkbox' + } - } - ) -join "`n" + if ($type -eq 'text') { + $subId = Escape-HtmlAttr ([string]$_.Id) + $subLabel = Escape-HtmlText ([string]$_.Label) + $ph = if ($_.PSObject.Properties.Name -contains 'Placeholder') { Escape-HtmlAttr ([string]$_.Placeholder) } else { '' } + $help = if ($_.PSObject.Properties.Name -contains 'Help') { Escape-HtmlText ([string]$_.Help) } else { '' } - $html += @" - +@" +
+ + + $help +
"@ } + else { + # default checkbox behaviour (your current behaviour) + $subLabel = Escape-HtmlText ([string]$_.Label) + + $subTaskIdClass = Escape-HtmlAttr ([string]$taskId) + $subValueAttr = Escape-HtmlAttr ([string]$_.Value) + + "" + } + } + ) -join "`n" + + $html += @" + +"@ +} + $html }