Parcourir la source

Made things a bit cleaner

master
Ludovic 'Archivist' Lagouardette il y a 2 ans
Parent
révision
9ce58d42ae
2 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. +4
    -2
      scripts/my_func.lua
  2. +1
    -1
      src/app/button.ecr

+ 4
- 2
scripts/my_func.lua Voir le fichier

@ -2,12 +2,14 @@ function run_event(name)
print("run " .. name)
if(name == "archivist") then
Business.fetch_add(10)
else
elseif(name == "reset") then
Business.fetch_add(-Business.fetch_add(0))
else
Business.fetch_add(1)
end
end
function display_event(name)
print("display " .. name)
return Business.fetch_add(0)
return tostring(Business.fetch_add(0))
end

+ 1
- 1
src/app/button.ecr Voir le fichier

@ -2,7 +2,7 @@
<html>
<head></head>
<body>
<div> <%= display_event.as(Lua::Function).call(name).as(Float64).to_i32!; %> </div>
<div> <%= display_event.as(Lua::Function).call(name).as(String); %> </div>
<form method="POST" action=<%= "/"+name %>>
<input type="submit" value="Go">
</form>

Chargement…
Annuler
Enregistrer