- 04 Dec, 2015 2 commits
-
-
Sean Hammond authored
-
Sean Hammond authored
-
- 03 Dec, 2015 21 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
-
Sean Hammond authored
Move the DOM event listener function that saves an annotation on Ctrl+Enter into AnnotationController. This is just for the sake of keeping all the code in one place (in AnnotationController, not in the directive's link function) and putting code where it can be tested more easily. Note that the controller's save() function was previously called with scope.$evalAsync() and we're now just calling it synchronously. This seems to be fine.
-
Sean Hammond authored
Remove AnnotationController's vm.preview as it doesn't appear to be used.
-
Sean Hammond authored
Replace AnnotationController's vm.editing boolean with a vm.editing() method. This removes some duplicated state, as both vm.editing and vm.action were recording whether or not the annotation was being edited.
-
Sean Hammond authored
Move scope.share() from the annotation directive to vm.share() 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 does not change after directive linking, there's no reason to $observe() it.
-
- 02 Dec, 2015 17 commits
-
-
Robert Knight authored
Translate annotation.coffee to JavaScript
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Fixes a bug that crept in during the annotation.coffee -> annotation.js translation.
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Declare variables on the same line where they're first defined, instead of at the top of the function.
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-