Skip to content
This repository

the no-library library: open module JavaScript framework

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 build
Octocat-spinner-32 examples
Octocat-spinner-32 make
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.md
Octocat-spinner-32 ender.js
Octocat-spinner-32 ender.min.js
README.md

Ender.js

a small yet powerful JavaScript library composed of application agnostic opensource submodules wrapped in a slick intuitive interface. At only 7k Ender.js can help you build anything from small prototypes to providing a solid base for large-scale rich applications. Inside Ender you get

Examples

DOM queries

$('#boosh p').html('hello').css({
  color: 'red',
  'text-decoration': 'underline'
}).addClass('blamo');

Extending

$.fn({
  color: function (c) {
    this.css({
      color: c
    });
    return this;
  }
});

$('#boosh a[rel~="bookmark"]').color('orange');

Classes

var Person = $.klass(function (name) {
  this.name = name;
})
  .methods({{
    walk: function () {}
  });
var SuperHuman = Person.extend({
  walk: function () {
    this.supr();
    this.fly();
  },
  fly: function () {}
});
(new SuperHuman('bob')).walk();

AJAX

$.ajax('path/to/html', function (resp) {
  $('#content').html(resp);
});
$.ajax({
  url: 'path/to/json',
  type: 'json',
  method: 'post',
  success: function (resp) {
    $('#content').html(resp.content);
  },
  failure: function () {}
});

script loading

$.script(['mod1.js', 'mod2.js'], 'base', function () {
  // script is ready
});

// event driven. listen for 'base' files to load
$.script.ready('base', function () {

});

Animation

$('p').animate({
  opacity: 1,
  width: 300,
  color: '#ff0000',
  duration: 300,
  after: function () {
    console.log('done!');
  }
});

Utility

Utility methods provided by underscore are augmented onto the '$' object. Some basics are illustrated:

$.map(['a', 'b', 'c'], function (letter) {
  return letter.toUpperCase();
}); // => ['A', 'B', 'C']

$.uniq(['a', 'b', 'b', 'c', 'a']); // => ['a', 'b', 'c']

$[65 other methods]()

No Conflict

var ender = $.noConflict(); // return '$' back to its original owner
ender('#boosh a.foo').each(fn);

The haps

Ender.js pulls together the beauty of well-designed modular software and proves that git submodules can actually work. Thus if one part of the system goes bad or unmaintained, it can be replaced with another with minimal to zero changes to the wrapper (Ender). Furthermore if you want remove a feature out entirely (like for example, the animation utility), you can fork this repo and remove the appropriate submodule.

Building

For those interested in contributing on the core wrapper itself. Here's the process. Assuming you have git already — install NodeJS — then run the following commands in your workspace:

git clone https://github.com/ded/Ender.js.git
cd !$
git submodule update --init
make

Take special note that building with Ender will more than likely require frequently updating your submodules. Thus if you're unsure how this works, it's best to read up on how submodules work. However the simple answer is to get used to doing this:

git pull
git submodule update

Why all this?

Because in the browser - small, loosely coupled modules are the future, and large, tightly-bound monolithic libraries are the past.

License

Ender.js (the wrapper) is licensed under MIT - copyright 2011 Dustin Diaz

For the individual submodules, see their respective licenses.

Current times

It's obviously early days for Ender.js, and there are still bugs in each of the respective submodules, but they are each actively being worked on and you can be sure that Ender will pull in these changes as often as possible.

Contributors

@todo

an event utility is currently in the works. expect multi-event binding, custom (observer) events, delegation, and proper x-browser event workarounds.

Something went wrong with that request. Please try again.