Skip to content

This is a mix of Virtual-DOM and vdom-parser that applies DOM "diffs"

Notifications You must be signed in to change notification settings

hallgren/krumelur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Krumelur

With Krumelur it's possible to update a DOM element with new html content, it does so by using a virtual-dom to patch the element with changes from the new html string.

Should works on IE9 and up

API

Krumelur.apply(html, element)

Krumelur.applyOuter(html, element) alias to apply

Krumelur.applyInner(html, element)

apply and applyOuter

Apply the html markup on the outerHTML on the element.

applyInner

Apply the html markup on the innerHTML on the element. The html markup needs to be encapsulated in a tag that souround all the applied markup.

Example

  element = document.getElementById("body")
  Krumelur.apply("<body id='body'><span>Applied on body outerHTML</span></body>", element)
  Krumelur.applyInner("<span>Applied on body innerHTML</span>", element)

Development

Setup

npm install

Build

npm run build generate public/krumelur.js

npm run build_minified generate public/krumelur.min.js

Test

bundle install Ruby sinatra webserver is used to host the test files in ./views

rackup

Live demo

demo

todoMVC

About

This is a mix of Virtual-DOM and vdom-parser that applies DOM "diffs"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published