context ⇒ WeavyWidget.plugins.context

Handles location changes and context features. Adds connect and disconnect buttons to bubble icons in the dock.

Kind: global mixin
Properties
NameType
.connectedUrl()connectedUrl

Instance members

widget.openContextFrame(weavyContext)

Opens a bubble from the given context data. Initiated from a frame when the page is loaded.

Kind: instance method of context
ParamTypeDescription
weavyContextObject
weavyContext.spaceIdint

The id of the space to open

weavyContext.urlurl

The url in the space


widget.connectBubble(id, type, [event])

Shows the connect space modal in a bubble panel

Kind: instance method of context
ParamTypeDescription
idint

spaceId or bubbleId for the space where the modal should be shown

typestring

"space" or "bubble". Indicates which type of id that is used.

[event]Event

Optional event that will be prevented and have propagation stopped.


Static members

context.defaults : Object

Default plugin options

Kind: static property of context
Properties
NameTypeDescription
connectObject
connect.iconhtml

<svg/> Icon for the connect button. Provided as HTML string.

connect.titlestring

Title of the connect button.

disconnectObject
disconnect.iconhtml

<svg/> Icon for the disconnect button. Provided as HTML string.

disconnect.titlestring

Title of the disconnect button.

Example
WeavyWidget.plugins.context.defaults = {
    connect: {
        icon: '',
        title: "Connect to url"
    },
    disconnect: {
        icon: '',
        title: "Disconnect from url"
    }
};

Inner members

context~connectedUrl(url)

Checks if the url matches the current context url document.location.href. A star may be provided in the end of the url to use wildcard matching.

Kind: inner method of context
ParamTypeDescription
urlurl

The url to match against current location. The url may end with a wildcard *.

Example
var isConnected = widget.plugins.context.connectedUrl("http://www.weavy.com/");
var isWildcardConnected = widget.plugins.context.connectedUrl("http://www.weavy.com/*");