From bd14d5d69665d205890a7771825c8b3b8bdb0440 Mon Sep 17 00:00:00 2001 From: Date: Wed, 30 Nov 2016 11:23:53 -0500 Subject: [PATCH 1/8] commit for merge --- html/webpages/homePage.html | 10 ++-- html/webpages/returnPage.html | 103 ++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 html/webpages/returnPage.html diff --git a/html/webpages/homePage.html b/html/webpages/homePage.html index 53169bf..97c9d38 100644 --- a/html/webpages/homePage.html +++ b/html/webpages/homePage.html @@ -71,10 +71,12 @@

Request

Check out our selection of devices that YOU have the chance to check out!

- + + +
diff --git a/html/webpages/returnPage.html b/html/webpages/returnPage.html new file mode 100644 index 0000000..894be31 --- /dev/null +++ b/html/webpages/returnPage.html @@ -0,0 +1,103 @@ + + + + + + + + + Synchrony Financial + + + + + + + + + +
+

Devices to Be Returned

+
+
+
+ name +
+
+

description

+
+
+
+
+
+ name +
+
+

description

+
+
+
+
+ \ No newline at end of file From 882b041cab66460b3b3dad6a335ea3aa0f97ca63 Mon Sep 17 00:00:00 2001 From: Connor L Jackson Date: Wed, 30 Nov 2016 22:25:42 -0500 Subject: [PATCH 2/8] Making the map page a bit more viewer friendly --- html/webpages/map.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/html/webpages/map.html b/html/webpages/map.html index 1af2a4b..fdf0994 100644 --- a/html/webpages/map.html +++ b/html/webpages/map.html @@ -18,9 +18,11 @@ /* Always set the map height explicitly to define the size of the div * element that contains the map. */ #map { - height: 50%; - width: 50%; + height: 60%; + width: 60%; margin:0 auto; + border-style: solid; + border-width: 20px; } h2{ From 1ed4ee941ad22d0d99b91dfae78f7c898baf535d Mon Sep 17 00:00:00 2001 From: Date: Thu, 1 Dec 2016 20:54:36 -0500 Subject: [PATCH 3/8] Functional return page -Could use some polishing. I want to make the buttons look better, and add return all/return selected options. -I do not have a working version of the request page (the most recent github version still had the null/empty string problem). I fixed it for myself but did not commit changes to hopefully avoid conflicts --- html/javascript/return.js | 143 ++++++++++++++++++++++++++++ html/webpages/homePage.html | 170 +++++++++++++++++----------------- html/webpages/returnPage.html | 126 +++++++++++++------------ 3 files changed, 294 insertions(+), 145 deletions(-) create mode 100644 html/javascript/return.js diff --git a/html/javascript/return.js b/html/javascript/return.js new file mode 100644 index 0000000..4f34951 --- /dev/null +++ b/html/javascript/return.js @@ -0,0 +1,143 @@ +var dev1 = { + id: 1, + name:"George", + hardware:"iphone", + checkout: new Date("11/11/2016"), +}; + +var dev2 = { + id: 2, + name:"Greyson", + hardware:"iphone", + checkout: new Date("8/10/2016"), +}; + +var dev3 = { + id: 3, + name:"Linkin Park", + hardware:"ipad", + checkout: new Date("8/20/2016"), +}; + +var dev4 = { + id: 4, + name:"Abercrombie", + hardware:"ipad", + checkout: new Date("11/3/2016"), +}; + +var dev5 = { + id: 5, + name:"Hulk", + hardware:"computerStick", + checkout: new Date("4/28/2016"), +}; + +var dev6 = { + id: 6, + name:"Captain America", + hardware:"computerStick", + checkout: new Date("10/22/2016"), +}; + +var devices = [dev1, dev2, dev3, dev4, dev5, dev6]; +//This array corresponds to the hardcoded inventory in request.js. The description has been replaced with a +//checkout date, because I imagine that is more the kind of info to pull from the database for this page. +//IDs, names and hardware are the same. + +populateDeviceList(); + +function populateDeviceList() +//generates html and writes to 'devContainer' div in returnPage.html +{ + var devicesToList = getCheckedOutDevices(null); + var htmlString=""; + for (var i = 0; i < devicesToList.length; i++) { + var id = devicesToList[i].id; + var name = devicesToList[i].name; + var hardware = devicesToList[i].hardware; + var checkout = devicesToList[i].checkout; + htmlString+="
"; + htmlString+=name; + htmlString+="

