{"action":"created","comment":{"url":"https://api.github.com/repos/diamm/diamm/pulls/comments/66641415","id":66641415,"diff_hunk":"@@ -0,0 +1,292 @@\n+/*\n+ * Retrieves iiif data from structures block\n+ */\n+window.divaPlugins.push((function ()\n+{\n+    var structures = [];\n+    var items = [];\n+\n+    // Adapted from Underscore.js\n+    // Returns a function that will only be trigerred 'wait' milliseconds\n+    // after the last time it was called.\n+    function debounce (func, wait)\n+    {\n+        var timeout;\n+        return function()\n+        {\n+            var context = this, args = arguments;\n+            var later = function()\n+            {\n+                timeout = null;\n+                func.apply(context, args);\n+            };\n+            clearTimeout(timeout);\n+            timeout = setTimeout(later, wait);\n+        };\n+    }\n+\n+    var itemsDiv = document.getElementById(\"image-item-listing\");\n+    function addVoiceVisibilityToggle (element)\n+    {\n+        var button = element.parentElement.firstChild; \n+        element.style.display = 'none';\n+\n+        var toggleVisibility = function ()\n+        {\n+            if (element.style.display === 'block')\n+            {\n+                button.lastChild.remove();\n+                i = document.createElement(\"i\");\n+                i.setAttribute(\"class\", \"fa fa-caret-down\");\n+                button.appendChild(i);\n+                element.style.display = 'none';\n+            }\n+            else\n+            {\n+                button.lastChild.remove();\n+                i = document.createElement(\"i\");\n+                i.setAttribute(\"class\", \"fa fa-caret-up\");\n+                button.appendChild(i);\n+                element.style.display = 'block';\n+            }\n+        };\n+        button.onclick = toggleVisibility;\n+        button.style.cursor = 'pointer';\n+    }\n+\n+    var populateStructures = function (manifest)\n+    {\n+        function getCompositionAnchor (composition)\n+        {\n+            var t, a;\n+            a = document.createElement(\"a\");\n+            t = document.createTextNode(composition.title);\n+            a.setAttribute('href', composition['@id']);\n+            a.appendChild(t);\n+\n+            return a;\n+        }\n+\n+        function getComposersPara (composers)\n+        {\n+            var p, t, a;\n+            p = document.createElement(\"p\");\n+            t = document.createTextNode(\"Composer: \");\n+            strong = document.createElement(\"strong\");\n+            strong.appendChild(t);\n+            p.appendChild(strong);\n+            for (var i = 0, clen = composers.length; i < clen; i++)\n+            {\n+                if (composers[i]['@id'])\n+                {\n+                    a = document.createElement(\"a\");\n+                    t = document.createTextNode(composers[i].name + \" \");\n+                    a.setAttribute('href', composers[i]['@id']);\n+                    a.appendChild(t);\n+                    p.appendChild(a);\n+                }\n+                else\n+                {\n+                    t = document.createTextNode(composers[i].name + \" \");\n+                    p.appendChild(t);\n+                }\n+\n+                if (composers[i].uncertain)\n+                {\n+                    t = document.createTextNode(\"? \");\n+                    p.appendChild(t);\n+                }\n+            }\n+\n+            return p;\n+        }\n+\n+        function getVoicesPara (voices)\n+        {\n+            var p, t, i;\n+            p = document.createElement(\"p\");\n+            strong = document.createElement(\"strong\");\n+            t = document.createTextNode(\"Voices \");\n+            strong.appendChild(t);\n+            i = document.createElement(\"i\");\n+            i.setAttribute(\"class\", \"fa fa-caret-down\");\n+            strong.appendChild(i);\n+            p.appendChild(strong);\n+\n+            for (i = 0, vlen = voices.length; i < vlen; i++)\n+            {\n+                p2 = document.createElement(\"p\");\n+                p2.style.textIndent = '-1em';","path":"diamm/static/javascripts/lib/iiif-structure.js","position":119,"original_position":119,"commit_id":"94e4cd2794f1957e81685a736ff7f1ef39910291","original_commit_id":"94e4cd2794f1957e81685a736ff7f1ef39910291","user":{"login":"ahankinson","id":163183,"avatar_url":"https://avatars.githubusercontent.com/u/163183?v=3","gravatar_id":"","url":"https://api.github.com/users/ahankinson","html_url":"https://github.com/ahankinson","followers_url":"https://api.github.com/users/ahankinson/followers","following_url":"https://api.github.com/users/ahankinson/following{/other_user}","gists_url":"https://api.github.com/users/ahankinson/gists{/gist_id}","starred_url":"https://api.github.com/users/ahankinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahankinson/subscriptions","organizations_url":"https://api.github.com/users/ahankinson/orgs","repos_url":"https://api.github.com/users/ahankinson/repos","events_url":"https://api.github.com/users/ahankinson/events{/privacy}","received_events_url":"https://api.github.com/users/ahankinson/received_events","type":"User","site_admin":false},"body":"This should probably be set in a stylesheet. ","created_at":"2016-06-10T16:21:13Z","updated_at":"2016-06-10T16:21:13Z","html_url":"https://github.com/diamm/diamm/pull/78#discussion_r66641415","pull_request_url":"https://api.github.com/repos/diamm/diamm/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/diamm/diamm/pulls/comments/66641415"},"html":{"href":"https://github.com/diamm/diamm/pull/78#discussion_r66641415"},"pull_request":{"href":"https://api.github.com/repos/diamm/diamm/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/diamm/diamm/pulls/78","id":73377036,"html_url":"https://github.com/diamm/diamm/pull/78","diff_url":"https://github.com/diamm/diamm/pull/78.diff","patch_url":"https://github.com/diamm/diamm/pull/78.patch","issue_url":"https://api.github.com/repos/diamm/diamm/issues/78","number":78,"state":"open","locked":false,"title":"Feat/diva structure plugin","user":{"login":"belljustin","id":8331769,"avatar_url":"https://avatars.githubusercontent.com/u/8331769?v=3","gravatar_id":"","url":"https://api.github.com/users/belljustin","html_url":"https://github.com/belljustin","followers_url":"https://api.github.com/users/belljustin/followers","following_url":"https://api.github.com/users/belljustin/following{/other_user}","gists_url":"https://api.github.com/users/belljustin/gists{/gist_id}","starred_url":"https://api.github.com/users/belljustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/belljustin/subscriptions","organizations_url":"https://api.github.com/users/belljustin/orgs","repos_url":"https://api.github.com/users/belljustin/repos","events_url":"https://api.github.com/users/belljustin/events{/privacy}","received_events_url":"https://api.github.com/users/belljustin/received_events","type":"User","site_admin":false},"body":"Refs #47 \r\n\r\nAdds a diva plugin that display information about the current items displayed in the diva viewer. This information includes:\r\n- current folio\r\n- compositions (with links)\r\n- folio range of the compositions\r\n- composer(s) (with links)\r\n- voices\r\n - incipit\r\n - type\r\n - language\r\n\r\nThe voices details are hidden until clicked. The item details div has the same height as the diva viewer and the overflow is scrollable.\r\n![screen shot 2016-06-10 at 9 51 55 am](https://cloud.githubusercontent.com/assets/8331769/15966452/306aa47c-2ef1-11e6-876e-074cb64bdf1b.png)\r\n\r\n","created_at":"2016-06-10T13:53:39Z","updated_at":"2016-06-10T16:21:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4987d9847b1be823d9ca5a90ec29883430694050","assignee":{"login":"ahankinson","id":163183,"avatar_url":"https://avatars.githubusercontent.com/u/163183?v=3","gravatar_id":"","url":"https://api.github.com/users/ahankinson","html_url":"https://github.com/ahankinson","followers_url":"https://api.github.com/users/ahankinson/followers","following_url":"https://api.github.com/users/ahankinson/following{/other_user}","gists_url":"https://api.github.com/users/ahankinson/gists{/gist_id}","starred_url":"https://api.github.com/users/ahankinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahankinson/subscriptions","organizations_url":"https://api.github.com/users/ahankinson/orgs","repos_url":"https://api.github.com/users/ahankinson/repos","events_url":"https://api.github.com/users/ahankinson/events{/privacy}","received_events_url":"https://api.github.com/users/ahankinson/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/diamm/diamm/milestones/1","html_url":"https://github.com/diamm/diamm/milestones/First%20Public%20Beta","labels_url":"https://api.github.com/repos/diamm/diamm/milestones/1/labels","id":1760412,"number":1,"title":"First Public Beta","description":"","creator":{"login":"ahankinson","id":163183,"avatar_url":"https://avatars.githubusercontent.com/u/163183?v=3","gravatar_id":"","url":"https://api.github.com/users/ahankinson","html_url":"https://github.com/ahankinson","followers_url":"https://api.github.com/users/ahankinson/followers","following_url":"https://api.github.com/users/ahankinson/following{/other_user}","gists_url":"https://api.github.com/users/ahankinson/gists{/gist_id}","starred_url":"https://api.github.com/users/ahankinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahankinson/subscriptions","organizations_url":"https://api.github.com/users/ahankinson/orgs","repos_url":"https://api.github.com/users/ahankinson/repos","events_url":"https://api.github.com/users/ahankinson/events{/privacy}","received_events_url":"https://api.github.com/users/ahankinson/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":32,"state":"open","created_at":"2016-05-11T15:43:34Z","updated_at":"2016-06-10T13:53:39Z","due_on":"2016-06-21T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/diamm/diamm/pulls/78/commits","review_comments_url":"https://api.github.com/repos/diamm/diamm/pulls/78/comments","review_comment_url":"https://api.github.com/repos/diamm/diamm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diamm/diamm/issues/78/comments","statuses_url":"https://api.github.com/repos/diamm/diamm/statuses/94e4cd2794f1957e81685a736ff7f1ef39910291","head":{"label":"diamm:feat/diva-structure-plugin","ref":"feat/diva-structure-plugin","sha":"94e4cd2794f1957e81685a736ff7f1ef39910291","user":{"login":"diamm","id":13665408,"avatar_url":"https://avatars.githubusercontent.com/u/13665408?v=3","gravatar_id":"","url":"https://api.github.com/users/diamm","html_url":"https://github.com/diamm","followers_url":"https://api.github.com/users/diamm/followers","following_url":"https://api.github.com/users/diamm/following{/other_user}","gists_url":"https://api.github.com/users/diamm/gists{/gist_id}","starred_url":"https://api.github.com/users/diamm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diamm/subscriptions","organizations_url":"https://api.github.com/users/diamm/orgs","repos_url":"https://api.github.com/users/diamm/repos","events_url":"https://api.github.com/users/diamm/events{/privacy}","received_events_url":"https://api.github.com/users/diamm/received_events","type":"Organization","site_admin":false},"repo":{"id":47477176,"name":"diamm","full_name":"diamm/diamm","owner":{"login":"diamm","id":13665408,"avatar_url":"https://avatars.githubusercontent.com/u/13665408?v=3","gravatar_id":"","url":"https://api.github.com/users/diamm","html_url":"https://github.com/diamm","followers_url":"https://api.github.com/users/diamm/followers","following_url":"https://api.github.com/users/diamm/following{/other_user}","gists_url":"https://api.github.com/users/diamm/gists{/gist_id}","starred_url":"https://api.github.com/users/diamm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diamm/subscriptions","organizations_url":"https://api.github.com/users/diamm/orgs","repos_url":"https://api.github.com/users/diamm/repos","events_url":"https://api.github.com/users/diamm/events{/privacy}","received_events_url":"https://api.github.com/users/diamm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diamm/diamm","description":"The DIAMM Website","fork":false,"url":"https://api.github.com/repos/diamm/diamm","forks_url":"https://api.github.com/repos/diamm/diamm/forks","keys_url":"https://api.github.com/repos/diamm/diamm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diamm/diamm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diamm/diamm/teams","hooks_url":"https://api.github.com/repos/diamm/diamm/hooks","issue_events_url":"https://api.github.com/repos/diamm/diamm/issues/events{/number}","events_url":"https://api.github.com/repos/diamm/diamm/events","assignees_url":"https://api.github.com/repos/diamm/diamm/assignees{/user}","branches_url":"https://api.github.com/repos/diamm/diamm/branches{/branch}","tags_url":"https://api.github.com/repos/diamm/diamm/tags","blobs_url":"https://api.github.com/repos/diamm/diamm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diamm/diamm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diamm/diamm/git/refs{/sha}","trees_url":"https://api.github.com/repos/diamm/diamm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diamm/diamm/statuses/{sha}","languages_url":"https://api.github.com/repos/diamm/diamm/languages","stargazers_url":"https://api.github.com/repos/diamm/diamm/stargazers","contributors_url":"https://api.github.com/repos/diamm/diamm/contributors","subscribers_url":"https://api.github.com/repos/diamm/diamm/subscribers","subscription_url":"https://api.github.com/repos/diamm/diamm/subscription","commits_url":"https://api.github.com/repos/diamm/diamm/commits{/sha}","git_commits_url":"https://api.github.com/repos/diamm/diamm/git/commits{/sha}","comments_url":"https://api.github.com/repos/diamm/diamm/comments{/number}","issue_comment_url":"https://api.github.com/repos/diamm/diamm/issues/comments{/number}","contents_url":"https://api.github.com/repos/diamm/diamm/contents/{+path}","compare_url":"https://api.github.com/repos/diamm/diamm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diamm/diamm/merges","archive_url":"https://api.github.com/repos/diamm/diamm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diamm/diamm/downloads","issues_url":"https://api.github.com/repos/diamm/diamm/issues{/number}","pulls_url":"https://api.github.com/repos/diamm/diamm/pulls{/number}","milestones_url":"https://api.github.com/repos/diamm/diamm/milestones{/number}","notifications_url":"https://api.github.com/repos/diamm/diamm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diamm/diamm/labels{/name}","releases_url":"https://api.github.com/repos/diamm/diamm/releases{/id}","deployments_url":"https://api.github.com/repos/diamm/diamm/deployments","created_at":"2015-12-05T23:51:13Z","updated_at":"2016-04-29T18:18:38Z","pushed_at":"2016-06-10T13:53:39Z","git_url":"git://github.com/diamm/diamm.git","ssh_url":"git@github.com:diamm/diamm.git","clone_url":"https://github.com/diamm/diamm.git","svn_url":"https://github.com/diamm/diamm","homepage":null,"size":91846,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":29,"forks":0,"open_issues":29,"watchers":1,"default_branch":"master"}},"base":{"label":"diamm:master","ref":"master","sha":"94f45be26a4eae672e7ae717b9748729e8ca3858","user":{"login":"diamm","id":13665408,"avatar_url":"https://avatars.githubusercontent.com/u/13665408?v=3","gravatar_id":"","url":"https://api.github.com/users/diamm","html_url":"https://github.com/diamm","followers_url":"https://api.github.com/users/diamm/followers","following_url":"https://api.github.com/users/diamm/following{/other_user}","gists_url":"https://api.github.com/users/diamm/gists{/gist_id}","starred_url":"https://api.github.com/users/diamm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diamm/subscriptions","organizations_url":"https://api.github.com/users/diamm/orgs","repos_url":"https://api.github.com/users/diamm/repos","events_url":"https://api.github.com/users/diamm/events{/privacy}","received_events_url":"https://api.github.com/users/diamm/received_events","type":"Organization","site_admin":false},"repo":{"id":47477176,"name":"diamm","full_name":"diamm/diamm","owner":{"login":"diamm","id":13665408,"avatar_url":"https://avatars.githubusercontent.com/u/13665408?v=3","gravatar_id":"","url":"https://api.github.com/users/diamm","html_url":"https://github.com/diamm","followers_url":"https://api.github.com/users/diamm/followers","following_url":"https://api.github.com/users/diamm/following{/other_user}","gists_url":"https://api.github.com/users/diamm/gists{/gist_id}","starred_url":"https://api.github.com/users/diamm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diamm/subscriptions","organizations_url":"https://api.github.com/users/diamm/orgs","repos_url":"https://api.github.com/users/diamm/repos","events_url":"https://api.github.com/users/diamm/events{/privacy}","received_events_url":"https://api.github.com/users/diamm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diamm/diamm","description":"The DIAMM Website","fork":false,"url":"https://api.github.com/repos/diamm/diamm","forks_url":"https://api.github.com/repos/diamm/diamm/forks","keys_url":"https://api.github.com/repos/diamm/diamm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diamm/diamm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diamm/diamm/teams","hooks_url":"https://api.github.com/repos/diamm/diamm/hooks","issue_events_url":"https://api.github.com/repos/diamm/diamm/issues/events{/number}","events_url":"https://api.github.com/repos/diamm/diamm/events","assignees_url":"https://api.github.com/repos/diamm/diamm/assignees{/user}","branches_url":"https://api.github.com/repos/diamm/diamm/branches{/branch}","tags_url":"https://api.github.com/repos/diamm/diamm/tags","blobs_url":"https://api.github.com/repos/diamm/diamm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diamm/diamm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diamm/diamm/git/refs{/sha}","trees_url":"https://api.github.com/repos/diamm/diamm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diamm/diamm/statuses/{sha}","languages_url":"https://api.github.com/repos/diamm/diamm/languages","stargazers_url":"https://api.github.com/repos/diamm/diamm/stargazers","contributors_url":"https://api.github.com/repos/diamm/diamm/contributors","subscribers_url":"https://api.github.com/repos/diamm/diamm/subscribers","subscription_url":"https://api.github.com/repos/diamm/diamm/subscription","commits_url":"https://api.github.com/repos/diamm/diamm/commits{/sha}","git_commits_url":"https://api.github.com/repos/diamm/diamm/git/commits{/sha}","comments_url":"https://api.github.com/repos/diamm/diamm/comments{/number}","issue_comment_url":"https://api.github.com/repos/diamm/diamm/issues/comments{/number}","contents_url":"https://api.github.com/repos/diamm/diamm/contents/{+path}","compare_url":"https://api.github.com/repos/diamm/diamm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diamm/diamm/merges","archive_url":"https://api.github.com/repos/diamm/diamm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diamm/diamm/downloads","issues_url":"https://api.github.com/repos/diamm/diamm/issues{/number}","pulls_url":"https://api.github.com/repos/diamm/diamm/pulls{/number}","milestones_url":"https://api.github.com/repos/diamm/diamm/milestones{/number}","notifications_url":"https://api.github.com/repos/diamm/diamm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diamm/diamm/labels{/name}","releases_url":"https://api.github.com/repos/diamm/diamm/releases{/id}","deployments_url":"https://api.github.com/repos/diamm/diamm/deployments","created_at":"2015-12-05T23:51:13Z","updated_at":"2016-04-29T18:18:38Z","pushed_at":"2016-06-10T13:53:39Z","git_url":"git://github.com/diamm/diamm.git","ssh_url":"git@github.com:diamm/diamm.git","clone_url":"https://github.com/diamm/diamm.git","svn_url":"https://github.com/diamm/diamm","homepage":null,"size":91846,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":29,"forks":0,"open_issues":29,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/diamm/diamm/pulls/78"},"html":{"href":"https://github.com/diamm/diamm/pull/78"},"issue":{"href":"https://api.github.com/repos/diamm/diamm/issues/78"},"comments":{"href":"https://api.github.com/repos/diamm/diamm/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/diamm/diamm/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/diamm/diamm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diamm/diamm/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/diamm/diamm/statuses/94e4cd2794f1957e81685a736ff7f1ef39910291"}}}}
{"actor":{"display_login":"ahankinson"}}