![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
bootstrap-show-modal
Advanced tools
bootstrap plugin to create modals in pure JavaScript, without jQuery
bootstrap plugin to create bootstrap modals in pure JavaScript.
This version is compatible with Bootstrap 5, but we remain a Bootstrap 4 compatible version with the branch bootstrap4-compatible. npm package versions 3.x are Bootstrap 5 compatible, versions 1.x Bootstrap 4 compatible.
With version 5.x of bootstrap-shop-modal we completely removed jQuery 🥳 🚀
npm install bootstrap-show-modal
Or just download this repository and include src/ShowModal.js
.
bootstrap.showModal({title: "Hello World!", body: "A very simple modal dialog without buttons."})
bootstrap.showAlert({title: "Hi", body: "Please press ok, if you like or dislike cookies."})
bootstrap.showConfirm({
title: "Please confirm", body: "Do you like cats?", textTrue: "Yes", textFalse: "No",
onSubmit: function (result) { // callback on confirm
if (result) {
bootstrap.showAlert({title: "Result: " + result, body: "You like cats."})
} else {
bootstrap.showAlert({title: "Result: " + result, body: "You don't like cats."})
}
},
onDispose: function() {
console.log("The confirm dialog vanished")
}
})
this.props = {
title: "", // the dialog title html
body: "", // the dialog body html
footer: "", // the dialog footer html (mainly used for buttons)
modalClass: "fade", // Additional css for ".modal", "fade" for fade effect
modalDialogClass: "", // Additional css for ".modal-dialog", like "modal-lg" or "modal-sm" for sizing
options: { // The Bootstrap modal options as described here: https://getbootstrap.com/docs/4.0/components/modal/#options
backdrop: 'static' // disallow closing on click in the background
},
draggable: false, // make the dialog draggable 🆕
// Events:
onCreate: null, // Callback, called after the modal was created
onShown: null, // Callback, called after the modal was shown and completely faded in
onDispose: null, // Callback, called after the modal was disposed
onSubmit: null // Callback of bootstrap.showConfirm(), called after yes or no was pressed
}
See the Bootstrap Modal documentation for possible
values of options
, modalClass
and modalDialogClass
.
I don't provide a minified version because I think it should be up to the using programmer to create minified versions, with all the used script sources concatenated to one file.
But, if you want it, it is easy to create your minified version with uglify: https://www.npmjs.com/package/uglify-js
Just install uglify
npm install uglify-js -g
and then in the src-folder
uglifyjs ShowModal.js --compress --mangle > ShowModal.min.js
It works in all modern browsers and in the Internet Explorer. Not tested with IE < 11.
Find more high quality modules from shaack.com on our projects page.
FAQs
bootstrap plugin to create modals in pure JavaScript, without jQuery
The npm package bootstrap-show-modal receives a total of 216 weekly downloads. As such, bootstrap-show-modal popularity was classified as not popular.
We found that bootstrap-show-modal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.