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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

This documentation is quite incomplete. At the moment, it is simply a holding place for various bits of documentation that don't have a proper home yet.

The Fluid framework includes a number of functions and utilities that component developers can avail themselves of. These are described below.

On This Page

fluid.js

fluid.accumulate


fluid.allocateSimpleId


fluid.byId


fluid.clear


fluid.COMPONENT_OPTIONS


fluid.container(container)


fluid.copy


fluid.createDomBinder


fluid.defaults


fluid.dumpEl


fluid.emptySubcomponent


fluid.event.getEventFirer()

fluid.event.getEventFirer()

returns:

{
    addListener: function(listener, namespace, exclusions),
    removeListener: function(listener),
    fireEvent: function()

fluid.expectFilledSelector


fluid.fail


fluid.find


fluid.findAncestor


findKeyInObject


fluid.formatMessage


fluid.getId


fluid.initDomBinder


fluid.initSubcomponent


This function provides a generic way of instantiating and configuring any "sub-components" that may be a part of, or used by, a parent component. For example, this function is used by the Inline Edit component to instantiate the Undo decorator, a sub-component that provides Undo functionality to components that support it.

Parameters

Parameter name

Description

that

 

className

is a string defined by the invoking component, identifying an option understood by that component.

args

 

fluid.initSubcomponents


fluid.initView(componentName, container, userOptions)


fluid.instantiateFirers


fluid.invokeGlobalFunction


fluid.isPrimitive


fluid.jById


fluid.keyForValue


fluid.log


fluid.mergeComponentOptions


fluid.merge


fluid.mergeListeners


fluid.messageLocator


fluid.model.composePath


fluid.model.copyModel


fluid.model.getBeanValue


fluid.remove


fluid.stringTemplate


fluid.transform


fluid.unwrap


fluid.VALUE


fluid.version


fluid.wrap


fluid.initComponents(that, className, args)

FluidDOMUtilities.js

fluid.dom.cleanseScripts(element)


Cleanse the children of a DOM node by removing all <script> tags. This is necessary to prevent the possibility that these blocks are reevaluated if the node were reattached to the document.

  • element - Element,

fluid.dom.cleanseScripts.MARKER


Used to indicate that the DOM node has been stripped of all <script> tags

Constant: "fluid-scripts-cleansed"

see also: fluid.dom.cleanseScripts

fluid.dom.computeAbsolutePosition(element)


Returns the absolute position of a supplied DOM node in pixels. Implementation taken from quirksmode http://www.quirksmode.org/js/findpos.html

  • element - Element, the element whose location is returned

Return: [curleft, curtop]

fluid.dom.getElementText(element)


Returns the element text from the supplied DOM node as a single String.

  • element - Element, the element to return the text from

Return: String

fluid.dom.insertAfter(newChild, refChild)


Mockup of a missing DOM function

Inserts newChild as the next sibling of refChild.

  • newChild - Element, the new element to insert
  • refChild - Element, the element to insert newChild after

fluid.dom.isContainer(container, containee)


Checks if the specified container is actually the parent of containee.

  • container - Element, the potential parent
  • conatainee - Element, the child in question

Return: Boolean

fluid.dom.isIgnorableNode(node)


Determine if a node should be ignored by the iterator functions.
It will return true if the node is a Text node that is all whitespace or a comment node.

  • node - Element, representing the DOM1 Node interface

Return: Boolean

fluid.dom.isWhitespaceNode(node)


Determine whether a node's text content is entirely whitespace

  • node - Element, a node implementing the CharacterData interface (i.e., a Text, Comment, or CDATASection node

Return: Boolean

fluid.dom.iterateDom(node, acceptor, allNodes)


Walks the DOM, applying the specified acceptor function to each element. There is a special case for the acceptor, allowing for quick deletion of elements and their children.

  • node - Element, a node to start walking the DOM from
  • acceptor - Function, the function to invoke with each DOM element. If the return value is "delete", the element in question will be deleted. If the return value is "stop" the iteration will be terminated
  • allNodes - Boolean, use true to call acceptor on all nodes, rather than just element nodes (type 1)

fluid.dom.iterateDom.DOM_BAIL_DEPTH


This is provided as a work around for IE's circular DOM issue. This is the default max DOM depth in IE.
http://msdn2.microsoft.com/en-us/library/ms761392(VS.85).aspx

Constant: 256


Defaults

Each Fluid component includes a standard options structure at its top-level. Options allow implementors to configure and customize a component. User-supplied options are merged with relevant defaults for the given components. These defaults registered by each component with the Fluid defaults management system via a call to fluid.defaults():

fluid.default(componentName, defaultsObject);

where

  • componentName is a string name for the component, and
  • defaultsObject is a Javascript object containing key/value pairs for the default configuration of the component.

The options for each component (and their defaults) will vary, but all components share a subset of required defaults. These are:

Selectors

The selectors <something?> is a Javascript object that defines the necessary selector strings that will be used to access the various DOM elements that make up the component. Each component will have different selectors, but all components must have this selectors. Implementors can override the default selectors, so long as the selectors they provide meet the following requirements:

  • selectors must be relative to the main component container element

fluid.applySkin(skin, element)

  • No labels