This commit is contained in:
2025-12-26 22:35:18 +08:00
commit 9cf62f793b
4263 changed files with 728989 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
function testAnim(x) {
document.getElementById('animationSandbox').classList.remove();
document.getElementById('animationSandbox').classList.add('animate__animated', 'animate__' + x);
document.getElementById('animationSandbox').addEventListener('webkitAnimationEnd', removeClasses);
document.getElementById('animationSandbox').addEventListener('mozAnimationEnd', removeClasses);
document.getElementById('animationSandbox').addEventListener('MSAnimationEnd', removeClasses);
document.getElementById('animationSandbox').addEventListener('oanimationend', removeClasses);
document.getElementById('animationSandbox').addEventListener('animationend', removeClasses);
}
function removeClasses() {
document.getElementById('animationSandbox').classList.remove();
}
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('.js--triggerAnimation').addEventListener('click', function(e) {
e.preventDefault();
var anim = document.querySelector('.js--animations').value;
testAnim(anim);
});
document.querySelector('.js--animations').addEventListener('change', function() {
var anim = this.value;
testAnim(anim);
});
});

View File

@@ -0,0 +1,205 @@
$(function () {
$(".block-card").on("click", function () {
var block_ele = $(this).closest(".card");
$(block_ele).block({
message: '<i class="ti ti-refresh text-white fs-5"></i>',
timeout: 2000, //unblock after 2 seconds
overlayCSS: {
backgroundColor: "#000",
opacity: 0.5,
cursor: "wait",
},
css: {
border: 0,
padding: 0,
backgroundColor: "transparent",
},
});
});
// Block sidebar
$(".block-sidenav").on("click", function () {
var block_ele = $(".side-mini-panel");
$(block_ele).block({
message: '<i class="ti ti-refresh text-white fs-5"></i>',
timeout: 2000, //unblock after 2 seconds
overlayCSS: {
backgroundColor: "#000",
opacity: 0.5,
cursor: "wait",
},
css: {
border: 0,
padding: 0,
backgroundColor: "transparent",
},
});
});
// Block page
$(".block-default").on("click", function () {
$.blockUI({
message: '<i class="ti ti-refresh text-white fs-5"></i>',
timeout: 2000, //unblock after 2 seconds
overlayCSS: {
backgroundColor: "#000",
opacity: 0.5,
cursor: "wait",
},
css: {
border: 0,
padding: 0,
backgroundColor: "transparent",
},
});
});
// onBlock callback
$(".onblock").on("click", function () {
$.blockUI({
message: '<i class="ti ti-refresh text-white fs-5"></i>',
fadeIn: 1000,
timeout: 2000, //unblock after 2 seconds
overlayCSS: {
backgroundColor: "#000",
opacity: 0.5,
cursor: "wait",
},
css: {
border: 0,
padding: 0,
color: "#333",
backgroundColor: "transparent",
},
onBlock: function () {
alert("Page blocked!");
},
});
});
// onUnblock callback
$(".onunblock").on("click", function () {
$.blockUI({
message: '<i class="ti ti-refresh text-white fs-5"></i>',
timeout: 2000, //unblock after 2 seconds
overlayCSS: {
backgroundColor: "#000",
opacity: 0.5,
cursor: "wait",
},
css: {
border: 0,
padding: 0,
color: "#333",
backgroundColor: "transparent",
},
onUnblock: function () {
alert("Page unblocked!");
},
});
});
// Overlay callback
$(".onoverlay-click").on("click", function () {
$.blockUI({
message: '<i class="ti ti-refresh text-white fs-5"></i>',
overlayCSS: {
backgroundColor: "#000",
opacity: 0.5,
cursor: "wait",
},
css: {
color: "#333",
border: 0,
padding: 0,
backgroundColor: "transparent",
},
onOverlayClick: $.unblockUI,
});
});
// Block Without Message
$(".without-msg").on("click", function () {
var block_ele = $(this).closest(".card");
$(block_ele).block({
message: null,
timeout: 2000, //unblock after 2 seconds
overlayCSS: {
backgroundColor: "#000",
opacity: 0.5,
cursor: "wait",
},
css: {
border: 0,
padding: 0,
backgroundColor: "transparent",
},
});
});
// Block without overlay
$(".without-overlay").on("click", function () {
var block_ele = $(this).closest(".card");
$(block_ele).block({
message: '<i class="ti ti-refresh text-white fs-5"></i>',
showOverlay: false,
timeout: 2000, //unblock after 2 seconds
css: {
width: 50,
height: 50,
lineHeight: 1,
color: "#fff",
border: 0,
padding: 15,
backgroundColor: "#000",
},
});
});
// Unblock on overlay click
$(".overlay-unblock").on("click", function () {
var block_ele = $(this).closest(".card");
$(block_ele).block({
message: '<i class="ti ti-refresh text-white fs-5"></i>',
overlayCSS: {
backgroundColor: "#000",
opacity: 0.5,
cursor: "wait",
},
css: {
border: 0,
padding: 0,
backgroundColor: "transparent",
},
});
$(".blockOverlay").on("click", function () {
$(block_ele).unblock();
});
});
// Growl notification
$(".growl").on("click", function () {
$.blockUI({
message: $(".growl-notification-example"),
fadeIn: 700,
fadeOut: 700,
timeout: 3000,
showOverlay: false,
centerY: false,
css: {
width: "250px",
top: "20px",
left: "",
right: "20px",
border: "none",
padding: "15px 5px",
backgroundColor: "#000",
"-webkit-border-radius": "10px",
"-moz-border-radius": "10px",
opacity: 0.9,
color: "#fff",
},
});
});
});

View File

