Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PluginDefinition<T>

With this you define your plugin.

Type parameters

Hierarchy

  • PluginDefinition

Indexable

[key: string]: any

With this you define your plugin.

Index

Properties

Optional applyAction

applyAction: ApplyActionCallback<T>

Callback that will be called when apply button in property dialog is clicked. It is usually used to store values from property dialogs fields to data object.

borderless

borderless: boolean

bringForward

bringForward: SimpleCallback

bringToFront

bringToFront: SimpleCallback

element

Rendered element options. They define how element will be rendered in builder.

Optional fullWidthChangeAction

fullWidthChangeAction: FullWidthChangeActionCallback

Optional getUsedFonts

Callback for getting used custom fonts.

This function must return an array of font families used by plugin. Any font families that are not available in the site (not default or added by user) are ignored.

Example:

PluginWrapper.registerPlugin('example', {
    ...
    getUsedFonts: function(serializedData) {
        var fonts = [];
        if( serializedData.content.captionFontFamily &&
            serializedData.content.captionFontFamily !== ""
        )
            fonts.push(serializedData.content.captionFontFamily);
        return fonts;
    }
    ...
});

Optional getUsedMediaGalleryItems

getUsedMediaGalleryItems: GetStringArrayCallback

Callback for getting used media library files.

This function must return an array of all paths to media library files used by plugin.

Example:

PluginWrapper.registerPlugin('example', {
    ...
    getUsedMediaGalleryItems: function(serializedData) {
        var images = [];
        if( serializedData.content.picture1 &&
            serializedData.content.picture1 !== "" &&
            serializedData.content.picture1 !== "none"
        )
            images.push(serializedData.content.picture1);

        if( serializedData.content.picture2 &&
            serializedData.content.picture2 !== "" &&
            serializedData.content.picture2 !== "none"
        )
            images.push(serializedData.content.picture2);

        return images;
    }
    ...
});

Optional getUsedSiteStyles

getUsedSiteStyles: GetStringArrayCallback

Callback for getting used site styles.

This function must return an array of all site style class names used by plugin. Each style class name must begin with a dot. For example ".wb-stl-normal" or ".wb-stl-custom3".

Example:

PluginWrapper.registerPlugin('example', {
    ...
    getUsedSiteStyles: function(serializedData) {
        var styles = [];
        if( serializedData.content.labelStyle &&
            serializedData.content.labelStyle !== ""
        )
            styles.push("." + serializedData.content.labelStyle);
        return styles;
    }
    ...
});

Optional loadAction

loadAction: LoadActionCallback

Callback that will be called when plugin elements data is loaded. This is perfect place to set default values (if they not already set or this is new element).

Optional loadedAction

loadedAction: LoadedActionCallback

Callback that will be called when HTML DOM elements of this element are initialised. You can do some initial html element initialisation processing.

moveToBody

moveToBody: SimpleCallback

moveToFooter

moveToFooter: SimpleCallback

moveToHeader

moveToHeader: SimpleCallback

name

name: string | null

Display name of the plugin. This is the name that will be visible in plugin toolbar in builder.

Optional notifyHelpSystemPlayer

notifyHelpSystemPlayer: NotifyHelpSystemPlayerCallback

Optional openAction

openAction: OpenActionCallback<T>

Callback that will be called before opening property dialog. It is usually used to load values prom data object to property dialogs fields.

openProperties

openProperties: SimpleCallback

Optional pluginScoped

pluginScoped: IDictionary<any>

Custom object that (its instance) will be shared between different instances of this plugin. You can use this to make sure something is initialised only once (for example track if external script is loaded).

propertyDialog

Property dialog definition object. This defines how property/configuration dialog will look.

Optional resizeAction

resizeAction: ResizeActionCallback

Callback that will be called when element is being resized. This callback will be called in realtime (a lots of times), so do not do anything heavy in it.

Optional resizeStopAction

resizeStopAction: ResizeActionCallback

Optional saveAction

saveAction: SaveActionCallback

Callback that will be called when user saves website in builder. This is the last chance to modify data object before it will be serialized and saved.

sendBackwards

sendBackwards: SimpleCallback

sendToBack

sendToBack: SimpleCallback

serviceUrl

serviceUrl: string | null

setLocation

setLocation: SetLocationCallback

setSize

Optional switchLanguageAction

switchLanguageAction: SwitchLanguageActionCallback

Optional switchModeAction

switchModeAction: SwitchModeActionCallback

Optional updateAction

updateAction: UpdateActionCallback<T>

updateElement

updateElement: SimpleCallback