1. 29 Jun, 2016 10 commits
  2. 28 Jun, 2016 1 commit
    • Robert Knight's avatar
      Match annotations by tags and ID in excludeAnnotations() · de6fa295
      Robert Knight authored
      After creating an annotation, we remove the pre-created annotation from
      the Redux store and replace it with the saved version from the server.
      
      In order to determine which pre-created annotation to remove when adding
      the version from the server, we need to match on local tag, since the
      version from the server has no ID - but it does have a local tag since
      that is copied across from the pre-to-post created version.
      de6fa295
  3. 27 Jun, 2016 3 commits
  4. 24 Jun, 2016 7 commits
    • Robert Knight's avatar
      Merge pull request #3529 from... · 206278e6
      Robert Knight authored
      Merge pull request #3529 from hypothesis/3167-do-not-show-you-do-not-have-permission-card-while-waiting-for-document-to-load
      
      Don't show permissions error before annotation
      206278e6
    • Robert Knight's avatar
      Match drafts by local tag as well as ID · 214e40fc
      Robert Knight authored
      In preparation for making Annotation objects immutable, enable the
      drafts service to match local annotations which do not have an ID by
      their local tag.
      214e40fc
    • Sean Hammond's avatar
      Don't show permissions error before annotation · a698d261
      Sean Hammond authored
      Don't momentarily show a "You do not have permission to see this
      annotation" card before showing the annotation when loading a
      direct-linked annotation.
      
      Fixes #3167.
      
      When following direct links to annotations on certain documents,
      for example large PDF files that take a while to load,
      a "You do not have permission to see this annotation" card was being
      displayed briefly in place of the annotation card, before quickly being
      replaced by the correct annotation card.
      
      Previously the logic of the WidgetController.isLoading() function was to
      return true if we are currently waiting for the response to an
      annotation search request that we've sent.
      
      The theory is that this was happening:
      
      1. Client loads, but PDF has not yet loaded, so URL is unknown.
      
      2. Since the URL is unknown, the sidebar does not start fetching
         annotations and isLoading() returns false.
      
      3. Since the client a) Has a selection but b) Is not in a loading state
         - it thinks that it failed to fetch the annotation and displays the
         "You do not have permission to see this annotation" message,
      
      4. Once the PDF finishes loading, the URL is updated and that is
         reported to the sidebar which then performs a search query and
         isLoading() starts to return true until the search query response
         arrives then it returns false again.
      
      The fix is to make isLoading() return true if _either_ we've sent an
      annotation search request and are waiting on the response _or_ we're
      still waiting for the document to finish loading and haven't sent the
      search request yet. So instead of returning false, then true, then false
      again isLoading() will just keep returning true until both the document
      has loaded and the search response has been received, then it will start
      returning false.
      a698d261
    • Robert Knight's avatar
      Merge pull request #3497 from hypothesis/tailor-api-response-to-client · 711c6eeb
      Robert Knight authored
      Tailor API response to client
      711c6eeb
    • Robert Knight's avatar
      Fix the implementation of `isNodeInRange()` (#3522) · 8cbdc1e2
      Robert Knight authored
      This function failed to account for the case where the node was
      contained by, but not equal to, the range's startContainer.
      
      In new browsers we could just use `Range.isPointInRange()`. Since that
      is not available in IE 10/11, add an implementation adapted from
      Blink's `Range::isPointInRange()` C++ impl, minus support for the
      `offset` parameter.
      
      This fixes an issue where the adder could fail to show up when making
      certain selections because `getTextBoundingBoxes()` could incorrectly
      fail to find the text nodes within certan ranges.
      
      Fixes #3521
      8cbdc1e2
    • chdorner's avatar
      Update client's document data extraction · 08776cd9
      chdorner authored
      The `annotation.uri` now always is a linkable URI if we got that data
      when the annotation got created. There is no need anymore to try and
      find another linkable URI from the document data.
      This also removes the type check of `annotation.document.title` since
      the presentation layer on the backend always returns an array of
      strings (or the `title` property is missing).
      08776cd9
    • Sean Hammond's avatar
      Merge pull request #3526 from hypothesis/gh3523-non-text-selection-fix · 6c7533d8
      Sean Hammond authored
      Fix adder breaking after making a selection containing no text
      6c7533d8
  5. 23 Jun, 2016 3 commits
    • Sean Hammond's avatar
      Merge pull request #3519 from hypothesis/request-scoped-session · 979b83c4
      Sean Hammond authored
      Use request-scoped rather than thread-local session
      979b83c4
    • Robert Knight's avatar
      Merge pull request #3531 from hypothesis/fix-missing-pdf-highlights · 3242665f
      Robert Knight authored
      Fix missing PDF highlights
      3242665f
    • Nick Stenning's avatar
      Fix missing PDF highlights · 8f4cc121
      Nick Stenning authored
      fda63b4 unfortunately broke highlighting in PDFs, because the PDF
      anchoring code first finds the text in the document, and then uses a
      TextPositionSelector and the HTML anchoring code to select a range in
      the rendered page for highlighting.
      
      This commit fixes that issue by moving the TextQuoteSelector check up a
      level into `Guest#anchor`.
      
      I've added two tests for this in `guest-test.coffee` -- one tests that
      annotations where the target contains no TextQuoteSelector are marked as
      orphans, and the second tests that the low-level anchoring code is never
      called in this case.
      
      I have also removed the integration test, on the basis that I don't
      think integration testing failure cases is a good habit to get into.
      
      Fixes #3530.
      8f4cc121
  6. 22 Jun, 2016 5 commits
  7. 21 Jun, 2016 7 commits
  8. 20 Jun, 2016 4 commits
    • Sean Hammond's avatar
      Fix size of sidebar tutorial header · 4acc1a99
      Sean Hammond authored
      Fix the font size of the sidebar tutorial header. This used to be
      smaller, was accidentally made larger.
      
      Fixes #3325.
      4acc1a99
    • Robert Knight's avatar
      Fix the Help panel on the stream and standalone annotation pages (#3507) · 023498a8
      Robert Knight authored
      - Fix incorrect reference to `onShowHelpPanel` property in <top-bar>
         template
      
       - Do not show URL entry in metadata display if there is no annotation
         guest connected to the sidebar, as is the case in the stream and
         permalink pages.
      023498a8
    • Sean Hammond's avatar
      Fix escaped HTML in login error message · 2ce56b18
      Sean Hammond authored
      If you try to login to an unactivated account the error message that the
      server returns contains HTML:
      
      You haven't activated your account yet. <strong>Please check your email and
      open the link to activate your account</strong>.
      
      Render this client-side as HTML rather than escaping the tags.
      
      Fixes #3501.
      2ce56b18
    • Robert Knight's avatar
      Fix annotations made on PDFs in non-Safari browsers not appearing in Safari (#3494) · 134ca864
      Robert Knight authored
      In Safari a trailing '#' is appended to URIs extracted from web
      documents and PDFs. For URLs this makes no difference as the Hypothesis
      search API ignores the fragment identifier. However a URN with a
      trailing '#' is considered different from a URN without a trailing '#'.
      Since the URI for PDFs is now a URN of the form 'urn:x-pdf:...', when
      viewing a PDF in Safari annotations made in other browsers were not
      fetched and vice-versa.
      
      The trailing '#' is caused by a bug in the `URL.hash` setter in Safari.
      
      According to section 6.3 of the URL spec [1], setting URL.hash to an empty
      string should _remove_ the fragment identifier. In Safari however, it
      sets the fragment identifier to an empty string. The result is that when
      the URL is serialized, the output is eg. 'urn:x-pdf:aabb#' instead of
      'urn:x-pdf:aabb'.
      
      Upstream bug: https://bugs.webkit.org/show_bug.cgi?id=158869
      Fixes #3471
      
      [1] https://url.spec.whatwg.org/#urlutils-members
      134ca864