@@ -0,0 +1,527 @@
$(function () {
var defaultData = [
{
text: "Parent 1",
href: "#parent1",
tags: ["4"],
nodes: [
{
text: "Child 1",
href: "#child1",
tags: ["2"],
nodes: [
{
text: "Grandchild 1",
href: "#grandchild1",
tags: ["0"],
},
{
text: "Grandchild 2",
href: "#grandchild2",
tags: ["0"],
},
],
},
{
text: "Child 2",
href: "#child2",
tags: ["0"],
},
],
},
{
text: "Parent 2",
href: "#parent2",
tags: ["0"],
},
{
text: "Parent 3",
href: "#parent3",
tags: ["0"],
},
{
text: "Parent 4",
href: "#parent4",
tags: ["0"],
},
{
text: "Parent 5",
href: "#parent5",
tags: ["0"],
},
];
var alternateData = [
{
text: "Parent 1",
tags: ["2"],
nodes: [
{
text: "Child 1",
tags: ["3"],
nodes: [
{
text: "Grandchild 1",
tags: ["6"],
},
{
text: "Grandchild 2",
tags: ["3"],
},
],
},
{
text: "Child 2",
tags: ["3"],
},
],
},
{
text: "Parent 2",
tags: ["7"],
},
{
text: "Parent 3",
icon: "glyphicon glyphicon-earphone",
href: "#demo",
tags: ["11"],
},
{
text: "Parent 4",
icon: "glyphicon glyphicon-cloud-download",
href: "/demo.html",
tags: ["19"],
selected: true,
},
{
text: "Parent 5",
icon: "glyphicon glyphicon-certificate",
color: "pink",
backColor: "red",
href: "http://www.tesco.com",
tags: ["available", "0"],
},
];
var json =
"[" +
"{" +
'"text": "Parent 1",' +
'"nodes": [' +
"{" +
'"text": "Child 1",' +
'"nodes": [' +
"{" +
'"text": "Grandchild 1"' +
"}," +
"{" +
'"text": "Grandchild 2"' +
"}" +
"]" +
"}," +
"{" +
'"text": "Child 2"' +
"}" +
"]" +
"}," +
"{" +
'"text": "Parent 2"' +
"}," +
"{" +
'"text": "Parent 3"' +
"}," +
"{" +
'"text": "Parent 4"' +
"}," +
"{" +
'"text": "Parent 5"' +
"}" +
"]";
$("#treeview1").treeview({
selectedBackColor: "var(--bs-primary)",
onhoverColor: "var(--bs-primary-bg-subtle)",
expandIcon: "ti ti-plus",
collapseIcon: "ti ti-minus",
nodeIcon: "ti ti-folder-filled fs-6",
data: defaultData,
});
$("#treeview2").treeview({
levels: 1,
selectedBackColor: "var(--bs-primary)",
onhoverColor: "var(--bs-primary-bg-subtle)",
expandIcon: "ti ti-plus",
collapseIcon: "ti ti-minus",
nodeIcon: "ti ti-folder-filled fs-6",
data: defaultData,
});
$("#treeview3").treeview({
levels: 99,
selectedBackColor: "var(--bs-primary)",
onhoverColor: "var(--bs-primary-bg-subtle)",
expandIcon: "ti ti-plus",
collapseIcon: "ti ti-minus",
nodeIcon: "ti ti-folder-filled fs-6",
data: defaultData,
});
$("#treeview4").treeview({
color: "#428bca",
selectedBackColor: "var(--bs-primary)",
onhoverColor: "var(--bs-primary-bg-subtle)",
expandIcon: "ti ti-plus",
collapseIcon: "ti ti-minus",
nodeIcon: "ti ti-folder-filled fs-6",
data: defaultData,
});
$("#treeview5").treeview({
expandIcon: "ti-angle-right",
onhoverColor: "var(--bs-primary-bg-subtle)",
selectedBackColor: "var(--bs-primary)",
collapseIcon: "ti-angle-down",
nodeIcon: "fa fa-bookmark",
data: defaultData,
});
$("#treeview6").treeview({
selectedBackColor: "var(--bs-primary)",
onhoverColor: "var(--bs-primary-bg-subtle)",
expandIcon: "fa fa-circle",
collapseIcon: "fa fa-check-circle-o",
nodeIcon: "ti ti-user",
showTags: true,
data: defaultData,
});
$("#treeview7").treeview({
color: "#428bca",
showBorder: false,
data: defaultData,
});
$("#treeview8").treeview({
expandIcon: "fa fa-circle",
collapseIcon: "fa fa-check-circle-o",
nodeIcon: "ti ti-user",
color: "yellow",
backColor: "purple",
onhoverColor: "orange",
borderColor: "red",
showBorder: false,
showTags: true,
highlightSelected: true,
selectedColor: "yellow",
selectedBackColor: "darkorange",
data: defaultData,
});
$("#treeview9").treeview({
expandIcon: "fa fa-circle",
collapseIcon: "fa fa-check-circle-o",
nodeIcon: "glyphicon glyphicon-user",
color: "yellow",
backColor: "purple",
onhoverColor: "orange",
borderColor: "red",
showBorder: false,
showTags: true,
highlightSelected: true,
selectedColor: "yellow",
selectedBackColor: "darkorange",
data: alternateData,
});
$("#treeview10").treeview({
color: "#428bca",
enableLinks: true,
data: defaultData,
});
var $searchableTree = $("#treeview-searchable").treeview({
selectedBackColor: "var(--bs-primary)",
onhoverColor: "var(--bs-primary-bg-subtle)",
expandIcon: "ti ti-plus",
collapseIcon: "ti ti-minus",
nodeIcon: "ti ti-folder-filled fs-6",
data: defaultData,
});
var search = function (e) {
var pattern = $("#input-search").val();
var options = {
ignoreCase: $("#chk-ignore-case").is(":checked"),
exactMatch: $("#chk-exact-match").is(":checked"),
revealResults: $("#chk-reveal-results").is(":checked"),
};
var results = $searchableTree.treeview("search", [pattern, options]);
var output = "<p>" + results.length + " matches found</p>";
$.each(results, function (index, result) {
output += "<p>- " + result.text + "</p>";
});
$("#search-output").html(output);
};
$("#btn-search").on("click", search);
$("#input-search").on("keyup", search);
$("#btn-clear-search").on("click", function (e) {
$searchableTree.treeview("clearSearch");
$("#input-search").val("");
$("#search-output").html("");
});
var initSelectableTree = function () {
return $("#treeview-selectable").treeview({
data: defaultData,
multiSelect: $("#chk-select-multi").is(":checked"),
onNodeSelected: function (event, node) {
$("#selectable-output").prepend(
"<p>" + node.text + " was selected</p>"
);
},
onNodeUnselected: function (event, node) {
$("#selectable-output").prepend(
"<p>" + node.text + " was unselected</p>"
);
},
});
};
var $selectableTree = initSelectableTree();
var findSelectableNodes = function () {
return $selectableTree.treeview("search", [
$("#input-select-node").val(),
{ ignoreCase: false, exactMatch: false },
]);
};
var selectableNodes = findSelectableNodes();
$("#chk-select-multi:checkbox").on("change", function () {
console.log("multi-select change");
$selectableTree = initSelectableTree();
selectableNodes = findSelectableNodes();
});
// Select/unselect/toggle nodes
$("#input-select-node").on("keyup", function (e) {
selectableNodes = findSelectableNodes();
$(".select-node").prop("disabled", !(selectableNodes.length >= 1));
});
$("#btn-select-node.select-node").on("click", function (e) {
$selectableTree.treeview("selectNode", [
selectableNodes,
{ silent: $("#chk-select-silent").is(":checked") },
]);
});
$("#btn-unselect-node.select-node").on("click", function (e) {
$selectableTree.treeview("unselectNode", [
selectableNodes,
{ silent: $("#chk-select-silent").is(":checked") },
]);
});
$("#btn-toggle-selected.select-node").on("click", function (e) {
$selectableTree.treeview("toggleNodeSelected", [
selectableNodes,
{ silent: $("#chk-select-silent").is(":checked") },
]);
});
var $expandibleTree = $("#treeview-expandible").treeview({
data: defaultData,
onNodeCollapsed: function (event, node) {
$("#expandible-output").prepend("<p>" + node.text + " was collapsed</p>");
},
onNodeExpanded: function (event, node) {
$("#expandible-output").prepend("<p>" + node.text + " was expanded</p>");
},
});
var findExpandibleNodess = function () {
return $expandibleTree.treeview("search", [
$("#input-expand-node").val(),
{ ignoreCase: false, exactMatch: false },
]);
};
var expandibleNodes = findExpandibleNodess();
// Expand/collapse/toggle nodes
$("#input-expand-node").on("keyup", function (e) {
expandibleNodes = findExpandibleNodess();
$(".expand-node").prop("disabled", !(expandibleNodes.length >= 1));
});
$("#btn-expand-node.expand-node").on("click", function (e) {
var levels = $("#select-expand-node-levels").val();
$expandibleTree.treeview("expandNode", [
expandibleNodes,
{ levels: levels, silent: $("#chk-expand-silent").is(":checked") },
]);
});
$("#btn-collapse-node.expand-node").on("click", function (e) {
$expandibleTree.treeview("collapseNode", [
expandibleNodes,
{ silent: $("#chk-expand-silent").is(":checked") },
]);
});
$("#btn-toggle-expanded.expand-node").on("click", function (e) {
$expandibleTree.treeview("toggleNodeExpanded", [
expandibleNodes,
{ silent: $("#chk-expand-silent").is(":checked") },
]);
});
// Expand/collapse all
$("#btn-expand-all").on("click", function (e) {
var levels = $("#select-expand-all-levels").val();
$expandibleTree.treeview("expandAll", {
levels: levels,
silent: $("#chk-expand-silent").is(":checked"),
});
});
$("#btn-collapse-all").on("click", function (e) {
$expandibleTree.treeview("collapseAll", {
silent: $("#chk-expand-silent").is(":checked"),
});
});
var $checkableTree = $("#treeview-checkable").treeview({
data: defaultData,
showIcon: false,
showCheckbox: true,
onNodeChecked: function (event, node) {
$("#checkable-output").prepend("<p>" + node.text + " was checked</p>");
},
onNodeUnchecked: function (event, node) {
$("#checkable-output").prepend("<p>" + node.text + " was unchecked</p>");
},
});
var findCheckableNodess = function () {
return $checkableTree.treeview("search", [
$("#input-check-node").val(),
{ ignoreCase: false, exactMatch: false },
]);
};
var checkableNodes = findCheckableNodess();
// Check/uncheck/toggle nodes
$("#input-check-node").on("keyup", function (e) {
checkableNodes = findCheckableNodess();
$(".check-node").prop("disabled", !(checkableNodes.length >= 1));
});
$("#btn-check-node.check-node").on("click", function (e) {
$checkableTree.treeview("checkNode", [
checkableNodes,
{ silent: $("#chk-check-silent").is(":checked") },
]);
});
$("#btn-uncheck-node.check-node").on("click", function (e) {
$checkableTree.treeview("uncheckNode", [
checkableNodes,
{ silent: $("#chk-check-silent").is(":checked") },
]);
});
$("#btn-toggle-checked.check-node").on("click", function (e) {
$checkableTree.treeview("toggleNodeChecked", [
checkableNodes,
{ silent: $("#chk-check-silent").is(":checked") },
]);
});
// Check/uncheck all
$("#btn-check-all").on("click", function (e) {
$checkableTree.treeview("checkAll", {
silent: $("#chk-check-silent").is(":checked"),
});
});
$("#btn-uncheck-all").on("click", function (e) {
$checkableTree.treeview("uncheckAll", {
silent: $("#chk-check-silent").is(":checked"),
});
});
var $disabledTree = $("#treeview-disabled").treeview({
data: defaultData,
onNodeDisabled: function (event, node) {
$("#disabled-output").prepend("<p>" + node.text + " was disabled</p>");
},
onNodeEnabled: function (event, node) {
$("#disabled-output").prepend("<p>" + node.text + " was enabled</p>");
},
onNodeCollapsed: function (event, node) {
$("#disabled-output").prepend("<p>" + node.text + " was collapsed</p>");
},
onNodeUnchecked: function (event, node) {
$("#disabled-output").prepend("<p>" + node.text + " was unchecked</p>");
},
onNodeUnselected: function (event, node) {
$("#disabled-output").prepend("<p>" + node.text + " was unselected</p>");
},
});
var findDisabledNodes = function () {
return $disabledTree.treeview("search", [
$("#input-disable-node").val(),
{ ignoreCase: false, exactMatch: false },
]);
};
var disabledNodes = findDisabledNodes();
// Expand/collapse/toggle nodes
$("#input-disable-node").on("keyup", function (e) {
disabledNodes = findDisabledNodes();
$(".disable-node").prop("disabled", !(disabledNodes.length >= 1));
});
$("#btn-disable-node.disable-node").on("click", function (e) {
$disabledTree.treeview("disableNode", [
disabledNodes,
{ silent: $("#chk-disable-silent").is(":checked") },
]);
});
$("#btn-enable-node.disable-node").on("click", function (e) {
$disabledTree.treeview("enableNode", [
disabledNodes,
{ silent: $("#chk-disable-silent").is(":checked") },
]);
});
$("#btn-toggle-disabled.disable-node").on("click", function (e) {
$disabledTree.treeview("toggleNodeDisabled", [
disabledNodes,
{ silent: $("#chk-disable-silent").is(":checked") },
]);
});
// Expand/collapse all
$("#btn-disable-all").on("click", function (e) {
$disabledTree.treeview("disableAll", {
silent: $("#chk-disable-silent").is(":checked"),
});
});
$("#btn-enable-all").on("click", function (e) {
$disabledTree.treeview("enableAll", {
silent: $("#chk-disable-silent").is(":checked"),
});
});
var $tree = $("#treeview12").treeview({
data: json,
});
});

