Many javascript libraries like MooTools, Dojo, ExtJS, YUI, and Qooxdoo have their source code organized in a structure that developers can use as a basis for organizing their own code. MooTools, YUI, and ExtJS have an online means of selecting the pieces of code needed and downloading a single script with all the selected code and required dependencies. This is great for optimizing the target library, but your code left not optimized: existing in separate files, uncompressed, and a polluter of the global namespace (if you care). This article describes one means for solving these issues.
Read the rest of this entry »
Tags: Javascript, Optimize, Organize
2 Comments »
While developing a website for a client, I was tasked with creating text that would fade in and out continuously. I figured that use case would be useful for many websites so I decided to create a class. It turns out the class is useful for cases where any html content has to be shown and hidden. The class is called Marquee.
I wrote several methods for controlling the Marquee class. Although I didn’t implement them for my current use case, I though they would be useful in the future. Methods included are
- load
- append
- start
- stop
- clear
- empty
- next
- previous
The class also accepts various options for configuring the Marquee and its messages. Last, I thought it would useful to monitor the different states of the Marquee so it allows several events to be observed. These are:
- start
- stop
- change
- before
- after
Tags: JavaScript Frameworks, Prototype
6 Comments »
There’s been quite a bit of talk about polluting the global namespace. It is certainly one of those things I try to be conscious of when I develop. I wanted a convenient means of creating namespaces and importing classes into them. This led to the development of Package.
Package provides a method for dynamically creating namespaces. These namespaces can be immediately used to create classes, simple functions, variables, etc. Existing classes that are organized in folder structures can be imported at any time using a namespace that resembles the path to the class.
Other javascript and css files can also be included on a page using the static include method.
Using the require and include methods make it possible to create web pages that load much faster by delaying the load of classes until you need them in your code. There are also two events (success and failure) that can be observed so that code can executed accordingly.
Check out the project page for usage information and examples.
Tags: Class, Javascript, Prototype
No Comments »
After a few days work, I am sharing with everyone my first (and surely not the last) prototypejs class. It allows you to easily provide notifications on your website similar to the Growl on the Mac OS.
This exists as a plugin for MooTools and jQuery but I didn’t see one for Prototype so I decided to provide one for the community.
Growler Project Page and Examples
Tags: JavaScript Frameworks, Prototype, UI
5 Comments »
Just got back from the Rich Web Experience 2008. A lot of great information was covered there. This is a summary of the sessions and keynotes that I was privileged to hear.
Day 1
Day 2
- JavaScript Security by Jason Harwig
- Sketching in Code by David Verba
- Object-Oriented and Functional Programming in JavaScript by Jason Harwig
- Refactoring JavaScript by Stuart Halloway
Day 3
- Industrial Strength Javascript by Nik Krimm
- Advanced Web Graphics with Canvas by Jason Harwig
- Keynote: Career 2.0 by Jared Richardson
I gained a wealth of knowledge from attending these sessions. I would highly recommend them to everyone. Check back for more information where I will start covering most of the subjects that were covered at RWE2008.
Tags: Ajax, Conference, RWE, Web 2.0
1 Comment »