Documentation for a historical release of Infusion: 1.4
Please view the Infusion Documentation site for the latest documentation, or the Infusion 1.3. Documentation for the previous release.
If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

Cookie Settings Store


The Cookie Settings Store subcomponent is used by UI Enhancer to store/save user preferences into a browser cookie. The options described on this page can be configured through the options of the UI Enhancer component.

Do not use this component directly. The information on this page should be use when customizing UI Enhancer.

See Also
UI Enhancer
Temporary Settings Store

Supported Events

none

#Methods

#fetch(cookieName, defaults)
Retrieves the current settings from the cookie.
#save(settings, cookieOptions)
Saves the specified settings in the cookie.

#Options

#cookie
Information for the storage cookie.

Methods

back to top

fetch(cookieName, defaults)

Description

Retrieves the current settings stored in the cookie.

Parameters

cookieName (optional)
The name the cookie is stored under.
Default: "fluid-ui-settings"

defaults (optional)
The values to use if the cookie is not set.
Default:

{
    textFont: "default",
    theme: "default",
    textSize: 1,
    lineSpacing: 1,
    layout: false,
    toc: false,
    links: false,
    inputsLarger: false
}

Return value

A JavaScript object containing the currently stored settings. This object has the following format:

{
    textFont: <string>, // key from classname map
    theme: <string>, // key from classname map
    textSize: <number>, // in points
    lineSpacing: <number>, // in ems
    layout: <boolean>,
    toc: <boolean>,
    links: <boolean>,
    inputsLarger: <boolean>
}

Availability

Infusion 1.4 and later

See also

#save(settings, cookieOptions)

save(settings, cookieOptions)

Description

Stores the specified settings in the cookie.

Parameters

settings
A JavaScript object containing the settings to be stored.
Form:

{
    textFont: <string>, // key from classname map
    theme: <string>, // key from classname map
    textSize: <number>, // in points
    lineSpacing: <number>, // in ems
    layout: <boolean>,
    toc: <boolean>,
    links: <boolean>,
    inputsLarger: <boolean>
}


cookieOptions (optional)
Information for the storage cookie. The default is the current value of the #cookie option.

Availability

Infusion 1.4 and later

See also

#fetch(cookieName, defaults)

Options

back to top

Description

A JavaScript option containing information for configuring the storage cookie.

Default

{
    name: "fluid-ui-settings",
    path: "/",
    expires: ""
}

Example

cookie: {
    expires: "Mon, 31 Dec 2012 23:59:00 UTC"
}