inputEx version 0.1.0 released

Wednesday, May 7th, 2008

It’s finally time !

I just finished the first public version of inputEx. I had this project in my bag since summer 2007.

Visit the website at http://javascript.neyric.com/inputex . Here is a short introduction from the documentation :

Introduction

inputEx is a javascript library to build fields and forms.
It can also be considered as an interface framework, since it provides a good structure to create you own fields.

It is built on top of the YUI library, and we tried to be as close as possible to the YUI philosophy.

It is of course fully skinable using CSS and currently supports Firefox 1.5+, Safari 2.0+, IE 7.0 and Opera 9+.

A unique field library

With so many form libraries out there, why would we create another one ?

  • HTML fields/forms are very limited
  • no existing good input library for YUI (let me know if I’m wrong !), except YUI widgets
  • it’s not all about validation !

Here are the features we implemented that makes inputEx unique :

  • json configuration for each field
  • complex data structures (list/objects/tree/list of urls/objects of objects etc…)
  • composition between the fields (for “meta”-fields such as InPlaceEdit,List,Tree,Pair,…)
  • javascript object mapping for greater interactivity
  • a common “updated” event to handle different browsers and different field interactions

No HTML ?

InputEx uses no html (it is the opposite of unobtrusive librairies): all the fields and forms are configured using json, then rendered by manipulating the DOM.
It is therefore a library to create javascript web applications, not webpages.

This approach has a great advantage: adding/modifying a field is made in one place only. Combined with
the json configuration that can be stored server-side, it makes customization of your web application very easy.

Help Us

It is very easy to help us improving the library :

  • Extend the library: send your custom fields to the wiki, it might help others !
  • Give your feedback on the forum
  • Report any bug

Other resources

If you didn’t find what you were looking for, please visit these websites :

WireIt version 0.2.1

Saturday, January 26th, 2008

I made a few updates this week-end. They mostly concern the Container
and Layer classes.

Here are the changes:

  • new Layer.getWiring function to save the state of the wiring. It
    can be customized by overriding Container.getConfig
  • jsBox updated to use the Layer.getWiring function
  • no default width for containers so they can auto-adjust to the
    content
  • Layer.addContainer and Layer.addWire now returns the created
    instance
  • Added the method Container.redrawAllWires and
    Terminal.redrawAllWires
  • Added Layer.removeAllContainers
  • adds a “body” div to the container
  • CSS updates on Containers and Layers
  • adds a focus CSS class on the last mousedown-ed container in the
    layer
  • bugfixes (events “addWire” and “removeWire” added to WireIt.Layer,
    offset in the connections)

WireIt 0.2.0 released

Saturday, January 5th, 2008

I just released the new 0.2.0 version. You can download it here.

Here are the main changes:

  • 2 new classes were added: WireIt.Container and WireIt.Layer
    Every project you might start using WireIt needs a widget that could contain Terminals, and that could be moved around. This is the goal of WireIt.Container.
    The Layer class creates a DIV element that can contain multiple containers and wires. It will be useful to save the state of the containers and connections between the terminals. (It also provide an extensible frame with scrollbars.)
  • Custom events added to create richer interactions when editing the wires.
  • A minified version built with YUI Compressor.
    This javascript minifier is almost perfect: I just wish you could have multiple input files…
    The result file is just below 20k.
  • jsBox: This is a sample application using WireIt.
    Create boxes containing javascript functions, connect them together, and run your program !
  • Many new configuration options, configurable CSS class names, and some new methods in the Wire and Terminals classes.

Don’t forget to give your feedback in the forum !

Have fun !

WireIt: a javascript wiring library

Thursday, December 6th, 2007

I’m pleased to announce the first release of WireIt (version 0.1) !

WireIt is a javascript library that allows you to create cool wires like Yahoo Pipes. It is built upon:

It comes with some examples (see the home page) and an application example, the Planar Game.

Why would you make such a library ? After playing a lot with Yahoo! Pipes, I realized how powerful it was to create mashups. I was already used to visual programming Languages like PureData or Mac OS Automator, but they’re definitly not able to do mashups.

However, Yahoo Pipes has this big inconvenient to run your pipes on their web servers. It has at least two disadvantages. First, it means we will always be restricted to the modules and types they implemented. You could always create a restful webservice and wrap it into a pipe, but the execution time blows up. Second disadvantage, you have to be careful with your data privacy. Indeed, I would like to create some Mashups that could mix with my private data in a more secure way.

That’s how I started to develop a Yahoo pipes-like application, and how I ran into this stumble block: “How the hell did they do those pipes ?”.

Waiting for your feedback,
Eric

Javascript Coding rules

Thursday, February 1st, 2007

Here are some rules I constrain myself to, and that can be useful for others :

  1. Use good code conventions
  2. Check your code: JSLint (javascript tools bundle for textmate make it automatic)
  3. Minification of your code: JSMin
  4. GZIP the code, don’t obfuscate: Minification v. Obfuscation

You will effectively reduce errors and debugging time by following those advices.

Singleton pattern in Javascript

Thursday, February 1st, 2007

If you’d like to create just one instance of a Class, you’d better use this singleton pattern:


var singleton = function() {

  /* Private variables */

  var privateVariable;

  /* Private methods */

  function privateFunction(x) {
    // do something here...
  }

  return {

    /* Public variables */

    publicVariable = 15,

    /* Public methods */

    getVariable: function() {
      return privateVariable;
    },

    setVariable: function() {
      privateVariable = 18;
      privateFunction();
    }
  };

}();

The magic of this pattern lies in the instanciation of the singleton:

the main function is called directly due to the ‘()’ at the end.

YUI improved Ajax

Saturday, October 14th, 2006

“The Yahoo! User Interface (YUI) Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX.”

I found YUI very helpful for my applications. It’s not the most complete framework that exists (look at BackBase for example) but it is very promising. You can make new Components easily ( with YAHOO.util.Dom, YAHOO.util.Event ), ajaxified behaviour (with YAHOO.util.Connect.asyncRequest ) etc…
I recommand two web sites :

For WordPress users, you can even use YUI to for the comments system.