Giter VIP home page Giter VIP logo

bootstrap-notify's Introduction

Bootstrap Notify

This is a simple plugin that turns standard Bootstrap alerts into "Growl-like" notifications.

Manual Download - Stable Release

If toy would like to download the latest stable release please follow the link below

Please keep in mind that the master branch may contain bugs or broken code. Please use the link above if you are not able to debug and correct issues in the master branch. Thank you.

Bower Officially Supported

I would like to thank Błażej Krysiak for doing this!

bower install remarkable-bootstrap-notify

Meteor Officially Supported

Meteor integration by zimme.

meteor add mouse0270:bootstrap-notify

Changelog

Version 3.1.5 provided by chrismbarr - Testing

  • Cleaned Up Code
  • Fixed Spelling
  • Added Option to prevent Duplicate Notifications
  • TypeScript Definitions File
Version 3.1.3 - Stable Release
  • Added Meteor Support
  • Fixed issue with Glyphicons Pro
  • Updating version pattern.
x.y.z
x = Main version of the plugin
y = New features were added to the plugin
z = Fixes/patches to existing features of the plugin
  • Fixed update for backwards compatibility
  • Add the ability to update multiple values in one call
  • Turn off Progress bar
  • Set Progress bar value / Progress bar not shown by default
//Update
var notify = $.notify('<strong>Saving</strong> Do not close this page...', { allow_dismiss: false });
notify.update({ type: 'success', '<strong>Success</strong> Your page has been saved!' });

// Turn of Progress bar on
$.notify('I have a progress bar', { showProgressbar: true });

// Update Progress bar
var notify = $.notify('<strong>Saving</strong> Do not close this page...', { allow_dismiss: false });
notify.update({ type: 'warning', '<strong>Oops</strong> Something happened. Correcting Now', progress: 20 });
  • New template structure
  • Better event handling for onShow, onShown, onClose, onClosed
  • updating notification content will reposition growls below it
  • Fixed updating icon images
  • Fixed IE Issues with Growl URL not being able to be clicked on
  • Added the ability to show progress bars
  • Added the ability to pass position in the settings
  • Added newest_on_top option that allows new growls to push down old growls
  • Added Transition CSS to plugin
transition: all 0.5 ease-in-out;
  • Remember to read to documentation. I use custom css style's for the progress bar that you can find there. This was left out of the plugin so you could choose to use the default progressbar styles provided for bootstrap or write your own.
  • Added the ability to set an X and Y value within the offset option
  • Added callback options onShow, onShown, onHide and onHidden
  • Added a close all method to close all open growls
  • Fixed issue with growl not closing if there was no CSS animations
Version 2.0.0a2 (with IE8 Support)
  • Changed animate.in to animate.enter for IE8 compatibility
  • Changed animate.out to animate.exit for IE8 compatibility
  • Modified .is(':hover') for IE8 compatibility
  • Better Minification
  • Major rewright of the plugin file.
  • Added the ability to pass the growl a link making it clickable.
  • Added the ability to control the growl animations in and out using css.
  • Added the ability to set growl settings globally.
  • Removed jQuery fadeIn (use css to control growl animations)
  • Added onGrowlShow and onGrowlShown callback functionality.
Version 1.0.5
  • Better positioning when using CSS animations after growl closes.
Version 1.0.4
  • Updated $.growl() to return a wrapper object with a small API to let you control individual notifications after they have been created.
  • Added onGrowlClose and onGrowlClosed callback functionality.
Version 1.0.3
  • Made jQuery $.extend() Recursive so when you change just one option under position or template the script wont fail
Version 1.0.2
  • Fixed an issue where $.growl("message") would thrown an exception | Provided by DannyJo
Version 1.0.0
  • Initial Release

Demo and Documentation

NOTE: Some users have reported an issue where the demo/documentation links repsond with only pageok in the body. If that occurs for you, try emptying your browser cache or an alternate browser.

Dependencies

Copyright and License

The MIT License (MIT) Copyright (c) 2015 Robert McIntosh

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

bootstrap-notify's People

Contributors

areikuen avatar baltazarqc avatar bmaupinnit avatar brettneese avatar chrismbarr avatar damnedest avatar dannyjo avatar gitter-badger avatar grevus avatar icai avatar juliyvchirkov avatar kgeis avatar lukencode avatar masterspambot avatar mfunaro avatar mouse0270 avatar pgilad avatar rafa-alarcon avatar rickerd avatar simon-20 avatar tomasszabo avatar zimme avatar

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

bootstrap-notify's Issues

Close all growls

Is there a way to close all the growls at once? I've tried growl.close(); bit it doesn't work

Bug in Offset Amount Adjustment

