|
|
“Apple, On Custom JavaScript Events” |
|||
| From: | Seth Dillingham | In Response To: | Top of Thread. |
| Date Posted: | Wednesday, July 4, 2007 1:45:35 PM | Replies: | 1 |
| Enclosures: | None. | ||
This morning when I checked my Gmail account, I read a message (from someone named "Filippelli Christophe") that said Apple seemed to be using my Custom JavaScript Events code on the iPhone page. (In case anyone misunderstands: this is a very good thing in my opinion.)
"Yeah right," I thought.
But it's true, at least at the moment. You can see it for yourself:
/global/scripts/lib/event_mixins.js”. Copy that path, and load it up in your browser. The irony is that my custom events code is based on Apple's own work.
Huh?
Well, in the early 90's, Apple pushed the Mac application developers to make their applications scriptable and recordable.
The way it worked was that a button click or menu selection (to name just two examples) in the application would cause the application to send an AppleEvent (the tech on which AppleScript was built) to itself. So it was like you had two applications in one: the one the user interacts with, and the "engine room" where all the real work was done, and the UI communicated with the engine room by sending AppleEvents.
Many well-written applications already “decoupled” the UI from the rest of the code anyway. If the application was also going to be scriptable, then also making it recordable (with the above approach) was at least a realistic consideration (though it was still a lot of work.)
My "Custom Events for JavaScript" article uses the word ‘decoupling’ in the title for exactly that reason: the intent is to allow you to decouple the UI of a web application from the data processing you do in JavaScript, and/or on the server side. It's not identical to Apple's recordability model, but it's inspired by it.
Blah blah blah... most people don't care about that stuff, I know.
Anyway, I told Rich about this and he said Apple owes me an iPhone. Hah.
“Dear Apple: my friend Rich Siegel — you've heard of him, right? — says you owe me an iPhone. Love, Seth”
(Of course, they don't actually owe me anything. I did release the code for free, after all...)
Rich had a funny response to the above (in the form of a faux letter back from Apple), but I'll leave it to him to post (or not). ;-)
I told Flip about it, too (hey, I was excited!), and he said he's going to tell his friends that he knows someone who made the iPhone possible. Hear that popping sound? That was my ego. ;-)
Update: forgot to mention that the custom events stuff is what landed me on the Prototype Core team in the first place... and they (the rest of the team) expect me to roll some form of the custom events code into Prototype itself. Have to do it soon, or Sam is going to send me a Howler...
There are no trackbacks.
|
TruerWords
is Seth Dillingham's personal web site. More than the sum of my parts. |