{"action":"created","comment":{"url":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/comments/30686435","id":30686435,"diff_hunk":"@@ -0,0 +1,71 @@\n+/**\n+ * # Rule Form.\n+ *\n+ * Requires an element to have a data-dough-component=\"RuleForm\" attribute. The application\n+ * file will spawn an instance of this class for each element it finds on the page.\n+ *\n+ * See test fixture for sample markup - /spec/js/fixtures/RuleForm.html\n+ */\n+\n+/**\n+ * Require from Config\n+ * @param  {[type]} $         [description]\n+ * @param  {[type]} DoughBaseComponent [description]\n+ * @return {[type]}           [description]\n+ * @private\n+ */\n+define(['jquery', 'DoughBaseComponent'], function($, DoughBaseComponent) {\n+\n+  'use strict';\n+\n+  var RuleFormProto,\n+      defaultConfig = {};\n+\n+  function RuleForm($el, config) {\n+    RuleForm.baseConstructor.call(this, $el, config, defaultConfig);\n+\n+    this.$ruleRegex = this.$el.find('#rule_regex').first();\n+    this.$ruleType  = this.$el.find('#rule_rule_type').first();\n+  }\n+\n+  RuleForm.componentName = 'RuleForm';\n+\n+  /**\n+   * Inherit from base module, for shared methods and interface\n+   * @type {[type]}\n+   * @private\n+   */\n+  DoughBaseComponent.extend(RuleForm);\n+  RuleFormProto = RuleForm.prototype;\n+\n+  /**\n+   * Init function\n+   *\n+   * Set up listeners\n+   * @param  {[type]} initialised [description]\n+   * @return {[type]}             [description]\n+   */\n+  RuleFormProto.init = function(initialised) {\n+    var self = this;\n+\n+    this.$el.find('#rule_rule_type').on('change', function () {\n+      self.toggleRegex();\n+    });","path":"app/assets/javascripts/modules/RuleForm.js","position":53,"original_position":53,"commit_id":"85da3328133f8eeaf0cb3def57ac1250df269ebc","original_commit_id":"0805a6ea7af27fc9ffe3c2d767f927d1d012a071","user":{"login":"urfolomeus","id":52965,"avatar_url":"https://avatars.githubusercontent.com/u/52965?v=3","gravatar_id":"","url":"https://api.github.com/users/urfolomeus","html_url":"https://github.com/urfolomeus","followers_url":"https://api.github.com/users/urfolomeus/followers","following_url":"https://api.github.com/users/urfolomeus/following{/other_user}","gists_url":"https://api.github.com/users/urfolomeus/gists{/gist_id}","starred_url":"https://api.github.com/users/urfolomeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfolomeus/subscriptions","organizations_url":"https://api.github.com/users/urfolomeus/orgs","repos_url":"https://api.github.com/users/urfolomeus/repos","events_url":"https://api.github.com/users/urfolomeus/events{/privacy}","received_events_url":"https://api.github.com/users/urfolomeus/received_events","type":"User","site_admin":false},"body":"Good point on the self/this flipping. Not sure I agree on using proxy just because it's more modern. :)","created_at":"2015-05-20T10:01:23Z","updated_at":"2015-05-20T10:01:23Z","html_url":"https://github.com/moneyadviceservice/webfeeds/pull/12#discussion_r30686435","pull_request_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/comments/30686435"},"html":{"href":"https://github.com/moneyadviceservice/webfeeds/pull/12#discussion_r30686435"},"pull_request":{"href":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/12","id":35524197,"html_url":"https://github.com/moneyadviceservice/webfeeds/pull/12","diff_url":"https://github.com/moneyadviceservice/webfeeds/pull/12.diff","patch_url":"https://github.com/moneyadviceservice/webfeeds/pull/12.patch","issue_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues/12","number":12,"state":"open","locked":false,"title":"Add custom rules","user":{"login":"mconnell","id":32398,"avatar_url":"https://avatars.githubusercontent.com/u/32398?v=3","gravatar_id":"","url":"https://api.github.com/users/mconnell","html_url":"https://github.com/mconnell","followers_url":"https://api.github.com/users/mconnell/followers","following_url":"https://api.github.com/users/mconnell/following{/other_user}","gists_url":"https://api.github.com/users/mconnell/gists{/gist_id}","starred_url":"https://api.github.com/users/mconnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mconnell/subscriptions","organizations_url":"https://api.github.com/users/mconnell/orgs","repos_url":"https://api.github.com/users/mconnell/repos","events_url":"https://api.github.com/users/mconnell/events{/privacy}","received_events_url":"https://api.github.com/users/mconnell/received_events","type":"User","site_admin":false},"body":"This PR allows an admin to apply custom rules to a feed:\r\n\r\n* Prepend – prepend specific content to all items in a feed\r\n* Append – append specific content to all items in a feed\r\n* transform – apply a regular expression transform to all items in a feed.\r\n\r\nWe've also introduced karma/chai/mocha/phantomjs for JS testing (mimicking the RAD setup). And followed the dough pattern for creating a dough component for toggling a text field being enabled or not.","created_at":"2015-05-15T15:38:43Z","updated_at":"2015-05-20T10:01:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0f72c86248457da6398a8763d2d0e8f21a6ada4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/12/commits","review_comments_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/12/comments","review_comment_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/comments{/number}","comments_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues/12/comments","statuses_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/statuses/85da3328133f8eeaf0cb3def57ac1250df269ebc","head":{"label":"moneyadviceservice:add_custom_rules","ref":"add_custom_rules","sha":"85da3328133f8eeaf0cb3def57ac1250df269ebc","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":34719869,"name":"webfeeds","full_name":"moneyadviceservice/webfeeds","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/webfeeds","description":"","fork":false,"url":"https://api.github.com/repos/moneyadviceservice/webfeeds","forks_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/forks","keys_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/teams","hooks_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/hooks","issue_events_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues/events{/number}","events_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/events","assignees_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/assignees{/user}","branches_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/branches{/branch}","tags_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/tags","blobs_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/statuses/{sha}","languages_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/languages","stargazers_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/stargazers","contributors_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/contributors","subscribers_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/subscribers","subscription_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/subscription","commits_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues/comments{/number}","contents_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/contents/{+path}","compare_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/merges","archive_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/downloads","issues_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues{/number}","pulls_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls{/number}","milestones_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/milestones{/number}","notifications_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/labels{/name}","releases_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/releases{/id}","created_at":"2015-04-28T08:59:24Z","updated_at":"2015-05-06T09:27:41Z","pushed_at":"2015-05-20T09:24:51Z","git_url":"git://github.com/moneyadviceservice/webfeeds.git","ssh_url":"git@github.com:moneyadviceservice/webfeeds.git","clone_url":"https://github.com/moneyadviceservice/webfeeds.git","svn_url":"https://github.com/moneyadviceservice/webfeeds","homepage":null,"size":31784,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"moneyadviceservice:master","ref":"master","sha":"44b4175acb535c0c6c0c7cbe6cb088ac2a586d4d","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":34719869,"name":"webfeeds","full_name":"moneyadviceservice/webfeeds","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/webfeeds","description":"","fork":false,"url":"https://api.github.com/repos/moneyadviceservice/webfeeds","forks_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/forks","keys_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/teams","hooks_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/hooks","issue_events_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues/events{/number}","events_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/events","assignees_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/assignees{/user}","branches_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/branches{/branch}","tags_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/tags","blobs_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/refs{/sha}","trees_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/statuses/{sha}","languages_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/languages","stargazers_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/stargazers","contributors_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/contributors","subscribers_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/subscribers","subscription_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/subscription","commits_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/commits{/sha}","git_commits_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/git/commits{/sha}","comments_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/comments{/number}","issue_comment_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues/comments{/number}","contents_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/contents/{+path}","compare_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/merges","archive_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/downloads","issues_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues{/number}","pulls_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls{/number}","milestones_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/milestones{/number}","notifications_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/labels{/name}","releases_url":"https://api.github.com/repos/moneyadviceservice/webfeeds/releases{/id}","created_at":"2015-04-28T08:59:24Z","updated_at":"2015-05-06T09:27:41Z","pushed_at":"2015-05-20T09:24:51Z","git_url":"git://github.com/moneyadviceservice/webfeeds.git","ssh_url":"git@github.com:moneyadviceservice/webfeeds.git","clone_url":"https://github.com/moneyadviceservice/webfeeds.git","svn_url":"https://github.com/moneyadviceservice/webfeeds","homepage":null,"size":31784,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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/moneyadviceservice/webfeeds/pulls/12"},"html":{"href":"https://github.com/moneyadviceservice/webfeeds/pull/12"},"issue":{"href":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues/12"},"comments":{"href":"https://api.github.com/repos/moneyadviceservice/webfeeds/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/moneyadviceservice/webfeeds/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/moneyadviceservice/webfeeds/statuses/85da3328133f8eeaf0cb3def57ac1250df269ebc"}}}}