Commit 53874096 authored by Porter Libby's avatar Porter Libby
Browse files

get rid of some older versions

parent 609a9ae2
var career_community = [
{
"name" : "community 1",
"desc" : "community 1 description"
},
{
"name" : "community 2",
"desc" : "community 2 description"
},
{
"name" : "community 3",
"desc" : "community 2 description"
},
{
"name" : "community 4",
"desc" : "community 2 description"
}
]
\ No newline at end of file
This diff is collapsed.
DROP TABLE IF EXISTS majors CASCADE;
DROP TABLE IF EXISTS minors CASCADE;
DROP TABLE IF EXISTS ips CASCADE;
DROP TABLE IF EXISTS campus_life CASCADE;
DROP TABLE IF EXISTS community_engagement CASCADE;
DROP TABLE IF EXISTS research CASCADE;
DROP TABLE IF EXISTS internship CASCADE;
DROP TABLE IF EXISTS off_campus_study CASCADE;
DROP TABLE IF EXISTS career CASCADE;
CREATE TABLE majors (
major_id int primary key,
major_name varchar(20) NOT NULL
);
CREATE TABLE minors (
minor_id int primary key,
minor_name varchar(20) NOT NULL
);
CREATE TABLE ips (
ip_id int primary key,
ip_name varchar(20) NOT NULL
);
CREATE TABLE campus_life (
campus_id int primary key,
campus_name varchar(20) NOT NULL
);
CREATE TABLE community_engagement (
comm_id int primary key,
comm_name varchar(20) NOT NULL
);
CREATE TABLE research (
research_id int primary key,
research_name varchar(20) NOT NULL
);
CREATE TABLE internship (
intern_id int primary key,
intern_name varchar(20) NOT NULL
);
CREATE TABLE off_campus_study (
offcamp_id int primary key,
offcamp_name varchar(20) NOT NULL
);
CREATE TABLE career (
career_id int primary key,
career_name varchar(20) NOT NULL
);
var major = [
"African and African American Studies",
"Ancient and Classical Studies",
"Archaeology",
"Art",
"Athletics Wellness and Physical Education",
"Biochemistry",
"Biology",
"Chemistry",
"Chinese Languages",
"Chinese Studies",
"Comparative Languages and Linguistics",
"Computer Science",
"East Asian Studies",
"Economics",
"English",
"Environmental Sustainability",
"Film Studies",
"French and Francophone Studies",
"Geology",
"German Language and Literature",
"Global Management",
"History",
"Human Development and Social Relations",
"International Studies",
"Japanese Language and Linguistics",
"Japanese Studies",
"Jewish Studies",
"Languages and Cultures",
"Master of Arts in Teaching",
"Master of Education",
"Mathematics",
"Museum Studies",
"Music",
"Neuroscience",
"Peace and Global Studies",
"Philosophy",
"Physics and Astronomy",
"Politics",
"Psychology",
"Public Health",
"Public Policy",
"Religion",
"Sociology and Anthropology",
"Spanish and Hispanic Studies",
"Teaching English to Speakers of Other Languages",
"Theatre Arts",
"Women's Gender Sexuality Studies"
]
African and African American Studies
Ancient and Classical Studies
Archaeology
Art
Athletics Wellness and Physical Education
Biochemistry
Biology
Chemistry
Chinese Languages
Chinese Studies
Comparative Languages and Linguistics
Computer Science
East Asian Studies
Economics
English
Environmental Sustainability
Film Studies
French and Francophone Studies
Geology
German Language and Literature
Global Management
History
Human Development and Social Relations
International Studies
Japanese Language and Linguistics
Japanese Studies
Jewish Studies
Languages and Cultures
Master of Arts in Teaching
Master of Education
Mathematics
Museum Studies
Music
Neuroscience
Peace and Global Studies
Philosophy
Physics and Astronomy
Politics
Psychology
Public Health
Public Policy
Religion
Sociology and Anthropology
Spanish and Hispanic Studies
Teaching English to Speakers of Other Languages
Theatre Arts
Women's Gender Sexuality Studies
Off-Campus Study 1
Off-Campus Study 2
Off-Campus Study 3
Off-Campus Study 4
Off-Campus Study 5
Off-Campus Study 6
Off-Campus Study 7
Off-Campus Study 8
Off-Campus Study 9
Off-Campus Study 10
\ No newline at end of file
//put the content in a .js file
function create_dropdown(element_id,data_file_name = '')
{
//var options_list = fs.readFileSync("test_input.dat").toString().split("\r\n");
var options_list = ['Program 1', 'Program 2', 'Program 3'];
var dropdown_menu = document.createElement('select');
for (i = 0; i < options_list.length; i++)
{
var option = document.createElement('option');
option.value = options_list[i];
option.innerText = options_list[i];
dropdown_menu.appendChild(option);
}
dropdown_menu.id = element_id + " menu";
dropdown_menu.style.display = "none";
dropdown_menu.style['margin-left'] = "30%";
document.getElementById(element_id).appendChild(dropdown_menu);
}
function show_hide(element_id)
{
var element = document.getElementById(element_id);
if (element.style.display === "none") {
element.style.display = 'block';
}
else {
element.style.display = "none";
}
}
create_dropdown('demo');
//document.getElementById('demo').onclick = "show_hide('demo menu')";
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>TEST BOX</title>
</head>
<body>
<div id="demo", onclick="show_hide(id + ' menu')",
style="
width: 200px;
height: 200px;
margin-top: 10%;
background-color: #db584f;
margin-left: 40%;
display: inline-block;
text-align: center;
font-size: 20px">
Click Me!
</div>
<script src="test.js"></script>
</body>
</html>
\ No newline at end of file
//Major related file
console.log(career_community); // show json structure from 'data/careers-data.js'
var career_community_counter = 0;
var container_name = 'Career Community';
var container = document.getElementById(container_name);
var text_display = document.createElement('span');
text_display.innerHTML = career_community[0].name;
var prev_button = document.createElement('button');
prev_button.innerHTML = "<";
var next_button = document.createElement('button');
next_button.innerHTML = ">";
text_display.style.display = 'inline';
prev_button.style.display = 'inline';
next_button.style.display = 'inline';
var selector = document.createElement('div');
selector.style.textAlign = 'center';
selector.style.marginTop = '50%';
selector.style.color = 'white'
selector.appendChild(prev_button);
selector.appendChild(text_display);
selector.appendChild(next_button);
container.appendChild(selector);
prev_button.onclick = function(){
career_community_counter--;
if (career_community_counter == -1){
career_community_counter = career_community.length - 1;
}
text_display.innerHTML = career_community[career_community_counter].name;
}
next_button.onclick = function(){
career_community_counter++;
if (career_community_counter == career_community.length){
career_community_counter = 0;
}
text_display.innerHTML = career_community[career_community_counter].name;
}
// Render menu for the career object
// Porter Libby 2019
console.log(careers); // show json structure from 'data/careers-data.js'
var container_name = 'Career';
var container = document.getElementById(container_name);
//create search obj
var search_container = document.createElement("div");
search_container.id = 'career-search-container';
var search = document.createElement("INPUT");
search.id = 'myInput'
search.setAttribute("type", "text");
search.setAttribute("value", "");
prompt = document.createElement('span');
prompt.innerHTML = 'Search for Careers:';
search_container.appendChild(prompt);
search_container.appendChild(search);
container.appendChild(search_container);
names_for_search = [];
for(x=0;x<careers.length;x++){
names_for_search.push(careers[x]);
}
function autocomplete(inp, arr) {
var currentFocus;
inp.addEventListener("input", function(e) {
var a, b, i, val = this.value;
closeAllLists();
if (!val) { return false;}
currentFocus = -1;
a = document.createElement("DIV");
a.setAttribute("id", this.id + "autocomplete-list");
a.setAttribute("class", "autocomplete-items");
this.parentNode.appendChild(a);
for (i = 0; i < arr.length; i++) {
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
b = document.createElement("DIV");
b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
b.innerHTML += arr[i].substr(val.length);
b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
b.addEventListener("click", function(e) {
inp.value = this.getElementsByTagName("input")[0].value;
closeAllLists();
});
a.appendChild(b);
}
}
});
inp.addEventListener("keydown", function(e) {
var x = document.getElementById(this.id + "autocomplete-list");
if (x) x = x.getElementsByTagName("div");
if (e.keyCode == 40) {
currentFocus++;
addActive(x);
} else if (e.keyCode == 38) { //up
currentFocus--;
addActive(x);
} else if (e.keyCode == 13) {
e.preventDefault();
if (currentFocus > -1) {
if (x) x[currentFocus].click();
}
}
});
function addActive(x) {
if (!x) return false;
removeActive(x);
if (currentFocus >= x.length) currentFocus = 0;
if (currentFocus < 0) currentFocus = (x.length - 1);
x[currentFocus].classList.add("autocomplete-active");
}
function removeActive(x) {
for (var i = 0; i < x.length; i++) {
x[i].classList.remove("autocomplete-active");
}
}
function closeAllLists(elmnt) {
var x = document.getElementsByClassName("autocomplete-items");
for (var i = 0; i < x.length; i++) {
if (elmnt != x[i] && elmnt != inp) {
x[i].parentNode.removeChild(x[i]);
}
}
}
document.addEventListener("click", function (e) {
closeAllLists(e.target);
});
}
autocomplete(document.getElementById("myInput"), names_for_search);
console.log(major);
var container_name = 'Major Selection';
var container = document.getElementById(container_name);
//create search obj
var search_container = document.createElement("div");
search_container.id = 'major-search-container';
var search = document.createElement("INPUT");
search.id = 'myInput'
search.setAttribute("type", "text");
search.setAttribute("value", "");
prompt = document.createElement('span');
prompt.innerHTML = 'Search for Major:';
search_container.appendChild(prompt);
search_container.appendChild(search);
container.appendChild(search_container);
names_for_search = [];
for(x=0;x<major.length;x++){
names_for_search.push(major[x]);
}
function autocomplete(inp, arr) {
var currentFocus;
inp.addEventListener("input", function(e) {
var a, b, i, val = this.value;
closeAllLists();
if (!val) { return false;}
currentFocus = -1;
a = document.createElement("DIV");
a.setAttribute("id", this.id + "autocomplete-list");
a.setAttribute("class", "autocomplete-items");
this.parentNode.appendChild(a);
for (i = 0; i < arr.length; i++) {
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
b = document.createElement("DIV");
b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
b.innerHTML += arr[i].substr(val.length);
b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
b.addEventListener("click", function(e) {
inp.value = this.getElementsByTagName("input")[0].value;
closeAllLists();
});
a.appendChild(b);
}
}
});
inp.addEventListener("keydown", function(e) {
var x = document.getElementById(this.id + "autocomplete-list");
if (x) x = x.getElementsByTagName("div");
if (e.keyCode == 40) {
currentFocus++;
addActive(x);
} else if (e.keyCode == 38) { //up
currentFocus--;
addActive(x);
} else if (e.keyCode == 13) {
e.preventDefault();
if (currentFocus > -1) {
if (x) x[currentFocus].click();
}
}
});
function addActive(x) {
if (!x) return false;
removeActive(x);
if (currentFocus >= x.length) currentFocus = 0;
if (currentFocus < 0) currentFocus = (x.length - 1);
x[currentFocus].classList.add("autocomplete-active");
}
function removeActive(x) {
for (var i = 0; i < x.length; i++) {
x[i].classList.remove("autocomplete-active");
}
}
function closeAllLists(elmnt) {
var x = document.getElementsByClassName("autocomplete-items");
for (var i = 0; i < x.length; i++) {
if (elmnt != x[i] && elmnt != inp) {
x[i].parentNode.removeChild(x[i]);
}
}
}
document.addEventListener("click", function (e) {
closeAllLists(e.target);
});
}
autocomplete(document.getElementById("myInput"), names_for_search);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment