diff --git a/html/javascript/listing.js b/html/javascript/listing.js index b27d54e..88a7793 100644 --- a/html/javascript/listing.js +++ b/html/javascript/listing.js @@ -56,7 +56,7 @@ function show(){ for(var i = 0; i < devices.length; i++){ if(type.localeCompare(devices[i].hardware) == 0 || type.localeCompare(devices[i].software) == 0){ - html += '
' + devices[i].name + '

' + devices[i].description + '


' + html += '
' + devices[i].name + '

' + devices[i].description + '


' } } diff --git a/html/javascript/request.js b/html/javascript/request.js new file mode 100644 index 0000000..b27d54e --- /dev/null +++ b/html/javascript/request.js @@ -0,0 +1,64 @@ +//get all the option buttons +var options = document.getElementsByClassName('option'); + +var dev1 = { + name:"George", + description:"George is probably the coolest iPhone to exist. Ever. Point blank, period.", + hardware:"iphone", + software:"apple" +}; + +var dev2 = { + name:"Greyson", + description:"Greyson is pretty cool.. I guess.", + hardware:"iphone", + software:"apple" +}; + +var dev3 = { + name:"Linkin Park", + description:'"The hardest part of ending is starting again."', + hardware:"ipad", + software:"apple" +}; + +var dev4 = { + name:"Abercrombie", + description:"To all the people that hated me in high school, I have the prettiest clothes you all wear now!!", + hardware:"ipad", + software:"apple" +}; + +var dev5 = { + name:"Hulk", + description:"Go ahead and HULK SMASH! this awesome computer stick into your USB.", + hardware:"computerStick", + software:"intel" +}; + +var dev6 = { + name:"Captain America", + description:'"Make America Great Again. Wait, thats someone else.."', + hardware:"computerStick", + software:"intel" +}; + +var devices = [dev1, dev2, dev3, dev4, dev5, dev6]; + +for(var a = 0; a < options.length; a++){ + var type = options[a].getAttribute('data-type'); + options[a].addEventListener('click', show); +} + +function show(){ + var type = this.getAttribute('data-type'); + var html = ''; + + for(var i = 0; i < devices.length; i++){ + if(type.localeCompare(devices[i].hardware) == 0 || type.localeCompare(devices[i].software) == 0){ + html += '
' + devices[i].name + '

' + devices[i].description + '


' + } + } + + document.getElementById('devContainer').innerHTML = html; +} \ No newline at end of file diff --git a/html/webpages/homePage.html b/html/webpages/homePage.html index 8de362e..53169bf 100644 --- a/html/webpages/homePage.html +++ b/html/webpages/homePage.html @@ -56,7 +56,7 @@
  • Home
  • Request Device
  • Return Device
  • -
  • Device Listing
  • +
  • Device Listing
  • User Information
  • @@ -66,21 +66,23 @@