- Github: https://github.com/apparena/aa_app_mod_share
- Docs: http://www.appalizr.com/index.php/share.html
- This is a module of the aa_app_template
Creates a share button with a bubble to show a list with additional buttons to share the current site or action in a social network. If only one social media chanel is activated in the config value "share_social_networks" (App-Manager config value), this chanel will be called directly on a click, without open a additional bubble. Sounds confusing? Ahh no it's very easy, try the demo with the app template ;-)
modules/aa_app_mod_share/js/views/GenerateShareButtonView
Defines all button settings, load the needed templates and start a callback function. With the callback, you can add the button to the place where you want to show it.
Param | Type | Description |
---|---|---|
options | Object | Button settings as JSON (btn_name or name, placement, section) |
• btn_name or name - Button value text (Name) | ||
• placement - Bubble placement for content buttons ( top, right, buttom, left) | ||
• section - button placement, to load the right templates (navigation or button ) | ||
callback | Function | To add the button to DOM or something else |
this
Returns the renderd button HTML, to put them into the DOM. Over the parameter, you can change the button value text. This is not required, but when you use the some button on different places, you can change the button texts with this param.
Param | Type | Description |
---|---|---|
name | String | Change button value text (not required) |
void
// initialize the script first
var shareBtnNavi = GenerateShareButtonView().init();
// now render a new button for the navigation section to decide the navigation template
shareBtnNavi.render({section: 'navigation'}, function () {
// add the button to .navbar-right in the callback function
$('.navbar-right').prepend(shareBtnNavi.getButton());
});
// initialize the script first
var shareBtnContent = GenerateShareButtonView().init();
// now render a new button to use it for normal content. Use "button" as "section" to decide the button template, change button text with "name" and define the bubble position to top
shareBtnContent.render({section: 'button', name: 'Share Button', placement: 'top'}, function () {
$('.content-wrapper').html(shareBtnContent.getButton());
});
config | default | description |
---|---|---|
share_image | empty | image value with src selection to show a share image on google stream or facebook open graph posts or share messages |
general_title | empty | Share title |
general_desc | empty | Share description |
share_social_networks | ["fb","twitter","gplus"] | share chanel selection to show selected share buttons |
locale | value example |
---|---|
share | [DE] Teilen, [EN] Share |