diff --git a/Functions/Public/base.ps1 b/Functions/Public/base.ps1 index 0862eaa4..e77426cd 100644 --- a/Functions/Public/base.ps1 +++ b/Functions/Public/base.ps1 @@ -63,10 +63,13 @@ Function base { } - Set-HtmlTag -TagName $tagname -Attributes $htmltagparams -TagType nonVoid + if($Attributes){ + $htmltagparams += $Attributes + } + } + Set-HtmlTag -TagName $tagname -Attributes $htmltagparams -TagType nonVoid } - diff --git a/Functions/Public/blockquote.ps1 b/Functions/Public/blockquote.ps1 index 651b3975..3a65626c 100644 --- a/Functions/Public/blockquote.ps1 +++ b/Functions/Public/blockquote.ps1 @@ -20,6 +20,7 @@ Function blockquote { .NOTES Current version 2.0 History: + 2018.10.02;@stephanevg;Fixed error when no content passed. to version 2.0 2018.10.02;bateskevin;updated to version 2.0 2018.05.07;stephanevg;updated to version 1.0 2018.04.01;bateskevinhanevg;Creation. @@ -28,7 +29,7 @@ Function blockquote { #> [Cmdletbinding()] Param( - [Parameter(Mandatory=$true)] + [Parameter(Mandatory=$false)] [AllowEmptyString()] [AllowNull()] [String] @@ -80,7 +81,7 @@ Function blockquote { } - Set-HtmlTag -TagName $tagname -Attributes $htmltagparams -TagType NonVoid } + Set-HtmlTag -TagName $tagname -Attributes $htmltagparams -TagType NonVoid } } \ No newline at end of file diff --git a/Functions/Public/datalist.ps1 b/Functions/Public/datalist.ps1 new file mode 100644 index 00000000..b2558090 --- /dev/null +++ b/Functions/Public/datalist.ps1 @@ -0,0 +1,83 @@ +Function datalist { + <# + .SYNOPSIS + Create a datalist tag in an HTML document. + + .DESCRIPTION + + The tag specifies a list of pre-defined options for an element. + + The tag is used to provide an "autocomplete" feature on elements. Users will see a drop-down list of pre-defined options as they input data. + + Use the element's list attribute to bind it together with a element. + + .EXAMPLE + + .EXAMPLE + + + .NOTES + Current version 2.0 + History: + 2018.10.05;@stephanevg;Creation. + .LINK + https://github.com/Stephanevg/PSHTML + #> + [Cmdletbinding()] + Param( + [Parameter(Mandatory=$false)] + [AllowEmptyString()] + [AllowNull()] + [String] + $Content, + + [string]$cite, + + [AllowEmptyString()] + [AllowNull()] + [String]$Class="", + + [String]$Id, + + [AllowEmptyString()] + [AllowNull()] + [String]$Style, + + [String]$title, + + [Hashtable]$Attributes + ) + + Process { + + $CommonParameters = "tagname" + [System.Management.Automation.PSCmdlet]::CommonParameters + [System.Management.Automation.PSCmdlet]::OptionalCommonParameters + $CustomParameters = $PSBoundParameters.Keys | ? { $_ -notin $CommonParameters } + + $htmltagparams = @{} + $tagname = "datalist" + + if($CustomParameters){ + + foreach ($entry in $CustomParameters){ + + + if($entry -eq "content"){ + + + $htmltagparams.$entry = $PSBoundParameters[$entry] + }else{ + $htmltagparams.$entry = "{0}" -f $PSBoundParameters[$entry] + } + + + } + + if($Attributes){ + $htmltagparams += $Attributes + } + + + Set-HtmlTag -TagName $tagname -Attributes $htmltagparams -TagType NonVoid + } + } +} \ No newline at end of file diff --git a/Functions/Public/dl.ps1 b/Functions/Public/dl.ps1 index b7ec62fc..808869a3 100644 --- a/Functions/Public/dl.ps1 +++ b/Functions/Public/dl.ps1 @@ -27,7 +27,6 @@ Function dl { [Parameter(Mandatory=$false,position=0)] [AllowEmptyString()] [AllowNull()] - [String] $Content, [Parameter(Position = 1)] diff --git a/Functions/Public/option.ps1 b/Functions/Public/option.ps1 new file mode 100644 index 00000000..ba9283e5 --- /dev/null +++ b/Functions/Public/option.ps1 @@ -0,0 +1,103 @@ +Function option { + <# + .SYNOPSIS + Create a