The offset amount adjustment caused by the existence of multiple notifications with the same placement (https://github.com/mouse0270/bootstrap-notify/blob/master/bootstrap-notify.js#L195) does not take into account the element inside which the notification is placed.

For example, I have two sibling elements, A and B, and element A contains a notification in its top-right. If I create a notification in the top-right of element B, its offset will be adjusted due to the top-right notification in element A.

You can solve this issue on line 195 by searching for notifications with matching placement among the immediate children of this.settings.element instead of among the whole document.

Thanks,

Thomas Schellenberg

growl immediately disappears with bootstrap modals

I am using a form inside bootstrap modal with submit button.On clicking the submit button modal disappears as well as the growl notification.
I have set z_index of the growl higher than modal.Also tried setting delay property of growl,still not working.

Add type with title

How can i add the type with a title?
This didn't work for me.

$.growl( { 
  title: 'I have a title', 
  icon: 'glyphicon glyphicon-info-sign', 
  message: 'This growl contains both a Title and a Icon' ,
  type: 'danger'
});

Minor IE8 Bugs

In IE8, in is a reserved word and throws an error when using it as such: animate.in. It also throws an error when setting up: animate: {in: 'whatever'}.

There was also a problem with using $template.is(':hover'). The is(':hover') pseudo does not seem to be supported in IE8.

Other than that, this is awesome stuff.

closeAll does not flush the placement

Hello.

After using $.growl(false, {command: 'closeAll'}) a new one growl has a placement after the previous growl's position until the "delay" event.

Bower naming issue

In your readme you suggest to run bower install bootstrap.notify however this package is incorrect.

Instead it should be bower install remarkable-bootstrap-growl and then it works absolutely fine :)

Issue with documentation

On the web site you document to use placement.from, while in the code its position.from as of 2.0.0

Include bootstrap [col-xs-11 col-sm-3] into the default template

Hi, thanks for your awesome project.

It took me some time to realize why the notification on my page look worse than those that you have on your demo page. By default the notifications lack some indentation from the 'x' close button.

On your demo page you set up a template to use [col-xs-11 col-sm-3] css classes that are not present in the sources.

Since notifications do look better with those classes present, and since you basically expect your own results to resemble the demo page, I suggest changing the default template.

onHide asks for non-existent event

you either need to provide an event for onHide, or you need to remove the event argument:
line 262 of bootstrap-growl.js
if (settings.onHide) { settings.onHide(event); }

Set delay for growl auto close and time for show up

This is more a question than a issue. I made this code to show the Growl message:

$.growl({
    message: "Some text"
}, {
    type: "danger",
    delay: 8000,
    allow_dismiss: true,
    animate: {
        enter: 'animated bounceInDown',
        exit: 'animated bounceOutUp'
    }
});

But,

  • The message shows after long time
  • The message appears for a few seconds

Maybe I misunderstood the docs but what I want is to let the message at least for 8 seconds, how I do that?

X and Y offset values

Add the ability to set different values for the x and y offsets.

for example you should be able to do

offset: 20

which will set both to 20 pixels

offset: {
    x: 20,
    y: 10
}

Which well set the notification 20 pixels off on the x axis and 10 pixels off on the y axis.

Growl should escape message strings by default

Seems like currently this plugin does not escape the message string (though the public demo does), which could lead to injection vulnerabilities. I think it should be escaped by default, with an option to disable the escaping if the user knows what they are doing.

animate.css mandatory ?

Hi
I found an dependency issue , if remove animate.css in your demo page and use default setting , will cause close button broken.

Notifications are collapsing down on hide

Hello! I've set up the example you gave (the first one) added animations.css and for some reason, when it's time to hide the notifications, they all collapse, without any animation and only after, they fade out. I positioned them in the bottom right corner, but the top behaves the same. It's very strange, because the example on your website works perfectly.
EDIT: It happens on every browser i test.

version in js-file

Hi,

I just noticed the .js-file says version 2.0.0, although it's supposed to be version 2.0.1

keep up the good work :)

Not compatible with Glyphicons PRO fonts v1.9

I recently installed the new font package from: http://glyphicons.com/
They change their classes from:
example: ".glyphicons .leaf" to ".glyphicons .glyphicons-leaf"

My bootstrap growl alerts now loop the fade in animation.

Not sure how the conflict is happening since there is no js errors in the console. Maybe you might have perspective on what may be causing this.

Thank you.
Here is my source code:
http://i.imgur.com/F98Ui15.png

Here is a video of it happening:
https://www.youtube.com/watch?v=SFfVCXZrNP8&list=UUmZJZ53ymIhqMZO4sT8U90Q

Use bootstrap's dismissible alerts

I'm thinking we could try and use bootstrap's dismissible alerts when using allow_dismiss

The html changes should be small and the changing position of the close button won't be necessary
to keep styling concise with bootstrap.

Thinking we can use 'close.bs.alert' and 'closed.bs.alert' events to handle logic when dismissed
i.e. change position of other alerts on close.

What do you think? is it worth spending time on a PR?

Add back event triggers from 1.0.6

Add the ability to pass in a function for when a growl is being opened, when it is opened, when it is closing and when it is closed.

