Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
6.1 KiB

  1. # jGrowl
  2. jGrowl is a jQuery plugin that raises unobtrusive messages within the browser, similar to the way that OS X's Growl Framework works. The idea is simple, deliver notifications to the end user in a noticeable way that doesn't obstruct the work flow and yet keeps the user informed.
  3. ## Example usages
  4. // Sample 1
  5. $.jGrowl("Hello world!");
  6. // Sample 2
  7. $.jGrowl("Stick this!", { sticky: true });
  8. // Sample 3
  9. $.jGrowl("A message with a header", { header: 'Important' });
  10. // Sample 4
  11. $.jGrowl("A message that will live a little longer.", { life: 10000 });
  12. // Sample 5
  13. $.jGrowl("A message with a beforeOpen callback and a different opening animation.", {
  14. beforeClose: function(e,m) {
  15. alert('About to close this notification!');
  16. },
  17. animateOpen: {
  18. height: 'show'
  19. }
  20. });
  21. ## Configuration Options
  22. | Option | Default | Description |
  23. |------------------|--------------------------------------|------------------------------------------------------------|
  24. | pool | 0 | Limit the number of messages appearing at a given time to the number in the pool. |
  25. | header | empty | Optional header to prefix the message, this is often helpful for associating messages to each other. |
  26. | group | empty | A css class to be applied to notifications when they are created, useful for 'grouping' notifications by a css selector. |
  27. | sticky | false | When set to true a message will stick to the screen until it is intentionally closed by the user. |
  28. | position | top-right | Designates a class which is applied to the jGrowl container and controls it's position on the screen. By Default there are five options available, top-left, top-right, bottom-left, bottom-right, center. This must be changed in the defaults before the startup method is called. |
  29. | glue | after | Designates whether a jGrowl notification should be appended to the container after all notifications, or whether it should be prepended to the container before all notifications. Options are after or before. |
  30. | theme | default | A CSS class designating custom styling for this particular message, intended for use with jQuery UI. |
  31. | themeState | highlight | A CSS class designating custom styling for this particular message and it's state, intended for use with jQuery UI. |
  32. | corners | 10px | If the corners jQuery plugin is include this option specifies the curvature radius to be used for the notifications as they are created. |
  33. | check | 250 | The frequency that jGrowl should check for messages to be scrubbed from the screen.This must be changed in the defaults before the startup method is called. |
  34. | life | 3000 | The lifespan of a non-sticky message on the screen. |
  35. | closeDuration | normal | The animation speed used to close a notification. |
  36. | openDuration | normal | The animation speed used to open a notification. |
  37. | easing | swing | The easing method to be used with the animation for opening and closing a notification. |
  38. | closer | true | Whether or not the close-all button should be used when more then one notification appears on the screen. Optionally this property can be set to a function which will be used as a callback when the close all button is clicked. This must be changed in the defaults before the startup method is called. |
  39. | closeTemplate | × | This content is used for the individual notification close links that are added to the corner of a notification. This must be changed in the defaults before the startup method is called. |
  40. | closerTemplate | <div>[ close all ]</div> | This content is used for the close-all link that is added to the bottom of a jGrowl container when it contains more than one notification. This must be changed in the defaults before the startup method is called. |
  41. | log | function(e,m,o) {} | Callback to be used before anything is done with the notification. This is intended to be used if the user would like to have some type of logging mechanism for all notifications passed to jGrowl. This callback receives the notification's DOM context, the notifications message and it's option object. |
  42. | beforeOpen | function(e,m,o) {} | Callback to be used before a new notification is opened. This callback receives the notification's DOM context, the notifications message and it's option object. |
  43. | afterOpen | function(e,m,o) {} | Callback to be used after a new notification is opened. This callback receives the notification's DOM context, the notifications message and it's option object. |
  44. | open | function(e,m,o) {} | Callback to be used when a new notification is opened. This callback receives the notification's DOM context, the notifications message and it's option object. |
  45. | beforeClose | function(e,m,o) {} | Callback to be used before a new notification is closed. This callback receives the notification's DOM context, the notifications message and it's option object. |
  46. | close | function(e,m,o) {} | Callback to be used when a new notification is closed. This callback receives the notification's DOM context, the notifications message and it's option object. |
  47. | animateOpen | { opacity: 'show' } | The animation properties to use when opening a new notification (default to fadeOut). |
  48. | animateClose | { opacity: 'hide' } | The animation properties to use when closing a new notification (defaults to fadeIn). |