GithubHelp home page GithubHelp logo

sciactive / pnotify Goto Github PK

View Code? Open in Web Editor NEW
3.7K 162.0 513.0 19.12 MB

Beautiful JavaScript notifications with Web Notifications support.

Home Page: https://sciactive.com/pnotify/

License: Apache License 2.0

CSS 13.47% JavaScript 14.23% HTML 47.97% Shell 0.09% TypeScript 0.88% Svelte 23.35%
pnotify desktop-notifications javascript html notifications ui ui-components jquery

pnotify's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pnotify's Issues

Feature request: Add click event for notifications

It would be nice to be able to specify a click handling callback for each notification (or a global one I suppose). The handler would be called any time the notification is clicked unless the user is clicking the sticker or close buttons.

This functionality could be used to perform the following actions:

  • Close the notification - Easier method to dismiss a notification than searching for the tiny button.
  • Stick/Unstick the notification - Easier method than searching for the button.
  • Take user to resource mentioned in the notification (either another URL or a hashtag for something on the current page).
  • Display more detailed content.
  • Maximize the notification.
  • Overlay the rest of the page with a blurring layer so that the notification is highlighted (i.e. like a jQuery modal dialog).
  • Some combination of the above.

Of course I'm not asking that those actions be built-in. Those are just a few ideas I came up with that would be possible with a click handler and would really be nice to be able to do.

Examples:

$.pnotify({
    title: 'New message',
    text: 'You have a new message from Joe',
    click: function(){
        window.location.href = "http://mysite.com/messages/messageFromJoeId";
    }
});
$.pnotify({
    title: 'New message',
    text: 'You have a new message from Joe',
    click: function(){
        $(this).append('<div class="messageContents">Hey man, how\'s it going?</div>');
    }
});

FEATURE: Close All

Similar to jGrowl plugin it would be nice to show a "close all" option below the notifications. The script was provided in the sample page for how to close all but having a built-in button appear would be nice.

New option to adjust position-animation-speed

Pretty simple: Add an option to enable the adjustment of the position-animation-speed.

I already did that in my copy of pnotify:

  1. Extend $.pnotify.defaults with position_animate_speed: 500
  2. Line 480: Replace
    pnotify.animate(animate, {duration: 500, queue: false});
    with
    pnotify.animate(animate, {duration: this.opts.position_animate_speed, queue: false});

BUG: Notes don't slide down more than second position

In your examples, in the section of "Really Different Stacks", having stack: stack_bar_bottom has a bug: when you fire like 4-5 notes, delaying between them like 2 seconds, the first one just fades out, but second and further, they slide down to the position of the just hidden note. I expect that second note also slides down to the first position. Currently all notes slide to the second position only, not to the first one.

I don't know if I'm clear enough, hope you get it.

Customize Pnotify

I use pnotify, Optimization is very important in my project, but i don't know use pnotify customize. i think it's very good to create a thing like bootstrap customization. for example i don't use from pnotify history, but i don't know witch parts of css and javascript must be remove or i use two simple type of notification but i don't now how i can remove extra notification type.

pnotify.pnotify_remove() does not remove a pnotify from jwindow.data('pnotify')

When pnotify.pnotify_remove() is called, it does not remove the pnotify object from jwindow.data('pnotify'), meaning that if $.pnotify_remove_all is called every 30 seconds, the pnotify.after_close / pnotify.before_close methods will be called for any notifications that have been displayed, even if they've been closed.

Add the time of the notification

