Another week is concluded today. The ComboBox widget was migrated to make use of the new PopupContainer and several related bugs were fixed. PopupContainer also received some improvement which makes it more customizable in regards to zIndex values.

The main effort in this week is to continue the enhancement of the Editor2/Editor2Toolbar to be extensible and get rid of hardcoded functions which are not related to the core part.

The issue mentioned in the last weekly report was solved by using another syntax of attaching event to a node.

In my current local copy, all but one (formatSelect) buttons present in tests/widget/test_Editor2.html have been implemented. The approach taken is modeled after FCKeditor (refined version of the proposal in last weekly report):

The principle of EditorCommand is introduced. An EditorCommandis an operation on the editing area. It also provides APIs to retrieve state of the command (Disabled/On/Off). Three items are introduced in Editor2.js:

Name Type Description
Editor2Command Class Base interface for all command in Editor2
Editor2BrowserCommand Class Browser builtin command
Editor2Manager Object Global object to register new Editor2Command and retrieve command based on name

In order to represent buttons and other more complex elements in the toolbar, ToolbarItem principle is introduced. Normally, every ToolbarItem has an associated EditorCommand. A ToolbarItem can create and/or initialize/modify a DOM node (such as connect onClick to another function to execute the related EditorCommand). In addition, it also encapsulate the code for refreshing the state of the button (such as highlight/unhighlight). One global object and 3 classes are added to Editor2Toolbar.js:

Name Type Description
Editor2ToolbarButton Class Button to wrap a simple Editor2BrowserCommand command, such as bold, italic
Editor2ToolbarDropDownButton Class Button which provides a dropdown (PopupContainer)
Editor2ToolbarColorPaletteButton Class Button to popup a ColorPalette to set front/back ground color of text
Editor2ToolbarItemManager Object Global object to register new Editor2ToolbarItem and retrieve toolbar item based on name

There are several outstanding issues I need to sort out before preparing a patch for peer review:

  1. In none-activeX mode under IE, it does not work yet;
  2. No matter which toolbar it always operates on the focused editor, this should be prevented when each editor has its own toolbar;
  3. selectFormat is not implemented yet;
  4. In IE activeX mode, inserthorizentalrule and strikethrough are not supported, need to find a workaround;