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.

130 lines
4.1 KiB

4 years ago
4 years ago
4 years ago
  1. function ShowAlertMessage() {
  2. notify({
  3. type: "alert", //alert | success | error | warning | info
  4. title: "Alert",
  5. message: "jQuery Notify.js Demo. Super simple Notify plugin.",
  6. position: {
  7. x: "right", //right | left | center
  8. y: "top" //top | bottom | center
  9. },
  10. icon: '<img src="images/paper_plane.png" />', //<i>
  11. size: "normal", //normal | full | small
  12. overlay: false, //true | false
  13. closeBtn: true, //true | false
  14. overflowHide: false, //true | false
  15. spacing: 20, //number px
  16. theme: "default", //default | dark-theme
  17. autoHide: true, //true | false
  18. delay: 2500, //number ms
  19. onShow: null, //function
  20. onClick: null, //function
  21. onHide: null, //function
  22. template: '<div class="notify"><div class="notify-text"></div></div>'
  23. });
  24. };
  25. function ShowAlertMessage(message, type, title, url, positionX, positionY, imageURL, autoHide) {
  26. if (imageURL == '' || imageURL == undefined) {
  27. if (type == 'success')
  28. imageURL = '/images/icons/success.png';
  29. if (type == 'error')
  30. imageURL = '/images/icons/error.png';
  31. if (type == 'info')
  32. imageURL = '/images/icons/info.png';
  33. }
  34. if (url == '' || url == undefined) {
  35. onHide = null;
  36. }
  37. if (title == '' || title == undefined) {
  38. if (type == 'success')
  39. title = 'Success';
  40. if (type == 'error')
  41. title = 'Error';
  42. if (type == 'info')
  43. title = 'Information';
  44. }
  45. if (positionX == '' || positionX == undefined)
  46. positionX = 'right';
  47. if (positionY == '' || positionY == undefined)
  48. positionY = 'top';
  49. if (autoHide == '' || autoHide == undefined)
  50. autoHide = true;
  51. $.notify({
  52. type: type, //alert | success | error | warning | info
  53. title: title,
  54. autoHide: autoHide,
  55. delay: 3000,
  56. theme: "dark-theme",
  57. position: {
  58. x: positionX, //right | left | center
  59. y: positionY //top | bottom | center
  60. },
  61. onClick: (url == '' || url == undefined) ? null : RedirectFunction(url),
  62. icon: '<img src="' + imageURL + '" />',
  63. message: message
  64. });
  65. };
  66. function RedirectFunction(url) {
  67. $(location).attr("href", url);
  68. }
  69. function ShowSuccessMessage(message) {
  70. notify({
  71. type: "success", //alert | success | error | warning | info
  72. title: "Success",
  73. autoHide: true,
  74. delay: 5000,
  75. theme: "dark-theme",
  76. position: {
  77. x: "right", //right | left | center
  78. y: "bottom" //top | bottom | center
  79. },
  80. icon: '<img src="/Plugins/jQueryAlert/images/paper_plane.png" />',
  81. message: message
  82. });
  83. };
  84. function ShowWarningBox() {
  85. notify({
  86. type: "warning", //alert | success | error | warning | info
  87. title: "Warning",
  88. theme: "dark-theme",
  89. position: {
  90. x: "right", //right | left | center
  91. y: "top" //top | bottom | center
  92. },
  93. icon: '<img src="images/paper_plane.png" />',
  94. message: "jQuery Notify.js Demo. Super simple Notify plugin."
  95. });
  96. };
  97. function ShowErrorBox() {
  98. notify({
  99. type: "error", //alert | success | error | warning | info
  100. title: "Error",
  101. theme: "dark-theme",
  102. position: {
  103. x: "right", //right | left | center
  104. y: "top" //top | bottom | center
  105. },
  106. icon: '<img src="images/paper_plane.png" />',
  107. message: "jQuery Notify.js Demo. Super simple Notify plugin."
  108. });
  109. };
  110. function ShowInfoBox() {
  111. notify({
  112. type: "info", //alert | success | error | warning | info
  113. title: "Info",
  114. theme: "dark-theme",
  115. position: {
  116. x: "right", //right | left | center
  117. y: "top" //top | bottom | center
  118. },
  119. icon: '<img src="/Plugins/jQueryAlert/images/paper_plane.png" />',
  120. message: "jQuery Notify.js Demo. Super simple Notify plugin."
  121. });
  122. };