forked from spongedouglas/spongeapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spongeapi.custom.min.js
1 lines (1 loc) · 1.15 KB
/
spongeapi.custom.min.js
1
var spongeapi=spongeapi||{};spongeapi.initComplete=!1,postMessage(JSON.stringify({type:"api",topic:"setup",iid:spongecell.studioAd.iid,callback:"handleSetupResponse"}),"*"),spongeapi.openScreen=function(e,n){window!=parent.top?n&&n.engagement?postMessage(JSON.stringify({iid:spongecell.studioAd.iid,topic:"nav",type:"api",engage:!0,screen:e}),"*"):postMessage(JSON.stringify({iid:spongecell.studioAd.iid,topic:"nav",type:"api",engage:!1,screen:e}),"*"):console.log("openScreen("+e+","+n+")")},spongeapi.openLanding=function(e){window!=parent.top?postMessage(JSON.stringify({iid:spongecell.studioAd.iid,topic:"nav",type:"api",landingPage:spongecell.apiData.landingPages[e]}),"*"):console.log("openLanding("+e+"): "+spongecell.apiData.landingPages[e].url)},spongeapi.getDynamicText=function(e){return spongecell.hasOwnProperty("apiData")?spongecell.apiData.properties[e].text:e},spongeapi.getDynamicImage=function(e){return spongecell.hasOwnProperty("apiData")?spongecell.apiData.assets[e].src:e},handleSetupResponse=function(e){spongeapi.initComplete||(window.spongecell.apiData=e||{},!spongecell.apiData.assets&&testData&&(spongecell.apiData=testData)),spongeapi.initComplete=!0};