Skip to content

Instantly share code, notes, and snippets.

@pure
Created July 20, 2012 15:04
Show Gist options
  • Save pure/3151200 to your computer and use it in GitHub Desktop.
Save pure/3151200 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<script src="http://zeptojs.com/zepto.js" type="text/javascript" charset="utf-8"></script>
<script src="http://github.com/pure/pure/raw/master/libs/pure.js"></script>
</head>
<body>
<div id="test"></div>
<script>
var data = {},
dir = {'.':'"test"'};
;(function($){
$.extend($.fn, {
directives:function(directive){
this._pure_d = directive; return this;
},
compile:function(directive, ctxt){
return $p(this).compile(this._pure_d || directive, ctxt);
},
render:function(ctxt, directive){
return $p( this ).render( ctxt, this._pure_d || directive );
},
autoRender:function(ctxt, directive){
return $p( this ).autoRender( ctxt, this._pure_d || directive );
}
})
})(Zepto)
console.log ( $('#test').render(data, dir) );
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment