@ -28,6 +28,8 @@ pageSetup = function(isEditor) {
// title and description both default to row description
document . getElementById ( "VideoTitle" ) . value = data . video _title ? data . video _title : data . description ;
document . getElementById ( "VideoDescription" ) . value = data . video _description ? data . video _description : data . description ;
// tags default to tags from sheet
document . getElementById ( "VideoTags" ) . value = tags _list _to _string ( data . video _tags ? data . video _tags : data . tags ) ;
// If any edit notes, show them
if ( data . notes . length > 0 ) {
@ -242,6 +244,7 @@ thrimbletrimmerSubmit = function(state) {
video _end : end ,
video _title : document . getElementById ( "VideoTitle" ) . value ,
video _description : document . getElementById ( "VideoDescription" ) . value ,
video _tags : tags _string _to _list ( document . getElementById ( "VideoTags" ) . value ) ,
allow _holes : document . getElementById ( 'AllowHoles' ) . checked ,
upload _location : document . getElementById ( 'uploadLocation' ) . value ,
video _channel : document . getElementById ( "StreamName" ) . value ,
@ -380,3 +383,20 @@ thrimbletrimmerResetLink = function(force) {
}
} ) ) ;
} ;
tags _list _to _string = function ( tag _list ) {
return tag _list . join ( ", " ) ;
}
tags _string _to _list = function ( tag _string ) {
return tag _string . split ( "," ) . map ( tag => tag . trim ( ) ) . filter ( tag => tag . length > 0 ) ;
}
round _trip _tag _string = function ( ) {
var element = document . getElementById ( "VideoTags" ) ;
element . value = tags _list _to _string (
tags _string _to _list (
element . value
)
) ;
}