Yorick is ultra-minimalistic, client-side, JavaScript nanoframework. Currently it is 256 lines of code. That's what I mean nano.
First, you need to include jQuery(ish) library. May it be a genuine jQuery, or any compatible. I use only modern browsers, and Zepto.js worked fine for me.
Look at example yorick-demo.html
Add data-controller
attribute to any HTML element you wish have in scope:
<body data-controller="MyController">
Then declare controller code:
var MyController = function($scope, $y) {
}
See yorick-demo.html
for examples.
Any HTML element value with data-value="name" attribute is bound to $scope.name
Any HTML element value with data-visible="name" attribute will be shown/hidden according to $scope.name boolean value.
Add data-action="funcname" to any button, select or checkbox. When element is changed (or button clicked), $scope.funcname() function is called.
Provided convenience function $y.loadFragment(selector, path) will load content of path file into element selected by given jQuery selector.
$y.hash(key, value) sets value for given key.
$y.hash(key) to retrieve value of key.
$y.log(...) will log to console if available and when window.YORICK_DEBUG is truthy