odyniec.net

I’m Alive, Honestly

July 20th, 2008

It’s been a while (two months, to be precise) since my last post, but I’m not dead, and neither is my blog. I just got somewhat overloaded with work, and had little spare time for my own projects — thus, little to blog about.

Now that most of my large work projects are completed, I’ve finally had some time to update the article on multiple select fields and work on a few additions to the imgAreaSelect plugin that were requested by people (expect a release soon).

ImgAreaSelect 0.4

May 20th, 2008

Here’s a new release of my imgAreaSelect jQuery plugin. I’ve fixed a few bugs and introduced two new features that have been asked for: the ability to enable/disable the plugin on demand, and to set the color and opacity of the unselected area.

Edit:
There were a few bugs in the 0.4 code (thanks to vivo for catching them quickly), so I’ve made a quick update and released version 0.4.1.

Edit #2:
This is definitely not my lucky day. It seems my quick update was in fact too quick, as the updated version turned out to be broken in IE. I fixed it (and TESTED this time) and made yet another release, so it’s version 0.4.2 now.

Multiple Select Fields

May 11th, 2008

I’ve just added a new web development related article on the subject of multiple select form fields. If the topic sounds boring, it probably is, as there’s not much to be excited about checkboxes and such, but I tried to make it at least a bit more attractive by introducing a colorful DHTML example.

The article is still a work in progress, as I intend to add some more information on a couple things (like pre-selecting options and limiting the number of choices), nonetheless I guess it’s mature enough to be brought into the daylight. I’d be glad to know what you think of it, so don’t hesitate to send me some feedback.

Stop. Hammertime!

April 16th, 2008

I’ve just upgraded my primary workstation — my old, overheating, and noisy as a vacuum cleaner Pentium D unit has been replaced by a new Core 2 Quad machine, which does not get hotter than room temperature and remains heavenly silent.

I assembled the new unit by myself, as with most of the machines that I’ve been using over the years, dating back to the prehistoric times of PC XT. However, it wasn’t until today, the high-tech era of quad-core CPUs, that I had to make use of this particular tool:

Yes, a hammer.

No matter how hard I tried, and how badly I cursed, I couldn’t install the damn heatsink on the motherboard — despite what the manual said, the “Push Pins” just wouldn’t get “firmly secured” in the holes. So I literally hammered them to the board. Apparently, I did it gently enough not to break anything, otherwise I wouldn’t be able to write this post on the new machine.

Now, I just need a new power supply to complete the upgrade. This means more assembling — I better get an axe, just in case.

ImgAreaSelect 0.3 Released

March 30th, 2008

I’ve finally had some spare time to update the imgAreaSelect jQuery plugin. A couple goodies that you people requested are now added, including the ability to pre-select an area on initialization, and dynamically change selection options.

All the usage examples have been updated to demonstrate a more bulletproof way of initializing the plugin. The initialization method is now called in the $(window).load() event handler instead of $(document).ready(), to prevent the plugin from being started before the image itself has finished loading — I know a few people encountered this problem. Thanks to Wojtek Zymonik for pointing it out.

I’ve also reworked the callback function example to incorporate real-time preview scaling (sounds neat, doesn’t it?).

IE8 vs. Buttons

March 24th, 2008

Remember the ridiculous implementation of the <button> element in IE6 and IE7? Well, I finally had my first hands-on experience with Internet Explorer 8 (beta 1 for developers), so I was able to check if they fixed it. I tried the new IE on a test page I made for the ieFixButtons jQuery plugin. And you know what? It seems the development team really got it right at last! In IE8 buttons do work as nature intended.

But, I also discovered that my website, the one you’re looking at right now, is slightly broken in the new IE. Specifically, the top navigation menu items are not displayed correctly. So far, I haven’t figured out how to fix it, and I wonder if it’s my fault, or if the beta version of IE8 is, well, too beta, and I should wait for the final version to come out. I will lazily assume the latter for the moment.

Musketeers!

March 17th, 2008

This is what I learned yesterday:

Do not watch The Three Musketeers while working on a use case diagram for your next project, or your diagram will end up like this:

En garde!

Drawn with Umbrello UML Modeller, by the way.

ImgAreaSelect 0.2

March 10th, 2008

Since many people (okay, actually just six people) requested a few additional features for the imgAreaSelect plugin, I’m releasing an updated version. The plugin now supports moving and resizing of the selection area, width/height limits, and fixed proportions.

I’ve also added a couple more usage examples.

ImgAreaSelect

February 24th, 2008

I’m releasing my second jQuery plugin today. It’s called imgAreaSelect, and it serves the exalted purpose of letting the user select a rectangular area within an image.

What good is selecting a rectangular area within an image, you may ask? Well, I originally used the code in a web gallery application — it allowed the user to select a part of a newly added image for cropping. So that’s one thing that it’s good for, but of course you can use it for any other wicked purpose that comes to your mind.

Buttons Back in Business

January 14th, 2008

Some time ago, Kevin Hale of Particletree described his rediscovery of the button element. I also made the same rediscovery once, and I had a brief moment of excitement when I realized how useful the button element can be for quickly putting together a nice web-based user interface.

Then came Internet Explorer and my dreams were crushed. The way buttons work in IE (including IE7) is a) standard-incompliant, b) insane, and c) useless. Here’s why:

What the standard says What IE is doing
If the button type is not specified, it defaults to submit. The default type is button.
When a button is used to submit a form, the contents of its value attribute is sent to the server. The inner text of the button is sent to the server.
If there is more than one submit button, only the value of the activated one is sent to the server. The inner text of all buttons is sent to the server.[1]
[1]

This was kind of fixed in IE7 — the other submit buttons are no longer sent to the server. However, it’s still the inner text that is transmitted, not the value.

From a practical point of view, this means that the value attribute is of no use, because it’s not being sent to the server when the form is submitted — instead, you’ll get whatever was placed between the <button> and </button> tags, including any HTML markup (this is just sick!). And, if you have multiple submit buttons in a form, you won’t be able to tell which one was clicked by the user, as they will be all sent to the server. Seriously, IE developers, what were you thinking?

Back then, I was left with two choices: either to forget buttons and keep using plain old inputs, or to fight the evil. And fight I did. Long story short, I wrote a piece of JavaScript (you know, the popular real-time browser bug-fixing technology) code which works around the irrational behavior of buttons in IE.

I’ve recently released the script as a jQuery plugin named ieFixButtons. Grab it if you want to use buttons the way they were supposed to.