2023-03-06 17:59:58 -05:00
|
|
|
$(document).ready(() ->
|
2023-03-07 10:53:18 -05:00
|
|
|
$('.channel-path').click((e) ->
|
2023-03-07 10:55:29 -05:00
|
|
|
newPath = prompt('New channel directory path', $(this).find('span').text())
|
2023-03-07 10:53:18 -05:00
|
|
|
if newPath
|
|
|
|
payload =
|
|
|
|
directory_path: newPath
|
|
|
|
channelId = $('#channel-id').val()
|
|
|
|
$.post('/channel/' + channelId + '/edit/directory_path', payload, (data) ->
|
|
|
|
if data == 'success'
|
|
|
|
$('.channel-path span').text(newPath)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-03-06 17:59:58 -05:00
|
|
|
$('.video-status').click((e) ->
|
2023-03-07 10:55:29 -05:00
|
|
|
newStatus = prompt('New video status', $(this).find('span').text())
|
2023-03-07 10:53:18 -05:00
|
|
|
if newStatus
|
|
|
|
newStatus = newStatus.toLowerCase()
|
|
|
|
payload =
|
|
|
|
status: newStatus
|
|
|
|
videoId = $('#video-id').val()
|
|
|
|
$.post('/video/' + videoId + '/edit/status', payload, (data) ->
|
|
|
|
if data == 'success'
|
|
|
|
$('.video-status span').text(capitalizeWord(newStatus))
|
|
|
|
)
|
2023-03-06 17:59:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
$('.video-serial').click((e) ->
|
2023-03-07 10:55:29 -05:00
|
|
|
newSerial = prompt('New video serial number', $(this).find('span').text())
|
2023-03-07 10:53:18 -05:00
|
|
|
if newSerial
|
|
|
|
payload =
|
|
|
|
serial: newSerial
|
|
|
|
videoId = $('#video-id').val()
|
|
|
|
$.post('/video/' + videoId + '/edit/serial', payload, (data) ->
|
|
|
|
if data == 'success'
|
|
|
|
$('.video-serial span').text(newSerial)
|
|
|
|
)
|
2023-03-06 17:59:58 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
capitalizeWord = (str) ->
|
|
|
|
return str.charAt(0).toUpperCase() + str.slice(1)
|