Difference between revisions of "Team:Purdue/Navpage"

Line 25: Line 25:
 
var charCode = 65;
 
var charCode = 65;
 
for(i = 0; i<26; i++){
 
for(i = 0; i<26; i++){
     entryBlocks[i]= letterEntry(String.fromCharCode(charCode));
+
     entryBlocks[i]= new letterEntry(String.fromCharCode(charCode));
 
}
 
}
 
arrayToList();
 
arrayToList();
 
//now a tags are made, time to place them in an unordered list
 
//now a tags are made, time to place them in an unordered list
entryBlocks.forEach(atagsInList());
+
atagsInList();
 
}
 
}
  
Line 45: Line 45:
 
function arrayToList(){
 
function arrayToList(){
 
var obj;
 
var obj;
for (obj in entryBlocks){
+
var temp;
obj.Url_name.sort();
+
 
var subObj;
 
var subObj;
for (subObj in obj.Url_name){
+
var as;
 +
for (i = 0; i < len(entryBlocks); i++){
 +
entryBlocks[i].Url_name.sort();
  
var temp = subObj.split(",",1);
+
for (k = 0; k < len(entryBlocks[i].Url_name); k++){
var as =  document.createElement("a");
+
temp = entryBlocks[i].Url_name[k].split(",",1);
 +
as =  document.createElement("a");
 
as.href=temp[1];
 
as.href=temp[1];
 
as.innerHTML=temp[0];
 
as.innerHTML=temp[0];
Line 61: Line 63:
 
function atagsInList(obj,Index){
 
function atagsInList(obj,Index){
 
//takes the link tags and adds them to a list
 
//takes the link tags and adds them to a list
obj.ulList = document.createElement("ul");
+
var list_item;
obj.a.forEach(function(obje,index){
+
for (i=0; i < len(entryBlocks); i++){
var list_item = document.createElement("li");
+
entryBlocks[i].ulList = document.createElement("ul");
list_item.appendChild(obje);
+
for (k=0; k < len(entryBlocks[i].a);k++){
obj.ulList.appendChild(list_item);
+
obj.(function(obje,index){
 +
list_item = document.createElement("li");
 +
list_item.appendChild(entryBlocks[i].a[k]);
 +
entryBlocks[i].ulList.appendChild(list_item);
 
});
 
});
obj.Header.appendChild(obj.ulList);
+
document.getElementById("div").appendChild(entryBlocks[i].Header);
document.getElementById("div").appendChild(obj.Header);
+
document.getElementById("div").appendChild(entryBlocks[i].ulList);
 
}
 
}
  

Revision as of 16:30, 13 June 2018

Bootstrap Example