ensemble.SocialShare
#
ensemblebase
#
ensemble~SocialShare ⇐ ensemble.SocialShare component.
Kind: inner class of ensemble
Extends: base
Todo
- arguments
- ~SocialShare ⇐
base
#
new SocialShare([element], options)Constructor method.
Param | Type | Default | Description |
---|---|---|---|
[element] | Element | A valid Element node that will be replaced with this component | |
options | object | Options object | |
[options.ns] | string | "share" | The namespace for social share |
[options.root] | string | "body" | The root Element node |
[options.className] | string | Array.<string> | "social-share" | The component CSS class name |
[options.link] | string | "''" | The link, leave empty to auto-discover with selector or location.href |
[options.title] | string | "''" | The title, leave empty to auto-discover with selector or window.title |
[options.description] | string | "''" | The description, leave empty to auto-discover with selector |
[options.displays] | object | null | Actions to display, default to all |
[options.intents] | object | Action intents | |
[options.uriform] | object | URI strings | |
[options.label] | object | Custom parameters for label | |
[options.selectorLink] | object | An element selector to find link | |
[options.selectorTitle] | object | An element selector to find title | |
[options.selectorDescription] | object | An element selector to find description | |
[options.locale] | object | Localization | |
[options.onInit] | function | onInit callback, fires when social share is initialized | |
[options.onIntent] | function | onIntent callback, fires when an action is called |
Example
object
#
socialShare._defaults() ⇒ Options object default properties.
Kind: instance method of SocialShare
#
socialShare._bindings()Methods binding.
Kind: instance method of SocialShare
#
socialShare.generator()The generator creates almost everything the component needs and replaces the element placeholder.
Kind: instance method of SocialShare
Todo
- dataset
#
socialShare.init()Initializes the component.
Kind: instance method of SocialShare
Todo
- TODO
#
socialShare.populate()In this stage the component is populated with all the content progeny.
Kind: instance method of SocialShare
See: window.navigator.share()
#
socialShare.action(intent, title)Creates the whole set of buttons.
Kind: instance method of SocialShare
Todo
- dataset
Param | Type | Description |
---|---|---|
intent | string | The activity name |
title | string | A title for activity |
#
socialShare.intent(e, target)The intent activity. This method is called from each action.
Kind: instance method of SocialShare
See: window.location
Todo
- url validation
Param | Type | Description |
---|---|---|
e | Event | An Event |
target | Element | The element that is invoking |
string
#
socialShare.text(data) ⇒ Makes text substitutions and encodes to an URL
Kind: instance method of SocialShare
Returns: string
- - The encoded URL text string
Param | Type | Description |
---|---|---|
data | object | The data object |
data.url | string | Shared URL |
data.title | string | Shared title |
data.text | string | Shared description text |
data.summary | string | Shared summary |
#
socialShare.social(e, data)Generic social method for social network sharing intent.
Kind: instance method of SocialShare
See: window.open()
Param | Type | Description |
---|---|---|
e | Event | An Event |
data | object | The data object |
data.url | string | Shared URL |
data.title | string | Shared title |
data.text | string | Shared description text |
data.summary | string | Shared summary |
#
socialShare.sendEmail(e, data)Send email intent, it tries to open the default mail client.
Kind: instance method of SocialShare
See: window.open()
Param | Type | Description |
---|---|---|
e | Event | An Event |
data | object | The data object |
data.url | string | Shared URL |
data.title | string | Shared title |
data.text | string | Shared description text |
data.summary | string | Shared summary |
#
socialShare.copyLink(e, data)Copy link intent, it tries to copy URL on the clipboard.
Kind: instance method of SocialShare
See
- document.createElement()
- document.execCommand()
Todo
- TODO
Param | Type | Description |
---|---|---|
e | Event | An Event |
data | object | The data object |
data.url | string | Shared URL |
data.title | string | Shared title |
data.text | string | Shared description text |
data.summary | string | Shared summary |
#
socialShare.webShare()Calls the native WebShare API for sharing.
Kind: instance method of SocialShare
See: window.navigator.share()