Mozile 0.7 Change Log

Mozile 0.7.6:
- Added Grant Gredvig's Edit Source module. It is included in the modules array of the default mozile.js file.
- Increased z-index values in interface.css. See http://bugzilla.mozdev.org/show_bug.cgi?id=14281
- Changed MozileMediator.documentToHTML() and editorToHTML() to use innerHTML for serializing, when possible.
- Changed MozileMediator.restoreState() in the UndoRedo module to ignore the MozileToolbar and MozileStatusbar elements. This fixes a bug when undoing changes when a full document is editable.
- Some changes to the LocalFile module in response to this bug: http://mozdev.org/bugs/show_bug.cgi?id=14543 Unfortunately, I don't have access to a WinXP test machine.
- Made a number of small changes to the extension system to allow the user to set the size of the Mozile toolbar icon. This is the best solution I could come up with: sizes are different on different browser versions, platforms, and themes, and I couldn't work out a stable auto-detect system.
- Added an Apache Ant based build system, similar to the one in Mozile 0.8.


Mozile 0.7.5:
- Reworked testing system to allow for functional tests as well as unit tests. Rearranged the testing directory. Renamed "core" to "unit". Changed index.xml and index.xsl significantly. Added a "function" directory and a GUIUtils.js script for simulating the mouse and keyboard. Moved shared files to "shared" and reworked testpage.js and testsuite.html. Since GUIUtils.js won't work in Gecko versions before 1.8, any test pages that require it fail quietly in unsupported browsers.
- Added a Boolean "undoable" option to MozileCommand, and an isUndoable() method. The default value is "true". Set it to "false" if the command should not be added to the undo stack. Changed all existing commands (where needed) to use the option. Updated test pages.
- InsertionPoint improved. Added Node.getFirstInsertionPoint() and Node.getLastInsertionPoint() methods.
- Changed XHTMLBasic's MozileInsertCommand to move the selection to the end of the inserted node, or immediately after it if the node has no insertion point.
- Minor MozileInterface and MozileToolbar fixes for better tracking of the parentNode.
- Improved arrow key handling in mozileHandleKeypress() in core.js using InsertionPoint.
- Improved InsertionPoint and related methods. Previously InsertionPoints were limited to text nodes. Now they have been generalized to include either a) the pair of a text node and an offset within the text, or b) the pair of an element and an offset within the childNodes list. The former is preferred and used whenever possible. This brings InsertionPoint into parity with Selection and Range, which use both kinds of points. The new InsertionPoint is used to override the default left/right cursor behaviour for the browser. The upshot is that the cursor can now be placed between elements.
- Revised getXPath() method to use polymorphism for Node, Attr, Element, and Text.
- Cleaned up tests. There's an increasing number of small bugs which apply to Mozilla 1.7 and Firefox 1.0.7 and which I can't fix. The ones that are breaking the test suite but don't appear to be doing any damage I've masked in the tests. Mozilla versions less than 1.8 can only be considered "partially" supported.
- Fixed extension help bug. Enhanced editors will request "showHelp" from the extension, which will open a new window. Unenhanced editors will open the mozile.mozdev.org documentation. Server-side editors will open the documentation included with the server-side distribution.
- Extension now sets the debugLevel when editPage() is called, using the mozile.debugLevel preference.
- HTTPPost abort button hides when mozileXHR.readyState is 0 or 4.
- Added an update() method to MozileInterface.
- Added isAvailable() method to MozileCommand, and changed the update() method to check for availability. If the command is not available, its button and menuitem are collapsed. By default isAvailable() always returns true. New Mozile "hideInactiveCommands" option determines where the commands are hidden (collapsed) or just disabled.
- Fixed editor splitting bug http://bugzilla.mozdev.org/show_bug.cgi?id=13728
- Fixed bug where a character was deleted when blocks were merged.
- Added an option to MozileUnformatCommand which allows the removal of tags with a specific name. Removed the unformat command in the default toolbar and replaced it with an unlink command. Moved the link command out of the insert menu and into the main toolbar.
- Changed MozileMeditator.watchSharedData() to use an event listener rather than an interval.