View File

@@ -0,0 +1,26 @@
// Example starter JavaScript for disabling form submissions if there are invalid fields
(function () {
"use strict";
window.addEventListener(
"load",
function () {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName("needs-validation");
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function (form) {
form.addEventListener(
"submit",
function (event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add("was-validated");
},
false
);
});
},
false
);
})();

View File

@@ -0,0 +1,23 @@
$(".demo").each(function () {
$(this).minicolors({
control: $(this).attr("data-control") || "hue",
defaultValue: $(this).attr("data-defaultValue") || "",
format: $(this).attr("data-format") || "hex",
keywords: $(this).attr("data-keywords") || "",
inline: $(this).attr("data-inline") === "true",
letterCase: $(this).attr("data-letterCase") || "lowercase",
opacity: $(this).attr("data-opacity"),
position: $(this).attr("data-position") || "bottom left",
swatches: $(this).attr("data-swatches")
? $(this).attr("data-swatches").split("|")
: [],
change: function (value, opacity) {
if (!value) return;
if (opacity) value += ", " + opacity;
if (typeof console === "object") {
console.log(value);
}
},
theme: "bootstrap",
});
});

View File

@@ -0,0 +1,135 @@
$(function () {
$(".image-popup-vertical-fit").magnificPopup({
type: "image",
closeOnContentClick: true,
mainClass: "mfp-img-mobile",
image: {
verticalFit: true,
},
});
$(".image-popup-fit-width").magnificPopup({
type: "image",
closeOnContentClick: true,
image: {
verticalFit: false,
},
});
$(".image-popup-no-margins").magnificPopup({
type: "image",
closeOnContentClick: true,
closeBtnInside: false,
fixedContentPos: true,
mainClass: "mfp-no-margins mfp-with-zoom", // class to remove default margin from left and right side
image: {
verticalFit: true,
},
zoom: {
enabled: true,
duration: 300, // don't foget to change the duration also in CSS
},
});
$(".popup-gallery").magnificPopup({
delegate: "a",
type: "image",
tLoading: "Loading image #%curr%...",
mainClass: "mfp-img-mobile",
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0, 1], // Will preload 0 - before current, and 1 after the current image
},
image: {
tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
titleSrc: function (item) {
return item.el.attr("title") + "<small>by Marsel Van Oosten</small>";
},
},
});
$(".zoom-gallery").magnificPopup({
delegate: "a",
type: "image",
closeOnContentClick: false,
closeBtnInside: false,
mainClass: "mfp-with-zoom mfp-img-mobile",
image: {
verticalFit: true,
titleSrc: function (item) {
return (
item.el.attr("title") +
' &middot; <a class="image-source-link" href="' +
item.el.attr("data-source") +
'" target="_blank">image source</a>'
);
},
},
gallery: {
enabled: true,
},
zoom: {
enabled: true,
duration: 300, // don't foget to change the duration also in CSS
opener: function (element) {
return element.find("img");
},
},
});
$("#image-popups").magnificPopup({
delegate: "a",
type: "image",
removalDelay: 500, //delay removal by X to allow out-animation
callbacks: {
beforeOpen: function () {
// just a hack that adds mfp-anim class to markup
this.st.image.markup = this.st.image.markup.replace(
"mfp-figure",
"mfp-figure mfp-with-anim"
);
this.st.mainClass = this.st.el.attr("data-effect");
},
},
closeOnContentClick: true,
midClick: true, // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
});
$(".popup-youtube, .popup-vimeo, .popup-gmaps").magnificPopup({
disableOn: 700,
type: "iframe",
mainClass: "mfp-fade",
removalDelay: 160,
preloader: false,
fixedContentPos: false,
});
$(".popup-with-form").magnificPopup({
type: "inline",
preloader: false,
focus: "#name",
// When elemened is focused, some mobile browsers in some cases zoom in
// It looks not nice, so we disable it:
callbacks: {
beforeOpen: function () {
if ($(window).width() < 700) {
this.st.focus = false;
} else {
this.st.focus = "#name";
}
},
},
});
$(".simple-ajax-popup-align-top").magnificPopup({
type: "ajax",
alignTop: true,
overflowY: "scroll", // as we know that popup content is tall we set scroll overflow by default to avoid jump
});
$(".simple-ajax-popup").magnificPopup({
type: "ajax",
});
});

