Skip to content

Commit a03b3cb

Browse files
committed
Update to v2.4.0 (Beta)
1 parent f4e79dc commit a03b3cb

File tree

11 files changed

+122
-44
lines changed

11 files changed

+122
-44
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WebUI Go v2.3.0
1+
# WebUI Go v2.4.0
22

33
[![Website](https://img.shields.io/circleci/project/github/badges/shields/master?style=for-the-badge)](https://github.com/webui-dev/go-webui) [![Website](https://img.shields.io/github/issues/webui-dev/go-webui.svg?branch=master&style=for-the-badge&url=https://google.com)](https://github.com/webui-dev/go-webui/issues) [![Website](https://img.shields.io/website?label=webui.me&style=for-the-badge&url=https://google.com)](https://webui.me/)
44

examples/hello_world.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const login_html string = `<!DOCTYPE html>
1010
<html>
1111
<head>
1212
<title>WebUI 2 - Go Example</title>
13+
<script src="/webui.js"></script>
1314
<style>
1415
body {
1516
color: white;
@@ -37,6 +38,7 @@ const dashboard_html string = `<!DOCTYPE html>
3738
<html>
3839
<head>
3940
<title>Dashboard</title>
41+
<script src="/webui.js"></script>
4042
<style>
4143
body {
4244
color: white;
@@ -55,7 +57,7 @@ const dashboard_html string = `<!DOCTYPE html>
5557
Call Secret() function and get the response
5658
<br>
5759
<br>
58-
<button OnClick="webui_fn('Sec').then((response) => { alert('Response is ' + response) });">Secret</button>
60+
<button OnClick="webui.call('Sec').then((response) => { alert('Response is ' + response) });">Secret</button>
5961
<br>
6062
<br>
6163
<button id="Exit">Exit</button>

examples/text-editor/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.20
44

55
require (
66
github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf
7-
github.com/webui-dev/go-webui/v2 v2.3.0
7+
github.com/webui-dev/go-webui/v2 v2.4.0
88
)
99

1010
require github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf // indirect

examples/text-editor/ui/MainWindow.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<link rel="stylesheet" href="css/codemirror.min.css">
1010
<link rel="stylesheet" href="css/all.min.css">
1111

12+
<!-- WebUI Bridge (Virtual File) -->
13+
<script src="/webui.js"></script>
14+
1215
<script src="js/codemirror.min.js"></script>
1316
<script src="js/xml.min.js"></script>
1417
<script src="js/css.min.js"></script>

examples/text-editor/ui/js/ui.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function SetFileModeExtension(extension) {
5656
// Add a line to the editor
5757
function addLine(text) {
5858
const lastLine = codeMirrorInstance.lineCount();
59-
codeMirrorInstance.replaceRange(webui_decode(text) + "\n", {line: lastLine});
59+
codeMirrorInstance.replaceRange(webui.decode(text) + "\n", {line: lastLine});
6060

6161
const element = document.getElementById('SaveLi');
6262
element.style.color = '#ddecf9';
@@ -65,7 +65,7 @@ function addLine(text) {
6565

6666
// Add full text to the editor
6767
function addText(text) {
68-
codeMirrorInstance.setValue(webui_decode(text));
68+
codeMirrorInstance.setValue(webui.decode(text));
6969

7070
const element = document.getElementById('SaveLi');
7171
element.style.color = '#ddecf9';
@@ -75,7 +75,7 @@ function addText(text) {
7575
// Save the file
7676
function SaveFile() {
7777
const content = codeMirrorInstance.getValue();
78-
webui_fn('Save', content);
78+
webui.call('Save', content);
7979
}
8080

8181
window.addEventListener("DOMContentLoaded", (event) => {
@@ -99,7 +99,7 @@ function changeWindowTitle(newTitle) {
9999

100100
// Set file title and language
101101
function SetFile(path_base64) {
102-
const path = webui_decode(path_base64);
102+
const path = webui.decode(path_base64);
103103
const Extension = getFileExtension(path);
104104
const FileName = getFileName(path);
105105
console.log('Extension: ' + path);

v2/libwebui-2-static-x64-windows.a

-186 KB
Binary file not shown.
251 KB
Binary file not shown.
194 KB
Binary file not shown.
199 KB
Binary file not shown.

v2/webui.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package webui
22

33
/*
4-
WebUI Library 2.3.0
5-
http://_webui_core.me
6-
https://github.com/webui-dev/go-webui
4+
WebUI Library 2.4.0
5+
http://webui.me
6+
https://github.com/webui-dev/webui
77
Copyright (c) 2020-2023 Hassan Draga.
88
Licensed under MIT License.
99
All rights reserved.
@@ -12,9 +12,9 @@ package webui
1212

1313
/*
1414
#cgo CFLAGS: -I ./
15-
#cgo windows LDFLAGS: -L ./ -lwebui-2-static-x64-windows -lws2_32
16-
#cgo darwin LDFLAGS: -L ./ -lwebui-2-static-x64-macos -lpthread -lm
17-
#cgo linux LDFLAGS: -L ./ -lwebui-2-static-x64-linux -lpthread -lm
15+
#cgo windows LDFLAGS: -L ./webui-windows-gcc-x64 -lwebui-2-static -lws2_32
16+
#cgo darwin LDFLAGS: -L ./webui-macos-clang-x64 -lwebui-2-static -lpthread -lm
17+
#cgo linux LDFLAGS: -L ./webui-linux-gcc-x64 -lwebui-2-static -lpthread -lm
1818
#include <webui.h>
1919
extern void goWebuiEvent(size_t _window, size_t _event_type, char* _element, char* _data, size_t _event_number);
2020
static void GoWebuiEvents_handler(webui_event_t* e) {

0 commit comments

Comments
 (0)