2010-04-25 - IMPROVED METHOD: Uize.substituteInto
2010-04-30 - NEW EXAMPLE: Animate Position in JavaScript
2010-03-11 - IMPROVED MODULE: Uize
2010-04-18 - NEW EXAMPLE: Animated Buttons with Box Shadow
2010-04-18 - NEW MODULE: Uize.Fx.xShadows
2010-04-15 - IMPROVED MODULE: Uize.Template
2010-04-12 - IMPROVED MODULE: Uize.Date
2010-03-24 - New Web Site Using UIZE: wardtog.com
2010-03-18 - NEW EXPLAINER: Creating A New Uize Module
2010-03-08 - NEW EXAMPLE: Get Tree from Page
2010-04-18 - DEPRECATED MODULE: Uize.Fx.xTextShadow
2010-06-07 - Improved Date Picker Widget
2010-06-15 - Deprecated Event Management Methods Killed
Touch me – qooxdoo support for mobile touch devices
New mobile touch devices are released on a weekly base. At least since the iPad and with other tablets on the horizon, people will want to use the Rich Internet Application they are used from their desktop computer on those devices.
These weeks we have started to improve the framework support for mobile touch devices. In the first iteration, we laid the focus on a basic touch support for Apple iPhone / iPad and Android devices.
So what's new for you and your applications?
<h2>Touch Events</h2>
With the qx.event.type.Touch event class it is possible to listen for touch events on elements, from low-level DOM elements to high-level UI widgets. With the following code snippet you can add a touch event:
elem.addListener("touchstart", function(e) {
var x = e.getDocumentLeft();
var y = e.getDocumentTop();
alert("touched at x: " + x + " / y: " + y);
}, this);
The following touch events are supported:
- touchstart – Fired when the element is touched by one or more fingers.
- touchmove – Fired when a finger is moved on the element
- touchend – Fired when a finger is lifted from the element
- touchcancel – Fired when the touch is interrupted by the system (e.g. when an alert occurs)
<h2>Demos</h2>
See the touch events in action:
Pong:
http://demo.qooxdoo.org/devel/demobrowser/demo/mobile/Pong.html?qx.theme=qx.theme.Modern
Fingers:
http://demo.qooxdoo.org/devel/demobrowser/demo/mobile/Fingers.html?qx.theme=qx.theme.Modern
Image Scale / Rotate:
http://demo.qooxdoo.org/devel/demobrowser/demo/mobile/ScaleImage.html?qx.theme=qx.theme.Modern
The Official jQuery Podcast has a New Home
Today, we’d like to announce that we’ve moved the Official jQuery Podcast off the jQuery blog and onto it’s own site at http://podcast.jquery.com.
We felt that with a weekly blog post for each episodes show notes the podcast was taking over the blog. Some of the community members thought the same way. We’ve been working on porting over the existing posts and making the new podcast site easier to use for our listeners.
Each episodes show-notes are now streamlined to give you a quick introduction about what the show is about followed by all the links that were mentioned in the show. We also have the ability to play the show from the post with an embedded player as well as easy links to download and subscribe.
We also have a easy contact form that will allow you to contact the podcast directly.
We’ve cleaned up the jQuery blog and removed the old show notes and put in place URL redirects so old urls will still go to the right post on the new site. While we are talking about the blog, we’d like to know what would you like to see more of on the jQuery blog? Currently we’ve been using the blog to post news about the project and upcoming events. What else can we post to help you out? We’d love to hear your ideas.
Special thanks goes out to Doug Neiner for helping out with design and coding, also, would like to thank Jonathan Sharp for setting up the site and getting the URL redirects in place.
Let us know what you think of the new podcast site and don’t forget to keep listening to the show.
The week in qooxdoo (2010-09-03)
Welcome back to the weekly status update.
Upcoming IE9 supportThis week we started to look more closely into the framework's support for the future Internet Explorer 9. While IE9 is still only available as a platform preview, the first beta is expected in about two weeks. While working with the browser preview we found some regressions in the new IE9 implementation, which we reported to Microsoft's developer team. For details see the bugzilla list, with some corresponding links to the Microsoft Feedback Program.
InspectorThe Inspector's Selenium window can now import test cases in the "Selenese" HTML format. More importantly, the required external scripts (Selenium Core and the qooxdoo extensions) can now be loaded straight from their online repositories, so no local copy is required. See the manual page for a detailed explanation of the new features.
Bug fixesFor a complete list of tasks accomplished during the last working week, use this bugzilla query.
New Contrib: TokenFieldIt's quite interesting to see how that contrib got started and how it is coming along: on Monday Christian Boulanger started to think aloud about integrating an existing jQuery-based "token field" into one of his apps. Guilherme Aiolfi couldn't quite stand that: "God, I hate jQuery. After getting used to the qooxdoo clean way of organizing code looking at jQuery code looks so messed up. I think you should be better porting it. I would be interested to help you with that." He suggested to implement it as a regular qooxdoo widget, based on the concept of a token field know from Mac OS X. The next day he already had a first version available.
It was a straightforward procedure to make Guilherme a contributor for qooxdoo-contrib, and let him continue his work as a new TokenField contrib. Now, by the end of the week, a development version of it is already showcased in the online contrib demobrowser. Thanks Christian and particularly Guilherme for such a fantastic job, transforming a mere idea into a public qooxdoo contribution within, what, four days!
OutlookNext week a number of team members will be absent, due to attending conferences, or being on vacation or on work-related trips. Please take that into account and expect some delay over typical communication channels like mailing list or bug tracking. It would be great you could help out, for instance by being particularly active on the mailing list, trying to answer other qooxdoo users' questions. Appreciated.
Have a nice weekend.
StealJS - Script Manager
There's a lot more to making JavaScript apps than writing JavaScript. StealJS is a collection of command and browser based JavaScript utilities that make building, packaging, sharing, and consuming JavaScript applications easy.
Download FeaturesStealJS is made of several components:
Dependency ManagementThe steal script is a script loader and dependency management tool. Features:
- Load JavaScript, CSS, Less, CoffeeScript, and a variety of client-side templates.
- Load files relative to the current file, steal's root folder, your server, or from other domains.
- Load a single file only once (the whole dependency management thing).
steal('dojo','jquery','prototype');
JS/CSS Concatenation and Compression
Steal's build plugin compresses an application into a single minimized JavaScript and CSS file. Features:
- Works with any application, even ones not using the steal script.
- Configurable compressors (defaults to Google Closure).
- Compresses Less and CoffeeScript.
- Pre-processes and compresses client-side templates (templates don't have to be parsed or included with the page).
- Expandable architecture makes it easy add other file types to the build script.
- Can intelligently combine shared dependencies into separate files for caching.
./js steal/buildjs mypage.htmlCode Generators
Steal's generate plugin makes it easy to get started developing. Features:
- Creates folders, files and scripts your app needs.
- It's very easy to make custom generators.
./js steal/generate/app myappPackage Management
Steal's get plugin is a very basic JavaScript version of ruby gems. Features:
- Download and install plugins from remote SVN or GIT repositories.
- Installs dependencies.
./js steal/getjs http://github.com/jupiterjs/funcunitCode Cleaner
Steal clean beautifies your code and checks it against JSLint.
./js steal/clean path/to/page.htmlLogging
Steal dev logs messages cross browser. Messages are removed in production builds.
steal.dev.log('something is happening');
Why
StealJS is an extremely strong attempt at solving a few of the the most core problems in JavaScript development:
Development vs ProductionThere's a tension between development and production JavaScript needs. When developing JavaScript, you want:
- Lots of logically separated files.
- Changes in a file to only require a refresh of the browser. (It's JavaScript not JavaCompile!)
This is in contrast to production where you want a few compressed and cacheable files.
Steal makes this easy with not only JavaScript, but with other resources like CSS, client side templates, Less, and CoffeeScript!
Yes, this means what you think it does. You can edit CoffeeScript/Less/template/CSS files and just refresh the browser to see changes. When you finally make a production build, steal will convert, package, and compress these files with your other JavaScript and CSS files.
Optimized WebsitesThere's also tension between script loading performance and caching. You want to:
- Have as few http requests as possible.
- Exploit the cache.
This is especially problematic when multiple pages have shared dependencies. Lots of shared scripts better exploit the cache, but also increase the number of requests.
StealJS makes it easy to find the perfect balance. It can build apps for multiple pages at the same time, understand the shared dependencies, and create cacheable shared downloads.
Framework AgnosticMost server frameworks come with varying levels of similar functionality. Ruby on Rails is particularly great and bundling Less CSS and JavaScript.
But, what if you wanted to bundle the same Less files with ASP.NET MVC?
StealJS works with any server framework. As we (or mabye you) add new features, those will be available to users of any web framework.
Resources- Documentation
- Github Repository
- Website (a work in progress).
- Get Help (on the JavaScriptMVC forums).
Download steal and unzip it into a public folder where you will have JavaScripts. You should see something like:
/your_public_folder /steal /js.bat /js
If you don't already, make sure you have Java 1.6 installed.
Using GeneratorsThe easiest way to create a new app that uses steal is to use steal.generate to create an application skeleton. Open a command line to your public folder. In windows write:
js steal\generate\app myapp
In Mac/Linux write:
./js steal/generate/app myapp
Warning: The remainder of this guide only shows the windows command. Mac/Linux users should change js to ./js and \ to /. (We make the Mac/Linux people figure it out because they are smarter :-).
This creates a myapp folder in your public directory that looks like:
/myapp
/docs
/scripts
/build.js
/clean.js
/test
/resources
/example.js
/example.coffee
/example.less
/myapp.html
/myapp.js
/myapp.css
Dependency Management and Script Loading
If you open myapp.html in a web browser, you should see something like:

*** This won't work on the filesystem from Chrome because it has draconian XHR limitations. If you run it from a server, it will work perfectly.
Now open myapp.html in a text editor, you will find a script tag like:
<script type='text/javascript'
src='../steal/steal.js?myapp/myapp.js'></script>
This loads the steal script. The steal script is what does dependency management. The myapp/myapp.js tells the steal script to load your app at myapp/myapp.js.
Open myapp/myapp.js. In it you'll see something like:
steal( 'resources/example' ) // 1
.css( 'myapp' ) // 2
.plugins(
'steal/less',
'steal/coffee' ) // 3
.then(function(){ // 4
steal.coffee('resources/example') // 5
.less('resources/example'); // 6
});
This:
- Loads 'myapp/resources/example.js'.
- Loads 'myapp/myapp.css'
- Loads 'steal/less/less.js' and 'steal/coffee/coffee.js'
- Adds a function to be called back once all prior files have been loaded and run.
- Loads 'myapp/resources/example.coffee'.
- Loads 'myapp/resources/example.less'.
*** This callback is needed because script loading is not synchronous. The 'steal/coffee' and 'steal/less' plugins add steal.coffee and steal.less.***
The steal script provides a number of helper functions to make loading scripts very easy. Once you have loaded all the scripts for your app, it's time to build it.
JS/CSS Concatenation and CompressionIf you used the generators to create your application, compressing your app is very straightforward:
js myapp/scripts/build.js
This packages your app into myapp/production.js and myapp/production.css.
To uses these files instead of all your uncompressed files, change your page to load steal.production.js instead of steal.js:
<script type='text/javascript'
src='../steal/steal.production.js?myapp/myapp.js'>
</script>
Reload myapp.html and you should see it load only 2 JavaScript files and one CSS file.
Package ManagementSteal.get downloads and installs plugins from a url. Typically it's run from the steal/getjs script.
The following copies the FuncUnit repo to a local funcunit folder.
js steal\getjs http://github.com/jupiterjs/funcunit -name funcunit
Official Plugins
Steal maintains a list of official plugins compatible with steal development. You can install these just by providing their name:
js steal\getjs funcunit
The following are the list of official StealJS plugins. As StealJS itself is in Beta, the following plugins should not be considered production ready:
- steal - Update steal itself.
- funcunit - Functional testing platform.
- jquery - jQuery 1.4.3 and the JavaScriptMVC components.
- phui - Very early alpha UI widgets.
- documentjs - A documentation engine.
- mustache - mustache templates.
- ss/statemachine - Implements jQuery.Controller as a fininte-state-machine
- ss/router - The Sherpa routing system for jQuery.Controller
Steal clean uses JS Beautifier to clean your code and JSLint to check it for trouble spots like global or unused variables.
Cleaning a Single Script
To clean a single script, you can write:
js steal/cleanjs path/to/my/script.js
It will replace the script with a beautified script. If you want to also add JSLint (feelings beware), run it with:
js steal/cleanjs path/to/my/script.js -jslint true
Cleaning a StealJS app
If you used the generator to build your app, you can clean myapp's scripts with:
js myapp/scripts/clean.js
Add JSLint with:
js myapp/scripts/clean.js -jslint trueLogging
Finally, a small but nice feature of StealJS is that you can leave log messages without worrying that they show up in your production build. For example, steal.build will remove the following from the production build.
steal.dev.log("Something has happened"); //***
*** If you want to see this work, change to development mode and open Firebug.
ConclusionWe built StealJS to provide a single solution to many of the script management problems we faced with our client work. I hope it helps you in the same way it has helped us - turning around higher quality apps faster.
In the next two weeks, we plan to release a production StealJS. This will be followed by months of adding new tools, resources, and documentation.
In the future, we hope to work with other projects like LabJS, CommonJS, and RequireJS, to offer a 'standard' solution to the problems addressed by StealJS.
JavaScriptMVC Features
I spent a lot of time the last few weeks arguing why jQuery needs the Enterprise, and why it needs JavaScriptMVC (part 2). But, I should have been explaining why YOU need JavaScriptMVC. So I put together a list of what JavaScriptMVC provides.
The JavaScriptMVC Framework is feature rich. It does everything you need in between jQuery and your project (with the exception of packaged UI widgets). The following is a rough list of the features of the framework's major components followed by the features of the project as a whole:
Steal- an independent code manager
Dependency Management- Load JavaScript, CSS, Less, CoffeeScript, and a variety of client-side templates.
- Load individual files only once.
- Can load relative to the current file.
- Can load from other domains.
- Works with any application, even those not using the dependency management solution.
- Configurable compressors (defaults to google closure).
- Compresses Less and CoffeeScript into a production build.
- Pre-processes, compresses and packages a variety of client-side templates.
- Expandable architecture makes it easy to add other resources.
- Can conditionally remove chunks of code from production build.
- Build standalone jQuery plugins.
- Log messages, but they will be removed in production build.
- Generate an application skeleton..
- Very easy to create your own generators.
- Download and install plugins from SVN or GIT repositories.
- Installs dependencies.
- Runs install scripts.
- We maintain an official list of good plugins.
- Runs http://jsbeautifier.org/ on your project’s code
- Runs JSLint on your project’s code
- an independent web testing framework
Comprehensive Functional Testing- Test clicking, typing, moving the mouse, and drag drop.
- Follow the user between pages
- High fidelity event playback
- Multi-browser and operating system support.
- Automated and interpretable with Continuous Integration solutions
- Email results to gmail users plugin.
- Write and debug tests with only the browser.
- Simple, chain-able api that parallels jQuery.
- Upcoming ‘recorder’ app.
- a low to mid-level jQuery development toolset
Best Practices- Encourages logically separated, deterministic code
- Service / Domain layer (Model)
- Uniform client-side template interface supports jq-tmpl, EJS, JAML, Micro, Mustache (View)
- Efficient compareDocumentPosition
- Cookies*
- Delegate with the open child selector.
- Set and animate innerWidth, innerHeight, outerWidth, outerHeight.
- Quickly get multiple current css properties on an element
- Convert form data into nested JavaScript objects.
- String helpers (including a working regexp split)
- Vector math
- JSON utilities+
- A simple, powerful, lightweight class system.
- Default events enable powerful Event Oriented Architectures.
- Bind to destroyed event for proper widget cleanup.
- Delegatable, highly customizable drag-drop events
- Hashchange event for browser history*
- Delegatable, configurable, hover events
- Normalized, cross-browser resize events
- Auto-magic cleanup (unbind, undelegate, unsubscribe)
- Organized methods and events
- Shared methods and properties
- Namespaces
- Automatically extendable
- Remove plugins without removing element
- Object Oriented
- an independent JavaScript documentation application
Feature Rich- Inline demos with source and HTML panels
- Taggable documentation
- Rapid, auto-suggest search
- Savable favorites
- Test results pages
- Disqus comments (coming soon)
- Can document any page’s JavaScript with no extra work
- Extends JSDoc syntax
- Corrects misspellings of directives (ie @codend instead of @codeend)
- Adds undocumented JavaScript functionality because it understands JavaScript.
- Customizable, flexible relationships
- JavaScript objects can add documentation across files
- an integrated collection of best practices for developing jQuery applications
Ease of Development- Everything you should be doing requires no extra work. When you create an application, it's ready to test, document, compress, clean, and share.
- Provides a standard, modular, file structure to build everything from the smallest plugin to the largest application.
- Almost everything is extremely well documented, with code examples, demos, and write-ups at JupiterJS.com. With the 3.0 release, everything will be documented.
- We are here to help. I don't think there is an un-answered question on our forum. I don't think a question has been left un-answered for more than a day.
- Every component is tested and developed independently but also combined into an automated nightly test.
- When we make fixes, it's extremely easy to upgrade JavaScriptMVC.
- JavaScriptMVC apps are lightweight. You only use only what you need, but combined and compressed, the MVC parts and their dependencies are only 15kb (compared to jQuery's 70kb).
- We've taken considerable care to fine tune the performance of nearly every part of JavaScriptMVC. It's techniques are 'fast-by-default'.
- Everything works standalone. You can use controller, steal, FuncUnit, the compare plugin, everything, by itself. If your app grows to need other parts, we've got you covered.
- JavaScriptMVC has been solving the challenges of enterprise jQuery development for years. (It was the first library to support comprehensive event delegation!) We have continually refined JavaScriptMVC's API and features to make it as easy as possible learn and use.
Hopefully at least something in this list interests you! If not, well ... I'm not interested in what you are doing.
To be sure, JavaScriptMVC has a TON of features. Often people interpret this as 'too enterprisey'. But, a lot of care has gone into making it as easy to use each part as possible. We want you to fall into fall into the pit of success. When you need those features, they are there.
Finally, while possible to assemble your own framework and build great things, it will undoubtedly be:
- More difficult to assemble.
- Less likely to interoperate (there's no extra work to document, clean, test, and build your app with JavaScriptMVC).
- More error prone.
- Harder to teach / get support.
- Larger (repeat work between stand-alone components)
So PLEASE take a look at JavaScriptMVC and even a better look at its beta 3.0 release. Your spouse / girlfriend / pet will appreciate all the free time it gives you.
jQuery's Object Literal Coding Conventions
jQuery has internal coding conventions. It uses tabs over spaces. It uses lots of white paces and you can always find a {} around if/else statements. I'm adopting these conventions for JavaScriptMVC. JavaScriptMVC had notoriously flexible (ie bad) coding conventions. We were more concerned with adding features, tests, etc than making our code look nice. But, for the 3.0 release, the features have stabilized. We're paying more attention to things like documentation and even coding conventions.
So, I spent a few hours today making JavaScriptMVC code look like jQuery code with a few simple regular expressions. My goal was to make our Object literals look like:
httpSuccess: function( xhr ) {
One nice feature you may not know is that you can search the jQuery source for a method easily by searching for METHOD:. I like that. So, I used a few regular expressions to convert our varied object literal methods to jQuery style object literal methods. Here's what they do in order you should run them:
//Converts method : function -> method: function
RegExp =/(\w+)\s*:\s*function/
Replace ="$1: function"
//Converts : function(f -> : function( f
RegExp =/: function\(([^ \)])/
Replace =": function( $1"
//Converts : function( f){ -> : function( f ) {
RegExp =/: function\(([^\)]*)([^ ])\)\s*\{/
Replace =": function($1$2 ) {"
//Converts : function(){ -> : function() {
RegExp =/: function\(\)\s*\{/
Replace =": function() {"
I'm positive there's an easier way to do this, but this might get you started cleaning up your own code. Maybe someday we'll roll this into JavaScriptMVC.
Why jQuery Needs JavaScriptMVC Part 2
After writing my previous article on Why jQuery Needs JavaScript, I feel like I didn't communicate why JavaScriptMVC is important for jQuery developers. Here's a much more succinct way of saying it.
JavaScriptMVC makes doing everything you should be doing as easy as possible
Here's some of the things you should be doing:
- Testing (especially automatic and functional testing)
- Documenting
- Breaking up code into logically organized files
- Compressing and concatenating your JavaScript files
- Using and organizing client side templates
- Making plugins that clean themselves up are internally organized, and extendable.
- Error reporting
All of these things are hard or impossible to do right with jQuery alone.
You can add your own automated testing library - Selenium or qUnit, qUnit isn't automated. Selenium is hard to write tests for.
You can add your own documentation engine - JSDoc, but make sure you keep track of every file!
You can add your own way of loading and compressing scripts - RequireJS.
You can use other client side template libraries - jquery-tmpl, but you won't be able to compress them into your build or put them in external files as easily.
You can be careful to structure your jQuery plugins so they can be easily removed from an element, remove all event handlers, and provide some mechanism for extending or overwriting your plugin.
You can devise your own way of doing error reporting.
Or
You can download JavaScriptMVC and run:
js steal/generate/app APPNAME
and get all of these things for free.
This is why jQuery needs JavaScriptMVC - to make it easy to do the things you should have been doing in the first place.
We've spent almost 3 years refining the same feature set to make crazy easy do these things. If this doesn't make sense to you, please read why JavaScriptMVC is not too Enterprisey.

