My javascript testing toolchain

Update (Jan 4th 2014): Since I wrote this post, I’ve switched to using Karma instead of testem. Karma is written and supported by the Angular guys and in the year or so since this post was originally written has matured more than testem. I have a karma skeleton project that I use to setup my frontend testing environment. The readme for that project is pretty extensive and outlines how to set up a karma project.

Creating js files with Rhino (from JSON)

(This is primarily a note to myself) I’ve been playing with Rhino. Specifically, reading in json objects, turning that into normal, runnable objects and saving that to a file so browsers can run it. More specifically, the code that transforms the JSON to an object in the browser should be exactly the same as the one that runs in Rhino. That way I don’t have to maintain two different versions.

ActsAsUndoable

With web apps becoming more and more like Desktop apps, it seems like user interfaces need be more like desktop user interfaces too. Some of these web apps can have a complex UI and their users need to be able to feel comfortable with it. Of course, making the UI as simple as possible is key, but if a task is relatively complex then the UI will also be relatively complex.

Another Tabbed Interface

This is a rather belated post and is sort of a continuation of my last post about Aspect Oriented Programming. I’ve made yet another tabbed interface widgety thing (like the ‘tubes needs another one) that uses AOP to add additonal features. A tabbed interface widget provided a nice problem for me to experiment with AOP. You can see the results which allows tabs in a widget to be draggable and closeable too.

JS Fun

For the last few months I’ve been playing around with different design patterns and methodologies in Javascript. I’ve been looking at the Composite pattern and also Aspects Oriented Programming (AOP). AOP is a way of changing the behaviour of existing code without modifying it. It does this by providing, what AOP calls, advice at certain join points. In plain english, it provides a way of adding additional behaviour (advice) at certain points in your program (join points).

Another LiveInfo fix

Andrew Gregory reported some bugs in Opera 7.54u2. The bug in Opera 7.54u2 turned out to be rather strange. Any opera browser below 7.6 uses an iframe and I check the html within the frame to see if it is loaded. I use the text as that is the root node. In 7.54u2, there is no , only . Strange. Anyway I introduced a check for that and it works okay now.

LiveInfo Update

Just a minor update release on LiveInfo. Version 1.01 just tidies up some Javascript warnings that sometimes occur.

Introducing LiveInfo..

Directly evolved from liveSearch, is a updated version which I’m calling liveInfo. As can be seen at chregu’s blog LiveSearch displays live search results while a user enters the search text. You’ve probably seen Google Suggest which uses the same technology (XMLHTTPRequest). One of the coolest things about liveSearch is the keyboard navigation where users, when the input field has the focus, the user can navigate through the results using the up and down keys on the keyboard.

LiveInfo - How it works

LiveInfo is directly evolved from Livesearch. If you don’t know what liveSearch is, liveSearch allowed users to search a website while still viewing the current page. The original can be seen here. Wanting to make use of liveSearch for one of my own projects, I proceeded to make some changes from which evolved LiveInfo. LiveInfo is a framework for multiple, real time, skinnable updatable elements within a web page. You can see LiveInfo in action on my blog where there are two LiveInfo elements.