Web Info & Tutorials

November 30th, 2006

YAHOO! TV: AJAX’D UP BETA

Yahoo! TV has had a face lift. and it has a lot of the usual suspects from YUI:

Nice smooth tabs:

Yahoo! TV Tabs

A carousel for picks, and a mini tv listings on the right side:

Yahoo! TV Carousels

The full tv listings show up on demand as you scroll down:

Yahoo! TV Beta

Some are not too enthused. Dave Winer commented:

Yahoo says they improved Yahoo TV, but imho, they broke it. The listings page, which until today was the only page I knew or cared about (they just added a bunch of community features) took a few seconds to load, now it’s an Ajax thing, and it loads as you scroll. Great. There’s a delay every time I hit Page Down. Now instead of finding out if there’s anything on in seconds it takes minutes. That’s an improvement?

The listings issue could be solved by a) loading the entire thing again, or by staying ahead of the game a bit, as then you wouldn’t notice (e.g. eagerly load at least one section).

What do you think of the new look?

November 30th, 2006

EXO PLATFORM GOES FROM PORTAL TO ENTERPRISE WEBOS

I have watched the eXo platform grow for a few years. Benhamin Mestrallet and his team do great work, and now we are seeing the next boost.

They have revamped their UI with Ajax, and it is looking really good.

Each window is a portlet, and both portlets and portal are fully Ajax enabled.

This means that with eXo you have an Ajax front end talking to a Java backend that supports the Java standards of JSR 168, and 170 for the application/windows and the file system. You will also be able to build widgets.

exo ajax portal

November 30th, 2006

DOMTOOL: GIVEN HTML GENERATE DOM METHODS

Stuart Colville has developed a tool for generating DOM methods from an HTML snippet called DOMTool:

The idea is that you drop a snippet of HTML in the input and the tool puts it into the document with innerHTML and then loops through that structure to generate the DOM methods needed to append that piece of HTML into a document from a script. There's a kind of beautiful irony in using innerHTML to generate DOM methods.

I've added a basic compat function to handle the problem with name attributes in IE so this would need to be included in the end-user's script should they be trying to create any elements with name attributes. This function only appears when name attributes are present in the input.

Users should also bear in mind that the ouput will not necessarily be optimal but it should be fairly easy to take the output and use it as a basis for production code.

Example

Say you hand the tool:

<p>test1</p>
<p>test2</p>
<p>test3</p>
 

You will get back:

