31 July 2008

A Bugfix for Several Ext Datefield and Timefield Problems

Been trying to use a custom datetime format (e.g., "g:i:s A", etc.) with your xtype "datefield" and "timefield" components, but not having any luck? Turns out there were some bugs with the datetime scripts in the final release of Ext 2.1.

There's quite a few explained here at the official fix -- the most notable one for me was the fact that no matter how many times I tried to apply a custom format to my timefields (I needed seconds to show up, as well), the seconds part of the formatting was still being chopped off. Even more frustrating was the fact that any time I tried to programatically enter values with seconds into the fields, the values were being lost completely -- not just the seconds part of the time was truncated, but the entire value.

But, after a lot of searching, I found where there's been a fix created by the dev team -- I wish they had a central place for stuff like this, however. Having to search through the forums for hours is kind of silly. :P

And in case you were having trouble like me when you try to copy the code form the official fix into your source files (I couldn't seem to copy the formatting, newlines and tabs and et cetera) -- if you're using Firefox to copy, use IE temporarily. I don't know why, but it works better... just this once.

30 July 2008

Shortest cross-browser cookie-grabbing function in the world?

function getCookie(cookieName) {
return unescape(document.cookie.match(new RegExp(cookieName + "=([^;]+)"))[1]);
};

So, whatta you think?

29 July 2008

Ext Form Fields and the hidden "enableKeyEvents" parameter

Been coding your ExtJS form fields, but wondering why you're unable to capture key events? Keep adding "keypress" and "specialkey" event listeners only to find them not fire? Wondering just where the hell the "enableKeyEvents" parameter is supposed to go?

Well, I was too. Turns out in all TextFields, there's a hidden "enableKeyEvents" param that defaults to false -- unless you set it explicitly to true, your key events won't be captured.

Yeah, apparently it made it to the last release of Ext but wasn't added to the documentation -- I only found out through the forum post here.

Oh, and in case you're wondering what the hell the difference between "keydown" and "keypress" was, John Resig has a great write-up about it here.

28 July 2008

The IE6 PNG Transparency Fix

Well, I can confirm that the IE 6/5.5 PNG Transparency Fix works fine on a Domino server (at least one running on Windows Server).  I was a little bit worried about it serving up .htc files as MIME type "text/x-component", but it seems to serve them up just fine.

I've known about this fix for a long time, but have just kinda put up with the way PNG's looked on IE6 up until now (in case you didn't know, IE6 wasn't built with PNG transparency support, and Microsoft has never released a fix for it).  However, I've recently started to use ExtJS trees with custom PNG's, and it just looks... tacky, to say the least, on Internet Explorer 6 (which I'm still developing on).

There's definitely some performance slowdowns with the PNG fix -- it seems to be doing a little bit of processing for each individual image you set it to work on, and if you've got a lot, you really notice it.

So, if you have to use this fix, make sure and use the author's advice and give each image you need to use this on its own custom class, and then apply the "behavior" css param to just that class.

25 July 2008

Yahoo pulls an MSN Music (only faster)

Yahoo pulls an MSN Music (only faster) | Bit Player | Los Angeles Times
This afternoon, Yahoo alerted customers of its erstwhile downloadable music store that it would no longer provide support after Sept. 30 (download the cheerful e-mail here). The upshot: starting Oct. 1, said customers won't be able to revive frozen tracks or move working ones onto new hard drives or computers, because Yahoo won't be providing any more keys to the songs' DRM wrappers. But hey, they can always buy MP3 versions from Yahoo's new partner Rhapsody!
When will they ever learn?

Or are they learning now?

Basically, a bunch of people (well, some, at least) bought music through Yahoo's "legitimate" music purchasing service, and now all the music they bought is pretty useless. I feel really bad for them -- these people probably tried to go the legitimate route to "try and do the right thing," and now they're being screwed because the company that "allowed" them to listen to the music they legally bought is closing its doors.

Meanwhile, all those people who have been downloading music for free from Bittorrent or the P2P networks over the years aren't having any issues.

DRM is bad, people, umm'kay?

24 July 2008

MPD Enforcer 2.0

MPD Enforcer 2.0

This is beautiful. An anonymous blogger (probably someone secretly on the police force in Memphis) using the internet to fight corruption.

What's special about it? Well, he seems to be winning.

23 July 2008

Great Smog of 1952 - Wikipedia

Picture of Nelson's Column during the Great Smog of 1952
Great Smog of 1952 - Wikipedia, the free encyclopedia

Now I know where William Gibson got the idea of the smog-choked London in The Difference Engine.

15 July 2008

Coolite Toolkit for ASP.NET Web Controls

Coolite Toolkit for ASP.NET Web Controls

Just found this recently -- apparently it's a rather well-made plug-in for Visual Studio that'll help integrate ExtJS into your ASP web applications. I'm not too fond of server-side-constructed JS (always preferred to keep my JS client-side), but hell -- I never thought I'd start using frameworks like ExtJS, either.

I'll keep taking a look and post back eventually with some more info about it.

Also in the news:

IBM.com: Build Ajax applications with Ext JS

Great to see the attention! Always thought about submitting an article to IBM to be posted about this exact thing, but I spend so much time developing, I hardly have any time to write about it!

03 July 2008

Court Ruling Will Expose Viewing Habits of YouTube Users - EFF

Court Ruling Will Expose Viewing Habits of YouTube Users | Electronic Frontier Foundation

Well, apparently the federal Video Privacy Protection Act (VPPA) doesn't apply to the internet yet. Great. You see -- sometimes just a little bit more regulation would be useful in situations like this.

In case you didn't know, the VPPA is a law that protects you from having your view habits exposed -- no matter who wants them. However -- and this is another problem -- the law uses archaic terms like "video tape" instead of just "film" (which probably would've been enough), so Viacom has apparently successfully argued that your rights in keeping your view habits private doesn't extend to Youtube. Wonderful.

Edit: Actually, as the wording of the law goes, it applies to "prerecorded video cassette tapes or similar audio visual materials." So, basically, the court's just ignoring the law. WTF?

02 July 2008

...and back to Firefox 2.0.

No offense, but I just can't use 3.0 anymore for development. -_-'

If it wasn't for the fact that my Greasemonkey scripts only selectively work now (I've yet to figure out why some of them work and some of them don't -- and these are simple, simple scripts)...

Or that my favorite extension, TabMixPlus hasn't been fully updated yet and is still just a development copy and could be causing problems...

It's that Firebug doesn't work correctly (the 3.0 version is still in beta, and is sometimes erratic as hell when I'm developing) -- this is the deal breaker. I need Firebug for web development, and if it doesn't work correctly, that's a problem. If it's not the fact that my watch variables I've set are constantly disappearing, it's the fact that when I go to another tab briefly and come back to the my development tab, Firebug ceases to be responsive.

So, for now, I've moved back to Firefox 2.0 -- I haven't uninstalled 3.0, though. I'm actually running 2.0 from a portable copy (via PortableApps.com). I'll keep updating 3.0 in the hopes that these issues are slowly fixed, and then move back over to it -- I mean, I do like the new version, trust me. If it's not the "AWESOME BAR" it's the new extension and plugin controls. And if it's not that, it's the speed and memory usage -- it is a lot faster than 2.0.

But, anyway -- Firefox 2.0 portable. Now, the problem with running it from a portable copy is you can't use your old profile (if you've saved it via FEBE or something). Firefox 2.0 portable doesn't support the "-profilemanager" flag to load the profile manager -- for all I know, it can't do it at all because of the way Firefox Portable was designed. So, the question is: how to get my old saved Firefox 2.0 profile (via FEBE .fbu file) into my copy of Firefox 2.0 portable so that I can use it?

Easy -- an FEBE .fbu file is just an archive; unpack it with your favorite unpacker. (These instructions are for Windows, by the way.)

Now, in your Firefox Portable folder, navigate to "/Data/profile". Save everything in this folder as an archive first, just to be sure -- delete everything in this folder afterwards.

Finally, copy everything in the unpacked FEBE .fbu file to the "/Data/profile" folder in your Firefox portable folder.

Then, restart and you're done! Now, happily develop away.