Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SWLab UI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hyeryung
SWLab UI
Commits
9107f981
Commit
9107f981
authored
Aug 27, 2024
by
minseok.park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
세션 여부에 따른 홈페이지 이동 및 dropdown 메뉴 변경
parent
826ca574
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
09-session.js
src/js/09-session.js
+47
-0
header-content.hbs
src/partials/header-content.hbs
+2
-1
No files found.
src/js/09-session.js
0 → 100644
View file @
9107f981
;(
function
()
{
'use strict'
const
logo
=
document
.
getElementById
(
'logo'
)
function
getCookie
(
name
)
{
let
cookies
=
document
.
cookie
.
split
(
';'
)
for
(
let
i
=
0
;
i
<
cookies
.
length
;
i
++
)
{
let
cookie
=
cookies
[
i
].
trim
()
if
(
cookie
.
startsWith
(
name
+
'='
))
{
return
cookie
.
substring
(
name
.
length
+
1
)
}
}
return
null
}
document
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
let
jsessionid
=
getCookie
(
'JSESSIONID'
)
if
(
jsessionid
)
{
// JSESSIONID 쿠키 값이 있을 경우 추가할 a 태그 생성
let
newLink
=
document
.
createElement
(
'a'
)
newLink
.
className
=
'navbar-item'
newLink
.
href
=
'https://swlab.bwg.co.kr/web/docs/bxm/swlab-docs-bxm-s/current/concepts/overview.html'
newLink
.
textContent
=
'BXM Concepts Overview'
// 기존 BXM 링크 바로 아래에 삽입
let
bxmLink
=
document
.
querySelector
(
'.navbar-dropdown .navbar-item[href="https://swlab.bwg.co.kr/web/docs/bxm/swlab-docs-bxm/current/index.html"]'
)
if
(
bxmLink
)
{
bxmLink
.
insertAdjacentElement
(
'afterend'
,
newLink
)
}
}
// logo 클릭 이벤트
logo
.
addEventListener
(
'click'
,
function
(
event
)
{
if
(
jsessionid
)
{
// JSESSIONID 쿠키 값이 있을 경우
window
.
location
.
href
=
'https://swlab.bwg.co.kr/web/dms/home'
}
else
{
// JSESSIONID 쿠키 값이 없을 경우
window
.
location
.
href
=
'https://swlab.bwg.co.kr/web/main/'
}
})
})
})()
src/partials/header-content.hbs
View file @
9107f981
<header
class=
"header"
>
<nav
class=
"navbar"
>
<div
class=
"navbar-brand"
>
<a
class=
"navbar-item"
href=
"https://swlab.bwg.co.kr/"
>
{{!-- <a class="navbar-item" href="https://swlab.bwg.co.kr/"> --}}
<a
id=
"logo"
class=
"navbar-item"
>
<i
class=
"navbar-logo"
></i>
<div
class=
"navbar-title-contents"
>
<span
class=
"navbar-title"
>
SWLab
</span>
...
...
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