(global, data)
| 5 | * @param {!Object} data |
| 6 | */ |
| 7 | export function ppstudio(global, data) { |
| 8 | validateData(data, ['crid', 'width', 'height', 'holderScript'], []); |
| 9 | |
| 10 | global._ppstudio = { |
| 11 | crid: data.crid, |
| 12 | width: data.width, |
| 13 | height: data.height, |
| 14 | holderScript: data.holderScript, |
| 15 | }; |
| 16 | |
| 17 | const e = global.document.createElement('script'); |
| 18 | e.id = 'pps-script-' + data.crid; |
| 19 | e.setAttribute('data-width', data.width); |
| 20 | e.setAttribute('data-height', data.height); |
| 21 | e.setAttribute('data-click-url', ''); |
| 22 | e.src = data.holderScript; |
| 23 | global.document.getElementById('c').appendChild(e); |
| 24 | |
| 25 | const i = global.document.createElement('ins'); |
| 26 | i.classList.add('ppstudio'); |
| 27 | i.setAttribute('data-pps-target-id', 'cr-' + data.crid); |
| 28 | global.document.getElementById('c').appendChild(i); |
| 29 | |
| 30 | loadScript(global, 'https://ads-cdn.tenmax.io/code/ppstudio.js', () => { |
| 31 | global.context.renderStart(); |
| 32 | }); |
| 33 | } |
nothing calls this directly
no test coverage detected