Patching system, video by id
This commit is contained in:
parent
38fa75402b
commit
c6b0f1e812
19 changed files with 305 additions and 60 deletions
|
|
@ -21,10 +21,8 @@ const isModalActive = () => modal.classList.contains('is-active')
|
|||
const toggleButton = (id, force) => document.getElementById(id) ? document.getElementById(id).toggleAttribute('disabled', force) : alert('That button does not exist')
|
||||
|
||||
// -- MODAL -- //
|
||||
const swapData = ({ video_url, video_width, video_height, desc, video_download, music_title, music_url }) => {
|
||||
const swapData = ({ video_url, desc, video_download, music_title, music_url }) => {
|
||||
video.src = video_url
|
||||
video.width = video_width
|
||||
video.height = video_height
|
||||
item_title.innerText = desc
|
||||
download_button.href = video_download
|
||||
audio_title.innerText = music_title
|
||||
|
|
|
|||
|
|
@ -1,16 +1,24 @@
|
|||
const goToUser = (e) => {
|
||||
const goToUser = e => {
|
||||
e.preventDefault()
|
||||
const formData = new FormData(e.target)
|
||||
const username = formData.get('username')
|
||||
window.location.href = `./@${username}`
|
||||
}
|
||||
|
||||
const goToTag = (e) => {
|
||||
const goToTag = e => {
|
||||
e.preventDefault()
|
||||
const formData = new FormData(e.target)
|
||||
const tag = formData.get('tag')
|
||||
window.location.href = `./tag/${tag}`
|
||||
}
|
||||
|
||||
const goToVideo = e => {
|
||||
e.preventDefault()
|
||||
const formData = new FormData(e.target)
|
||||
const video_id = formData.get('video_id')
|
||||
window.location.href = `./video/${video_id}`
|
||||
}
|
||||
|
||||
document.getElementById('username_form').addEventListener('submit', goToUser, false)
|
||||
document.getElementById('tag_form').addEventListener('submit', goToTag, false)
|
||||
document.getElementById('video_form').addEventListener('submit', goToVideo, false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue