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

Function getEmbedContainer

3p/facebook.js:168–182  ·  view source on GitHub ↗

* Create DOM element for the Facebook embedded content plugin. * @param {!Window} global * @param {!Object} data The element data * @param {string} embedAs * @return {!Element} div

(global, data, embedAs)

Source from the content-addressed store, hash-verified

166 * @return {!Element} div
167 */
168function getEmbedContainer(global, data, embedAs) {
169 devAssert(isEnumValue(FacebookEmbedType, embedAs));
170 switch (embedAs) {
171 case FacebookEmbedType.PAGE:
172 return getPageContainer(global, data);
173 case FacebookEmbedType.LIKE:
174 return getLikeContainer(global, data);
175 case FacebookEmbedType.COMMENTS:
176 return getCommentsContainer(global, data);
177 case FacebookEmbedType.VIDEO:
178 return getVideoContainer(global, data);
179 default:
180 return getPostContainer(global, data);
181 }
182}
183
184/**
185 * @param {!Window} global

Callers 1

facebookFunction · 0.85

Calls 7

devAssertFunction · 0.90
isEnumValueFunction · 0.90
getPageContainerFunction · 0.85
getLikeContainerFunction · 0.85
getCommentsContainerFunction · 0.85
getVideoContainerFunction · 0.85
getPostContainerFunction · 0.70

Tested by

no test coverage detected