Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ampproject/amphtml
Browse files Browse the repository at this point in the history
  • Loading branch information
nitzanj committed May 6, 2019
2 parents 413d780 + b814e5d commit d5c6c2a
Show file tree
Hide file tree
Showing 169 changed files with 6,655 additions and 3,620 deletions.
14 changes: 12 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"root": true,
"parser": "babel-eslint",
"plugins": [
"amphtml-internal",
"chai-expect",
"eslint-plugin-amphtml-internal",
"eslint-plugin-google-camelcase",
"google-camelcase",
"jsdoc",
"notice",
"sort-imports-es6-autofix",
"sort-requires"
],
Expand Down Expand Up @@ -135,6 +136,15 @@
"no-undef": 2,
"no-var": 2,
"no-warning-comments": [2, { "terms": ["do not submit"], "location": "anywhere" }],
"notice/notice": [2,
{
"mustMatch": "Copyright 20\\d{2} The AMP HTML Authors\\.",
"templateFile": "LICENSE-TEMPLATE.txt",
"messages": {
"whenFailedToMatch": "Missing or incorrect license header"
}
}
],
"object-curly-spacing": [2, "never", {
"objectsInObjects": false,
"arraysInObjects": false
Expand Down
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/release-tracking-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Release tracking issue
about: Create a tracking issue for a new AMP release (to be used by release on-duty
engineers)
title: "\U0001F684 Release tracking issue for release <RELEASE_NUMBER>"
labels: 'Type: Release'
assignees: ''

---

# Release tracking issue

<!--
Note to onduty:
Use this issue to track a release from the initial canary release build through
production. The community uses this issue to keep track of what is going on
with the release so please keep this issue up to date:
- As you reach each stage of the release, check the appropriate checkbox and replace <CL submit time> with the "Submitted" text from the corresponding CL, e.g. "2:49 PM, Jul 25, 2018 UTC-4".
- If you need to perform cherry picks, add new checkboxes here (by editing this
issue), making sure to use the release number for the new build. Link the
release number to the GitHub tag page the first time a given release number
appears in the checkboxes.
- Add any updates that may be of interest to the community (such as delays) as
comments on this issue, including after the release is pushed to production.
- Keep the title of the issue updated to reflect whether this issue is tracking
the Canary or the build in Production.
Note: remove the backticks (``) from the link.
-->

- [x] Release `[<RELEASE_NUMBER>](https://github.com/ampproject/amphtml/releases/tag/<RELEASE_NUMBER>)` is cut as a new canary release
- [ ] Release <RELEASE_NUMBER> pushed to dev channel (<CL submit time>)
- [ ] Release <RELEASE_NUMBER> pushed to 1% (<CL submit time>)
- [ ] Release <RELEASE_NUMBER> pushed to production (<CL submit time>)

<!--
If you perform cherry picks, add/update the checkboxes above as needed e.g.
- [ ] Release `[<CHERRY_PICK_RELEASE_NUMBER>](...)` created with cherry picks.
- [ ] Release <CHERRY_PICK_RELEASE_NUMBER> pushed to Dev Channel
-->

See the [release documentation](https://github.com/ampproject/amphtml/blob/master/contributing/release-schedule.md) for more information on the release process, including how to test changes in the Dev Channel.

If you find a bug in this build, please file an [issue](https://github.com/ampproject/amphtml/issues/new). If you believe the bug should be fixed in this build, follow the instructions in the [cherry picks documentation](https://bit.ly/amp-cherry-pick).
50 changes: 1 addition & 49 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,49 +1 @@
# The AMP open source project code of conduct

All members, committers and volunteers in this community are required to act according to the following code of conduct. We encourage you to follow these guidelines, which help steer our interactions, keep the AMP Project a positive, growing project and community and provide and ensure a safe environment for everyone.

## Responsible and enforcing this code of conduct

If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact us immediately: contact Malte Ubl (malte.ubl+coc@gmail.com) or Dima Voytenko dimav+coc@google.com. We are here to help you. Your reports will be taken seriously and not dismissed or argued with.

## What we believe in and how we act

- We are committed to providing a friendly, safe and welcoming environment for everyone, regardless of gender, sexual orientation, personal ability or disability, ethnicity, religion, level of experience, set of skills or similar personal characteristics.
- Our community is based on mutual respect, tolerance, and encouragement.
- We believe that a diverse community where people treat each other with respect is stronger, more vibrant and has more potential contributors and more sources for ideas. We aim for more diversity.
- We are kind, welcoming and courteous to everyone.
- We’re respectful of others, their positions, their skills, their commitments and their efforts.
- We’re attentive in our communications, whether in person or online, and we're tactful when approaching differing views.
- We are aware that language shapes reality. Thus, we use inclusive, gender-neutral language in the documents we provide and when we talk to people. When referring to a group of people, we aim to use gender-neutral terms like “team”, “folks”, “everyone”. (For details, we recommend [this post](https://modelviewculture.com/pieces/gendered-language-feature-or-bug-in-software-documentation)).
- We respect that people have differences of opinion and criticize constructively.

## Don't

- Don’t be mean or rude.
- Don’t discriminate against anyone. Although we have phrased the formal diversity statement generically to make it all-inclusive, we recognize that there are specific attributes that are used to discriminate against people. In alphabetical order, some of these attributes include (but are not limited to): age, culture, ethnicity, gender identity or expression, national origin, physical or mental difference, politics, race, religion, sex, sexual orientation, socio-economic status, and subculture. We welcome people regardless of these or other attributes.
- Sexism and racism of any kind (including sexist and racist “jokes”), demeaning or insulting behaviour and harassment are seen as direct violations to this code of conduct. Harassment includes offensive verbal comments related to gender, sexual orientation, disability, physical appearance, body size, race, religion, sexual images in public spaces, deliberate intimidation, stalking, following, harassing photography or recording, inappropriate physical contact, and unwelcome sexual attention.
- On IRC, Slack and other online or offline communications channels, don't use overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all.
- Unwelcome / non-consensual sexual advances over IRC or any other channels related with this community are not okay.
- Derailing, tone arguments and otherwise playing on people's desires to be nice are not welcome, especially in discussions about violations to this code of conduct.
- Please avoid unstructured critique.
- Likewise, any spamming, trolling, flaming, baiting or other attention-stealing behaviour is not welcome.

## Consequences for violations of this code of conduct

If a participant engages in any behavior violating this code of conduct, the core members of this community may take any action they deem appropriate, including warning the offender or expulsion from the community, exclusion from any interaction and loss of all rights in this community.

## Decisions about consequences of violations

Decisions about consequences of violations of this code of conduct are being made by this community's core committers and will not be discussed with the person responsible for the violation.

## For questions or feedback

If you have any questions or feedback on this code of conduct, we're happy to hear from you: amphtml-coc@googlegroups.com (Private group; posts are not publicly visible; access is limited to selected committers)

## Thanks for the inspiration

This code of conduct is based on the [Hoodie Community Code of Conduct](http://hood.ie/code-of-conduct/), with permission.

## License

This page is licensed as [CC-BY-NC](http://creativecommons.org/licenses/by-nc/4.0/).
See https://github.com/ampproject/meta/blob/master/CODE_OF_CONDUCT.md
15 changes: 15 additions & 0 deletions LICENSE-TEMPLATE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright <%= YEAR %> 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.
*/
31 changes: 19 additions & 12 deletions ads/google/imaVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
import {CONSENT_POLICY_STATE} from '../../src/consent-state';
import {ImaPlayerData} from './ima-player-data';
import {camelCaseToTitleCase, px, setStyle, setStyles} from '../../src/style';
import {getData} from '../../src/event-helper';
import {isObject} from '../../src/types';
import {loadScript} from '../../3p/3p';
import {throttle} from '../../src/utils/rate-limit';
import {tryParseJson} from '../../src/json';


/**
* Possible player states.
* @enum {number}
Expand Down Expand Up @@ -1354,14 +1356,18 @@ export function hideControls() {
* @param {!Event} event
*/
function onMessage(global, event) {
const msg = isObject(event.data) ? event.data : tryParseJson(event.data);
if (msg === undefined) {
const eventData = getData(event);
if (!eventData) {
return;
}
const msg = isObject(eventData) ? eventData : tryParseJson(eventData);
if (!msg) {
return; // We only process valid JSON.
}
if (!msg.event || !msg.func) {
if (!msg['event'] || !msg['func']) {
return;
}
switch (msg.func) {
switch (msg['func']) {
case 'playVideo':
if (adsActive) {
adsManager.resume();
Expand Down Expand Up @@ -1398,22 +1404,23 @@ function onMessage(global, event) {
}
break;
case 'resize':
if (msg.args && msg.args.width && msg.args.height) {
const args = msg['args'];
if (args && args.width && args.height) {
setStyles(wrapperDiv, {
'width': px(msg.args.width),
'height': px(msg.args.height),
'width': px(args.width),
'height': px(args.height),
});
setStyles(bigPlayDiv, {
'width': px(msg.args.width),
'height': px(msg.args.height),
'width': px(args.width),
'height': px(args.height),
});
if (adsActive && !fullscreen) {
adsManager.resize(
msg.args.width, msg.args.height,
args.width, args.height,
global.google.ima.ViewMode.NORMAL);
} else {
adsManagerWidthOnLoad = msg.args.width;
adsManagerHeightOnLoad = msg.args.height;
adsManagerWidthOnLoad = args.width;
adsManagerHeightOnLoad = args.height;
}
}
break;
Expand Down
31 changes: 15 additions & 16 deletions ads/ucfunnel.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/*
Copyright 2019 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.
*/

/**
* Copyright 2019 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 {loadScript, validateData} from '../3p/3p';

Expand Down
31 changes: 15 additions & 16 deletions ads/unruly.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/*
Copyright 2018 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.
*/

/**
* Copyright 2018 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 {loadScript, validateData} from '../3p/3p';

Expand Down
7 changes: 4 additions & 3 deletions build-system/check-package-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,14 @@ function checkGlobalGulp() {
cyan('"yarn global add gulp-cli"') + yellow('.'));
} else if (!firstInstall) {
const gulpVersions = getStdout(gulpExecutable + ' --version').trim();
const gulpVersion = gulpVersions.match(/Local version (.*?)$/);
const gulpVersion = gulpVersions.match(/Local version[:]? (.*?)$/);
if (gulpVersion && gulpVersion.length == 2) {
console.log(green('Detected'), cyan('gulp'), green('version'),
cyan(gulpVersion[1]) + green('.'));
} else {
console.log(yellow('WARNING: Something went wrong. ' +
'Could not determine the local version of gulp.'));
console.log(yellow('WARNING: ' +
'Could not determine the local version of gulp. ' +
'(This is normal during install / upgrade.)'));
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions build-system/compile/closure-compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@

const closureCompiler = require('google-closure-compiler');
const colors = require('ansi-colors');
const {closureNailgunPort} = require('../tasks/nailgun');
const {highlight} = require('cli-highlight');

// Also used in gulpfile.js
const NAILGUN_PORT = '2114';

let compilerErrors = '';

/**
Expand Down Expand Up @@ -61,7 +59,6 @@ exports.handleSinglePassCompilerError = function() {
function handleError(message) {
console./*OK*/error(
`${message}\n` + formatClosureCompilerError(compilerErrors));
process.exit(1);
}

/**
Expand All @@ -82,7 +79,7 @@ exports.gulpClosureCompile = function(compilerOptions) {
if (process.platform == 'darwin' || process.platform == 'linux') {
compilerOptions = [
'--nailgun-port',
NAILGUN_PORT,
closureNailgunPort,
'org.ampproject.AmpCommandLineRunner',
'--',
].concat(compilerOptions);
Expand Down
Loading

0 comments on commit d5c6c2a

Please sign in to comment.