Merge pull request #1448 from OliverEvans96/gif_cache

Remove cache-busting from gif animation. Should be done by the frontend.
This commit is contained in:
Michael Krabbe Borregaard 2019-01-16 09:30:39 +01:00 committed by GitHub
commit 7b3826c2d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,13 +93,13 @@ end
# write out html to view the gif... note the rand call which is a hack so the image doesn't get cached # write out html to view the gif
function Base.show(io::IO, ::MIME"text/html", agif::AnimatedGif) function Base.show(io::IO, ::MIME"text/html", agif::AnimatedGif)
ext = file_extension(agif.filename) ext = file_extension(agif.filename)
write(io, if ext == "gif" write(io, if ext == "gif"
"<img src=\"$(relpath(agif.filename))?$(rand())>\" />" "<img src=\"$(relpath(agif.filename))\" />"
elseif ext in ("mov", "mp4") elseif ext in ("mov", "mp4")
"<video controls><source src=\"$(relpath(agif.filename))?$(rand())>\" type=\"video/$ext\"></video>" "<video controls><source src=\"$(relpath(agif.filename)) type=\"video/$ext\"></video>"
else else
error("Cannot show animation with extension $ext: $agif") error("Cannot show animation with extension $ext: $agif")
end) end)