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 🙏

© 2026 – Pkg Stats / Ryan Hefner

bootstrap-confirm-delete

v2.1.3

Published

Bootstrap confirm delete modal dialog jquery plugin

Readme

Bootstrap Confirm Delete

Bootstrap confirm delete modal dialog jquery plugin

Installation

You can install from npm.

$ yarn add bootstrap-confirm-delete
$ npm install --save bootstrap-confirm-delete

Dependencies

This plugin depends on the following:

  • jquery >= 1.9.1
  • bootstrap >= 3.3.5

NOTE: This plugin has not been tested with versions prior to these.

Basic Usage

This plugin will intercept the delete event on configured page elements. In this example it will block the deletion click on any links or buttons that have the 'delete' class on them.

<script src="jquery.js"></script>
<script src="bootstrap-confirm-delete.js"></script>
<a href="server.php" class="delete" data-type="post">Delete</a>

Initialise the plugin either in tags on the html page or in an external .js script.

$(document).ready(() => {
  $('.delete').bootstrap_confirm_delete();
});

Notice the 'data-type' attribute on the link. The plugin will use this attribute if set to show a custom delete message. For example,

Heading: 'Delete Post'

Message: 'Are you sure you want to delete this post?'

Example

This example shows all the available options:

$(document).ready(() => {
  $('.delete').bootstrap_confirm_delete({
    debug: false,
    heading: 'My Custom Delete Heading',
    message: 'Are you sure you want to delete this item?',
    btn_ok_label: 'Yes',
    btn_cancel_label: 'Cancel',
    data_type: 'post',
    callback: (event) => {
      // grab original clicked delete button
      var button = event.data.originalObject;
      // execute delete operation
      button.closest('tr').remove();
    },
    delete_callback: () => {
      console.log('delete button clicked');
    },
    cancel_callback: () => {
      console.log('cancel button clicked');
    },
  });
});

See test directory for a more complete example

Options

Bootstrap Confirm Delete plugin comes with several optional settings.

debug

Debug mode will output events and information to the console.

heading

This is for setting a custom modal heading.

message

Setting a custom delete message/question.

btn_ok_label

Set the confirm label text

btn_cancel_label:

Set the cancel label text

data_type

Used if heading & message are not provided

callback

Will fire if responding to a button click that has no href attribute.

Use this callback to do any deletions from a button click. Parameters:

  • data (data.originalObject contains the originally clicked object)

delete_callback

Will fire when the delete button is clicked and a handler is provided. Parameters:

  • data (data.originalObject contains the originally clicked object)

cancel_callback

Will fire when the cancel button is clicked and a handler is provided. Parameters:

  • data (data.originalObject contains the originally clicked object)

License

Copyright © 2015-2019 Tom Kaczocha [email protected]

Licensed under the MIT license.

Contributors

Special thanks to: