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

ng-browser-update

v1.1.0

Published

AngularJS directive for Browser-Update.org (http://browser-update.org): out-dated browsers notifier

Downloads

17,470

Readme

ng-browser-update Build StatusdevDependency Status

AngularJS directive for Browser-Update.org: out-dated browsers notifier.

Demo: http://tinesoft.github.io/ng-browser-update

Installation

Using bower:

bower install ng-browser-update

Using npm:

npm install ng-browser-update

How to use it

You should already angular script referenced. If not, add it:

<script type="text/javascript" src="angular.min.js"></script>

Then add the library:

<script type="text/javascript" src="ng-browser-update.min.js"></script>

Next, inject ngBrowserUpdate in your application module:

angular.module('myApp', ['ngBrowserUpdate']);

and then just add an browser-update tag in your main file (index.html for example):

<browser-update></browser-update>

Implemented features so far:

  • versions : browser versions to notify
  • language : set a language for the message, e.g. "en", overrides the default detection
  • reminder : atfer how many hours should the message reappear: 0 = show all the time
  • new-window: open link in new window/tab
  • always-show-bar: always show the bar (for testing)
  • notification-text : custom notification html text (takes precedence over the 'language' option)
  • on-notification-bar-shown: callback function after the bar has appeared
  • on-notificationBar-clicked: callback function if bar was clicked

Example with some above features:

<browser-update  
 versions="{i:8,f:8,o:9.63,s:2,c:8}" reminder="1"
 always-show-bar="false" new-window="false" 
 notification-text="This is my custom notification message">
</browser-update>

Easy i18n support for custom notification message

Version v1.1 of ng-browser-update makes it possible to use angular's expressions as value for the notification-text attribute. This allows you to use, for example, angular-translate's translate filter, to easily translate the custom message that appears in the notification bar.

Here is an example:

<browser-update  
 versions="{i:8,f:8,o:9.63,s:2,c:8}" reminder="1"
 always-show-bar="false" new-window="false" 
 notification-text="{{ 'CUSTOM_NOTIFICATION_MESSAGE_ID' | translate }}">
</browser-update>

where CUSTOM_NOTIFICATION_MESSAGE_ID is the key of the message.

More information on how to use angular-translate's translate filter can be found here.

Features to be implemented:

  • onNotificationClosed : callback when user closes the notification bar

Build

You can run the tests by cloning the repo and then (inside the project folder) running

npm install
bower install
grunt watch

assuming you already have grunt installed, otherwise you also need to do:

npm install -g grunt-cli

License

Copyright (c) 2015 Tine Kondo. Licensed under the MIT License (MIT)

Thanks To

Credits and thanks go to the team behind Browser-Update.org for this awesome initiative!