View File

@@ -0,0 +1,40 @@
$(function () {
// Nestable
var updateOutput = function (e) {
var list = e.length ? e : $(e.target),
output = list.data("output");
if (window.JSON) {
output.val(window.JSON.stringify(list.nestable("serialize"))); //, null, 2));
} else {
output.val("JSON browser support required for this demo.");
}
};
$("#nestable")
.nestable({
group: 1,
})
.on("change", updateOutput);
$("#nestable2")
.nestable({
group: 1,
})
.on("change", updateOutput);
updateOutput($("#nestable").data("output", $("#nestable-output")));
updateOutput($("#nestable2").data("output", $("#nestable2-output")));
$("#nestable-menu").on("click", function (e) {
var target = $(e.target),
action = target.data("action");
if (action === "expand-all") {
$(".dd").nestable("expandAll");
}
if (action === "collapse-all") {
$(".dd").nestable("collapseAll");
}
});
$("#nestable-menu").nestable();
});

View File

@@ -0,0 +1,999 @@
$(function () {
// Handles
var handlesSlider = document.getElementById("slider-handles");
noUiSlider.create(handlesSlider, {
start: [4000, 8000],
range: {
min: [2000],
max: [10000],
},
});
// Range
var rangeSlider = document.getElementById("slider-range");
noUiSlider.create(rangeSlider, {
start: [4000],
range: {
min: [2000],
max: [10000],
},
});
// Stepping and snapping to values
var stepSlider = document.getElementById("slider-step");
noUiSlider.create(stepSlider, {
start: [4000],
step: 1000,
range: {
min: [2000],
max: [10000],
},
});
// Non-linear sliders
var nonLinearSlider = document.getElementById("slider-non-linear");
noUiSlider.create(nonLinearSlider, {
start: [4000],
range: {
min: [2000],
"30%": [4000],
"70%": [8000],
max: [10000],
},
});
// Stepping in non-linear sliders
var nonLinearStepSlider = document.getElementById("slider-non-linear-step");
noUiSlider.create(nonLinearStepSlider, {
start: [500, 4000],
range: {
min: [0],
"10%": [500, 500],
"50%": [4000, 1000],
max: [10000],
},
});
// Snapping between steps
var snapSlider = document.getElementById("slider-snap");
noUiSlider.create(snapSlider, {
start: [0, 500],
snap: true,
connect: true,
range: {
min: 0,
"10%": 50,
"20%": 100,
"30%": 150,
"40%": 500,
"50%": 800,
max: 1000,
},
});
// Tap
tapSlider = document.getElementById("tap");
noUiSlider.create(tapSlider, {
start: 40,
behaviour: "tap",
connect: "upper",
range: {
min: 20,
max: 80,
},
});
// Drag
var dragSlider = document.getElementById("drag");
noUiSlider.create(dragSlider, {
start: [40, 60],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
});
// Fixed dragging
dragFixedSlider = document.getElementById("drag-fixed");
noUiSlider.create(dragFixedSlider, {
start: [40, 60],
behaviour: "drag-fixed",
connect: true,
range: {
min: 20,
max: 80,
},
});
// Snap
snapSlider = document.getElementById("snap");
noUiSlider.create(snapSlider, {
start: 40,
behaviour: "snap",
connect: "lower",
range: {
min: 20,
max: 80,
},
});
// Hover
var hoverSlider = document.getElementById("hover"),
field = document.getElementById("hover-val");
noUiSlider.create(hoverSlider, {
start: 20,
behaviour: "hover-snap",
range: {
min: 0,
max: 10,
},
});
hoverSlider.noUiSlider.on("hover", function (value) {
field.innerHTML = value;
});
// Combined options
dragTapSlider = document.getElementById("combined");
noUiSlider.create(dragTapSlider, {
start: [40, 60],
behaviour: "drag-tap",
connect: true,
range: {
min: 20,
max: 80,
},
});
var range_all_sliders = {
min: [0],
"10%": [5, 5],
"50%": [40, 10],
max: [100],
};
// Range
var pipsRange = document.getElementById("pips-range"),
pipsRangeRtl = document.getElementById("pips-range-rtl");
noUiSlider.create(pipsRange, {
range: range_all_sliders,
start: 0,
pips: {
mode: "range",
density: 3,
},
});
noUiSlider.create(pipsRangeRtl, {
range: range_all_sliders,
start: 0,
direction: "rtl",
pips: {
mode: "range",
density: 3,
},
});
// Steps
function filter500(value, type) {
return value % 1000 ? 2 : 1;
}
var pipsStepsFilter = document.getElementById("pips-steps-filter");
noUiSlider.create(pipsStepsFilter, {
range: range_all_sliders,
start: 0,
pips: {
mode: "steps",
density: 3,
filter: filter500,
format: wNumb({
decimals: 2,
prefix: "$",
}),
},
});
// Default
var defaultColorSlider = document.getElementById("default-color-slider");
noUiSlider.create(defaultColorSlider, {
start: [45, 55],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
});
// Success
var successColorSlider = document.getElementById("success-color-slider");
noUiSlider.create(successColorSlider, {
start: [40, 60],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
});
// Info
var infoColorSlider = document.getElementById("info-color-slider");
noUiSlider.create(infoColorSlider, {
start: [35, 65],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
});
// Warning
var warningColorSlider = document.getElementById("warning-color-slider");
noUiSlider.create(warningColorSlider, {
start: [45, 55],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
});
// Danger
var dangerColorSlider = document.getElementById("danger-color-slider");
noUiSlider.create(dangerColorSlider, {
start: [40, 60],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
});
// Custom Color
var customColorSlider = document.getElementById("custom-color-slider");
noUiSlider.create(customColorSlider, {
start: [35, 65],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
});
// Extra large options
var xl_options = {
start: [45, 55],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
};
var lg_options = {
start: [40, 60],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
};
var default_options = {
start: [35, 65],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
};
var sm_options = {
start: [30, 70],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
};
var xs_options = {
start: [25, 75],
behaviour: "drag",
connect: true,
range: {
min: 20,
max: 80,
},
};
// Extra Large
var extraLargeSlider = document.getElementById("extra-large-slider");
var circleExtraLargeSlider = document.getElementById(
"circle-extra-large-slider"
);
var squareExtraLargeSlider = document.getElementById(
"square-extra-large-slider"
);
noUiSlider.create(extraLargeSlider, xl_options);
noUiSlider.create(circleExtraLargeSlider, xl_options);
noUiSlider.create(squareExtraLargeSlider, xl_options);
// Large
var largeSlider = document.getElementById("large-slider");
var circleLargeSlider = document.getElementById("circle-large-slider");
var squareLargeSlider = document.getElementById("square-large-slider");
noUiSlider.create(largeSlider, lg_options);
noUiSlider.create(circleLargeSlider, lg_options);
noUiSlider.create(squareLargeSlider, lg_options);
// Default
var defaultSlider = document.getElementById("default-slider");
var circleDefaultSlider = document.getElementById("circle-default-slider");
var squareDefaultSlider = document.getElementById("square-default-slider");
noUiSlider.create(defaultSlider, default_options);
noUiSlider.create(circleDefaultSlider, default_options);
noUiSlider.create(squareDefaultSlider, default_options);
// Small
var smallSlider = document.getElementById("small-slider");
var circleSmallSlider = document.getElementById("circle-small-slider");
var squareSmallSlider = document.getElementById("square-small-slider");
noUiSlider.create(smallSlider, sm_options);
noUiSlider.create(circleSmallSlider, sm_options);
noUiSlider.create(squareSmallSlider, sm_options);
// Extra Small
var extraSmallSlider = document.getElementById("extra-small-slider");
var circleExtraSmallSlider = document.getElementById(
"circle-extra-small-slider"
);
var squareExtraSmallSlider = document.getElementById(
"square-extra-small-slider"
);
noUiSlider.create(extraSmallSlider, xs_options);
noUiSlider.create(circleExtraSmallSlider, xs_options);
noUiSlider.create(squareExtraSmallSlider, xs_options);
// Default
var vertical_slider_1 = document.getElementById("slider-vertical-1");
noUiSlider.create(vertical_slider_1, {
start: 20,
orientation: "vertical",
range: {
min: 0,
max: 100,
},
});
var vertical_slider_2 = document.getElementById("slider-vertical-2");
noUiSlider.create(vertical_slider_2, {
start: 50,
orientation: "vertical",
range: {
min: 0,
max: 100,
},
});
var vertical_slider_3 = document.getElementById("slider-vertical-3");
noUiSlider.create(vertical_slider_3, {
start: 20,
orientation: "vertical",
range: {
min: 0,
max: 100,
},
});
var vertical_slider_4 = document.getElementById("slider-vertical-4");
noUiSlider.create(vertical_slider_4, {
start: 50,
orientation: "vertical",
range: {
min: 0,
max: 100,
},
});
var vertical_slider_5 = document.getElementById("slider-vertical-5");
noUiSlider.create(vertical_slider_5, {
start: 20,
orientation: "vertical",
range: {
min: 0,
max: 100,
},
});
// Connect to lower
var connectLowerSlider1 = document.getElementById("connect-lower-1");
noUiSlider.create(connectLowerSlider1, {
start: 30,
orientation: "vertical",
connect: "lower",
range: {
min: 0,
max: 100,
},
});
var connectLowerSlider2 = document.getElementById("connect-lower-2");
noUiSlider.create(connectLowerSlider2, {
start: 40,
orientation: "vertical",
connect: "lower",
range: {
min: 0,
max: 100,
},
});
var connectLowerSlider3 = document.getElementById("connect-lower-3");
noUiSlider.create(connectLowerSlider3, {
start: 50,
orientation: "vertical",
connect: "lower",
range: {
min: 0,
max: 100,
},
});
var connectLowerSlider4 = document.getElementById("connect-lower-4");
noUiSlider.create(connectLowerSlider4, {
start: 60,
orientation: "vertical",
connect: "lower",
range: {
min: 0,
max: 100,
},
});
var connectLowerSlider5 = document.getElementById("connect-lower-5");
noUiSlider.create(connectLowerSlider5, {
start: 70,
orientation: "vertical",
connect: "lower",
range: {
min: 0,
max: 100,
},
});
// Connect to upper
var connectUpperSlider1 = document.getElementById("connect-upper-1");
noUiSlider.create(connectUpperSlider1, {
start: 30,
orientation: "vertical",
connect: "upper",
range: {
min: 0,
max: 100,
},
});
var connectUpperSlider2 = document.getElementById("connect-upper-2");
noUiSlider.create(connectUpperSlider2, {
start: 40,
orientation: "vertical",
connect: "upper",
range: {
min: 0,
max: 100,
},
});
var connectUpperSlider3 = document.getElementById("connect-upper-3");
noUiSlider.create(connectUpperSlider3, {
start: 50,
orientation: "vertical",
connect: "upper",
range: {
min: 0,
max: 100,
},
});
var connectUpperSlider4 = document.getElementById("connect-upper-4");
noUiSlider.create(connectUpperSlider4, {
start: 60,
orientation: "vertical",
connect: "upper",
range: {
min: 0,
max: 100,
},
});
var connectUpperSlider5 = document.getElementById("connect-upper-5");
noUiSlider.create(connectUpperSlider5, {
start: 70,
orientation: "vertical",
connect: "upper",
range: {
min: 0,
max: 100,
},
});
// Tooltips
var tooltipSlider1 = document.getElementById("slider-tooltips-1");
noUiSlider.create(tooltipSlider1, {
start: [20, 80],
orientation: "vertical",
tooltips: [
false,
wNumb({
decimals: 1,
}),
],
range: {
min: 0,
max: 100,
},
});
var tooltipSlider2 = document.getElementById("slider-tooltips-2");
noUiSlider.create(tooltipSlider2, {
start: [20, 80],
orientation: "vertical",
tooltips: [
false,
wNumb({
decimals: 1,
}),
],
range: {
min: 0,
max: 100,
},
});
var tooltipSlider3 = document.getElementById("slider-tooltips-3");
noUiSlider.create(tooltipSlider3, {
start: [20, 80],
orientation: "vertical",
tooltips: [
false,
wNumb({
decimals: 1,
}),
],
range: {
min: 0,
max: 100,
},
});
// Direction top to bottom
var directionTopBottom1 = document.getElementById(
"slider-direction-top-bottom-1"
);
noUiSlider.create(directionTopBottom1, {
range: range_all_sliders,
start: 30,
connect: "lower",
orientation: "vertical",
pips: {
mode: "range",
density: 5,
},
});
var directionTopBottom2 = document.getElementById(
"slider-direction-top-bottom-2"
);
noUiSlider.create(directionTopBottom2, {
range: range_all_sliders,
start: 50,
connect: "lower",
orientation: "vertical",
pips: {
mode: "range",
density: 5,
},
});
var directionTopBottom3 = document.getElementById(
"slider-direction-top-bottom-3"
);
noUiSlider.create(directionTopBottom3, {
range: range_all_sliders,
start: 70,
connect: "lower",
orientation: "vertical",
pips: {
mode: "range",
density: 5,
},
});
// Direction bottom to top
var directionBottomTop1 = document.getElementById(
"slider-direction-bottom-top-1"
);
noUiSlider.create(directionBottomTop1, {
range: range_all_sliders,
start: 70,
connect: "lower",
orientation: "vertical",
direction: "rtl",
pips: {
mode: "range",
density: 5,
},
});
var directionBottomTop2 = document.getElementById(
"slider-direction-bottom-top-2"
);
noUiSlider.create(directionBottomTop2, {
range: range_all_sliders,
start: 50,
connect: "lower",
orientation: "vertical",
direction: "rtl",
pips: {
mode: "range",
density: 5,
},
});
var directionBottomTop3 = document.getElementById(
"slider-direction-bottom-top-3"
);
noUiSlider.create(directionBottomTop3, {
range: range_all_sliders,
start: 30,
connect: "lower",
orientation: "vertical",
direction: "rtl",
pips: {
mode: "range",
density: 5,
},
});
// Margin
var verticalMarginSlider1 = document.getElementById("vertical-margin-1");
noUiSlider.create(verticalMarginSlider1, {
start: [40, 60],
orientation: "vertical",
margin: 20,
range: {
min: 0,
max: 100,
},
});
var verticalMarginSlider2 = document.getElementById("vertical-margin-2");
noUiSlider.create(verticalMarginSlider2, {
start: [35, 65],
orientation: "vertical",
margin: 30,
range: {
min: 0,
max: 100,
},
});
var verticalMarginSlider3 = document.getElementById("vertical-margin-3");
noUiSlider.create(verticalMarginSlider3, {
start: [30, 70],
orientation: "vertical",
margin: 30,
range: {
min: 0,
max: 100,
},
});
var verticalMarginSlider4 = document.getElementById("vertical-margin-4");
noUiSlider.create(verticalMarginSlider4, {
start: [25, 75],
orientation: "vertical",
margin: 30,
range: {
min: 0,
max: 100,
},
});
var verticalMarginSlider5 = document.getElementById("vertical-margin-5");
noUiSlider.create(verticalMarginSlider5, {
start: [20, 80],
orientation: "vertical",
margin: 30,
range: {
min: 0,
max: 100,
},
});
// Limit
var verticalLimitSlider1 = document.getElementById("vertical-limit-1");
noUiSlider.create(verticalLimitSlider1, {
start: [40, 60],
orientation: "vertical",
limit: 40,
behaviour: "drag",
connect: true,
range: {
min: 0,
max: 100,
},
});
var verticalLimitSlider2 = document.getElementById("vertical-limit-2");
noUiSlider.create(verticalLimitSlider2, {
start: [35, 65],
orientation: "vertical",
limit: 40,
behaviour: "drag",
connect: true,
range: {
min: 0,
max: 100,
},
});
var verticalLimitSlider3 = document.getElementById("vertical-limit-3");
noUiSlider.create(verticalLimitSlider3, {
start: [30, 70],
orientation: "vertical",
limit: 50,
behaviour: "drag",
connect: true,
range: {
min: 0,
max: 100,
},
});
var verticalLimitSlider4 = document.getElementById("vertical-limit-4");
noUiSlider.create(verticalLimitSlider4, {
start: [25, 75],
orientation: "vertical",
limit: 50,
behaviour: "drag",
connect: true,
range: {
min: 0,
max: 100,
},
});
var verticalLimitSlider5 = document.getElementById("vertical-limit-5");
noUiSlider.create(verticalLimitSlider5, {
start: [20, 80],
orientation: "vertical",
limit: 70,
behaviour: "drag",
connect: true,
range: {
min: 0,
max: 100,
},
});
// Step
var stepsOptions = {
start: [20, 80],
orientation: "vertical",
step: 10,
range: {
min: 0,
max: 100,
},
};
var verticalStepSlider1 = document.getElementById("vertical-steps-1");
noUiSlider.create(verticalStepSlider1, stepsOptions);
var verticalStepSlider2 = document.getElementById("vertical-steps-2");
noUiSlider.create(verticalStepSlider2, stepsOptions);
var verticalStepSlider3 = document.getElementById("vertical-steps-3");
noUiSlider.create(verticalStepSlider3, stepsOptions);
var verticalStepSlider4 = document.getElementById("vertical-steps-4");
noUiSlider.create(verticalStepSlider4, stepsOptions);
var verticalStepSlider5 = document.getElementById("vertical-steps-5");
noUiSlider.create(verticalStepSlider5, stepsOptions);
// Extra large options
var vertical_xl_options = {
start: [45, 55],
behaviour: "drag",
connect: true,
orientation: "vertical",
range: {
min: 20,
max: 80,
},
};
var vertical_lg_options = {
start: [40, 60],
behaviour: "drag",
connect: true,
orientation: "vertical",
range: {
min: 20,
max: 80,
},
};
var vertical_default_options = {
start: [35, 65],
behaviour: "drag",
connect: true,
orientation: "vertical",
range: {
min: 20,
max: 80,
},
};
var vertical_sm_options = {
start: [30, 70],
behaviour: "drag",
connect: true,
orientation: "vertical",
range: {
min: 20,
max: 80,
},
};
var vertical_xs_options = {
start: [25, 75],
behaviour: "drag",
connect: true,
orientation: "vertical",
range: {
min: 20,
max: 80,
},
};
// Extra Large
var vertExtraLargeSlider = document.getElementById("vert-extra-large-slider");
var vertCircleExtraLargeSlider = document.getElementById(
"vert-circle-extra-large-slider"
);
var vertSquareExtraLargeSlider = document.getElementById(
"vert-square-extra-large-slider"
);
noUiSlider.create(vertExtraLargeSlider, vertical_xl_options);
noUiSlider.create(vertCircleExtraLargeSlider, vertical_xl_options);
noUiSlider.create(vertSquareExtraLargeSlider, vertical_xl_options);
// Large
var vertLargeSlider = document.getElementById("vert-large-slider");
var vertCircleLargeSlider = document.getElementById(
"vert-circle-large-slider"
);
var vertSquareLargeSlider = document.getElementById(
"vert-square-large-slider"
);
noUiSlider.create(vertLargeSlider, vertical_lg_options);
noUiSlider.create(vertCircleLargeSlider, vertical_lg_options);
noUiSlider.create(vertSquareLargeSlider, vertical_lg_options);
// Default
var vertDefaultSlider = document.getElementById("vert-default-slider");
var vertCircleDefaultSlider = document.getElementById(
"vert-circle-default-slider"
);
var vertSquareDefaultSlider = document.getElementById(
"vert-square-default-slider"
);
noUiSlider.create(vertDefaultSlider, vertical_default_options);
noUiSlider.create(vertCircleDefaultSlider, vertical_default_options);
noUiSlider.create(vertSquareDefaultSlider, vertical_default_options);
// Small
var vertSmallSlider = document.getElementById("vert-small-slider");
var vertCircleSmallSlider = document.getElementById(
"vert-circle-small-slider"
);
var vertSquareSmallSlider = document.getElementById(
"vert-square-small-slider"
);
noUiSlider.create(vertSmallSlider, vertical_sm_options);
noUiSlider.create(vertCircleSmallSlider, vertical_sm_options);
noUiSlider.create(vertSquareSmallSlider, vertical_sm_options);
// Extra Small
var vertExtraSmallSlider = document.getElementById("vert-extra-small-slider");
var vertCircleExtraSmallSlider = document.getElementById(
"vert-circle-extra-small-slider"
);
var vertSquareExtraSmallSlider = document.getElementById(
"vert-square-extra-small-slider"
);
noUiSlider.create(vertExtraSmallSlider, vertical_xs_options);
noUiSlider.create(vertCircleExtraSmallSlider, vertical_xs_options);
noUiSlider.create(vertSquareExtraSmallSlider, vertical_xs_options);
});

