{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/86975444","pull_request_review_id":7605206,"id":86975444,"diff_hunk":"@@ -0,0 +1,94 @@\n+/**\n+ * Copyright 2016 David Karlin, Bachtrack Ltd. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+import {isLayoutSizeDefined} from '../../../src/layout';\n+import {getLifecycleReporter} from '../../../ads/google/a4a/performance';\n+import {user} from '../../../src/log';\n+import {getBatchManager} from './amp-ad-batch-manager.js';\n+import {templatesFor} from '../../../src/template';\n+\n+/** @const {!string} Tag name for 3P AD implementation. */\n+export const TAG_AD_IMAGE = 'amp-ad-image';\n+\n+export class AmpAdImage extends AMP.BaseElement {\n+\n+  /** @param {!AmpElement} element */\n+  constructor(element) {\n+    super(element);\n+\n+    /** @private {string} The base URL of the ad server for this ad */\n+    this.url_ = element.getAttribute('data-url');\n+\n+    /** @private {string} A string identifying this ad slot: the server's responses will be keyed by slot */\n+    this.slot_ = element.getAttribute('data-slot');\n+    if (!this.slot_.match(/^[0-9a-z]+$/)) {\n+      user().error(TAG_AD_IMAGE, 'imagead slot should be alphanumeric: ' +\n+            this.slot_);\n+    }\n+\n+    /** @private {Object} Data passed back from the ad server, via the batch manager */\n+    this.jsondata_ = null;\n+\n+    /** @private {AmpAdBatchManager} This will batch up the display of this ad together with others of the same URL */\n+    this.batchManager_ = getBatchManager(this, this.url_,\n+        'amp-ad[type=imagead]');\n+\n+    this.lifecycleReporter_ = getLifecycleReporter(this, 'amp');\n+    this.lifecycleReporter_.sendPing('adSlotBuilt');\n+  }\n+\n+  /** @override */\n+  getPriority() {\n+    // Loads ads after other content.\n+    return 2;\n+  }\n+\n+  /** @override **/\n+  isLayoutSupported(layout) {\n+    /** @todo Add proper support for more layouts, and figure out which ones we're permitting */","path":"extensions/amp-ad/0.1/amp-ad-image.js","position":null,"original_position":61,"commit_id":"3af7935c6d66a51505e4e805f3b6f2cfa703e9ff","original_commit_id":"f1da813c2254af9c54bc0244812d952e92d9140a","user":{"login":"xgretsch","id":898362,"avatar_url":"https://avatars.githubusercontent.com/u/898362?v=3","gravatar_id":"","url":"https://api.github.com/users/xgretsch","html_url":"https://github.com/xgretsch","followers_url":"https://api.github.com/users/xgretsch/followers","following_url":"https://api.github.com/users/xgretsch/following{/other_user}","gists_url":"https://api.github.com/users/xgretsch/gists{/gist_id}","starred_url":"https://api.github.com/users/xgretsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xgretsch/subscriptions","organizations_url":"https://api.github.com/users/xgretsch/orgs","repos_url":"https://api.github.com/users/xgretsch/repos","events_url":"https://api.github.com/users/xgretsch/events{/privacy}","received_events_url":"https://api.github.com/users/xgretsch/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2016-11-08T12:05:42Z","updated_at":"2016-11-08T12:05:42Z","html_url":"https://github.com/ampproject/amphtml/pull/5751#discussion_r86975444","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/5751","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/86975444"},"html":{"href":"https://github.com/ampproject/amphtml/pull/5751#discussion_r86975444"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5751"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/5751","id":90391291,"html_url":"https://github.com/ampproject/amphtml/pull/5751","diff_url":"https://github.com/ampproject/amphtml/pull/5751.diff","patch_url":"https://github.com/ampproject/amphtml/pull/5751.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/5751","number":5751,"state":"open","locked":false,"title":"First implementation of imagead (intent to implement #5541)","user":{"login":"xgretsch","id":898362,"avatar_url":"https://avatars.githubusercontent.com/u/898362?v=3","gravatar_id":"","url":"https://api.github.com/users/xgretsch","html_url":"https://github.com/xgretsch","followers_url":"https://api.github.com/users/xgretsch/followers","following_url":"https://api.github.com/users/xgretsch/following{/other_user}","gists_url":"https://api.github.com/users/xgretsch/gists{/gist_id}","starred_url":"https://api.github.com/users/xgretsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xgretsch/subscriptions","organizations_url":"https://api.github.com/users/xgretsch/orgs","repos_url":"https://api.github.com/users/xgretsch/repos","events_url":"https://api.github.com/users/xgretsch/events{/privacy}","received_events_url":"https://api.github.com/users/xgretsch/received_events","type":"User","site_admin":false},"body":"This is fairly bare-bones: still needs converting the example ad server\nfrom one on pbl.bachtrack.com to one on the test server, and still\nneeds some tests implemented. May possibly also want to add support\nfor mustache.js templates - to be decided.\n","created_at":"2016-10-21T14:16:46Z","updated_at":"2016-11-08T12:05:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf48036f7800001ee949d30555ea88f26cf54218","assignee":{"login":"lannka","id":8496897,"avatar_url":"https://avatars.githubusercontent.com/u/8496897?v=3","gravatar_id":"","url":"https://api.github.com/users/lannka","html_url":"https://github.com/lannka","followers_url":"https://api.github.com/users/lannka/followers","following_url":"https://api.github.com/users/lannka/following{/other_user}","gists_url":"https://api.github.com/users/lannka/gists{/gist_id}","starred_url":"https://api.github.com/users/lannka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lannka/subscriptions","organizations_url":"https://api.github.com/users/lannka/orgs","repos_url":"https://api.github.com/users/lannka/repos","events_url":"https://api.github.com/users/lannka/events{/privacy}","received_events_url":"https://api.github.com/users/lannka/received_events","type":"User","site_admin":false},"assignees":[{"login":"lannka","id":8496897,"avatar_url":"https://avatars.githubusercontent.com/u/8496897?v=3","gravatar_id":"","url":"https://api.github.com/users/lannka","html_url":"https://github.com/lannka","followers_url":"https://api.github.com/users/lannka/followers","following_url":"https://api.github.com/users/lannka/following{/other_user}","gists_url":"https://api.github.com/users/lannka/gists{/gist_id}","starred_url":"https://api.github.com/users/lannka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lannka/subscriptions","organizations_url":"https://api.github.com/users/lannka/orgs","repos_url":"https://api.github.com/users/lannka/repos","events_url":"https://api.github.com/users/lannka/events{/privacy}","received_events_url":"https://api.github.com/users/lannka/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/5751/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/5751/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/5751/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/3af7935c6d66a51505e4e805f3b6f2cfa703e9ff","head":{"label":"xgretsch:imagead","ref":"imagead","sha":"3af7935c6d66a51505e4e805f3b6f2cfa703e9ff","user":{"login":"xgretsch","id":898362,"avatar_url":"https://avatars.githubusercontent.com/u/898362?v=3","gravatar_id":"","url":"https://api.github.com/users/xgretsch","html_url":"https://github.com/xgretsch","followers_url":"https://api.github.com/users/xgretsch/followers","following_url":"https://api.github.com/users/xgretsch/following{/other_user}","gists_url":"https://api.github.com/users/xgretsch/gists{/gist_id}","starred_url":"https://api.github.com/users/xgretsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xgretsch/subscriptions","organizations_url":"https://api.github.com/users/xgretsch/orgs","repos_url":"https://api.github.com/users/xgretsch/repos","events_url":"https://api.github.com/users/xgretsch/events{/privacy}","received_events_url":"https://api.github.com/users/xgretsch/received_events","type":"User","site_admin":false},"repo":{"id":71483792,"name":"amphtml","full_name":"xgretsch/amphtml","owner":{"login":"xgretsch","id":898362,"avatar_url":"https://avatars.githubusercontent.com/u/898362?v=3","gravatar_id":"","url":"https://api.github.com/users/xgretsch","html_url":"https://github.com/xgretsch","followers_url":"https://api.github.com/users/xgretsch/followers","following_url":"https://api.github.com/users/xgretsch/following{/other_user}","gists_url":"https://api.github.com/users/xgretsch/gists{/gist_id}","starred_url":"https://api.github.com/users/xgretsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xgretsch/subscriptions","organizations_url":"https://api.github.com/users/xgretsch/orgs","repos_url":"https://api.github.com/users/xgretsch/repos","events_url":"https://api.github.com/users/xgretsch/events{/privacy}","received_events_url":"https://api.github.com/users/xgretsch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xgretsch/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/xgretsch/amphtml","forks_url":"https://api.github.com/repos/xgretsch/amphtml/forks","keys_url":"https://api.github.com/repos/xgretsch/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xgretsch/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xgretsch/amphtml/teams","hooks_url":"https://api.github.com/repos/xgretsch/amphtml/hooks","issue_events_url":"https://api.github.com/repos/xgretsch/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/xgretsch/amphtml/events","assignees_url":"https://api.github.com/repos/xgretsch/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/xgretsch/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/xgretsch/amphtml/tags","blobs_url":"https://api.github.com/repos/xgretsch/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xgretsch/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xgretsch/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/xgretsch/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xgretsch/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/xgretsch/amphtml/languages","stargazers_url":"https://api.github.com/repos/xgretsch/amphtml/stargazers","contributors_url":"https://api.github.com/repos/xgretsch/amphtml/contributors","subscribers_url":"https://api.github.com/repos/xgretsch/amphtml/subscribers","subscription_url":"https://api.github.com/repos/xgretsch/amphtml/subscription","commits_url":"https://api.github.com/repos/xgretsch/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/xgretsch/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/xgretsch/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/xgretsch/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/xgretsch/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/xgretsch/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xgretsch/amphtml/merges","archive_url":"https://api.github.com/repos/xgretsch/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xgretsch/amphtml/downloads","issues_url":"https://api.github.com/repos/xgretsch/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/xgretsch/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/xgretsch/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/xgretsch/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xgretsch/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/xgretsch/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/xgretsch/amphtml/deployments","created_at":"2016-10-20T16:44:46Z","updated_at":"2016-10-20T16:44:51Z","pushed_at":"2016-11-08T12:05:12Z","git_url":"git://github.com/xgretsch/amphtml.git","ssh_url":"git@github.com:xgretsch/amphtml.git","clone_url":"https://github.com/xgretsch/amphtml.git","svn_url":"https://github.com/xgretsch/amphtml","homepage":"https://ampproject.org","size":178040,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ampproject:master","ref":"master","sha":"2eb26fea7d6fb93750543372eeb9b1c25e6a0216","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2016-11-08T04:37:25Z","pushed_at":"2016-11-08T12:05:15Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://ampproject.org","size":220551,"stargazers_count":9009,"watchers_count":9009,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1375,"mirror_url":null,"open_issues_count":945,"forks":1375,"open_issues":945,"watchers":9009,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5751"},"html":{"href":"https://github.com/ampproject/amphtml/pull/5751"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/5751"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/5751/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5751/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/5751/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/3af7935c6d66a51505e4e805f3b6f2cfa703e9ff"}}}}
{"actor":{"display_login":"xgretsch"}}