var p1=document.createElement('P');
var txt1=document.createTextNode(’test1′);
p1.appendChild(txt1);
var p2=document.createElement(’P');
var txt1=document.createTextNode(’test2′);
p2.appendChild(txt1);
var p3=document.createElement(’P'
);
var txt1=document.createTextNode(’test3′);
p3.appendChild(txt1);
 

If you want to give it a whirl, visit the tool here: DOMTool 1.01

November 30th, 2006

BLACK BACKGROUND TECHNIQUE

Jason Fried of 37 Signals talked most a Basecamp design decision that had to do with their support section.

An Ajax asking on an signaling activity was occuring likewise fast:

Speed is good, but pace crapper also be deceiving. Sometimes things crapper hap likewise fast. Sometimes it doesn’t countenance same anything changed. That was the example force for the yellow-fade framework introduced in Basecamp.

But the chromatic drop meet didn’t seem to attain as such significance in this case. We desired to be a taste more subtle. Flashing a Brobdingnagian 500 sq/px country chromatic was likewise much.

A impalpable disagreement was institute between dynamical the headline, and making it albescent on black. With a black background, you saw it modify length, and users could impact that change:

Now when you attain the alter the appearance of the brick also changes. The black forbid changes length. That’s a aggregation more manifest than meet black book on a albescent background.

This plays soured Tufte’s “smallest trenchant difference” theory which essentially says you should attain every seeable distinctions as impalpable as possible, but ease country and effective.

Changing black book was likewise impalpable and not country enough. But dynamical the scenery to black allowed the country modify to be country and trenchant still impalpable sufficiency not to shock you same a Brobdingnagian chromatic drop strength hit done.

black div background

November 29th, 2006

SYMFONY 1.0 BETA RELEASED

symfony, the popular PHP Ajax framework, has released a beta of their 1.0 framework.

New Features in 1.0

  • Easier installation and larger compatibility. Symfony is now compatible with magic_quotes_gpc set to on and PHP 5.2. Pake and phing are now bundled with the core classes, so symfony has no more external dependency. It is very easy to link a symfony application to the symfony libraries (through the config/config.php file), and PEAR is no more a prerequisite. The symfony command line now works out the box (for PEAR, SVN or .tgz).

  • Major performance improvement. Many parts of the code have been refactored, with performance in mind. The result is a performance increase of 50% to 500%, depending on your platform.

  • New plugin system. Extending symfony has never been easier. A plugin can package classes, modules, helpers, filters, web assets, fixtures, data models, unit tests, and so on. Plugins can be installed with one command. Check the Plugins page for a list of already available plugins.

  • New unit test library. Symfony is now bundled with its own unit and functional test framework, called lime, and a bunch of automated tests utilities, such as the sfTestBrowser and sfDomCssSelector classes. Symfony itself has more than 2800 unit and functional tests that guarantee its quality of code.

  • Updated default pages for error 404, error 500, insufficient credentials, unavailable page, and deactivated application (thanks justinm for the design!). These pages are both much nicer and much easier to customize than before.

  • Easier templating. Components and components slots now work perfectly on every situation, even with cache set to on. Their code was refactored to be fast and effective. The new temlate fragment tools, called slots, are faster than component slots, require no extra file or configuration to add a dynamic zone to a layout. And the icing on the cake: Ajax actions have no layout by default.

  • Better and more flexible Model layer. Symfony is now ORM independent: it is still bundled with Propel by default, but can work with others (such as Doctrine) in a snap. Database schemas can now be written in YAML instead of XML. Persistent support and specific database encoding are now supported natively.

  • New mixin feature. The sfMixin class introduces mixins in PHP, allowing core classes modification without inheritance, addition of new methods to existing classes, and multiple inheritance.

  • New behaviors for Propel classes. A behavior is a group of properties and methods that can alter the Propel generated classes. To make a Propel class sortable, to add a pessimistic lock, or to change the deletion by a is_deleted flag, you now need only one line of code with behaviors.

  • More user-friendly development tools. The symfony logs and the web debug toolbar now display more information about time and execution bottlenecks, thanks to the new sfTimer class. The symfony command line now has a color output (in *nix). The logging mechanism (via the sfLogger class) is more flexible and easier to extend. Logs rotation and cleaning are automated.

  • More flexible filter system. User filters can now be registered anywhere in the filter chain (even before the security filter).

  • New many-to-many relationships are now supported in the admin generator.

  • Easier deployment. The freeze task is implemented and fully functional. It transforms a symfony project into a self sufficient program by adding in the symfony libraries and assets.

  • Updated creole, Propel, script.aculo.us (1.6.5) and prototype (1.5.0_rc1)

  • And more than 200 bug fixes and small enhancements
November 29th, 2006

TDD AND JAVASCRIPT WITH JSMOCK

I've been using JsUnit for a while now to do Test Driven Development with OO Javascript. I've been implementing mock objects simply by stubbing out methods and adding in a limited amount of logic, but it's just not the same. So, this past weekend was the time to come up with a port of jMock to Javascript. But before reinventing the wheel, I thought I'd take a look around one more time to see if anyone had beaten me to the punch. Enter JsMock, a Javascript mock objects library that supports Firefox 1.0+, IE6+ and Safari 1.5+.

You can add JsMock into JsUnit tests simply by including the jsmock.js file into your unit test HTML page and adding some mock object code to your tests. An example:

var mockControl = null;
var div = null;
function setUp()
{
 mockControl = new MockControl();
 div = document.createElement("div");
}

/* Interface we will mock */
function DocWrapper() {};
DocWrapper.prototype = {
 byId:function(){},
 create:function(){},
 appendToBody:function(){}
};

/* Object we will test */
function Hello(docWrapper) { this.docWrapper = docWrapper; };
Hello.prototype = {
 displayHello:function(id) {
  var elem = this.docWrapper.byId(id);
  if (elem == null) {
   elem = this.docWrapper.create("div");
   elem.id = id;
   this.docWrapper.appendToBody(elem);
  }
  elem.style.fontWeight = 'bold';
 }
};

/* tests we will run */
function test_NewElem() {
 var mock = mockControl.createMock(DocWrapper);
 mock.expect().byId("helloContent").andReturn(null);
 mock.expect().create("div").andReturn(div);
 mock.expect().appendToBody(div);

 var hello = new Hello(mock);
 hello.displayHello("helloContent");

 try {
  mockControl.verify();
 }
 catch(e)
 {
  fail("Verify should have passed: " + e);
 }
}

function test_ExistingElem() {
 var mock = mockControl.createMock(DocWrapper);
 mock.expect().byId("helloContent").andReturn(div);

 var hello = new Hello(mock);
 hello.displayHello("helloContent");

 try {
  mockControl.verify();
 }
 catch(e)
 {
  fail("Verify should have passed: " + e);
 }
}

function test_BadOrder() {
 var mock = mockControl.createMock(DocWrapper);
 mock.expect().create("div").andReturn(div);
 mock.expect().byId("helloContent").andReturn(null);
 mock.expect().appendToBody(div);

 var hello = new Hello(mock);
 hello.displayHello("helloContent");

 try {
  mockControl.verify();
 }
 catch(e)
 {
  fail("This will fail: \n" + e);
 }
}
 

In the above example, we stub out an interface for a wrapper for the document object (in Firefox and Safari you can actually mock the document object, but not in IE), mock it out for different scenarios, then put the Hello class through its paces, first when there is no DOM node with id "helloContent" and next when there is one. We don't actually modify the DOM in this case, we just reuse a scratch DIV node that we create in the setup. The last test fails on purpose, just to illustrate how the order of calls matters in JsMock.

:jsmock.JPG

The documentation is a little sparse, so you have to work your way through the examples to get the gist of JsMock. Prior knowledge of jMock or EasyMock is definitely helpful. If you never do any OO Javascript or TDD, you won't understand why you need something like JsMock. If you do TDD, have at it. It's just another step in the professionalization of Javascript development.

BTW, this tool was just released in August and updated in the last few days, so the paint is still wet on it. Please consider making bug reports to the authors.

November 29th, 2006

INCLUDING DOJO VIA THE AOL CDN

AOL has been hosting Dojo builds for awhile, but now Alex Russell has:

constructed a couple of very small “wrapper” files that will let you include the “Ajax” build of Dojo from various versions through the cross-domain loader.

Including the latest stable Dojo couldn’t be simpler:

<script src="http://download.dojotoolkit.org/dojo_0.3.1.js"></script>

It’s also trivial to test out the latest 0.4.1 Release Candidate:

<script src="http://download.dojotoolkit.org/dojo_0.4.1rc2.js"></script>

That’s all there is to it!

From here on in, your pages can use the dojo.require() system to pull in anything that’s part of the “stock” distribution, and by following James’ detailed documentation and test page, you can also load your own custom packages while still loading the main system from a separate domain.

Imagine if lots of people did this. Browser cache happy.

November 29th, 2006

PASSLET: AJAX PASSWORD MANAGER WITH AES CLIENT-SIDE ENCRYPTION

Passlet is a newborn Ajax countersign trainer that does every encryption/decryption on the computer side.

Passlet uses the industry-standard key account duty PBKDF2 (c.f. RFC 2898) to create a 128-bit AES key from the officer password.

Here is the Password-Based attorney Derivation Function 2 (PBKDF2) JavaScript implementation.

Agatra (covered earlier) offers kindred functionality, but Passlet communicator Parvez Anandam points out: “Agatra does not encrypt and rewrite passwords locally. But Passlet does. All AES coding and coding is finished completely client-side. The computer does not ever wager the officer password. Passlet uses the key account duty PBKDF2 (c.f. RFC 2898) to create a 128-bit AES key from the officer password. I conceive this is the prototypal (and only) javascript feat of this key derivation.” Another website along these lines is Halfnote (covered earlier).

Passlet is an warning of the Host-Proof Hosting (more intimately than Agatra and Halfnote) - Parvez says “While I was datum it, I couldn’t support but smile: your organisation ornament is a thought of what I was intellection in the limited environment of a countersign manager. And today you hit a real-world warning of this organisation pattern!”

Passlet

November 28th, 2006

OPERA MINI 3.0 AND THE AJAX PHONE

Opera has announced Opera Mini 3.0 which includes:

  • Feed Reader: I’ve let this replace the native feed reader I have on my phone. The UI is better than what the Sony Ericsson M600i offers, and it actually supports a multitude of formats, including Atom 1.0
  • Photo upload. My phone has no camera, but here it is, direct photo upload from within Opera Mini.
  • Support for secure connections: You can finally use secure services and stay safe all the way.
  • Since most web authors have no regard for mobile usability (and no, dotmobi won’t help), Opera Mini 3.0 has content folding, where long navigation lists and other filler fluff is collapsed so you don’t have to scroll past 323 pages to get to your actual content.

If you want to check it out without trying it on your phone, pop over to the simulator.

There is also footage of the Aida mobile desktop, which is an R&D project tested by Opera, Telenor and FAST.


November 28th, 2006

TASKS ADDED TO GOOGLE CALENDAR BY MILKERS

The Remember the Milk folks have added task management to Google Calendar (something many wish Google had added themselves).

We know that many of you are managing your tasks with Remember The Milk and your events with Google Calendar, and we thought it would be very cool if we could bring the two together. This new feature adds a small task icon to the top of each day in Google Calendar — click on the icon to:

  • Review your tasks for the day
  • Add new tasks and edit existing ones
  • Easily complete and postpone tasks
  • Review your overdue tasks
  • Optionally show tasks with no due date
  • See where your tasks are located on a map (Google Maps integration)

This is really interesting. An outside group was able to add an important feature that we can not all use in a Google app itself.