Skip to content

myWidget Ad extension#7252

Closed
3lvcz wants to merge 8 commits intoampproject:masterfrom
mailru:ad-mywidget
Closed

myWidget Ad extension#7252
3lvcz wants to merge 8 commits intoampproject:masterfrom
mailru:ad-mywidget

Conversation

@3lvcz
Copy link
Copy Markdown
Contributor

@3lvcz 3lvcz commented Jan 30, 2017

Pull-request for "myWidget" ad.

Closes #6965

@googlebot
Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@3lvcz
Copy link
Copy Markdown
Contributor Author

3lvcz commented Jan 30, 2017

I signed it!

@jridgewell
Copy link
Copy Markdown
Contributor

/to @lannka

@lannka lannka self-assigned this Jan 31, 2017
@3lvcz
Copy link
Copy Markdown
Contributor Author

3lvcz commented Jan 31, 2017

I signed it!

@googlebot
Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

@3lvcz
Copy link
Copy Markdown
Contributor Author

3lvcz commented Jan 31, 2017

I signed it!

Copy link
Copy Markdown
Contributor

@lannka lannka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you also add an example in ads.amp.html and make sure it loads ad locally.

ads/mywidget.js Outdated

// load the myWidget initializer asynchronously
loadScript(global, 'https://likemore-go.imgsmail.ru/widget.amp.js', () => {}, () => {
global.context.noContentAvailable();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can make global.context.noContentAvailable as the last param of loadScript?

ads/mywidget.js Outdated

ready: function(opts) {
// Make sure ready() is called only once.
if (isReady) { return; }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please break lines before } and after {

ads/mywidget.js Outdated
ready: function(opts) {
// Make sure ready() is called only once.
if (isReady) { return; }
else { isReady = true; }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

ads/mywidget.js Outdated
renderStart: global.context.renderStart,
noContentAvailable: global.context.noContentAvailable,

ready: function(opts) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be simplified to:
ready(opts) {

ads/mywidget.js Outdated
const height = data.height;
let isReady = false;

if (!(height >= 0)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

height < 0?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

height < 0 would not quite fit :) data.height can be undefined here, if attribute has invalid value or is absent, so... I can change condition to: if (typeof height === 'undefined' || height < 0) if you like. But there is no guarantee, that the default value of absent attribute not will be null tomorrow :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-) please add a little comment about this trap. to prevent "smart" people like me to refactor it later.

Copy link
Copy Markdown
Contributor

@lannka lannka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you follow the CLA robot's guide? try to use the same email for your git

ads/mywidget.js Outdated
const height = data.height;
let isReady = false;

if (!(height >= 0)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-) please add a little comment about this trap. to prevent "smart" people like me to refactor it later.

@3lvcz
Copy link
Copy Markdown
Contributor Author

3lvcz commented Feb 2, 2017

I signed it!

@3lvcz
Copy link
Copy Markdown
Contributor Author

3lvcz commented Feb 2, 2017

I recently synchronized our fork with current master (because our master revision has build errors and amp.js was not produced). Also I fixed all things that you mentioned in comments and tested ads.amp.html locally. Our Ad works fine.

But I don't understand what should I do with CLA stuff :) I already commited with my github accout one time f3b83b8b and after that created an individual CLA and said "I signed it!". I missed something?

@lannka
Copy link
Copy Markdown
Contributor

lannka commented Feb 3, 2017

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

Can you try this: 1) set git email to the one signed CLA. 2) squash all the commits and then update this PR.

@3lvcz
Copy link
Copy Markdown
Contributor Author

3lvcz commented Feb 8, 2017

I think, squash is not possible, because I pulled master between commits, so I have to squash other commits too in that case. What if we just close this pull request and create another with correct git user? Is that ok?

@3lvcz 3lvcz closed this Feb 10, 2017
@3lvcz 3lvcz mentioned this pull request Feb 10, 2017
@3lvcz
Copy link
Copy Markdown
Contributor Author

3lvcz commented Feb 10, 2017

Done! There is new clean pull-request: #7471

@priver priver deleted the ad-mywidget branch September 12, 2017 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants