View the latest version of these documents: http://mozile.mozdev.org/0.7/docs/index.html
Welcome to Mozile, the WYSIWYG XHTML editor for Mozilla! This document includes information for using and developing Mozile. It is a work in progress, and we welcome suggestions and contributions.
Mozile is a framework which makes it as easy to edit a web pages as it is to use a word-processor. Mozile makes use of the advanced technologies available in the Firefox and Mozilla browsers.
Mozile code is written in JavaScript, documented with JSDoc, and tested using JSUnit. It makes use of Mozilla specific technologies such as XUL (the User Interface Language), XBL (the Extensible Binding Language), and many others.
Mozile allows what-you-see-is-what-you-get (WYSIWYG) editing of XHTML and XML documents. Although it will be able to create documents from scratch, it is designed primarily to allow editing of existing documents, or documents derived from templates. Mozile provides the tools to build truly powerful web-based content management systems.
The Mozile project was founded by Conor Dowling. James Overton is the current project leader. Mozile is Open Source software, licensed under the MPL 1.1, the GPL 2.0, and the LGPL 2.1, which allows great flexibility for using Mozile code in other projects. The Mozile web site is at http://mozile.mozdev.org, and you can email our mailing list at mozile@mozdev.org. We welcome suggestions and contributions.
Flexibility
Mozile should be flexible enough to be put to uses that are hard to imagine.
This document is part of the design specification for the 0.7 series of Mozile releases. Previous versions of Mozile did not have such a document, which led to some confusion. So the goal of this design specification is to describe exactly how Mozile should behave, and how it should be built. We want all our developers to be working off the same page.
This document is necessarily a work in progress. Currently it is incomplete. Although written as if Mozile behaved "properly", this document describes how Mozile should, not how it actually does behave. Even when it is "finished", there may be cases where the community decides that some new features is worth adding, or some behaviour is worth changing. In these cases this document will be changed. So be sure to refer to the most current version!
There are several parts to the Mozile 0.7 documentation. This document is an overview, while others go into greater detail, and others are focused on different subjects, like the user documentation. Here are the major parts:
General Design
This document
User Design
User stories and a description of Mozile's intended behaviour from the perspective of someone who edits documents with Mozile.
Mozile can be used as a set of server-side scripts or as a browser extension (a plug-in). Most of the code is shared between them, but a certain amount has to be kept separate.
The shared code makes up the majority of the Mozile code base. We can distinguish this into the core code which Mozile needs in order to do anything, and the modules which provide added functionality. So we have,
Mozile Core
The core of Mozile includes eDOM, the Editable Document Object Model code which provides the basic tools that Mozile uses to edit documents.
Mozile Modules
Everything except the essentials is separated into modules. Some, all, or none of these modules can be used in a particular case. This allows web designers to reduce bandwidth and loading times, and it allows users more flexible control over Mozile's behaviour.
The two different ways of using Mozile are called,
Mozile Server-Side
The server-side code allows web designers to make parts of their web pages editable by users with a Firefox or Mozilla browser.
Mozile Extension
Users can also install Mozile into their Firefox or Mozilla browsers. This makes it faster to load Mozile, and allows certain features which require greater security privileges (you don't let scripts on web pages do anything they want to!). With the Mozile Extension you can also edit pages which were not designed for Mozile editing.
The essential code which Mozile requires to run is in the Mozile Core. This code includes eDOM and its associated files.
eDOM consists of JavaScript code which extends the functions of certain Document Object Model (DOM) objects. See Mozilla's DOM Reference for details. This is possible because JavaScript provides "prototyping" capabilities. For example, the Selection object is extended via prototyping to include the insertCharacter() method. When insertCharacter(characterCode) is called, the given character is inserted into the current text node at the selection. eDOM makes use of DOM functions to make this possible, but without eDOM it would be a difficult process to do such a basic word-processor-like thing. With eDOM it becomes easy.
eDOM also creates new objects which embody concepts which are not part of the DOM, but are required for word-processing, like an Insertion Point.
But eDOM alone does not make an editor. The user has to be able to access these functions, and there are many other things which an editor must do besides editing. The rest of Mozile makes it possible to do these things.
Building upon the functionality of the Mozile Core is a series of modules. Modules add features which are useful, but not necessarily needed in every situation where that Mozile is used. Examples of modules include:
Mozile ModulesModules extend the mozileContainer object with new properties and methods. Mozile is carefully designed so that it can operate without a given module, however it may sometimes be the case that one module depends on another.
Modules also allow web designers to add functionality to Mozile which is specific to their sites.
There are two different ways that Mozile can be used. The first is as a set of scripts which are stored on a server and loaded into the user's browser only when she navigates to a page designed to work with Mozile. Nothing special is required of the user, except that she is using a Firefox or Mozilla browser.
Mozile Server-Side takes care of loading Mozile into the web page, activating the Mozile Core and Mozile Modules, and controlling the Mozile Editor instances within the page.
The Mozile Server-Side code is clever enough to cooperate with the Mozile Extension when it has been installed in the user's browser.
The Mozile Extension is a plug-in for Forefox and Mozilla browsers. Plug-ins for these browsers are usually called "extensions". The user must download and install the Mozile Extension in a special XPI (Cross-Platform Installer) file. After installation, the browser must be restarted. Updates will be automatically reported to Firefox users via Mozilla Update.
Once the Mozile Extension is installed, three new features are available:
Faster Loading
Since the user has already installed the Mozile code, when she uses a page which is designed for Mozile, the Mozile Server-Side code on that page can ask the Mozile Extension to do some of the work. That means that the Mozile code won't have to be downloaded from that web site, and Mozile will load much more quickly.
Added Features
With the Mozile Extension installed, the user will be able to store preferences about how she prefers to edit. Also, certain Mozile functions which require special permission to run via Mozile Server-Side will now work automatically via the Mozile Extension. This includes things like using the system clipboard.
Edit the Web
Finally, with the Mozile Extension the user has the ability to edit any web page with Mozile. Of course, the changes will not be saved to the web server unless the user has permission to do so. But the edited page can be saved to the user's computer. Not only is it great fun to search Google for your name and then edit the results, but this makes it easy to do things correct a mistake on a web page and send the fixed version to the web master.
Mozile is object-oriented software. There are three major objects that Mozile defines.
mozileEditor
The mozileEditor object is attached to an element within the document, and then transforms that element into a Mozile Editor. Most of the magic is done by XBL and JavaScript. A single document may contain many mozileEditor objects.
mozileContainer
The mozileContainer object is attached to a particular document (web page). It is created when Mozile is loaded into a page, and it is used to create and control mozileEditor objects. Most of the Mozile functionality is built into this object, and the mozileEditors call methods of the mozileContainer to do their work. Every web page which is editable by Mozile will have a single mozileContainer object.
mozileExtension
The mozileExtension object is implemented by the Mozile Extension code-base, but the object and the code-base should be distinguished. It is attached to the browser window, and is accessible through the Window object. The mozileContainer will check to see if a mozileExtension object exists. It it does not (if the user has not installed the Mozile Extension), then the mozileContainer will use all of its own methods. If the mozileExtension object does exist, then the mozileContainer will use some the mozileExtension's methods to make use of the added features the the Mozile Extension provides. If the Mozile Extension is installed, every browser window will have a single mozielExtension object.
James A. Overton - http://mozile.mozdev.org - 2005-03-23