Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
WebDev
epic-journey-display
Commits
438e4d59
Commit
438e4d59
authored
Mar 05, 2020
by
Porter Libby
Browse files
work on data layout
parent
bc51c745
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/data/data.js
View file @
438e4d59
...
...
@@ -46,55 +46,196 @@ var dictionary = {
"
community engagement 1
"
,
"
community engagement 2
"
],
"
major_selection
"
:
[
"
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
"
],
"
major_selection
"
:
{
"
African and African American Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Ancient and Classical Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Archaeology
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Art
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Athletics Wellness and Physical Education
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Biochemistry
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Biology
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Chemistry
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Chinese Languages
"
:[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Chinese Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Comparative Languages and Linguistics
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Computer Science
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
East Asian Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Economics
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
English
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Environmental Sustainability
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Film Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
French and Francophone Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Geology
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
German Language and Literature
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Global Management
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
History
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Human Development and Social Relations
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
International Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Japanese Language and Linguistics
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Japanese Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Jewish Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Languages and Cultures
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Master of Arts in Teaching
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Master of Education
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Mathematics
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Museum Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Music
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Neuroscience
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Peace and Global Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Philosophy
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Physics and Astronomy
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Politics
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Psychology
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Public Health
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Public Policy
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Religion
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Sociology and Anthropology
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Spanish and Hispanic Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Teaching English to Speakers of Other Languages
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Theatre Arts
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
],
"
Women's Gender Sexuality Studies
"
:
[
"
www.sample-link.com
"
,
"
sample major description
"
]
},
"
research
"
:
[
"
research option 1
"
,
"
research option 2
"
,
...
...
public/js/searchBar.js
View file @
438e4d59
...
...
@@ -21,17 +21,19 @@ function create_searchbar(parent, key){
search_container
.
appendChild
(
prompt
);
search_container
.
appendChild
(
search
);
parent
.
appendChild
(
search_container
);
names_for_search
=
[];
for
(
x
=
0
;
x
<
dictionary
[
key
].
length
;
x
++
){
names_for_search
.
push
(
dictionary
[
key
][
x
]);
}
names_for_search
=
Object
.
keys
(
dictionary
[
key
]);
autocomplete
(
parent
.
querySelector
(
"
#searchbar
"
),
names_for_search
);
autocomplete
(
parent
.
querySelector
(
"
#searchbar
"
),
names_for_search
,
dictionary
[
key
]
);
}
function
autocomplete
(
inp
,
arr
)
{
function
autocomplete
(
inp
,
arr
,
sub_dict
)
{
var
currentFocus
;
inp
.
addEventListener
(
"
input
"
,
function
(
e
)
{
if
(
arr
.
includes
(
inp
.
value
)){
createInfo
(
sub_dict
[
inp
.
value
])
}
else
{
destroyInfo
();
}
var
a
,
b
,
i
,
val
=
this
.
value
;
closeAllLists
();
if
(
!
val
)
{
return
false
;}
...
...
@@ -92,5 +94,17 @@ function autocomplete(inp, arr) {
}
document
.
addEventListener
(
"
click
"
,
function
(
e
)
{
closeAllLists
(
e
.
target
);
if
(
arr
.
includes
(
inp
.
value
)){
createInfo
(
sub_dict
[
inp
.
value
])
}
else
{
destroyInfo
()
}
});
}
function
createInfo
(
info_arr
){
console
.
log
(
'
creating related info
'
)
}
function
destroyInfo
(){
console
.
log
(
'
No info
'
)
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment