Text Area Resizer - A Prototype Port

Sam Burney | Fri, 11/14/2008 - 04:57 | 1100 comments

For whatever reason, when I first delved into JavaScript and AJAX a few years ago I picked Prototype as my helper library.

Since then I've written a lot of code requiring Prototype, so even though the idea of switching to something like jQuery has been tempting, the fact that I would either have to rewrite a whole bunch of code or include TWO 100kB+ JavaScript libraries has kept me away.

One of my main on-going projects required a resizable text area, and I knew that Drupal (This blog is a Drupal site) had just the right thing for it.  The problem is that Drupal's TextAreaResizer script is written for jQuery and it seemed rather stupid to include the whole of jQuery just to put a 'grippie' on the bottom of a textarea.  No other Prototype ports of this exist (At least that I could find) so I decided to give doing it myself a go.

Prototype Port of textarearesizer.js

Features:

  • Simple, neat and unobtrusive textarea and iframe resizing
  • Written for use with Prototype
  • Tested in Firefox 3.0.3 and Internet Explorer 7
  • Ability to specify a callback function after you have finished dragging

Links:

Updates:

  • Chrome fix: Thanks to Scott Falkingham

sifnt Modal

Sam Burney | Fri, 10/10/2008 - 15:40 | 246 comments

Well...it really has been a long time since my last blog entry.  Actually if anything this is my first real blog entry...

I'm a bit of an amatuer web 'coder' and generally, in the interests of learning as much as possible, try to code my own solutions for things rather than use someone elses.

I decided my far-from-finished BillShare Clone project needed a nice pretty modal-style popup box, and although I have written a similar thing before I wasn't entirely happy with it so decided to give someone else's a go.  I came across ModalBox, and it seemed to tick all the boxes - pretty, easy to use, lightweight; I started using it.

Although it worked very well, it failed at one crucial feature, the ability to have a modal appear on top of another Modal.  Frustrated, but inspired by it's design, I 'borrowed' some of it's elements (And all of it's CSS) and wrote my own from scratch.

sifnt Modal

Features:

  • AJAH (Asyncronous Javascript And HTML) or 'Offline' filled Modals
  • Multi-level Modal support
  • Tested in Firefox 2-3.1, Safari 3 and Internet Explorer 7

Links: