{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/comments/23094828","id":23094828,"diff_hunk":"@@ -0,0 +1,37 @@\n+(function () {\n+  'use strict';\n+\n+  moj.Modules.CurrencyFormatting = {\n+    currencyFields: [],\n+\n+    init: function() {\n+      var self = this;\n+      this.cacheEls();\n+      this.bindEvents();\n+      this.currencyFields.each(function(){\n+        $(this).trigger('blur');\n+      });\n+    },\n+\n+    bindEvents: function() {\n+      this.currencyFields.on('blur', this.formatCurrency);\n+    },\n+\n+    formatCurrency: function(evt) {\n+      var $field = $(evt.target);\n+      var pounds = $field.val().toString().replace(/,/g, '');\n+\n+      if(!isNaN(parseFloat(pounds))) {\n+        var pence = Math.round(parseFloat(pounds)*100);\n+        var pennies = pence % 100;\n+        var pounds = Math.floor(pence/100);","path":"cla_public/static-src/javascripts/modules/currency-formatting.js","position":27,"original_position":27,"commit_id":"fb511fb52d2b584074eaaef175e86edb7dc38ff4","original_commit_id":"fb511fb52d2b584074eaaef175e86edb7dc38ff4","user":{"login":"axemonkey","id":988436,"avatar_url":"https://avatars.githubusercontent.com/u/988436?v=3","gravatar_id":"","url":"https://api.github.com/users/axemonkey","html_url":"https://github.com/axemonkey","followers_url":"https://api.github.com/users/axemonkey/followers","following_url":"https://api.github.com/users/axemonkey/following{/other_user}","gists_url":"https://api.github.com/users/axemonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/axemonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axemonkey/subscriptions","organizations_url":"https://api.github.com/users/axemonkey/orgs","repos_url":"https://api.github.com/users/axemonkey/repos","events_url":"https://api.github.com/users/axemonkey/events{/privacy}","received_events_url":"https://api.github.com/users/axemonkey/received_events","type":"User","site_admin":false},"body":"DOH. Friday code. Will fix.","created_at":"2015-01-16T17:27:21Z","updated_at":"2015-01-16T17:27:21Z","html_url":"https://github.com/ministryofjustice/cla_public/pull/374#discussion_r23094828","pull_request_url":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/374","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/comments/23094828"},"html":{"href":"https://github.com/ministryofjustice/cla_public/pull/374#discussion_r23094828"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/374"}}},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/374","id":27520399,"html_url":"https://github.com/ministryofjustice/cla_public/pull/374","diff_url":"https://github.com/ministryofjustice/cla_public/pull/374.diff","patch_url":"https://github.com/ministryofjustice/cla_public/pull/374.patch","issue_url":"https://api.github.com/repos/ministryofjustice/cla_public/issues/374","number":374,"state":"open","locked":false,"title":"format currencies in fields","user":{"login":"axemonkey","id":988436,"avatar_url":"https://avatars.githubusercontent.com/u/988436?v=3","gravatar_id":"","url":"https://api.github.com/users/axemonkey","html_url":"https://github.com/axemonkey","followers_url":"https://api.github.com/users/axemonkey/followers","following_url":"https://api.github.com/users/axemonkey/following{/other_user}","gists_url":"https://api.github.com/users/axemonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/axemonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axemonkey/subscriptions","organizations_url":"https://api.github.com/users/axemonkey/orgs","repos_url":"https://api.github.com/users/axemonkey/repos","events_url":"https://api.github.com/users/axemonkey/events{/privacy}","received_events_url":"https://api.github.com/users/axemonkey/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-16T17:08:51Z","updated_at":"2015-01-16T17:27:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d129a6d498f9681be05dc36c73f4a32b98bd87ac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/374/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/374/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ministryofjustice/cla_public/issues/374/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/cla_public/statuses/fb511fb52d2b584074eaaef175e86edb7dc38ff4","head":{"label":"ministryofjustice:feature/currency-formatting","ref":"feature/currency-formatting","sha":"fb511fb52d2b584074eaaef175e86edb7dc38ff4","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":17939582,"name":"cla_public","full_name":"ministryofjustice/cla_public","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/cla_public","description":"Public facing site of the CLA app","fork":false,"url":"https://api.github.com/repos/ministryofjustice/cla_public","forks_url":"https://api.github.com/repos/ministryofjustice/cla_public/forks","keys_url":"https://api.github.com/repos/ministryofjustice/cla_public/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/cla_public/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/cla_public/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/cla_public/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/cla_public/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/cla_public/events","assignees_url":"https://api.github.com/repos/ministryofjustice/cla_public/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/cla_public/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/cla_public/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/cla_public/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/cla_public/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/cla_public/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/cla_public/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/cla_public/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/cla_public/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/cla_public/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/cla_public/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/cla_public/issues/comments/{number}","contents_url":"https://api.github.com/repos/ministryofjustice/cla_public/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/cla_public/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/cla_public/merges","archive_url":"https://api.github.com/repos/ministryofjustice/cla_public/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/cla_public/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/cla_public/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/cla_public/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/cla_public/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/cla_public/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/cla_public/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/cla_public/releases{/id}","created_at":"2014-03-20T11:09:30Z","updated_at":"2015-01-15T14:49:04Z","pushed_at":"2015-01-16T17:07:58Z","git_url":"git://github.com/ministryofjustice/cla_public.git","ssh_url":"git@github.com:ministryofjustice/cla_public.git","clone_url":"https://github.com/ministryofjustice/cla_public.git","svn_url":"https://github.com/ministryofjustice/cla_public","homepage":null,"size":10592,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"ministryofjustice:develop","ref":"develop","sha":"fde3da4d6c4e72584c9caeecc2e1604719503b19","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":17939582,"name":"cla_public","full_name":"ministryofjustice/cla_public","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/cla_public","description":"Public facing site of the CLA app","fork":false,"url":"https://api.github.com/repos/ministryofjustice/cla_public","forks_url":"https://api.github.com/repos/ministryofjustice/cla_public/forks","keys_url":"https://api.github.com/repos/ministryofjustice/cla_public/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/cla_public/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/cla_public/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/cla_public/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/cla_public/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/cla_public/events","assignees_url":"https://api.github.com/repos/ministryofjustice/cla_public/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/cla_public/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/cla_public/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/cla_public/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/cla_public/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/cla_public/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/cla_public/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/cla_public/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/cla_public/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/cla_public/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/cla_public/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/cla_public/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/cla_public/issues/comments/{number}","contents_url":"https://api.github.com/repos/ministryofjustice/cla_public/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/cla_public/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/cla_public/merges","archive_url":"https://api.github.com/repos/ministryofjustice/cla_public/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/cla_public/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/cla_public/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/cla_public/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/cla_public/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/cla_public/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/cla_public/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/cla_public/releases{/id}","created_at":"2014-03-20T11:09:30Z","updated_at":"2015-01-15T14:49:04Z","pushed_at":"2015-01-16T17:07:58Z","git_url":"git://github.com/ministryofjustice/cla_public.git","ssh_url":"git@github.com:ministryofjustice/cla_public.git","clone_url":"https://github.com/ministryofjustice/cla_public.git","svn_url":"https://github.com/ministryofjustice/cla_public","homepage":null,"size":10592,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/374"},"html":{"href":"https://github.com/ministryofjustice/cla_public/pull/374"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/cla_public/issues/374"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/cla_public/issues/374/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/374/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/cla_public/pulls/374/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/cla_public/statuses/fb511fb52d2b584074eaaef175e86edb7dc38ff4"}}}}