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

ember-notifyme

v3.0.0

Published

Show notifications in your Ember app.

Downloads

123

Readme

Ember-notifyme

Simple addon that adds ability to show popup notifications.

DEMO: http://igorkvasn.github.io/ember-notifyme/

Features

  • countdown (notification message will disappear after certain timeout) + countdown progress bar
  • onClick and onClose callbacks
  • animations (VelocityJS)
  • full customization of icons (by default FontAwesome is supported, but any HTML element can be used instead - e.g. Glyphicons, IcoMoon,...)
  • supports HTML content

Installation

ember install ember-notifyme

  • Ember.js v3.20 or above
  • Ember CLI v3.20 or above
  • Node.js v12 or above

Usage

Add this component anywhere into your hbs file (eg. application.hbs)

{{notification-panel}}

To trigger a notification message you can either:

this.notifications.addMessage({
  message: "My message"
  //other options here
});

or use convenience methods success, info or error:

this.notifications.info("My info message", options);

To hide a notification:

this.notifications.removeMessage(message);

To hide all notifications:

 this.notifications.removeAll();

Note: by default, FontAwesome must be included in your project - to use different icon set, see Global Configuration section below for a configuration hints

Callbacks

You can also use callbacks onClick and onClose that take a function with one parameter (message that triggered this callback);

this.notifications.addMessage({
  message: "My message"
  onClick(message){
    alert('message clicked!');
  },
  onClose(message){
    alert('message closed!');
  }
});

Another callback available is onCloseTimeout that is called whenever notification's timeout expires and the notification message is auto-closing.

this.notifications.addMessage({
  message: "My message"
  onCloseTimeout(message){
    alert('message timeout expired');
  }
});

List of available options:

| Option | Description | Default value | | ------------- |-------------| -----| | type | type of message; possible values: 'info', 'error', 'success'; CSS class of the same name will be added to notification message to allow styling | 'info' | | message | text of a message | | | timeout | time before notification disappears | based on notification type (errors have no timeout, otherwise 8000 milis) | | sticky | if true, notification will not disappear | based on notification type (errors are sticky=true) | | htmlContent | enabled/disables HTML content in message (Warning: be sure to properly escape message if this option is set to true) | false | | closeOnClick | if set to true, message is closed when user clicks on it | false | | onClose | callback triggered when user clicks on X button to close the notification | | | onClick | callback triggered when user clicks on the notification | | | onCloseTimeout | callback triggered when message timeout expires and message is automatically closed (see timeout option above) |false | |data | any arbitrary data |

Global configuration

Some options can be globally configured so you do not have to set the same options over and over. Additionally icons can be configured as well. In config/environment.js you can configure globals such as (every entry is optional, eg. if you do not specify success timeout, default will be used):

ENV['ember-notifyme']={
  closeIconHTML: '<i class="fa fa-times"></i>',
  messages:{
    success: {
      timeout: 8000,
      icon: '<span class="fa-stack fa-sm"><i class="fa fa-circle-thin fa-stack-2x"></i>  <i class="fa fa-check fa-stack-1x"></i></span>'
    },
    error: {
      sticky: true,
      icon: '<span class="fa-stack fa-sm"><i class="fa fa-circle-thin fa-stack-2x"></i>  <i class="fa fa-exclamation fa-stack-1x"></i></span>'
    },
    info: {
      timeout: 8000,
      icon: '<span class="fa-stack fa-sm"><i class="fa fa-circle-thin fa-stack-2x"></i>  <i class="fa fa-info fa-stack-1x"></i></span>'
    },
  }
}

Addon Development

  • git clone this repository
  • npm install
  • bower install

Linting

  • ember server
  • Visit your app at http://localhost:4200.

Running tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Running the dummy application

For more information on using ember-cli, visit http://www.ember-cli.com/.