All posts in JavaScript

It’s been a long time since I released an update to the JavaScript Image Cropper UI (for reference v1.2.0 was released on 30th Oct 2006!).

However it is still going strong and a couple of things prompted me to release this update to bring it to v1.2.1.

The first thing was Tom Hirashima (sorry Tom, wasn’t sure if you have a site you want me to link to) sent me an email last week with an update to the code to allow it to work with the latest versions of Prototype & script.aculo.us out of the box (1.6.1.0 & 1.8.2 respectively). Although the last time I tried the cropper with the latest versions of them both it worked fine, you just had to change the bundles that script.aculo.us included, Tom has made some further changes. This is a good thing as for the past couple of years I’ve pretty much been out of the prototype & script.aculo.us loop having moved to MooTools and now jQuery (which I hated at first, but that’s another story).

The second thing was that the cropper was mentioned (and my how old does this site design look to me now) in the latest (and as usual excellent) Railscast, Cropping Images.

As a part of integrating Tom’s changes I decided to tackle a load of bugs from the bug list to try and reduce the list so I can keep on top of it better going forward (a long list of open bugs is never conducive to getting any of them fixed).
Continue reading this entry »

Having spent most of Saturday trying to get files to upload from a Flex application to a Rails backend, fighting against both Flex and Rails all the way, I thought I’d collect together some of the things that have helped me work through this in the hope that others don’t have to spend quite as long battling through this. Note however that these are not necessarily best pratices, more a collection of tips that helped me in my situation, there are probably better ways to do some or all of the things that I’ll be writing about – and if you know of any improvements/alternatives I’d love to hear about them.
Continue reading this entry »

I’ve just read this interesting post on how to speed up your web application with an automated system for working with browsers cache for your assets (CSS, JavaScript, images etc.).

Previously I’ve used query strings parameters within asset requests so that they act as a ‘cache bust’ parameter, these have usually been the source control revision number and is built into the release process. But I’ve never taken the step of force an expiry date on content that can be cached and the solution in the post is a lot more fine grained than my previous solutions. Something to consider for the future.

I’ve had a list of changes and updates to apply to the JavaScript Image Cropper for quite a while now and I have been thinking of these in a lot more detail recently. There are lots of changes that I plan to make that would bring the cropper up to V2 level and ensure that it remains a viable cropping solution for the future.
Continue reading this entry »

Every so often, in pretty much any field, something comes out or is released that I don’t realise I’ve been missing until it’s pointed out to me. Today it is a little proof of concept for toggling multiple check boxes by click-hold-drag. This is something that I’ve become familiar and comfortable with in desktop programs, but I never noticed it was missing from web browsers. Now this script has pointed out that it’s not there – I miss it.

Ok, so before you get too excited it’s not really a fully fledged version fantastic Firebug Firefox plugin, but the lite version does go some ways to easing your cross browser development.

If you’re not aware what Firebug is, the official site quote is:

Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

But that doesn’t explain just how excellent Firebug is, it is by far and away not only the most complete debugging plugin I have found for any browser, but it also seems to be one of the most complete and professionally executed Firefox plugins around.
Continue reading this entry »

I’m currently in the middle of writing a reusable little JavaScript utility, which I’ll probably release when it’s finished, for one of my many projects and I wanted to employ unit testing as part of the development process, as I believe in the benefits of it quite strongly.

However my previous experience with unit testing JavaScript haven’t been the most pleasent, I have tried the most common nUnit variations for JS, the best of which was JSUnit. But I always found this a little cumbersome and difficult to use, however I had recently read about the unit testing available with script.aculo.us and although the only documentation I could find was the PDF available at mir.aculo.us I thought I’d give it a go.
Continue reading this entry »

Screenshot of JavaScript struct dump output I came across this funky little script earlier today which allows you to dump variables of any data type in JavaScript and presents the results in exactly the same format as the default output of a <cfdump var="#myVar#" /> in Coldfusion.

I really like the completeness of this script, how it handles the node elements and the cross browser support. I’ve not tried using it in development yet and I doubt it would replace my console.log() calls in Firefox when using Firebug, as that offers so much more, but for the poorer members of the web browser family (poor little IE) I can definitely see it coming in handy.

I’ve finally released the latest version of the JavaScript Image Cropper UI which has been updated to version 1.2.0.

This adds quite a few bugs fixes, feature additions (the much requested ability to set maximum dimensions) and speed improvements and general streamlining.

NOTE: One really important change to note is that the cropper no longer has the default behaviour of automatically setting a ratio when both min width & height passed, the ratioDimensions must be now passed when this functionality is required.
Continue reading this entry »

The list I’m referring to is that of fantastic JavaScript frameworks. My list now includes Prototype (and the fact that I didn’t need to look up the URL just shows how many times I’ve recommended Prototoype), Dojo Toolkit, script.aculo.us and now MooTools.

I’ve not had the time to play around with MooTools yet, but simply looking at the help page you can’t deny that it looks sweet.
Continue reading this entry »