Commit 1553be55 authored by jkerr's avatar jkerr
Browse files

Final Commit.

parent d45f785c
Pipeline #2602 passed with stage
in 3 seconds
......@@ -5,6 +5,7 @@
<option for="true" />
<option maxerr="50" />
<option multivar="true" />
<option globals="$, console, SetBooking, L, FilterSites" />
<option this="true" />
<option white="true" />
</component>
......
//global $
//global console
//global SetBooking
var FilterSites = (function () {
"use strict";
var pub = {};
......
//global $
var GetBookings = (function () {
"use strict";
var pub = [];
......
//global $
//global L
var Map = (function () {
"use strict";
var pub = [];
......
//global jQuery
//global $
var Reviews = (function () {
"use strict";
var pub = [];
......
//global $
//global console
var SetBooking= (function () {
"use strict";
var pub = [];
/** Displays the booking currently stored in localstorage **/
pub.displayBooking = function() {
var currBooking = JSON.parse(localStorage.getItem("savedQuickCampBooking"));
if (currBooking !== "") {
var bookingText = "";
if (currBooking.siteId !== "") {
bookingText += "<span><b>Site:</b> "+currBooking.siteId+"</span>";
}
if (currBooking.checkIn !== "") {
bookingText += "<span><b>| Check In:</b> "+currBooking.checkIn+"</span>";
}
if (currBooking.checkOut !== "") {
bookingText += "<span><b>| Check Out:</b> "+currBooking.checkOut+"</span>";
var bookingText = "";
if (currBooking.name !== "") {
$("#name").val(currBooking.name);
}
if (currBooking.siteId !== "") {
bookingText += "<span><b>Site:</b> " + currBooking.siteId + "</span>";
}
if (currBooking.checkIn !== "") {
bookingText += "<span><b>| Check In:</b> " + currBooking.checkIn + "</span>";
$("#checkIn").val(currBooking.checkIn);
}
if (currBooking.checkOut !== "") {
bookingText += "<span><b>| Check Out:</b> " + currBooking.checkOut + "</span>";
$("#checkOut").val(currBooking.checkOut);
}
bookingText = "<p id='bookingDisplay'><span>" + bookingText + "</span></p>";
$("#bookingDisplay").remove();
$("form").after(bookingText);
}
bookingText = "<p id='bookingDisplay'><span>"+bookingText+"</span></p>";
$("#bookingDisplay").remove();
$("form").after(bookingText);
};
/** Saves a booking to localstorage **/
function setBooking() {
var booking = {};
booking.name = $("#name").val();
booking.siteId = $(this).parent().parent().find("td")[0].textContent;
booking.checkIn = $("#checkIn").val();
booking.checkOut = $("#checkOut").val();
......@@ -32,6 +41,7 @@ var SetBooking= (function () {
pub.displayBooking();
}
/** Adds a book button to each available site **/
pub.updateButtons = function() {
var bookButtons = $(".bookButton");
var i;
......
//global $
//global FilterSites
var changeType = (function () {
"use strict";
var pub = {};
......
......@@ -31,7 +31,7 @@
--white: #FFFFFF;
--defaultSeperation: 20px;
--minWidth: 300px;
--minWidth: 1200px;
}
/* ======== Variables ======== */
......@@ -168,26 +168,17 @@ label {
float: right;
display: block;
}
#bookingDisplay {
width: 100%;
overflow: hidden;
border: solid green 1px;
text-align: center;
}
#bookingDisplay span {
width: auto;
margin: 0 5px 0 0;
}
#bookingDisplay p span:last-child {
margin: 0;
}
table {
width: 100%;
border-collapse: collapse;
......@@ -221,7 +212,6 @@ figure img {
#map {
height: 500px;
}
footer {
height: 120px;
padding: var(--defaultSeperation);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment