htmx

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoosted

func GetBoosted(r *http.Request) bool

GetBoosted indicates that the request is via an element using hx-boost.

func GetCurrentURL

func GetCurrentURL(r *http.Request) string

GetCurrentURL is the current URL of the browser.

func GetHistoryRestoreRequest

func GetHistoryRestoreRequest(r *http.Request) bool

GetHistoryRestoreRequest returns true if the request is for history restoration after a miss in the local history cache.

func GetPrompt

func GetPrompt(r *http.Request) string

GetPrompt is the user response to an hx-prompt.

func GetRequest

func GetRequest(r *http.Request) bool

GetRequest indicates that it is a HTMX request.

func GetTarget

func GetTarget(r *http.Request) string

GetTarget is the id of the target element if it exists.

func GetTrigger

func GetTrigger(r *http.Request) string

GetTrigger is the id of the triggered element if it exists.

func GetTriggerName

func GetTriggerName(r *http.Request) string

GetTriggerName is the name of the triggered element if it exists.

func Join

func Join(s ...string) string

func SetLocation

func SetLocation(w http.ResponseWriter, url string)

SetLocation allows you to do a client-side redirect that does not do a full page reload.

func SetPushURL

func SetPushURL(w http.ResponseWriter)

SetPushURL pushes a new url into the history stack.

func SetRedirect

func SetRedirect(w http.ResponseWriter, url string)

SetRedirect used to do a client-side redirect to a new location.

func SetRefresh

func SetRefresh(w http.ResponseWriter)

SetRefresh will do a client-side full refresh of the page.

func SetReplaceURL

func SetReplaceURL(w http.ResponseWriter, url string)

SetReplaceURL replaces the current URL in the location bar.

func SetReselect

func SetReselect(w http.ResponseWriter)

SetReselect is a CSS selector that allows you to choose which part of the response is used to be swapped in.

func SetReswap

func SetReswap(w http.ResponseWriter)

SetReswap allows you to specify how the response will be swapped.

func SetRetarget

func SetRetarget(w http.ResponseWriter, target string)

SetRetarget is a CSS selector that updates the target of the content update to a different element on the page.

func SetTrigger

func SetTrigger(w http.ResponseWriter, event string)

SetTrigger events as soon as the response is received.

func SetTriggerAfterSettle

func SetTriggerAfterSettle(w http.ResponseWriter, event string)

SetTriggerAfterSettle events after the settling step.

func SetTriggerAfterSwap

func SetTriggerAfterSwap(w http.ResponseWriter, event string)

SetTriggerAfterSwap events after the swap step.

Types

type Event

type Event string

func (Event) FromBody

func (e Event) FromBody() string

FromBody is used on the client side in the hx-trigger HTML attribute.

func (Event) SetTrigger

func (e Event) SetTrigger(w http.ResponseWriter)

SetTrigger events as soon as the response is received.

func (Event) SetTriggerAfterSettle

func (e Event) SetTriggerAfterSettle(w http.ResponseWriter)

SetTriggerAfterSettle events after the settling step.

func (Event) SetTriggerAfterSwap

func (e Event) SetTriggerAfterSwap(w http.ResponseWriter)

SetTriggerAfterSwap events after the swap step.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL