1. 07 Jan, 2016 2 commits
  2. 06 Jan, 2016 19 commits
    • Robert Knight's avatar
      Avoid scrolling the page when expanding/collapsing excerpts · 9be50963
      Robert Knight authored
      Stop propagation of the click event in the 'More'/'Less'
      links which would otherwise bubble up to the
      annotation card and scroll the page to that annotation.
      9be50963
    • Nick Stenning's avatar
      Merge pull request #2831 from hypothesis/gh2830-chrome_ext_inline_install · 9574d01e
      Nick Stenning authored
      Fix inline Chrome extension installation
      9574d01e
    • Nick Stenning's avatar
      Merge pull request #2826 from hypothesis/gh2820-date-formatting-perf · bdaed673
      Nick Stenning authored
      Improve stream / sidebar date formatting performance
      bdaed673
    • Robert Knight's avatar
      Merge pull request #2832 from hypothesis/jshint-tweaks · e8c93b2b
      Robert Knight authored
      Jshint tweaks
      e8c93b2b
    • Nick Stenning's avatar
      Merge pull request #2795 from hypothesis/via-plain-html-form · a18ddc05
      Nick Stenning authored
      Make the Via form on the homepage work as a plain HTML form
      a18ddc05
    • Sean Hammond's avatar
      Fix jshintrc file indentation · 9fdbe711
      Sean Hammond authored
      9fdbe711
    • Sean Hammond's avatar
      jshint: Add some predefs · 91ec35bd
      Sean Hammond authored
      Gets rid of lots of spurious jshint warnings in tests.
      91ec35bd
    • Sean Hammond's avatar
      jshint: use the global form of strict · 25f5cb43
      Sean Hammond authored
      Tell jshint that use put our 'use strict'; statements at the top of the
      file (because we're using browserify) not inside a wrapper function.
      
      This gets rid of jshint 'Use the function form of "use strict"' errors.
      25f5cb43
    • Robert Knight's avatar
      Unify annotation card link styles · 58f66c69
      Robert Knight authored
      Use a single CSS class for the annotation timestamp,
      reply count and 'More'/'Less' link for truncated annotation bodies.
      
      This gives the 'More' link a consistent style with the other links
      and removes some duplicated styling.
      58f66c69
    • Robert Knight's avatar
      Make the full width of an annotation quote clickable to expand it · 113f2b82
      Robert Knight authored
      For consistency with annotation bodies and to provide an easier hit
      target on mobile, make the full width of annotation quotes clickable
      to expand them.
      113f2b82
    • Robert Knight's avatar
      Fix excerpt content height when switching from edit back to view mode · 3d3df156
      Robert Knight authored
      The 'max-height' style property was not updated when the <excerpt>'s
      enabled state changed from false to true which happened when switching
      from annotation edit mode back to view mode.
      
      Use ngStyle to ensure the inline styles applied to the <excerpt>'s
      content element are updated as necessary in this case.
      3d3df156
    • Robert Knight's avatar
      Remove unnecessary pointer-events property · 15406d38
      Robert Knight authored
      The inline controls use to cover the full height of the right-side
      of excerpts, not just the visible area occupied by the 'More' and
      'Less' links. This is no longer the case.
      
      The use of 'pointer-events' here also caused the 'More' link
      to be unresponsive in Microsoft Edge. There may be a difference
      in behavior between Edge and FF/Chrome when nested elements
      have different pointer-events values, but I haven't verified
      this yet.
      15406d38
    • Robert Knight's avatar
      Update tests for <excerpt> control · 06b092bc
      Robert Knight authored
       * Remove the controller tests which no longer correspond
         to the implementation
      
       * Set default values for <excerpt> attributes needed
         by test
      
       * Add additional tests for toggling of the <excerpt>
         using inline controls and using properties to control
         expansion/collapse externally.
      06b092bc
    • Robert Knight's avatar
      Run <excerpt> initialization asynchronously · 7aaad32f
      Robert Knight authored
      Run initialization of <excerpt> asynchronously so that any
      directives inside its children have been resolved by the time
      updateContentMaxHeight() is called.
      
      In the context of the annotation list, the maxHeight
      style property of the content element was set to 0 for the
      annotation quotes because the 'ngRepeat' directive which
      creates the DOM elements for the quotes had not run by the time
      that updateContentMaxHeight() was called.
      7aaad32f
    • Robert Knight's avatar
      Simplify <excerpt> link function · 5f80a473
      Robert Knight authored
      Wrapping the init logic in `scope.$evalAsync()` used to be
      necessary so that any code touching the '.excerpt' element
      ran after that element had been transcluded into the DOM.
      
      However, this is no longer necessary since all the init logic
      now runs inside a `scope.$watch()` callback, which is invoked
      after `ngIf` has inserted the '.excerpt' element into the DOM.
      5f80a473
    • Robert Knight's avatar
      Truncated excerpt design tweaks · c7687b68
      Robert Knight authored
       * Increase the expansion speed
      
       * Make the drop-shadow at the bottom of collapsed annotation bodies
         expand to the full width of the annotation card and be clickable
         to provide an easier-to-hit target for expanding collapsed
         annotations
      
       * Make the shadow non-clickable when hidden after expansion
      c7687b68
    • Robert Knight's avatar
      Update the truncated state of the annotation when the feature flag changes · deeab8b2
      Robert Knight authored
      If the enabled state of the annotation changes after the view
      loaded, the truncation state did not update.
      
      With the current feature flag implementation this typically happens
      if the feature flags load after the session data has been received.
      In future the intention is to make feature flags part of the session
      data payload so this won't happen.
      deeab8b2
    • Robert Knight's avatar
      Fix expand/collapse controls not being shown when embedded media loads · 8839b89a
      Robert Knight authored
      When embedded media in an annotation loads, this may trigger
      a resize of the element's content and result in a change of whether
      expand/collapse controls need to be shown, outside of Angular's
      knowledge.
      
      The DOM doesn't provide a nice way to monitor for resizing
      of a specific elements (although hacks involving scroll events,
      hidden <iframes> etc. exist) so here we just monitor for 'load'
      events and trigger a digest in that case, as well as notifying
      the containing directive whenever the collapsible state changes.
      8839b89a
    • Robert Knight's avatar
      Implement new annotation card truncation design · 9e117768
      Robert Knight authored
      This implements the new annotation card truncation design
      from https://trello.com/c/Jg0NWyF3/
      
      The main consequence of the change is to make the annotation
      cards more compact when truncation is enabled by:
      
       * Reducing the number of quote lines shown from 3 to 2
      
       * Showing the link to expand truncated quotes at the end
         of the second line of the quote, instead of on its own
         line
      
       * Moving the link to expand truncated annotation bodies
         outside of the annotation body and into a control
         inline with the tags list.
      
         This has been implemented by giving the <excerpt> control
         two modes, one that shows inline expand/collapse controls
         and a second that allows the containing directive to
         implement its own controls.
      9e117768
  3. 22 Dec, 2015 7 commits
    • Robert Knight's avatar
      1658f019
    • Robert Knight's avatar
      Cache annotation tooltip timestamp strings · 113c018f
      Robert Knight authored
      Even with the previous fix to use Intl.DateTimeFormat
      where available, 'vm.updatedString()' was the most expensive
      watcher in the annotation card.
      
      Generate this string only when updating the visible text
      of the timestamp and cache it thereafter.
      
      Fixes #2820
      113c018f
    • Robert Knight's avatar
      Optimize timestamp formatting · f6e7bda8
      Robert Knight authored
      Date.toLocaleDateString() with options is extremely slow,
      creating and re-using an Intl.DateTimeFormat object is two
      orders of magnitude faster (see #2820)
      
      Fixes #2820
      f6e7bda8
    • Sean Hammond's avatar
      Merge pull request #2825 from hypothesis/gh2819-new-annot-timestamp · b8140413
      Sean Hammond authored
      Update annotation timestamp when creating and editing annotations
      b8140413
    • Robert Knight's avatar
      Refactor duplicated function call · f123a91a
      Robert Knight authored
      f123a91a
    • Robert Knight's avatar
      Refresh the view model when a new highlight is saved · fdbd4277
      Robert Knight authored
      When a new highlight is saved, updateViewModel() was called
      immediately after making the request to the server to save
      the highlight, but not after the response from the server
      is received, when additional properties such as the last-updated
      timestamp for the highlight, will have been set.
      fdbd4277
    • Robert Knight's avatar
      Update the displayed annotation timestamp immediately after creation/update · 37e2407a
      Robert Knight authored
      There were two problems here:
      
       1. The periodic interval for updating the timestamp was never started
          for new annotations because the initial call to updateTimestamp()
          was a no-op for annotations that had no timestamp yet.
      
       2. domainModel.updated was never updated after an annotation
          was saved to the server and hence the call to
          updateTimestamp() re-used the old timestamp.
      
      (1) is fixed now by restarting the interval using the current
      last-updated timestamp whenever the view model is updated.
      
      (2) is fixed indirectly now by moving the logic to update
      the timestamp into updateViewModel(), so that all updates
      to it happen in one place. When an annotation is updated,
      the updated domain model returned by the server is the one
      passed into updateViewModel() to update it.
      
       * Separate out the logic for creating a decaying interval
         whose frequency depends on the age of some input timestamp,
         and updating the timestamp string on each interval.
      
         The decaying interval is now handled by 'time.decayingInterval'
      
       * Trigger a restart of the interval whenever the view model is
         updated in response to a change to the annotation
      
      Fixes #2819
      Fixes #2822
      37e2407a
  4. 20 Dec, 2015 1 commit
  5. 18 Dec, 2015 11 commits