Class Index | File Index

Classes


Class templateLayout

TemplateLayout is a CSS Template Layout prototype that implements some basic features defined in W3C working draft "Template Layout Module". Features:


Defined in: templateLayout.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
templateLayout(templateSource)
Create the prototype main class
Field Summary
Field Attributes Field Name and Description
 
Template compiler
 
Constant object that stores CSS properties names used as triggers

Currently used:
  • constants.DISPLAY = "display"
  • constants.POSITION = "position"
 
Template output generator
 
Template sources store
 
Version number
Method Summary
Method Attributes Method Name and Description
 
Returns the info from the parsing step
 
Returns TOM (Template Object Model)
 
Checks if given property is a valid one.
 
"Parser stop" callback.
 
"Parser start" callback.
 
propertyFound(property)
"Property has been found" callback.
 
transform(options)
Reads, compiles and generates the template
Class Detail
templateLayout(templateSource)
Create the prototype main class
Parameters:
{string|strings[]} templateSource Optional
template source. Supports 0..* strings containing valid CSS text or URL.

Empty constructor searches parent HTML file for STYLE tags and uses its CSS content as template source.

String params are analyzed and loaded in this way:
  • "htttp[s]://..." entries are loaded as files and content extracted
  • "file://..." entries are loaded as files and content extracted
  • Unmatched entries are loaded as CSS text
Multiple strings are first analyzed and then concatenated
Field Detail
compiler
Template compiler

constants
Constant object that stores CSS properties names used as triggers

Currently used:

generator
Template output generator

templateSources
Template sources store

version
Version number
Method Detail
{ParserBufferEntry[]} getBuffer()
Returns the info from the parsing step
Returns:
{ParserBufferEntry[]} buffer

{rootTemplate} getTOM()
Returns TOM (Template Object Model)
Returns:
{rootTemplate} tom

{boolean} isSupportedProperty(property)
Checks if given property is a valid one. If property name exists in constants then is a valid one
Parameters:
{CSSParserProperty} property
the property
Returns:
{boolean} true if exists constants[???] == property.declaration.property

parserDone(o)
"Parser stop" callback. Prints stop time
Parameters:
{StopCallbackData} o
Information sent by parser

parserStarts(o)
"Parser start" callback. Prints start time and resets buffer
Parameters:
o
Information sent by parser
o.time
Start time in milliseconds

propertyFound(property)
"Property has been found" callback. Stores in buffer valid properties
Parameters:
{CSSParserProperty} property
found property information

transform(options)
Reads, compiles and generates the template
Parameters:
{string} options Optional, Default: all
Only for testing purposes. Supported values [none|parse|compile]

Stops transform process at different points:
  • none: transform does nothing
  • parse: transform only parses template source
  • compile: transform parses source and compiles the template

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Feb 13 2012 12:35:32 GMT+0100 (CET)