From fc2c46334e3d5380ed209992f6d445c8b2d32d6c Mon Sep 17 00:00:00 2001 From: fonsp Date: Wed, 7 Oct 2020 12:54:04 +0000 Subject: [PATCH] Pluto 0.12 fix --- Project.toml | 2 +- assets/clock.js | 6 ++--- src/Images.jl | 70 +++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 72 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 6316c092..0d87fd5a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlutoUI" uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8" authors = ["Fons van der Plas "] -version = "0.6.6" +version = "0.6.7" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/assets/clock.js b/assets/clock.js index 1fb17e7b..765d7673 100644 --- a/assets/clock.js +++ b/assets/clock.js @@ -1,5 +1,5 @@ // const clock = this.querySelector("clock") -const clock = this.currentScript.previousElementSibling +const clock = (this == undefined ? currentScript : this.currentScript).previousElementSibling const tpsInput = clock.querySelector("input") const analogfront = clock.querySelector("analog front") const analogzoof = clock.querySelector("analog zoof") @@ -13,8 +13,8 @@ tpsInput.oninput = (e) => { if (clock.classList.contains("inverted")) { dt = 1.0 / dt } - dt = (dt == Infinity || dt == 0) ? 1e9 : dt - analogzoof.style.opacity = 0.8 - Math.pow(dt, .2) + dt = dt == Infinity || dt == 0 ? 1e9 : dt + analogzoof.style.opacity = 0.8 - Math.pow(dt, 0.2) analogfront.style.animationDuration = dt + "s" e && e.stopPropagation() } diff --git a/src/Images.jl b/src/Images.jl index aeff30de..ce40db12 100644 --- a/src/Images.jl +++ b/src/Images.jl @@ -17,7 +17,7 @@ function show(io::IO, ::MIME"text/html", img::ImageInput) + + """ + end + write(io, result) +end + +# the default is a 0x0 image +get(cam::CameraInput) = Dict( + "width" => 0, + "height" => 0, + "data" => zeros(UInt8, 0, 0), +) \ No newline at end of file