Permalink
Browse files

start to break apart the Hypothesis controller

- Break Hypothesis down into App and Viewer controllers (Auth
was factored out earlier)
- Break the XDM pieces and the bulk of what used to be the
main subclass of Annotator into a service, since the annotator
services, inside the iframe, is only every a singleton anyway.
This distinguishes the service from the highlight providers a bit.
Eventually, multiple "annotators" on the host page could
communicate with the same service (in the iframe) or, in the case
of a browser extension, the service can be in the background page
app context.
- Use the $location provider for routes and hook it up to the viewer
so that detail is triggered by a route parameter. This will let our
back functionality be implemented by browser history and could
prove useful as well as sensible.
  • Loading branch information...
1 parent cd5a64f commit 369f5b4891b93b9da01024bb0feefc9808b511ff @tilgovi committed Dec 6, 2012
Showing with 542 additions and 689 deletions.
  1. +18 −7 h/js/app.coffee
  2. +88 −674 h/js/controllers.coffee
  3. +1 −1 h/js/inject/host.coffee
  4. +431 −0 h/js/services.coffee
  5. +4 −7 h/templates/app.pt
View
@@ -1,8 +1,19 @@
-angular.module 'h', [
- 'bootstrap'
- 'deform'
- 'h.controllers'
- 'h.directives'
- 'h.filters'
- 'h.services'
+imports = [
+ 'bootstrap'
+ 'deform'
+ 'h.controllers'
+ 'h.directives'
+ 'h.filters'
+ 'h.services'
]
+
+
+configure = ($routeProvider, $locationProvider) ->
+ $routeProvider.when '/app/viewer',
+ controller: 'Viewer'
+ reloadOnSearch: false
+ templateUrl: 'viewer.html'
+configure.$inject = ['$routeProvider', '$locationProvider']
+
+
+angular.module('h', imports, configure)
Oops, something went wrong.

0 comments on commit 369f5b4

Please sign in to comment.