{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/commercial-templates/pulls/comments/87807601","pull_request_review_id":8403330,"id":87807601,"diff_hunk":"@@ -0,0 +1,30 @@\n+import { getIframeId, getWebfonts, resizeIframeHeight, onViewport, reportClicks } from '../../_shared/js/messages';\n+\n+reportClicks();\n+getIframeId()\n+    .then(() => addColourContrastClass())\n+    .then(() => getWebfonts())\n+    .then(resizeIframeHeight)\n+    .then(function(){\n+        onViewport(() => resizeIframeHeight());\n+    });\n+\n+function addColourContrastClass () {\n+    var div = document.getElementsByClassName('creative--hosted')[0];\n+    var brandColour = div.getAttribute('data-brand-color');\n+    if(isDark(brandColour)){\n+        div.className += \" hosted-bright\";","path":"src/guardian-hosted/web/index.js","position":16,"original_position":16,"commit_id":"2a4800cdd8436581a0942739b7a1c878b064a23b","original_commit_id":"2a4800cdd8436581a0942739b7a1c878b064a23b","user":{"login":"regiskuckaertz","id":629976,"avatar_url":"https://avatars.githubusercontent.com/u/629976?v=3","gravatar_id":"","url":"https://api.github.com/users/regiskuckaertz","html_url":"https://github.com/regiskuckaertz","followers_url":"https://api.github.com/users/regiskuckaertz/followers","following_url":"https://api.github.com/users/regiskuckaertz/following{/other_user}","gists_url":"https://api.github.com/users/regiskuckaertz/gists{/gist_id}","starred_url":"https://api.github.com/users/regiskuckaertz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regiskuckaertz/subscriptions","organizations_url":"https://api.github.com/users/regiskuckaertz/orgs","repos_url":"https://api.github.com/users/regiskuckaertz/repos","events_url":"https://api.github.com/users/regiskuckaertz/events{/privacy}","received_events_url":"https://api.github.com/users/regiskuckaertz/received_events","type":"User","site_admin":false},"body":"... and you can even wrap it in a `write` call 😃 ","created_at":"2016-11-14T14:15:28Z","updated_at":"2016-11-14T14:20:10Z","html_url":"https://github.com/guardian/commercial-templates/pull/4#discussion_r87807601","pull_request_url":"https://api.github.com/repos/guardian/commercial-templates/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/guardian/commercial-templates/pulls/comments/87807601"},"html":{"href":"https://github.com/guardian/commercial-templates/pull/4#discussion_r87807601"},"pull_request":{"href":"https://api.github.com/repos/guardian/commercial-templates/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/commercial-templates/pulls/4","id":82514811,"html_url":"https://github.com/guardian/commercial-templates/pull/4","diff_url":"https://github.com/guardian/commercial-templates/pull/4.diff","patch_url":"https://github.com/guardian/commercial-templates/pull/4.patch","issue_url":"https://api.github.com/repos/guardian/commercial-templates/issues/4","number":4,"state":"open","locked":false,"title":"Hosted By traffic driver","user":{"login":"lps88","id":6290008,"avatar_url":"https://avatars.githubusercontent.com/u/6290008?v=3","gravatar_id":"","url":"https://api.github.com/users/lps88","html_url":"https://github.com/lps88","followers_url":"https://api.github.com/users/lps88/followers","following_url":"https://api.github.com/users/lps88/following{/other_user}","gists_url":"https://api.github.com/users/lps88/gists{/gist_id}","starred_url":"https://api.github.com/users/lps88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lps88/subscriptions","organizations_url":"https://api.github.com/users/lps88/orgs","repos_url":"https://api.github.com/users/lps88/repos","events_url":"https://api.github.com/users/lps88/events{/privacy}","received_events_url":"https://api.github.com/users/lps88/received_events","type":"User","site_admin":false},"body":"New 'thrasher' traffic driver for hosted campaigns. Can have 2, 3 or 4 cards.\r\n\r\nTo continue this work:\r\n1. Check out `guardian/commercial-templates`\r\n2. Edit `src/guardian-hosted/index.html` and `src/guardian-hosted/index.scss`\r\n3. Run `npm run build`\r\n4. Copy `build/guardian-hosted/index.html` and `build/guardian-hosted/index.css` in to the appropriate boxes in [the native template](https://www.google.com/dfp/59666047#delivery/CreateNativeAdFormatAndStyle/nativeStyleId=71215&creativeTemplateId=10062327) and save.\r\n5. Click `Ad format details` to add/remove template variables if needed.\r\n6. Open [localhost:9000/uk?adtest=lydia1](http://localhost:9000/uk?adtest=lydia1) and the thrasher should appear in the page.\r\n\r\nChanges take a while to appear from DFP. To test style changes more quickly, copy the compiled css into the style tag in the iframe instead.\r\n\r\nAny template changes may require updates to [this creative](https://www.google.com/dfp/59666047#delivery/PreviewCreative/orderId=341470047&lineItemId=131115447&creativeId=102066672447).\r\n\r\nThere is a field in the template called `numberOfElements` which determines how many cards are shown. It's currently set to two, but the creative has images etc set up for all four cards. Just change the `with-2-elements` class to quickly add/remove the 3rd and 4th.\r\n\r\n\r\n![upload_8_23_2016_at_4_51_15_pm](https://cloud.githubusercontent.com/assets/6290008/17926783/810527de-69ea-11e6-9a49-fed57c6ef24a.png)\r\n![upload_8_23_2016_at_4_52_18_pm](https://cloud.githubusercontent.com/assets/6290008/17926782/8104884c-69ea-11e6-89c1-324f8dab38ed.png)\r\n![upload_8_23_2016_at_4_53_05_pm](https://cloud.githubusercontent.com/assets/6290008/17926784/8108673c-69ea-11e6-90a9-f99053ba4268.png)\r\n","created_at":"2016-08-24T10:05:36Z","updated_at":"2016-11-14T14:20:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea7805060147094605b346f37529bf4b91fad5a9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/guardian/commercial-templates/pulls/4/commits","review_comments_url":"https://api.github.com/repos/guardian/commercial-templates/pulls/4/comments","review_comment_url":"https://api.github.com/repos/guardian/commercial-templates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/commercial-templates/issues/4/comments","statuses_url":"https://api.github.com/repos/guardian/commercial-templates/statuses/2a4800cdd8436581a0942739b7a1c878b064a23b","head":{"label":"guardian:lps88-guardian-hosted","ref":"lps88-guardian-hosted","sha":"2a4800cdd8436581a0942739b7a1c878b064a23b","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":64410610,"name":"commercial-templates","full_name":"guardian/commercial-templates","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/commercial-templates","description":"Guardian bespoke DFP native styles","fork":false,"url":"https://api.github.com/repos/guardian/commercial-templates","forks_url":"https://api.github.com/repos/guardian/commercial-templates/forks","keys_url":"https://api.github.com/repos/guardian/commercial-templates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/commercial-templates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/commercial-templates/teams","hooks_url":"https://api.github.com/repos/guardian/commercial-templates/hooks","issue_events_url":"https://api.github.com/repos/guardian/commercial-templates/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/commercial-templates/events","assignees_url":"https://api.github.com/repos/guardian/commercial-templates/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/commercial-templates/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/commercial-templates/tags","blobs_url":"https://api.github.com/repos/guardian/commercial-templates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/commercial-templates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/commercial-templates/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/commercial-templates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/commercial-templates/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/commercial-templates/languages","stargazers_url":"https://api.github.com/repos/guardian/commercial-templates/stargazers","contributors_url":"https://api.github.com/repos/guardian/commercial-templates/contributors","subscribers_url":"https://api.github.com/repos/guardian/commercial-templates/subscribers","subscription_url":"https://api.github.com/repos/guardian/commercial-templates/subscription","commits_url":"https://api.github.com/repos/guardian/commercial-templates/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/commercial-templates/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/commercial-templates/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/commercial-templates/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/commercial-templates/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/commercial-templates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/commercial-templates/merges","archive_url":"https://api.github.com/repos/guardian/commercial-templates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/commercial-templates/downloads","issues_url":"https://api.github.com/repos/guardian/commercial-templates/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/commercial-templates/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/commercial-templates/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/commercial-templates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/commercial-templates/labels{/name}","releases_url":"https://api.github.com/repos/guardian/commercial-templates/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/commercial-templates/deployments","created_at":"2016-07-28T16:17:39Z","updated_at":"2016-10-26T11:04:38Z","pushed_at":"2016-11-14T14:09:06Z","git_url":"git://github.com/guardian/commercial-templates.git","ssh_url":"git@github.com:guardian/commercial-templates.git","clone_url":"https://github.com/guardian/commercial-templates.git","svn_url":"https://github.com/guardian/commercial-templates","homepage":"","size":933,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"516326cce90bf02018d366e743caff0e325b006d","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":64410610,"name":"commercial-templates","full_name":"guardian/commercial-templates","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/commercial-templates","description":"Guardian bespoke DFP native styles","fork":false,"url":"https://api.github.com/repos/guardian/commercial-templates","forks_url":"https://api.github.com/repos/guardian/commercial-templates/forks","keys_url":"https://api.github.com/repos/guardian/commercial-templates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/commercial-templates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/commercial-templates/teams","hooks_url":"https://api.github.com/repos/guardian/commercial-templates/hooks","issue_events_url":"https://api.github.com/repos/guardian/commercial-templates/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/commercial-templates/events","assignees_url":"https://api.github.com/repos/guardian/commercial-templates/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/commercial-templates/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/commercial-templates/tags","blobs_url":"https://api.github.com/repos/guardian/commercial-templates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/commercial-templates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/commercial-templates/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/commercial-templates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/commercial-templates/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/commercial-templates/languages","stargazers_url":"https://api.github.com/repos/guardian/commercial-templates/stargazers","contributors_url":"https://api.github.com/repos/guardian/commercial-templates/contributors","subscribers_url":"https://api.github.com/repos/guardian/commercial-templates/subscribers","subscription_url":"https://api.github.com/repos/guardian/commercial-templates/subscription","commits_url":"https://api.github.com/repos/guardian/commercial-templates/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/commercial-templates/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/commercial-templates/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/commercial-templates/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/commercial-templates/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/commercial-templates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/commercial-templates/merges","archive_url":"https://api.github.com/repos/guardian/commercial-templates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/commercial-templates/downloads","issues_url":"https://api.github.com/repos/guardian/commercial-templates/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/commercial-templates/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/commercial-templates/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/commercial-templates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/commercial-templates/labels{/name}","releases_url":"https://api.github.com/repos/guardian/commercial-templates/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/commercial-templates/deployments","created_at":"2016-07-28T16:17:39Z","updated_at":"2016-10-26T11:04:38Z","pushed_at":"2016-11-14T14:09:06Z","git_url":"git://github.com/guardian/commercial-templates.git","ssh_url":"git@github.com:guardian/commercial-templates.git","clone_url":"https://github.com/guardian/commercial-templates.git","svn_url":"https://github.com/guardian/commercial-templates","homepage":"","size":933,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/commercial-templates/pulls/4"},"html":{"href":"https://github.com/guardian/commercial-templates/pull/4"},"issue":{"href":"https://api.github.com/repos/guardian/commercial-templates/issues/4"},"comments":{"href":"https://api.github.com/repos/guardian/commercial-templates/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/commercial-templates/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/commercial-templates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/commercial-templates/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/commercial-templates/statuses/2a4800cdd8436581a0942739b7a1c878b064a23b"}}}}
{"actor":{"display_login":"regiskuckaertz"}}