Weavy widget options

Typically, adding the Weavy widget script to your application or website is quite enough to get you started. For more advanced scenarios you may want to tweak the default options a bit to make your Weavy widget look and behave the way you want it to.

weavy_options

The weavy_options object contains the options you can tweak to modify the behavior of your Weavy widget.

<script> 
    var weavy_options = { 
        url: WEAVY_URL,
        init: true,
        el: null,
        https: "adaptive",
        className : 'weavy-middle',
        bubble_limit: 16
    }; 
</script> 

url string (required)

The root URL to your Weavy installation, e.g. https://example.weavycloud.com.

init bool

Whether or not Weavy should be automatically initiated and displayed when the Weavy script has loaded. Default is set to true. Use weavyWidget.init() when desired if set to false.

el element

Specifies a custom element where you want to add your Weavy widget. Default is set to null, which makes the widget create a separate section element next to the body element on the page where you add the script. This means you can safely replace the whole body without affecting the weavy widget.

https string Makes sure urls in the widget are using approperiate https protocol.

  • force - The widget enforces https always.
  • adaptive - The widget enforces https only if the site uses https.
  • default - The widget will not enforce https

className string

A custom class name that is added to the Weavy container. This is handy if you want to take control over the layout and styling of both the Weavy container and the buttons. Default is "weavy-middle" which makes the widget appear vertically centered.

Accessing the options

After making a new WeavyWidget()you can access all options through weavyWidget.options.

var weavy_options = {
  url: '[weavyinstallation]'
}

var widget = new WeavyWidget(widget_options);

var currentOptions = widget.options;

Defaults

The default settings for the WeavyWidget is accessed through WeavyWidget.defaults. These settings is the ones being used as default when you make a new WeavyWidget().

Plugin options

The widget has built-in support for javascript plugins. You may configure or disable plugins in your widget_options. There is currently one built in plugin called position, which handles minimizing and drag-n-drop positioning of the dock in the widget. You can set options for the plugin under weavy_options.plugins.position. All options for custom plugins will also be set under weavy_options.plugins[custom_plugin_name].

var weavy_options = {
  url: '[weavyinstallation]',
  plugins: {
    position: {
        position_class_name: 'weavy-collapsed',
        snapping_x: 4,
        snapping_y: 4,
        minimize_delay: 15000
    }
  }
}

var widget = new WeavyWidget(widget_options);

Disabling plugins

Simply set the options to false for the plugin you want to disable.

var weavy_options = {
  url: '[weavyinstallation]',
  plugins: {
    position: false
  }
}

var widget = new WeavyWidget(widget_options);

Widget API

For even more control of the Weavy widget and its behavior you should have a look at the Widget API.