?

Log in

No account? Create an account
Second javascript app - brad's life [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Second javascript app [Nov. 6th, 2005|07:54 pm]
Brad Fitzpatrick
[Tags|, , ]

My second-ish big JavaScript app is live on the site. Go to manage a picture and click on "thumbnail focus".

I have a cooler demo coming, though, based on stuff I learned on this project.
LinkReply

Comments:
[User Picture]From: supersat
2005-11-07 04:05 am (UTC)
Very cool, but totally broken in Opera. It always positions the selection rectangle and center-of-focus mark too high. Looks nice in Firefox, though!
(Reply) (Thread)
[User Picture]From: brad
2005-11-07 04:10 am (UTC)
Pity. Because I didn't really do much at all to make it work in Safari, IE, and Firefox.

The biggest thing was an IE-specific img attribute to disable the image toolbar.
(Reply) (Parent) (Thread)
[User Picture]From: brad
2005-11-07 06:00 am (UTC)
I see what's not working in Opera. Probably fixable. I've asked Randy, who maintains the dom.js library I'm using, to fix the coordinate system to work in Opera (8.5). Or maybe I can find it on the web....

(at least Opera is easier to debug than Safari... damn I hate debugging Safari.)
(Reply) (Parent) (Thread)
[User Picture]From: burr86
2005-11-07 04:21 am (UTC)
That is really cool! I totally spent a good 10 minutes playing around with it. :)

One thing I noticed as I was trying to figure out what the five images on the bottom were: the tooltip for the first thumbnail says "Regular thumbnail: scaled, but not uncropped". Either the "not" or the "un" should go, right?
(Reply) (Thread)
[User Picture]From: brad
2005-11-07 04:35 am (UTC)
Whoops, yup.
(Reply) (Parent) (Thread)
From: evan
2005-11-07 04:53 am (UTC)
I think idealisms implemented something like this last year but he said he filed it in a bug tracker and never heard about it again.
(Reply) (Thread)
[User Picture]From: brad
2005-11-07 05:02 am (UTC)
The selection part was dead simple, done in about 10 minutes.

The harder part, and the fun part, was the thumbnail previews. Did idealisms' patch do that? That'd be sad, if so. In any case, it was a good learning experience for me. And overall it only took last night and some of today, so wasn't a ton of time wasted.
(Reply) (Parent) (Thread)
[User Picture]From: idealisms
2005-11-07 07:12 am (UTC)
No, it didn't do the thumbnail previews. However, the selection was more mac style (the non-selected region is shaded out) and works in IE/Firefox/Safari and kind of worked in Opera 8.5 (no transparency). Here's a copy of the patch.

I tried to look it up on bugzilla, but I can't seem to access it.
(Reply) (Parent) (Thread)
[User Picture]From: brad
2005-11-07 07:26 am (UTC)
Bugzilla was on a semi-public (~50 LJ users) machine that got owned, so we halted it while we image its disk and reinstall/reharden the OS, partitioning off the potentially malicious/careless users.

Just checked out your patch...

-- the shading's nice!
-- unselectable='on': whoa. didn't know of that.
-- Point class: durrr. it's so "Welcome to OO!" but this is a perfect use case for one. i should add one.

I'll be merging in a lot of that with the stuff I did.

Btw, what ever motivated this patch? Do you use fotobilder?
(Reply) (Parent) (Thread)
[User Picture]From: idealisms
2005-11-07 08:01 am (UTC)
unselectable is an IE only tag. Mozilla has a similar tag, -moz-user-select, but they're a little different (I think the Mozilla tag is inherited by child nodes whereas 'unselectable' needs to be put on all nodes you want to deactivate text selection).

This was motivated by me complaining about that page and Evan saying, "hey, why don't you submit a patch?"
(Reply) (Parent) (Thread)
[User Picture]From: brad
2005-11-07 09:53 am (UTC)
The cool thing about the old page was that it worked without Javascript! :-)

But I gave up on that mission several years ago. It doesn't matter nowadays with reasonably consistent javascript/DOM implementations.
(Reply) (Parent) (Thread)