Origami Frontend Components & Services

JSDoc: o-comments active

setConfig(keyOrObject, value)

Global Function

Adds or overrides configuration options.

parameter type default description
keyOrObject string | object Key or actually an object with key-value pairs.
value anything Optional. Should be specified only if keyOrObject is actually a key (string).

Returns

  • undefined

Links

enableLogging

Global Function

Enables logging.

Returns

  • undefined

Links

disableLogging

Global Function

Disables logging.

Returns

  • undefined

Links

setLoggingLevel

Global Function

Sets logging level.

Returns

  • undefined

Links

Widget(rootEl, config)

Global Function

Incorporates the loading of Livefyre core resources, communication with SUDS and caching, Livefyre authentication, Livefyre's widget loading mechanism with the possibility to extend and modify the process.

Configuration:

Mandatory fields:
  • articleId: ID of the article, any string
  • url: canonical URL of the page
  • title: Title of the page
Optional fields:
  • stream_type: livecomments, livechat, liveblog
  • livefyre: object which contains key-value pairs which should be added to the init object
  • stringOverrides: key-value pairs which override default LF strings
  • authPageReload: if authentication needs a page reload. By default it's false.
  • section: Override the default mapping based on URL or CAPI with an explicit mapping. Section parameter should be a valid FT metadata term (Primary section)
  • tags: Tags which will be added to the collection in Livefyre
parameter type default description
rootEl object | string Root element in which the widget should be loaded.
config object Configuration object. See in the description the fields that are mandatory.

Returns

  • undefined

Links

loadInitData(callback)

Global Function

Loads init data from the SUDS service.

parameter type default description
callback function function (err, data), where data is the init object

Returns

  • undefined

Links

WidgetUi(widgetContainer, config)

Global Function

FT specific UI customizing of the Livefyre widget.

parameter type default description
widgetContainer DOMElement Container of the widget instance.
config Object Config object of the Widget instance

Returns

  • undefined

Links

makeReadOnly

Global Function

Makes the Livefyre comments widget read-only by hiding the editors and action buttons.

Returns

Links

addAuthNotAvailableMessage

Global Function

Inserts message when SUDS reports as authentication is not available.

Returns

  • undefined

Links

addTermsAndGuidelineMessage

Global Function

Inserts the terms and guidelines text into the widget.

Returns

  • undefined

Links

moveCommentCountOut

Global Function

Comment counter is part of the Livefyre widget, but on FT.com this element is moved out into the header.

Returns

  • undefined

Links

login(callback)

Global Function

Tries to obtain the user's login data. Calls a callback with the resulted status, and also fires an event if the user can be logged in.

parameter type default description
callback function Called with two parameters: loginStatus, authData.

Returns

  • undefined

Links

logout(callback)

Global Function

Logs out the user in the Livefyre system, and also clears the token from the local cache.

parameter type default description
callback function Called when logout is successful.

Returns

  • undefined

Links

loginRequiredPseudonymMissing(callback, maintainCommentQueue)

Global Function

Login required and pseudonym is missing

parameter type default description
callback function function (err, data)
maintainCommentQueue Boolean Should the comment queue be maintaied or deleted if page reload is required for authentication

Returns

  • undefined

Links

loginRequiredAfterASuccess(callback)

Global Function

Login required, first attempt of the login process is successful. If the user is still not logged in, then fail. If the user has no pseudonym, ask for a pseudonym.

parameter type default description
callback function function (err, data)

Returns

  • undefined

Links

loginRequired(callback)

Global Function

Login is required. If pseudonym is missing, ask for a pseudonym. If there is no known method to login the user, generate a loginRequired.authAction event that can be handled at the integration level. If successful, check if the user is logged in.

parameter type default description
callback function function (err, data)

Returns

  • undefined

Links

trackPost(siteId, parent)

Global Function

Tracks a comment post.

parameter type default description
siteId number Livefyre site ID.
parent number Optional. Parent ID of the comment to which a reply was made.

Returns

  • undefined

Links

