With this you define your plugin.
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.
Rendered element options. They define how element will be rendered in builder.
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;
}
...
});
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;
}
...
});
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;
}
...
});
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).
Callback that will be called when HTML DOM elements of this element are initialised. You can do some initial html element initialisation processing.
Display name of the plugin. This is the name that will be visible in plugin toolbar in builder.
Callback that will be called before opening property dialog. It is usually used to load values prom data object to property dialogs fields.
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).
Property dialog definition object. This defines how property/configuration dialog will look.
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.
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.
With this you define your plugin.