Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sucs-site
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Alexander Moras
sucs-site
Commits
d9387cf9
Commit
d9387cf9
authored
9 years ago
by
Laurence Sebastian Bowes
Browse files
Options
Downloads
Plain Diff
what
Merge branch 'master' of
https://projects.sucs.org/sucssite/sucs-site
parents
a7b59e82
ad9d9fb6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/js/cb.js
+67
-69
67 additions, 69 deletions
htdocs/js/cb.js
with
67 additions
and
69 deletions
htdocs/js/cb.js
+
67
−
69
View file @
d9387cf9
/*
addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
*/
function
addEvent
(
obj
,
type
,
fn
)
{
if
(
obj
.
addEventListener
)
obj
.
addEventListener
(
type
,
fn
,
false
);
else
if
(
obj
.
attachEvent
)
{
obj
[
"
e
"
+
type
+
fn
]
=
fn
;
obj
[
type
+
fn
]
=
function
()
{
obj
[
"
e
"
+
type
+
fn
](
window
.
event
);
}
obj
.
attachEvent
(
"
on
"
+
type
,
obj
[
type
+
fn
]
);
}
addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
*/
function
addEvent
(
obj
,
type
,
fn
)
{
if
(
obj
.
addEventListener
)
obj
.
addEventListener
(
type
,
fn
,
false
);
else
if
(
obj
.
attachEvent
)
{
obj
[
"
e
"
+
type
+
fn
]
=
fn
;
obj
[
type
+
fn
]
=
function
()
{
obj
[
"
e
"
+
type
+
fn
](
window
.
event
)
;
}
;
obj
.
attachEvent
(
"
on
"
+
type
,
obj
[
type
+
fn
]);
}
}
/*
createElement function found at http://simon.incutio.com/archive/2003/06/15/javascriptWithXML
*/
createElement function found at http://simon.incutio.com/archive/2003/06/15/javascriptWithXML
*/
function
createElement
(
element
)
{
if
(
typeof
document
.
createElementNS
!=
'
undefined
'
)
{
return
document
.
createElementNS
(
'
http://www.w3.org/1999/xhtml
'
,
element
);
}
if
(
typeof
document
.
createElement
!=
'
undefined
'
)
{
return
document
.
createElement
(
element
);
}
return
false
;
if
(
typeof
document
.
createElementNS
!=
'
undefined
'
)
{
return
document
.
createElementNS
(
'
http://www.w3.org/1999/xhtml
'
,
element
);
}
if
(
typeof
document
.
createElement
!=
'
undefined
'
)
{
return
document
.
createElement
(
element
);
}
return
false
;
}
function
insertTop
(
obj
)
{
// Create the two div elements needed for the top of the box
d
=
createElement
(
"
div
"
);
d
.
className
=
"
bt
"
;
// The outer div needs a class name
d2
=
createElement
(
"
div
"
);
// Create the two div elements needed for the top of the box
d
=
createElement
(
"
div
"
);
d
.
className
=
"
bt
"
;
// The outer div needs a class name
d2
=
createElement
(
"
div
"
);
d
.
appendChild
(
d2
);
obj
.
insertBefore
(
d
,
obj
.
firstChild
);
obj
.
insertBefore
(
d
,
obj
.
firstChild
);
}
function
insertBottom
(
obj
)
{
// Create the two div elements needed for the bottom of the box
d
=
createElement
(
"
div
"
);
d
.
className
=
"
bb
"
;
// The outer div needs a class name
d2
=
createElement
(
"
div
"
);
// Create the two div elements needed for the bottom of the box
d
=
createElement
(
"
div
"
);
d
.
className
=
"
bb
"
;
// The outer div needs a class name
d2
=
createElement
(
"
div
"
);
d
.
appendChild
(
d2
);
obj
.
appendChild
(
d
);
obj
.
appendChild
(
d
);
}
function
initCB
()
{
// Find all div elements
var
divs
=
document
.
getElementsByTagName
(
'
div
'
);
var
cbDivs
=
[];
for
(
var
i
=
0
;
i
<
divs
.
length
;
i
++
)
{
// Find all div elements with cbb in their class attribute while allowing for multiple class names
if
(
/
\b
cbb
\b
/
.
test
(
divs
[
i
].
className
))
cbDivs
[
cbDivs
.
length
]
=
divs
[
i
];
}
// Loop through the found div elements
var
thediv
,
outer
,
i1
,
i2
;
for
(
var
i
=
0
;
i
<
cbDivs
.
length
;
i
++
)
{
// Save the original outer div for later
thediv
=
cbDivs
[
i
];
// Create a new div, give it the original div's class attribute, and replace 'cbb' with 'cb'
outer
=
createElement
(
'
div
'
);
outer
.
className
=
thediv
.
className
;
outer
.
className
=
thediv
.
className
.
replace
(
'
cbb
'
,
'
cb
'
);
// Change the original div's class name and replace it with the new div
thediv
.
className
=
'
i3
'
;
thediv
.
parentNode
.
replaceChild
(
outer
,
thediv
);
// Create two new div elements and insert them into the outermost div
i1
=
createElement
(
'
div
'
);
i1
.
className
=
'
i1
'
;
outer
.
appendChild
(
i1
);
i2
=
createElement
(
'
div
'
);
i2
.
className
=
'
i2
'
;
i1
.
appendChild
(
i2
);
// Insert the original div
i2
.
appendChild
(
thediv
);
// Insert the top and bottom divs
insertTop
(
outer
);
insertBottom
(
outer
);
}
function
initCB
()
{
// Find all div elements
var
divs
=
document
.
getElementsByTagName
(
'
div
'
);
var
cbDivs
=
[];
for
(
var
i
=
0
;
i
<
divs
.
length
;
i
++
)
{
// Find all div elements with cbb in their class attribute while allowing for multiple class names
if
(
/
\b
cbb
\b
/
.
test
(
divs
[
i
].
className
))
cbDivs
[
cbDivs
.
length
]
=
divs
[
i
];
}
// Loop through the found div elements
var
thediv
,
outer
,
i1
,
i2
;
for
(
var
j
=
0
;
j
<
cbDivs
.
length
;
j
++
)
{
// Save the original outer div for later
thediv
=
cbDivs
[
j
];
// Create a new div, give it the original div's class attribute, and replace 'cbb' with 'cb'
outer
=
createElement
(
'
div
'
);
outer
.
className
=
thediv
.
className
;
outer
.
className
=
thediv
.
className
.
replace
(
'
cbb
'
,
'
cb
'
);
// Change the original div's class name and replace it with the new div
thediv
.
className
=
'
i3
'
;
thediv
.
parentNode
.
replaceChild
(
outer
,
thediv
);
// Create two new div elements and insert them into the outermost div
i1
=
createElement
(
'
div
'
);
i1
.
className
=
'
i1
'
;
outer
.
appendChild
(
i1
);
i2
=
createElement
(
'
div
'
);
i2
.
className
=
'
i2
'
;
i1
.
appendChild
(
i2
);
// Insert the original div
i2
.
appendChild
(
thediv
);
// Insert the top and bottom divs
insertTop
(
outer
);
insertBottom
(
outer
);
}
}
if
(
document
.
getElementById
&&
document
.
createTextNode
)
{
addEvent
(
window
,
'
load
'
,
initCB
);
if
(
document
.
getElementById
&&
document
.
createTextNode
)
{
addEvent
(
window
,
'
load
'
,
initCB
);
}
\ No newline at end of file
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