Skip to content

Commit

Permalink
SweetAlert
Browse files Browse the repository at this point in the history
  • Loading branch information
tsawler committed Feb 21, 2021
1 parent 273f9cd commit b0bbfbf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion working-html/reservation.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/datepicker-bs4.min.css">
<link rel="stylesheet" type="text/css" href="https://unpkg.com/notie/dist/notie.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.min.css">

<style>
.my-footer {
Expand Down Expand Up @@ -133,6 +134,7 @@ <h1 class="mt-3">Search for Availability</h1>
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/datepicker-full.min.js"></script>
<script src="https://unpkg.com/notie"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.min.js"></script>

<script>
console.log("I am printing from javascript");
Expand All @@ -156,7 +158,8 @@ <h1 class="mt-3">Search for Availability</h1>
})();

document.getElementById("colorButton").addEventListener("click", function () {
notify("This is my message", "warning");
// notify("This is my message", "warning");
notifyModal("title", "<em>hello, world</em>", "success", "My text for the button")
})

const elem = document.getElementById('reservation-dates');
Expand All @@ -171,6 +174,15 @@ <h1 class="mt-3">Search for Availability</h1>
})
}

function notifyModal(title, text ,icon, confirmationButtonText){
Swal.fire({
title: title,
html: text,
icon: icon,
confirmButtonText: confirmationButtonText
})
}

</script>

</body>
Expand Down

0 comments on commit b0bbfbf

Please sign in to comment.