goog.ui.emoji.ProgressiveEmojiPaletteRenderer
Classgoog.ui.emoji.ProgressiveEmojiPaletteRenderer
> goog.ui.emoji.EmojiPaletteRenderer
> goog.ui.PaletteRenderer
> goog.ui.ControlRenderer
goog.ui.emoji.ProgressiveEmojiPaletteRenderer(defaultImgUrl)
Progressively renders an emoji palette. The progressive renderer tries to use img tags instead of background-image for sprited emoji, since most browsers render img tags progressively (i.e., as the data comes in), while only very new browsers render background-image progressively.
defaultImgUrl
{string
}
.buildElementFromSpriteMetadata(dom, spriteInfo, displayUrl)
Inherited from goog.ui.emoji.EmojiPaletteRenderer
.
Builds the inner contents of a palette item out of sprite metadata.
dom
{goog.dom.DomHelper
}
spriteInfo
{goog.ui.emoji.SpriteInfo
}
displayUrl
{string
}
HTMLDivElement
}
.canDecorate(element)
Inherited from goog.ui.PaletteRenderer
.
Overrides {@link goog.ui.ControlRenderer#canDecorate} to always return false.
element
{Element
}
boolean
}
.createCell(node, dom)
Inherited from goog.ui.emoji.EmojiPaletteRenderer
.
Returns a table cell element (or equivalent) that wraps the given palette item (which must be a DOM node).
node
{Node
|string
}
dom
{goog.dom.DomHelper
}
Element
}
.createDom(palette)
Inherited from goog.ui.PaletteRenderer
.
Returns the palette items arranged in a table wrapped in a DIV, with the renderer's own CSS class and additional state-specific classes applied to it.
palette
{goog.ui.Control
}
Element
}
.createGrid(items, size, dom)
Inherited from goog.ui.PaletteRenderer
.
Returns the given items in a table with {@code size.width} columns and {@code size.height} rows. If the table is too big, empty cells will be created as needed. If the table is too small, the items that don't fit will not be rendered.
items
{Array
.<Node
>}
size
{goog.math.Size
}
dom
{goog.dom.DomHelper
}
Element
}
.createPaletteItem(dom, id, spriteInfo, displayUrl)
Inherited from goog.ui.emoji.EmojiPaletteRenderer
.
Creates a palette item from the given emoji data.
dom
{goog.dom.DomHelper
}
id
{string
}
spriteInfo
{goog.ui.emoji.SpriteInfo
}
displayUrl
{string
}
HTMLDivElement
}
.createRow(cells, dom)
Inherited from goog.ui.PaletteRenderer
.
Returns a table row element (or equivalent) that wraps the given cells.
cells
{Array
.<Element
>}
dom
{goog.dom.DomHelper
}
Element
}
.createTable(rows, dom)
Inherited from goog.ui.PaletteRenderer
.
Returns a table element (or equivalent) that wraps the given rows.
rows
{Array
.<Element
>}
dom
{goog.dom.DomHelper
}
Element
}
.decorate(palette, element)
Inherited from goog.ui.PaletteRenderer
.
Overrides {@link goog.ui.ControlRenderer#decorate} to be a no-op, since palettes don't support the decorate flow (for now).
palette
{goog.ui.Control
}
element
{Element
}
null
}
.enableClassName(control, className, enable)
Inherited from goog.ui.ControlRenderer
.
Updates the control's DOM by adding or removing the specified class name to/from its root element. May add additional combined classes as needed in IE6 and lower. Because of this, subclasses should use this method when modifying class names on the control's root element.
control
{goog.ui.Control
|Element
}
className
{string
}
enable
{boolean
}
.enableExtraClassName(control, className, enable)
Inherited from goog.ui.ControlRenderer
.
Updates the control's DOM by adding or removing the specified extra class name to/from its element.
control
{goog.ui.Control
}
className
{string
}
enable
{boolean
}
.getAriaRole()
Inherited from goog.ui.ControlRenderer
.
Returns the ARIA role to be applied to the control. See http://wiki/Main/ARIA for more info.
goog.dom.a11y.Role
|undefined
}
.getClassForState(state)
[protected]Inherited from goog.ui.ControlRenderer
.
Takes a single {@link goog.ui.Component.State}, and returns the corresponding CSS class name (null if none).
state
{goog.ui.Component.State
}
string
|undefined
}
.getClassNames(control)
[protected]Inherited from goog.ui.ControlRenderer
.
Returns all CSS class names applicable to the given control, based on its state. The return value is an array of strings containing
control
{goog.ui.Control
}
Array
.<string
>}
.getClassNamesForState(state)
[protected]Inherited from goog.ui.ControlRenderer
.
Takes a bit mask of {@link goog.ui.Component.State}s, and returns an array of the appropriate class names representing the given state, suitable to be applied to the root element of a component rendered using this renderer, or null if no state-specific classes need to be applied. This default implementation uses the renderer's {@link getClassForState} method to generate each state-specific class.
state
{number
}
Array
.<string
>}
.getContainingItem(palette, node)
Inherited from goog.ui.emoji.EmojiPaletteRenderer
.
Returns the item corresponding to the given node, or null if the node is neither a palette cell nor part of a palette item.
palette
{goog.ui.Palette
}
node
{Node
}
Node
}
.getContentElement(element)
Inherited from goog.ui.ControlRenderer
.
Takes the control's root element and returns the parent element of the control's contents. Since by default controls are rendered as a single DIV, the default implementation returns the element itself. Subclasses with more complex DOM structures must override this method as needed.
element
{Element
}
Element
}
.getCssClass()
Inherited from goog.ui.PaletteRenderer
.
Returns the CSS class to be applied to the root element of components rendered using this renderer.
string
}
.getIe6ClassCombinations()
Inherited from goog.ui.ControlRenderer
.
Returns an array of combinations of classes to apply combined class names for in IE6 and below. See {@link IE6_CLASS_COMBINATIONS} for more detail. This method doesn't reference {@link IE6_CLASS_COMBINATIONS} so that it can be compiled out, but subclasses should return their IE6_CLASS_COMBINATIONS static constant instead.
Array
.<Array
.<string
>>}
.getKeyEventTarget(control)
Inherited from goog.ui.ControlRenderer
.
Returns the element within the component's DOM that should receive keyboard focus (null if none). The default implementation returns the control's root element.
control
{goog.ui.Control
}
Element
}
.getStateFromClass(className)
[protected]Inherited from goog.ui.ControlRenderer
.
Takes a single CSS class name which may represent a component state, and returns the corresponding component state (0x00 if none).
className
{string
}
goog.ui.Component.State
}
.getStructuralCssClass()
Inherited from goog.ui.ControlRenderer
.
Returns the name of a DOM structure-specific CSS class to be applied to the root element of all components rendered or decorated using this renderer. Unlike the class name returned by {@link #getCssClass}, the structural class name may be shared among different renderers that generate similar DOM structures. The structural class name also serves as the basis of derived class names used to identify and style structural elements of the control's DOM, as well as the basis for state-specific class names. The default implementation returns the same class name as {@link #getCssClass}, but subclasses are expected to override this method as needed.
string
}
.highlightCell(palette, node, highlight)
Inherited from goog.ui.PaletteRenderer
.
Updates the highlight styling of the palette cell containing the given node based on the value of the Boolean argument.
palette
{goog.ui.Palette
}
node
{Node
}
highlight
{boolean
}
.initializeDom(control)
Inherited from goog.ui.ControlRenderer
.
Initializes the control's DOM by configuring properties that can only be set after the DOM has entered the document. This implementation sets up BiDi and keyboard focus. Called from {@link goog.ui.Control#enterDocument}.
control
{goog.ui.Control
}
.isFocusable(control)
Inherited from goog.ui.ControlRenderer
.
Returns true if the control's key event target supports keyboard focus (based on its {@code tabIndex} attribute), false otherwise.
control
{goog.ui.Control
}
boolean
}
.selectCell(palette, node, select)
Inherited from goog.ui.PaletteRenderer
.
Updates the selection styling of the palette cell containing the given node based on the value of the Boolean argument.
palette
{goog.ui.Palette
}
node
{Node
}
select
{boolean
}
.setAllowTextSelection(element, allow)
Inherited from goog.ui.ControlRenderer
.
Allows or disallows text selection within the control's DOM.
element
{Element
}
allow
{boolean
}
.setAriaRole(element, opt_preferredRole)
Inherited from goog.ui.ControlRenderer
.
Sets the element's ARIA role.
element
{Element
}
opt_preferredRole
{?goog.dom.a11y.Role
=}
.setAriaStates(control, element)
Inherited from goog.ui.ControlRenderer
.
Sets the element's ARIA states. An element does not need an ARIA role in order to have an ARIA state. Only states which are initialized to be true will be set.
control
{!goog.ui.Control
}
element
{!Element
}
.setContent(element, content)
Inherited from goog.ui.PaletteRenderer
.
Overrides {@link goog.ui.ControlRenderer#setContent} for palettes. Locates the HTML table representing the palette grid, and replaces the contents of each cell with a new element from the array of nodes passed as the second argument. If the new content has too many items the table will have more rows added to fit, if there are less items than the table has cells, then the left over cells will be empty.
element
{Element
}
content
{goog.ui.ControlContent
}
.setFocusable(control, focusable)
Inherited from goog.ui.ControlRenderer
.
Updates the control's key event target to make it focusable or non-focusable via its {@code tabIndex} attribute. Does nothing if the control doesn't support the {@code FOCUSED} state, or if it has no key event target.
control
{goog.ui.Control
}
focusable
{boolean
}
.setRightToLeft(element, rightToLeft)
Inherited from goog.ui.ControlRenderer
.
Applies special styling to/from the control's element if it is rendered right-to-left, and removes it if it is rendered left-to-right.
element
{Element
}
rightToLeft
{boolean
}
.setState(control, state, enable)
Inherited from goog.ui.ControlRenderer
.
Updates the appearance of the control in response to a state change.
control
{goog.ui.Control
}
state
{goog.ui.Component.State
}
enable
{boolean
}
.setVisible(element, visible)
Inherited from goog.ui.ControlRenderer
.
Shows or hides the element.
element
{Element
}
visible
{boolean
}
.updateAnimatedPaletteItem(item, animatedImg)
Inherited from goog.ui.emoji.EmojiPaletteRenderer
.
Modifies a palette item containing an animated emoji, in response to the animated emoji being successfully downloaded.
item
{Element
}
animatedImg
{Image
}
.updateAriaState(element, state, enable)
[protected]Inherited from goog.ui.ControlRenderer
.
Updates the element's ARIA (accessibility) state.
element
{Element
}
state
{goog.ui.Component.State
}
enable
{boolean
}