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

jAlert

v4.9.1

Published

Simple jQuery (Modal | Popup | Lightbox | Alert) Plugin

Downloads

1,423

Readme

Join the chat at https://gitter.im/jAlert/Lobby Packagist Codeship npm

jAlert

by HTMLGuy, LLC (https://htmlguy.com)

example jalert

Demo & Detailed Docs

https://htmlguyllc.github.io/jAlert/

What is it?

Simple jQuery (Modal | Popup | Lightbox | Alert) Plugin

Whether you call it a lightbox, modal, popup, or window, jAlert is an excellent replacement / alternative for Simple Modal, FancyBox, or Reveal.

Getting the files

Available on NPM (https://www.npmjs.com/package/jAlert):

npm install jAlert

Dependencies

jQuery 1.7+

Setup

Include the CSS files from the folder in the head section:

<link rel="stylesheet" href="jAlert-master/dist/jAlert.css">

Include the JS file from the folder before the </body>:

<script src="jAlert-master/dist/jAlert.min.js"></script>
<script src="jAlert-master/dist/jAlert-functions.min.js"></script> <!-- COMPLETELY OPTIONAL -->

To use the 'data-jAlert' attributes, you must attach the handlers (must be re-attached for newly added dynamic content):

<a href='#' data-jAlert data-title='New jAlert!' data-content='Great job!'>Click Me</a>
$(function(){
  $.jAlert('attach');
});

This is the default usage. Doesn't require jAlert-functions.js

  $.jAlert({ //this is the normal usage
    'title': 'Test',
    'content': 'Howdy',
    'theme': 'green',
    'size': 'xsm'
  });

Quick Use (requires jAlert-functions.js!!!)

  alert('hi'); //override is enabled by default 

Note: When you run alert() in your console, it works as expected but will return "undefined"...ignore that. It's just because the function doesn't return anything. Had to add this disclaimer because people got confused..lol..

  successAlert('Success', 'You did it!'); //green alert
  errorAlert('Error', 'It didn\'t work!'); //red alert
  infoAlert('Info', 'Information!'); //blue alert
  warningAlert('Warning', 'Warning!'); //yellow alert
  blackAlert('Warning', 'Warning!'); //black alert (obviously)
  imageAlert('http://mydomain.com/myimg.jpg'); //optional second param is the image width (defaults to auto)
  videoAlert('http://youtube.com/viddk35k');
  ajaxAlert('http://mydomain.com/myfile.php'); //optional second param is onOpen callback which gets passed the instance of jAlert
  iframeAlert('http://mydomain.com'); //optional second param is height (defaults to fill the viewport height)
  confirm(function(){
    console.log('confirmed!');
  }, function(){
    console.log('denied');
  });
  $.fn.jAlert.defaults.backgroundColor = 'white'; //override a default setting
  
  $.fn.jAlert({ //same as $.jAlert when you're not passing an element - this alert will now have the white background color
    'title': 'Test',
    'content': 'Howdy',
    'theme': 'green',
    'size': 'xsm'
    //'backgroundColor': 'white' //you could also pass it here
  });
  
  $.fn.jAlert.defaults.backgroundColor = 'black'; //set it back to black
  $('.btn').alertOnClick({ //this function attaches an onclick handler to .btn and passes the options to jAlert
    'title': 'It worked!',
    'content': 'You clicked the button'
  });
  $.alertOnClick('.btn', { //this function attaches an onclick handler to the body for .btn and kicks off jAlert
    'title': 'Like magic',
    'content': 'You clicked the button that was dynamically added'
  });
  $.jAlert({ //creates a lightbox for the image - responsive and all
    'image': 'http://mysite.com/my-image.jpg'
  });
  $.jAlert({ //creates a lightbox for the video - responsive and all
    'video': 'http://youtube.com/dflskd'
  });
  $.jAlert({ //creates an alert that fills most of the height with a scrollable iframe
    'iframe': 'http://mysite.com'
  });
  $.jAlert({ //gets content from another file with $.get()
    'ajax': 'my-ajax-content.php'
  });