Mozile 0.7.4:
- Changed MozileExtension.editPage() to call preloadInterfaces() before loading the mozile.js script. This means that Mozile in the document can run mozile._cleanUpInterfaces() in mozile.loaded() and not have to wait for the Extension to tell it to. The shared data "status" attribute is now unneeded.
- Updated MozileInterface.getElement() in interface.js to do better detection for previously injected elements. Added similar features to MozileResource.getElement() and load() in core.js - the resource will check to see if an element with the given id already exists and use it, and it won't load an element which is already positioned in the document.
- MozileMediator.loaded() now calls module.init() for each module mozile.getModules(). The modules no longer have to do it themselves.
- Created new MozileToolbar class which inherits from MozileInterface. Reworked the toolbar and statusbar systems to use the new class. The XBL binding in interface.xml is no longer needed so that file has been removed. A new status.xml file was created for the statusbar interface. New MozileToolbar unit tests. The changes seemed to make the toolbar menu bug show up in Firefox 1.0.7, and so I've extended the fix for that to all Mozilla 1.7 based browsers.
- Changed statusbar buttons to toolbarbuttons, and tweaked interface.css.
- Changed the statusbar id to "MozileStatusbar" and toolbar id to "MozileToolbar".
- Added a "preloaded" configuration option for MozileMediator. The default is "false". When "true" it stops new scripts from being loaded in MozileMediator.load().
- All modules now use an init() function for initialization, and MozileModule has a default (empty) init() method.
- Made testing tools more flexible, allowing you to run the full test suite for only one file type (e.g. XHMTL) at a time.
- Added a toString method for MozileComponent and MozileResource.
- Renamed "cleanUp*" methods to "clean*".
- Reworked MozileExtension.editPage() to insert JavaScript code as text into document instead of linking to chrome files. This eliminates the need for calls to "wrappedJSObject" in Mozile and should be more secure. Also, mozile._cleanString has been removed as unneeded.
- Following Max's changes to 0.6, changed HTTPPost.js to no longer use XMLHTTPRequest.setRequestHeader('Content-Length', length) in versions of Mozilla other than the old 1.7.
- Changed source.xml to use an HTML textarea instead of an XUL textbox. This allows for better copying out of the box without any JavaScript warnings. Removed textbox rules from interface.css.
- Added a central mozileHandleEvent() function to core.js, which redirects events to the other handlers. This can support hooks for event handling in the future. Changed all event listeners to point to this function.
- Removed MozileMediator.getSelection and getDocument methods, which should no longer be needed now that XPCNativeWrappers are being respected.
- Simplified the Selection.deleteContents() method. Added a Selection object test page.
- Created Document.isHTML, getHead, and getBody methods, and revised core.js and interface.js to use them. Added a Document object test page.
- Cleaned up Node methods, and added a Node.getXPath() method to generate a simple unique XPath from the documentElement to the node. Added an executeXPath() function. Added a Node object test page.
- Moved MozileMediator.storeSelection() and restoreSelection() methods to Selection.store() and restore(). Revised them to use the new Node.getXPath().
- Added an InsertionPoint object, which you create by calling Selecton.createInsertionPoint(). Added test page.
- Fixed a bug Sebastian Schaffert pointed out in XHTMLBasic, where the ul, ol, style, attribute, and title commands needed their main methods renamed to "execute".
- Improved safeEval in extension.js
- Fixed MozileResource.load() in core.js
- Updated install.rdf files.
- Fixed editor creation in core.js to deal more gracefully with input fields.
- Better extension start and stop behaviour.
- Fixed sizing of Mozile Edit button for Firefox cross-platform.
- New mozileBuild.py script. Works cross-platform and with Mozile 0.6 and 0.7. Stored in mozile/www/tools/mozileBuild.py
- Extension loading fix for browsers other than Firefox 1.5