Checked out: " + htmlString+=checkout.toISOString().substring(0,10); + htmlString+="

You've had this device for "; + var milliseconds=new Date().getTime()-checkout.getTime(); + var seconds=Math.floor(milliseconds/1000); + var minutes=Math.floor(seconds/60); + var hours=Math.floor(minutes/60); + var days=Math.floor(hours/24); + var weeks=Math.floor(days/7); + htmlString+= weeks+ " weeks!"; + htmlString+="


"; + } + document.getElementById("devContainer").innerHTML = htmlString; + + var returnbuttons = document.getElementsByClassName('returnbutton'); + for (var i = 0; i < returnbuttons.length; i++) { + returnbuttons[i].addEventListener('click',returnDevice); + } +} + +function returnDevice() +{ + var id = this.getAttribute('id'); + id = parseInt(id.replace(/[^0-9\.]/g,''), 10); + if(isUnavailable(id)) + { + var unavailable = getUnavailableIDs(); + unavailable.splice(unavailable.indexOf(id),1); + localStorage.setItem('unavailable',JSON.stringify(unavailable)); + } + else + alert("That's already marked available. Something may have gone wrong."); + populateDeviceList(); +} + +function getCheckedOutDevices(user) +//Eventually this will return information about all devices checked out by *user* +//Right now there is only one user, and the function just returns IDs of all checked out devicess. +{ + var unavailable = getUnavailableIDs(); + var checkedDevices = new Array(); + for (var i = 0; i < unavailable.length; i++) { + for (var j = 0; j < devices.length; j++) { + if(unavailable[i] == devices[j].id) + { + checkedDevices.push(devices[j]); + break; + } + } + } + return checkedDevices; +} + +function isUnavailable(id){ + var unavailable = getUnavailableIDs(); + if(unavailable.length == 0) + return 0; + else{ + for(var i = 0; i < unavailable.length; i++){ + if(unavailable[i] == (id)) + return 1; + } + } + return 0; +} +function getUnavailableIDs() +//Identical to the function in request.js: just reads the 'unavailable' array in local storage. +//Will need to be changed (or may be obsolete) when we get a database +{ + var unavailable = new Array; + var unavailable_str = localStorage.getItem('unavailable'); + if(unavailable_str !== ""){ + unavailable = JSON.parse(unavailable_str); + } + return unavailable; +} \ No newline at end of file diff --git a/html/webpages/homePage.html b/html/webpages/homePage.html index 57a299e..3d4af10 100644 --- a/html/webpages/homePage.html +++ b/html/webpages/homePage.html @@ -1,96 +1,98 @@ - - - - - - - + + + + + + + - Synchrony Financial + Synchrony Financial - - - - - - - + div.menuBox{ + text-align: center; + position: absolute; + top: 50%; + left: 50%; + margin-top: -160px; + margin-left: -260px; + } + + + - + - -
@@ -93,6 +97,7 @@

Devices to Be Returned

+
name
@@ -100,8 +105,13 @@

Devices to Be Returned

Checked out: 4/28/2016

You've had this device for 20 months, 5 days, 11 hours and 2 minutes

+
+
+ +

