File tree Expand file tree Collapse file tree 1 file changed +5
-24
lines changed Expand file tree Collapse file tree 1 file changed +5
-24
lines changed Original file line number Diff line number Diff line change @@ -5,34 +5,15 @@ import {loadScript, validateData} from '#3p/3p';
5
5
* @param {!Object } data
6
6
*/
7
7
export function teads ( global , data ) {
8
+ validateData ( data , [ 'pid' ] ) ;
9
+
8
10
/*eslint "local/camelcase": 0*/
9
11
global . _teads_amp = {
10
- allowed_data : [ 'pid' , 'tag' ] ,
11
- mandatory_data : [ 'pid' ] ,
12
- mandatory_tag_data : [ 'tta' , 'ttp' ] ,
13
12
data,
14
13
} ;
15
14
16
- validateData (
17
- data ,
18
- global . _teads_amp . mandatory_data ,
19
- global . _teads_amp . allowed_data
15
+ loadScript (
16
+ global ,
17
+ 'https://a.teads.tv/page/' + encodeURIComponent ( data . pid ) + '/tag'
20
18
) ;
21
-
22
- if ( data . tag ) {
23
- validateData ( data . tag , global . _teads_amp . mandatory_tag_data ) ;
24
- global . _tta = data . tag . tta ;
25
- global . _ttp = data . tag . ttp ;
26
-
27
- loadScript (
28
- global ,
29
- 'https://a.teads.tv/media/format/' +
30
- encodeURI ( data . tag . js || 'v3/teads-format.min.js' )
31
- ) ;
32
- } else {
33
- loadScript (
34
- global ,
35
- 'https://a.teads.tv/page/' + encodeURIComponent ( data . pid ) + '/tag'
36
- ) ;
37
- }
38
19
}
You can’t perform that action at this time.
0 commit comments