- 07 Dec, 2015 13 commits
-
-
Nick Stenning authored
This adds a basic robots.txt which prevents indexing of pages under `/groups`.
-
Nick Stenning authored
2728 misc annotation controller refactors part 2
-
Sean Hammond authored
This one needs to be of the `var` form because it gets redefined later.
-
Sean Hammond authored
Better for each property to have its own docstring where it's defined, than to try and keep them in sync.
-
Sean Hammond authored
This function isn't part of the view model, it's never called by the templates, only by code in annotation.js itself.
-
Sean Hammond authored
-
Sean Hammond authored
Move the public method vm.render() out of AnnotationController, making it a private function and renaming it to updateViewModel(). This function is not part of the view model (it's never called by the templates, only by code in annotation.js and tests) and its tests don't need to be part of the annotation controller/directive tests. Move it out. All the function does is copy some fields from the domain model to the view model, the opposite of what the updateDomainModel() function does, so rename it to updateViewModel() and put it next to updateDomainModel(), clarifying its role.
-
Sean Hammond authored
Private functions first, then public methods, and each section in alphabetical order. This also means that all `on*()` event listener functions are together (except for vm.onKeydown()). Also always use the `function foo() {}` form instead of mixing it with `var foo = function() {}`.
-
Sean Hammond authored
-
Sean Hammond authored
Public properties first, then private ones, then event listeners and watchers, then initialization logic, and each group in alphabetical order. Also added/improved some docstrings.
-
Sean Hammond authored
It isn't necessary.
-
Sean Hammond authored
Collect all AnnotationController init code together in an init() function. Previously it was spread around at the top, middle and bottom of the AnnotationController() function, some of it even hiding between method definitions. Now it's all in one place.
-
Nick Stenning authored
Remove USER_CHANGED event from AnnotationController
-
- 04 Dec, 2015 11 commits
-
-
Nick Stenning authored
Add groups report to admin dashboard
-
Sean Hammond authored
When the user logs out or logs in we throw away all the AnnotationController instances and create new ones. So everything it needs to do "when the user logs in" (or out) AnnotationController can do on Initialization, it doesn't need the event.
-
Robert Knight authored
Refactor saving highlights in AnnotationController
-
Sean Hammond authored
-
Sean Hammond authored
Remove the global variable `annotation` from annotation-test.js. This paves the way for having different helper functions for creating different kinds of annotation and passing them in to the directive initialization. Some describe()s still use their own global annotation objects, these should be factored out as well.
-
Sean Hammond authored
Simply having no content does not make an annotation a highlight (it also has to not be a page note or reply).
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Clarify the logic a little.
-
Sean Hammond authored
-
Sean Hammond authored
-
- 03 Dec, 2015 16 commits
-
-
Sean Hammond authored
-
Sean Hammond authored
* Rename local variable `highlight` to `newlyCreatedByHighlightButton` and add a docstring - clarify what this piece of state actually means. * Fix `vm.isHighlight()`: It now returns `false` for new annotations that the user hasn't entered any text or tags for yet (instead of `true`). * Move the code for saving new highlights to the server into a `saveNewHighlight()` function that's called on AnnotationController instantiation instead of having it in a `$watch()` function that's called every time the local variable `model` changes. Also use the presence of `model.id` to avoid re-saving highlights that have already been saved - instead of abusing the `highlight` (now `newlyCreatedByHighlightButton`) variable and confusing what it represents. * Don't automatically open the annotation editor on Annotationcontroller instantiation if the annotation is a highlight. This fixes this bug: 1. Create a new highlight while logged out 2. Log in 3. Your highlight is saved to the server, but also the annotation editor is open on your highlight. The intention is that highlights are simply saved to the server, not opened for editing. _Annotations_ created while logged out, on the other hand, are _not_ saved to the server on login but _are_ opened for editing on login.
-
Robert Knight authored
Refactor annotation controller tests
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Remove gloval `controller` variable from AnnotationController tests.
-
Sean Hammond authored
Move the tests for annotation.js's top-level function out of the 'AnnotationController' describe() - these functions aren't part of AnnotationController and their tests don't need all the setup in this describe().
-
Sean Hammond authored
Wrap the annotation directive tests in a new top-level describe that's for the entire file annotation.js, not just AnnotationController or the annotation directive.
-
Robert Knight authored
Refactor annotation controller, part 1
-
Sean Hammond authored
Move scope.feature() from the annotation directive to vm.feature() in the AnnotationController. Just trying to move as much as possible out of the directive's scope and link function into the controller, if we're gonna use a directive controller here try to just use it instead of randomly using the link function and scope for some things and the controller for others.
-
Sean Hammond authored
It doesn't appear to be possible for model to be null.
-
Sean Hammond authored
-