View File

@@ -0,0 +1,3 @@
var quill = new Quill("#editor-feeds", {
theme: "snow",
});

View File

@@ -0,0 +1,109 @@
$(function () {
$.fn.raty.defaults.path = "../assets/images/rating/";
// Default
$("#default-star-rating").raty();
// Default Score
$("#score-rating").raty({
score: 3,
});
// Number of stars
$("#no-of-stars").raty({
number: 10,
});
// Maximum number of stars
$("#max-number-stars").raty({
numberMax: 5,
number: 100,
});
// Read Only
$("#read-only-stars").raty({
readOnly: true,
score: 3,
});
// No Rated Message
$("#no-rated-msg").raty({
half: true,
readOnly: true,
});
// Cancel Star
$("#cancel-star").raty({
cancel: true,
});
// Space
$("#space-star").raty({
space: false,
});
// Single
$("#single-star").raty({
single: true,
});
// Half Star
$("#half-star").raty({
half: true,
});
// Star Half
$("#star-half").raty({
half: true,
starHalf: "star-half-mono.png",
});
// Round Enabled
$("#round-enabled").raty({
score: 3.26,
});
// Round Disabled
$("#round-disabled").raty({
halfShow: false,
score: 3.26,
});
// Custom Icon
$("#custom-icon-star").raty({
starOff: "heart.png",
starOn: "like.png",
});
// Icon Range
$("#icon-range").raty({
iconRange: [
{
range: 1,
on: "ti ti-cloud-rain fs-7",
off: "ti ti-cloud fs-7",
},
{
range: 2,
on: "ti ti-cloud-rain fs-7",
off: "ti ti-cloud fs-7",
},
{
range: 3,
on: "ti ti-cloud-rain fs-7",
off: "ti ti-cloud fs-7",
},
{
range: 4,
on: "ti ti-cloud-rain fs-7",
off: "ti ti-cloud fs-7",
},
{
range: 5,
on: "ti ti-cloud-rain fs-7",
off: "ti ti-cloud fs-7",
},
],
starType: "i",
});
});

