Documentation
¶
Overview ¶
Package assets contains the embedded client assets and helpers used by JaWS setup code.
The embedded JavaScript applies server-sent DOM updates and intentionally trusts the server to distinguish trusted HTML from escaped user text. Applications should route untrusted text through escaping helpers before it reaches template.HTML or raw string HTML paths.
Index ¶
Constants ¶
const ISO8601 = "2006-01-02"
ISO8601 is the date format used by date input widgets (YYYY-MM-DD).
Variables ¶
var DefaultCookieName string
DefaultCookieName holds the default JaWS cookie name. It will be generated from the executable name, or "jaws" if that fails.
var JavascriptText []byte
JavascriptText is the source code for the client-side JaWS JavaScript library.
var JawsCSS []byte
JawsCSS is the source code for the client-side JaWS stylesheet.
Functions ¶
func JawsKeyAppend ¶
JawsKeyAppend appends the JaWS key as a base-32 string to the buffer.
A zero key appends nothing. The encoding pairs with JawsKeyValue.
func JawsKeyString ¶
JawsKeyString returns the string to be used for the given JaWS key.
func JawsKeyValue ¶
JawsKeyValue parses a base-32 key string, as returned by JawsKeyString, into a uint64. Any trailing "/..." path suffix is ignored. Returns 0 if the key cannot be parsed.
func MakeCookieName ¶
MakeCookieName creates a cookie-safe name from an executable path.
func PreloadHTML ¶
PreloadHTML returns HTML code to load the given resources efficiently.
JavaScript and CSS files are emitted as script and stylesheet tags. Other recognized resources are emitted as preload tags. Favicon image URLs are returned separately.
Types ¶
This section is empty.