fix: bugs

This commit is contained in:
Joshua Seigler 2021-11-29 23:57:53 -05:00
parent 1b49b532dc
commit c853faf3ca
2 changed files with 6 additions and 10 deletions

View file

@ -7,7 +7,7 @@
"license": "MIT",
"scripts": {
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
"build": "parcel build index.html --no-scope-hoist --public-url ./",
"build": "parcel build index.html --no-scope-hoist --public-url ./ && echo ipfsvideo.cc > ./dist/CNAME",
"serve": "parcel serve index.html --open -p 8888",
"start": "npm run serve",
"test": "npm run build && playwright test tests --browser=firefox --retries=3",

View file

@ -52,26 +52,22 @@ document.addEventListener('DOMContentLoaded', async () => {
menu.style.top = e.pageY + 'px'
e.preventDefault()
}
background.onClick = e => {
background.onclick = e => {
e.stopPropagation()
background.classList.toggle('is-hidden')
}
const url = `http://ipfsvideo.cc?hash=${
hash
}${
title && '&title=' + encodeURIComponent(title)
(title && '&title=' + encodeURIComponent(title))||''
}${
source && '&source=' + encodeURIComponent(source)
(source && '&source=' + encodeURIComponent(source))||''
}`
document.getElementById('contextMenu-url').onClick = e => {
e.stopPropagation()
document.getElementById('contextMenu-url').onclick = e => {
navigator.clipboard.writeText(url)
background.classList.toggle('is-hidden')
}
document.getElementById('contextMenu-urlWithTime').onClick = e => {
e.stopPropagation()
document.getElementById('contextMenu-urlWithTime').onclick = e => {
navigator.clipboard.writeText(`${url}&time=${Math.round(video.currentTime)}`)
background.classList.toggle('is-hidden')
}
}
})