diff --git a/html/css/stylesheet.css b/html/css/stylesheet.css
index 022a40a..c6e2cb0 100644
--- a/html/css/stylesheet.css
+++ b/html/css/stylesheet.css
@@ -2,6 +2,7 @@ body{
background-color: #94969A;
padding-top: 50px;
height: 100vh;
+ overflow-x: hidden;
}
a.divlink{
diff --git a/html/javascript/listing.js b/html/javascript/listing.js
index 7fd2d55..5d1c0bc 100644
--- a/html/javascript/listing.js
+++ b/html/javascript/listing.js
@@ -44,12 +44,40 @@ var dev6 = {
};
var devices = [dev1, dev2, dev3, dev4, dev5, dev6];
-
-for(var a = 0; a < options.length; a++){
- var type = options[a].getAttribute('data-type');
+options[0].addEventListener('click', showAll);
+for(var a = 1; a < options.length; a++){
options[a].addEventListener('click', show);
}
+showAll();
+
+function showAll(){
+ var html = '';
+
+ for(var i = 0; i < devices.length; i++){
+ html += '

' + devices[i].name + '
' + devices[i].description + '
';
+ }
+
+ document.getElementById('devContainer').innerHTML = html;
+
+ var unavailable = getUnavailableItems();
+ var anchors = document.getElementsByClassName('availableAnchor');
+ for(var i = 0; i < anchors.length; i++){
+ var anchor = anchors[i];
+ var id = anchor.getAttribute('id');
+ if(isUnavailable(id)){
+ document.getElementById(id).innerHTML = 'Unavailable';
+ id = '#' + id;
+ $(id).css({'background-color':'#ff3535'});
+ }
+ else{
+ document.getElementById(id).innerHTML = 'Available';
+ id = '#' + id;
+ $(id).css({'background-color':'#1fe07f'});
+ }
+ }
+}
+
function show(){
var type = this.getAttribute('data-type');
var html = '';
diff --git a/html/javascript/request.js b/html/javascript/request.js
index 4efcdf7..6279c41 100644
--- a/html/javascript/request.js
+++ b/html/javascript/request.js
@@ -53,7 +53,6 @@ var devices = [dev1, dev2, dev3, dev4, dev5, dev6];
//add event listeners to the options in the left sidebar
for(var a = 0; a < options.length; a++){
- var type = options[a].getAttribute('data-type');
options[a].addEventListener('click', show);
}
@@ -70,6 +69,9 @@ function show(){
}
}
+ if(html.localeCompare("")==0)
+ html += "There are no devices with the search criteria: " + this.textContent + "
";
+
//add to HTML page
document.getElementById('devContainer').innerHTML = html;
diff --git a/html/webpages/listingPage.html b/html/webpages/listingPage.html
index 45d2e60..4a86942 100644
--- a/html/webpages/listingPage.html
+++ b/html/webpages/listingPage.html
@@ -54,6 +54,7 @@
-
Available Devices
+
Device Dictionary
diff --git a/html/webpages/requestPage.html b/html/webpages/requestPage.html
index 3326433..e5c4d54 100644
--- a/html/webpages/requestPage.html
+++ b/html/webpages/requestPage.html
@@ -80,7 +80,7 @@ Operating Systems
Available Devices
-
+
Choose an option to the left to begin requesting!