|
Server IP : 111.118.215.156 / Your IP : 216.73.216.167 Web Server : Apache System : Linux md-in-26.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : azasoqqa ( 1858) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/azasoqqa/public_html/vsrcbse.com/admin/javascript/components/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
/*! ========================================================================
* notification.js
* Page/renders: components-notification.html
* Plugins used: gritter, bootbox
* ======================================================================== */
$(function () {
// Gritter
// ================================
(function () {
// sticky notice
$("#add-sticky").on("click", function (e) {
$.gritter.add({
title: "Sticky notice",
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eget tincidunt velit.",
sticky: true,
});
e.preventDefault();
});
// regular notice
$("#add-regular").on("click", function (e) {
$.gritter.add({
title: "Regular notice",
text: "This will fade out after a certain amount of time. Vivamus eget tincidunt velit.",
sticky: false,
});
e.preventDefault();
});
// max 3 notice
$("#add-max").on("click", function (e) {
$.gritter.add({
title: "Max of 3 notice on screen",
text: "This will fade out after a certain amount of time. Vivamus eget tincidunt velit.",
sticky: false,
// (function) before the gritter notice is opened
before_open: function () {
if ($(".gritter-item-wrapper").length == 3) {
// Returning false prevents a new gritter from opening
return false;
}
}
});
e.preventDefault();
});
// with image notice
$("#add-image").on("click", function (e) {
$.gritter.add({
title: "Notice with image",
text: "This will fade out after a certain amount of time. Vivamus eget tincidunt velit.",
image: "../assets/image/avatar/avatar5.jpg",
sticky: false
});
e.preventDefault();
});
// light notice with image
$("#add-light").on("click", function (e) {
$.gritter.add({
title: "Light notice",
text: "This will fade out after a certain amount of time. Vivamus eget tincidunt velit.",
image: "../assets/image/avatar/avatar8.jpg",
class_name: "gritter-light",
sticky: true
});
e.preventDefault();
});
})();
// Bootbox
// ================================
(function () {
// bootbox - alert
$("#bootbox-alert").on("click", function (event) {
bootbox.alert("Hello world!");
event.preventDefault();
});
// bootbox - confirm
$("#bootbox-confirm").on("click", function (event) {
bootbox.confirm("Are you sure?", function (result) {
// callback
});
event.preventDefault();
});
// bootbox - prompt
$("#bootbox-prompt").on("click", function (event) {
bootbox.prompt("What is your name?", function (result) {
// callback
});
event.preventDefault();
});
// bootbox - custom
$("#bootbox-custom").on("click", function (event) {
bootbox.dialog({
message: "I am a custom dialog",
title: "Custom title",
buttons: {
success: {
label: "Success",
className: "btn-success",
callback: function () {
// callback
}
},
danger: {
label: "Danger",
className: "btn-danger",
callback: function () {
// callback
}
},
main: {
label: "Primary",
className: "btn-primary",
callback: function () {
// callback
}
}
}
});
event.preventDefault();
});
})();
});