{"action":"created","comment":{"url":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/comments/23991589","id":23991589,"diff_hunk":"@@ -0,0 +1,72 @@\n+define(['jquery', 'DoughBaseComponent'], function($, DoughBaseComponent) {\n+\n+  'use strict';\n+\n+  var Newsletter,\n+      defaultConfig = {};\n+\n+  Newsletter = function($el, config) {\n+    Newsletter.baseConstructor.call(this, $el, config, defaultConfig);\n+  };\n+\n+  /**\n+  * Inherit from base module, for shared methods and interface\n+  */\n+  DoughBaseComponent.extend(Newsletter);\n+\n+  /**\n+  * Set up and populate the model from the form inputs\n+  * @param {Promise} initialised\n+  */\n+  Newsletter.prototype.init = function(initialised) {\n+    this._initialisedSuccess(initialised);\n+    this.showInArticle($);\n+  };\n+\n+  Newsletter.prototype.showInArticle = function($) {\n+    var $panel = this.getPanel($);\n+    var $article = $('.editorial main');\n+\n+    if (!$panel.length || !$article.length) {\n+      setTimeout(function () {\n+        this.showInArticle($);","path":"app/assets/javascripts/components/Newsletter.js","position":32,"original_position":32,"commit_id":"9747d2ce039001138cfb738a9a21c059a244fd66","original_commit_id":"9747d2ce039001138cfb738a9a21c059a244fd66","user":{"login":"Guntrisoft","id":6049076,"avatar_url":"https://avatars.githubusercontent.com/u/6049076?v=3","gravatar_id":"","url":"https://api.github.com/users/Guntrisoft","html_url":"https://github.com/Guntrisoft","followers_url":"https://api.github.com/users/Guntrisoft/followers","following_url":"https://api.github.com/users/Guntrisoft/following{/other_user}","gists_url":"https://api.github.com/users/Guntrisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Guntrisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guntrisoft/subscriptions","organizations_url":"https://api.github.com/users/Guntrisoft/orgs","repos_url":"https://api.github.com/users/Guntrisoft/repos","events_url":"https://api.github.com/users/Guntrisoft/events{/privacy}","received_events_url":"https://api.github.com/users/Guntrisoft/received_events","type":"User","site_admin":false},"body":"@stevoland - any idea why this bit was in the optimisely script? Not sure on a case example of why the panel or article would ever be missing at this point?","created_at":"2015-02-03T09:30:16Z","updated_at":"2015-02-03T09:30:16Z","html_url":"https://github.com/moneyadviceservice/frontend/pull/889#discussion_r23991589","pull_request_url":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/889","_links":{"self":{"href":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/comments/23991589"},"html":{"href":"https://github.com/moneyadviceservice/frontend/pull/889#discussion_r23991589"},"pull_request":{"href":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/889"}}},"pull_request":{"url":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/889","id":28480740,"html_url":"https://github.com/moneyadviceservice/frontend/pull/889","diff_url":"https://github.com/moneyadviceservice/frontend/pull/889.diff","patch_url":"https://github.com/moneyadviceservice/frontend/pull/889.patch","issue_url":"https://api.github.com/repos/moneyadviceservice/frontend/issues/889","number":889,"state":"open","locked":false,"title":"adding Newsletter injection script","user":{"login":"Guntrisoft","id":6049076,"avatar_url":"https://avatars.githubusercontent.com/u/6049076?v=3","gravatar_id":"","url":"https://api.github.com/users/Guntrisoft","html_url":"https://github.com/Guntrisoft","followers_url":"https://api.github.com/users/Guntrisoft/followers","following_url":"https://api.github.com/users/Guntrisoft/following{/other_user}","gists_url":"https://api.github.com/users/Guntrisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Guntrisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guntrisoft/subscriptions","organizations_url":"https://api.github.com/users/Guntrisoft/orgs","repos_url":"https://api.github.com/users/Guntrisoft/repos","events_url":"https://api.github.com/users/Guntrisoft/events{/privacy}","received_events_url":"https://api.github.com/users/Guntrisoft/received_events","type":"User","site_admin":false},"body":"- uses dough loader to kick off javascript component\r\n- component injects newsletter div into the right\r\n  place within an article and adds a class\r\n  which displays it to the user\r\n- altered where the newsletter div gets included\r\n  conditionally loading it in an article\r\n  template as long as the current URL\r\n  doesn't match an excluded list of slugs\r\n  or is a welsh article","created_at":"2015-02-02T16:22:10Z","updated_at":"2015-02-03T09:30:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"13fac007977ff6e5601c36d7d94cf9cdb9cf1d19","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/889/commits","review_comments_url":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/889/comments","review_comment_url":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/comments/{number}","comments_url":"https://api.github.com/repos/moneyadviceservice/frontend/issues/889/comments","statuses_url":"https://api.github.com/repos/moneyadviceservice/frontend/statuses/9747d2ce039001138cfb738a9a21c059a244fd66","head":{"label":"moneyadviceservice:newsletter_signup_in_article","ref":"newsletter_signup_in_article","sha":"9747d2ce039001138cfb738a9a21c059a244fd66","user":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=3","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"repo":{"id":15315123,"name":"frontend","full_name":"moneyadviceservice/frontend","owner":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=3","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moneyadviceservice/frontend","description":"The Money Advice Service's improved website.","fork":false,"url":"https://api.github.com/repos/moneyadviceservice/frontend","forks_url":"https://api.github.com/repos/moneyadviceservice/frontend/forks","keys_url":"https://api.github.com/repos/moneyadviceservice/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneyadviceservice/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneyadviceservice/frontend/teams","hooks_url":"https://api.github.com/repos/moneyadviceservice/frontend/hooks","issue_events_url":"https://api.github.com/repos/moneyadviceservice/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/moneyadviceservice/frontend/events","assignees_url":"https://api.github.com/repos/moneyadviceservice/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/moneyadviceservice/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/moneyadviceservice/frontend/tags","blobs_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneyadviceservice/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/moneyadviceservice/frontend/languages","stargazers_url":"https://api.github.com/repos/moneyadviceservice/frontend/stargazers","contributors_url":"https://api.github.com/repos/moneyadviceservice/frontend/contributors","subscribers_url":"https://api.github.com/repos/moneyadviceservice/frontend/subscribers","subscription_url":"https://api.github.com/repos/moneyadviceservice/frontend/subscription","commits_url":"https://api.github.com/repos/moneyadviceservice/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneyadviceservice/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneyadviceservice/frontend/issues/comments/{number}","contents_url":"https://api.github.com/repos/moneyadviceservice/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/moneyadviceservice/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneyadviceservice/frontend/merges","archive_url":"https://api.github.com/repos/moneyadviceservice/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneyadviceservice/frontend/downloads","issues_url":"https://api.github.com/repos/moneyadviceservice/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/moneyadviceservice/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/moneyadviceservice/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/moneyadviceservice/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneyadviceservice/frontend/labels{/name}","releases_url":"https://api.github.com/repos/moneyadviceservice/frontend/releases{/id}","created_at":"2013-12-19T15:25:21Z","updated_at":"2015-01-30T11:40:36Z","pushed_at":"2015-02-02T16:30:08Z","git_url":"git://github.com/moneyadviceservice/frontend.git","ssh_url":"git@github.com:moneyadviceservice/frontend.git","clone_url":"https://github.com/moneyadviceservice/frontend.git","svn_url":"https://github.com/moneyadviceservice/frontend","homepage":"https://www.moneyadviceservice.org.uk  ","size":29889,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":10,"forks":3,"open_issues":10,"watchers":3,"default_branch":"master"}},"base":{"label":"moneyadviceservice:master","ref":"master","sha":"dff42868ca7e48fab3889cbfb7127f9987b0b507","user":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=3","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"repo":{"id":15315123,"name":"frontend","full_name":"moneyadviceservice/frontend","owner":{"login":"moneyadviceservice","id":2064781,"avatar_url":"https://avatars.githubusercontent.com/u/2064781?v=3","gravatar_id":"","url":"https://api.github.com/users/moneyadviceservice","html_url":"https://github.com/moneyadviceservice","followers_url":"https://api.github.com/users/moneyadviceservice/followers","following_url":"https://api.github.com/users/moneyadviceservice/following{/other_user}","gists_url":"https://api.github.com/users/moneyadviceservice/gists{/gist_id}","starred_url":"https://api.github.com/users/moneyadviceservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moneyadviceservice/subscriptions","organizations_url":"https://api.github.com/users/moneyadviceservice/orgs","repos_url":"https://api.github.com/users/moneyadviceservice/repos","events_url":"https://api.github.com/users/moneyadviceservice/events{/privacy}","received_events_url":"https://api.github.com/users/moneyadviceservice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moneyadviceservice/frontend","description":"The Money Advice Service's improved website.","fork":false,"url":"https://api.github.com/repos/moneyadviceservice/frontend","forks_url":"https://api.github.com/repos/moneyadviceservice/frontend/forks","keys_url":"https://api.github.com/repos/moneyadviceservice/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneyadviceservice/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneyadviceservice/frontend/teams","hooks_url":"https://api.github.com/repos/moneyadviceservice/frontend/hooks","issue_events_url":"https://api.github.com/repos/moneyadviceservice/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/moneyadviceservice/frontend/events","assignees_url":"https://api.github.com/repos/moneyadviceservice/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/moneyadviceservice/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/moneyadviceservice/frontend/tags","blobs_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneyadviceservice/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/moneyadviceservice/frontend/languages","stargazers_url":"https://api.github.com/repos/moneyadviceservice/frontend/stargazers","contributors_url":"https://api.github.com/repos/moneyadviceservice/frontend/contributors","subscribers_url":"https://api.github.com/repos/moneyadviceservice/frontend/subscribers","subscription_url":"https://api.github.com/repos/moneyadviceservice/frontend/subscription","commits_url":"https://api.github.com/repos/moneyadviceservice/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneyadviceservice/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneyadviceservice/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneyadviceservice/frontend/issues/comments/{number}","contents_url":"https://api.github.com/repos/moneyadviceservice/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/moneyadviceservice/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneyadviceservice/frontend/merges","archive_url":"https://api.github.com/repos/moneyadviceservice/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneyadviceservice/frontend/downloads","issues_url":"https://api.github.com/repos/moneyadviceservice/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/moneyadviceservice/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/moneyadviceservice/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/moneyadviceservice/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneyadviceservice/frontend/labels{/name}","releases_url":"https://api.github.com/repos/moneyadviceservice/frontend/releases{/id}","created_at":"2013-12-19T15:25:21Z","updated_at":"2015-01-30T11:40:36Z","pushed_at":"2015-02-02T16:30:08Z","git_url":"git://github.com/moneyadviceservice/frontend.git","ssh_url":"git@github.com:moneyadviceservice/frontend.git","clone_url":"https://github.com/moneyadviceservice/frontend.git","svn_url":"https://github.com/moneyadviceservice/frontend","homepage":"https://www.moneyadviceservice.org.uk  ","size":29889,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":10,"forks":3,"open_issues":10,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/889"},"html":{"href":"https://github.com/moneyadviceservice/frontend/pull/889"},"issue":{"href":"https://api.github.com/repos/moneyadviceservice/frontend/issues/889"},"comments":{"href":"https://api.github.com/repos/moneyadviceservice/frontend/issues/889/comments"},"review_comments":{"href":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/889/comments"},"review_comment":{"href":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/moneyadviceservice/frontend/pulls/889/commits"},"statuses":{"href":"https://api.github.com/repos/moneyadviceservice/frontend/statuses/9747d2ce039001138cfb738a9a21c059a244fd66"}}}}