Mozile 0.7.3:
- Fixed JavaScript warnings when focussing on textbox or input elements. The solution to the former was to make readonly textboxes have CSS "-moz-user-input: none" in interface.css. The solution to the latter was to place XBL event handlers in try blocks in interface.xml. Removed "-moz-user-select" from interface.css input and textbox entry since it was causing an error in FF 1.5 and things seem to work fine without it.
- Fixed bug where context menus would appear while trying to click toolbar buttons. Solution is to capture "contextmenu" events in the "toolbar" XBL binding in interface.xml - when the event.originalTarget has the "mozileButton" class, cancel the event.
- Added getBrowserName, getBrowserVersion, getGeckoVersion, and getMozillaVersion methods to MozileMediator in core.js.
- Fixed toolbarbutton menupopup bug in Mozilla 1.7.11 and 1.7.12. Solution is to change MozileCommandList._createButton (in interface.js) only for Mozilla 1.7 versions and add an onpopupshown handler: the boxObject.screenY is wrong by event.pageY pixels, so we fix it. Already fixed in 1.8+ (i.e. Firefox 1.5 and Seamonkey) and in FF 1.0.7, but may apply to older FF 1.0.x. 
- Fixed Mozile Extension problem under Windows with FF 1.5 where only the title bar of Warning and Options dialogs would show. Solution is to add "this.sizeToContent();" to the "onload" attribute of the dialog.
- Fixed Mozile Extension problem where a newly editable page would have only a few buttons in the toolbar. The problem was that I relied on a timer to tell the toolbar to show itself, and it would often fire before most of the buttons had loaded. The solution was to add a MozileMediator.loaded() method which would do the work. In order to call the method at the right time, I changed MozileMediator.load() to add a trivial <script> tag after loading all modules. That script tag calls "mozile.loaded()". I also changed MozileExtension to listed for "status=loaded" messages from the document, and removed a call to "mozile.getToolbar()" from the very end of interface.js. The toolabr will also make sure that it's up to date with the new MozileCommandList.updateBox().
- Added the "mozile.updateInterval" preference to extension.js. This value is used by all the timers and intervals in extension.js, and watchSharedData in particular. The default is 100, but it can be set to any number of milliseconds in about:config. New browser windows will use the changed setting.
- Changed MozileMediator.restoreSelection() in core.js to fail silently.
- Changed mozileHandleFocus() in core.js to fail silently.
- Added a "setClipboard" enhancement to the MozileExtension. It's used by the CopyCutPaste module's setClipboard() to share data with the Extension. Changed the default option in options.xul.
- Fixed a FF 1.5 bug where code running from chrome can't get at methods added to Range without using wrappedJSObject. Solution is to add a try block to the top of MozileWrapCommand._wrapRange() in XHTMLBasic.js.
- Better caret handling with the Extension installed. Changed MozileMediator.showCaret() and hideCaret() to set the "editing" shared data attribute. MozileExtension.update() listens for the state and sets the caret status.
- Added "-moz-user-input: auto;" to the CSS that Mozile attaches to editors: MozileMediator.createEditor(), createEditors(), makeDocumentEditable() in core.js. The goal is to solve the lack of cursor on the home page, and it doesn't seem to cause any complaints elsewhere.



Mozile 0.7.2:
 General -
- The 0.7 license can now be found at http://mozile.mosdev.org/license2.html
- Major refactoring of Mozile code, breaking the monolithic Mozile object down into several smaller objects. Interfaces have often changed radically, so the new code is not compatible with previous versions!
- mozile.js has been simplified and clarified. It is incompatible with previous version of Mozile! However the format should not change much from now on.
- Any modules written for previous versions will probably be broken! A better versioning system is expected in the future, but otherwise the interface should be relatively stable now.
- New unit tests have been written for all the classes. Not all methods are covered yet.
- The Mozile Extension has been rewritten to use XPCNativeWrappers, so the security risk from using the extension should be small.
 Specifics -
- New MozileResource class handles external resources using elements such as <script/>. Subclasses include MozileScriptResource (script tags), MozileLinkResource (link tags), and MozileStyleResource (style tags).
- New MozileComponent class defines common operations for other classes, such as option getting, setting, and parsing. Subclasses include MozileModule, MozileEditor, MozileInterface, MozileCommand, and MozileMediator.
- MozileCommand was one of the few OO parts of previous versions. It is now a subclass of MozileComponent, and it and its subclasses have all been refactored to match the other new classes.
- New MozileCommandSeparator is a new dummy command which is rendered as a toolbar-separator or a menu-separator depending on the context.
- New MozileModule handles the loading of modules. All of the modules have been refactored to take advantage of this new class.
- New MozileEditor now handles all editing operations. This class will be expanded in future work.
- New MozileInterface handles popups and dialogs, either using a resource from within the page or grabbing one with XMLHTTPRequest.
- New MozileMediator is a catch-all class following the Mediator design-pattern. Like the old Mozile object, there should be a single global instance of this object, which all the other objects rely on.
- New MozileExtension handles the extension logic.
- saveCharset, saveEntities, and saveConversion have been ported from 0.6 to 0.7 following Max's SaveOptions01.pdf documentation. Note that nsISaveAsCharset requires privileges to execute, which cannot be assumed in Mozile 0.7 as they could in 0.6. You can set saveCharset, saveEntities, and saveConversion options in the configuration strings locally for for save modules and globally in the mozileOptions.
- HTTPPost module has been reworked for Mozile 0.7, and should now conform with the behaviour of HTTPPost in Mozile 0.6 according to Max's PostSave05.html documentation. In particular the MozileID feature has been implemented. The key difference is that the HTTPPost module does not run privileged, so it cannot convert character sets like in 0.6. 
- LocalFile does run privileged, and will now convert character sets. Also, if the current document uses the "file:" protocol, the module will quietly try to save the content back to that file.
- The toolbar will now overflow onto multiple lines if the window is too narrow.
- Editors, whether they are blocks or inline, will no longer split when then "enter" key is pressed.
 New Mozile Options:
