Exhibit/API/2.2.0/HTML Attributes

From SIMILE Widgets
Jump to: navigation, search

Most configurable components will also take their unique identifier from the id attribute value.

Contents

General

Pulled from exhibit.js and ui/ui.js

role (exhibit-)?(collection|coder|coordinator|hiddenContent|lens|logo|submission-lens|edit-lens|facet|view|viewPanel)
Enumerated; lens, submission-lens, and edit-lens are synonyms. On any element that should play a role, usually div
collectionID An existing collection ID
Directly associate pertinent components with a collection (facets, view panels, etc.)
formats See Exhibit/Formats
Associate custom modes of formatting certain values with the component (lens, views, or document.body for global scope)
configuration JSON object
Represents configuration of component in JSON object form; only document.body
exporters example: Exhibit.JSONExporter;JSONExporter;JSON
Semicolon-separated string, each entry evaluated to a JavaScript object; only on document.body
ondataload Function
Run function after data has successfully loaded; only on document.body.

Collection

Pulled from data/collection.js

itemTypes example: President,VicePresident
Comma-separated string of types that belong in a collection.
expression
Exhibit Expression
baseCollectionID
Existing collection ID
restrictBaseCollection (true|false)
Boolean, for whether this collection restricts its base collection

Importer

converter example:
Name of the converter object to call on for this link
jsonp-callback example:
JSONP callback to pass in
charset example:
Character set of response

Facets

See Facet HTML Atttributes

facetClass example: Text; default: Exhibit.ListFacet
Any valid class of facet currently available; resolved to Javascript class Exhibit.classFacet

View Panel

initialView Integer; default: 0
The 0-based index of the view to initially display from all the views within the panel.

Views

viewClass example: Thumbnail; default: Exhibit.TileView
Any valid class of view currently available; resolved to Javascript class Exhibit.classView
viewLabel String; default from localization
The label for this class of view (e.g., "Tile")
label String
The display label for this instance of the view (there may be more than one view using this view class)
title String; default from localization
A description of the view displayed as a tooltip when the option to select this view is hovered over

Ordered Views

Including Tile and Thumbnail. Only applies when the view uses an ordered view frame.

orders Comma separated list of properties or { expression: string, ascending: boolean } objects
The set of properties' values which are used initially to sort this view by; defaults to label
directions Comma separated list of either (ascending|descending)
The set of initial sort directions for each property in the orders attribute.
possibleOrders Same as orders
The list of available properties for sorting; defaults to all
possibleDirections Same as directions
The list of matching directions to possibleOrders

Tabular

columns Comma separated list of expressions
Evaluated for each column, usually a forward property of the item
columnLabels Comma separated list of strings
Labels for each column
columnFormats Comma separated list of formats
Format type for each column
rowStyler Function
A function taking arguments itemID, database, row element (to modify), index of row in table that can set the color of the row depending on item properties and/or position in the table
tableStyler Function
A function taking arguments table element (to modify), database, in order to style the table

More

This section is incomplete. See the views section of Reference Documentation for Exhibit for an exhaustive list of attributes for each view. Note pagination is available for several ordered views.

Lens

itemTypes Comma separated list of database item types
Types this lens can be used for
lensSelector Function
A function taking the arguments itemID and database, using them to return the appropriate lens
template Element ID
The HTML id of the template element in this same document that will act as the lens, as opposed to the contents of this element.
templateFile URL
A pointer to the separate file that contains the template, to be fetched with AJAX (subject to same-domain policies, should probably be peered with Exhibit document)
onshow Function
A Javascript function to run when this lens is displayed

Templating

See Exhibit/Lens Templates and Exhibit/Conditional content

formats Exhibit/Formats
Applicable formats for value types
content Expression
Render this element with a text node containing the result of evaluating this expression against the item.
tag HTML tag name
Re-render this element with this tag instead of whatever it is (particularly useful for embed tags)
*-style-content Expression
The element style specified (e.g., text-color) will have its value set to the result of evaluating the expression
*-content Expression
The element attribute specified (e.g., href) will have its value set to the result of evaluating the expression
*-style-subcontent Expression + Template
The element style specified will have its value set to the evaluation of the expression in conjunction with the templating
*-subcontent Expression + Template
The element attribute specified will have its value set to the evaluation of the expression in conjunction with the templating
style CSS
Styles to apply to this element when rendered.
if-exists Expression
if Expression
select Expression
case Expression
* (anything else) Any attribute except id (preferably valid) with any value (preferably valid for that attribute)
The attribute of the element will be set to the value when rendered

These pertain to edit-lenses: control, editor, edit, options, editvalues

Coder

A coder contains elements like <span ex:color="#FFF">Foo</span> where the text is the value that gets the color (or icon, or whatever it may be).

coderClass example: Color
Any valid class of view currently available; resolved to Javascript class Exhibit.classCoder
case (others|mixed|missing)
Special case for which no one value can be used
color Valid RGB color
For color-based coders, Exhibit.ColorCoder, Exhibit.OrderedColorCoder, Exhibit.ColorGradientCoder
icon URL for an image
For icon-based coders, Exhibit.IconCoder
size Number (units? interpretation?)
For size-based coders, Exhibit.SizeCoder, Exhibit.SizeGradientCoder
gradientPoints Semicolon-separated list of comma-separated value-to-color/size gradient points
markerScale (log|linear|exp|quad); default: quad
The scale of the marker: logarithmic, linear, exponential, quadratic, for Exhibit.SizeGradientCoder

Logo Widget

color example: AliceBlue
Valid color names can be found in the image directory, after the last hyphen and before ".png" in the file names.
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox