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
20abfb90
Commit
20abfb90
authored
Aug 27, 2024
by
minseok.park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rollback
parent
58af47f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
43 deletions
+43
-43
09-session.js
src/js/09-session.js
+41
-41
header-content.hbs
src/partials/header-content.hbs
+2
-2
No files found.
src/js/09-session.js
View file @
20abfb90
;(
function
()
{
'use strict'
//
;(function () {
//
'use strict'
const
logo
=
document
.
getElementById
(
'logo'
)
//
const logo = document.getElementById('logo')
function
getCookie
(
name
)
{
const
cookies
=
document
.
cookie
.
split
(
';'
)
for
(
let
i
=
0
;
i
<
cookies
.
length
;
i
++
)
{
const
cookie
=
cookies
[
i
].
trim
()
if
(
cookie
.
startsWith
(
name
+
'='
))
{
return
cookie
.
substring
(
name
.
length
+
1
)
}
}
return
null
}
//
function getCookie (name) {
//
const cookies = document.cookie.split(';')
//
for (let i = 0; i < cookies.length; i++) {
//
const cookie = cookies[i].trim()
//
if (cookie.startsWith(name + '=')) {
//
return cookie.substring(name.length + 1)
//
}
//
}
//
return null
//
}
document
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
const
jsessionid
=
getCookie
(
'JSESSIONID'
)
//
document.addEventListener('DOMContentLoaded', function () {
//
const jsessionid = getCookie('JSESSIONID')
if
(
jsessionid
)
{
// JSESSIONID 쿠키 값이 있을 경우 추가할 a 태그 생성
const
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'
//
if (jsessionid) {
//
// JSESSIONID 쿠키 값이 있을 경우 추가할 a 태그 생성
//
const 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 링크 바로 아래에 삽입
const
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
)
}
}
//
// 기존 BXM 링크 바로 아래에 삽입
//
const 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/'
}
})
})
})()
//
// 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 @
20abfb90
<header
class=
"header"
>
<nav
class=
"navbar"
>
<div
class=
"navbar-brand"
>
{{!-- <a class="navbar-item" href="https://swlab.bwg.co.kr/"> --}}
<a
id=
"logo"
class=
"navbar-item"
>
<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