petruisfan / boopup

Bootstrap popups

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Boopup

Bootstrap Popups

This is a reimplementation of the browser popups: alert, confirm and prompt, using bootstrap modals.

Instructions for using:

  1. Add a link to the js and css file in your html:
<script src="/bower_components/boopup/dist/boopup.js"></script>
<link rel="stylesheet" href="bower_components/boopup/dist/boopup.min.css"/>

Warning: this will append the bootstrap modals to your body!

  1. Use the global variable Boopup:

Alert

Boopup.alert("This is a boopup alert!");

Example

Confirm

Boopup.confirm("This is a boopup confirm!", function(agree) {
    console.log(agree);
})

Example

Prompt

Boopup.prompt("This is a boopup prompt!", function(input) {
    console.log(input);
})          

Example

Bootstrap and jquery must already be loaded. You can customize the css by overriding boopup.min.css classes.

About

Bootstrap popups

License:Apache License 2.0


Languages

Language:JavaScript 66.7%Language:HTML 32.1%Language:CSS 1.2%