Skip to content

Connors branch #27

Merged
merged 9 commits into from Feb 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file removed WebContent/html/imgs/computerStick.png
Binary file not shown.
Binary file removed WebContent/html/imgs/ipad.png
Binary file not shown.
Binary file removed WebContent/html/imgs/iphone.png
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 5 additions & 26 deletions WebContent/html/javascript/listing.jsp
Expand Up @@ -9,95 +9,81 @@
</head>
<body>
<%
/*MySQLAccess myaccess = new MySQLAccess();
MySQLAccess myaccess = new MySQLAccess();
myaccess.connectDB();
String name = myaccess.getResult()[0][0];
String description = myaccess.getResult()[0][1];
String hardware = myaccess.getResult()[0][2];*/
//out.println(name);
String hardware = myaccess.getResult()[0][2];
System.out.println(name);
//out.println(description);
//out.println(hardware);
%>

<script type=text/javascript>
//gets variables for database data
<%
/*(function(){
window.myname = "<=name>" ; --> add percents to make them work in the name box things
window.mydesc = "<=description>" ;
window.myhard = "<=hardware>" ;
})(); */
%>


//get all the option buttons
var options = document.getElementsByClassName('option');

/*var dev7 = {
name: window.myname,
description: window.mydesc,
hardware: window.myhard,
software:"intel"
};*/

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];
var devices = [dev1, dev2, dev3, dev4, dev5, dev6, dev7];
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 += '<div class = "deviceContainer"><div class = "imgContainer"><img src="../imgs/' + devices[i].hardware + '.png" class = "device">' + devices[i].name + '</div><div class = "deviceDescp"><p>' + devices[i].description + '</p><div class = "availableAnchor" id = "' + (i+1) + '"></div></div></div><br><br>';
}

document.getElementById('devContainer').innerHTML = html;

var unavailable = getUnavailableItems();
var anchors = document.getElementsByClassName('availableAnchor');
for(var i = 0; i < anchors.length; i++){
Expand All @@ -115,19 +101,15 @@ function showAll(){
}
}
}

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 += '<div class = "deviceContainer"><div class = "imgContainer"><img src="../imgs/' + devices[i].hardware + '.png" class = "device">' + devices[i].name + '</div><div class = "deviceDescp"><p>' + devices[i].description + '</p><div class = "availableAnchor" id = "' + (i+1) + '"></div></div></div><br><br>'
}
}

document.getElementById('devContainer').innerHTML = html;

var unavailable = getUnavailableItems();
var anchors = document.getElementsByClassName('availableAnchor');
for(var i = 0; i < anchors.length; i++){
Expand All @@ -145,8 +127,6 @@ function show(){
}
}
}


function getUnavailableItems(){
var unavailable = new Array;
var unavailable_str = localStorage.getItem('unavailable');
Expand All @@ -155,7 +135,6 @@ function getUnavailableItems(){
}
return unavailable;
}

function isUnavailable(id){
var unavailable = getUnavailableItems();
if(unavailable.length == 0)
Expand Down
2 changes: 1 addition & 1 deletion WebContent/html/javascript/navbar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

211 changes: 0 additions & 211 deletions WebContent/html/javascript/return.js

This file was deleted.