🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

dt-browser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dt-browser

Δt browser render logic for adapters - async & dynamic templating engine

Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

Δt jQuery Adapter

This is an jQuery Adapter for Δt.

It listen on the template events and writes to the DOM.

Check out the demo!

Installation

$ npm install dt-jquery

How this Adapter works:

<script src="dt-jquery.browser.js"></script>
<scipt>
    var jqueryify = window.dynamictemplate.jqueryify; // get the jquery adapter
</script>

Just throw your template in and add it to the DOM when it's ready:

var tpl = jquerify(template(mydata));
tpl.ready(function () {
    $('.container').append(tpl.jquery);
});

Documentation

jqueryify(tpl)

tpl = jqueryify(new dynamictemplate.Template)

Expects a fresh Δt template instance (fresh means, instantiated in the same tick to prevent event loss).

It just simply listen for a bunch of events to use jQuery for DOM manipulation.

Uses requestAnimationFrame for heavy DOM manipulation like node insertion and node deletion.

Overrides the query method of the async XML Builder.

For query type text it returns the result of jQuery.text.

For query type attr it returns the result of jQuery.attr.

For query type tag it returns a dummy object that it will receive again on an add event.

Build Status

Keywords

dt

FAQs

Package last updated on 22 May 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts