1. 14 Mar, 2019 1 commit
  2. 13 Mar, 2019 5 commits
  3. 12 Mar, 2019 4 commits
    • Robert Knight's avatar
      Replace usage of $http in api-routes service with fetch · 090e0f05
      Robert Knight authored
      As part of the migration away from AngularJS, replace use of the `$http`
      service with `fetch` when fetching API route information from the `/api/`
      route.
      
      This is part of #974.
      090e0f05
    • Robert Knight's avatar
      Merge pull request #997 from hypothesis/replace-http-with-fetch-in-oauthclient · a83852e0
      Robert Knight authored
      Replace $http with fetch in OAuthClient
      a83852e0
    • Robert Knight's avatar
      Merge pull request #1003 from hypothesis/send-event-to-current-ga-queue · db3598c2
      Robert Knight authored
      Fix Google Analytics event reporting
      db3598c2
    • Robert Knight's avatar
      Fix Google Analytics event reporting · ba29753e
      Robert Knight authored
      Fix a race condition where events would not be reported if the analytics
      service was instantiated before Google Analytics had fully loaded.
      
      The main interface to Google Analytics, `window.ga`, is initially a
      simple function which just records commands in a buffer. When
      analytics.js loads it sends the buffered events and replaces `window.ga`
      with a function that sends new events immediately. The analytics service
      captured the value of `window.ga` at the time it was instantiated and did
      not use the replacement after GA loaded. As a result tracked events were
      just stored in a buffer and never send to GA.
      
      Fix this by removing the `GoogleAnalytics` wrapper class and always invoking
      the _current_ `window.ga` function.
      
      Also update the documentation of the service's methods and add pointers to
      relevant Google Analytics docs.
      
      Fixes #976
      ba29753e
  4. 11 Mar, 2019 8 commits
  5. 07 Mar, 2019 5 commits
    • Hannah Stepanek's avatar
      Merge pull request #986 from hypothesis/add-showSection-logic · 6f29d1f8
      Hannah Stepanek authored
      Add show section logic
      6f29d1f8
    • Robert Knight's avatar
      Replace Angular $http service with `window.fetch` in OAuthClient · 11ac0e25
      Robert Knight authored
      As part of the migration away from AngularJS, replace `$http` with
      `fetch` in the OAuthClient class which handles interactions with h's
      OAuth endpoints.
      
      For testing use the fetch-mock library that is already used in h's
      frontend tests. The current version (v7) has dependencies that are
      written in ES6 and not transpiled, and so don't work in PhantomJS [1]. As a
      workaround, use v6 of the library for the time being.
      
      This is part of #974.
      
      [1] We _do_ transpile our own code from ES6 -> ES5 but that transform is
          not applied to dependencies.
      11ac0e25
    • Robert Knight's avatar
      Add `window.fetch` polyfill for older browsers · cdc6a27f
      Robert Knight authored
      Also improve the documentation on how to add a new polyfill in future.
      cdc6a27f
    • Robert Knight's avatar
      Remove angulartics dependency · 75d0cbbc
      Robert Knight authored
      As part of the migration away from AngularJS, replace Angulartics with
      direct usage of the Google Analytics client.
      
      Since we only use a single analytics provider (Google Analytics) and
      only basic event tracking functionality in a single-route application,
      its easiest just to replace the code with direct calls to the
      analytics.js API.
      
      See https://developers.google.com/analytics/devguides/collection/analyticsjs/events
      
      Fixes #976
      75d0cbbc
    • Robert Knight's avatar
      Replace angular-sanitize with DOMPurify · 05db13ea
      Robert Knight authored
      In preparation for the move away from AngularJS, replace
      angular-sanitize with the DOMPurify library, which is a modern and
      widely used HTML sanitization library with no framework dependency.
      
      The sanitization logic is now encapsulated fully within the
      `render-markdown` module which no longer takes a sanitization function
      as an argument. That argument used to be necessary because
      the angular-sanitize function had to be obtained via Angular's
      dependency injection. DOMPurify can just be required as a module inside
      render-markdown.js.
      
      One improvement that is possible with DOMPurify but not done here is to
      generate sanitized DOM nodes directly instead of having showdown
      generate HTML, which is then parsed to DOM and sanitized, then converted
      back to HTML and finally converted back to DOM by Angular.
      
      Fixes #975
      05db13ea
  6. 05 Mar, 2019 12 commits
  7. 04 Mar, 2019 5 commits