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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
SWD
SWLab UI
Commits
b6a3d216
Commit
b6a3d216
authored
Oct 25, 2024
by
minseok.park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update download
parent
a421d64f
Pipeline
#21719
passed with stages
in 3 minutes and 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
40 deletions
+10
-40
07-header.js
src/js/07-header.js
+10
-40
No files found.
src/js/07-header.js
View file @
b6a3d216
...
...
@@ -14,7 +14,7 @@
}
})
function
downloadFile
()
{
function
downloadFile
(
isMobile
)
{
var
pathname
=
window
.
location
.
pathname
var
path
=
pathname
.
split
(
'/'
)
var
isInternal
=
path
[
4
]?.
includes
(
'-s'
)
...
...
@@ -31,48 +31,18 @@
:
path
[
4
]
:
''
// 링크 생성 및 열기
var
link
=
`https://swlab.bwg.co.kr/web/dms/download-file?filename=
${
filename
}
.zip&directory=
${
directory
}
`
window
.
open
(
link
,
'_blank'
)
const
downloadLink
=
`https://swlab.bwg.co.kr/web/dms/download-file?filename=
${
filename
}
.zip&directory=
${
directory
}
`
if
(
isMobile
)
{
window
.
open
(
downloadLink
,
'_blank'
)
}
else
{
window
.
location
.
href
=
downloadLink
}
}
// PC 다운로드 버튼
download
.
addEventListener
(
'click'
,
downloadFile
)
download
.
addEventListener
(
'click'
,
()
=>
downloadFile
(
false
)
)
// 모바일 다운로드 버튼
downloadMobile
.
addEventListener
(
'click'
,
downloadFile
)
// download.addEventListener('click', function () {
// var pathname = window.location.pathname
// var path = pathname.split('/')
// var isInternal = path[4].includes('-s')
// var filename = path[3] ? path[3] === 'swlab-docs'
// ? 'docs' : isInternal ? `docs-${path[3]}-s` : `docs-${path[3]}` : ''
// var directory = path[3] && path[4] ? path[3] === 'swlab-docs' ? path[3] : path[4] : ''
// var link = document.createElement('a')
// link.href = `https://swlab.bwg.co.kr/web/dms/download-file?filename=${filename}.zip&directory=${directory}`
// link.click()
// if (link.parentNode) {
// document.body.removeChild(link)
// }
// })
// downlaodMobile.addEventListener('click', function () {
// var pathname = window.location.pathname
// var path = pathname.split('/')
// var isInternal = path[4].includes('-s')
// var filename = path[3] ? path[3] === 'swlab-docs'
// ? 'docs' : isInternal ? `docs-${path[3]}-s` : `docs-${path[3]}` : ''
// var directory = path[3] && path[4] ? path[3] === 'swlab-docs' ? path[3] : path[4] : ''
// var link = document.createElement('a')
// link.href = `https://swlab.bwg.co.kr/web/dms/download-file?filename=${filename}.zip&directory=${directory}`
// link.click()
// if (link.parentNode) {
// document.body.removeChild(link)
// }
// })
downloadMobile
.
addEventListener
(
'click'
,
()
=>
downloadFile
(
true
))
})()
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