- 14 Apr, 2016 1 commit
-
-
Nick Stenning authored
Markdown editor input refactor and additional tests
-
- 13 Apr, 2016 6 commits
-
-
Robert Knight authored
The editor is only used from the <annotation> component which never sets this input.
-
Robert Knight authored
This simplifies the implementation of the <markdown> component slightly, and makes its inputs more consistent with other recently written components. - Replace use of 'ngModel' with 'text' input property and 'onEditText' output event. - Add tests for preview state. - Add tests for rendering and editing annotations that have no text. - Optimize editor initialization by not creating the toolbar's DOM elements until the user starts editing the annotation, via using ng-if rather than ng-show to hide the toolbar in view mode.
-
Robert Knight authored
Displaying local file names in the Groups document list
-
Nick Stenning authored
Add deleting of annotations from new search index
-
Sean Hammond authored
Convert h.features to package
-
Christof Dorner authored
Add the skeleton of a functional test suite
-
- 12 Apr, 2016 5 commits
-
-
Sean Hammond authored
Remove routes_mapper fixture and use configurator routes
-
chdorner authored
-
Nick Stenning authored
Re-implement collapsible excerpt overflow state checking
-
Robert Knight authored
In addition to the content changing, the window resizing and media loading, another way that the excerpt's overflow state can change is if it or a parent element's visibility changes. Since there isn't a generic, performant way to watch the visibility of DOM elements, the change here adds a scope watch which tests for the presence of the 'ng-hide' class used by the ng-show and ng-hide directives on parent elements, since that is the only method of changing visibility that we actually need to support at the moment.
-
Robert Knight authored
Excerpts update their overflow state outside of the Angular $digest cycle. The usual way to deal with this is to wrap the update in a $scope.$apply() call. However, this triggers a full $digest cycle, which we want to avoid if many excerpts update their state at the same time - eg. if we have a large number of annotation cards. This commit instead explicitly invokes the $digest _only_ in the affected annotation card and then only if the collapsible state of an annotation body actually changed.
-
- 11 Apr, 2016 3 commits
-
-
Robert Knight authored
This makes it possible to write isolated tests for just the overflow state and content style recalculation aspects of <excerpt> components. It also simplifies the <excerpt> component tests by making it easier to reason about when the excerpt's overflow state will have been recalculated and the directive's state updated accordingly.
-
Robert Knight authored
rAF is not available in PhantomJS 1.x but is supported by all of our target browsers (IE >= 10).
-
Robert Knight authored
Previously the overflowing state of the excerpt was computed implicitly by the overflowing() method, which was called from several other controller functions. There were several problems with this approach: 1. Since this method calls Element.scrollHeight, it triggered an expensive synchronous layout flush. 2. In certain situations, this could trigger a loop where the overflowing flag was continually flipped (see #2960) 3 It was unpredictable when the overflowing state would be recomputed. This commit instead opts for a different approach which is more explicit about when the state is recomputed, based on the assumption that the <excerpt>'s content size is a function of: 1. The inputs to the <excerpt>'s content (eg. the text of a quote, the body of an annotation) 2. The sidebar window's size 3. The dimensions of any embedded media The content size is then computed and updated as follows: 1. When the <excerpt> is initially created, an async computation of the scrollHeight is scheduled. The calculation unfortunately needs to be async because the content may contain Angular directives which take several $digest cycles to fully process. 2. The <excerpt> listens for changes to the content's data (via a 'contentData' property), media 'load' events and window 'resize' events and recomputes the overflow state in response to any of these. There are a couple of other fixes here: - Use an optional boolean property for the 'enabled' input, rather than a function. The app passed a function to this property but the tests passed a boolean. Fixes #2960
-
- 08 Apr, 2016 3 commits
-
-
Robert Knight authored
Replace node page router
-
chdorner authored
-
chdorner authored
We don't need all the client-side routing part, we only need to be able to selectively run certain JavaScript code depending on which site the user is at the moment. This implementation is not as advanced as the one from the `page` package, or what is possible with the `url-pattern` package. But we don't need any fancy URL matching at the moment, once we do we can revisit and maybe introduce something like `url-pattern` instead of just a crude `document.location.pathname === path`.
-
- 06 Apr, 2016 9 commits
-
-
Robert Knight authored
Add tests for authentication policy
-
Nick Stenning authored
Scroll to annotation when clicking at bottom of collapsed quote
-
Nick Stenning authored
Fix 'Location' sort order for annotations
-
Nick Stenning authored
Use require() for templates
-
Robert Knight authored
For consistency with how other transforms are specified, specify the stringify transform in package.json instead of in code in the create-bundle.js script and the Karma config.
-
Robert Knight authored
Since components now require() their own templates, it is no longer necessary to use a preprocessor to load them.
-
Robert Knight authored
Include Angular component templates as strings in the app bundle using the stringify Browserify transform and use them from directives using 'template' instead of 'templateUrl'. This is faster, because it avoids going through the async $http machinery to load templates, but it is also synchronous, which generally means fewer surprises due to async template loading and specifically in the context of the <excerpt> directive will be useful as it will make it possible for the <excerpt> directive to measure the height of its content in the link function, because all components inside the exercept's content will have been fully resolved at that point.
-
Robert Knight authored
Collapsed quotes can be expanded either explicitly by clicking the 'More' link on the quote or 'implicitly' by clicking anywhere at the bottom of the quote. In that case, the clicked annotation should be scrolled into view. This commit separates the behavior when clicking on the toggle link vs clicking at the bottom of the card. In the template, the bottom area has been moved before the inline controls so that the inline controls are above the bottom area and receive click events first.
-
Robert Knight authored
1398661 extracted the code for getting a location from an annotation into a separate module. However that function expects an Annotation but the sort predicate function was being passed a Thread. Consequently the predicate function was returning Number.POSITIVE_INFINITY for every thread and so sort ordering fell back to the default 'tie-breaker' comparator - which is the original index of the element in the list being sorted. Fixes #3106
-
- 05 Apr, 2016 4 commits
-
-
Christof Dorner authored
Postgres Write 2/4: Model code for creating new annotations in Postgres
-
Nick Stenning authored
Live reload development tool for Hypothesis client
-
Robert Knight authored
If multiple asset bundles are regenerated in quick succession, including JS or template files, the client might try to reload whilst some of the bundles are still being regenerated, resulting in the client failing to load. This commit reduces the likelihood of this happening by debouncing live-reload notifications and makes a note of the issue.
-
Robert Knight authored
This implements support and a test environment in which the Hypothesis client can live reload when scripts, styles etc. are changed. Live reloading when scripts change currently requires support from the hosting page. There are two parts to this: - A server which serves test pages with the Hypothesis client embedded and notifies it when front-end assets (styles, scripts) are changed. Test pages are served at http://localhost:3000/<any path> by default. - A small client script which connects to the server and listens for notifications of asset changes. When styles change it will reload styles for the page. When scripts or Angular templates change it will send a request to the top-level page to reload. This enables reloading to work when changing both the sidebar app and Annotator code but also avoids the need to manually unload the existing Annotator instance before reloading.
-
- 04 Apr, 2016 2 commits
-
-
Robert Knight authored
CSP violation: admin confirm users delete
-
chdorner authored
Which fixes a CSP violation, but it was also always the preferred solution. This wasn't done in the first place as we didn't have any JS bundle set up for admin, that exists now, so it's time to move the confirmation dialog triggering into the proper place.
-
- 01 Apr, 2016 7 commits
-
-
Nick Stenning authored
Rename postgres_read feature flag to postgres
-
chdorner authored
In order to be able to execute specific JS code on certain admin pages.
-
chdorner authored
So we get reports about JS errors in the admin bundle. This is particularily important since we introduced a bug in the past that didn't confirm the users delete form which could have led to deleting users and all their data without a confirmation dialog.
-
Nick Stenning authored
Make client injection robust to pages that replace the URL fragment as they load
-
Nick Stenning authored
Display 'Show all N public annotations' message when there is a selection
-
Robert Knight authored
-
Robert Knight authored
-