1. 25 Sep, 2015 6 commits
    • Nick Stenning's avatar
      Don't consider new-format comments to be orphans · f1c3d2fd
      Nick Stenning authored
      Previously, an annotation with a selectorless target (such as a comment
      or "page note") would be marked as an orphan.
      
      This commit adjusts the orphan detection code so that an annotation is
      marked as an orphan only if both of the following conditions are met:
      
      - it has at least one target with selectors (an "anchorable target")
      - none of the anchorable targets have successfully anchored
      f1c3d2fd
    • Nick Stenning's avatar
      Give comments/page notes a single target with source field · fdc79de8
      Nick Stenning authored
      In order for comments (AKA "page notes") to be discoverable with the
      search logic implemented in #2413 (cc4ca35), they need to have at least
      one target with a source field.
      
      Previously a comment was defined as an annotation
      
      - with a `uri`
      - without any targets
      - without any references (no targets but with references == a reply)
      
      Now comments have a single target with a single field, `source`. This
      finally puts us in a position where we can consider deprecating the
      `uri` field.
      fdc79de8
    • Nick Stenning's avatar
      Improve error handling in test that uses setTimeout · 29fd17c6
      Nick Stenning authored
      If one of these asserts fails, then this test will timeout (taking 2
      seconds to do so).
      
      By using a small helper (`timeoutPromise`) to implement the "next tick"
      functionality that was previously achieved with `setTimeout`, this is
      improved: we return a promise from the test function and a failure will
      be reported immediately.
      
      See https://mochajs.org/#working-with-promises for more on returning
      promises from mocha test functions.
      29fd17c6
    • Nick Stenning's avatar
      Add a few short clarifying comments about selectors · b4653a0e
      Nick Stenning authored
      It's not at all clear from the code that the singular "selector" is in
      fact an array of selectors referring to a single target. Add a few
      comments to help understanding this until we can sort out a better
      refactoring/naming.
      b4653a0e
    • Nick Stenning's avatar
      Remove unused AnnotationController#isComment method · a81822ee
      Nick Stenning authored
      The last thing that used this was removed in 7829cc1.
      a81822ee
    • Nick Stenning's avatar
      Merge pull request #2542 from hypothesis/2525-new-annotations-disappearing · ab7ceae1
      Nick Stenning authored
      Change $anchored -> $orphan
      ab7ceae1
  2. 24 Sep, 2015 5 commits
    • Sean Hammond's avatar
      Add tests for shouldShowThread() · 4102d301
      Sean Hammond authored
      4102d301
    • Sean Hammond's avatar
      Change $anchored -> $orphan · 6ebf0412
      Sean Hammond authored
      Instead of setting $anchored=true on anchored annotations, set
      $orphan=true on orphaned (i.e. unanchored) ones as we used to do.
      
      Orphaned annotations are the exception: we don't show them, or if
      show_unanchored_annotations is one then we show them with a warning.
      It's simpler and less buggy to add $orphan=true onto the exceptional
      annotations than to try to add $anchored=true onto all of the
      unexceptional ones.
      
      Fixes #2525.
      Fixes #2541.
      6ebf0412
    • Nick Stenning's avatar
      Merge pull request #2533 from hypothesis/9sqXWtNi-fix-title-for-local-file-pdf-annotations · 530466ae
      Nick Stenning authored
      Fix document title and domain for local file PDF annotations
      530466ae
    • Sean Hammond's avatar
      Fix broken card titles for some annotations · ca26970b
      Sean Hammond authored
      This fixes two issues on the annotation cards for some annotations:
      
      1. If the annotated document has a non-http(s) URI (e.g. a local file://
         URI) then don't hyperlink the document's title to that URI
      
      2. If the annotated document has no .domain value or its domain is the
         same as its title then don't display anything, instead of displaying
         a pair of emtpy braces ().
      
      To fix this move the logic for formatting an annotation's document's title
      and domain into AngularJS filters where it can be tested, instead of in
      the template.
      ca26970b
    • Nick Stenning's avatar
      Merge pull request #2534 from robertknight/autoprefix_css · a13ea6d2
      Nick Stenning authored
      Use autoprefixer to add vendor prefixes to CSS
      a13ea6d2
  3. 23 Sep, 2015 13 commits
  4. 22 Sep, 2015 14 commits
    • Nick Stenning's avatar
      Fix annotation pages · 89bfa6b3
      Nick Stenning authored
      cf410d0 broke standalone annotation pages by changing
      `threadRoot.children` from an array into a thread container.
      Unsurprisingly, `children` is supposed to be an array.
      89bfa6b3
    • Robert Knight's avatar
      Use more consistent naming for groupList directive · 9d93a631
      Robert Knight authored
       * Use the singular 'groupList' everywhere
      
       * Simplify the logic for stopping click propagation
         when toggling the selected group
      
       * Remove underscore prefix for Controller classes as per the PR
         discussion.
      
      Card 87
      9d93a631
    • Robert Knight's avatar
      Sort groups in lexicographical order · b2a90531
      Robert Knight authored
      Card 87
      b2a90531
    • Sean Hammond's avatar
      Merge pull request #2522 from hypothesis/fix-pdf-uris · 99bd3f21
      Sean Hammond authored
      Fix detection of PDF URIs
      99bd3f21
    • Robert Knight's avatar
      Add unit tests for <group-list> directive · f49b6d3c
      Robert Knight authored
      Card 87
      f49b6d3c
    • Nick Stenning's avatar
      Only render unanchored notice if feature turned on · 5d37b53e
      Nick Stenning authored
      *N.B.* This does not fix the underlying problem, but it does make it
      possible to deploy the existing codebase without breaking everything in
      production.
      5d37b53e
    • Nick Stenning's avatar
      Fix detection of PDF URIs · 84867512
      Nick Stenning authored
      70c9b9b broke a number of features of the h client that were toggled on
      for PDF documents, by renaming the Annotator PDF plugin from
      `Annotator.Plugin.PDF` to `Annotator.Plugin.Pdf`.
      
      While it's certainly an ugly side-effect of a straightforward rename,
      the problem is that `Guest#getDocumentInfo` (to pick one example) used
      `@plugins.PDF?` to determine whether to use the PDF metadata
      (provided by the PDF.js `PDFViewerApplication`).
      
      In the absence of PDF metadata, `getDocumentInfo` falls back to using
      `window.location.href`, which explains the behaviour identified
      in #2506.
      
      Fixes #2506.
      84867512
    • Robert Knight's avatar
      Add unit test for Groups List dropdown controller · 1b25b808
      Robert Knight authored
      Add a test for the controller part of the <groups-list> directive.
      
      We have a couple of different patterns for testing directive
      controllers in the code, the approach taken here follows the privacy
      dropdown's directive in simply exporting the controller's constructor
      as a 'private' export and referencing it directly in the test.
      
       * Rename the exports in the 'directive/privacy' module for consistency
      1b25b808
    • Robert Knight's avatar
      Groups list dropdown UI tweaks · 08ced29b
      Robert Knight authored
       * Restructure the 'New group' item to make icon
         and label align with the items above it
      
       * Make the whole 'New group' section clickable
      
       * Make 'New group' icon bold for visual consistency
         with other icons
      
       * Use the prerendered group URL from the API instead
         of generating it locally
      
      Card 87
      08ced29b
    • Robert Knight's avatar
      Add inline share link to groups dropdown in top bar · 31316fac
      Robert Knight authored
       * Use an element directive for <group-list> for
         consistency with the <privacy> directive and because
         the directive has its own template.
      
       * Use flexbox for easier layout of items in the groups
         dropdown list.
      
       * Update the hover and selection states of items in the dropdown
         list as per the mocks.
      
       * Add descriptive titles to all links in the list
      
      Card 87
      31316fac
    • Robert Knight's avatar
      Update style for dropdown menus · 8b7a7887
      Robert Knight authored
       * Use the brand color for hovered items,
         including selected items.
      
      Card 87
      8b7a7887
    • Robert Knight's avatar
      Refactor groups list styling · 43085602
      Robert Knight authored
      Use nesting for readability.
      
      Card 87
      43085602
    • Robert Knight's avatar
      Adjust color of 'New Group' background as per the mocks. · 1190a4c2
      Robert Knight authored
      Use a light grey background.
      
      Card 87
      1190a4c2
    • Nick Stenning's avatar
      Merge pull request #2518 from robertknight/karma-watch-target · 87665a80
      Nick Stenning authored
      Add make target to run karma tests with auto-watch enabled
      87665a80
  5. 21 Sep, 2015 2 commits