Skip to content

Commit

Permalink
make the title refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso committed May 26, 2024
1 parent f90f59e commit 0171176
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 25 deletions.
6 changes: 3 additions & 3 deletions wasm/app-worker.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const cacheName = "app-" + "v0.6.3";
const cacheName = "app-" + "v0.6.4";
const resourcesToCache = ["/","/app.css","/app.js","/manifest.webmanifest","/wasm_exec.js","/web/app.wasm","/web/css/alert.css","/web/img/logo.png","https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js","https://cdn.jsdelivr.net/npm/[email protected]/css/halfmoon.min.css","https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.11/clipboard.min.js","https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css","https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-twilight.min.css"];

self.addEventListener("install", (event) => {
console.log("installing app worker v0.6.3");
console.log("installing app worker v0.6.4");

event.waitUntil(
caches
Expand All @@ -28,7 +28,7 @@ self.addEventListener("activate", (event) => {
);
})
);
console.log("app worker v0.6.3 is activated");
console.log("app worker v0.6.4 is activated");
});

self.addEventListener("fetch", (event) => {
Expand Down
2 changes: 1 addition & 1 deletion wasm/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var goappOnAppInstallChange = function () {
goappAppInstallChangedBeforeWasmLoaded = true;
};

const goappEnv = {"GOAPP_INTERNAL_URLS":"null","GOAPP_ROOT_PREFIX":"/","GOAPP_STATIC_RESOURCES_URL":"/web","GOAPP_VERSION":"v0.6.3"};
const goappEnv = {"GOAPP_INTERNAL_URLS":"null","GOAPP_ROOT_PREFIX":"/","GOAPP_STATIC_RESOURCES_URL":"/web","GOAPP_VERSION":"v0.6.4"};
const goappLoadingLabel = "{progress}%";
const goappWasmContentLength = "";
const goappWasmContentLengthHeader = "";
Expand Down
11 changes: 5 additions & 6 deletions wasm/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ func (i *index) dismissError(_ app.Context, _ app.Event) {
i.err = nil
}

type back struct {
type title struct {
app.Compo
}

func (b *back) Render() app.UI {
return app.A().Href("#").Body(app.I().OnClick(b.OnClick).Class("fa fa-arrow-left fa-2x"))
func (b *title) Render() app.UI {
return app.Div().Class("title").Text("CRD Parser").OnClick(b.OnClick)
}

func (b *back) OnClick(ctx app.Context, _ app.Event) {
func (b *title) OnClick(ctx app.Context, _ app.Event) {
ctx.Reload()
}

Expand All @@ -53,12 +53,11 @@ type header struct {

func (h *header) Render() app.UI {
return app.Header().Body(app.Nav().Body(
app.Div().Class("title").Text("CRD Parser"),
&title{},
app.Ul().Body(
app.Li().Body(
app.A().Href("https://github.com/Skarlso/crd-to-sample-yaml").Target("_blank").Body(
app.I().Class("fa fa-github fa-2x")),
&back{},
)),
))
}
Expand Down
16 changes: 8 additions & 8 deletions wasm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
<meta property="og:type" content="website">
<meta property="og:image" content="https://">
<title>Preview CRDs</title>
<link href="/app.css" type="text/css" rel="preload" as="style">
<link as="style" href="/web/css/alert.css" type="text/css" rel="preload">
<link type="text/css" rel="preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-twilight.min.css">
<link rel="preload" as="style" href="/app.css" type="text/css">
<link href="/web/css/alert.css" type="text/css" rel="preload" as="style">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-twilight.min.css" type="text/css" rel="preload" as="style">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/halfmoon.min.css" type="text/css" rel="preload" as="style">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" rel="preload" as="style">
<link rel="icon" href="https://raw.githubusercontent.com/maxence-charriere/go-app/master/docs/web/icon.svg">
<link rel="apple-touch-icon" href="/web/img/logo.png">
<link rel="preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link href="https://raw.githubusercontent.com/maxence-charriere/go-app/master/docs/web/icon.svg" rel="icon">
<link href="/web/img/logo.png" rel="apple-touch-icon">
<link rel="manifest" href="/manifest.webmanifest">
<link href="/app.css" type="text/css" rel="stylesheet">
<link href="/web/css/alert.css" type="text/css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-twilight.min.css" type="text/css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/halfmoon.min.css" type="text/css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script defer src="/wasm_exec.js"></script>
<script defer src="/app.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
Expand Down Expand Up @@ -60,7 +60,7 @@
</head>
<body>
<main></main>
<aside class="goapp-app-info" id="app-wasm-loader">
<aside id="app-wasm-loader" class="goapp-app-info">
<img id="app-wasm-loader-icon" class="goapp-logo goapp-spin" alt="wasm loader icon" src="/web/img/logo.png">
<p id="app-wasm-loader-label" class="goapp-label">0%</p>
</aside>
Expand Down
2 changes: 1 addition & 1 deletion wasm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func main() {
Name: "Preview CRDs",
Title: "Preview CRDs",
Author: "Gergely Brautigam",
Version: "v0.6.3",
Version: "v0.6.4",
HTML: func() app.HTMLHtml { return app.Html().DataSet("bs-core", "modern").DataSet("bs-theme", "dark") },
Styles: []string{
"web/css/alert.css",
Expand Down
12 changes: 6 additions & 6 deletions wasm/share.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
<meta charset="UTF-8">
<meta name="author" content="Gergely Brautigam">
<meta name="description" content>
<meta name="theme-color" content="#2d2c2c">
<meta content="#2d2c2c" name="theme-color">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, viewport-fit=cover">
<meta property="og:url" content="https:///share">
<meta property="og:title" content="Preview CRDs">
<meta content="Preview CRDs" property="og:title">
<meta property="og:description" content>
<meta property="og:type" content="website">
<meta property="og:image" content="https://">
<title>Preview CRDs</title>
<link as="style" href="/app.css" type="text/css" rel="preload">
<link href="/web/css/alert.css" type="text/css" rel="preload" as="style">
<link rel="preload" as="style" href="/web/css/alert.css" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-twilight.min.css" type="text/css" rel="preload" as="style">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/halfmoon.min.css" type="text/css" rel="preload" as="style">
<link type="text/css" rel="preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="icon" href="https://raw.githubusercontent.com/maxence-charriere/go-app/master/docs/web/icon.svg">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" rel="preload" as="style">
<link href="https://raw.githubusercontent.com/maxence-charriere/go-app/master/docs/web/icon.svg" rel="icon">
<link rel="apple-touch-icon" href="/web/img/logo.png">
<link rel="manifest" href="/manifest.webmanifest">
<link href="/app.css" type="text/css" rel="stylesheet">
<link href="/web/css/alert.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="/web/css/alert.css" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-twilight.min.css" type="text/css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/halfmoon.min.css" type="text/css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" rel="stylesheet">
Expand Down
Binary file modified wasm/web/app.wasm
Binary file not shown.

0 comments on commit 0171176

Please sign in to comment.