unsplit
A lightweight framework for rapid development with Javascript.
Getting started
Standard
Download either the minified or un-minifed version from the dist
folder.
Grunt
Clone our repository and install the modules to build unsplit with Grunt (NOTE: You will need to have nodeJS installed):
git clone https://github.com/unsplit/unsplit.gitcd unsplit && npm installgrunt
To change what is include in the build, edit the Gruntfile.js
and look for the fileOrder
array.
Generator
We provide a generator for unsplit, which allows you to specify in the url which modules/plugins get included. You can either clone the Generator repository and link through to it or you can link through to ours:
http://generator.unspl.it/?core,ajax,handlebars
API
$( element )
Pass through an element such as document
or query based on CSS selectors.
Example:
.module( modules, function(module) )
Include other modules here. (coming soon)
Example:
;
.controller( settings, function(components) )
Configure and initialize a controller. (coming soon)
Example:
;
.addClass( newClass )
;
.removeClass( currentClass )
;
.click( function )
;
.html( newHTML )
To recieve the html:
;
To change the html
;
.position()
var pos = ; console;
.attr( attribute, value )
To recieve the attribute's value:
;
To change the value:
;
.hasClass( class )
;
.append( string )
Insert text or HTML
;
;
$ajax
.get( url )
$ajax;
more coming soon!
$scope
initialization
;
data-template
Request a template via url, this is handy for keeping your code in small chunks.
<!-- templates/test.html -->{{#games}}* {{name}}{{/games}}
data-repeat (in development)
Repeat the DOM element by an array/object
{{name}} {{#tags}} {{name}} {{/tags}}
data-keypress
On a particular keypress, run a function in the scope
more coming soon!
Plugins
We want to keep the core of unsplit minimal, so you can choose exactly what you need from the framework. Here you will find a list of plugins which are supported within the core:
Name | Status | Website | API |
---|---|---|---|
Mustache | development | http://mustache.github.io/ | .template(html) |
Handlebars | development | http://handlebarsjs.com/ | .template(html) |
Google Analytics | development | http://developers.google.com | .ga(category, label, value) |