{"action":"created","comment":{"url":"https://api.github.com/repos/biosistemika/scinote-web/pulls/comments/178265916","pull_request_review_id":108301585,"id":178265916,"diff_hunk":"@@ -0,0 +1,58 @@\n+(function(global) {\n+  'use strict';\n+\n+  global.initPreviewModal = function initPreviewModal() {\n+    var name;\n+    var url;\n+    var downloadUrl;\n+    $('.file-preview-link').off();\n+    $('.file-preview-link').click(function(e) {\n+      e.preventDefault();\n+      name = $(this).find('p').text();\n+      url = $(this).data('preview-url');\n+      downloadUrl = $(this).attr('href');\n+      openPreviewModal(name, url, downloadUrl);\n+    });\n+  }\n+\n+  function openPreviewModal(name, url, downloadUrl) {\n+    var modal = $('#filePreviewModal');\n+    $.ajax({\n+      url: url,\n+      type: 'GET',\n+      dataType: 'json',\n+      success: function(data) {\n+        modal.find('.file-preview-container').empty();\n+        modal.find('.file-wopi-controls').empty();\n+        if (data.hasOwnProperty('wopi-controls')) {\n+          modal.find('.file-wopi-controls').html(data['wopi-controls']);\n+        }\n+        var link = modal.find('.file-download-link');\n+        link.attr('href', downloadUrl);\n+        link.attr('data-no-turbolink', true);\n+        link.attr('data-status', 'asset-present');\n+        if (data['type'] === 'image') {\n+          modal.find('.file-preview-container')\n+               .append($('<img>')\n+                 .attr('src', data['large-preview-url'])\n+                 .attr('alt', name)\n+                 .click(function(ev) {\n+                   ev.stopPropagation();\n+                 })\n+               );\n+        } else {\n+          modal.find('.file-preview-container').html(data['preview-icon']);\n+        }\n+        modal.find('.file-name').text(name);\n+        modal.find('.modal-body').click(function() {\n+          modal.modal('hide');\n+        });\n+        modal.modal();\n+        $('.modal-backdrop').last().css('z-index', modal.css('z-index') - 1);\n+      },\n+      error: function(ev) {","path":"app/assets/javascripts/sitewide/file_preview.js","position":53,"original_position":53,"commit_id":"cc5d8550b12384f6d51c4a4ab603c87b9e9bb429","original_commit_id":"cc5d8550b12384f6d51c4a4ab603c87b9e9bb429","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Expected method shorthand                                                  object-shorthand<br>Unexpected unnamed method 'error'                                          func-names<br>'ev' is defined but never used                                             no-unused-vars","created_at":"2018-03-30T09:52:50Z","updated_at":"2018-03-30T09:52:51Z","html_url":"https://github.com/biosistemika/scinote-web/pull/1068#discussion_r178265916","pull_request_url":"https://api.github.com/repos/biosistemika/scinote-web/pulls/1068","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/biosistemika/scinote-web/pulls/comments/178265916"},"html":{"href":"https://github.com/biosistemika/scinote-web/pull/1068#discussion_r178265916"},"pull_request":{"href":"https://api.github.com/repos/biosistemika/scinote-web/pulls/1068"}}},"pull_request":{"url":"https://api.github.com/repos/biosistemika/scinote-web/pulls/1068","id":178530370,"html_url":"https://github.com/biosistemika/scinote-web/pull/1068","diff_url":"https://github.com/biosistemika/scinote-web/pull/1068.diff","patch_url":"https://github.com/biosistemika/scinote-web/pull/1068.patch","issue_url":"https://api.github.com/repos/biosistemika/scinote-web/issues/1068","number":1068,"state":"open","locked":false,"title":"Refactor file preview modal [SCI-2217]","user":{"login":"okriuchykhin","id":22216856,"avatar_url":"https://avatars3.githubusercontent.com/u/22216856?v=4","gravatar_id":"","url":"https://api.github.com/users/okriuchykhin","html_url":"https://github.com/okriuchykhin","followers_url":"https://api.github.com/users/okriuchykhin/followers","following_url":"https://api.github.com/users/okriuchykhin/following{/other_user}","gists_url":"https://api.github.com/users/okriuchykhin/gists{/gist_id}","starred_url":"https://api.github.com/users/okriuchykhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okriuchykhin/subscriptions","organizations_url":"https://api.github.com/users/okriuchykhin/orgs","repos_url":"https://api.github.com/users/okriuchykhin/repos","events_url":"https://api.github.com/users/okriuchykhin/events{/privacy}","received_events_url":"https://api.github.com/users/okriuchykhin/received_events","type":"User","site_admin":false},"body":"https://biosistemika.atlassian.net/browse/SCI-2217","created_at":"2018-03-30T09:52:30Z","updated_at":"2018-03-30T09:52:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00a7aaa53d4ea8c569a4b8b752f999e17c7e10a4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":872393827,"url":"https://api.github.com/repos/biosistemika/scinote-web/labels/ux%20release%201%20:nail_care:","name":"ux release 1 :nail_care:","color":"ffc0bf","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/biosistemika/scinote-web/pulls/1068/commits","review_comments_url":"https://api.github.com/repos/biosistemika/scinote-web/pulls/1068/comments","review_comment_url":"https://api.github.com/repos/biosistemika/scinote-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/biosistemika/scinote-web/issues/1068/comments","statuses_url":"https://api.github.com/repos/biosistemika/scinote-web/statuses/cc5d8550b12384f6d51c4a4ab603c87b9e9bb429","head":{"label":"okriuchykhin:ok_SCI_2217","ref":"ok_SCI_2217","sha":"cc5d8550b12384f6d51c4a4ab603c87b9e9bb429","user":{"login":"okriuchykhin","id":22216856,"avatar_url":"https://avatars3.githubusercontent.com/u/22216856?v=4","gravatar_id":"","url":"https://api.github.com/users/okriuchykhin","html_url":"https://github.com/okriuchykhin","followers_url":"https://api.github.com/users/okriuchykhin/followers","following_url":"https://api.github.com/users/okriuchykhin/following{/other_user}","gists_url":"https://api.github.com/users/okriuchykhin/gists{/gist_id}","starred_url":"https://api.github.com/users/okriuchykhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okriuchykhin/subscriptions","organizations_url":"https://api.github.com/users/okriuchykhin/orgs","repos_url":"https://api.github.com/users/okriuchykhin/repos","events_url":"https://api.github.com/users/okriuchykhin/events{/privacy}","received_events_url":"https://api.github.com/users/okriuchykhin/received_events","type":"User","site_admin":false},"repo":{"id":68292067,"name":"scinote-web","full_name":"okriuchykhin/scinote-web","owner":{"login":"okriuchykhin","id":22216856,"avatar_url":"https://avatars3.githubusercontent.com/u/22216856?v=4","gravatar_id":"","url":"https://api.github.com/users/okriuchykhin","html_url":"https://github.com/okriuchykhin","followers_url":"https://api.github.com/users/okriuchykhin/followers","following_url":"https://api.github.com/users/okriuchykhin/following{/other_user}","gists_url":"https://api.github.com/users/okriuchykhin/gists{/gist_id}","starred_url":"https://api.github.com/users/okriuchykhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okriuchykhin/subscriptions","organizations_url":"https://api.github.com/users/okriuchykhin/orgs","repos_url":"https://api.github.com/users/okriuchykhin/repos","events_url":"https://api.github.com/users/okriuchykhin/events{/privacy}","received_events_url":"https://api.github.com/users/okriuchykhin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/okriuchykhin/scinote-web","description":"Open source electronic scientific notebook (ELN) that helps you manage your laboratory work and stores all your experimental data in one place.","fork":true,"url":"https://api.github.com/repos/okriuchykhin/scinote-web","forks_url":"https://api.github.com/repos/okriuchykhin/scinote-web/forks","keys_url":"https://api.github.com/repos/okriuchykhin/scinote-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/okriuchykhin/scinote-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/okriuchykhin/scinote-web/teams","hooks_url":"https://api.github.com/repos/okriuchykhin/scinote-web/hooks","issue_events_url":"https://api.github.com/repos/okriuchykhin/scinote-web/issues/events{/number}","events_url":"https://api.github.com/repos/okriuchykhin/scinote-web/events","assignees_url":"https://api.github.com/repos/okriuchykhin/scinote-web/assignees{/user}","branches_url":"https://api.github.com/repos/okriuchykhin/scinote-web/branches{/branch}","tags_url":"https://api.github.com/repos/okriuchykhin/scinote-web/tags","blobs_url":"https://api.github.com/repos/okriuchykhin/scinote-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/okriuchykhin/scinote-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/okriuchykhin/scinote-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/okriuchykhin/scinote-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/okriuchykhin/scinote-web/statuses/{sha}","languages_url":"https://api.github.com/repos/okriuchykhin/scinote-web/languages","stargazers_url":"https://api.github.com/repos/okriuchykhin/scinote-web/stargazers","contributors_url":"https://api.github.com/repos/okriuchykhin/scinote-web/contributors","subscribers_url":"https://api.github.com/repos/okriuchykhin/scinote-web/subscribers","subscription_url":"https://api.github.com/repos/okriuchykhin/scinote-web/subscription","commits_url":"https://api.github.com/repos/okriuchykhin/scinote-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/okriuchykhin/scinote-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/okriuchykhin/scinote-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/okriuchykhin/scinote-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/okriuchykhin/scinote-web/contents/{+path}","compare_url":"https://api.github.com/repos/okriuchykhin/scinote-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/okriuchykhin/scinote-web/merges","archive_url":"https://api.github.com/repos/okriuchykhin/scinote-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/okriuchykhin/scinote-web/downloads","issues_url":"https://api.github.com/repos/okriuchykhin/scinote-web/issues{/number}","pulls_url":"https://api.github.com/repos/okriuchykhin/scinote-web/pulls{/number}","milestones_url":"https://api.github.com/repos/okriuchykhin/scinote-web/milestones{/number}","notifications_url":"https://api.github.com/repos/okriuchykhin/scinote-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/okriuchykhin/scinote-web/labels{/name}","releases_url":"https://api.github.com/repos/okriuchykhin/scinote-web/releases{/id}","deployments_url":"https://api.github.com/repos/okriuchykhin/scinote-web/deployments","created_at":"2016-09-15T12:31:51Z","updated_at":"2016-09-15T12:31:53Z","pushed_at":"2018-03-30T09:50:42Z","git_url":"git://github.com/okriuchykhin/scinote-web.git","ssh_url":"git@github.com:okriuchykhin/scinote-web.git","clone_url":"https://github.com/okriuchykhin/scinote-web.git","svn_url":"https://github.com/okriuchykhin/scinote-web","homepage":"http://www.scinote.net","size":13471,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"biosistemika:ux-release-1","ref":"ux-release-1","sha":"b7a14215bcc7ea0d5b29b437c1b79049f94b1bbc","user":{"login":"biosistemika","id":15630206,"avatar_url":"https://avatars2.githubusercontent.com/u/15630206?v=4","gravatar_id":"","url":"https://api.github.com/users/biosistemika","html_url":"https://github.com/biosistemika","followers_url":"https://api.github.com/users/biosistemika/followers","following_url":"https://api.github.com/users/biosistemika/following{/other_user}","gists_url":"https://api.github.com/users/biosistemika/gists{/gist_id}","starred_url":"https://api.github.com/users/biosistemika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biosistemika/subscriptions","organizations_url":"https://api.github.com/users/biosistemika/orgs","repos_url":"https://api.github.com/users/biosistemika/repos","events_url":"https://api.github.com/users/biosistemika/events{/privacy}","received_events_url":"https://api.github.com/users/biosistemika/received_events","type":"Organization","site_admin":false},"repo":{"id":51598133,"name":"scinote-web","full_name":"biosistemika/scinote-web","owner":{"login":"biosistemika","id":15630206,"avatar_url":"https://avatars2.githubusercontent.com/u/15630206?v=4","gravatar_id":"","url":"https://api.github.com/users/biosistemika","html_url":"https://github.com/biosistemika","followers_url":"https://api.github.com/users/biosistemika/followers","following_url":"https://api.github.com/users/biosistemika/following{/other_user}","gists_url":"https://api.github.com/users/biosistemika/gists{/gist_id}","starred_url":"https://api.github.com/users/biosistemika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biosistemika/subscriptions","organizations_url":"https://api.github.com/users/biosistemika/orgs","repos_url":"https://api.github.com/users/biosistemika/repos","events_url":"https://api.github.com/users/biosistemika/events{/privacy}","received_events_url":"https://api.github.com/users/biosistemika/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/biosistemika/scinote-web","description":"Open source electronic lab notebook (ELN) that helps you manage your laboratory work and stores all your experimental data in one place.","fork":false,"url":"https://api.github.com/repos/biosistemika/scinote-web","forks_url":"https://api.github.com/repos/biosistemika/scinote-web/forks","keys_url":"https://api.github.com/repos/biosistemika/scinote-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biosistemika/scinote-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biosistemika/scinote-web/teams","hooks_url":"https://api.github.com/repos/biosistemika/scinote-web/hooks","issue_events_url":"https://api.github.com/repos/biosistemika/scinote-web/issues/events{/number}","events_url":"https://api.github.com/repos/biosistemika/scinote-web/events","assignees_url":"https://api.github.com/repos/biosistemika/scinote-web/assignees{/user}","branches_url":"https://api.github.com/repos/biosistemika/scinote-web/branches{/branch}","tags_url":"https://api.github.com/repos/biosistemika/scinote-web/tags","blobs_url":"https://api.github.com/repos/biosistemika/scinote-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biosistemika/scinote-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biosistemika/scinote-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/biosistemika/scinote-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biosistemika/scinote-web/statuses/{sha}","languages_url":"https://api.github.com/repos/biosistemika/scinote-web/languages","stargazers_url":"https://api.github.com/repos/biosistemika/scinote-web/stargazers","contributors_url":"https://api.github.com/repos/biosistemika/scinote-web/contributors","subscribers_url":"https://api.github.com/repos/biosistemika/scinote-web/subscribers","subscription_url":"https://api.github.com/repos/biosistemika/scinote-web/subscription","commits_url":"https://api.github.com/repos/biosistemika/scinote-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/biosistemika/scinote-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/biosistemika/scinote-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/biosistemika/scinote-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/biosistemika/scinote-web/contents/{+path}","compare_url":"https://api.github.com/repos/biosistemika/scinote-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biosistemika/scinote-web/merges","archive_url":"https://api.github.com/repos/biosistemika/scinote-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biosistemika/scinote-web/downloads","issues_url":"https://api.github.com/repos/biosistemika/scinote-web/issues{/number}","pulls_url":"https://api.github.com/repos/biosistemika/scinote-web/pulls{/number}","milestones_url":"https://api.github.com/repos/biosistemika/scinote-web/milestones{/number}","notifications_url":"https://api.github.com/repos/biosistemika/scinote-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biosistemika/scinote-web/labels{/name}","releases_url":"https://api.github.com/repos/biosistemika/scinote-web/releases{/id}","deployments_url":"https://api.github.com/repos/biosistemika/scinote-web/deployments","created_at":"2016-02-12T15:47:19Z","updated_at":"2018-03-28T13:23:08Z","pushed_at":"2018-03-30T09:52:31Z","git_url":"git://github.com/biosistemika/scinote-web.git","ssh_url":"git@github.com:biosistemika/scinote-web.git","clone_url":"https://github.com/biosistemika/scinote-web.git","svn_url":"https://github.com/biosistemika/scinote-web","homepage":"https://www.scinote.net","size":25104,"stargazers_count":132,"watchers_count":132,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":38,"open_issues":12,"watchers":132,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biosistemika/scinote-web/pulls/1068"},"html":{"href":"https://github.com/biosistemika/scinote-web/pull/1068"},"issue":{"href":"https://api.github.com/repos/biosistemika/scinote-web/issues/1068"},"comments":{"href":"https://api.github.com/repos/biosistemika/scinote-web/issues/1068/comments"},"review_comments":{"href":"https://api.github.com/repos/biosistemika/scinote-web/pulls/1068/comments"},"review_comment":{"href":"https://api.github.com/repos/biosistemika/scinote-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/biosistemika/scinote-web/pulls/1068/commits"},"statuses":{"href":"https://api.github.com/repos/biosistemika/scinote-web/statuses/cc5d8550b12384f6d51c4a4ab603c87b9e9bb429"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houndci-bot"}}