forked from Jonathan/Peradventure
		
	learned hx-trigger
This commit is contained in:
		
							
								
								
									
										16
									
								
								app.lua
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								app.lua
									
									
									
									
									
								
							| @ -4,9 +4,13 @@ local say = require('lua_scripts/main') | |||||||
|  |  | ||||||
| app:enable("etlua") | app:enable("etlua") | ||||||
|  |  | ||||||
|  | app:post("/clickme", function(self) | ||||||
|  | 	self.plane = "P-38L" | ||||||
|  | 	return self.plane | ||||||
|  | end) | ||||||
|  |  | ||||||
| app:get("/", function(self) | app:get("/", function(self) | ||||||
|     self.text = say.hello() |     self.text = say.hello() | ||||||
|     self.plane = { "P-38L" } |  | ||||||
|   return {render = "index"} |   return {render = "index"} | ||||||
| end) | end) | ||||||
|  |  | ||||||
| @ -21,6 +25,16 @@ return app | |||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
							
								
								
									
										0
									
								
								htmx.min.js → static/htmx.min.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										0
									
								
								htmx.min.js → static/htmx.min.js
									
									
									
									
										vendored
									
									
								
							| @ -1,5 +1,5 @@ | |||||||
| <!-- views/index.etlua --> | <!-- views/index.etlua --> | ||||||
| <script src="/path/to/htmx.min.js"></script> | <script src="/static/htmx.min.js"></script> | ||||||
|  |  | ||||||
| <h1>Hello world</h1> | <h1>Hello world</h1> | ||||||
| <p>Welcome to my page</p> | <p>Welcome to my page</p> | ||||||
| @ -18,7 +18,8 @@ | |||||||
| </form> | </form> | ||||||
| <br> | <br> | ||||||
|  |  | ||||||
| <button>Click me</button> | <button hx-post="/clickme" hx-target="#clickable">Click me</button> | ||||||
|  | <p id="clickable"></p> | ||||||
|  |  | ||||||
| <ol> | <ol> | ||||||
| <p><% for i, thing in pairs(text) do %> | <p><% for i, thing in pairs(text) do %> | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user