From d487f87b688c163c7589913a47382586aaeb54b8 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 8 Jul 2026 11:28:19 +0100 Subject: [PATCH] Added readme --- README.md | 34 ++++++++++++++++++++++++++++++++++ wiki/USAGE.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 README.md create mode 100644 wiki/USAGE.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..72522ef --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# BSDialog + +> BSDialog is a JavaScript helper for improving Bootstrap 3 modals. Add (and remove) modals to a page dynamically and load content with jQuery/AJAX. Bootstrap 3 is required. + +--- + +## Features + +- Add (inject) and remove modals into a page +- Load modal-content or modal-body from URL with jQuery-AJAX +- Stack multiple modals + +--- + +## Releases & Builds + +See [Releases](/Ray/bsdialog) + +## 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. + +- [Bootstrap](https://getbootstrap.com/) +- [jQuery](https://jquery.com/) + +## License + +This project is licensed under the least restrictive terms of its dependencies, viz. MIT License. \ No newline at end of file diff --git a/wiki/USAGE.md b/wiki/USAGE.md new file mode 100644 index 0000000..af6d9d1 --- /dev/null +++ b/wiki/USAGE.md @@ -0,0 +1,43 @@ +# Usage: v0.1.0.029a + +This is the usage guide for [BSDialog](/bootstrapjs-bsdialog), v0.1.0.029a. + +## Usage + +### Create(id, title, url, [is_big], [update_body]) + +| Parameter | Type | Description | +|-----------|------|-------------| +| id | string | Unique identifier for the modal, so you can refer to multiple modal | +| title | string | Label at the top of the modal | +| url | string | URL to load into the modal body | +| is_big | boolean | Use large width or small width on the modal. (Optional. Default is false) | +| update_body | boolean | Update modal-body with content, otherwise model-content. (Optional. Default is false) | + +Creates the Modal on the page and loads the body from a URL. An existing box will be reused if the ID already exists. + +```javascript +BSDialog.Create("123", "My Modal Box 123", "/my-modal-box.html"); +BSDialog.Create("123", "My Modal Box 123", "/my-modal-box.html", false); +BSDialog.Create("123", "My Modal Box 123", "/my-modal-box.html", false, false); +``` + +### Close(id) + +| Parameter | Type | Description | +|-----------|------|-------------| +| id | string | Unique identifier for the modal, so you can refer to multiple modal | + +Close the Modal box by the box identifier. + +```javascript +BSDialog.Close("123"); +``` + +### Clear() + +Close all Modal boxes on the page. + +```javascript +BSDialog.Clear(); +```