Client API Browser

Welcome to the Client API Browser - your one stop shop for Client API documentation.

Classes

Weavy

The core class for the Weavy client.

WeavyApp

Base class for representation of apps in Weavy.

WeavyConsole

Class for wrapping native console logging.

  • Options for turning on/off logging
  • Optional prefix by id with color
WeavyEvents

Event handling with event propagation and before and after phases.

The event system provides event-chaining with a bubbling mechanism that propagates all the way from the emitting child trigger to the root instance.

NOTE: Each weavy instance has an event handler instance exposed as weavy.events. So references to weavyEvents.triggerEvent() in this documentation would translate to weavy.events.triggerEvent(). For convenience the .on(), .one() and .off() functions are exposed directly on the weavy instance as weavy.on(), weavy.one() and weavy.off(). They are also exposed as child object functions on spaces and apps as space.on() and app.on() etc.

All events in the client have three phases; before, on and after. Each event phase is a prefix to the event name.

  • The before:event-name is triggered in an early stage of the event cycle and is a good point to modify event data or cancel the event.
  • The on:event-name is the normal trigger point for the event. It does not need to be prefixed when registering an event listener, you can simly use the event-name when you register a listener. This is the phase you normally use to register event listeners.
  • The after:event-name is triggered when everything is processed. This is a good point to execute code that is dependent on that all other listers have been executed.

In each phase, the event is propagated to objects in the hierarchy, much like bubbling in the DOM. The event chain always contains at least the triggering object and the root, but may have more objects in between. This means that the root will receive all events regardless of which child-object that was triggering event, but the child objects will only receive the events that they triggered themeselves or any of their child objects triggered.

  • The event chain starts at the root in the before: phase and works it's way towards the triggering child object. This gives all parent-listeners a chance to modify event data or cancel the event before it reaches the triggering child object.
  • In the on: phase the event chain starts at the trigger and goes up to the weavy instance, like rings on the water.
  • Finally, the after: phase goes back from the weavy instance and ends up at the triggering child-object at last.

Cancelling an event by calling event.stopPropagation() will stop any propagation and cause all the following phases for the event to be cancelled.

WeavyNavigation

Class for handling internal/external navigation

WeavyPanels

Panel manager for handling for iframes and their communication.

The panel management is split up into a panels container which can contain multiple panels. Each panel is essentialy a wrapped iframe. The panels container provides the possibility to have multiple panels in the same client container and adds the possibility to shift between which panel that is visible in the container as a tab behavior.

WeavyPromise

Unified promises that can be reset

WeavySpace

Base class for representation of spaces in Weavy.

Plugins

AlertPlugin Weavy.plugins.alert

Plugin for displaying alert messages.

AuthenticationPanelPlugin Weavy.plugins.authenticationPanel

Plugin for sign-in panel.

FileBrowserPlugin Weavy.plugins.filebrowser

Filepicker plugin for attaching from Google, O365, Dropbox etc. It listens to request:origin messages from frames and responds to the source with a origin message containing the window.location.origin.

This plugin has no exposed properties or options.

PreviewPlugin Weavy.plugins.preview

Displaying content and attachments in the full browser window.

ThemePlugin Weavy.plugins.theme

Inject additional styles into the sealed weavy shadow dom. You may define styles by either setting weavy plugin options or by injecting them via ThemePlugin#addCss