Text Controls
The Text Controls subcomponent is used by UI Options to present controls that allow a user to configure how text should be presented on a page. The options described on this page can be configured through the options of the main UI Options components. Three version of UI Options are available:
Do not use this component directly. The information on this page should be use when customizing one of the three versions.
See Also
Layout Controls
Links Controls
Full Page UI Options
Full Page UI Options (with Preview)
Fat Panel UI Options
|
|
|
|
|
Supported Events
Listeners can be attached to any supported events through a component's listeners
option. Values can be a function reference (not a string function name) or an anonymous function definition, as illustrated below:
var myComponent = component.name("#myContainerID", { listeners: { eventName1: functionName, eventName2: function (params) { ... } } });
For information on the different types of events, see Infusion Event System.
onUIOptionsRefresh
Description |
This event fires any time the text settings are saved or reset, or when the user cancels their changes to the interface. |
---|---|
Type |
default |
Parameters |
none |
Availability |
Infusion 1.4 and later |
Options
Configurable subcomponents can be configured though the parent component's options by passing a JavaScript object containing options for the subcomponent:
parent.component.name(".myContainer", { <subcomponentName>: { options: { <subcomponent options> } } });
The options supported by the Text Controls subcomponent are described below.
controlValues
Description |
This options defines values for the two lists in this set of controls: |
---|---|
Default |
controlValues: { textFont: ["default", "times", "comic", "arial", "verdana"], theme: ["default", "bw", "wb", "by", "yb"] } |
Example |
controlValues: { textFont: ["default", "time", "comic", "arial", "verdana", "courier"] } |
Notes |
|
See also |
UI Enhancer |
lineSpacing
Description |
Minimum and maximum settings for the line spacing range |
---|---|
Default |
lineSpacing: { min: 1, max: 2 } |
Example |
lineSpacing: { max: 5 } |
selectors
Description |
... See below. |
---|
strings
Description |
Labels for the drop-down lists in this set of controls |
---|---|
Default |
strings: { textFont: ["Default", "Times New Roman", "Comic Sans", "Arial", "Verdana"], theme: ["Default", "Black on white", "White on black", "Black on yellow", "Yellow on black"] } |
Example |
strings: { theme: ["default", "black/white", "white/black", "black/yellow", "yellow/black"] } |
textSize
Description |
Minimum and maximum settings for the text size range |
---|---|
Default |
textSize: { min: 1, max: 2 } |
Example |
{ textSize: { min: 0.5, max: 3 } |
Selectors
One of the options that can be provided to the component is a set of CSS-based selectors identifying where in the DOM different elements can be found. The value for the option is itself a Javascript object containing name/value pairs:
selectors: { selector1Name: "selector 1 string", selector2Name: "selector 2 string", ... }
The component defines defaults for these selectors: If you use those defaults in your markup, you do not need to specify the selectors option. If you do choose to override any of the selectors, you can specify your custom selector using this option.
The selectors supported by the Text Controls subcomponent are described below.
lineSpacing
Description |
Container for the line spacing controls (by default, a text-field/slider control) |
---|---|
Default |
".flc-uiOptions-layout" |
Example |
selectors: { lineSpacing: "div.layout-controls-container" } |
textFont
Description |
Container for the font family controls (by default, a drop-down list) |
---|---|
Default |
".flc-uiOptions-line-text-font" |
Example |
selectors: { textFont: ".fontFamilyList" } |
textSize
Description |
Container for the font size controls (by default, a text-field/slider control) |
---|---|
Default |
".flc-uiOptions-line-min-text-size" |
Example |
selectors: { textSize: "#sizeInputs" } |
theme
Description |
Container for the colour contrast controls (by default, a drop-down list) |
---|---|
Default |
".flc-uiOptions-line-theme" |
Example |
selectors: { theme: "div.theme-list" } |