+ \ No newline at end of file From 8c297227241babbedba54211ab240646142f7a0a Mon Sep 17 00:00:00 2001 From: Connor L Jackson Date: Fri, 2 Dec 2016 11:25:35 -0500 Subject: [PATCH 6/8] Removing files --- html/webpages/homePage.html.BACKUP.91.html | 109 ------------------- html/webpages/homePage.html.BASE.91.html | 94 ----------------- html/webpages/homePage.html.LOCAL.91.html | 96 ----------------- html/webpages/homePage.html.REMOTE.91.html | 94 ----------------- html/webpages/homePage.html.orig | 109 ------------------- html/webpages/map.html | 115 +++++++++++++++++++-- 6 files changed, 107 insertions(+), 510 deletions(-) delete mode 100644 html/webpages/homePage.html.BACKUP.91.html delete mode 100644 html/webpages/homePage.html.BASE.91.html delete mode 100644 html/webpages/homePage.html.LOCAL.91.html delete mode 100644 html/webpages/homePage.html.REMOTE.91.html delete mode 100644 html/webpages/homePage.html.orig diff --git a/html/webpages/homePage.html.BACKUP.91.html b/html/webpages/homePage.html.BACKUP.91.html deleted file mode 100644 index f91ce60..0000000 --- a/html/webpages/homePage.html.BACKUP.91.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - Synchrony Financial - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/html/webpages/homePage.html.BASE.91.html b/html/webpages/homePage.html.BASE.91.html deleted file mode 100644 index 53169bf..0000000 --- a/html/webpages/homePage.html.BASE.91.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - Synchrony Financial - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/html/webpages/homePage.html.LOCAL.91.html b/html/webpages/homePage.html.LOCAL.91.html deleted file mode 100644 index 97c9d38..0000000 --- a/html/webpages/homePage.html.LOCAL.91.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - Synchrony Financial - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/html/webpages/homePage.html.REMOTE.91.html b/html/webpages/homePage.html.REMOTE.91.html deleted file mode 100644 index 06d3f64..0000000 --- a/html/webpages/homePage.html.REMOTE.91.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - Synchrony Financial - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/html/webpages/homePage.html.orig b/html/webpages/homePage.html.orig deleted file mode 100644 index f91ce60..0000000 --- a/html/webpages/homePage.html.orig +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - Synchrony Financial - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/html/webpages/map.html b/html/webpages/map.html index fdf0994..21bf87a 100644 --- a/html/webpages/map.html +++ b/html/webpages/map.html @@ -66,8 +66,8 @@

Our Wonderful Synchrony Financial Map!

