home
features
quick start
download
documentation
thymol files
configuration
message resources
control parameters
expression objects
thymol types
thymol API
thymol extensions
examples
sessions
say-hello
stsm example
with-dialect
extrathyme
petclinic
news
credits
user forum
issues
browser constraints
other known issues
create new issue
thymeleaf

thymoljs

dialects

Thymol 2.0 extensions may optionally be grouped together into a logical set sharing the same xml namespace prefix. You do this by invoking the thymol.addDialect function.

thymol.addDialect = function(dialectSpec)

The single mandatory argument "dialectSpec" names a specification object that should have the following structure:

        {
            prefix : prefixNm,
            attributeProcessors : [ 
                {
                    name : attr1Nm,
                    processor : attr1ProcessorFnNm,
                    precedence : attr1Prec
                },
                {
                    name : attr2Nm,
                    processor : attr2ProcessorFnNm,
                    precedence : attr2Prec
                }, 
                ...
            ],
            elementProcessors : [
                {
                    name : elem1Nm,
                    processor : elem1ProcessorFnNm
                },
                {
                    name : elem2Nm,
                    processor : elem2ProcessorFnNm
                }, 
                ...
            ],
            objects : [
                obj1ExprObj,
                obj2ExprObj,
                {
                    name : obj1Nm,
                    object : obj1ProcessorFnNm
                },
                {
                    name : obj2Nm,
                    object : obj2ProcessorFnNm
                },
                ...
                ...
            ]
        }

Where:

Members of the attributeProcessors array property are name, function, precedence triples.

Members of the elementProcessors array property are name, function pairs.

The prefix value is shared by the attributeProcessors and elementProcessors.

Members of the objects array property may be either functions as defined on the expression objects page or plain JavaScript objects that expose functions to be called as expression object functions. In this case, the object field specifies the expression object function reference and the name field gives the expression object name.