npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bootstrap-dialogs

v0.3.1

Published

Twitter Bootstrap Modal Dialogs

Downloads

9

Readme

Bootstrap Dialogs

Latest npm version Number of npm downloads Build Status

Description

Asynchronous modal dialogs for the synchronous window.alert, window.confirm and window.prompt, styled and managed by Twitter Bootstrap. Pretty similar to Bootbox, yet using jQuery's Deferred objects.

Usage

alert, confirm and prompt all support custom title and body. Additionally, they support setting the button text and severity (default and danger at the moment).

// Alert dialog with custom title and body
Bootstrap.Dialogs.alert({ title: 'Alert title', body: 'Alert body' })
  .done(function () {
    ...
  });

// Confirm dialog with default text
Bootstrap.Dialogs.confirm()
  .done(function () {
    ...
  })
  .fail(function () {
    ...
  });

// Prompt dialog with custom title and body
Bootstrap.Dialogs.prompt({ title: 'What is your name?', body: 'Please enter your name' })
  .done(function (name) {
    ...
  })
  .fail(function () {
    ...
  });
  
// Confirm dialog with custom button text
Bootstrap.Dialogs.confirm({ ok: 'Confirm', cancel: 'Abort' });
  
// Critical alert dialog
Bootstrap.Dialogs.alert({ danger: true });

Development

TL;DR: npm install && npm test

Install Node and Npm using your packet manager of choice.

Install development dependencies:

npm install

Build and run the tests:

npm test

Start a development cycle listening for changes to files running a simple static server, CoffeeScript linting + compilation, and the test suite:

npm start

Examples

To see the examples in action, issue npm install && npm start and access http://localhost:8000/examples/.

Upgrade the distribution files

In order to upgrade the distribution files bundled in the repo, run npm run-script dist.

Perform release

  • Update Release notes
  • Bump package.json and bower.json version numbers
  • Run npm run dist to update all distribution sources
  • git tag -a <tag> with the appropriate version number

Release notes

v0.3.1 (2015-06-04)

  • Support require of jQuery and bootstrap for better browserify integration.

v0.3.0 (2015-05-28)

  • Add very basic CommonJS support.

v0.2.8 (2014-05-06)

  • Fix leak of click handlers between buttons.

v0.2.7 (2014-02-25)

  • Disable scrolling of body behind a dialog.

v0.2.6

  • Upgrade jQuery dependency to 1.10.2.
  • Capitalize "OK" texts.

v0.2.5

  • Make Bower dependencies looser.

v0.2.4

  • Fix #5: Allow clicking the backdrop to dismiss (unless "lock" is true).
  • Fix #4: Add "lock" option to disable ESC closing.
  • Replace noButtons with lock option.

v0.2.3

  • Remove positional arguments support from .dialog.
  • Add noButtons option to .dialog.

v0.2.2

  • Add return option to allow confirm dialogs to optionally be resolvable by pressing the return key.

v0.2.1

  • Fix #3: Allow setting alert, confirm and prompt button texts.

v0.2.0

  • Update API's argument passing style to be objects rather than regular argument list.
  • Fix #2: Add option to make the 'OK' button take on the btn-danger class.

v0.1.0

  • Add keyboard bindings for Return and Escape

v0.0.3

  • Add grunt-cli as a dependency
  • Depend on jQuery 1.8.3 to match Bootstrap
  • Allow buttons to be jQuery objects or DOM elements
  • Make "Ok" buttons primary

v0.0.2

  • Add Bootstrap and jQuery as component dependencies.
  • Submit prompt on Return keypress.
  • Give prompt input focus.
  • Wrap titles in h3.
  • Add close button by default.

v0.0.1

  • Initial release.

License

Distrubuted under the ISC license. Please refer to the LICENSE.