Archive for May, 2009

Butterfish
by Butterfish

Swell Widget example: ImageZoom

Posted in Javascript, Swell

As Beta release is around the corner, we are glad today to provide the first swell widget. This widgets makes intensive use of Core components and shows how much power you have at your fingertips…

This is a widget that ecommerce companies often look for, which enables to zoom on an image and view much more details than on a thumbnail, without having to display the entire image; providing better user experience.

imagezoom

Cichlid
by Cichlid

On Joining Swell

Posted in Swell

I consider myself quite lucky. Earlier this week I stumbled upon the Swell project, and shortly after, the project has been gracious enough to let me help. I’m glad to now be part of the project – to help create a piece of software that has the potential to help so many others.

The Swell team has done a phenomal job with their code. It is well documented and logical. It is exciting time to be on board and I am looking forward to contributing.

I am Ryan, and my handle for the Swell project is Cichlid. And from the newest contributor, welcome to the Swell project. We hope you enjoy your stay.

SleepyCod
by SleepyCod

Trigger image loading with Javascript and Swell

Posted in Javascript, Swell

As we are seeing growing interest for Swell, we now want to show how to use it and how cool it is :D , this is according to the milestones on our Trac a necessity and this will as well open up the project to a larger public.

One of the Core component (Lazy loader) plays well with another (Element) in this example.

playground

Enjoy!

FlagBlenny
by FlagBlenny

Let’s start using Swell!

Posted in Swell

If you’ve been following this blog (or are going to read some previous posts), you’ll most likely want to try out Swell for yourself.

I posted a while ago about CDN technology allowing anyone to start using Swell while linking it on a Content Delivery Network, meaning visitors will always get the library from the closest point, and as the first milestone has been reached, I guess it’s time to do a little introduction on the way you will be able to make Swell-enabled applications.

At first, you need to determine which component you need. If you try to implement one of the examples in previous or future posts, you can get this information from the code snippet itself.

In our case, let’s say we want to use setStyle() to change our page’s background color. We want it black, the reason is irrelevant.

This will get our background black:

$(document.body).setStyle({backgroundColor : '#000'});

As setStyle() is part of the Core.Element Swell library, we’ll need it, but also its dependencies. “Core.Element” requires “Core.Hashtable” which requires “Core.CustomEvent” which requires “Core.Core”, who are all requiring the “Swell” namespace itself.
Dependencies are a pain, so we’ll just ignore them and include “Element” (Core.Element‘s alias name). The server-side system will automatically include everything we need in a very convenient way.

http://get.swl.fr/1.0/Element.js

Yep, that’s all. With this URL, I’ll include the Element lib from Swell, with all its dependencies, from the “1.0″ stable branch. If you feel adventurous, you can replace “1.0″ with “trunk” and get bleeding edge code.

<script type="text/javascript" src="http://get.swl.fr/1.0/Element.js"></script>
<script type="text/javascript">
$(document.body).setStyle({backgroundColor : '#000'});
</script>

Looks simple, try it too!

Finally, you might want to include more than one library. This is also possible, and is really easy. Let’s say we want Ajax and Event too, the URL would become: http://get.swl.fr/1.0/Element/Ajax/Event.js. The (obvious) goal is to include everything you need without including tons of different files.

Just a final note: using Swell only to change your page’s background color is called overkill. Try out the other examples on the blog and start building rich web applications!

Butterfish
by Butterfish

Swell’s current progress overview

Posted in Swell

1dotzero

We have recently completed the first milestone labelled under “alpha”, this first version is basically the framework itself, composed of:

  • Core, which contains the whole OOP logic including mixins, inheritance and the basic methods;
  • Browser, something you may need if you have no other choice but to rely on the user agent for building your application;
    • ran at load, this component identifies the browser family (trident, gecko, webkit, presto) and their version, the operating system, and if the site is accessed from a mobile device; every information is provided in multiple manners allowing boolean checks, or switch case dancing.
  • Event, splitted in three categories:
    • Event.js, provides a complete set of methods for Event manipulation in a cross-browser manner
    • CustomEvent.js, its name is self-explanatory: this class enables the use of custom events using the Dom Level 3 implementation when possible;
    • KeyListener.js, easy-to-use key listening abstraction for every class-A browser (including the troublemakers Opera and IE).
  • Ajax, ease the xhr process by providing a simple yet powerful API, a few highlights:
    • headers manipulation;
    • form serialization;
    • asynchronous file upload;
    • automated JSON parsing when the X-JSON header is spotted, using native JSON methods when available.
  • Hashtable, provides advanced key/value manipulation;
  • Asset, provides asynchronous loading for IMG/CSS/JS/JSONP components;
  • Element, the component which ties together numerous of the aforementionned components and ease their usage:
    • automated batch process, you may use one or more elements in a single instance and then call a method which will be executed on each element of the stack, this modus operandi drops drastically the line count;
    • the html builder, enables simple yet powerful element creation with hierarchy, events, custom attributes…

Well, that’s about all, to be honest we are frankly amazed by the work we’ve done so far in three months, although we were working/brainstorming on our spare-time we still managed to deliver the alpha two weeks before the estimated time with two extras (Asset/Hashtable weren’t planned for the alpha).

So, what’s coming?

And we’re already working on the beta, the second milestone estimated time is in six weeks, and includes:

  • Position, everything about position, size, areas… done; we’ll add some extra methods in there given enough time;
  • Drag & Drop, currently in brainstorming state, we plan on using the Firefox 3.5 HTML5 DD native API and simulate on the others (Trident/Webkit APIs are not really convincing);
  • Effects library, obviously necessary, as people tend to like what’s sparkling (and we do!);
  • History manager, a prerequisite for the RC (tabs and therefore, the feedreader application);
  • XML library, also a prerequisite, but we may finally not need it… wait & see!