Skip to content

Commit

Permalink
using embedded
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed Nov 12, 2024
1 parent cd19980 commit 205a92d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
4 changes: 2 additions & 2 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if ("outerHTML" in SVGElement.prototype) {
// breakpoints defined in assets/css/_variables.scss
const breakpoints = { xs: 0, sm: 544, md: 800, lg: 1088, xxl: 1344 };

submitOnEvents(["blur", "change"]);
/* submitOnEvents(["blur", "change"]);
googleAnalytics();
setupGlobalNavigation();
collapse();
Expand Down Expand Up @@ -159,4 +159,4 @@ previousEventsButton();
pslPageSetup();
accordionInit();
mobileAppBanner();
mobileAppBanner(); */
10 changes: 4 additions & 6 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import Config
config :dotcom, :cache, Dotcom.Cache.Multilevel
config :dotcom, :trip_plan_feedback_cache, Dotcom.Cache.TripPlanFeedback.Cache

config :kino_live_component, KinoLiveComponent.Endpoint,
adapter: Bandit.PhoenixAdapter,
http: [ip: {0, 0, 0, 0}, port: 9999],
server: true,
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
config :kino_live_component,
css_path: "http://localhost:8090/app.css",
endpoint: "http://localhost:4001/kino-live-component",
js_path: "http://localhost:8090/app.js"
21 changes: 21 additions & 0 deletions lib/dotcom_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,27 @@ defmodule DotcomWeb.Router do
end
end

if Mix.env() == :dev do
pipeline :allow_insecure_headers do
plug(:accepts, ["html"])
plug(:fetch_session)
plug(:protect_from_forgery)
plug(:put_insecure_headers)
end

defp put_insecure_headers(conn, _) do
conn
|> put_resp_header("access-control-allow-origin", "*")
|> put_resp_header("content-security-policy", "frame-ancestors *;")
end

scope "/kino-live-component", KinoLiveComponent do
pipe_through([:allow_insecure_headers])

live("/", Live.Index)
end
end

scope "/preview", DotcomWeb do
import Phoenix.LiveView.Router
pipe_through([:browser, :browser_live, :basic_auth])
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ defmodule DotCom.Mixfile do
{:html_sanitize_ex, "1.4.3"},
{:httpoison, "2.2.1"},
{:inflex, "2.1.0"},
{:kino_live_component, "0.0.1", only: :dev},
{:kino_live_component, "0.0.2"},
{:jason, "1.4.4", override: true},
{:logster, "1.1.1"},
{:mail, "0.4.1"},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"jsx": {:hex, :jsx, "3.1.0", "d12516baa0bb23a59bb35dccaf02a1bd08243fcbb9efe24f2d9d056ccff71268", [:rebar3], [], "hexpm", "0c5cc8fdc11b53cc25cf65ac6705ad39e54ecc56d1c22e4adb8f5a53fb9427f3"},
"kino": {:hex, :kino, "0.14.2", "46c5da03f2d62dc119ec5e1c1493f409f08998eac26015ecdfae322ffff46d76", [:mix], [{:fss, "~> 0.1.0", [hex: :fss, repo: "hexpm", optional: false]}, {:nx, "~> 0.1", [hex: :nx, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}, {:table, "~> 0.1.2", [hex: :table, repo: "hexpm", optional: false]}], "hexpm", "f54924dd0800ee8b291fe437f942889e90309eb3541739578476f53c1d79c968"},
"kino_live_component": {:hex, :kino_live_component, "0.0.1", "aae49e8d2bdf7c59bef1f2804c5671f8a8376c264d760d9fb67fcba64de48cdb", [:mix], [{:bandit, "1.5.7", [hex: :bandit, repo: "hexpm", optional: false]}, {:jason, "1.4.4", [hex: :jason, repo: "hexpm", optional: false]}, {:kino, "0.14.2", [hex: :kino, repo: "hexpm", optional: false]}, {:phoenix, "1.7.14", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "4.1.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_live_view, "0.20.17", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "451b52fed7c37ad7c80fc3932d4c012a79db35c50f6ad85811bb445223742173"},
"kino_live_component": {:hex, :kino_live_component, "0.0.2", "872ec328f1e740e4f6488e9e104862fc680f5148c8642a34cd435a514fd57250", [:mix], [{:bandit, "1.5.7", [hex: :bandit, repo: "hexpm", optional: false]}, {:jason, "1.4.4", [hex: :jason, repo: "hexpm", optional: false]}, {:kino, "0.14.2", [hex: :kino, repo: "hexpm", optional: false]}, {:phoenix, "1.7.14", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "4.1.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_live_view, ">= 0.20.17", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "ca9facceb3503587217e4050572f937374ec02ea90b29fefacaea31c7c30bc79"},
"logster": {:hex, :logster, "1.1.1", "d6fddac540dd46adde0c894024500867fe63b0043713f842c62da5815e21db10", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "d18e852c430812ad1c9756998ebe46ec814c724e6eb551a512d7e3f8dee24cef"},
"mail": {:hex, :mail, "0.4.1", "f3928edeeafbc833319879811fc9337c453acb039f68119cc6732775aa0dea04", [:mix], [], "hexpm", "d9e69b60431084b8c88603f0d899736b46356a6ca12397b63034133d9382b92d"},
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
Expand Down

0 comments on commit 205a92d

Please sign in to comment.