Skip to content

Commit

Permalink
Update to WebUI 2.5.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadordf committed Jun 23, 2024
1 parent b201c2d commit dfb2b19
Show file tree
Hide file tree
Showing 103 changed files with 14,180 additions and 1,158 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ However, you can also decide to have a visible Delphi or Lazarus application com

WebUI4Delphi can be used in Delphi or Lazarus applications for Windows, Linux and MacOS.

WebUI4Delphi was developed and tested on Delphi 12.1 and Lazarus 3.2/FPC 3.2.2 but it also supports Delphi XE2.
WebUI4Delphi was developed and tested on Delphi 12.1 and Lazarus 3.4/FPC 3.2.2 but it also supports Delphi XE2.

WebUI4Delphi includes VCL, FireMonkey (FMX), LCL and console examples.

Expand Down
83 changes: 65 additions & 18 deletions assets/serve_a_folder/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,9 @@ <h4><a href="test.txt">Static file example (Embedded)</a></h4>
<h4><a href="dynamic.html">Dynamic file example (Embedded)</a></h4>
<p>
Unicode Test:<br /><br />
مرحبًا<br />
<!-- Arabic -->
你好<br />
<!-- Chinese -->
こんにちは
<!-- Japanese -->
مرحبًا<br /> <!-- Arabic -->
你好<br /> <!-- Chinese -->
こんにちは <!-- Japanese -->
</p>
</body>

Expand All @@ -94,8 +91,8 @@ <h4><a href="dynamic.html">Dynamic file example (Embedded)</a></h4>
<script>
function call_deno_file() {
// Because `main.c` set Deno as the `.ts` and `.js` interpreter
// then a simple HTTP request to `/deno_test.ts` will be parsed
// of course Deno should be installed.
// then a simple HTTP request to `/deno_test.ts` will be bassed
// to Deno.

// Simple HTTP Request
var xmlHttp = new XMLHttpRequest();
Expand All @@ -104,18 +101,68 @@ <h4><a href="dynamic.html">Dynamic file example (Embedded)</a></h4>
alert(xmlHttp.responseText);
}

// JavaScript Example
/*
document.addEventListener('DOMContentLoaded', function() {
// DOM is loaded, and `webui` object should be available.
webui.setEventCallback((e) => {
if (e == webui.event.CONNECTED) {
// Connection to the backend is established
console.log('Connected.');
} else if (e == webui.event.DISCONNECTED) {
// Connection to the backend is lost
console.log('Disconnected.');
}
});
// DOM is loaded. Check if `webui` object is available
if (typeof webui !== 'undefined') {
// Set events callback
webui.setEventCallback((e) => {
if (e == webui.event.CONNECTED) {
// Connection to the backend is established
console.log('Connected.');
webuiTest();
} else if (e == webui.event.DISCONNECTED) {
// Connection to the backend is lost
console.log('Disconnected.');
}
});
} else {
// The virtual file `webui.js` is not included
alert('Please add webui.js to your HTML.');
}
});
function webuiTest() {
// Call a backend function
if (webui.isConnected()) {
// When you bind a func in the backend
// webui will create the `func` object
// in three places:
//
// Global : func(...)
// Property : webui.func(...)
// Method : webui.call('func', ...)
//
// [!] Note: Objects creation fails when
// a similar object already exist.
const foo = 'Hello';
const bar = 123456;
// Calling as global object
myBackendFunction(foo, bar).then((response) => {
// Do something with `response`
});
// Calling as property of `webui.` object
webui.myBackendFunction(foo, bar).then((response) => {
// Do something with `response`
});
// Calling using the method `webui.call()`
webui.call('myBackendFunction', foo, bar).then((response) => {
// Do something with `response`
});
// Using await
// const response = await myBackendFunction(foo, bar);
// const response = await webui.myBackendFunction(foo, bar);
// const response = await webui.call('myBackendFunction', foo, bar);
}
}
*/

</script>
</html>
2 changes: 1 addition & 1 deletion assets/text_editor/css/all.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions assets/text_editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<nav>
<button id="open-btn" title="Open file" type="button"><i class="fas fa-folder-open"></i></button>
<button id="save-btn" title="Save file" type="button" disabled><i class="fa fa-floppy-disk"></i></button>
<button id="__close-btn" title="Close file" type="button"><i class="fas fa-circle-xmark"></i></button>
<button id="close_app" title="Close file" type="button"><i class="fas fa-circle-xmark"></i></button>
<button id="about-btn" title="About Info" type="button"><i class="fas fa-question-circle"></i></button>
</nav>
<div class="main" id="main">
Expand All @@ -27,7 +27,7 @@
<h1>WebUI Text Editor</h1>
v1.1
<p>Example of a text editor software in C using WebUI library.</p>
<p><a href="https://webui.me" target="_blank">webui.me</a> | (C)2023 Hassan Draga</p>
<p><a href="https://webui.me" target="_blank">webui.me</a> | (C)2024 Hassan Draga</p>
</div>
</div>
<script src="js/codemirror.min.js"></script>
Expand Down
Binary file added bin32/arm/webui-2.so
Binary file not shown.
Binary file added bin32/arm/webui-2_debug.so
Binary file not shown.
Binary file modified bin32/webui-2.dll
Binary file not shown.
Binary file modified bin32/webui-2_debug.dll
Binary file not shown.
Binary file modified bin64/arm64/webui-2.so
Binary file not shown.
Binary file modified bin64/arm64/webui-2_debug.so
Binary file not shown.
Binary file modified bin64/webui-2.dll
Binary file not shown.
Binary file modified bin64/webui-2.dylib
Binary file not shown.
Binary file modified bin64/webui-2.so
Binary file not shown.
Binary file modified bin64/webui-2_debug.dll
Binary file not shown.
Binary file modified bin64/webui-2_debug.dylib
Binary file not shown.
Binary file modified bin64/webui-2_debug.so
Binary file not shown.
Loading

0 comments on commit dfb2b19

Please sign in to comment.