- Load Just-In-Time. "loadJIT=true" option will load core.js but will wait to load all other files until they are needed. Defaults to "false".
- Activate On Focus. "activateOnFocus=false" will require you to use the mozile.startEditing() method to enable editing. Also available are mozile.isEditable() and mozile.stopEditing() methods. The default for this option is "true".
- Replace Anchors. "replaceAnchors=true" will replace all the "a" elements in the current editor with "mozileAnchorReplacement" elements that have identical attributes. Replacement takes place when the editor is focussed and the anchor elements are restored when the editor is blurred. The effect is that anchor elements can no longer steal the focus, and users can click on them without leaving the page. Default is "true".
- Default Interval. "defaultInterval=100" will set all window.setInterval operations to use 100 milliseconds. The toolbar and interfaces use intervals to reposition themselves. Default is "100".
- Not Versions. Format for the "notversion" option has changed from allowing multiple "notversion" entries to allowing a single "notversions=[1.0.2,1.0.5]" array. Other options needing multiple values follow this format now.
- Save Character Set. "saveCharset=UTF-8" will make Mozile try to convert the character set. Note that this requires privileges which are not always available. Default is the document character set.
- Save Entities. "saveEntities=[html40latin1,html40symbols]" sets the options for entity conversion. See the docs for all options. Note that this requires privileges which are not always available. Default is none.
- Save Conversion. "saveConversion=[entitybeforecharset,questionmark]" sets the conversion options. See the docs for all options. Note that this requires privileges which are not always available. Default is none.
- CopyCutPaste has been modified. Now a keyboard "copy" command, no matter what privileges Mozile has, should copy to the system clipboard. Pasting from the system clipboard requires privileges or enhancement by the Mozile Extension.
- Mozile Extension UI has been reworked, and should be a lot less annoying.
- Mozile Extension now communicates with Mozile instances inside the browser windows using attributes of the "Mozile-Core-core.js" script element. The setSharedData and getSharedData operations manipulate the attributes, while the watchSharedData method watches for changes and executes code when changes occur. Right now the watchers updates at 100ms intervals. This may be faster than necessary.
- Mozile Extension now includes editable "enhancements" which are operations that can be requested from the document. The only default enhancement is "getClipboard" which asks the Mozile Extension to send the current system clipboard contents. A "save to local file" enhancement is planned. The user-definable enhancements are the only access Mozile documents get to the Extension.
- Changed mozileBuild.py script to generate "full.html" files from the XML source with all documentation on a single page.
- Extension now uses chrome.manifest files, which specify xpcnativewrappers=yes.
- New image files generated, "Mozile" and "Mozile9" in 32, 24, 20, an 16 px sizes.


Mozile 0.7.1:
- Add a chrome.manifest file with the xpcnativewrappers=no option. This should allow the extension to work properly in Firefox 1.5.
- Supress alert in extension.js that was so annoying.
- Fixed more files with bad line-endings. All line-endings should be Unix style LF.
- Fixed Mozile.makeDocumentEditable() to make it register the editor and set the tabIndex attribute.
- Fixed Mozile.saveToDialog bug where source would not display if the editor was enhanced by the Mozile extension. 
- Fixed copy, cut, and paste commands to return true. This makes sure that undo/redo work properly for them.

Mozile 0.7.0 Final:
- Added -moz-user-select: text to createEditor commands
- Looked at a bug with FF 1.5 causing the statusbar layout orientation to swicth between horizontal and vertical. Still haven't figured out why, but when the Mozile toolbarPosition=absolute option is set the problem disappears.
- Added mousedown listeners to the toolbar widget in interface.xml, in order to work around a bug in FF 1.5 where you would try to press a statusbar button and the statusbar would hide before the click event was triggered.
- Added Max's PHP and Lars' JSP demo code to the HTTPPost module.
- Rearranged the mozile.js file for easier configuration by adding the mozileOptions variable to the top.
- Changed test suites to work around a bizarre FF 1.5 problem: JsUnit test functions are being executed in reverse order!

