{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/pontoon/pulls/comments/130027492","pull_request_review_id":52860058,"id":130027492,"diff_hunk":"@@ -1954,45 +1974,53 @@ var Pontoon = (function (my) {\n       });\n \n       $('#helpers .history').on('click', 'menu .unapprove', function (e) {\n-         var button = $(this),\n-             translationId = parseInt($(this).parents('li').data('id'));\n+        var button = $(this),\n+            translationId = parseInt($(this).parents('li').data('id'));\n \n-         $.post('/unapprove-translation/', {\n-            csrfmiddlewaretoken: $('#server').data('csrf'),\n-            translation: translationId,\n-            paths: self.getPartPaths(self.currentPart)\n-         }).then(function(data) {\n-           var entity = self.getEditorEntity(),\n-               pf = self.getPluralForm(true);\n-\n-           self.stats = data.stats;\n-           self.updateProgress(entity);\n-\n-           self.updateTranslation(entity, pf, data.translation);\n-\n-           $('#translation').val(data.translation.string).focus();\n-           self.updateCachedTranslation();\n-           self.updateCurrentTranslationLength();\n-\n-           if (entity.body && pf === 0) {\n-             self.postMessage(\"SAVE\", {\n-               translation: data.translation.string,\n-               id: entity.id\n-             });\n-           }\n-\n-           button.removeClass('unapprove').addClass('approve');\n-           button.prop('title', 'Approve');\n-           button.parents('li.translated').removeClass('translated').addClass('suggested');\n-           button.parents('li').find('.info a').prop('title', self.getApproveButtonTitle({\n-             approved: false,\n-             unapproved_user: self.user.display_name\n-           }));\n-\n-           self.endLoader('Translation has been unapproved.');\n-         }, function() {\n-           self.endLoader(\"Couldn't unapprove this translation.\");\n-         });\n+        $.post('/unapprove-translation/', {\n+          csrfmiddlewaretoken: $('#server').data('csrf'),\n+          translation: translationId,\n+          paths: self.getPartPaths(self.currentPart)\n+        }).then(function(data) {\n+          var entity = self.getEditorEntity(),\n+              pf = self.getPluralForm(true);\n+\n+          self.stats = data.stats;\n+          self.updateProgress(entity);\n+\n+          self.updateTranslation(entity, pf, data.translation);\n+\n+          // FTL Editor\n+          if ($('#ftl').is('.active')) {\n+            self.fluent.renderEditorWithTranslation(data.translation);\n+\n+          // Standard Editor\n+          } else {\n+            var translationString = self.fluent.getSimplePreview(data.translation, data.translation.string, entity);\n+            $('#translation').val(translationString).focus();\n+            self.updateCachedTranslation();\n+            self.updateCurrentTranslationLength();\n+          }\n+\n+          if (entity.body && pf === 0) {\n+            self.postMessage(\"SAVE\", {\n+              translation: data.translation.string,\n+              id: entity.id\n+            });\n+          }\n+\n+          button.removeClass('unapprove').addClass('approve');","path":"pontoon/base/static/js/translate.js","position":130,"original_position":130,"commit_id":"257567b4866eceb5f0bca80096d3f10d4591e342","original_commit_id":"257567b4866eceb5f0bca80096d3f10d4591e342","user":{"login":"jotes","id":8784972,"avatar_url":"https://avatars2.githubusercontent.com/u/8784972?v=4","gravatar_id":"","url":"https://api.github.com/users/jotes","html_url":"https://github.com/jotes","followers_url":"https://api.github.com/users/jotes/followers","following_url":"https://api.github.com/users/jotes/following{/other_user}","gists_url":"https://api.github.com/users/jotes/gists{/gist_id}","starred_url":"https://api.github.com/users/jotes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jotes/subscriptions","organizations_url":"https://api.github.com/users/jotes/orgs","repos_url":"https://api.github.com/users/jotes/repos","events_url":"https://api.github.com/users/jotes/events{/privacy}","received_events_url":"https://api.github.com/users/jotes/received_events","type":"User","site_admin":false},"body":"I hope that React/Angular will free us from that bloat of changing of state of elements inside the js code.","created_at":"2017-07-28T07:21:34Z","updated_at":"2017-07-28T07:21:34Z","html_url":"https://github.com/mozilla/pontoon/pull/651#discussion_r130027492","pull_request_url":"https://api.github.com/repos/mozilla/pontoon/pulls/651","_links":{"self":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/comments/130027492"},"html":{"href":"https://github.com/mozilla/pontoon/pull/651#discussion_r130027492"},"pull_request":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/651"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/pontoon/pulls/651","id":132870366,"html_url":"https://github.com/mozilla/pontoon/pull/651","diff_url":"https://github.com/mozilla/pontoon/pull/651.diff","patch_url":"https://github.com/mozilla/pontoon/pull/651.patch","issue_url":"https://api.github.com/repos/mozilla/pontoon/issues/651","number":651,"state":"open","locked":false,"title":"Fixes for a few FTL bugs","user":{"login":"mathjazz","id":626716,"avatar_url":"https://avatars2.githubusercontent.com/u/626716?v=4","gravatar_id":"","url":"https://api.github.com/users/mathjazz","html_url":"https://github.com/mathjazz","followers_url":"https://api.github.com/users/mathjazz/followers","following_url":"https://api.github.com/users/mathjazz/following{/other_user}","gists_url":"https://api.github.com/users/mathjazz/gists{/gist_id}","starred_url":"https://api.github.com/users/mathjazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathjazz/subscriptions","organizations_url":"https://api.github.com/users/mathjazz/orgs","repos_url":"https://api.github.com/users/mathjazz/repos","events_url":"https://api.github.com/users/mathjazz/events{/privacy}","received_events_url":"https://api.github.com/users/mathjazz/received_events","type":"User","site_admin":false},"body":"Details in commit messages.\r\n\r\n@jotes r?","created_at":"2017-07-28T00:02:00Z","updated_at":"2017-07-28T07:21:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec64c66ce25b2a8c59dc4c92a9253fb1c0f65153","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/pontoon/pulls/651/commits","review_comments_url":"https://api.github.com/repos/mozilla/pontoon/pulls/651/comments","review_comment_url":"https://api.github.com/repos/mozilla/pontoon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/pontoon/issues/651/comments","statuses_url":"https://api.github.com/repos/mozilla/pontoon/statuses/257567b4866eceb5f0bca80096d3f10d4591e342","head":{"label":"mathjazz:a-few-ftl-bugs","ref":"a-few-ftl-bugs","sha":"257567b4866eceb5f0bca80096d3f10d4591e342","user":{"login":"mathjazz","id":626716,"avatar_url":"https://avatars2.githubusercontent.com/u/626716?v=4","gravatar_id":"","url":"https://api.github.com/users/mathjazz","html_url":"https://github.com/mathjazz","followers_url":"https://api.github.com/users/mathjazz/followers","following_url":"https://api.github.com/users/mathjazz/following{/other_user}","gists_url":"https://api.github.com/users/mathjazz/gists{/gist_id}","starred_url":"https://api.github.com/users/mathjazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathjazz/subscriptions","organizations_url":"https://api.github.com/users/mathjazz/orgs","repos_url":"https://api.github.com/users/mathjazz/repos","events_url":"https://api.github.com/users/mathjazz/events{/privacy}","received_events_url":"https://api.github.com/users/mathjazz/received_events","type":"User","site_admin":false},"repo":{"id":35116849,"name":"pontoon","full_name":"mathjazz/pontoon","owner":{"login":"mathjazz","id":626716,"avatar_url":"https://avatars2.githubusercontent.com/u/626716?v=4","gravatar_id":"","url":"https://api.github.com/users/mathjazz","html_url":"https://github.com/mathjazz","followers_url":"https://api.github.com/users/mathjazz/followers","following_url":"https://api.github.com/users/mathjazz/following{/other_user}","gists_url":"https://api.github.com/users/mathjazz/gists{/gist_id}","starred_url":"https://api.github.com/users/mathjazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathjazz/subscriptions","organizations_url":"https://api.github.com/users/mathjazz/orgs","repos_url":"https://api.github.com/users/mathjazz/repos","events_url":"https://api.github.com/users/mathjazz/events{/privacy}","received_events_url":"https://api.github.com/users/mathjazz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mathjazz/pontoon","description":"In-place localization tool","fork":true,"url":"https://api.github.com/repos/mathjazz/pontoon","forks_url":"https://api.github.com/repos/mathjazz/pontoon/forks","keys_url":"https://api.github.com/repos/mathjazz/pontoon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mathjazz/pontoon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mathjazz/pontoon/teams","hooks_url":"https://api.github.com/repos/mathjazz/pontoon/hooks","issue_events_url":"https://api.github.com/repos/mathjazz/pontoon/issues/events{/number}","events_url":"https://api.github.com/repos/mathjazz/pontoon/events","assignees_url":"https://api.github.com/repos/mathjazz/pontoon/assignees{/user}","branches_url":"https://api.github.com/repos/mathjazz/pontoon/branches{/branch}","tags_url":"https://api.github.com/repos/mathjazz/pontoon/tags","blobs_url":"https://api.github.com/repos/mathjazz/pontoon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mathjazz/pontoon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mathjazz/pontoon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mathjazz/pontoon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mathjazz/pontoon/statuses/{sha}","languages_url":"https://api.github.com/repos/mathjazz/pontoon/languages","stargazers_url":"https://api.github.com/repos/mathjazz/pontoon/stargazers","contributors_url":"https://api.github.com/repos/mathjazz/pontoon/contributors","subscribers_url":"https://api.github.com/repos/mathjazz/pontoon/subscribers","subscription_url":"https://api.github.com/repos/mathjazz/pontoon/subscription","commits_url":"https://api.github.com/repos/mathjazz/pontoon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mathjazz/pontoon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mathjazz/pontoon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mathjazz/pontoon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mathjazz/pontoon/contents/{+path}","compare_url":"https://api.github.com/repos/mathjazz/pontoon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mathjazz/pontoon/merges","archive_url":"https://api.github.com/repos/mathjazz/pontoon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mathjazz/pontoon/downloads","issues_url":"https://api.github.com/repos/mathjazz/pontoon/issues{/number}","pulls_url":"https://api.github.com/repos/mathjazz/pontoon/pulls{/number}","milestones_url":"https://api.github.com/repos/mathjazz/pontoon/milestones{/number}","notifications_url":"https://api.github.com/repos/mathjazz/pontoon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mathjazz/pontoon/labels{/name}","releases_url":"https://api.github.com/repos/mathjazz/pontoon/releases{/id}","deployments_url":"https://api.github.com/repos/mathjazz/pontoon/deployments","created_at":"2015-05-05T18:28:58Z","updated_at":"2016-10-25T09:24:45Z","pushed_at":"2017-07-27T23:59:46Z","git_url":"git://github.com/mathjazz/pontoon.git","ssh_url":"git@github.com:mathjazz/pontoon.git","clone_url":"https://github.com/mathjazz/pontoon.git","svn_url":"https://github.com/mathjazz/pontoon","homepage":"https://pontoon.mozilla.org/","size":21414,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"004e092f9baf292c50343d10347137c6804aac9d","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1385890,"name":"pontoon","full_name":"mozilla/pontoon","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/pontoon","description":"In-place localization tool","fork":false,"url":"https://api.github.com/repos/mozilla/pontoon","forks_url":"https://api.github.com/repos/mozilla/pontoon/forks","keys_url":"https://api.github.com/repos/mozilla/pontoon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/pontoon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/pontoon/teams","hooks_url":"https://api.github.com/repos/mozilla/pontoon/hooks","issue_events_url":"https://api.github.com/repos/mozilla/pontoon/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/pontoon/events","assignees_url":"https://api.github.com/repos/mozilla/pontoon/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/pontoon/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/pontoon/tags","blobs_url":"https://api.github.com/repos/mozilla/pontoon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/pontoon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/pontoon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/pontoon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/pontoon/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/pontoon/languages","stargazers_url":"https://api.github.com/repos/mozilla/pontoon/stargazers","contributors_url":"https://api.github.com/repos/mozilla/pontoon/contributors","subscribers_url":"https://api.github.com/repos/mozilla/pontoon/subscribers","subscription_url":"https://api.github.com/repos/mozilla/pontoon/subscription","commits_url":"https://api.github.com/repos/mozilla/pontoon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/pontoon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/pontoon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/pontoon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/pontoon/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/pontoon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/pontoon/merges","archive_url":"https://api.github.com/repos/mozilla/pontoon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/pontoon/downloads","issues_url":"https://api.github.com/repos/mozilla/pontoon/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/pontoon/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/pontoon/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/pontoon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/pontoon/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/pontoon/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/pontoon/deployments","created_at":"2011-02-19T11:25:51Z","updated_at":"2017-07-27T18:43:53Z","pushed_at":"2017-07-28T00:02:01Z","git_url":"git://github.com/mozilla/pontoon.git","ssh_url":"git@github.com:mozilla/pontoon.git","clone_url":"https://github.com/mozilla/pontoon.git","svn_url":"https://github.com/mozilla/pontoon","homepage":"https://pontoon.mozilla.org/","size":21169,"stargazers_count":231,"watchers_count":231,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":71,"mirror_url":null,"open_issues_count":11,"forks":71,"open_issues":11,"watchers":231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/651"},"html":{"href":"https://github.com/mozilla/pontoon/pull/651"},"issue":{"href":"https://api.github.com/repos/mozilla/pontoon/issues/651"},"comments":{"href":"https://api.github.com/repos/mozilla/pontoon/issues/651/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/651/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/651/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/pontoon/statuses/257567b4866eceb5f0bca80096d3f10d4591e342"}}}}
{"actor":{"display_login":"jotes"}}