Documentation
¶
Index ¶
- func HxHideIndicatorCSS() string
- func HxPrompt(r *http.Request) string
- func HxTarget(r *http.Request) string
- func HxTriggerName(r *http.Request) string
- func IsHtmx(r *http.Request) bool
- func IsHxBoosted(r *http.Request) bool
- func IsHxHistoryRestoreRequest(r *http.Request) bool
- func IsHxRequest(r *http.Request) bool
- func IsHxTrigger(r *http.Request) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HxHideIndicatorCSS ¶
func HxHideIndicatorCSS() string
HxHideIndicatorCSS returns the CSS for hiding the HTMX indicator.
Returns the CSS code for hiding the HTMX indicator.
Returns:
- string: the CSS code
func HxPrompt ¶
HxPrompt gets the prompt message for the user.
Returns the value of the "HX-Prompt" header, or an empty string if the header is not present.
Parameters:
- r: the http request
Returns:
- string: the prompt message
func HxTarget ¶
HxTarget gets the target element for the response.
Returns the value of the "HX-Target" header, or an empty string if the header is not present.
Parameters:
- r: the http request
Returns:
- string: the target element
func HxTriggerName ¶
HxTriggerName gets the name of the event or trigger that initiated the request.
Returns the value of the "HX-Trigger-Name" header, or an empty string if the header is not present.
Parameters:
- r: the http request
Returns:
- string: the trigger name
func IsHtmx ¶
IsHtmx checks if the given HTTP request is an HTMX request.
An HTMX request is determined by the presence of the "HX-Request" header.
Parameters:
- r: the http request
Returns:
- bool: true if it's an HTMX request, false otherwise
func IsHxBoosted ¶
IsHxBoosted checks if the request has been boosted for performance.
Returns true if the "HX-Boosted" header is present and its value is "true", otherwise returns false.
Parameters:
- r: the http request
Returns:
- bool: true if the request has been boosted, false otherwise
func IsHxHistoryRestoreRequest ¶
IsHxHistoryRestoreRequest checks if the request is related to restoring the browser's history.
Returns true if the "HX-History-Restore-Request" header is present and its value is "true", otherwise returns false.
Parameters:
- r: the http request
Returns:
- bool: true if the request is a history restore request, false otherwise
func IsHxRequest ¶
IsHxRequest checks if this is an HTMX request.
Returns true if the "HX-Request" header is present and its value is "true", otherwise returns false.
Parameters:
- r: the http request
Returns:
- bool: true if it's an HTMX request, false otherwise
func IsHxTrigger ¶
IsHxTrigger checks if the request was triggered by an event.
Returns true if the "HX-Trigger" header is present and its value is "true", otherwise returns false.
Parameters:
- r: the http request
Returns:
- bool: true if the request was triggered, false otherwise
Types ¶
This section is empty.