MCPcopy
hub / github.com/ampproject/amphtml / getLikeContainer

Function getLikeContainer

3p/facebook.js:148–159  ·  view source on GitHub ↗

* Create DOM element for the Facebook like-button plugin: * Reference: https://developers.facebook.com/docs/plugins/like-button * @param {!Window} global * @param {!Object} data The element data * @return {!Element} div

(global, data)

Source from the content-addressed store, hash-verified

146 * @return {!Element} div
147 */
148function getLikeContainer(global, data) {
149 const container = createContainer(global, 'like', data.href);
150 container.setAttribute('data-action', data.action || 'like');
151 container.setAttribute('data-colorscheme', data.colorscheme || 'light');
152 container.setAttribute('data-kd_site', data.kd_site || 'false');
153 container.setAttribute('data-layout', data.layout || 'standard');
154 container.setAttribute('data-ref', data.ref || '');
155 container.setAttribute('data-share', data.share || 'false');
156 container.setAttribute('data-show_faces', data.show_faces || 'false');
157 container.setAttribute('data-size', data.size || 'small');
158 return container;
159}
160
161/**
162 * Create DOM element for the Facebook embedded content plugin.

Callers 1

getEmbedContainerFunction · 0.85

Calls 2

createContainerFunction · 0.70
setAttributeMethod · 0.45

Tested by

no test coverage detected