1. 18 Apr, 2016 1 commit
  2. 15 Apr, 2016 1 commit
  3. 14 Apr, 2016 8 commits
  4. 13 Apr, 2016 6 commits
  5. 12 Apr, 2016 5 commits
  6. 11 Apr, 2016 3 commits
    • Robert Knight's avatar
      Extract overflow state recalculation into a helper class · 36069747
      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.
      36069747
    • Robert Knight's avatar
      Provide a polyfill for window.requestAnimationFrame() in tests · c5d1c27f
      Robert Knight authored
      rAF is not available in PhantomJS 1.x but is supported by all of our
      target browsers (IE >= 10).
      c5d1c27f
    • Robert Knight's avatar
      Re-implement excerpt overflow state recalculation · 6f49c8f6
      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
      6f49c8f6
  7. 08 Apr, 2016 3 commits
  8. 06 Apr, 2016 9 commits
  9. 05 Apr, 2016 4 commits
    • Christof Dorner's avatar
      Merge pull request #3151 from hypothesis/postgres-write-models · 17e6556c
      Christof Dorner authored
      Postgres Write 2/4: Model code for creating new annotations in Postgres
      17e6556c
    • Nick Stenning's avatar
      Merge pull request #3038 from hypothesis/client-live-reload · e80973ec
      Nick Stenning authored
      Live reload development tool for Hypothesis client
      e80973ec
    • Robert Knight's avatar
      Debounce live-reload notifications · 386e3552
      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.
      386e3552
    • Robert Knight's avatar
      Live reload dev tool for the Hypothesis client · 70f5676d
      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.
      70f5676d