bsdialog5/bs5-test.html
2023-08-19 14:06:34 +01:00

104 lines
3.6 KiB
HTML

<!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/5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<link href="http://cdn.hiimray.co.uk/8206c600-707c-469e-8d49-a76ae35782af/bootstrap/5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" />
<script src="bsdialog5.js"></script>
<title></title>
</head>
<body class="py-5">
<div class="container">
<div class="row mb-3 border-bottom">
<div class="col-12">
<p><b>Example One</b></p>
<p>Launch an empty modal</p>
<div class="alert alert-secondary">BSDialog5.Create('abc123', 'My Modal Box 123', null, 'xl');</div>
<p><button id="button1" 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 Two</b></p>
<p>Launch a modal with text</p>
<div class="alert alert-secondary">BSDialog5.Create('abc123', 'My Modal Box 123', 'Hello momo!', 'lg');</div>
<p><button id="button2" 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 Three</b></p>
<p>Launch an empty modal then update its title, body, footer and size.</p>
<div class="alert alert-secondary">
BSDialog5.ShowToast('abc123', 'My Modal Box 123', null, 'sm');<br />
BSDialog5.UpdateTitle('abc123', 'My Modal Box 567');<br />
BSDialog5.UpdateBody('abc123', 'Help, I\'m toast!');<br />
BSDialog5.UpdateFooter('abc123', '');<br />
BSDialog5.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">
BSDialog5.ShowToast('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');<br />
BSDialog5.ShowToast('abc123456', 'My Modal Box 123.567', 'Help! I\'m a second toast.', 'md');<br />
</div>
<p><button id="button4" type="button" class="btn btn-primary">Launch Modal</button></p>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("#button1").on('click', function(){
BSDialog5.Create('abc123', 'My Modal Box 123', null, 'xl');
});
$("#button2").on('click', function(){
BSDialog5.Create('abc123', 'My Modal Box 123', 'Hello momo!', 'lg');
});
$("#button3").on('click', function(){
BSDialog5.ShowToast('abc123', 'My Modal Box 123', null, 'sm');
BSDialog5.UpdateTitle('abc123', 'My Modal Box 567');
BSDialog5.UpdateBody('abc123', 'Help, I\'m toast!');
BSDialog5.UpdateFooter('abc123', '');
BSDialog5.UpdateSize('abc123', 'lg');
});
$("#button4").on('click', function(){
BSDialog5.ShowToast('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');
BSDialog5.ShowToast('abc123456', 'My Modal Box 123.567', 'Help! I\'m a second toast.', 'md');
});
});
</script>
</body>
</html>