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-flash-message-2000

v0.0.8

Published

Easy flash messages for your Ember-CLI app.

Downloads

32

Readme

Ember Flash Message 2000

Installation

This is an ember-cli addon and can be installed using npm:

npm install --save-dev ember-flash-message-2000

Demo

You can see the basic dummy app here:

Basic API

  {{flash-messages}}

// From within a route, controller, or component...

// The basic flash message. Displays itself after the next route transition occurs
this.get('flashMessage').addMessage({text: 'hello', type: 'alert alert-success'});

// The same as above, but it will automatically dismiss itself after 5 seconds
this.get('flashMessage').addMessage({dismiss: 5000, text: 'hello', type: 'alert alert-success'});

// Shows immediately
this.get('flashMessage').addMessage({text: 'hello', type: 'alert alert-success'}).now();

// Shows immediately and removes itself after 3 seconds
this.get('flashMessage').addMessage({text: 'goodbye', type: 'alert alert-success', dismiss: 3000}).now();

Custom Dismiss Effects

If you'd like to add your own dismiss effects, all you need to do is override the default initializer. To do this, just copy the default one from this repository to your own project, ensuring the filename is the same. The initializer allows you to pass a config object that has a customDismiss method, which will be used in place of default one. You can see an example of this below:

// your-app/initializers/flash-message-2000.js
import Ember from 'ember';
import {initialize} from 'ember-flash-message-2000/initializers/flash-message-2000';

if(Ember.libraries) {
  Ember.libraries.register('Ember Flash Message 2000', '0.0.7');
}

export default {
  name: 'ember-flash-message-2000',
  initialize: function(container, application) {
    var config = {
      customDismiss: function() {
        var _this = this;
        this.$().fadeOut(1000, function() {
          _this.get('flashMessage.messages').removeObject(_this.get('message'));
        })
      }
    };
    initialize(container, application, config);
  }
};

Template Customizations

If you'd like to customize the markup of the flash messages you can leverage the power of Ember-CLI and simply override the default templates provided by Ember-Flash-Message-2000. These are all defined here. In simple terms, create a folder in your host application templates/components/ember-flash-message-2000/, copy over the existing templates from this project, and modify to your liking. At the moment the markup is taken directly from bootstrap.

Demo App

You can see a more holistic example by looking at the Dummy app that we use to test against. The index.hbs template and the application route are of particular interest.