From 86403693406679487bf8e593ab53d6722bff25be Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 8 Jul 2026 11:01:06 +0100 Subject: [PATCH] Added usage --- README.md | 4 ++ wiki/USAGE.md | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 wiki/USAGE.md diff --git a/README.md b/README.md index 91f0f6d..6d891d1 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ For example: you wanted to watch a random episode of your favourite show. See [Releases](/Ray/bstoast4) +## Documentation + +See [Usage](wiki/USAGE.md) + ## Acknowledgements This software uses a number of dependencies and assets from third-parties. These developers and artists deserve due credit for their work and for their commitment to sharing their work freely. Each product is released under their own particular license, for more information please visit their websites. diff --git a/wiki/USAGE.md b/wiki/USAGE.md new file mode 100644 index 0000000..d72e9e6 --- /dev/null +++ b/wiki/USAGE.md @@ -0,0 +1,136 @@ +# BSToast4 + +## Usage + +This is the usage guide for **BSToast4**, version **0.2.0.059**. + +--- + +## `Create(options)` + +Creates a Toast on the page. The default position is the **top-right**. + +### Options + +```javascript +{ + Icon: "", + Title: "", + Time: "", + Message: "", + Footer: "", + Animation: true, + AutoHide: true, + Delay: 6000, + Position: "position:fixed; top:0; right:80px; margin:20px;", + MinWidth: 320, + MinHeight: 100, + HeaderClass: "bg-light", + FooterClass: "bg-light text-center" +} +``` + +### Parameters + +| Name | Type | Description | +|------|------|-------------| +| `Icon` | `html` | HTML for the top-left image. | +| `Title` | `string` | Label shown at the top of the toast. | +| `Time` | `string` | Text displayed at the top-right of the toast, typically the time. | +| `Message` | `string` | HTML body of the toast. | +| `Footer` | `string` | HTML body of the toast footer. | +| `Animation` | `bool` | Whether the toast opens with an animation. | +| `AutoHide` | `bool` | Whether the toast automatically closes after a delay. | +| `Delay` | `int` | Delay before automatically closing the toast, in milliseconds. | +| `Position` | `css` | CSS defining the toast container position. | +| `MinWidth` | `int` | Minimum width of the toast. | +| `MinHeight` | `int` | Minimum height of the toast. | +| `HeaderClass` | `css class` | CSS class applied to the toast header. | +| `FooterClass` | `css class` | CSS class applied to the toast footer. | + +### Example + +```javascript +BSToast4.Create({ + Icon: "", + Title: "Hello Toast", + Time: "Now", + Message: "Hello", + Footer: "Footer", + Animation: true, + AutoHide: true, + Delay: 6000, + Position: "position:fixed; top:0; right:80px; margin:20px;", + MinWidth: 320, + MinHeight: 100, + HeaderClass: "bg-light", + FooterClass: "bg-light text-center" +}); +``` + +--- + +## `Push(options)` + +Creates a new toast or appends a toast to the existing toast stack. + +### Options + +```javascript +{ + Icon: "", + Title: "", + Time: "", + Message: "", + Footer: "", + Animation: true, + AutoHide: true, + Delay: 6000, + MinWidth: 320, + MinHeight: 100 +} +``` + +### Parameters + +| Name | Type | Description | +|------|------|-------------| +| `Icon` | `html` | HTML for the top-left image. | +| `Title` | `string` | Label shown at the top of the toast. | +| `Time` | `string` | Text displayed at the top-right of the toast, typically the time. | +| `Message` | `string` | HTML body of the toast. | +| `Footer` | `string` | HTML body of the toast footer. | +| `Animation` | `bool` | Whether the toast opens with an animation. | +| `AutoHide` | `bool` | Whether the toast automatically closes after a delay. | +| `Delay` | `int` | Delay before automatically closing the toast, in milliseconds. | +| `MinWidth` | `int` | Minimum width of the toast. | +| `MinHeight` | `int` | Minimum height of the toast. | + +### Example + +```javascript +BSToast4.Create({ + Icon: "", + Title: "Hello Toast (2)", + Time: "Now", + Message: "Hello again", + Footer: "", + Animation: true, + AutoHide: true, + Delay: 6000, + MinWidth: 320, + MinHeight: 100 +}); +``` + +--- + +## `Clear()` + +Closes all toasts currently displayed on the page. + +### Example + +```javascript +BSToast4.Clear(); +``` \ No newline at end of file