Jaml updates
January 29, 2010 by Ed Spencer · Leave a Comment
Jaml seems to have been getting a lot of interest lately. Here are a few quick updates on what’s been going on:
- Tom Robinson added support for CommonJS
- Eneko Alonso ported the project to MooTools, creating mooml
- Carl Furrow wrote up a nice comparison on Jaml and EJS
- Jaml is now a rendering option in JavaScriptMVC, along with John Resig’s microtemplates
- Andrew Dupont committed a series of patches such as improving Jaml’s efficiency and optionally removing the ‘with’ and ‘eval’ magic
In addition Jaml was recently picked up by Ajaxian, and a couple of people have written up blog posts about Jaml in languages other than English, which is great to see.
Jaml is up on Github and has a number of forks already. If you like the library and have something to add, fork away and send me a pull request!
If you’ve never seen Jaml before or have forgotten what it does, it turns this:
div(
h1("Some title"),
p("Some exciting paragraph text"),
br(),
ul(
li("First item"),
li("Second item"),
li("Third item")
)
);
Into this:
<div>
<h1>Some title</h1>
<p>Some exciting paragraph text</p>
<br />
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ul>
</div>
Ext JS is looking for a QA rockstar
January 19, 2010 by Ed Spencer · Leave a Comment
This has been cross-posted from our Open Discussion Forum.
As part of our ambition of creating the world’s best JavaScript framework, we’re looking to hire a special somebody to help maintain the high quality of our components.
While we have one eye on implementing new features and improving Ext JS’s performance, the other is on making sure what we already have still works well.
This is a difficult job and we need someone smart, focused and well versed in Ext JS. Somebody who will:
* Use our existing systems to test components as new builds of the library are landed
* Maintain a strong presence in the forums and be the first to know of any reported issues
* Respond to bug tickets such as rendering issues and broken functionality
* Totally own the Quality Assurance of Ext JS – we want your ideas and your initiative as well as your expertise with Ext
* Liaise with the core team on a daily basis
This is a full-time position, though allowances can be made for the right person. If you think you would enjoy working with Ext JS, and have what it takes to help us keep Ext at the forefront of our field, drop me a private message with the following information:
* Your name
* Email address
* Location (city, country, timezone)
* All experience with Ext JS
* Bonus points for links to open source software
2010: The year Ext JS takes over
January 13, 2010 by Ed Spencer · 18 Comments
On January 1st 2010 I officially joined Ext JS to take over the role of lead developer. After living and breathing Ext for the last 3 years I am delighted to have joined the company itself. Ext JS has lead the way in developing rich client side applications since the very first release; this is a tradition we will continue and build upon.
2010 is going to be an extremely exciting year for Ext JS. A new focus is being placed on helping developers create their applications much more quickly, with the help of advanced creation tools and a standardised application architecture right out of the box.
We will continue the performance improvements started in 3.1 to make sure that Ext applications really fly. Ext JS 3.2 will be the fastest, most stable version ever released.
2010 is also the year that Ext JS becomes much easier to learn. With a completely reinvented learning section, Ext will no longer take months to learn and understand – even our API documentation will get a facelift.
The upcoming Marketplace will be the perfect venue to find and share new, high quality components created by our awesome developer community. Think of the Marketplace as the App Store for Ext JS – full of great offerings that are easy to drop in to any application.
Calling all able-minded Ext JS developers
Ext JS is already the best JavaScript library in the world for creating rich, desktop-quality applications on the web. If you want to help us make it even better, I want to hear from you.
As well as creating new components and improving our application support, we need people to help us maintain the quality and stability of what we already have. If you’re intimate with Ext and think you have what it takes to get involved, drop me a PM and introduce yourself.
OSX Screensaver emulation with Canvas: That’s Bean
December 6, 2009 by Ed Spencer · 3 Comments
OS X has a pretty little screensaver which takes a bunch of images and ‘drops’ them, spinning, onto the screen. Think of it like scattering photographs onto a table, one at a time.
Naturally, there’s a desperate need for a JavaScript/Canvas port of this functionality, resulting in the following:
I had to limit the video capture framerate a bit so the video makes it look less smooth than it actually is. Check it out running in your own browser here.
For obvious reasons I have called the code behind this Bean, and it’s all available up on Github.
For the curious, here’s a little explanation about how it works. Bean starts off with a blank canvas and a list of image urls, which it preloads before getting started. It then drops one image at a time, rotating it as it goes. Each falling image is called a Plunger, because it plunges.
Each Plunger gets a random position and rotation to end up in, and takes care of drawing itself to the canvas on each frame by calculating its current size and rotation as it falls away from you.
Drawing each Plunger image on every frame quickly starts to kill the CPU, so we take a frame snapshot every time a Plunger has finished its descent. This just entails drawing the completed Plunges first and then using Canvas’ getImageData API to grab the pixel data for the image.
This gives us a snapshot of all of the fallen Plungers, meaning we can just draw a single background image and the currently falling Plunger on each frame. This approach ensures the performance remains constant, as we are only ever drawing a maximum of 2 images per frame. Each time a Plunger finishes its descent a new snapshot is taken.
Bean attempts to draw a new frame roughly 25 times per second and modern browsers seem to handle this pretty well. Safari pulls around 60% of one core on my MacBook Pro, with Firefox somewhat less performant. Needless to say, I didn’t even bother trying to make this work with IE.
Here’s the code to set the Bean in motion. This is using a few bundled APOD images:
var bean = new Bean({
imageUrls: [
'images/DoubleCluster_cs_fleming.jpg',
'images/NGC660Hagar0_c900.jpg',
'images/filaments_iac.jpg',
'images/m78wide_tvdavis900.jpg',
'images/sunearthpanel_sts129.jpg',
'images/NGC253_SSRO_900.jpg',
'images/Ophcloud_spitzer_c800.jpg'
],
canvasId : 'main',
fillBody : true
});
bean.onReady(function(bean) {
bean.start();
});
Ext.ux.Exporter – export any Grid to Excel or CSV
November 24, 2009 by Ed Spencer · 36 Comments
Sometimes we want to print things, like grids or trees. The Ext JS printing plugin is pretty good for that. But what if we want to export them instead? Enter Ext.ux.Exporter.
Ext.ux.Exporter allows any store-based component (such as grids) to be exported, locally, to Excel or any other format. It does not require any server side programming – the export document is generated on the fly, entirely in JavaScript.
The extension serves as a base for exporting any kind of data, but comes bundled with a .xls export formatter suitable for exporting any Grid straight to Excel. Here’s how to do that:
var grid = new Ext.grid.GridPanel({
store: someStore,
tbar : [
{
xtype: 'exportbutton',
store: someStore
}
],
//your normal grid config goes here
});
Clicking the Download button in the top toolbar iterates over the data in the store and creates an Excel file locally, before Base64 encoding it and redirecting the browser via a data url. If you have Excel or a similar program installed your browser should ask you to save the file or open it with Excel.
I put together a quick example of the plugin in action inside the repository, just clone or download the code and drag the examples/index.html file into your browser to run it.
The Exporter will work with any store or store-based component. It also allows export to any format – for example CSV or PDF. Although the Excel Formatter is probably the most useful, implementing a CSV or other Formatter should be trivial – check out the Excel Formatter example in the ExcelFormatter directory.