[Elements] are optional
Class SAPO.Widget.ShareThis
class
SAPO.Widget.ShareThis
Allows to put a share widget on the known services like links sapo, delicious, google bookmarks etc, pdf export and send link by email
Defined in
Widget/ShareThis/0.1/lib.jsInclusion link: http://js.sapo.pt/SAPO/Widget/ShareThis/0.1/
Sample: http://js.sapo.pt/SAPO/Widget/ShareThis/sample/
Variable Summary
Provides multilingue default options for ShareThis
Constructor Summary
ShareThis
([Object
options])
Function Summary
addCss()
debug()
debug stuff
removes the services passed on exclude array on the options object
getPDF()
make print to PDF
init()
constructor alias
check if pdf was generated succesfully
generates the DOM to the widget on mode 0
outputLink
(Object
service)
creates the link to the service
generates the DOM to the widget on mode 2
generates the DOM to the widget on mode 1
generates the overlay DOM element to the tooltip View
generates the DOM to the widget on mode 3
adds PDF and Email if they are enabled
Constructor Details
constructor ShareThis
ShareThis([Object
options])
Parameters:
[options]
-
[ Boolean debug ] -
[ String target ]- DOM Element Id from the widget container -
[ String url ] -
[ Number mode ]- widget mode type (0 => Show just icon from the services, 1 => Show only names of the services, 2 => Show icons and names of the services, 3 => Tooltip Mode) -
[ Array only ] -
[ Array exclude ] -
[ Boolean clickOutClose ]- if true, on Tooltip mode, closes the tooltip when click outside the tooltip -
[ Object custom_services ] -
[ String tooltip_title ] -
[ String email_tab_title ] -
[ String email_link_title ]- text to display on the link that sends the mail -
[ String pdf_tab_title ] -
[ String pdf_link_title ]- text to display on the link that generates pdf of the page -
[ String web_tab_title ] -
[ String pdf_json_url ]- json service that generates the pdf -
[ String email_url ]- json service that sends the email -
[ Boolean pdf ]- if false hide tab print pdf -
[ Boolean email ]- if false hide tab email send -
[ Number max_retries ]- Number of retries -
[ String pageTitle ]- page title to bookmark/print/send -
[ String closeTitle ]- text to appear on close button (Tooltip mode) -
[ String cssURI ]- url of alternative stylesheet -
[ Function servicesCallback ]- function to be called when a service link is clicked (arguments[0] -> link; arguments[1] -> title ) -
[ Function pdfCallback ]- function to be called when a pdf is printed (arguments[0] -> link; arguments[1] -> title ) -
[ Function emailCallback ]- function to be called when a email is succesfully sent (arguments[0] -> link; arguments[1] -> title ) -
[ String language ]- language to use in Share This. Accepted values ['pt','en','es','fr','ar','zh','ru',de] -
[ Object lang_values ]- values to be overrided in the default language set @.... {optional String} email_name_from, @.... {optional String} email_name_to, @.... {optional String} email_to, @.... {optional String} email_send, @.... {optional String} email_sending, @.... {optional String} email_sending_error, @.... {optional String} email_invalid, @.... {optional String} email_required, @.... {optional String} email_share, @.... {optional String} email_close, @.... {optional String} pdf_download, @.... {optional String} pdf_error, @.... {optional String} closeTitle, @.... {optional String} tooltip_title, @.... {optional String} email_tab_title, @.... {optional String} email_link_text, @.... {optional String} pdf_tab_title, @.... {optional String} pdf_link_text, @.... {optional String} web_tab_title: 'Internet', -
[ Array visible ]- -
[ String showMoreSymbol, ] -
[ Boolean useSprite, ] -
[ String unknownIcon ]
Function Details
function addCss
addCss()
function createEmailForm
createEmailForm()
function createFloatingEmailBalloon
createFloatingEmailBalloon()
function createTab
createTab(String
title, Boolean
visible)
generates a tab for the widget
Parameters:
title
- Tab Title
visible
- True if selected function debug
debug()
debug stuff
function emailFormSubmit
emailFormSubmit()
function emailSendInPlace
emailSendInPlace()
function filterServices
filterServices()
removes the services passed on exclude array on the options object
function getPDF
getPDF()
make print to PDF
function init
init()
constructor alias
function observeEMAILVarChange
observeEMAILVarChange()
function observePDFVarChange
observePDFVarChange()
check if pdf was generated succesfully
function outputIconView
outputIconView()
generates the DOM to the widget on mode 0
function outputLink
outputLink(Object
service)
creates the link to the service
Parameters:
service
function outputMixedView
outputMixedView()
generates the DOM to the widget on mode 2
function outputTextView
outputTextView()
generates the DOM to the widget on mode 1
function outputTooltipSkeleton
outputTooltipSkeleton()
generates the overlay DOM element to the tooltip View
function outputTooltipView
outputTooltipView()
generates the DOM to the widget on mode 3
function setBehaviours
setBehaviours()
adds PDF and Email if they are enabled