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

Function getCommentContainer

3p/reddit.js:29–41  ·  view source on GitHub ↗

* @param {!Window} global * @param {!Object} data The element data * @return {!Element} div

(global, data)

Source from the content-addressed store, hash-verified

27 * @return {!Element} div
28 */
29function getCommentContainer(global, data) {
30 const div = global.document.createElement('div');
31 div.classList.add('reddit-embed');
32 div.setAttribute('data-embed-media', 'www.redditmedia.com');
33 // 'uuid' and 'created' are provided by the embed script, but don't seem
34 // to actually be needed. Account for them, but let them default to undefined.
35 div.setAttribute('data-embed-uuid', data.uuid);
36 div.setAttribute('data-embed-created', data.embedcreated);
37 div.setAttribute('data-embed-parent', data.embedparent || 'false');
38 div.setAttribute('data-embed-live', data.embedlive || 'false');
39
40 return div;
41}
42
43/**
44 * @param {!Window} global

Callers 1

redditFunction · 0.85

Calls 2

addMethod · 0.45
setAttributeMethod · 0.45

Tested by

no test coverage detected