File tree Expand file tree Collapse file tree 10 files changed +14
-14
lines changed
custom_spa_server_on_free_port Expand file tree Collapse file tree 10 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ pub fn main() !void {
77 // Create a window
88 var nwin = webui .newWindow ();
99
10- // Bind HTML elements with C functions
10+ // Bind HTML elements with Zig functions
1111 _ = try nwin .bind ("my_function_count" , my_function_count );
1212 _ = try nwin .bind ("my_function_exit" , my_function_exit );
1313
Original file line number Diff line number Diff line change 4242 < body >
4343 < h1 > WebUI - Call Zig from JavaScript</ h1 >
4444 < p >
45- Call C functions with arguments (< em > See the logs in your terminal</ em > )
45+ Call Zig functions with arguments (< em > See the logs in your terminal</ em > )
4646 </ p >
4747 < button onclick ="my_function_string('Hello', 'World'); ">
4848 Call my_function_string()
@@ -61,7 +61,7 @@ <h1>WebUI - Call Zig from JavaScript</h1>
6161 Call my_function_raw_binary()
6262 </ button >
6363 < br />
64- < p > Call a C function that returns a response</ p >
64+ < p > Call a Zig function that returns a response</ p >
6565 < button onclick ="MyJS(); "> Call my_function_with_response()</ button >
6666 < div > Double: < input type ="text " id ="MyInputID " value ="2 " /> </ div >
6767 < script >
Original file line number Diff line number Diff line change 33 < head >
44 < meta charset ="UTF-8 " />
55 < meta http-equiv ="cache-control " content ="no-cache " />
6- < title > WebUI - Custom Web-Server Free Port Example (C) </ title >
6+ < title > WebUI - Custom Web-Server Free Port Example</ title >
77 <!-- Connect this window to the back-end app -->
88 < script src ="http://localhost:[WEBUI_PORT]/webui.js "> </ script >
99 < script src ="pages.js "> </ script >
@@ -34,7 +34,7 @@ <h1>This is the First (Home) Page</h1>
3434 </ div >
3535 < hr />
3636 < footer style ="margin-top: 50px; ">
37- < h3 > Example: Web-Server that finds available free port (C) </ h3 >
37+ < h3 > Example: Web-Server that finds available free port</ h3 >
3838 < p >
3939 Similar to the Custom Web-Server example, this HTML page is handled by a custom Web-Server other than WebUI.< br />
4040 This window is connected to the back-end because we used: < pre > http://localhost:[WEBUI_PORT]/webui.js</ pre >
Original file line number Diff line number Diff line change 22< html >
33 < head >
44 < meta charset ="UTF-8 " />
5- < title > WebUI - Custom Web-Server Example (C) </ title >
5+ < title > WebUI - Custom Web-Server Example</ title >
66 <!-- Connect this window to the back-end app -->
77 < script src ="http://localhost:8081/webui.js "> </ script >
88 </ head >
99 < body >
10- < h3 > Custom Web-Server Example (C) </ h3 >
10+ < h3 > Custom Web-Server Example</ h3 >
1111 < p >
1212 This HTML page is handled by a custom Web-Server other than WebUI.< br />
1313 This window is connected to the back-end because we used: < pre > http://localhost:8081/webui.js</ pre >
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ pub fn main() !void {
99 // Bind all events
1010 _ = try nwin .bind ("" , events );
1111
12- // Bind HTML elements with C functions
12+ // Bind HTML elements with Zig functions
1313 _ = try nwin .bind ("my_backend_func" , my_backend_func );
1414
1515 // Set the web-server/WebSocket port that WebUI should
Original file line number Diff line number Diff line change 22< html >
33 < head >
44 < meta charset ="UTF-8 " />
5- < title > WebUI - Custom Web-Server second page (C) </ title >
5+ < title > WebUI - Custom Web-Server second page</ title >
66 <!-- Connect this window to the back-end app -->
77 < script src ="http://localhost:8081/webui.js "> </ script >
88 </ head >
Original file line number Diff line number Diff line change 22< html >
33 < head >
44 < meta charset ="UTF-8 " />
5- < title > WebUI - Serve a Folder Example (C) </ title >
5+ < title > WebUI - Serve a Folder Example</ title >
66 < style >
77 body {
88 font-family : 'Arial' , sans-serif;
5151 </ style >
5252 </ head >
5353 < body >
54- < h3 id ="title "> Serve a Folder Example (C) </ h3 >
54+ < h3 id ="title "> Serve a Folder Example</ h3 >
5555 < br />
5656 < p id ="description ">
5757 You can edit this HTML file as you need.< br />
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ pub fn main() !void {
1212 MyWindow = try webui .newWindowWithId (1 );
1313 MySecondWindow = try webui .newWindowWithId (2 );
1414
15- // Bind HTML element IDs with a C functions
15+ // Bind HTML element IDs with a Zig functions
1616 _ = try MyWindow .bind ("SwitchToSecondPage" , switch_second_window );
1717 _ = try MyWindow .bind ("OpenNewWindow" , show_second_window );
1818 _ = try MyWindow .bind ("Exit" , exit_app );
Original file line number Diff line number Diff line change 22< html >
33 < head >
44 < meta charset ="UTF-8 " />
5- < title > WebUI - Second Page (C) </ title >
5+ < title > WebUI - Second Page</ title >
66 < style >
77 body {
88 font-family : 'Arial' , sans-serif;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ pub fn main() !void {
1616 // Set the root folder for the UI
1717 try mainW .setRootFolder ("ui" );
1818
19- // Bind HTML elements with the specified ID to C functions
19+ // Bind HTML elements with the specified ID to Zig functions
2020 _ = try mainW .bind ("close_app" , close );
2121
2222 // Show the window, this will select the best browser to show
You can’t perform that action at this time.
0 commit comments