1. 06 Mar, 2017 8 commits
  2. 03 Mar, 2017 1 commit
  3. 02 Mar, 2017 3 commits
  4. 01 Mar, 2017 11 commits
  5. 28 Feb, 2017 5 commits
    • Robert Knight's avatar
      Make boot script load settings from correct config tags (#243) · 68be70df
      Robert Knight authored
      An inconsistency crept in where the annotator code reads settings from
      JSON script tags with a 'js-hypothesis-config' class name but the sidebar app
      reads settings from JSON script tags with a 'js-hypothesis-settings'
      class name. The boot script ended up using 'js-hypothesis-settings'
      which is the default class name specified in `settings.js`.
      
      We should use the same name everywhere, which needs to be
      'js-hypothesis-config' since that is used by the public documentation
      [1].
      
      This commit changes the default class to `js-hypothesis-config` and
      removes the ability to specify alternative class names when calling
      `settings()`.
      
      The extension and service will need to be updated to use the new class
      name.
      
      [1] See docs/config.md
      68be70df
    • Nick Stenning's avatar
      Merge pull request #229 from hypothesis/package-content-server · e743717c
      Nick Stenning authored
      Add an express server which serves the package's contents.
      e743717c
    • Sean Hammond's avatar
      Merge pull request #262 from hypothesis/fix-pdf-quote-anchoring-2 · 5b836627
      Sean Hammond authored
      Fix PDF quote anchoring (Part II)
      5b836627
    • Sean Hammond's avatar
      Support onLogin callbacks from partner sites · 0ca108c0
      Sean Hammond authored
      When the client is embedded in a partner site and a login button in the
      client is clicked, call the JavaScript onLogin function that was
      provided to us by the partner via the window.hypothesisConfig function.
      
      When not embedded in a partner site, just prompt for a first-party login
      as normal.
      
      Note that this means that if the client is embedded in a partner site
      with no onLogin callback in window.hypothesisConfig, then nothing will
      happen when the login button in the client is clicked.
      0ca108c0
    • Sean Hammond's avatar
      Separate bridge events by direction · 473fa634
      Sean Hammond authored
      Separate bridge events sent from sidebar to annotator and from annotator
      to sidebar into two separate sections in the source code. Just to make
      documentation of the events clearer.
      473fa634
  6. 27 Feb, 2017 12 commits
    • Robert Knight's avatar
      Update the package server's URL structure to mirror cdn.hypothes.is · 3782856c
      Robert Knight authored
       - /hypothesis and /hypothesis@X.Y.Z serve the boot script
      
       - /hypothesis/X.Y.Z/ serves the files for a given version of the
         package
      3782856c
    • Robert Knight's avatar
      Revert an unnecessary change to the config in the live reload server · 751a0503
      Robert Knight authored
      The change from defining a `window.hypothesisConfig` function to using a
      script config tag was left over from an earlier version of the package
      content server work.
      751a0503
    • Robert Knight's avatar
      Remove log message when asset manifest is built · cd10d27a
      Robert Knight authored
      This is now just getting distracting amidst the more important
      information that gets logged during a build.
      cd10d27a
    • Robert Knight's avatar
      Output the sidebar app URL and asset root URL after the first build · 895e7e2b
      Robert Knight authored
      Print the sidebar app URL and asset root URL that were baked into the
      client after the first build.
      
      This is useful to verify that the build was run with the expected
      environment.
      895e7e2b
    • Robert Knight's avatar
      Support customizing the hostname in URLs that point to the package server · bb55a41c
      Robert Knight authored
      To facilitate testing the client on devices that are not the same as the
      one the package server and Hypothesis dev server are running on, it is
      useful to be able to set the hostname for URLs that point to the package
      content server that `gulp watch` runs.
      
      This commit adds support for setting this via a `PACKAGE_SERVER_HOSTNAME`
      env var.
      bb55a41c
    • Robert Knight's avatar
      Bake the local asset server's URL into the boot script · a3dc82e3
      Robert Knight authored
      When building the client in development mode, make the client load
      assets from the package content server by default.
      
      Also if `H_SERVICE_URL` is set, bake that service's /app.html endpoint
      into the boot script.
      a3dc82e3
    • Robert Knight's avatar
      Modify live reload server to use client served by package content server · 6dcec091
      Robert Knight authored
      The live reload server's example page was modified to use a script tag
      for config settings because the boot script currently only reads that
      config source and does not use `window.hypothesisConfig()`.
      
      In order to use the sidebar app from the local service, the service
      needs to be configured to serve the local client by setting the
      'CLIENT_URL' env var before running the devserver and in the client, the
      'H_SERVICE_URL' env var needs to be pointed at the devserver host.
      6dcec091
    • Robert Knight's avatar
      Make package content server behave more like unpkg · edaa1bcc
      Robert Knight authored
      Make the package content server mirror unpkg's behavior in that:
      
       - The entry point for a package is located at `/{packageName}@{version}`
      
       - Requests without a package version specified redirect to the
         corresponding path for the latest package version
      edaa1bcc
    • Robert Knight's avatar
      Add an express server which serves the package's contents. · ed4afca0
      Robert Knight authored
      Add an express server which serve's the package's contents in a manner
      similar to unpkg:
      
       - The '/' route serves the package's entry point script
      
       - Other routes serve files from the package
      
      This can be used together with the CLIENT_URL setting in the Hypothesis
      service to configure the service to serve the local development version
      of the client instead of the production version.
      ed4afca0
    • Robert Knight's avatar
      Fix anchoring using quote selector alone failing · 2381e2c9
      Robert Knight authored
      Looking at the `anchor` function, it is clearly intended that the
      position selector is optional for anchoring, as is the case for HTML
      anchoring. However, anchoring using only a quote selector did not
      actually work. This was in part due to the bug fixed in the previous
      commit but also because of a missing check for a null position selector
      when populating the (quote,position) cache.
      
      In order for the test to pass using only a quote, it was necessary to
      change the search string to a unique quote which only occurs once in the
      document. Otherwise the quote anchoring found the occurrence of
      'Netherfield Park' on the non-rendered page 1.
      2381e2c9
    • Robert Knight's avatar
      Fix PDF quote anchoring only testing a single page · 81aa2372
      Robert Knight authored
      The `findInPages` function was supposed to search for a quote looking
      at each of the page indexes in the input array, in order.
      
      However because of the way that `next` was used, this function ended up
      only searching the first page in the list. The `then(attempt, next)`
      code was intended to try the current page and then move to the next in
      the list if no match was found. However the `next` function is not
      called if `attempt` throws in this context.
      
      The `pdfContent` var in the test was renamed to `pdfPages` for clarity.
      81aa2372
    • Robert Knight's avatar
      Merge pull request #261 from hypothesis/fix-pdf-quote-anchoring · cffcd255
      Robert Knight authored
      Fix PDF quote anchoring
      cffcd255