mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Add BundledAssetFileServer for bundled /wails/runtime.js. Update examples.
This commit is contained in:
@@ -46,7 +46,6 @@ func main() {
|
||||
generate.NewSubCommandFunction("constants", "Generate JS constants from Go", commands.GenerateConstants)
|
||||
generate.NewSubCommandFunction(".desktop", "Generate .desktop file", commands.GenerateDotDesktop)
|
||||
generate.NewSubCommandFunction("appimage", "Generate Linux AppImage", commands.GenerateAppImage)
|
||||
generate.NewSubCommandFunction("runtime", "Generate the latest compiled runtime", commands.GenerateRuntime)
|
||||
|
||||
plugin := app.NewSubCommand("plugin", "Plugin tools")
|
||||
//plugin.NewSubCommandFunction("list", "List plugins", commands.PluginList)
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<input autofocus autocomplete="off" class="input" id="name" type="text"/>
|
||||
<button class="btn" onclick="greet()">Greet</button>
|
||||
</div>
|
||||
<script src='runtime.js'></script>
|
||||
<script src='/wails/runtime.js'></script>
|
||||
<script src='bindings_main.js'></script>
|
||||
<script>
|
||||
let resultText = "";
|
||||
|
||||
@@ -17,7 +17,7 @@ func main() {
|
||||
&GreetService{},
|
||||
},
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
Handler: application.BundledAssetFileServer(assets),
|
||||
},
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<title>Title</title>
|
||||
<style>body{ text-align: center; color: white; background-color: #191919; }</style>
|
||||
<style>.region{ width: 100%; border: 3px solid #00a4db; }</style>
|
||||
<script src="/wails/runtime.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Context Menu Demo</h1>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -17,7 +17,7 @@ func main() {
|
||||
Name: "Context Menu Demo",
|
||||
Description: "A demo of the Context Menu API",
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
Handler: application.BundledAssetFileServer(assets),
|
||||
},
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||
|
||||
@@ -35,14 +35,6 @@ func main() {
|
||||
URL: "/",
|
||||
})
|
||||
|
||||
//app.On(events.Common.ThemeChanged, func(e *application.Event) {
|
||||
// if app.IsDarkMode() {
|
||||
// log.Println("Dark mode!")
|
||||
// } else {
|
||||
// log.Println("Light mode!")
|
||||
// }
|
||||
//})
|
||||
|
||||
err := app.Run()
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<style>body{ text-align: center; color: white; background-color: #191919; user-select: none; -ms-user-select: none; -webkit-user-select: none; }</style>
|
||||
<script src="/wails/runtime.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Drag-n-drop Demo</h1>
|
||||
|
||||
@@ -18,7 +18,7 @@ func main() {
|
||||
Name: "Drag-n-drop Demo",
|
||||
Description: "A demo of the Drag-n-drop API",
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
Handler: application.BundledAssetFileServer(assets),
|
||||
},
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<script src="runtime.js"></script>
|
||||
<script src="/wails/runtime.js"></script>
|
||||
<style>body{ text-align: center; color: white; background-color: #191919; user-select: none; -ms-user-select: none; -webkit-user-select: none; }</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -19,7 +19,7 @@ func main() {
|
||||
Name: "Events Demo",
|
||||
Description: "A demo of the Events API",
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
Handler: application.BundledAssetFileServer(assets),
|
||||
},
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
<script src="runtime.js"></script>
|
||||
<script src="/wails/runtime.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -17,7 +17,7 @@ func main() {
|
||||
Name: "Frameless Demo",
|
||||
Description: "A demo of frameless windows",
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
Handler: application.BundledAssetFileServer(assets),
|
||||
},
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||
|
||||
@@ -16,7 +16,6 @@ func main() {
|
||||
Description: "A test of Hidden window and display it",
|
||||
Assets: application.AlphaAssets,
|
||||
Mac: application.MacOptions{
|
||||
// ActivationPolicy: application.ActivationPolicyAccessory,
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: false,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
text-align: -webkit-center;
|
||||
}
|
||||
</style>
|
||||
<script src="runtime.js"></script>
|
||||
<script src="/wails/runtime.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -26,7 +26,7 @@ func main() {
|
||||
WebviewBrowserPath: "",
|
||||
},
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
Handler: application.BundledAssetFileServer(assets),
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
font-size: large;
|
||||
}
|
||||
</style>
|
||||
<script src="runtime.js"></script>
|
||||
<script src="/wails/runtime.js"></script>
|
||||
</head>
|
||||
<body style="--webkit-app-region: drag;">
|
||||
<img class="logo"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user