-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Sevio Vendor skeleton * Sevio Vendor skeleton config. Prefetch js * Modify sevio.js file * Modify path to amp.js instead of loader-amp.js * Update path to CDN amp.js * Fix sevio width and height - linter errors * Added extra new line before and after sevio in the _config.js
- Loading branch information
Showing
8 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// src/polyfills.js must be the first import. | ||
import '#3p/polyfills'; | ||
|
||
import {register} from '#3p/3p'; | ||
import {draw3p, init} from '#3p/integration-lib'; | ||
|
||
import {sevio} from '#ads/vendors/sevio'; | ||
|
||
init(window); | ||
register('sevio', sevio); | ||
|
||
window.draw3p = draw3p; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {loadScript, validateData} from '#3p/3p'; | ||
|
||
/** | ||
* @param {!Window} global | ||
* @param {!Object} data | ||
*/ | ||
export function sevio(global, data) { | ||
validateData(data, ['zone']); | ||
|
||
const container = document.getElementById('c'); | ||
const adDivId = 'sevioads-amp-' + encodeURIComponent(data.zone); | ||
const adDiv = document.createElement('div'); | ||
adDiv.setAttribute('id', adDivId); | ||
container.appendChild(adDiv); | ||
|
||
loadScript( | ||
global, | ||
'https://cdn.adx.ws/scripts/amp.js', | ||
() => { | ||
window.sevioAmpLoader = window.sevioAmpLoader || []; | ||
window.sevioAmpLoader.push({ | ||
zoneId: encodeURIComponent(data.zone), | ||
placeholderId: encodeURIComponent(adDivId), | ||
wu: window.location.href, | ||
width: data.width, | ||
height: data.height, | ||
}); | ||
}, | ||
() => { | ||
global.context.noContentAvailable(); | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Sevio | ||
|
||
## Example of Sevio's model implementation | ||
|
||
### Basic | ||
|
||
```html | ||
<amp-ad | ||
type="sevio" | ||
width="300" | ||
height="250" | ||
data-zone="zoneId" | ||
> | ||
</amp-ad> | ||
``` | ||
|
||
### Required parameters | ||
|
||
- `data-zone`: Zone ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters