Class: ActionsLoadedEvent

sync.api.Editor.ActionsLoadedEvent

new ActionsLoadedEvent(actionsConfiguration)

Configuration of the actions that are going to be enabled for the current editor was loaded. This configuration may specify some of the:

  • the action together with their shortcuts
  • the configuration of one of the toolbars
  • the configuration of the context menu

This event is triggered before the action are used, so changes to the configuration will take effect in the UI.

The toolbar and contextmenu configurations contain only action ids. In order to change the actual actions or to add more actions one can use the sync.api.ActionsManager.


Example of listening for this event:

goog.events.listen(editor, sync.api.Editor.EventTypes.ACTIONS_LOADED, function(e) {
  // e is of type sync.api.Editor.ActionsLoadedEvent
});
Parameters:
Name Type Description
actionsConfiguration sync.api.Editor.ActionsConfiguration A object that represents the actions configuration.
Source:

Type Definitions

ActionDescriptor

The action descriptor.
Type:
  • Object
Properties:
Name Type Attributes Description
compatible boolean Whether the action is compatible with webapp. If not, it will not be used in the UI.
icon16 string <optional>
The URL for a 16x16 icon to be used for the action.
icon20 string <optional>
The URL for a 24x24 icon to be used for the action. Yes, 24x24, it's called icon20 for backwards compatibility reasons.
id string The unique ID of the action.
name string <optional>
The display name of the action.
tooltip string <optional>
The tooltip description of the action.
shortcut string <optional>
The shortcut of the action. Can use platform-generic modifiers (e.g. M1) similar with how they work in SA.
Source:

ActionEntry

The descriptor for an action entry on the toolbar or in the context menu.
Type:
  • Object
Properties:
Name Type Description
id string The ID of the action to render on the toolbar.
type string Equal to "action".
Source:

ActionsConfiguration

The object used to open the editor.
Type:
  • Object
Properties:
Name Type Description
actions Array.<sync.api.Editor.ActionsLoadedEvent.ActionDescriptor> An array of actions descriptors.
toolbars Array.<sync.api.Editor.ActionsLoadedEvent.ActionsListDescriptor> An array of descriptors for actions lists that will be rendered as toolbars.
contextualItems Array.<sync.api.Editor.ActionsLoadedEvent.ContextMenuEntry> An array of descriptors for entries in the context menu.
Source:

ActionsListDescriptor

The descriptor for a toolbar, a drop-down menu on the toolbar, or context sub-menu.
Type:
  • Object
Properties:
Name Type Attributes Description
icon16 string <optional>
The URL for a 16x16 icon to be used to render the actions list.
icon20 string <optional>
The URL for a 24x24 icon to be used to render the actions list. Yes, 24x24, it's called icon20 for backwards compatibility reasons.
iconDom HTMLElement <optional>
A DOM element that will be used to render the actions list.
name string <optional>
The name of the toolbar, used as an HTML attribute. It is used also a fallback for displayName.
displayName string <optional>
The display name of the toolbar.
type string Equal to "list".
children Array.<(sync.api.Editor.ActionsLoadedEvent.ActionsListDescriptor|sync.api.Editor.ActionsLoadedEvent.ActionEntry|sync.api.Editor.ActionsLoadedEvent.Sep)> the list entries.
Source:

ContextMenuEntry

The context menu entry descriptor.
Type:
  • Object
Properties:
Name Type Attributes Description
icon string <optional>
The URL for a 16x16 icon to be used for the toolbar.
name string <optional>
The display name of the toolbar.
type string Equal to "list".
children Array.<(sync.api.Editor.ActionsLoadedEvent.ActionsListDescriptor|sync.api.Editor.ActionsLoadedEvent.ActionEntry|sync.api.Editor.ActionsLoadedEvent.Sep)> the list entries.
Source:

Sep

A separator.
Type:
  • Object
Properties:
Name Type Description
type string Equal to "sep".
Source: