Home > alpha

alpha

Alpha is a project mainly written in JAVASCRIPT and PYTHON, based on the MIT license.

= Alpha

The initial idea was to create a compatibility library, permitting developers to write JavaScript and DOM as they are defined by the ECMAScript and the W3C. This means an obstrusive framework, that would transparently add support for missing (or broken) standard methods, like addEventListener() or querySelectorAll().

Of course, behing obstrusive, it certainly collapses with frameworks. But frameworks should be built around standards anyway (if so, they should be compatible).

== Why?

Why do we use JavaScript librairies at all? Because Internet Explorer's JScript sucks. It lacks complete support for the DOM Event or even the DOM Element object. We thus rely on JavaScript librairies to ease our pain.

IE8 eventually introduced support for the DOM Element, meaning we could use Element.prototype to implement missing DOM Event methods for instance. The problem was IE6 and IE7 do not support this. I thus started hacking and found a way to emulate an Element prototype and have standard methods like getElementById() to always return extended elements.

Since it just worked I continued and implemented DOM Events, querySelectorAll, and more; so that I would have all the latest features to work on older browsers, that are still used.

It works in all browsers I've tested so far (it might also work with older releases):

  • Internet Explorer 6+
  • Firefox 2+
  • Opera 9.5
  • Safari 3+
  • Google Chome

== Organisation

Alpha is currently separated in different parts:

  • lib/alpha: tries to fix, emulate and implement broken or missing features.
  • lib/addons: adds a few methods that I thought were missing (I must be wrong).
  • lib/html5: proposes an actual implementation of HTML5 features that can be emulated.
  • lib/ui: proposes some user interface widgets, like dialogs, tooltips, autocompleters, date pickers, etc (lives in it's own namespace).
  • lib/ujs: backend for the Unobstrusive JavaScript (UJS) of Ruby on Rails 3.

I feel bad about the Addons part since it goes back to having a library, but writing UI I felt the necessity to abstract some code out of it. So I did it.

You may use a mixin of any parts, as long as you have satisfy depencies.

Previous:BaiDuTop