Skip to content

Commit 57f8559

Browse files
authored
Merge pull request #248 from Badgerati/develop
v0.7.0
2 parents d877325 + c72d43d commit 57f8559

93 files changed

Lines changed: 3186 additions & 423 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.build.ps1

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,20 @@ task MoveLibs {
198198

199199
# monaco
200200
New-Item -Path "$($libs_path)/monaco" -ItemType Directory -Force | Out-Null
201+
New-Item -Path "$($libs_path)/vs" -ItemType Directory -Force | Out-Null
202+
201203
New-Item -Path "$($libs_path)/monaco/editor" -ItemType Directory -Force | Out-Null
202204
New-Item -Path "$($libs_path)/monaco/basic-languages" -ItemType Directory -Force | Out-Null
203-
New-Item -Path "$($libs_path)/monaco/base/worker" -ItemType Directory -Force | Out-Null
204205

205206
Copy-Item -Path "$($src_path)/monaco-editor/min/vs/loader.js" -Destination "$($libs_path)/monaco/" -Force
206207
Copy-Item -Path "$($src_path)/monaco-editor/min/vs/editor/*.*" -Destination "$($libs_path)/monaco/editor/" -Force
208+
209+
New-Item -Path "$($libs_path)/monaco/base/worker" -ItemType Directory -Force | Out-Null
207210
Copy-Item -Path "$($src_path)/monaco-editor/min/vs/base/worker/*.*" -Destination "$($libs_path)/monaco/base/worker/" -Force
208211

212+
New-Item -Path "$($libs_path)/monaco/base/browser/ui/codicons/codicon" -ItemType Directory -Force | Out-Null
213+
Copy-Item -Path "$($src_path)/monaco-editor/min/vs/base/browser/ui/codicons/codicon/*.*" -Destination "$($libs_path)/monaco/base/browser/ui/codicons/codicon/" -Force
214+
209215
$langs = @(
210216
'bat',
211217
'cpp',
@@ -236,6 +242,17 @@ task MoveLibs {
236242
}
237243
}
238244

245+
New-Item -Path "$($libs_path)/monaco/language" -ItemType Directory -Force | Out-Null
246+
New-Item -Path "$($libs_path)/vs/language" -ItemType Directory -Force | Out-Null
247+
248+
(Get-ChildItem -Path "$($src_path)/monaco-editor/min/vs/language" -Directory).Name | ForEach-Object {
249+
New-Item -Path "$($libs_path)/monaco/language/$($_)/" -ItemType Directory -Force | Out-Null
250+
Copy-Item -Path "$($src_path)/monaco-editor/min/vs/language/$($_)/*.*" -Destination "$($libs_path)/monaco/language/$($_)/" -Force
251+
252+
New-Item -Path "$($libs_path)/vs/language/$($_)/" -ItemType Directory -Force | Out-Null
253+
Copy-Item -Path "$($src_path)/monaco-editor/min/vs/language/$($_)/*.*" -Destination "$($libs_path)/vs/language/$($_)/" -Force
254+
}
255+
239256
$vs_maps_path = "$($dest_path)/min-maps/vs"
240257
if (Test-Path $vs_maps_path) {
241258
Remove-Item -Path $vs_maps_path -Recurse -Force | Out-Null

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
> 💝 A lot of my free time, evenings, and weekends goes into making Pode happen; please do consider sponsoring as it will really help! 😊
1313
14-
This is a web template framework for use with the [Pode](https://github.com/Badgerati/Pode) PowerShell web server (v2.2.0+).
14+
This is a web template framework for use with the [Pode](https://github.com/Badgerati/Pode) PowerShell web server (v2.5.0+).
1515

1616
It allows you to build web pages purely with PowerShell - no HTML, CSS, or JavaScript knowledge required!
1717

docs/Getting-Started/Installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Pode.Web is a PowerShell module that works along side [Pode](https://github.com/
66

77
Before installing Pode.Web, the minimum requirements must be met:
88

9-
* Pode v2.2.0+
9+
* Pode v2.5.0+
1010

1111
Which also includes Pode's minimum requirements:
1212
* OS:

docs/Tutorials/Elements/Audio.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Audio
2+
3+
| Support | |
4+
| ------- |-|
5+
| Events | Yes |
6+
7+
To play audio clips on your site you can use [`New-PodeWebAudio`](../../../Functions/Elements/New-PodeWebAudio). The audio can be set to auto-play and loop, and can also accept multiple sources and tracks.
8+
9+
The sources specified can be done so via `-Source` and [`New-PodeWebAudioSource`](../../../Functions/Elements/New-PodeWebAudioSource). Sources can only be of type `MP3`, `OGG` and `WAV`, and at least one source must be specified:
10+
11+
```powershell
12+
New-PodeWebCard -Content @(
13+
New-PodeWebAudio -Name 'example' -Source @(
14+
New-PodeWebAudioSource -Url 'https://samplelib.com/lib/preview/mp3/sample-6s.mp3'
15+
)
16+
)
17+
```
18+
19+
Which looks like below:
20+
21+
![audio](../../../images/audio.png)
22+
23+
Any optional tracks you wish to specify can be done via `-Track` and [`New-PodeWebMediaTrack`](../../../Functions/Elements/New-PodeWebMediaTrack). Tracks can only be of type `VTT`, and can be used for subtitles, captions, metadata, etc.
24+
25+
The `-Language` is mandatory if the track's `-Type` is subtitles, and should be a [2-letter language code](https://www.w3schools.com/tags/ref_language_codes.asp).
26+
27+
```powershell
28+
New-PodeWebCard -Content @(
29+
New-PodeWebAudio -Name 'example' -Source @(
30+
New-PodeWebAudioSource -Url 'https://samplelib.com/lib/preview/mp3/sample-6s.mp3'
31+
) `
32+
-Tracks @(
33+
New-PodeWebMediaSource -Url '/some/url/path/english.vtt' -Language 'en' -Title 'English' -Type 'subtitles' -Default
34+
)
35+
)
36+
```
37+
38+
## Size
39+
40+
The `-Width` of an audio element has the default unit of `%`. If `0` is specified then `20%` is used instead. Any custom value such as `100px` can be used, but if a plain number is used then `%` is appended.
41+
42+
## Events
43+
44+
The following specific events are supported by the Audio element, and can be registered via [`Register-PodeWebMediaEvent`](../../../Functions/Events/Register-PodeWebMediaEvent):
45+
46+
| Name | Description |
47+
| ---- | ----------- |
48+
| CanPlay | Fires when the browser is ready to play the audio |
49+
| Ended | Fires when the audio has finished playing, unless looping |
50+
| Pause | Fires when the audio is paused |
51+
| Play | Fires when the audio is played, or un-paused |
52+
53+
Example:
54+
55+
```powershell
56+
New-PodeWebAudio -Name 'example' -Source @(
57+
New-PodeWebAudioSource -Id 'sample' -Url 'https://samplelib.com/lib/preview/mp3/sample-6s.mp3'
58+
) |
59+
Register-PodeWebMediaEvent -Type Play -ScriptBlock {
60+
Show-PodeWebToast -Title 'Action' -Message $EventType
61+
}
62+
```

docs/Tutorials/Elements/Charts.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,7 @@ New-PodeWebCounterChart -Counter '\Processor(_Total)\% Processor Time' -AsCard
141141
which renders a chart that looks like below:
142142

143143
![chart_line_counter](../../../images/chart_line_counter.png)
144+
145+
## Size
146+
147+
The `-Height` of a chart has the default unit of `px`. If `0` is specified then `auto` is used instead. Any custom value such as `10%` can be used, but if a plain number is used then `px` is appended.

docs/Tutorials/Elements/Checkbox.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,11 @@ Which looks like below:
4343
## Inline
4444

4545
You can render this element inline with other non-form elements by using the `-NoForm` switch. This will remove the form layout, and render the element more cleanly when used outside of a form.
46+
47+
## Display Name
48+
49+
By default the label displays the `-Name` of the element. You can change the value displayed by also supplying an optional `-DisplayName` value; this value is purely visual, when the user submits the form the value of the element is still retrieved using the `-Name` from `$WebEvent.Data`.
50+
51+
## Display Options
52+
53+
By default the options displayed are from the `-Options` parameter. Like the Name, you can change the values displayed by supplying the optional `-DisplayOptions` - values in the array should be in the same order as the values in `-Options`. These values are, like the Display Name, purely visual, and when the form is submitted the server receives the original values from `-Options`.

docs/Tutorials/Elements/Credentials.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,22 @@ New-PodeWebCard -Content @(
2020
Which looks like below:
2121

2222
![credentials](../../../images/credentials.png)
23+
24+
## Type
25+
26+
By default both the Username and Password fields are displayed, but you can control which ones are displayed by using the `-Type` parameter:
27+
28+
```powershell
29+
# both (this is the default)
30+
New-PodeWebCredential -Name 'Example' -Type Username, Password
31+
32+
# just username
33+
New-PodeWebCredential -Name 'Example' -Type Username
34+
35+
# just password
36+
New-PodeWebCredential -Name 'Example' -Type Password
37+
```
38+
39+
## Display Name
40+
41+
By default the label displays the `-Name` of the element. You can change the value displayed by also supplying an optional `-DisplayName` value; this value is purely visual, when the user submits the form the value of the element is still retrieved using the `-Name` from `$WebEvent.Data`.

docs/Tutorials/Elements/DateTime.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,22 @@ New-PodeWebCard -Content @(
2020
Which looks like below:
2121

2222
![datetime](../../../images/datetime.png)
23+
24+
## Type
25+
26+
By default both the Date and Time fields are displayed, but you can control which ones are displayed by using the `-Type` parameter:
27+
28+
```powershell
29+
# both (this is the default)
30+
New-PodeWebDateTime -Name 'Example' -Type Date, Time
31+
32+
# just date
33+
New-PodeWebDateTime -Name 'Example' -Type Date
34+
35+
# just time
36+
New-PodeWebDateTime -Name 'Example' -Type Time
37+
```
38+
39+
## Display Name
40+
41+
By default the label displays the `-Name` of the element. You can change the value displayed by also supplying an optional `-DisplayName` value; this value is purely visual, when the user submits the form the value of the element is still retrieved using the `-Name` from `$WebEvent.Data`.

docs/Tutorials/Elements/FileUpload.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ Which looks like below:
2020

2121
![file_upload](../../../images/file_upload.png)
2222

23+
## Accept
24+
25+
By default the file upload dialog will accept every file type, but you can filter which files are accepted via the `-Accept` parameter. This accepts an array of file types/extensions such as:
26+
27+
```powershell
28+
New-PodeWebFileUpload -Name 'File' -Accept '.png', 'audio/*'
29+
```
30+
31+
which will accept any `.png` file, and all sound files.
32+
2333
## Inline
2434

2535
You can render this element inline with other non-form elements by using the `-NoForm` switch. This will remove the form layout, and render the element more cleanly when used outside of a form.
36+
37+
## Display Name
38+
39+
By default the label displays the `-Name` of the element. You can change the value displayed by also supplying an optional `-DisplayName` value; this value is purely visual, when the user submits the form the value of the element is still retrieved using the `-Name` from `$WebEvent.Data`.

docs/Tutorials/Elements/Form.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Which looks like below:
3131

3232
![form](../../../images/form.png)
3333

34+
!!! note
35+
If you have multiple forms on one page, make sure the Name/IDs are unique, including the Name/IDs of all form input elements as well.
36+
3437
You can pass values to the scriptblock by using the `-ArgumentList` parameter. This accepts an array of values/objects, and they are supplied as parameters to the scriptblock:
3538

3639
```powershell
@@ -52,7 +55,19 @@ The available form elements in Pode.Web are:
5255
* [DateTime](../DateTime)
5356
* [FileUpload](../FileUpload)
5457
* [Hidden](../Hidden)
58+
* [MinMax](../DateTime)
59+
* [Range](../Range)
5560
* [Radio](../Radio)
5661
* [Range](../Range)
5762
* [Select](../Select)
5863
* [Textbox](../Textbox)
64+
65+
## Method/Action
66+
67+
The default method for forms is `Post`, and the action is the internal route created for the form.
68+
69+
You can change these values by using the `-Method` and `-Action` parameters. The method can only be `Get` or `Post`, and the action must be a valid URL.
70+
71+
## Reset
72+
73+
You can reset all form inputs by either using the [`Reset-PodeWebForm`](../../../Functions/Outputs/Reset-PodeWebForm) output action, or by using `-ShowReset` switch on [`New-PodeWebForm`](../../../Functions/Elements/New-PodeWebForm) to display an optional reset button.

0 commit comments

Comments
 (0)