Update StackMonkey.ps1

This commit is contained in:
2025-06-29 13:25:35 -04:00
parent bd8cd2e63c
commit 63758ea64f

View File

@@ -800,37 +800,37 @@
#region UI Generation #region UI Generation
function Build-Checkboxes { function Build-Checkboxes {
param($Page, $Column) param($Page, $Column)
( (
$Global:Tasks | $Global:Tasks |
Where-Object Page -EQ $Page | Where-Object Page -EQ $Page |
Where-Object Column -EQ $Column | Where-Object Column -EQ $Column |
ForEach-Object { ForEach-Object {
$taskId = $_.Id $taskId = $_.Id
$tooltip = if ($_.PSObject.Properties.Name -contains 'Tooltip' -and $_.Tooltip) { $tooltip = if ($_.PSObject.Properties.Name -contains 'Tooltip' -and $_.Tooltip) {
" title='$($_.Tooltip)'" " title='$($_.Tooltip)'"
} else { '' } } else { '' }
$html = "<label$tooltip><input type='checkbox' id='$taskId' name='$($_.Name)' data-column='$Column'> $($_.Label)</label>" $html = "<label$tooltip><input type='checkbox' id='$taskId' name='$($_.Name)' data-column='$Column'> $($_.Label)</label>"
if ($_.SubOptions) { if ($_.SubOptions) {
# join inside the code block is fine # join inside the code block is fine
$subHtml = ( $subHtml = (
$_.SubOptions | $_.SubOptions |
ForEach-Object { ForEach-Object {
"<label style='margin-left:20px; display:block;'> "<label style='margin-left:20px; display:block;'>
<input type='checkbox' class='sub-option-$taskId' name='$($_.Value)' value='$($_.Value)'> $($_.Label) <input type='checkbox' class='sub-option-$taskId' name='$($_.Value)' value='$($_.Value)'> $($_.Label)
</label>" </label>"
} }
) -join "`n" ) -join "`n"
$html += @" $html += @"
<div id='${taskId}OptionsContainer' style='display:none; margin-top:4px;'> <div id='${taskId}OptionsContainer' style='display:none; margin-top:4px;'>
$subHtml $subHtml
</div> </div>
"@ "@
} }
$html $html