Skip to content

Screens system for Javascript, based on sammy.js, knockout.js, Lab.js, Haml.js (optional) and John Resig's simple javascript inheritance

Notifications You must be signed in to change notification settings

drkarl/javascript-screens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Screens

Javascript Screens is a simple Screen system for Javascript.

¿What does screen mean in this project? A dynamic self-contained page in a web-site.

That project features a ScreenFactory where you can register new Screens. Each Screen is
* A javascript class
* Extended from the Screen class
* Autowired to a Sammy.js route
* Which self renders an associated .haml file
* Using a ScreenName_18n.json file for internationalized copys
* Bound to dynamic data using knockout.js
* With automatic routing for elements with the css class “.link”
* And cleaner markup, getting rid of knockout.js’ data-bind attributes thanks to Knockout.unobstrusive.js plugin for Knockout.js

It uses:

Usage

You can create new screens extending from class Screen. There are 2 example screens, Index.js and Content.js

You must register new screens using
APP.register(‘key’, new ScreenName());

And you start sammy.js by defining
APP.init(id) where id is the id of the element Sammy will be working on.

You can add css class “.link” to automatically route to that id. For instance

%button#about.link=About will route to #/about

It uses sammy.haml.js plugin for Sammy, which works with haml.js to render .haml files client-side, but you can disable it and use regular html files, or use another template engine like mustache, or whichever you like most.

About

Screens system for Javascript, based on sammy.js, knockout.js, Lab.js, Haml.js (optional) and John Resig's simple javascript inheritance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published