Fix quoting and escaping of JS fragments

NB jQuery $('#id') in a string looks like an [expr ...] to Jim!
This commit is contained in:
df 2021-04-17 01:55:33 +00:00
parent 8bbc28d3c2
commit 243dfdd595

View File

@ -283,9 +283,10 @@ if {$type ne "ts" || ("ODEncrypted" ni $flags && $url eq "") } {
</tr>"
set hasffmpeg 1
} elseif {$type eq "ts" && $url ne ""} {
puts { <script type="text/javascript"> }
puts "$('#playDL').attr('href','$url').enable();
puts { </script> }
puts [format {
<script type="text/javascript">
$('#playDL').attr('href','%s').enable();
</script> } $url]
}
puts "
</table>
@ -293,10 +294,9 @@ puts "
if {$hasffmpeg} {
set url "/browse/ffmpeg.jim?file=[cgi_quote_url $file]"
puts { <script type="text/javascript"> }
puts "var url = \"$url\";"
puts {
$('#ffmpeg').load(url, function() { $('#play, #playDL').enable(); });
</script>
}
puts [format {
<script type="text/javascript">
var url = "%s";
$('#ffmpeg').load(url, function() { $('#play, #playDL').enable(); }); }
</script> } $url]
}