Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ampproject/amphtml into a…
Browse files Browse the repository at this point in the history
…mp_reddit_extension

* 'master' of https://github.com/ampproject/amphtml: (121 commits)
  `#setOwner` should rewrite `resource.owner_` value if it exist (ampproject#5898)
  Defer full upgrade until the element is connected (ampproject#5908)
  Skeleton for an amp-animation component (ampproject#5891)
  Use upgrade callback to pick the correct carousel class. (ampproject#5899)
  Add alert role to user-notification by default (ampproject#5896)
  Fix test-iframe-createIframeWithMessageStub failures on older browsers (ampproject#5895)
  Make screen readers announce changes in the slides carousel. (ampproject#5892)
  Separate out implementaton of document-info and remove dependency of … (ampproject#5864)
  Fixed assertion in key fetch function. (ampproject#5854)
  Track impression on amp landing page (ampproject#5606)
  Backward compatible way of stringifying Uint8Array (ampproject#5881)
  Ensure that a friendly-iframe embed cancels any boilerplate when ready (ampproject#5863)
  Fix amp-forms broken and flakey tests. (ampproject#5835)
  Make SW test properly skip when Request == undefined (ampproject#5876)
  Add Preamble section to AMP Cache Guidelines (ampproject#5873)
  Adding Adverline to amp-ad (ampproject#5829)
  Clarify cache guidelines (ampproject#5874)
  Consider it as non-viewer mode if there is no "origin" in hash param. (ampproject#5867)
  [amp-youtube] autoplay and test suite to run across all video players that implement the video API (ampproject#5765)
  Update Forms Docs to reflect availability. (ampproject#5815)
  ...
  • Loading branch information
Max Haarhaus committed Oct 31, 2016
2 parents a0e690c + 7ae082b commit 314d2b1
Show file tree
Hide file tree
Showing 241 changed files with 8,127 additions and 2,038 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Expand Up @@ -19,13 +19,15 @@ addons:
- python-protobuf
before_install:
- |
[ -z "$(git diff --name-only $TRAVIS_COMMIT_RANGE)" ] || git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(md|txt)$)|(^(examples|spec))/' || {
[ -z "$(git diff --name-only $TRAVIS_COMMIT_RANGE)" ] || git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.(md|txt)$)|(^spec)/' || {
echo "Only docs were updated, stopping build process."
exit
}
- export CHROME_BIN=chromium-browser
- export CHROME_BIN=google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome*.deb
before_script:
- pip install --user protobuf
script: node build-system/pr-check.js $TRAVIS_COMMIT_RANGE
Expand Down
17 changes: 15 additions & 2 deletions 3p/integration.js
Expand Up @@ -53,6 +53,7 @@ import {adspirit} from '../ads/adspirit';
import {adstir} from '../ads/adstir';
import {adtech} from '../ads/adtech';
import {aduptech} from '../ads/aduptech';
import {adverline} from '../ads/adverline';
import {advertserve} from '../ads/advertserve';
import {affiliateb} from '../ads/affiliateb';
import {amoad} from '../ads/amoad';
Expand All @@ -75,6 +76,8 @@ import {imobile} from '../ads/imobile';
import {improvedigital} from '../ads/improvedigital';
import {inmobi} from '../ads/inmobi';
import {kargo} from '../ads/kargo';
import {kixer} from '../ads/kixer';
import {ligatus} from '../ads/ligatus';
import {loka} from '../ads/loka';
import {mads} from '../ads/mads';
import {mantisDisplay, mantisRecommend} from '../ads/mantis';
Expand All @@ -96,6 +99,7 @@ import {revcontent} from '../ads/revcontent';
import {rubicon} from '../ads/rubicon';
import {sharethrough} from '../ads/sharethrough';
import {smartadserver} from '../ads/smartadserver';
import {smartclip} from '../ads/smartclip';
import {sortable} from '../ads/sortable';
import {sovrn} from '../ads/sovrn';
import {taboola} from '../ads/taboola';
Expand All @@ -104,10 +108,12 @@ import {triplelift} from '../ads/triplelift';
import {webediads} from '../ads/webediads';
import {weboramaDisplay} from '../ads/weborama';
import {widespace} from '../ads/widespace';
import {yahoo} from '../ads/yahoo';
import {yahoojp} from '../ads/yahoojp';
import {yieldbot} from '../ads/yieldbot';
import {yieldmo} from '../ads/yieldmo';
import {yieldone} from '../ads/yieldone';
import {zedo} from '../ads/zedo';
import {zergnet} from '../ads/zergnet';
import {zucks} from '../ads/zucks';

Expand All @@ -116,11 +122,12 @@ import {zucks} from '../ads/zucks';
* @const {!Object<string, boolean>}
*/
const AMP_EMBED_ALLOWED = {
taboola: true,
_ping_: true,
'mantis-recommend': true,
plista: true,
smartclip: true,
taboola: true,
zergnet: true,
_ping_: true,
};

const data = parseFragment(location.hash);
Expand Down Expand Up @@ -148,6 +155,7 @@ register('adspirit', adspirit);
register('adstir', adstir);
register('adtech', adtech);
register('aduptech', aduptech);
register('adverline', adverline);
register('advertserve', advertserve);
register('affiliateb', affiliateb);
register('amoad', amoad);
Expand All @@ -172,6 +180,8 @@ register('improvedigital', improvedigital);
register('industrybrains', industrybrains);
register('inmobi', inmobi);
register('kargo', kargo);
register('kixer', kixer);
register('ligatus', ligatus);
register('loka', loka);
register('mads', mads);
register('mantis-display', mantisDisplay);
Expand All @@ -195,6 +205,7 @@ register('revcontent', revcontent);
register('rubicon', rubicon);
register('sharethrough', sharethrough);
register('smartadserver', smartadserver);
register('smartclip', smartclip);
register('sortable', sortable);
register('sovrn', sovrn);
register('taboola', taboola);
Expand All @@ -204,11 +215,13 @@ register('twitter', twitter);
register('webediads', webediads);
register('weborama-display', weboramaDisplay);
register('widespace', widespace);
register('yahoo', yahoo);
register('yahoojp', yahoojp);
register('yieldbot', yieldbot);
register('yieldmo', yieldmo);
register('zergnet', zergnet);
register('yieldone', yieldone);
register('zedo', zedo);
register('zucks', zucks);

// For backward compat, we always allow these types without the iframe
Expand Down
5 changes: 5 additions & 0 deletions 3p/polyfills.js
Expand Up @@ -21,3 +21,8 @@

// This list should not get longer without a very good reason.
import '../third_party/babel/custom-babel-helpers';
import {install as installMathSign} from '../src/polyfills/math-sign';
import {install as installObjectAssign} from '../src/polyfills/object-assign';

installMathSign(self);
installObjectAssign(self);
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
-->

[![Build Status](https://travis-ci.org/ampproject/amphtml.svg?branch=master)](https://travis-ci.org/ampproject/amphtml)
[![Issue Stats](http://issuestats.com/github/ampproject/amphtml/badge/pr)](http://issuestats.com/github/ampproject/amphtml)
[![Issue Stats](http://issuestats.com/github/ampproject/amphtml/badge/issue)](http://issuestats.com/github/ampproject/amphtml)
[![Issue Stats](http://issuestats.com/github/ampproject/amphtml/badge/pr?style=flat)](http://issuestats.com/github/ampproject/amphtml)
[![Issue Stats](http://issuestats.com/github/ampproject/amphtml/badge/issue?style=flat)](http://issuestats.com/github/ampproject/amphtml)

# AMP HTML ⚡

Expand Down
2 changes: 1 addition & 1 deletion ads/README.md
Expand Up @@ -231,7 +231,7 @@ If you're adding support for a new 3P ad service, changes to the following files

### Verify your examples

To verify the examples that you have put in `/examples/ads.amp.html`, you will need to start a local gulp web server by running command `gulp`. Then visit `http://localhost:8000/examples/ads.amp.max.html` in your browser to make sure the examples load ads.
To verify the examples that you have put in `/examples/ads.amp.html`, you will need to start a local gulp web server by running command `gulp`. Then visit `http://localhost:8000/examples/ads.amp.max.html?type=yournetwork` in your browser to make sure the examples load ads.

Please consider having the example consistently load a fake ad (with ad targeting disabled). Not only it will be a more confident example for publishers to follow, but also for us to catch any regression bug during our releases.

Expand Down
2 changes: 1 addition & 1 deletion ads/_a4a-config.js
Expand Up @@ -64,5 +64,5 @@ if (getMode().localDev || getMode().test) {
*/
export const signingServerURLs = {
'google': 'https://cdn.ampproject.org/amp-ad-verifying-keyset.json',
// TODO(levitzky) Add dev key path once it is live.
'google-dev': 'https://cdn.ampproject.org/amp-ad-verifying-keyset-dev.json',
};
37 changes: 36 additions & 1 deletion ads/_config.js
Expand Up @@ -98,6 +98,14 @@ export const adConfig = {
prefetch: 'https://s.d.adup-tech.com/jsapi',
},

adverline: {
prefetch: 'https://ads.adverline.com/richmedias/amp.js',
preconnect: [
'https://adnext.fr',
],
renderStartImplemented: true,
},

advertserve: {
renderStartImplemented: true,
},
Expand Down Expand Up @@ -179,6 +187,8 @@ export const adConfig = {
],
},

fake: {},

flite: {},

genieessp: {
Expand Down Expand Up @@ -213,6 +223,13 @@ export const adConfig = {

kargo: {},

kixer: {
prefetch: 'https://cdn.kixer.com/ad/load.js',
renderStartImplemented: true,
},

ligatus: {},

loka: {
prefetch: 'https://loka-cdn.akamaized.net/scene/amp.js',
preconnect: [
Expand Down Expand Up @@ -334,14 +351,22 @@ export const adConfig = {

rubicon: {},

sharethrough: {},
sharethrough: {
renderStartImplemented: true,
},

smartadserver: {
prefetch: 'https://ec-ns.sascdn.com/diff/js/amp.v0.js',
preconnect: 'https://static.sascdn.com',
renderStartImplemented: true,
},

smartclip: {
prefetch: 'https://cdn.smartclip.net/amp/amp.v0.js',
preconnect: 'https://des.smartclip.net',
renderStartImplemented: true,
},

sortable: {
prefetch: 'https://www.googletagservices.com/tag/js/gpt.js',
preconnect: [
Expand Down Expand Up @@ -387,6 +412,11 @@ export const adConfig = {

widespace: {},

yahoo: {
prefetch: 'https://s.yimg.com/os/ampad/display.js',
preconnect: 'https://us.adserver.yahoo.com',
},

yahoojp: {
prefetch: [
'https://s.yimg.jp/images/listing/tool/yads/ydn/amp/amp.js',
Expand Down Expand Up @@ -416,6 +446,11 @@ export const adConfig = {
prefetch: 'https://img.ak.impact-ad.jp/ic/pone/commonjs/yone-amp.js',
},

zedo: {
prefetch: 'https://ss3.zedo.com/gecko/tag/Gecko.amp.min.js',
renderStartImplemented: true,
},

zergnet: {},

zucks: {
Expand Down
2 changes: 1 addition & 1 deletion ads/_integration-guide.md
Expand Up @@ -87,4 +87,4 @@ Also see approach to using the [intersection observer pattern](https://github.co

*Examples : Taboola, Outbrain*

If you have some piece of JavaScript embeded on the publisher website today but the approach will not work in AMP pages. If you would like to recommend content on an AMP page, we suggest that you use the amp-embed extension to request the content details. Please see the [Taboola](https://github.com/ampproject/amphtml/blob/master/ads/taboola.md) example.
Useful if you have some piece of JavaScript embeded on the publisher website today but the approach will not work in AMP pages. If you would like to recommend content on an AMP page, we suggest that you use the [`amp-embed` extension](https://www.ampproject.org/docs/reference/components/amp-ad) to request the content details. Please see the [Taboola](https://github.com/ampproject/amphtml/blob/master/ads/taboola.md) example.
12 changes: 9 additions & 3 deletions ads/_ping_.js
Expand Up @@ -43,11 +43,17 @@ export function _ping_(global, data) {
}
document.body.appendChild(img);
if (width || height) {
context.renderStart({width, height});
global.context.renderStart({width, height});
} else {
context.renderStart();
global.context.renderStart();
}
global.context.observeIntersection(function(changes) {
changes.forEach(function(c) {
dev().info('Intersection: (WxH)' +
`${c.intersectionRect.width}x${c.intersectionRect.height}`);
});
});
} else {
context.noContentAvailable();
global.context.noContentAvailable();
}
}
27 changes: 25 additions & 2 deletions ads/ads.extern.js
Expand Up @@ -19,7 +19,13 @@
/** @constructor */
function BaseElement$$module$src$base_element() {};
/** @constructor */
function AmpAdApiHandler$$module$extensions$amp_ad$0_1$amp_ad_api_handler() {};
function AmpAdXOriginIframeHandler$$module$extensions$amp_ad$0_1$amp_ad_xorigin_iframe_handler() {};
/** @constructor */
function AmpAd3PImpl$$module$extensions$amp_ad$0_1$amp_ad_3p_impl() {};
/** @constructor */
function AmpA4A$$module$extensions$amp_a4a$0_1$amp_a4a() {};
/** @constructor */
function AmpAdUIHandler$$module$extensions$amp_ad$0_1$amp_ad_ui() {};

// Long list of, uhm, stuff the ads code needs to compile.
// All unquoted external properties need to be added here.
Expand Down Expand Up @@ -49,6 +55,7 @@ data.epl_ksv;
data.epl_kvs;
data.epl_e;
data.guid;
data.adslot;

var Criteo;
Criteo.DisplayAd;
Expand Down Expand Up @@ -200,8 +207,24 @@ data.enablemraid;
data.jsplayer;
var sas;
sas.callAmpAd;

data.uuid;
data.embedcreated;
data.embedparent
data.embedlive
var ZGTag;
var geckoTag;
var placement;
data.superId;
data.network;
geckoTag.setAMP;
geckoTag.addPlacement;
data.placementId;
data.channel;
data.publisher;
data.dim;
placement.includeRenderer;
geckoTag.loadAds;
geckoTag.placementReady;
data.plc;
data.sz;
data.extra;
27 changes: 27 additions & 0 deletions ads/adverline.js
@@ -0,0 +1,27 @@
/**
* Copyright 2015 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {validateData, writeScript} from '../3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function adverline(global, data) {
validateData(data, ['id', 'plc'], ['s', 'section']);

writeScript(global, 'https://ads.adverline.com/richmedias/amp.js');
}
40 changes: 40 additions & 0 deletions ads/adverline.md
@@ -0,0 +1,40 @@
<!---
Copyright 2015 The AMP HTML Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Adverline

## Examples

### Single ad

```html
<amp-ad width=300 height=250
type="adverline"
data-id="your_publisher_id"
data-plc="your_plc"
data-section="your,test,sections" >
</amp-ad>
```

## Configuration

Required parameters:
- id: site ID
- plc: format ID (unique per page)

Additional parameters:
- section: tag list, separated by commas
- s: dynamic sizing, allowed values: fixed, all, small (default), big
2 changes: 1 addition & 1 deletion ads/alp/handler.js
Expand Up @@ -139,7 +139,7 @@ function getEventualUrl(a) {
if (!eventualUrl) {
return;
}
if (!eventualUrl.indexOf(`${urls.cdn}/c/`) == 0) {
if (eventualUrl.indexOf(`${urls.cdn}/c/`) != 0) {
return;
}
return eventualUrl;
Expand Down

0 comments on commit 314d2b1

Please sign in to comment.