trackLike(siteId)

Global Function

Tracks a comment like.

parameter type default description
siteId number Livefyre site ID.

Returns

  • undefined

Links

trackShare(siteId, platform)

Global Function

Tracks sharing a comment to the social media.

parameter type default description
siteId number Livefyre site ID.
platform string e.g. facebook, twitter

Returns

  • undefined

Links

trackMention(siteId, platform)

Global Function

Tracks when a social media user is mentioned.

parameter type default description
siteId number Livefyre site ID.
platform string e.g. facebook, twitter

Returns

  • undefined

Links

trackUnsubscribeFromEmailAlert(unsubscribeList)

Global Function

Tracks when a user unsubscribes from the email alert.

parameter type default description
unsubscribeList Array List of unsubscribes

Returns

  • undefined

Links

trackSudsDown

Global Function

Tracks when SUDS is down.

Returns

  • undefined

Links

trackLivefyreDown

Global Function

Tracks when Livefyre is down and the resources cannot be loaded.

Returns

  • undefined

Links

trackSuccessLoad

Global Function

Tracks when the widget is successfully loaded.

Returns

  • undefined

Links

showChangePseudonymDialog(currentPseudonym, callback)

Global Function

Settings dialog where the user can change its pseudonym or email preferences.

parameter type default description
currentPseudonym Object Required. Current pseudonym of the user.
callback function Optional. function (err, data), where data is the new authentication data.

Returns

  • undefined

Links

emptyLivefyreActionQueue

Global Function

Livefyre creates a queue in localStorage when a user posts a comment without being logged in. This method clears the queue.

Returns

  • undefined

Links

isPermalinkPresent

Global Function

Detects if the URL is a Livefyre permalink. This can be used to override the lazy loading of the widget.

Returns

  • Boolean - Returns if permalink is present or not

Links

cloneObject(obj)

Global Function

Clones a plain object by serializing and deserializing an object to JSON.

parameter type default description
obj object Object to be cloned.

Returns

  • object - Cloned object

Links

authDelegate

Global Property

See http://docs.livefyre.com/developers/identity-integration/#AuthDelegateObject

Links

pseudonymMissing

Global Property

Type

  • Boolean

Pseudonym is still missing.

Links

pseudonymWasMissing

Global Property

Type

  • Boolean

Pseudonym was missing since the page was loaded and only 1 comment was posted.

Links

lfStringOverride

Global Property

Type

  • Object

Livefyre string overrides. See http://docs.livefyre.com/developers/reference/customization/string-customizations/

Links

subscribeTermsTranslate

Global Property

Tracks when a user subscribes for email alert

Links

loadLivefyreCore

Global Property

Load Livefyre's core Javascript library

Links

module.exports

Static Property

Type

  • object

Widget.js exposed as main constructor

Links

config.livefyre.disableAvatars

Static Property

Avatar disabled.

Links

config.livefyre.disableIE8Shim

Static Property

Disable HTML5 shiv by Livefyre

Links

config.livefyre.disableThirdPartyAnalytics

Static Property

Disable Livefyre internal analytics

Links

Widget~stringOverrides

Inner Property

Type

  • Object

Merge custom string overrides with FT specific string overrides.

Links

Widget~login

Inner Function

Adds the "Commenting settings" link when login occurs.

Returns

  • undefined

Links

Widget~logout

Inner Function

Removes the "Commenting settings" link when logout occurs.

Returns

  • undefined

Links

Switch component view

GitHub Repository

Install o-comments

If using the Build Service, add o-comments@^4.1.2 to your script and link tags.

If running a Manual Build, run bower install --save "o-comments@^4.1.2".

Help & Support

o-comments is maintained directly by the Origami team. If you have any questions about o-comments or Origami in general, we are happy to help. 😊

Slack: #ft-origami
Email: origami.support@ft.com

Feedback / Issues

To report a bug or request features please create an issue on Github. For support or general feedback please get in touch 😊

Slack: #ft-origami
Email: origami.support@ft.com