fincallorca/twbs-alert-overlay

This is a small javascript snippet to show Bootstrap Alert Elements as result of XMLHttpRequests.

0.1.1 2017-05-11 14:42 UTC

This package is auto-updated.

Last update: 2024-03-29 03:07:04 UTC


README

LICENSE Packagist LICENSE https://jquery.com/ https://v4-alpha.getbootstrap.com/

This is a small javascript snippet to show Bootstrap Alert Elements as result of XMLHttpRequests.

Integrations

Download the code from GitHub and copy the dist directory to your project.

Include the following lines of code in the <head> section of your HTML.

<link href="path/to/twbs-alert-overlay.jquery.min.css" rel="stylesheet" />
<script src="path/to/twbs-alert-overlay.jquery.min.js"></script>

The basics

Use the predefined bootstrap alert-* types and add some content to show as alert message:

  • success,
  • info,
  • warning or
  • danger
$.twbsAlertOverlay({
    messages:
    [
        {type: 'success', content: 'The entity was successfully updated.'},
        {type: 'warning', content: '<p>The database connection is not working!</p>'}
    ]
})

Contributing

Building

Google's Closure Compiler

java -jar closure-compiler.jar --js src/js/jquery.twbs-alert-overlay.js --js src/js/core.js --js_output_file dist/twbs-alert-overlay.jquery.min.js

Use an online css compressor, for instance CSS Compressor