1. 03 May, 2016 3 commits
  2. 01 May, 2016 1 commit
  3. 29 Apr, 2016 5 commits
    • Robert Knight's avatar
    • Robert Knight's avatar
      Set the adder to appear above or below the selection depending on the selection direction · 5d5a1e33
      Robert Knight authored
      Try to avoid showing the adder above the selected text where possible by
      showing the adder above or below the selection depending on whether the
      selection was made forwards, in which case the focus point is assumed to
      be at the bottom of the selection, or backwards, in which case the focus
      point is assumed to be at the top of the selection.
      5d5a1e33
    • Robert Knight's avatar
      Switch the direction of the adder arrow to point up if it would disappear off the top of the screen · 9aecc0c3
      Robert Knight authored
      If the last line of the selection is very close to the top of the screen
      then show the adder pointing up at the text rather than down at it.
      
      Also constrain the adder's position so that it never appears outside the
      viewport.
      9aecc0c3
    • Robert Knight's avatar
      Componentize the annotation adder toolbar · ceb8e238
      Robert Knight authored
      Extract the adder styles and logic into separate files for easier
      testing and extension.
      
      Also extract the styling for positioning the arrow out into a a helper
      class so we can more easily reposition the arrow depending on the
      available space.
      ceb8e238
    • Robert Knight and Sheetal Umesh Kumar's avatar
      Show adder if user makes a selection and then launches the plugin. · 487d782e
      If a user selects some text, and then realises that Hypothesis isn't
      active, their first reaction will probably be to activate Hypothesis.
      In this scenario, we should pop up the adder near the selection on launch.
      
       * If there is a selection when the 'ready' event fires, show the adder
         at the focus point of the selection.
      
       * For consistency, show the adder at the focus point of the selection
         after a selection whilst Hypothesis is active.
      
       * Add 'range-util' module which provides utility functions to get
         the coordinates at the end of the selection.
      
         'range-util' uses the DOM Range, Selection and NodeIterator APIs directly
         rather than Annotator's Range functions for several reasons:
      
         1) Given that H now requires IE >= 10, all of our target browsers
            have all the APIs that we need.
      
         2) Using the DOM APIs directly proved easier to debug and test.
      487d782e
  4. 28 Apr, 2016 3 commits
  5. 27 Apr, 2016 2 commits
  6. 26 Apr, 2016 6 commits
    • Robert Knight's avatar
      Enable slow test reporting · 7bde508b
      Robert Knight authored
      This should help to catch slow tests in development before they become
      flakey failures on Travis.
      7bde508b
    • Robert Knight's avatar
      Fix two slow tests · 7f48a0c9
      Robert Knight authored
       * Avoid `assert.includes()` in Bridge test, since this does a deep
         equality comparison which is much more expensive than necessary
         (50-60ms to execute on a desktop system with no contention. I think
         this might explain the very occassional failure seen on Travis).
      
       * Use the correct name for the `retries` option in a
         retryPromiseOperation() test. This test should have failed but
         because the min timeout value was set so low, the test was taking < 2
         seconds to run even though it was retrying 10 times with an
         expontentially increasing timeout.
      7f48a0c9
    • Robert Knight's avatar
    • Robert Knight's avatar
      Fix error after an automatic incremental rebuild whilst running tests · 4b6c491f
      Robert Knight authored
      When running tests in `gulp watch` mode, the initial run passed but
      subsequent changes resulted in an error in the `merge-descriptors`
      package, related to PhantomJS.
      
      I haven't looked deeply into the problem but it does look like a
      familiar issue related to Proxyquire trying to 'call through' to the
      original imports in the module. Adding the '@noCallThru' flag in
      guest-test.coffee resolves the issue.
      4b6c491f
    • Robert Knight's avatar
      Switch to karma-mocha-reporter in tests · 2efd1860
      Robert Knight authored
      This produces more helpful output when test assertions involving deep
      equality checks fail.
      
      See https://www.npmjs.com/package/karma-mocha-reporter#showdiff
      
      This requires karma-mocha >= v0.2.2
      2efd1860
    • Robert Knight's avatar
      Update devDependencies to current versions, except for PhantomJS · 361906bb
      Robert Knight authored
      Update test and development dependencies to latest versions from npm,
      except for PhantomJS. The PhantomJS 1.9.x -> 2.x transition requires
      additional changes in tests.
      
      A couple of issues came up during the upgrade:
      
       - 'constructor' is no longer a valid name for describe() blocks
      
       - The require() in Karma's Browserify config ended up being resolved
         relative to the location of karma.config.js for reasons I haven't
         debugged, instead of looking in node_modules/. Using
         require.resolve() to get the absolute path works around the issue.
      361906bb
  7. 23 Apr, 2016 2 commits
  8. 22 Apr, 2016 2 commits
  9. 21 Apr, 2016 2 commits
  10. 20 Apr, 2016 14 commits