upgrade ⇒ WeavyWidget.plugins.upgrade

Checks if widget needs to be upgraded on options event.

Kind: global mixin
Properties
NameTypeDescription
.check()function

Trigger an upgrade check


Instance members

Events

"upgrade" ⇒ Object

Triggered when the widget need to be upgraded and reloaded to match the version on the server.

Kind: event emitted by upgrade
Category: events
Properties
NameTypeDescription
currentstring

The currently running script semver version

availablestring

The semver version on the server

Example
widget.on("upgrade", function(e, version) {
    widget.info("Current widget version:", version.current);
    widget.info("New widget version available:", version.available);
});

Static members

upgrade.defaults : Object

Default plugin options

Kind: static property of upgrade
Properties
NameTypeDefaultDescription
showAlertboolean true

Show an elert when the widget has been upgraded.

Example
WeavyWidget.plugins.upgrade.defaults = {
    showAlert: true
};