2 <script type=
"text/javascript">
3 function deleteItem(sender) {
4 sender.parentNode.remove();
7 const p = document.createElement('p');
8 const temp = document.getElementById('item-template');
9 p.innerHTML = temp.innerHTML;
10 const marker = document.getElementById('add-item');
11 const parent = marker.parentNode;
12 parent.insertBefore(p, marker);
23 <form action=
"/playlists/submit" method=
"POST">
24 <input type=
"hidden" name=
"playlistId" value=
"{{.Playlist.Id}}">
26 <input type=
"checkbox" id=
"playlistEnabled" name=
"playlistEnabled" value=
"1" {{if .Playlist.Enabled}} checked {{end}}
>
27 <label for=
"playlistEnabled">Playlist enabled?
</label><br>
30 <label for=
"playlistName">Name:
</label>
31 <input type=
"text" id=
"playlistName" name=
"playlistName" value=
"{{.Playlist.Name}}">
34 <label for=
"playlistStartTime">Transmission Start:
</label>
35 <input type=
"datetime-local" id=
"playlistStartTime" name=
"playlistStartTime" value=
"{{.Playlist.StartTime}}">
37 <h3>Playlist Items
</h3>
41 <input type=
"text" name=
"delaySeconds" value=
"{{.DelaySeconds}}" class=
"seconds">
43 <select name=
"isRelative">
44 <option value=
"1">from previous
</option>
45 <option value=
"0" {{if not .IsRelative}}
selected=
"selected" {{end}}
>from start
</option>
48 <select name=
"filename">{{$f := .Filename}}
49 <option value=
"">(no file selected)
</option>
51 <option value=
"{{.}}" {{if eq . $f }}
selected=
"selected" {{end}}
>{{.}}
</option>
54 <a href=
"#" onclick=
"deleteItem(this)">(Delete)
</a>
58 <a href=
"#" onclick=
"addItem()" id=
"add-item">Add Item
</a>
61 <input type=
"submit" value=
"Save Playlist">
66 <form action=
"/playlists/delete" method=
"POST">
67 <input type=
"hidden" name=
"playlistId" value=
"{{.Playlist.Id}}">
69 <input type=
"submit" value=
"Delete Playlist">
73 <template id=
"item-template">
75 <input type=
"text" name=
"delaySeconds" value=
"0" class=
"seconds">
77 <select name=
"isRelative">
78 <option value=
"1">from previous
</option>
79 <option value=
"0">from start
</option>
82 <select name=
"filename">
83 <option value=
"">(no file selected)
</option>
85 <option value=
"{{.}}">{{.}}
</option>
88 <a href=
"#" onclick=
"deleteItem(this)">(Delete)
</a>