Insert more line breaks
This commit is contained in:
@ -122,7 +122,13 @@ struct AudioPlayer: HtmlProducer {
|
||||
|
||||
var content: String {
|
||||
"""
|
||||
<div class="playlist-song amplitude-song-container amplitude-play-pause amplitude-paused" data-amplitude-song-index="\(index)"><img src="\(image)"><div class="playlist-song-meta"><span class="playlist-song-name">\(name)</span><span class="playlist-song-artist">\(album) • \(artist)</span></div></div>
|
||||
<div class="playlist-song amplitude-song-container amplitude-play-pause amplitude-paused" data-amplitude-song-index="\(index)">
|
||||
<img src="\(image)">
|
||||
<div class="playlist-song-meta">
|
||||
<span class="playlist-song-name">\(name)</span>
|
||||
<span class="playlist-song-artist">\(album) • \(artist)</span>
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,14 @@ struct AudioPlayerScript: HtmlProducer {
|
||||
}
|
||||
|
||||
func populate(_ result: inout String) {
|
||||
result += "<script>window.onload = () => { "
|
||||
result += "<script>\nwindow.onload = () => { "
|
||||
result += "Amplitude.init({ songs: "
|
||||
let songData = try! JSONEncoder().encode(items)
|
||||
result += String(data: songData, encoding: .utf8)!
|
||||
result += "}); }; " // Close Amplitude.init and window.onload
|
||||
result += "}); };\n" // Close Amplitude.init and window.onload
|
||||
result += "function playEntry(index) { Amplitude.playSongAtIndex(index) };"
|
||||
result += animatePlaylist
|
||||
result += "</script>"
|
||||
result += "\n</script>"
|
||||
}
|
||||
|
||||
private var animatePlaylist: String {
|
||||
|
Reference in New Issue
Block a user