onshow: function() {},
onshown: function() {},
onhide: function() {},
onhidden: function() {}

Suggestion: Add option to disable to ticker if desired

currently I've done workaround by using a custom template that doesn't have the progressbar html in it, however the internal polling is still happening for it.

It'd be nice if there was an option to either enable or disable the ticker for notifications, and make it a global settings as well so notifications can default to either using or not.

$template variable

The $template variable leaks into window scope.
You might want to add $template to the variables on the very top of the plugin like:
var pluginName = "growl", $template;

Setting global defauly by API

How we can set default values in frontend by API.

template: {
    container: '<div class="col-md-3 growl-animated alert">'
  }

For example I want to make this default but nor I don't want edit source code neither have appetite to write the same thing over and over again?

Missing Version Tags

My company was using v2.0.1 in production, via Bower, and this morning all our builds broke because that tag no longer existed.

Did the tag get removed this morning during the v3 bump? If so, why?

composer

Please remove the jquery and bootstrap requirements as those are non existing packages without a vendor. Unless I'm doing something wrong?

Also on packagist the name bootstrap-growl is still in use.

Type does not change from 'info'

Hi,
I initialize growl this way, as suggested in the docs:

 $.growl(false, {
    delay: 4000,
allow_dismiss: false
});

then, when my own success(message) metod is called I do:

$.growl({
    icon: "fa fa-check-circle-o fa-lg",
    title: " Success! ",
    message: message,
    type: 'success'
});

But the notification is always of type info.

Thanks
Andrea

Passing a link to a growl?

Hi,

Anyone have any thoughts on the best way to include a link in a growl, or to make the whole alert clickable?

please add an option to integrate a progressbar for dismiss-delay

It would be nice to have a progress bar (either a tiny little bar at the top/bottom (just like youtube but only inside a growl-container) of each notification container or as a filler for the whole growl-container-background)
This way i can see when the growl container actually gets hidden.

i vote for Bootstrap Notification

There already exists notify.js which could get confusing (maybe with cdn also) aswell, so

Bootstrap Notification

makes more sense to me and is clear. :)

btw: Awesome work you did and looking forward to V3 :)

growl => notify

Did you do search replace growl => notify in http://bootstrap-growl.remabledesigns.com/? For example ifightcrime's bootstrap growl also became bootstrap notify and the link does not work.

Also maybe related to this rename or maybe bower.io search not working, but the only bootstrap.notify I found refers to another project. But bootstrap.growl still points correctly to your project in bower.io.

event not defined

Bug found in the onShow and onHide callback settings.

Lines 159 and 265.
there is no event object available to pass thru to the settings.onShow and onHide methods.
These are being called manually whereas the onShown and onHidden will have an event object supplied by the event binding for the end of animation.

I propose the following fixes as the easiest way to resolve this:

line 159
settings.onShow(jQuery.Event("show"));

line 265
settings.onHide(jQuery.Event("hide"));

There may also be another way, and that would be to fire the onhide and onshow events on the animation start (lines 181 and 276)

Thanks,

John

add id after growl has been created

Hi

How can I access the growl object after it has been created? I would like to add an id to the growl container. Unfortunaley this does not work:

var growl = $.growl({...},{...});

growl.attr('id','test');

Thanks,
Frank

update method api

From the documentation, api for update method is only modifying one parameter at a time eg notify.update("title", "new title"); To modify/update multiple parameters, we need to call update method multiple times.
Can I propose update api similar to the $.notify() api where multiple parameters can be modified at the same time?
Eg notify.update ({ icon: "fa fa-warning", title: "new title", message: "new message" });

the code logic has problem~!

$.growl({message:'This is an Successful Notification!',icon: 'fa fa-check',} , { type: 'success' });
when action this code, but output the type:info.

v1.0.4
`
if (Object.prototype.toString.call(content) == "[object Object]") {
message = content.message;
title = " "+content.title+" ";
icon = content.icon;
}else{
message = content;
}

`

v1.0.6

if (typeof content == "object") { message = content.message; title = content.title ? " "+content.title+" " : null; icon = content.icon ? content.icon : null; options = content; }else{ message = content; }

Center-aligned growl is not responsive with screen resize

To Duplicate:

  • Navigate to bootstrap-growl.remabledesigns.com
  • "Create Growl" with extended delay and set to the center of the screen
  • Decrease window size, down to mobile width (for example)
  • Growl may extend off the screen or appear not centered

See example Screenshot: http://i.imgur.com/sbqxbVa.png

Seems obscure, what is the use-case?
For us, the issue comes up with rotation on mobile devices. For example, if the user triggers the growl in landscape and then rotates to portrait, a situation much like the above screenshot can occur.

What's the fix?
We've got a window resize listener to re-set the growl's margin-left at -($growl.outerWidth() / 2) + 'px' and it seems to work just fine... but maybe there is another, more robust solution?

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.