Mozile 0.7.0-preview2:
- Fixed MozileCore.js Mozile.initializeToolbar() to use the rootCommandList.
- Fixed a bug in MozileCore.js Mozile.cleanUp() involving the removal of moziletoolbar elements.
- Changed MozileCore.js Node.isBlock() regular expression to include -moz-box as a kind of block.
- Changed name of "widgets.xbl" to "widgets.xml", and fixed all references in MozileCore.js.
- Changed core/widgets.xml editor's constructor to wrap the editor in an "html:wrapper" element, with 'tabindex="12345"', which fixes a major bug in Firefox 1.1 development version Deer Park Alpha 2. This might have to be revised again later.
- Fixed Mozile.initializeToolbar() in MozileCore.js and XHTMLBasic.js to append the rootCommandList box instead of copying it. Fixes a toolbar problem in Deer Park where every other button was ignored.
- Tweaked the toolbar to center better (widgets.css, widgets.xml). I'd like the buttons to flow onto new lines when the window is narrow, but that isn't working right now.
- Changed Mozile.moduleList to include the module's configArray as its value instead of just the version string. The Mozile.registerModule() method now fails if it does not find a moduleList entry with the appropriate id.
- Changed the functions in core/debug.xul to look for key-value arrays instead of numbered ones, and changed all the debugging arrays (everywhere) to match this.
- Added a statusbar which pops up at the bottom of the screen, and a Mozile.status function, which feeds messages to the status bar and also to the debugList.
- Added saving functionality. The Mozile.saveList tracks the various saving methods. Mozile.saveAs() opens the save.xul dialog. When it's done it stes the Mozile.saveFlag to true. The next time Mozile.showToolbar is called(when an editor is focussed?) Mozile.save() is called, which sets the Mozile.saveConfig and calls Mozile.saveConfig["function"].
- Moved all of the Mozile dialogs into XBL, and made them popup within the document using CSS. This prevents numerous problems with popup blockers.
- Split the MozileCore.js file into two parts: core.js and interface.js. The first can be used alone for very basic editing, while the second supports MozileCommands, MozileCOmmandLists, the toolbar and statusbar, and Mozile dialogs. Also broke widgets.xml into core.xml (basic editor XBL) and interface XBL (for toolbar, statusbar, and dialogs). Finally, widgets.css is not interface.css. There is a new variable in mozile.js called "mozileInterface", which when set to false disables all modules and interface elements, and loads only the core/core.js file.
- Fixed the toXML/toHTML functions so that they output XML declarations, doctype declarations, and processing instructions, as well as the serialized documentElement. Because the Mozile.cleanUp() method wasn't catching the Mozile-Core-core.js script tag.
- Added a Mozile.makeDocumentEditable() method, which attaches event listeners directly to the document rather than using XBL. This requires me to move all of the Mozile.handleEvent methods into the global scope as mozileHandleEvent. I also added mozileHandleFocus() and mozileHandleBlur() functions.
- Added some basic performance testing code.
- Rearranged the index files for the testing directory. Now there's an "index.xml" file for listing the tests, and "index.xsl" for making it nice to look at.
- Optimized the mozileHandleKeypress(), Mozile.deletion(), and Mozile.seekIP() code. Managed to cut 20-25% off of the execution time. Mozile.seelIP() is much cleaner.
- Created "semantic" option for XHTMLBasic module. When "semantic=true" (which is the default) the bold command uses "strong", and italic command uses "em", for better semantic XHTML. Else it uses "b" and "i".
- Added all of the XPI stuff. This includes XUL overlays for Firefox and Mozilla, new options dialog, new JavaScript to load all the Mozile code into the browser, and a new "enhance" functionality, which over-rides functions defined by Mozile Server-Side in order to provide enhanced privileges. Although the user is appropriately warned of the security risks in this, I'm still concerned about security issues.
- Changed licensing blocks on all the files that only I (James Overton) have changed, to reflect the fact that this is a complete rewrite of Mozile, and does not depend on the original Playsophy code. I should have done this before, but it's done now.
- Added LocalFile save module, taking the lead from the Save Text Area extension (http://www.benya.com/software/savetextarea/) to see how it's done.
- Added an HTTP POST save module, reusing Max's code from Mozile 0.6.
- Added a "toolbarPosition" option to the Mozile object configuration. Values can be "absolute" or "fixed", which changes the CSS positioning of the toolbars. Default is "abolute", which looks better and works just as well in Firefox 1.0.x, but it slows Deer Park (1.6.x) down significantly. I've added a window.setInterval which calls Mozile.moveToolbar every 100 milliseconds, whenever Mozile.toolbarUpdateFrequency==2. This might need to be changed.
- Connected a code compressor called JSMin (http://www.crockford.com/javascript/jsmin.html) to the mozileBuild.py script. Now all the JavaScript files in the standard builds (non-developer) are compressed before they are packaged.


Mozile 0.7.0-preview:
- Initial Release