toolips session extension
The ToolipsSession extension is loaded into apps by default whenever the new_webapp() method is used to create their files, along with the Files extension from the Toolips core (?(Files)).
ToolipsSession.ToolipsSession
— ModuleCreated in June, 2022 by chifi - an open source software dynasty. by team toolips This software is MIT-licensed.
ToolipsSession
Extension for:
- Toolips This module provides the capability to make web-pages interactive by simply
adding the Session extension to your ServerTemplate before starting. There are also methods contained for modifying Servables.
Module Composition
ToolipsSession.ComponentModifier
— TypeName
- text::String Description
example
field info
constructors
ToolipsSession.Session
— TypeSession
- type::Vector{Symbol}
- f::Function
- active_routes::Vector{String}
- events::Dict{String, Pair{String, Function}}
- iptable::Dict{String, Dates.DateTime}
- timeout::Integer Provides session capabilities and full-stack interactivity to a toolips server.
example
exts = [Session()]
st = ServerTemplate(extensions = exts)
server = st.start()
route!(server, "/") do c::Connection
myp = p("myp", text = "welcome to my site")
on(c, myp, "click") do cm::ComponentModifier
if cm[myp][:text] == "welcome to my site"
set_text!(cm, myp, "unwelcome to my site")
else
set_text!(cm, myp, "welcome to my site")
end
end
write!(c, myp)
end
field info
constructors
ToolipsSession.TimedTrigger
— TypeToolips.kill!
— MethodToolips.style!
— MethodToolips.style!
— MethodToolipsSession.document_linker
— Methoddocument_linker(c::Connection) -> _
ToolipsSession.gen_ref
— MethodSession
gen_ref() -> ::String
Creates a random string of 16 characters. This is used to map connections to specific events by the session.
example
gen_ref()
"jfuR2wgprielweh3"
ToolipsSession.get_text
— MethodToolipsSession.modify!
— MethodToolipsSession.modify!
— MethodToolipsSession.modify!
— MethodToolipsSession.observe!
— MethodToolipsSession.on
— MethodToolipsSession.remove!
— Method