Notas de un Peregrino Articulos varios sobre la web, mozilla y firebug

11Aug/10Off

Jetpack and Code Portability

Yesterday I was tinkering with my Multitouch Simulator Jetpack wondering if I could take the code out of it and make it a standalone library. I expected some pain extracting the code and making it work on a webpage as it's a somewhat different environment... I couldn't be more wrong.

From the beginning I wanted to code the extension's modules in a way that would allow me to take them away from the Jetpack extension. But that was it, just a wish, I didn't write each single line thinking on portability. Hopefully things ended up better than I expected.
When it was time to take the code out, I just copied the events dispatcher and files parser modules, performed 2 or 3 global replaces because of conflicting names and... job done! You can see the results in here with Firefox Minefield.

I think this is a great feature, not only meaning that you can take your code out from a Jetpack extension, but also the possibility of putting in a Jetpack previously coded "for the web" JavaScript libraries!

If you know me a little,  you would guess that I couldn't leave that possibility without a try... And you would be quite right :D So I took some little bit of code that Marcio Galli showed me on twitter, a QR-Code maker done entirely in Canvas+Javascript (see here), and decided to stuff it in a Jetpack.
Again, a very effort-less thing with great results. I ported that code to Jetpack in a blink, and created a qr-code library for jetpack, and in 5 more minutes, I had this Selection-To-QRcode extension running.

So, in brief, these are some exciting new possibilities to expand and remix the web and your experience with it!

Filed under: English, Jetpack Comments Off
Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.