After I covered the mandatory "Hello World" sample in my last
dojo article I want to introduce
the parts of dojo in this one. dojo consist of three parts.
In the core part of dojo there is
also the base part, which provides a lot of functionality. The base is
the "dojo.js" file. Compressed the file has only 30k.
- Browser recognition
- JSON encoding / decoding
- Packages loading
- Eventhandling
- Animation effects
- AJAX
- CSS utilities
- OOP
- Firebug integration
For 30k there is a lot of functionality
in there.
All the other aspects of the "core"
of dojo are in packages, which could be loaded via the dojo.require("...")
method. Features within the core part are:
- Drag & Drop
- I18N support
- Date formating
- Number formation
- String utils
- Cookie handling
- Extended animations
- Back button handling
My
favorite is Drag & Drop. It is simply genius. Further along in the
article series I will show that three lines of JavaScript code is all you
need to rearrange elements in a web page via Drag & Drop.
GUI elements in dojo are called dijits. This stands for dojo interface
widgets. All GUI elements can change their look with "themes".
That means you can change the complete look of an web site by just changing
the theme. Another think I like about dijits is the language/country awareness.
Living in Germany, a country that uses the comma as a decimal separator,
it sometimes drives me mad that a lot of existing code samples in other
JavaScript frameworks just won't work outside the U.S.. But the dijits
has been developed with internationalization in mind. Take the dijit.form.NumberTextBox
as a sample. It automatically changes the decimal separator according to
the language settings in the browser. Most of the dijits has been build
with the Web
Accessibility Initiative (WAI)
in mind. Normaly the have a mode with higher contrast to help reading them.
Also most of them could be operated with the keyboard.
dojoX is the more experimental part of dojo. The slogan is „The future,
today“. Most of the elements are stable and could be used in production
environments. Beside the generating of charts and the support of SVG there
are projects like dojoX Offline, that integrates Gears into dojo. Also
there are a lot of dojoX widgets like image galleries.
The three parts of dojo are also visible
in the file system. For a Domino 8.5.1 Server there is a folder "js"
under the "domino" directory of the Domino data directory. In
this folder are different subfolders for each supported dojo versions.
So there is the current 1.3.2 version and an older version 1.1.1. Actually
the 1.1.1 version is also installed for a Domino 7.0.4 server. Beside the
three folders for the core (dojo) part, dijit and dojoX there is an folder
with IBM enhancements.
A good overview of the power of the
dojo
toolkit could be found on their
demo
web page.
The dojo
article 3 - "Use case 'SpeedAgendaing' and the first step"
will start to deal with Lotus Notes and the use of dojo in a Domino web
application. I promise.