3.3.2 • Published 4 months ago

notify-sl v3.3.2

Weekly downloads
5
License
MIT
Repository
github
Last release
4 months ago

finwo / notify-sl

npm npm

Simple notification library

Why

another notification library, you ask?

Because most don't provide a clear interface AND are theme-able with simple css.

Installation

npm install --save notify-sl

Usage

Browser

First, you'll need to include either of these scripts inside your page. If requirejs' define function was found, it will register itself under the name notify-sl.

<script type="text/javascript" src="/path/to/bower/components/notify-sl/dist/notify-sl.js"></script>
<script type="text/javascript" src="/path/to/bower/components/notify-sl/dist/notify-sl.min.js"></script>

After including it on your page, you can start sending notifications to your users as follows:

notifysl.alert(  'message', 'title', options, callback);
notifysl.confirm('message', 'title', options, callback);
notifysl.prompt( 'message', 'title', options, callback);

// For if you want more control:
notifysl.open({
  closeAll: <boolean>, // Indicates if you want to close all other notifications
  callback: <function>,
  buttons: {
    'buttonText': <value>,      // Gets the classes: btn btn-default btn-primary
    'someOtherButton': <value>, // Gets the classes: btn btn-default
  },
  timeout: <milliseconds>,
  
  // Either contents or message+title
  contents: <html, jq object, jq object array>,
  
  message: 'notification text',
  title: 'notification title'
});

Node.JS

Sorry, this package is not intended for usage outside of a browser.

Contributing

After checking the Github issues and confirming that your request isn't already being worked on, feel free to spawn a new fork of the develop branch & send in a pull request.

The develop branch is merged periodically into the master after confirming it's stable, to make sure the master always contains a production-ready version.

3.3.1

4 months ago

3.3.0

4 months ago

3.2.0

4 months ago

3.3.2

4 months ago

3.1.8

4 years ago

3.1.7

5 years ago

3.1.6

5 years ago

3.1.5

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.0

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago