Update samy.ps1
This commit is contained in:
10
samy.ps1
10
samy.ps1
@@ -694,13 +694,6 @@ function Get-SamyTasks {
|
|||||||
if ($t.PSObject.Properties.Name -contains 'Tooltip') { $tooltip = [string]$t.Tooltip }
|
if ($t.PSObject.Properties.Name -contains 'Tooltip') { $tooltip = [string]$t.Tooltip }
|
||||||
if ([string]::IsNullOrWhiteSpace($tooltip)) { $tooltip = [string]$t.Label }
|
if ([string]::IsNullOrWhiteSpace($tooltip)) { $tooltip = [string]$t.Label }
|
||||||
|
|
||||||
# Escape for HTML attribute
|
|
||||||
$tooltip = $tooltip -replace '&','&'
|
|
||||||
$tooltip = $tooltip -replace "'",'''
|
|
||||||
$tooltip = $tooltip -replace '"','"'
|
|
||||||
$tooltip = $tooltip -replace '<','<'
|
|
||||||
$tooltip = $tooltip -replace '>','>'
|
|
||||||
|
|
||||||
if ($t.PSObject.Properties.Name -contains 'Tooltip') {
|
if ($t.PSObject.Properties.Name -contains 'Tooltip') {
|
||||||
$t.Tooltip = $tooltip
|
$t.Tooltip = $tooltip
|
||||||
} else {
|
} else {
|
||||||
@@ -809,8 +802,9 @@ if (-not $Global:SamyTasks) {
|
|||||||
$subHtml = (
|
$subHtml = (
|
||||||
$_.SubOptions |
|
$_.SubOptions |
|
||||||
ForEach-Object {
|
ForEach-Object {
|
||||||
|
$subLabel = Escape-HtmlText ([string]$_.Label)
|
||||||
"<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)'> $subLabel
|
||||||
</label>"
|
</label>"
|
||||||
}
|
}
|
||||||
) -join "`n"
|
) -join "`n"
|
||||||
|
|||||||
Reference in New Issue
Block a user