{"action":"created","comment":{"url":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/comments/26040058","id":26040058,"diff_hunk":"@@ -135,9 +137,19 @@ define(['jquery', 'oae.core', 'jquery.oembed'], function($, oae) {\n                     embeddable = false;\n                 }\n             }\n+            // Only embed text, html, images, and types that the browser has plugins to support\n+            var type = widgetData.previews.targetType ? widgetData.previews.targetType.split(';')[0] : false;\n+            var universalSupport = _.contains(['text/html', 'text/plain', 'image/png', 'image/jpeg', 'image/gif', 'image/svg+xml'], type);\n+            var havePlugin = navigator.mimeTypes && navigator.mimeTypes[type] && navigator.mimeTypes[type].enabledPlugin;\n+            var supported = widgetData.previews.targetType && (universalSupport || havePlugin);\n+\n             // The link can be embedded as an iFrame\n-            if (embeddable) {\n-                oae.api.util.template().render($('#linkpreview-iframe-template', $rootel), {'link': link}, $('#linkpreview-container'), $rootel);\n+            if (embeddable && supported) {\n+                if (type.substring(0, 6) === 'image/') {\n+                    oae.api.util.template().render($('#linkpreview-image-template', $rootel), {'img': link, 'linkProfile': widgetData}, $('#linkpreview-container'), $rootel);\n+                } else {\n+                    oae.api.util.template().render($('#linkpreview-iframe-template', $rootel), {'link': link}, $('#linkpreview-container'), $rootel);","path":"node_modules/oae-core/linkpreview/js/linkpreview.js","position":37,"original_position":37,"commit_id":"f6e2f3cd6f203d465d32301074d5c4da1039710d","original_commit_id":"f6e2f3cd6f203d465d32301074d5c4da1039710d","user":{"login":"nicolaasmatthijs","id":109850,"avatar_url":"https://avatars.githubusercontent.com/u/109850?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolaasmatthijs","html_url":"https://github.com/nicolaasmatthijs","followers_url":"https://api.github.com/users/nicolaasmatthijs/followers","following_url":"https://api.github.com/users/nicolaasmatthijs/following{/other_user}","gists_url":"https://api.github.com/users/nicolaasmatthijs/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaasmatthijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaasmatthijs/subscriptions","organizations_url":"https://api.github.com/users/nicolaasmatthijs/orgs","repos_url":"https://api.github.com/users/nicolaasmatthijs/repos","events_url":"https://api.github.com/users/nicolaasmatthijs/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaasmatthijs/received_events","type":"User","site_admin":false},"body":"When a link points to an external file (and therefore a screenshot can't be taken), we should be rendering the default link preview instead of the one where we try to display a screenshot of the page\r\n\r\n![screen shot 2015-03-09 at 07 23 39](https://cloud.githubusercontent.com/assets/109850/6557045/43eae286-c62f-11e4-9668-fe2314d4b44f.png)\r\n","created_at":"2015-03-09T14:38:25Z","updated_at":"2015-03-09T14:38:25Z","html_url":"https://github.com/oaeproject/3akai-ux/pull/3967#discussion_r26040058","pull_request_url":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/3967","_links":{"self":{"href":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/comments/26040058"},"html":{"href":"https://github.com/oaeproject/3akai-ux/pull/3967#discussion_r26040058"},"pull_request":{"href":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/3967"}}},"pull_request":{"url":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/3967","id":27925942,"html_url":"https://github.com/oaeproject/3akai-ux/pull/3967","diff_url":"https://github.com/oaeproject/3akai-ux/pull/3967.diff","patch_url":"https://github.com/oaeproject/3akai-ux/pull/3967.patch","issue_url":"https://api.github.com/repos/oaeproject/3akai-ux/issues/3967","number":3967,"state":"open","locked":false,"title":"check that the browser supports a link content-type before embedding","user":{"login":"stuartf","id":70221,"avatar_url":"https://avatars.githubusercontent.com/u/70221?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartf","html_url":"https://github.com/stuartf","followers_url":"https://api.github.com/users/stuartf/followers","following_url":"https://api.github.com/users/stuartf/following{/other_user}","gists_url":"https://api.github.com/users/stuartf/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartf/subscriptions","organizations_url":"https://api.github.com/users/stuartf/orgs","repos_url":"https://api.github.com/users/stuartf/repos","events_url":"https://api.github.com/users/stuartf/events{/privacy}","received_events_url":"https://api.github.com/users/stuartf/received_events","type":"User","site_admin":false},"body":"needs https://github.com/oaeproject/Hilary/pull/1107","created_at":"2015-01-23T14:14:07Z","updated_at":"2015-03-09T14:38:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da700db647ee61b1950c15adf8e240084f1bb0bb","assignee":{"login":"nicolaasmatthijs","id":109850,"avatar_url":"https://avatars.githubusercontent.com/u/109850?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolaasmatthijs","html_url":"https://github.com/nicolaasmatthijs","followers_url":"https://api.github.com/users/nicolaasmatthijs/followers","following_url":"https://api.github.com/users/nicolaasmatthijs/following{/other_user}","gists_url":"https://api.github.com/users/nicolaasmatthijs/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaasmatthijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaasmatthijs/subscriptions","organizations_url":"https://api.github.com/users/nicolaasmatthijs/orgs","repos_url":"https://api.github.com/users/nicolaasmatthijs/repos","events_url":"https://api.github.com/users/nicolaasmatthijs/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaasmatthijs/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/3967/commits","review_comments_url":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/3967/comments","review_comment_url":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oaeproject/3akai-ux/issues/3967/comments","statuses_url":"https://api.github.com/repos/oaeproject/3akai-ux/statuses/f6e2f3cd6f203d465d32301074d5c4da1039710d","head":{"label":"stuartf:externalFiles","ref":"externalFiles","sha":"f6e2f3cd6f203d465d32301074d5c4da1039710d","user":{"login":"stuartf","id":70221,"avatar_url":"https://avatars.githubusercontent.com/u/70221?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartf","html_url":"https://github.com/stuartf","followers_url":"https://api.github.com/users/stuartf/followers","following_url":"https://api.github.com/users/stuartf/following{/other_user}","gists_url":"https://api.github.com/users/stuartf/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartf/subscriptions","organizations_url":"https://api.github.com/users/stuartf/orgs","repos_url":"https://api.github.com/users/stuartf/repos","events_url":"https://api.github.com/users/stuartf/events{/privacy}","received_events_url":"https://api.github.com/users/stuartf/received_events","type":"User","site_admin":false},"repo":{"id":901494,"name":"3akai-ux","full_name":"stuartf/3akai-ux","owner":{"login":"stuartf","id":70221,"avatar_url":"https://avatars.githubusercontent.com/u/70221?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartf","html_url":"https://github.com/stuartf","followers_url":"https://api.github.com/users/stuartf/followers","following_url":"https://api.github.com/users/stuartf/following{/other_user}","gists_url":"https://api.github.com/users/stuartf/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartf/subscriptions","organizations_url":"https://api.github.com/users/stuartf/orgs","repos_url":"https://api.github.com/users/stuartf/repos","events_url":"https://api.github.com/users/stuartf/events{/privacy}","received_events_url":"https://api.github.com/users/stuartf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stuartf/3akai-ux","description":"Front-end development for OAE","fork":true,"url":"https://api.github.com/repos/stuartf/3akai-ux","forks_url":"https://api.github.com/repos/stuartf/3akai-ux/forks","keys_url":"https://api.github.com/repos/stuartf/3akai-ux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stuartf/3akai-ux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stuartf/3akai-ux/teams","hooks_url":"https://api.github.com/repos/stuartf/3akai-ux/hooks","issue_events_url":"https://api.github.com/repos/stuartf/3akai-ux/issues/events{/number}","events_url":"https://api.github.com/repos/stuartf/3akai-ux/events","assignees_url":"https://api.github.com/repos/stuartf/3akai-ux/assignees{/user}","branches_url":"https://api.github.com/repos/stuartf/3akai-ux/branches{/branch}","tags_url":"https://api.github.com/repos/stuartf/3akai-ux/tags","blobs_url":"https://api.github.com/repos/stuartf/3akai-ux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stuartf/3akai-ux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stuartf/3akai-ux/git/refs{/sha}","trees_url":"https://api.github.com/repos/stuartf/3akai-ux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stuartf/3akai-ux/statuses/{sha}","languages_url":"https://api.github.com/repos/stuartf/3akai-ux/languages","stargazers_url":"https://api.github.com/repos/stuartf/3akai-ux/stargazers","contributors_url":"https://api.github.com/repos/stuartf/3akai-ux/contributors","subscribers_url":"https://api.github.com/repos/stuartf/3akai-ux/subscribers","subscription_url":"https://api.github.com/repos/stuartf/3akai-ux/subscription","commits_url":"https://api.github.com/repos/stuartf/3akai-ux/commits{/sha}","git_commits_url":"https://api.github.com/repos/stuartf/3akai-ux/git/commits{/sha}","comments_url":"https://api.github.com/repos/stuartf/3akai-ux/comments{/number}","issue_comment_url":"https://api.github.com/repos/stuartf/3akai-ux/issues/comments{/number}","contents_url":"https://api.github.com/repos/stuartf/3akai-ux/contents/{+path}","compare_url":"https://api.github.com/repos/stuartf/3akai-ux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stuartf/3akai-ux/merges","archive_url":"https://api.github.com/repos/stuartf/3akai-ux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stuartf/3akai-ux/downloads","issues_url":"https://api.github.com/repos/stuartf/3akai-ux/issues{/number}","pulls_url":"https://api.github.com/repos/stuartf/3akai-ux/pulls{/number}","milestones_url":"https://api.github.com/repos/stuartf/3akai-ux/milestones{/number}","notifications_url":"https://api.github.com/repos/stuartf/3akai-ux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stuartf/3akai-ux/labels{/name}","releases_url":"https://api.github.com/repos/stuartf/3akai-ux/releases{/id}","created_at":"2010-09-10T14:56:55Z","updated_at":"2015-03-03T18:53:03Z","pushed_at":"2015-03-05T21:10:09Z","git_url":"git://github.com/stuartf/3akai-ux.git","ssh_url":"git@github.com:stuartf/3akai-ux.git","clone_url":"https://github.com/stuartf/3akai-ux.git","svn_url":"https://github.com/stuartf/3akai-ux","homepage":"oaeproject.org","size":131008,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"oaeproject:master","ref":"master","sha":"f017399e65d0d4bd900676bd06dba8439e083d5c","user":{"login":"oaeproject","id":4659912,"avatar_url":"https://avatars.githubusercontent.com/u/4659912?v=3","gravatar_id":"","url":"https://api.github.com/users/oaeproject","html_url":"https://github.com/oaeproject","followers_url":"https://api.github.com/users/oaeproject/followers","following_url":"https://api.github.com/users/oaeproject/following{/other_user}","gists_url":"https://api.github.com/users/oaeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/oaeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oaeproject/subscriptions","organizations_url":"https://api.github.com/users/oaeproject/orgs","repos_url":"https://api.github.com/users/oaeproject/repos","events_url":"https://api.github.com/users/oaeproject/events{/privacy}","received_events_url":"https://api.github.com/users/oaeproject/received_events","type":"Organization","site_admin":false},"repo":{"id":761723,"name":"3akai-ux","full_name":"oaeproject/3akai-ux","owner":{"login":"oaeproject","id":4659912,"avatar_url":"https://avatars.githubusercontent.com/u/4659912?v=3","gravatar_id":"","url":"https://api.github.com/users/oaeproject","html_url":"https://github.com/oaeproject","followers_url":"https://api.github.com/users/oaeproject/followers","following_url":"https://api.github.com/users/oaeproject/following{/other_user}","gists_url":"https://api.github.com/users/oaeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/oaeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oaeproject/subscriptions","organizations_url":"https://api.github.com/users/oaeproject/orgs","repos_url":"https://api.github.com/users/oaeproject/repos","events_url":"https://api.github.com/users/oaeproject/events{/privacy}","received_events_url":"https://api.github.com/users/oaeproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oaeproject/3akai-ux","description":"Open Academic Environment (OAE) Front-End","fork":false,"url":"https://api.github.com/repos/oaeproject/3akai-ux","forks_url":"https://api.github.com/repos/oaeproject/3akai-ux/forks","keys_url":"https://api.github.com/repos/oaeproject/3akai-ux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oaeproject/3akai-ux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oaeproject/3akai-ux/teams","hooks_url":"https://api.github.com/repos/oaeproject/3akai-ux/hooks","issue_events_url":"https://api.github.com/repos/oaeproject/3akai-ux/issues/events{/number}","events_url":"https://api.github.com/repos/oaeproject/3akai-ux/events","assignees_url":"https://api.github.com/repos/oaeproject/3akai-ux/assignees{/user}","branches_url":"https://api.github.com/repos/oaeproject/3akai-ux/branches{/branch}","tags_url":"https://api.github.com/repos/oaeproject/3akai-ux/tags","blobs_url":"https://api.github.com/repos/oaeproject/3akai-ux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oaeproject/3akai-ux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oaeproject/3akai-ux/git/refs{/sha}","trees_url":"https://api.github.com/repos/oaeproject/3akai-ux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oaeproject/3akai-ux/statuses/{sha}","languages_url":"https://api.github.com/repos/oaeproject/3akai-ux/languages","stargazers_url":"https://api.github.com/repos/oaeproject/3akai-ux/stargazers","contributors_url":"https://api.github.com/repos/oaeproject/3akai-ux/contributors","subscribers_url":"https://api.github.com/repos/oaeproject/3akai-ux/subscribers","subscription_url":"https://api.github.com/repos/oaeproject/3akai-ux/subscription","commits_url":"https://api.github.com/repos/oaeproject/3akai-ux/commits{/sha}","git_commits_url":"https://api.github.com/repos/oaeproject/3akai-ux/git/commits{/sha}","comments_url":"https://api.github.com/repos/oaeproject/3akai-ux/comments{/number}","issue_comment_url":"https://api.github.com/repos/oaeproject/3akai-ux/issues/comments{/number}","contents_url":"https://api.github.com/repos/oaeproject/3akai-ux/contents/{+path}","compare_url":"https://api.github.com/repos/oaeproject/3akai-ux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oaeproject/3akai-ux/merges","archive_url":"https://api.github.com/repos/oaeproject/3akai-ux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oaeproject/3akai-ux/downloads","issues_url":"https://api.github.com/repos/oaeproject/3akai-ux/issues{/number}","pulls_url":"https://api.github.com/repos/oaeproject/3akai-ux/pulls{/number}","milestones_url":"https://api.github.com/repos/oaeproject/3akai-ux/milestones{/number}","notifications_url":"https://api.github.com/repos/oaeproject/3akai-ux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oaeproject/3akai-ux/labels{/name}","releases_url":"https://api.github.com/repos/oaeproject/3akai-ux/releases{/id}","created_at":"2010-07-07T12:48:50Z","updated_at":"2015-03-05T13:58:01Z","pushed_at":"2015-03-05T13:58:01Z","git_url":"git://github.com/oaeproject/3akai-ux.git","ssh_url":"git@github.com:oaeproject/3akai-ux.git","clone_url":"https://github.com/oaeproject/3akai-ux.git","svn_url":"https://github.com/oaeproject/3akai-ux","homepage":"http://www.oaeproject.org","size":172126,"stargazers_count":128,"watchers_count":128,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":223,"mirror_url":null,"open_issues_count":67,"forks":223,"open_issues":67,"watchers":128,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/3967"},"html":{"href":"https://github.com/oaeproject/3akai-ux/pull/3967"},"issue":{"href":"https://api.github.com/repos/oaeproject/3akai-ux/issues/3967"},"comments":{"href":"https://api.github.com/repos/oaeproject/3akai-ux/issues/3967/comments"},"review_comments":{"href":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/3967/comments"},"review_comment":{"href":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oaeproject/3akai-ux/pulls/3967/commits"},"statuses":{"href":"https://api.github.com/repos/oaeproject/3akai-ux/statuses/f6e2f3cd6f203d465d32301074d5c4da1039710d"}}}}