{"action":"created","comment":{"url":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/comments/76523400","id":76523400,"diff_hunk":"@@ -199,6 +209,85 @@ if(modeEnabled('translation')) {\n             $('a#fileDownload').fadeOut('fast');\n         });\n \n+        $('#translatedText').css('height', $('#originalText').css('height'));\n+        $('#suggestCloseBtn').click(function () {\n+            $('#suggestedWordInput').val('');\n+            grecaptcha.reset();\n+        });\n+        $('#suggestBtn').click(function () {\n+            var fromWord = $('#suggestionTargetWord').html();\n+            var toWord = $('#suggestedWordInput').val();\n+            var recaptchaResponse = grecaptcha.getResponse();\n+\n+            if(toWord.length === 0) {\n+                $('#suggestedWordInput').tooltip('destroy');\n+                $('#suggestedWordInput').tooltip({\n+                    'title': 'Suggestion cannot be empty.',\n+                    'trigger': 'manual',\n+                    'placement': 'bottom'\n+                });\n+                $('#suggestedWordInput').tooltip('show');\n+                setTimeout(function () {\n+                    $('#suggestedWordInput').tooltip('destroy');\n+                }, SUGGESTION_DESTROY_TIMEOUT);\n+\n+                return;\n+            }\n+\n+            // Obtaining context, (± config.SUGGESTIONS.context_sizi) words\n+            // fallback to complete text if this fails.\n+            var hashedWord = fromWord.hashCode() + fromWord + fromWord.hashCode();\n+            $('#wordGettingSuggested').text(hashedWord);\n+\n+            var splitText = $('#translatedText').text().split(' ');\n+            $('#wordGettingSuggested').text(fromWord);\n+\n+            var targetIndex = splitText.indexOf(hashedWord);\n+            var wrapLength = parseInt(config.SUGGESTIONS.context_size);\n+            var begin = (targetIndex > wrapLength) ? (targetIndex - wrapLength) : 0;\n+            var end = (splitText.length - targetIndex - 1 > wrapLength) ? (targetIndex + wrapLength + 1) : splitText.length;            ","path":"assets/js/translator.js","position":64,"original_position":64,"commit_id":"034907e7d1c56ae99ed137657b649163341b3fcb","original_commit_id":"034907e7d1c56ae99ed137657b649163341b3fcb","user":{"login":"Kira-D","id":15314543,"avatar_url":"https://avatars.githubusercontent.com/u/15314543?v=3","gravatar_id":"","url":"https://api.github.com/users/Kira-D","html_url":"https://github.com/Kira-D","followers_url":"https://api.github.com/users/Kira-D/followers","following_url":"https://api.github.com/users/Kira-D/following{/other_user}","gists_url":"https://api.github.com/users/Kira-D/gists{/gist_id}","starred_url":"https://api.github.com/users/Kira-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kira-D/subscriptions","organizations_url":"https://api.github.com/users/Kira-D/orgs","repos_url":"https://api.github.com/users/Kira-D/repos","events_url":"https://api.github.com/users/Kira-D/events{/privacy}","received_events_url":"https://api.github.com/users/Kira-D/received_events","type":"User","site_admin":false},"body":"I think that the name is ok. Do you want another name for this variable?","created_at":"2016-08-27T22:48:51Z","updated_at":"2016-08-27T22:48:51Z","html_url":"https://github.com/goavki/apertium-html-tools/pull/72#discussion_r76523400","pull_request_url":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/comments/76523400"},"html":{"href":"https://github.com/goavki/apertium-html-tools/pull/72#discussion_r76523400"},"pull_request":{"href":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/72","id":82998091,"html_url":"https://github.com/goavki/apertium-html-tools/pull/72","diff_url":"https://github.com/goavki/apertium-html-tools/pull/72.diff","patch_url":"https://github.com/goavki/apertium-html-tools/pull/72.patch","issue_url":"https://api.github.com/repos/goavki/apertium-html-tools/issues/72","number":72,"state":"open","locked":false,"title":"Suggestions","user":{"login":"Kira-D","id":15314543,"avatar_url":"https://avatars.githubusercontent.com/u/15314543?v=3","gravatar_id":"","url":"https://api.github.com/users/Kira-D","html_url":"https://github.com/Kira-D","followers_url":"https://api.github.com/users/Kira-D/followers","following_url":"https://api.github.com/users/Kira-D/following{/other_user}","gists_url":"https://api.github.com/users/Kira-D/gists{/gist_id}","starred_url":"https://api.github.com/users/Kira-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kira-D/subscriptions","organizations_url":"https://api.github.com/users/Kira-D/orgs","repos_url":"https://api.github.com/users/Kira-D/repos","events_url":"https://api.github.com/users/Kira-D/events{/privacy}","received_events_url":"https://api.github.com/users/Kira-D/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-27T20:41:58Z","updated_at":"2016-08-27T22:48:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da848a778db620e612db30329e96b835c8bc991b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/72/commits","review_comments_url":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/72/comments","review_comment_url":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/goavki/apertium-html-tools/issues/72/comments","statuses_url":"https://api.github.com/repos/goavki/apertium-html-tools/statuses/034907e7d1c56ae99ed137657b649163341b3fcb","head":{"label":"Kira-D:lastSuggestions","ref":"lastSuggestions","sha":"034907e7d1c56ae99ed137657b649163341b3fcb","user":{"login":"Kira-D","id":15314543,"avatar_url":"https://avatars.githubusercontent.com/u/15314543?v=3","gravatar_id":"","url":"https://api.github.com/users/Kira-D","html_url":"https://github.com/Kira-D","followers_url":"https://api.github.com/users/Kira-D/followers","following_url":"https://api.github.com/users/Kira-D/following{/other_user}","gists_url":"https://api.github.com/users/Kira-D/gists{/gist_id}","starred_url":"https://api.github.com/users/Kira-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kira-D/subscriptions","organizations_url":"https://api.github.com/users/Kira-D/orgs","repos_url":"https://api.github.com/users/Kira-D/repos","events_url":"https://api.github.com/users/Kira-D/events{/privacy}","received_events_url":"https://api.github.com/users/Kira-D/received_events","type":"User","site_admin":false},"repo":{"id":53226621,"name":"apertium-html-tools","full_name":"Kira-D/apertium-html-tools","owner":{"login":"Kira-D","id":15314543,"avatar_url":"https://avatars.githubusercontent.com/u/15314543?v=3","gravatar_id":"","url":"https://api.github.com/users/Kira-D","html_url":"https://github.com/Kira-D","followers_url":"https://api.github.com/users/Kira-D/followers","following_url":"https://api.github.com/users/Kira-D/following{/other_user}","gists_url":"https://api.github.com/users/Kira-D/gists{/gist_id}","starred_url":"https://api.github.com/users/Kira-D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kira-D/subscriptions","organizations_url":"https://api.github.com/users/Kira-D/orgs","repos_url":"https://api.github.com/users/Kira-D/repos","events_url":"https://api.github.com/users/Kira-D/events{/privacy}","received_events_url":"https://api.github.com/users/Kira-D/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kira-D/apertium-html-tools","description":"Apertium Html-tools is a web application providing a fully localised interface for text/document translation, analysis and generation powered by Apertium.","fork":true,"url":"https://api.github.com/repos/Kira-D/apertium-html-tools","forks_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/forks","keys_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/teams","hooks_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/hooks","issue_events_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/issues/events{/number}","events_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/events","assignees_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/assignees{/user}","branches_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/branches{/branch}","tags_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/tags","blobs_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/languages","stargazers_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/stargazers","contributors_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/contributors","subscribers_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/subscribers","subscription_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/subscription","commits_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/contents/{+path}","compare_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/merges","archive_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/downloads","issues_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/issues{/number}","pulls_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/labels{/name}","releases_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/releases{/id}","deployments_url":"https://api.github.com/repos/Kira-D/apertium-html-tools/deployments","created_at":"2016-03-05T22:34:34Z","updated_at":"2016-03-05T22:34:36Z","pushed_at":"2016-08-27T22:40:25Z","git_url":"git://github.com/Kira-D/apertium-html-tools.git","ssh_url":"git@github.com:Kira-D/apertium-html-tools.git","clone_url":"https://github.com/Kira-D/apertium-html-tools.git","svn_url":"https://github.com/Kira-D/apertium-html-tools","homepage":"http://wiki.apertium.org/wiki/Apertium-html-tools","size":2039,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"goavki:master","ref":"master","sha":"f30a358a9073a2d28c33072f1342a7e53f850cb9","user":{"login":"goavki","id":10347085,"avatar_url":"https://avatars.githubusercontent.com/u/10347085?v=3","gravatar_id":"","url":"https://api.github.com/users/goavki","html_url":"https://github.com/goavki","followers_url":"https://api.github.com/users/goavki/followers","following_url":"https://api.github.com/users/goavki/following{/other_user}","gists_url":"https://api.github.com/users/goavki/gists{/gist_id}","starred_url":"https://api.github.com/users/goavki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goavki/subscriptions","organizations_url":"https://api.github.com/users/goavki/orgs","repos_url":"https://api.github.com/users/goavki/repos","events_url":"https://api.github.com/users/goavki/events{/privacy}","received_events_url":"https://api.github.com/users/goavki/received_events","type":"Organization","site_admin":false},"repo":{"id":28576409,"name":"apertium-html-tools","full_name":"goavki/apertium-html-tools","owner":{"login":"goavki","id":10347085,"avatar_url":"https://avatars.githubusercontent.com/u/10347085?v=3","gravatar_id":"","url":"https://api.github.com/users/goavki","html_url":"https://github.com/goavki","followers_url":"https://api.github.com/users/goavki/followers","following_url":"https://api.github.com/users/goavki/following{/other_user}","gists_url":"https://api.github.com/users/goavki/gists{/gist_id}","starred_url":"https://api.github.com/users/goavki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goavki/subscriptions","organizations_url":"https://api.github.com/users/goavki/orgs","repos_url":"https://api.github.com/users/goavki/repos","events_url":"https://api.github.com/users/goavki/events{/privacy}","received_events_url":"https://api.github.com/users/goavki/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/goavki/apertium-html-tools","description":"Apertium Html-tools is a web application providing a fully localised interface for text/document translation, analysis and generation powered by Apertium.","fork":false,"url":"https://api.github.com/repos/goavki/apertium-html-tools","forks_url":"https://api.github.com/repos/goavki/apertium-html-tools/forks","keys_url":"https://api.github.com/repos/goavki/apertium-html-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/goavki/apertium-html-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/goavki/apertium-html-tools/teams","hooks_url":"https://api.github.com/repos/goavki/apertium-html-tools/hooks","issue_events_url":"https://api.github.com/repos/goavki/apertium-html-tools/issues/events{/number}","events_url":"https://api.github.com/repos/goavki/apertium-html-tools/events","assignees_url":"https://api.github.com/repos/goavki/apertium-html-tools/assignees{/user}","branches_url":"https://api.github.com/repos/goavki/apertium-html-tools/branches{/branch}","tags_url":"https://api.github.com/repos/goavki/apertium-html-tools/tags","blobs_url":"https://api.github.com/repos/goavki/apertium-html-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/goavki/apertium-html-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/goavki/apertium-html-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/goavki/apertium-html-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/goavki/apertium-html-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/goavki/apertium-html-tools/languages","stargazers_url":"https://api.github.com/repos/goavki/apertium-html-tools/stargazers","contributors_url":"https://api.github.com/repos/goavki/apertium-html-tools/contributors","subscribers_url":"https://api.github.com/repos/goavki/apertium-html-tools/subscribers","subscription_url":"https://api.github.com/repos/goavki/apertium-html-tools/subscription","commits_url":"https://api.github.com/repos/goavki/apertium-html-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/goavki/apertium-html-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/goavki/apertium-html-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/goavki/apertium-html-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/goavki/apertium-html-tools/contents/{+path}","compare_url":"https://api.github.com/repos/goavki/apertium-html-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/goavki/apertium-html-tools/merges","archive_url":"https://api.github.com/repos/goavki/apertium-html-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/goavki/apertium-html-tools/downloads","issues_url":"https://api.github.com/repos/goavki/apertium-html-tools/issues{/number}","pulls_url":"https://api.github.com/repos/goavki/apertium-html-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/goavki/apertium-html-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/goavki/apertium-html-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/goavki/apertium-html-tools/labels{/name}","releases_url":"https://api.github.com/repos/goavki/apertium-html-tools/releases{/id}","deployments_url":"https://api.github.com/repos/goavki/apertium-html-tools/deployments","created_at":"2014-12-29T01:40:22Z","updated_at":"2016-08-26T18:44:09Z","pushed_at":"2016-08-27T22:40:26Z","git_url":"git://github.com/goavki/apertium-html-tools.git","ssh_url":"git@github.com:goavki/apertium-html-tools.git","clone_url":"https://github.com/goavki/apertium-html-tools.git","svn_url":"https://github.com/goavki/apertium-html-tools","homepage":"http://wiki.apertium.org/wiki/Apertium-html-tools","size":12397,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":28,"forks":12,"open_issues":28,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/72"},"html":{"href":"https://github.com/goavki/apertium-html-tools/pull/72"},"issue":{"href":"https://api.github.com/repos/goavki/apertium-html-tools/issues/72"},"comments":{"href":"https://api.github.com/repos/goavki/apertium-html-tools/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/goavki/apertium-html-tools/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/goavki/apertium-html-tools/statuses/034907e7d1c56ae99ed137657b649163341b3fcb"}}}}
{"actor":{"display_login":"Kira-D"}}