- 08 Jun, 2017 1 commit
-
-
Sheetal Umesh Kumar authored
We need to be able to support the client to work with different annotation services, other than just `https://hypothes.is/api`. If the settings from the host doesn't specify a service, the client should fall back to using the default apiUrl which would be `https://hypothes.is/api`. https://github.com/hypothesis/product-backlog/issues/278
-
- 07 Jun, 2017 4 commits
-
-
Sean Hammond authored
Extract a new configFuncSettingsFrom() function
-
Sean Hammond authored
-
Robert Knight authored
Extract app() into separate function
-
Robert Knight authored
Simplify a test fake
-
- 06 Jun, 2017 12 commits
-
-
Sean Roberts authored
-
Sean Roberts authored
-
Sean Hammond authored
Extract some code for reading config settings from a window.hypothesisConfig() function out of annotator.config.config#configFrom() and into a new, separate function annotator.config.settings#configFuncSettingsFrom(). This function can now be unit-tested separately and the long configFrom() function gets a bit shorter.
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Extract the code for reading the config.app setting into a separate function. This function can now be unit tested separately, and the long configFrom() function gets a little shorter.
-
Sean Hammond authored
Search by DOI: Include DOI URIs in search URI list
-
Robert Knight authored
When the `search_for_doi` feature flag is enabled, include `doi:` URIs in the query to the `/annotations/search` endpoint. This enables the client to fetch annotations made on different URLs which are associated with the same DOI as the current page.
-
Sean Roberts authored
adding console log capture to karma
-
Sean Hammond authored
Search by DOI: Add document metadata to app state
-
Sean Hammond authored
Move config.js and extract-annotation-query.js into new config dir
-
Sean Hammond authored
-
- 05 Jun, 2017 11 commits
-
-
Robert Knight authored
Fix ghost adder
-
Sean Hammond authored
The adder is not off screen, it's in the top-left corner.
-
Sean Hammond authored
Hide the `<hypothesis-adder-toolbar>` element, rather than its containing `<hypothesis-adder>` element, when hiding/showing the adder. Since 56f5243e hiding the parent `<hypothesis-adder>` element doesn't work because, to protect them from third-party CSS elsewhere in the DOM, its child elements no longer inherit its CSS properties. Fixes https://github.com/hypothesis/client/issues/414
-
Sean Hammond authored
Adder() contains a `var self = this` line and a line that assigns the `element` that `createAdderDOM()` returns to `this.element`, but it usually accesses `element` via the local variable element (and occassionally as `this.element`). Change this to be consistent: assign `self.element = createAdderDOM()`; always access it as `self.element` not `this.element`; delete the local variable `element`. This just makes the code a little simpler and more self-consistent.
-
Robert Knight authored
Move the extraction of search URIs from frame metadata out of the callback for the "getDocumentInfo" cross-frame request and into a selector function. This will make it easier to change the set of search URIs that the client sends for a given set of connected frames depending on enabled features. It also makes it easier to implement tests for this. * Remove `searchUris` from frame objects in the app state and instead compute this list on-demand from the frame URI and metadata when needed.
-
Robert Knight authored
In preparation for conditionally including 'doi:' URIs in the set of search URIs depending on the active feature flags, store the complete document metadata for connected frames in the app state, instead of just extracting the document fingerprint and search URIs. This will allow the code that searches for annotations to later extract the set of search URIs just before it sends the query, at a point when the client has feature flag information.
-
Robert Knight authored
In particular add a test for the `documentFingerprint` property in preparation for changing the structure of frames objects in the app state.
-
Sean Hammond authored
extract-annotation-query.js is purely about reading a couple of config settings and is only used by config/config.js, so move it from the util/ dir into a new config/settings.js file. config/settings.js is going to become a file containing all of the different functions for reading different config settings. These functions are imported and used by config/settings.js. For a start, move extract-annotation-query.js's two functions into settings.js, but later we'll be adding more functions to this file. These functions are in a separate settings.js file, rather than just in the config.js file that uses them, so that they can be unit tested separately.
-
Sean Hammond authored
Add a src/annotator/config/ directory to contain all config-related code for the src/annotator/ part of the code. Move config.js into the directory. We're going to be adding more config-related files in this directory later.
-
Sean Hammond authored
Ignore all config other than direct linked ID from host page.
-
Sheetal Umesh Kumar authored
configuration on the host page other than the query and annotations. Fixes https://github.com/hypothesis/product-backlog/issues/209
-
- 02 Jun, 2017 1 commit
-
-
Sean Hammond authored
Adding group leave, switch, and view activity metrics
-
- 01 Jun, 2017 11 commits
-
-
Sean Roberts authored
-
Sean Roberts authored
-
Sean Roberts authored
Split extract annotation query into two separate functions
-
Sean Hammond authored
-
Sean Hammond authored
For a future refactoring of this config code I need to have one function per config setting (the function returns the value of the config setting). extractAnnotationQuery() is actually a single function for two config settings - it returns either {query: *} or {annotations: *} depending on what's in the URL #fragment. This doesn't fit into my planned refactoring, so split extractAnnotationQuery() into two settings functions: one for config.query and one for config.annotations.
-
Sean Hammond authored
Refactor extract annotation query
-
Sean Hammond authored
-
Sean Hammond authored
Only match the `#annotations:<ID>` regex against the URL if the `#annotation:<q|query>:<QUERY>` regex, which takes precedence, doesn't find a match. This also makes it clearer that the URL-safe base64 IDs comment applies to `annotFragmentMatch` only not to `queryFragmentMatch`.
-
Sean Hammond authored
I think this makes the code more readable.
-
Sean Hammond authored
This both clarifies the intent of the code (what exception, thrown by what, it's intending to catch) and reduces the chances of a bug where it actually catches a different exception thrown by something else that it didn't intend to catch.
-
Sean Hammond authored
Rewrite these tests to make them more descriptive, and clarify what the behaviour of `extractAnnotationQuery()` actually is: - Replace `unroll()` with a simple dynamic test generation approach that allows each test to have its own different `describe()` and `it()` strings - Change the top-level describe from `describe('annotation queries'` to `describe('annotation.util.extractAnnotationQuery'` - There was a test for what happens when a `#annotations:<ID>` fragment contains non-alphanumeric characters which used the test URL `'http://localhost:3000#annotations:\"TRYINGTOGETIN\");EVILSCRIPT()'),`. This seems to suggest that the alphanumeric characters restriction is a code injection defense, but I don't think it is. Replaced this with just `not%20alphanumeric`.
-