Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Curriculum-Request
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tim Steiner
Curriculum-Request
Commits
d36ba034
Commit
d36ba034
authored
15 years ago
by
Tim Steiner
Browse files
Options
Downloads
Patches
Plain Diff
Various updates to public-view, made comment icons clickable.
parent
76377958
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
document_root/javascript/courses/public-view/search-box.js
+151
-0
151 additions, 0 deletions
document_root/javascript/courses/public-view/search-box.js
with
151 additions
and
0 deletions
document_root/javascript/courses/public-view/search-box.js
0 → 100644
+
151
−
0
View file @
d36ba034
addLoadEvent
(
onLoadPublicViewSearch
);
function
onLoadPublicViewSearch
()
{
if
(
document
.
getElementById
(
'
refineSearchLink
'
))
{
document
.
getElementById
(
'
refineSearchLink
'
).
onclick
=
handleRefineSearchLinkClick
;
}
document
.
getElementById
(
'
college
'
).
onchange
=
handleChangeSelectHierarchy
;
document
.
getElementById
(
'
department
'
).
onchange
=
handleChangeSelectHierarchy
;
handleChangeSelectHierarchy
();
if
(
document
.
getElementById
(
'
printButton
'
))
{
document
.
getElementById
(
'
printButton
'
).
onclick
=
function
()
{
window
.
print
();
};
}
var
helpLinks
=
getElementsByClassName
(
'
hoverHelp
'
);
for
(
var
i
=
0
;
i
<
helpLinks
.
length
;
i
++
)
{
helpLinks
[
i
].
onmouseover
=
displayHoverHelp
;
helpLinks
[
i
].
onmouseout
=
hideHoverHelp
;
helpLinks
[
i
].
onclick
=
function
()
{
return
false
;};
}
document
.
getElementById
(
'
ace
'
).
onclick
=
function
()
{
document
.
getElementById
(
'
aceOutcomes
'
).
disabled
=
!
this
.
checked
;
var
options
=
document
.
getElementById
(
'
aceOutcomes
'
).
getElementsByTagName
(
'
option
'
);
for
(
var
i
=
0
;
i
<
options
.
length
;
i
++
)
{
options
[
i
].
selected
=
this
.
checked
;
}
document
.
getElementById
(
'
aceOutcomes
'
).
focus
();
}
if
(
document
.
getElementById
(
'
reset
'
))
{
document
.
getElementById
(
'
reset
'
).
onclick
=
function
()
{
clearForm
(
this
.
form
);
return
false
;
}
}
}
function
handleRefineSearchLinkClick
()
{
document
.
getElementById
(
'
searchSummary
'
).
style
.
display
=
'
none
'
;
document
.
getElementById
(
'
searchForm
'
).
style
.
display
=
''
;
}
function
handleChangeSelectHierarchy
()
{
var
collegeSelect
=
document
.
getElementById
(
'
college
'
);
var
departmentSelect
=
document
.
getElementById
(
'
department
'
);
var
subjectSelect
=
document
.
getElementById
(
'
subject
'
);
var
selectedCollegeId
=
collegeSelect
.
options
[
collegeSelect
.
selectedIndex
].
value
;
var
options
=
departmentSelect
.
getElementsByTagName
(
'
option
'
);
for
(
var
i
=
options
.
length
-
1
;
i
>=
0
;
i
--
)
{
if
(
options
[
i
].
getAttribute
(
'
rel
'
)
==
selectedCollegeId
||
collegeSelect
.
value
==
0
||
options
[
i
].
value
==
0
)
{
options
[
i
].
style
.
display
=
''
;
}
else
{
options
[
i
].
style
.
display
=
'
none
'
;
}
}
var
selectedDepartment
=
departmentSelect
.
options
[
departmentSelect
.
selectedIndex
];
if
(
selectedDepartment
.
style
.
display
==
'
none
'
)
{
departmentSelect
.
selectedIndex
=
0
;
}
var
selectedDepartments
=
new
Array
();
if
(
departmentSelect
.
selectedIndex
==
0
)
{
var
options
=
departmentSelect
.
getElementsByTagName
(
'
option
'
);
for
(
var
i
=
options
.
length
-
1
;
i
>=
0
;
i
--
)
{
if
(
options
[
i
].
style
.
display
==
'
none
'
)
{
continue
;
}
selectedDepartments
.
push
(
options
[
i
].
value
);
}
}
else
{
selectedDepartments
.
push
(
departmentSelect
.
options
[
departmentSelect
.
selectedIndex
].
value
);
}
options
=
subjectSelect
.
getElementsByTagName
(
'
option
'
);
for
(
var
i
=
options
.
length
-
1
;
i
>=
0
;
i
--
)
{
if
(
selectedDepartments
.
inArray
(
options
[
i
].
getAttribute
(
'
rel
'
))
||
options
[
i
].
value
==
0
)
{
options
[
i
].
style
.
display
=
''
;
}
else
{
options
[
i
].
style
.
display
=
'
none
'
;
}
}
var
selectedSubject
=
subjectSelect
.
options
[
subjectSelect
.
selectedIndex
];
if
(
selectedSubject
.
style
.
display
==
'
none
'
)
{
subjectSelect
.
selectedIndex
=
0
;
}
}
function
displayHoverHelp
(
e
)
{
e
=
e
||
window
.
event
;
var
cursor
=
{
x
:
0
,
y
:
0
};
if
(
e
.
pageX
||
e
.
pageY
)
{
cursor
.
x
=
e
.
pageX
;
cursor
.
y
=
e
.
pageY
;
}
else
{
cursor
.
x
=
e
.
clientX
+
(
document
.
documentElement
.
scrollLeft
||
document
.
body
.
scrollLeft
)
-
(
document
.
documentElement
.
clientLeft
||
document
.
body
.
clientLeft
);
cursor
.
y
=
e
.
clientY
+
(
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
)
-
(
document
.
documentElement
.
clientTop
||
document
.
body
.
clientTop
);
}
var
helpDiv
,
helpText
;
if
(
!
document
.
getElementById
(
'
floating_help_text_div
'
))
{
helpDiv
=
document
.
createElement
(
'
div
'
);
helpDiv
.
style
.
display
=
'
none
'
;
helpDiv
.
id
=
'
floating_help_text_div
'
;
helpText
=
document
.
createTextNode
(
''
);
helpDiv
.
style
.
position
=
'
absolute
'
;
helpDiv
.
appendChild
(
helpText
);
document
.
body
.
appendChild
(
helpDiv
);
}
else
{
helpDiv
=
document
.
getElementById
(
'
floating_help_text_div
'
);
}
if
(
getElementsByClassName
(
'
hoverHelpText
'
,
this
,
'
span
'
)[
0
].
childNodes
[
0
])
{
helpDiv
.
childNodes
[
0
].
data
=
getElementsByClassName
(
'
hoverHelpText
'
,
this
,
'
span
'
)[
0
].
childNodes
[
0
].
data
;
helpDiv
.
style
.
borderWidth
=
'
1px
'
;
if
(
document
.
body
.
clientWidth
-
cursor
.
x
<
cursor
.
x
)
{
helpDiv
.
style
.
left
=
''
;
helpDiv
.
style
.
right
=
(
document
.
body
.
clientWidth
-
cursor
.
x
+
5
)
+
'
px
'
;
}
else
{
helpDiv
.
style
.
left
=
(
cursor
.
x
+
5
)
+
'
px
'
;
helpDiv
.
style
.
right
=
''
;
}
helpDiv
.
style
.
top
=
(
cursor
.
y
+
5
)
+
'
px
'
;
helpDiv
.
style
.
display
=
'
block
'
;
}
}
function
hideHoverHelp
()
{
if
(
document
.
getElementById
(
'
floating_help_text_div
'
))
{
document
.
getElementById
(
'
floating_help_text_div
'
).
style
.
display
=
'
none
'
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment