diff --git a/package.json b/package.json index 9310f49..246ed10 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.js b/src/index.js index 733491f..0d3a29a 100644 --- a/src/index.js +++ b/src/index.js @@ -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') } } })