function initMap() { var map = new google.maps.Map(document.getElementById('map'), { - zoom: 5, - center: {lat: 38.907192, lng: -77.036871} + zoom: 4, + center: {lat: 39.023617, lng: -94.69357} }); // Create an array of alphabetical characters used to label the markers. @@ -90,27 +90,126 @@

Our Wonderful Synchrony Financial Map!

} var locations = [ {lat: 47.610150, lng: -122.201516}, //Bellevue, WA - {lat: 37.774929, lng: -122.419416}, //San Francisco, CA + {lat: 47.610150, lng: -122.201516}, //Bellevue, WA + {lat: 37.774929, lng: -122.419416}, //San Francisco, CA {lat: 37.338208, lng: -121.886329}, //San Jose, CA {lat: 33.641132, lng: -117.918669}, //Costa Mesa, CA {lat: 40.760779, lng: -111.891047}, //Salt Lake City, UT + {lat: 40.760779, lng: -111.891047}, //Salt Lake City, UT + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ {lat: 33.448377, lng: -112.074037}, //Phoenix, AZ + {lat: 14.599512, lng: 120.984219}, //Manilla, Philippines + {lat: 14.599512, lng: 120.984219}, //Manilla, Philippines + {lat: 14.599512, lng: 120.984219}, //Manilla, Philippines + {lat: 14.599512, lng: 120.984219}, //Manilla, Philippines + {lat: 14.599512, lng: 120.984219}, //Manilla, Philippines + {lat: 14.599512, lng: 120.984219}, //Manilla, Philippines + {lat: 17.385044, lng: 78.486671}, //Hyderabad, India + {lat: 17.385044, lng: 78.486671}, //Hyderabad, India + {lat: 17.385044, lng: 78.486671}, //Hyderabad, India + {lat: 17.385044, lng: 78.486671}, //Hyderabad, India + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD {lat: 44.080543, lng: -103.231015}, //Rapid City, SD - {lat: 39.023617, lng: -94.69357}, //Merriam, KS + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD + {lat: 44.080543, lng: -103.231015}, //Rapid City, SD + {lat: 39.023617, lng: -94.69357}, //Merriam, KS {lat: 39.023617, lng: -94.69357}, //Merriam, KS {lat: 36.372854, lng: -94.208817}, //Bentonville, AR + {lat: 36.372854, lng: -94.208817}, //Bentonville, AR + {lat: 36.372854, lng: -94.208817}, //Bentonville, AR + {lat: 36.372854, lng: -94.208817}, //Bentonville, AR + {lat: 36.372854, lng: -94.208817}, //Bentonville, AR + {lat: 36.372854, lng: -94.208817}, //Bentonville, AR + {lat: 36.372854, lng: -94.208817}, //Bentonville, AR + {lat: 36.372854, lng: -94.208817}, //Bentonville, AR + {lat: 36.372854, lng: -94.208817}, //Bentonville, AR {lat: 33.150674, lng: -96.823612}, //Frisco, TX - {lat: 44.953703, lng: -93.089958}, //St. Paul, MN + {lat: 33.150674, lng: -96.823612}, //Frisco, TX + {lat: 33.150674, lng: -96.823612}, //Frisco, TX + {lat: 33.150674, lng: -96.823612}, //Frisco, TX + {lat: 33.150674, lng: -96.823612}, //Frisco, TX + {lat: 33.150674, lng: -96.823612}, //Frisco, TX + {lat: 33.150674, lng: -96.823612}, //Frisco, TX + {lat: 33.150674, lng: -96.823612}, //Frisco, TX + {lat: 44.953703, lng: -93.089958}, //St. Paul, MN {lat: 44.953703, lng: -93.089958}, //St. Paul, MN {lat: 44.953703, lng: -93.089958}, //St. Paul, MN {lat: 41.878114, lng: -87.629798}, //Chicago, IL + {lat: 41.878114, lng: -87.629798}, //Chicago, IL + {lat: 41.878114, lng: -87.629798}, //Chicago, IL + {lat: 41.878114, lng: -87.629798}, //Chicago, IL + {lat: 41.878114, lng: -87.629798}, //Chicago, IL + {lat: 41.878114, lng: -87.629798}, //Chicago, IL + {lat: 41.878114, lng: -87.629798}, //Chicago, IL {lat: 39.689504, lng: -84.168827}, //Kettering, OH - {lat: 34.075376, lng: -84.29409}, //Alpharetta, GA + {lat: 39.689504, lng: -84.168827}, //Kettering, OH + {lat: 39.689504, lng: -84.168827}, //Kettering, OH + {lat: 39.689504, lng: -84.168827}, //Kettering, OH + {lat: 34.075376, lng: -84.29409}, //Alpharetta, GA + {lat: 40.798947, lng: -81.378447}, //Canton, OH {lat: 40.798947, lng: -81.378447}, //Canton, OH - {lat: 35.227087, lng: -80.843127}, //Charloette, NC + {lat: 40.798947, lng: -81.378447}, //Canton, OH + {lat: 40.798947, lng: -81.378447}, //Canton, OH + {lat: 40.798947, lng: -81.378447}, //Canton, OH + {lat: 40.798947, lng: -81.378447}, //Canton, OH + {lat: 35.227087, lng: -80.843127}, //Charloette, NC {lat: 28.538335, lng: -81.379236}, //Orlando, FL - {lat: 40.593964, lng: -74.604906}, //Bridgewater, NJ + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 28.538335, lng: -81.379236}, //Orlando, FL + {lat: 40.593964, lng: -74.604906}, //Bridgewater, NJ + {lat: 40.593964, lng: -74.604906}, //Bridgewater, NJ + {lat: 40.593964, lng: -74.604906}, //Bridgewater, NJ + {lat: 40.593964, lng: -74.604906}, //Bridgewater, NJ + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT {lat: 41.053430, lng: -73.538734}, //Stamford, CT + {lat: 41.053430, lng: -73.538734}, //Stamford, CT {lat: 41.053430, lng: -73.538734}, //Stamford, CT {lat: 41.053430, lng: -73.538734}, //Stamford, CT {lat: 41.053430, lng: -73.538734}, //Stamford, CT From c2502999c02796d886d99a51dbeff09fa2c6e732 Mon Sep 17 00:00:00 2001 From: Connor L Jackson Date: Fri, 2 Dec 2016 11:36:08 -0500 Subject: [PATCH 7/8] Navbar is now generated from navbar.js --- html/javascript/navbar.js | 1 + html/webpages/homePage.html | 25 ++++--------------------- html/webpages/listingPage.html | 23 ++--------------------- html/webpages/map.html | 23 ++--------------------- html/webpages/requestPage.html | 23 ++--------------------- html/webpages/returnPage.html | 23 ++--------------------- html/webpages/shoppingCart.html | 23 ++--------------------- 7 files changed, 15 insertions(+), 126 deletions(-) create mode 100644 html/javascript/navbar.js diff --git a/html/javascript/navbar.js b/html/javascript/navbar.js new file mode 100644 index 0000000..cfee4c6 --- /dev/null +++ b/html/javascript/navbar.js @@ -0,0 +1 @@ +document.getElementById('navbar').innerHTML = '' \ No newline at end of file diff --git a/html/webpages/homePage.html b/html/webpages/homePage.html index 3d4af10..cad2f3e 100644 --- a/html/webpages/homePage.html +++ b/html/webpages/homePage.html @@ -40,27 +40,8 @@ -