pnotify-init.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. PNotify.prototype.options.styling = "bootstrap3";
  2. $(document).ready(function() {
  3. $('#pn-simple').on('click', function() {
  4. new PNotify('Check me out! I\'m a notice.');
  5. });
  6. $('#pn-regular').on('click', function() {
  7. new PNotify({
  8. title: 'Regular Notice',
  9. text: 'Check me out! I\'m a notice.',
  10. addclass: 'alert-with-icon'
  11. });
  12. });
  13. $('#pn-glyphicon').on('click', function() {
  14. new PNotify({
  15. title: 'Bootstrap Icon',
  16. text: 'I have an icon that uses the Bootstrap icon styles.',
  17. icon: 'glyphicon glyphicon-envelope',
  18. addclass: 'alert-with-icon'
  19. });
  20. });
  21. $('#pn-custom-icon').on('click', function() {
  22. new PNotify({
  23. title: 'Custom Icon',
  24. text: 'I have an icon that uses the Bootstrap icon styles.',
  25. icon: 'font-icon font-icon-warning',
  26. addclass: 'alert-with-icon'
  27. });
  28. });
  29. $('#pn-no-icon').on('click', function() {
  30. new PNotify({
  31. title: 'No Icon Notice',
  32. text: 'I have no icon.',
  33. icon: false
  34. });
  35. });
  36. $('#pn-info').on('click', function() {
  37. new PNotify({
  38. title: 'New Thing',
  39. text: 'Just to let you know, something happened.',
  40. type: 'info',
  41. icon: 'font-icon font-icon-warning',
  42. addclass: 'alert-with-icon'
  43. });
  44. });
  45. $('#pn-success').on('click', function() {
  46. new PNotify({
  47. title: 'Regular Success',
  48. text: 'That thing that you were trying to do worked!',
  49. type: 'success',
  50. icon: 'font-icon font-icon-check-circle',
  51. addclass: 'alert-with-icon'
  52. });
  53. });
  54. $('#pn-danger').on('click', function() {
  55. new PNotify({
  56. title: 'Oh No!',
  57. text: 'Something terrible happened.',
  58. type: 'error',
  59. icon: 'font-icon font-icon-warning',
  60. addclass: 'alert-with-icon'
  61. });
  62. });
  63. $('#pn-warning').on('click', function() {
  64. new PNotify({
  65. title: 'Oh No!',
  66. text: 'Something terrible happened.',
  67. icon: 'font-icon font-icon-warning',
  68. addclass: 'alert-with-icon'
  69. });
  70. });
  71. $('#pn-purple').on('click', function() {
  72. new PNotify({
  73. title: 'Oh No!',
  74. text: 'Something terrible happened.',
  75. icon: 'font-icon font-icon-warning',
  76. addclass: 'alert-with-icon alert-purple'
  77. });
  78. });
  79. $('#pn-white').on('click', function() {
  80. new PNotify({
  81. title: 'Oh No!',
  82. text: 'Something terrible happened.',
  83. icon: 'font-icon font-icon-warning',
  84. addclass: 'alert-with-icon alert-white'
  85. });
  86. });
  87. $('#pn-grey').on('click', function() {
  88. new PNotify({
  89. title: 'Oh No!',
  90. text: 'Something terrible happened.',
  91. icon: 'font-icon font-icon-warning',
  92. addclass: 'alert-with-icon alert-grey'
  93. });
  94. });
  95. });