{"action":"created","issue":{"url":"https://api.github.com/repos/hypothesis/h/issues/2494","labels_url":"https://api.github.com/repos/hypothesis/h/issues/2494/labels{/name}","comments_url":"https://api.github.com/repos/hypothesis/h/issues/2494/comments","events_url":"https://api.github.com/repos/hypothesis/h/issues/2494/events","html_url":"https://github.com/hypothesis/h/pull/2494","id":106129272,"number":2494,"title":"Split host / sidebar and clean up plugin loading","user":{"login":"tilgovi","id":20818,"avatar_url":"https://avatars.githubusercontent.com/u/20818?v=3","gravatar_id":"","url":"https://api.github.com/users/tilgovi","html_url":"https://github.com/tilgovi","followers_url":"https://api.github.com/users/tilgovi/followers","following_url":"https://api.github.com/users/tilgovi/following{/other_user}","gists_url":"https://api.github.com/users/tilgovi/gists{/gist_id}","starred_url":"https://api.github.com/users/tilgovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilgovi/subscriptions","organizations_url":"https://api.github.com/users/tilgovi/orgs","repos_url":"https://api.github.com/users/tilgovi/repos","events_url":"https://api.github.com/users/tilgovi/events{/privacy}","received_events_url":"https://api.github.com/users/tilgovi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-09-12T04:35:37Z","updated_at":"2015-10-07T21:50:27Z","closed_at":"2015-09-15T17:31:04Z","pull_request":{"url":"https://api.github.com/repos/hypothesis/h/pulls/2494","html_url":"https://github.com/hypothesis/h/pull/2494","diff_url":"https://github.com/hypothesis/h/pull/2494.diff","patch_url":"https://github.com/hypothesis/h/pull/2494.patch"},"body":"Clean up the way we decide how to load and configure the application and provide more example application classes.\r\n\r\nIn other words, sub-classing instead of piling on options for things.\r\n\r\nFrom the documentation change:\r\n\r\n```rst\r\n``Annotator.Guest`` expects to connect to an annotator widget running in a\r\ndifferent frame. Any number of instances can communicate with a single widget\r\nin order to provide annotation of many frames.\r\n\r\n``Annotator.Host`` is an extended version of ``Annotator.Guest`` that will\r\ninstantiate an annotator widget by loading the location given by the ``app``\r\noption in an iframe and appending it to the document.\r\n\r\n``Annotator.Sidebar`` is an extended ``Annotator.Host`` that puts the widget\r\nin a sidebar interface. It loads additional plugins that show a bar of bucket\r\nindicators, each providing the ability to select a cluster of highlights, and a\r\ntoolbar that can be used to resize the widget and control other aspects of the\r\nuser interface.\r\n\r\n``Annotator.PdfSidebar`` is a custom version of ``Annotator.Sidebar`` with\r\ndefaults tailored for use in a PDF.js viewer.\r\n```\r\n\r\nThis is proposed as an alternative to #2490.\r\n\r\nBy using `Annotator.Host` instead of `Annotator.Sidebar` it is trivial to load a version of the application that creates the annotator widget but doesn't load the toolbar or bucket bar and doesn't open or close. This leaves the integrator to control hiding, showing or resizing the widget and providing the controls normally on the toolbar."},"comment":{"url":"https://api.github.com/repos/hypothesis/h/issues/comments/146343242","html_url":"https://github.com/hypothesis/h/pull/2494#issuecomment-146343242","issue_url":"https://api.github.com/repos/hypothesis/h/issues/2494","id":146343242,"user":{"login":"tilgovi","id":20818,"avatar_url":"https://avatars.githubusercontent.com/u/20818?v=3","gravatar_id":"","url":"https://api.github.com/users/tilgovi","html_url":"https://github.com/tilgovi","followers_url":"https://api.github.com/users/tilgovi/followers","following_url":"https://api.github.com/users/tilgovi/following{/other_user}","gists_url":"https://api.github.com/users/tilgovi/gists{/gist_id}","starred_url":"https://api.github.com/users/tilgovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilgovi/subscriptions","organizations_url":"https://api.github.com/users/tilgovi/orgs","repos_url":"https://api.github.com/users/tilgovi/repos","events_url":"https://api.github.com/users/tilgovi/events{/privacy}","received_events_url":"https://api.github.com/users/tilgovi/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T21:50:27Z","updated_at":"2015-10-07T21:50:27Z","body":"If you need to subclass, the constructor should be globally available during the configuration callback. It's not the cleanest thing in the world but it does work.\r\n\r\nTo improve this, we could have annotator/main.js export the `Annotator` symbol and move the actual bootstrapping into embed.js."}}