From 26edc5fa497449a3f8cfa23bc050394e834a3231 Mon Sep 17 00:00:00 2001 From: jochenkrattenmacher <10695828+jochenkrattenmacher@users.noreply.github.com> Date: Tue, 17 Jan 2023 16:28:25 +0100 Subject: [PATCH] core_theme now only affects whether standard css is loaded (no effect on js). This is also a bugfix (before, core_theme = false resulted in an error) --- src/Layout.jl | 2 +- src/Stipple.jl | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Layout.jl b/src/Layout.jl index 2aa81e6a..e52e0306 100644 --- a/src/Layout.jl +++ b/src/Layout.jl @@ -48,7 +48,7 @@ function layout(output::Union{S,Vector}, m::M; content = [ output theme(; core_theme) - Stipple.deps(m; core_theme) + Stipple.deps(m) ] partial && return content diff --git a/src/Stipple.jl b/src/Stipple.jl index 12b2361c..78719ea4 100644 --- a/src/Stipple.jl +++ b/src/Stipple.jl @@ -588,10 +588,12 @@ Registers the `routes` for all the required JavaScript dependencies (scripts). function deps_routes(channel::String = Stipple.channel_js_name; core_theme::Bool = true) :: Nothing if ! Genie.Assets.external_assets(assets_config) - Genie.Router.route(Genie.Assets.asset_route(Stipple.assets_config, :css, file="stipplecore")) do - Genie.Renderer.WebRenderable( - Genie.Assets.embedded(Genie.Assets.asset_file(cwd=dirname(@__DIR__), type="css", file="stipplecore")), - :css) |> Genie.Renderer.respond + if core_theme + Genie.Router.route(Genie.Assets.asset_route(Stipple.assets_config, :css, file="stipplecore")) do + Genie.Renderer.WebRenderable( + Genie.Assets.embedded(Genie.Assets.asset_file(cwd=dirname(@__DIR__), type="css", file="stipplecore")), + :css) |> Genie.Renderer.respond + end end if is_channels_webtransport() @@ -613,11 +615,9 @@ function deps_routes(channel::String = Stipple.channel_js_name; core_theme::Bool Genie.Assets.embedded(Genie.Assets.asset_file(cwd=normpath(joinpath(@__DIR__, "..")), type="js", file=VUEJS)), :javascript) |> Genie.Renderer.respond end - if core_theme - Genie.Router.route(Genie.Assets.asset_route(assets_config, :js, file="stipplecore"), named = :get_stipplecorejs) do - Genie.Renderer.WebRenderable( - Genie.Assets.embedded(Genie.Assets.asset_file(cwd=normpath(joinpath(@__DIR__, "..")), type="js", file="stipplecore")), :javascript) |> Genie.Renderer.respond - end + Genie.Router.route(Genie.Assets.asset_route(assets_config, :js, file="stipplecore"), named = :get_stipplecorejs) do + Genie.Renderer.WebRenderable( + Genie.Assets.embedded(Genie.Assets.asset_file(cwd=normpath(joinpath(@__DIR__, "..")), type="js", file="stipplecore")), :javascript) |> Genie.Renderer.respond end Genie.Router.route( @@ -671,14 +671,14 @@ end Outputs the HTML code necessary for injecting the dependencies in the page (the