View File

@@ -0,0 +1,503 @@
!(function (a) {
a(["jquery"], function (a) {
return (function () {
function h(a, b, c) {
return u({
type: e.error,
iconClass: v().iconClasses.error,
message: a,
optionsOverride: c,
title: b,
});
}
function i(c, d) {
return (
c || (c = v()),
(b = a("#" + c.containerId)),
b.length ? b : (d && (b = r(c)), b)
);
}
function j(a, b, c) {
return u({
type: e.info,
iconClass: v().iconClasses.info,
message: a,
optionsOverride: c,
title: b,
});
}
function k(a) {
c = a;
}
function l(a, b, c) {
return u({
type: e.success,
iconClass: v().iconClasses.success,
message: a,
optionsOverride: c,
title: b,
});
}
function m(a, b, c) {
return u({
type: e.warning,
iconClass: v().iconClasses.warning,
message: a,
optionsOverride: c,
title: b,
});
}
function n(a, c) {
var d = v();
b || i(d), q(a, d, c) || p(d);
}
function o(c) {
var d = v();
return (
b || i(d),
c && 0 === a(":focus", c).length
? void w(c)
: void (b.children().length && b.remove())
);
}
function p(c) {
for (var d = b.children(), e = d.length - 1; e >= 0; e--) q(a(d[e]), c);
}
function q(b, c, d) {
var e = !(!d || !d.force) && d.force;
return (
!(!b || (!e && 0 !== a(":focus", b).length)) &&
(b[c.hideMethod]({
duration: c.hideDuration,
easing: c.hideEasing,
complete: function () {
w(b);
},
}),
!0)
);
}
function r(c) {
return (
(b = a("<div/>")
.attr("id", c.containerId)
.addClass("toast-container")
.addClass(c.positionClass)),
b.appendTo(a(c.target)),
b
);
}
function s() {
return {
tapToDismiss: !0,
toastClass: "toast",
containerId: "toast-container",
debug: !1,
showMethod: "fadeIn",
showDuration: 300,
showEasing: "swing",
onShown: void 0,
hideMethod: "fadeOut",
hideDuration: 1e3,
hideEasing: "swing",
onHidden: void 0,
closeMethod: !1,
closeDuration: !1,
closeEasing: !1,
closeOnHover: !0,
extendedTimeOut: 1e3,
iconClasses: {
error: "toast-error",
info: "toast-info",
success: "toast-success",
warning: "toast-warning",
},
iconClass: "toast-info",
positionClass: "toast-top-right",
timeOut: 5e3,
titleClass: "toast-title",
messageClass: "toast-message",
escapeHtml: !1,
target: "body",
closeHtml: '<button type="button">&times;</button>',
closeClass: "toast-close-button",
newestOnTop: !0,
preventDuplicates: !1,
progressBar: !1,
progressClass: "toast-progress",
rtl: !1,
};
}
function t(a) {
c && c(a);
}
function u(c) {
function q(a) {
return (
null == a && (a = ""),
a
.replace(/&/g, "&amp;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
);
}
function r() {
y(), A(), B(), C(), D(), E(), z(), s();
}
function s() {
var a = "";
switch (c.iconClass) {
case "toast-success":
case "toast-info":
a = "polite";
break;
default:
a = "assertive";
}
j.attr("aria-live", a);
}
function u() {
e.closeOnHover && j.hover(I, H),
!e.onclick && e.tapToDismiss && j.click(G),
e.closeButton &&
n &&
n.click(function (a) {
a.stopPropagation
? a.stopPropagation()
: void 0 !== a.cancelBubble &&
a.cancelBubble !== !0 &&
(a.cancelBubble = !0),
e.onCloseClick && e.onCloseClick(a),
G(!0);
}),
e.onclick &&
j.click(function (a) {
e.onclick(a), G();
});
}
function x() {
j.hide(),
j[e.showMethod]({
duration: e.showDuration,
easing: e.showEasing,
complete: e.onShown,
}),
e.timeOut > 0 &&
((h = setTimeout(G, e.timeOut)),
(o.maxHideTime = parseFloat(e.timeOut)),
(o.hideEta = new Date().getTime() + o.maxHideTime),
e.progressBar && (o.intervalId = setInterval(J, 10)));
}
function y() {
c.iconClass && j.addClass(e.toastClass).addClass(f);
}
function z() {
e.newestOnTop ? b.prepend(j) : b.append(j);
}
function A() {
if (c.title) {
var a = c.title;
e.escapeHtml && (a = q(c.title)),
k.append(a).addClass(e.titleClass),
j.append(k);
}
}
function B() {
if (c.message) {
var a = c.message;
e.escapeHtml && (a = q(c.message)),
l.append(a).addClass(e.messageClass),
j.append(l);
}
}
function C() {
e.closeButton &&
(n.addClass(e.closeClass).attr("role", "button"), j.prepend(n));
}
function D() {
e.progressBar && (m.addClass(e.progressClass), j.prepend(m));
}
function E() {
e.rtl && j.addClass("rtl");
}
function F(a, b) {
if (a.preventDuplicates) {
if (b.message === g) return !0;
g = b.message;
}
return !1;
}
function G(b) {
var c = b && e.closeMethod !== !1 ? e.closeMethod : e.hideMethod,
d = b && e.closeDuration !== !1 ? e.closeDuration : e.hideDuration,
f = b && e.closeEasing !== !1 ? e.closeEasing : e.hideEasing;
if (!a(":focus", j).length || b)
return (
clearTimeout(o.intervalId),
j[c]({
duration: d,
easing: f,
complete: function () {
w(j),
clearTimeout(h),
e.onHidden && "hidden" !== p.state && e.onHidden(),
(p.state = "hidden"),
(p.endTime = new Date()),
t(p);
},
})
);
}
function H() {
(e.timeOut > 0 || e.extendedTimeOut > 0) &&
((h = setTimeout(G, e.extendedTimeOut)),
(o.maxHideTime = parseFloat(e.extendedTimeOut)),
(o.hideEta = new Date().getTime() + o.maxHideTime));
}
function I() {
clearTimeout(h),
(o.hideEta = 0),
j.stop(!0, !0)[e.showMethod]({
duration: e.showDuration,
easing: e.showEasing,
});
}
function J() {
var a = ((o.hideEta - new Date().getTime()) / o.maxHideTime) * 100;
m.width(a + "%");
}
var e = v(),
f = c.iconClass || e.iconClass;
if (
("undefined" != typeof c.optionsOverride &&
((e = a.extend(e, c.optionsOverride)),
(f = c.optionsOverride.iconClass || f)),
!F(e, c))
) {
d++, (b = i(e, !0));
var h = null,
j = a("<div/>"),
k = a("<div/>"),
l = a("<div/>"),
m = a("<div/>"),
n = a(e.closeHtml),
o = { intervalId: null, hideEta: null, maxHideTime: null },
p = {
toastId: d,
state: "visible",
startTime: new Date(),
options: e,
map: c,
};
return r(), x(), u(), t(p), e.debug && console && console.log(p), j;
}
}
function v() {
return a.extend({}, s(), f.options);
}
function w(a) {
b || (b = i()),
a.is(":visible") ||
(a.remove(),
(a = null),
0 === b.children().length && (b.remove(), (g = void 0)));
}
var b,
c,
g,
d = 0,
e = {
error: "error",
info: "info",
success: "success",
warning: "warning",
},
f = {
clear: n,
remove: o,
error: h,
getContainer: i,
info: j,
options: {},
subscribe: k,
success: l,
version: "2.1.3",
warning: m,
};
return f;
})();
});
// Success Type
$("#ts-success").on("click", function () {
toastr.success("Have fun storming the castle!", "Miracle Max Says");
});
// Success Type
$("#ts-info").on("click", function () {
toastr.info("We do have the Kapua suite available.", "Turtle Bay Resort");
});
// Success Type
$("#ts-warning").on("click", function () {
toastr.warning(
"My name is Inigo Montoya. You killed my father, prepare to die!"
);
});
// Success Type
$("#ts-error").on("click", function () {
toastr.error(
"I do not think that word means what you think it means.",
"Inconceivable!"
);
});
// Position Top Left
$("#pos-top-left").on("click", function () {
toastr.info(
"I do not think that word means what you think it means.",
"Top Left!",
{ positionClass: "toastr toast-top-left", containerId: "toast-top-left" }
);
});
// Position Top Center
$("#pos-top-center").on("click", function () {
toastr.info(
"I do not think that word means what you think it means.",
"Top Center!",
{
positionClass: "toastr toast-top-center",
containerId: "toast-top-center",
}
);
});
// Position Top Right
$("#pos-top-right").on("click", function () {
toastr.info(
"I do not think that word means what you think it means.",
"Top Right!",
{
positionClass: "toastr toast-top-right",
containerId: "toast-top-right",
}
);
});
// Position Top Full Width
$("#pos-top-full").on("click", function () {
toastr.info(
"I do not think that word means what you think it means.",
"Top Full Width!",
{
positionClass: "toastr toast-top-full-width",
containerId: "toast-top-full-width",
}
);
});
// Position Bottom Left
$("#pos-bottom-left").on("click", function () {
toastr.info(
"I do not think that word means what you think it means.",
"Bottom Left!",
{
positionClass: "toastr toast-bottom-left",
containerId: "toast-bottom-left",
}
);
});
// Position Bottom Center
$("#pos-bottom-center").on("click", function () {
toastr.info(
"I do not think that word means what you think it means.",
"Bottom Center!",
{
positionClass: "toastr toast-bottom-center",
containerId: "toast-bottom-center",
}
);
});
// Position Bottom Right
$("#pos-bottom-right").on("click", function () {
toastr.info(
"I do not think that word means what you think it means.",
"Bottom Right!",
{
positionClass: "toastr toast-bottom-right",
containerId: "toast-bottom-right",
}
);
});
// Position Bottom Full Width
$("#pos-bottom-full").on("click", function () {
toastr.info(
"I do not think that word means what you think it means.",
"Bottom Full Width!",
{
positionClass: "toastr toast-bottom-full-width",
containerId: "toast-bottom-full-width",
}
);
});
// Text Notification
$("#text-notification").on("click", function () {
toastr.info("Have fun storming the castle!", "Miracle Max Says");
});
// Close Button
$("#close-button").on("click", function () {
toastr.success("Have fun storming the castle!", "With Close Button", {
closeButton: true,
});
});
// Progress Bar
$("#progress-bar").on("click", function () {
toastr.warning("Have fun storming the castle!", "Progress Bar", {
progressBar: true,
});
});
// Clear Toast Button
$("#clear-toast-btn").on("click", function () {
toastr.error(
'Clear itself?<br /><br /><button type="button" class="btn btn-secondary clear">Yes</button>',
"Clear Toast Button"
);
});
// Slide Down / Slide Up
$("#slide-toast").on("click", function () {
toastr.success(
"I do not think that word means what you think it means.",
"Slide Down / Slide Up!",
{ showMethod: "slideDown", hideMethod: "slideUp", timeOut: 2000 }
);
});
// Fade In / Fade Out
$("#fade-toast").on("click", function () {
toastr.success(
"I do not think that word means what you think it means.",
"Slide Down / Slide Up!",
{ showMethod: "fadeIn", hideMethod: "fadeOut", timeOut: 2000 }
);
});
})(
"function" == typeof define && define.amd
? define
: function (a, b) {
"undefined" != typeof module && module.exports
? (module.exports = b(require("jquery")))
: (window.toastr = b(window.jQuery));
}
);