2023-08-03 12:25:33 +00:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="en-GB">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
<meta http-equiv="content-type" content="text/html" charset="UTF-8" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
<meta name="description" content="" />
|
|
|
|
<meta name="keyword" content="" />
|
|
|
|
|
|
|
|
<!-- jquery -->
|
|
|
|
<script src="http://cdn.hiimray.co.uk/8206c600-707c-469e-8d49-a76ae35782af/jquery/3.7.0/dist/jquery.min.js"></script>
|
|
|
|
<!-- bootstrap -->
|
|
|
|
<script src="http://cdn.hiimray.co.uk/8206c600-707c-469e-8d49-a76ae35782af/bootstrap/4.6.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
|
|
<link href="http://cdn.hiimray.co.uk/8206c600-707c-469e-8d49-a76ae35782af/bootstrap/4.6.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
|
|
|
|
|
|
|
<script src="bsdialog4.js"></script>
|
|
|
|
<title></title>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body class="py-5">
|
|
|
|
|
|
|
|
<div class="container">
|
2023-08-21 00:43:47 +00:00
|
|
|
|
2023-08-19 12:34:51 +00:00
|
|
|
<div class="row mb-3 border-bottom">
|
2023-08-03 12:25:33 +00:00
|
|
|
<div class="col-12">
|
|
|
|
|
2023-08-19 12:34:51 +00:00
|
|
|
<p><b>Example One</b></p>
|
|
|
|
<p>Launch an empty modal</p>
|
|
|
|
<div class="alert alert-secondary">BSDialog.Create('abc123', 'My Modal Box 123', null, 'xl');</div>
|
|
|
|
<p><button id="button1" type="button" class="btn btn-primary">Launch Modal</button></p>
|
2023-08-03 12:25:33 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-08-19 12:34:51 +00:00
|
|
|
<div class="row mb-3 border-bottom">
|
2023-08-03 12:25:33 +00:00
|
|
|
<div class="col-12">
|
|
|
|
|
2023-08-19 12:34:51 +00:00
|
|
|
<p><b>Example Two</b></p>
|
|
|
|
<p>Launch a modal with text</p>
|
|
|
|
<div class="alert alert-secondary">BSDialog.Create('abc123', 'My Modal Box 123', 'Hello momo!', 'lg');</div>
|
|
|
|
<p><button id="button2" type="button" class="btn btn-primary">Launch Modal</button></p>
|
2023-08-03 12:25:33 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-08-19 12:34:51 +00:00
|
|
|
<div class="row mb-3 border-bottom">
|
2023-08-03 12:25:33 +00:00
|
|
|
<div class="col-12">
|
|
|
|
|
2023-08-19 12:34:51 +00:00
|
|
|
<p><b>Example Three</b></p>
|
|
|
|
<p>Launch an empty modal then update its title, body, footer and size.</p>
|
|
|
|
<div class="alert alert-secondary">
|
2023-08-21 00:52:54 +00:00
|
|
|
BSDialog.Create('abc123', 'My Modal Box 123', null, 'sm');<br />
|
2023-08-19 12:34:51 +00:00
|
|
|
BSDialog.UpdateTitle('abc123', 'My Modal Box 567');<br />
|
|
|
|
BSDialog.UpdateBody('abc123', 'Help, I\'m toast!');<br />
|
|
|
|
BSDialog.UpdateFooter('abc123', '');<br />
|
|
|
|
BSDialog.UpdateSize('abc123', 'lg');<br />
|
|
|
|
</div>
|
|
|
|
<p><button id="button3" type="button" class="btn btn-primary">Launch Modal</button></p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row mb-3 border-bottom">
|
|
|
|
<div class="col-12">
|
|
|
|
|
|
|
|
<p><b>Example Four</b></p>
|
|
|
|
<p>Launch a multiple modals</p>
|
|
|
|
<div class="alert alert-secondary">
|
2023-08-21 00:52:54 +00:00
|
|
|
BSDialog.Create('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');<br />
|
|
|
|
BSDialog.Create('abc123456', 'My Modal Box 123.567', 'Help! I\'m a second toast.', 'md');<br />
|
2023-08-19 12:34:51 +00:00
|
|
|
</div>
|
|
|
|
<p><button id="button4" type="button" class="btn btn-primary">Launch Modal</button></p>
|
2023-08-03 12:25:33 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-08-21 00:52:54 +00:00
|
|
|
<div class="row mb-3 border-bottom">
|
|
|
|
<div class="col-12">
|
|
|
|
|
|
|
|
<p><b>Example Six</b></p>
|
|
|
|
<p>Show a toast-style modal</p>
|
|
|
|
<div class="alert alert-secondary">
|
|
|
|
BSDialog.ShowToast('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');<br />
|
|
|
|
</div>
|
|
|
|
<p><button id="button6" type="button" class="btn btn-primary">Launch Modal</button></p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-08-21 00:43:47 +00:00
|
|
|
<div class="row mb-3 border-bottom">
|
|
|
|
<div class="col-12">
|
|
|
|
|
|
|
|
<p><b>Example Five</b></p>
|
|
|
|
<p>Launch a prompt modal</p>
|
|
|
|
<div class="alert alert-secondary">
|
|
|
|
let result = await BSDialog.ShowPrompt({<br />
|
|
|
|
Title: "Prompt",<br />
|
|
|
|
Message: "This is a prompt",<br />
|
|
|
|
Size: "md",<br />
|
|
|
|
Buttons: [<br />
|
|
|
|
{ Label: "Yes", Value: "Yes", Colour: "primary" },<br />
|
|
|
|
{ Label: "No", Value: "No", Colour: "secondary" },<br />
|
|
|
|
{ Label: "Cancel", Value: "Cancel", Colour: "secondary" }<br />
|
|
|
|
]<br />
|
|
|
|
});<br />
|
|
|
|
<br />
|
|
|
|
alert(result);<br />
|
|
|
|
</div>
|
|
|
|
<p><button id="button5" type="button" class="btn btn-primary">Launch Modal</button></p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-08-03 12:25:33 +00:00
|
|
|
</div>
|
|
|
|
|
2023-08-19 12:34:51 +00:00
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
$("#button1").on('click', function(){
|
|
|
|
BSDialog.Create('abc123', 'My Modal Box 123', null, 'xl');
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#button2").on('click', function(){
|
|
|
|
BSDialog.Create('abc123', 'My Modal Box 123', 'Hello momo!', 'lg');
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#button3").on('click', function(){
|
2023-08-21 00:52:54 +00:00
|
|
|
BSDialog.Create('abc123', 'My Modal Box 123', null, 'sm');
|
2023-08-19 12:34:51 +00:00
|
|
|
BSDialog.UpdateTitle('abc123', 'My Modal Box 567');
|
|
|
|
BSDialog.UpdateBody('abc123', 'Help, I\'m toast!');
|
|
|
|
BSDialog.UpdateFooter('abc123', '');
|
|
|
|
BSDialog.UpdateSize('abc123', 'lg');
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#button4").on('click', function(){
|
2023-08-21 00:52:54 +00:00
|
|
|
BSDialog.Create('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');
|
|
|
|
BSDialog.Create('abc123456', 'My Modal Box 123.567', 'Help! I\'m a second toast.', 'md');
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#button6").on('click', function(){
|
2023-08-19 12:34:51 +00:00
|
|
|
BSDialog.ShowToast('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');
|
|
|
|
});
|
|
|
|
|
2023-08-21 00:43:47 +00:00
|
|
|
$("#button5").on('click', async function(){
|
|
|
|
let result = await BSDialog.ShowPrompt({
|
|
|
|
Title: "Prompt",
|
|
|
|
Message: "This is a prompt",
|
|
|
|
Size: "md",
|
|
|
|
PromptType: "YesNoCancel"
|
|
|
|
});
|
|
|
|
|
|
|
|
alert(result);
|
|
|
|
});
|
|
|
|
|
2023-08-19 12:34:51 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
2023-08-03 12:25:33 +00:00
|
|
|
</body>
|
|
|
|
</html>
|