For instance when a notification appears set the hours like:

  • 12:52
  • 12h52 25s
  • 15 seconds ago (when you hover this; it's display the original hour like 12:25:20)

What do you thinks about that ?

Show last 5 different messages

Can you please introduce a feature to display last n number of different notices, where n may b 1,2,3...20 as mentioned by user.

FEATURE: Stacks (included)

The javascript and css for topleft, bottomleft, bottomright, topbar, and bottombar should be part of the standard install files. It took me a while to figure out i needed to steal code from the source of the demo page in order to make them work.

Latest tag v1.2.0 doesn't match HEAD

Hi,

just tried to integrate pnotify via bower (bower install sciactive/pnotify --save) into a project. Thereby the latest tag is fetched, which does not contain the stack styles. This is a little bit confusing, and won't work properly.

f651534

Thanks & Regards
100hz

Disable Redisplay

I haven't dug into the source yet. But there should be a documented option to not display the Redisplay menu at the top.

pnotify_remove() doesn't work when hovering over notification

I have a pnotify notification informing the user that the page is loading (there's some AJAX stuff going on in the background). I remove the notification when everything is done using the pnotify_remove() function.

However, I've noticed that if I'm hovering over the notification with my mouse, the notification will never get removed by pnotify_remove(). I don't have any close buttons on this notification, so now the notification is stuck on the page and there is no way to remove it.

Shouldn't the pnotify_remove() function remove the notification no matter what the user is doing?

Integrating with ajax chat

I would like to integrate this with ajax chat. But I am not very familiar with java script can someone point in the right direction please.

Add support for confirmation

Either add a confirmation function, or if there is anyway to handle the JS confirm function like the JS alert handling. In using pnotify as the standard for user user feedback platform on an app, it leaves out this crucial part of web form and UI behavior. We can handle it using native jquery UI or just JS, but having an integrated, consistent UX framework would be preferable.

Boostrap Success Alert

You have the rest, so why not just add the success styling. To get this to work i obviously did the custom class, but shipping it with the product would be nice. I also added opacity to the close icon.

Thanks for the great product!

/* Close icon has opacity unless hover*/
.ui-pnotify.custom .ui-pnotify-closer {
    position: absolute;
    right: 14px;
    top: 8px;
    opacity: 0.2;
}
.ui-pnotify.custom .ui-pnotify-closer:hover {
    opacity: 0.5;
}

getter for visibility status

It would be quite useful, if you could determin, wether a notice is visible or not at a certain state.
Problem is, when running

myNotice.pnotify_display();

when it is visible already, the animation is triggered again, which makes it look awefull.

Solution could look like this:

if(!myNotice.pnotify_isVisible()) {
     myNotice.pnotify_display();
}

FEATURE: Closing specific notices

Could we have a way to specify which notice we want to close (perhaps via id or data-)? This is kind of an enhancement to our ability to close all current notices.

For instance: if I created a sticky notice because I noticed something wasn't loaded/working properly but then also run a check a few seconds later and find that it has been loaded I'd like to be able to close my earlier notice without having to close every single one.

In isolated and completely locked down environments I can see where simply calling the function to close all notices would suffice, but in complex apps other notices (or multiple sticky failure notices) might need to stay.

scroll

Hi thx for nice and cool stuff. :)

is there any way to apply scroll option ? because I am using more than one notice per page and one notice contents are too big to fit.

Limiting the number of notifications

Is there anyway to limit the number of notifications show at a time? I can't seem to figure out a way to do it, or if there is way, I am not able to find it.

Thank you!

Who's driving this thing?

Master has had no activity in a year. I don't see any open issues getting responded to. ...Pnotify isn't under active development any more, is it =(

Sticky ruban

I don't know what I am doing wrong, but I have a problem with ruban (the little thingy with "redisplay" buttons).

If I create a notif after the page is loaded, it works fine (appears collapsed, expand on mouseover).
However if the notif is created within
$(function() { /* create notif */ });
The ruban says expanded whatever I do.

Any idea?

TIA

greg

Calling alert or confirm in a onclick handler disables closing of notice in IE10.

I close the notice in a onclick handler with:
notice.pnotify({pnotify_remove: true});
notice.pnotify_remove();

If I call alert or confirm in the onclick handler, the notice is never closed in IE10.
Any idea?

Here is a minimum code:
var tm = new Date().toString(),
nt = jQuery.pnotify({hide:false, history: false, title:'Alert',text:tm, type:'info'}).click(function(e){ e.preventDefault(); nt.pnotify({pnotify_remove:true}); nt.pnotify_remove(); alert('Act on warning');});

History div positionning

Could not find a simple way to move the history div bottom right as I have my notification there.
Any way to add this feature ?

Couldn't find 'pnotify'

couldn't find file 'pnotify'
(in /home/neilmarion/ROR/projects/ppm/app/assets/javascripts/application.js:20)

Long message outside the box

Hello,

If you have a very long message (p.e., an url) that doesn't contain a space, the text goes outside the box.

Is it possible to create some kind of a layer that cuts the extra text? It would be better looking than current approach.

Thanks

image

FEATURE : click to close

Hi,

This would be great to be able to close the notification by clicking anywhere in the notification element (".ui-pnotify").

This feature is easy to add, and is especially useful for mobile devices with limited "click" area accuracy.

Pending this, is there a function to programmatically close the notification? This way, we would be able to add a global "click" hook on ".ui-pnotify" in order to close the notif.

Thank you for your interest in this suggestion,

Anyone use this with rails flash?

This is not an issue really but I'd appreciate if this was left open to give someone the chance to suggest how pnotify might be used with rails messages.

Anyone out there using pnotify with rails flash that can suggest how to make it work?

pnotify broken for jquery 1.4.2

Hi, we are running jquery 1.4.2 in production (upgrading as I write this) and i was looking at using pnotify but for some reason there was no note!
Further investigation showed that 1.4.[0,1,3,4] all work with my simple test; but 1.4.2 doesn't.
I tested with chrome-v19 and firefox-v13 on osx-v10.6.8.

<html>
<head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>                                                                 
    <script type="text/javascript" src="http://pinesframework.org/pnotify/jquery.pnotify.js"></script>

    <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/ui-lightness/jquery-ui.css" />
    <link type="text/css" rel="stylesheet" href="http://pinesframework.org/pnotify/jquery.pnotify.default.css" />
</head>                                                                                                                                                                        
<body>                                                                                                                                                                         
    <h2>This is Foo - the home of a sticky note.</h2>
    <script>                                                                                                                                                                   
        $(function(){ $.pnotify({ pnotify_title: 'Sticky Notice', pnotify_text: 'I\'m a sticky notice.', pnotify_hide: false }); });                                           
    </script>                                                                                                                                                                  
</body>                                                                                                                                                                        
</html>

Advanced Demos first time appearance

On demos page
http://pinesframework.org/pnotify/
In "Advanced Demos" section => "Really Different Stacks" => "Bottom bar style. (Like New Microsoft Notification Bars.) Moves up, then right. Pushes to stack bottom."

Clicking any of Notice, Info, Success, Error buttons for first time notify appears not in the bottom middle, but to the right of the screen and quickly moves to the middle(expected position). Next time it appears in the middle as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.