1. 06 Jun, 2017 5 commits
  2. 05 Jun, 2017 11 commits
    • Robert Knight's avatar
      Merge pull request #419 from hypothesis/fix-ghost-adder · 2c4d883e
      Robert Knight authored
      Fix ghost adder
      2c4d883e
    • Sean Hammond's avatar
      Correct a comment · 488c5b4f
      Sean Hammond authored
      The adder is not off screen, it's in the top-left corner.
      488c5b4f
    • Sean Hammond's avatar
      Hide the <hypothesis-adder-toolbar> not its parent · c9f31eca
      Sean Hammond authored
      Hide the `<hypothesis-adder-toolbar>` element, rather than its
      containing `<hypothesis-adder>` element, when hiding/showing the adder.
      
      Since 56f5243e hiding the parent
      `<hypothesis-adder>` element doesn't work because, to protect them from
      third-party CSS elsewhere in the DOM, its child elements no longer
      inherit its CSS properties.
      
      Fixes https://github.com/hypothesis/client/issues/414
      c9f31eca
    • Sean Hammond's avatar
      Access element as self.element · 9ba75b00
      Sean Hammond authored
      Adder() contains a `var self = this` line and a line that assigns the
      `element` that `createAdderDOM()` returns to `this.element`, but it
      usually accesses `element` via the local variable element (and
      occassionally as `this.element`).
      
      Change this to be consistent: assign `self.element = createAdderDOM()`;
      always access it as `self.element` not `this.element`; delete the local
      variable `element`.
      
      This just makes the code a little simpler and more self-consistent.
      9ba75b00
    • Robert Knight's avatar
      Move search URI extraction to a selector · 24a44817
      Robert Knight authored
      Move the extraction of search URIs from frame metadata out of the
      callback for the "getDocumentInfo" cross-frame request and into a
      selector function.
      
      This will make it easier to change the set of search URIs that the
      client sends for a given set of connected frames depending on enabled
      features. It also makes it easier to implement tests for this.
      
       * Remove `searchUris` from frame objects in the app state and instead
         compute this list on-demand from the frame URI and metadata when
         needed.
      24a44817
    • Robert Knight's avatar
      Save document metadata in app state. · 58ee6ee2
      Robert Knight authored
      In preparation for conditionally including 'doi:' URIs in the set of
      search URIs depending on the active feature flags, store the complete
      document metadata for connected frames in the app state, instead of just
      extracting the document fingerprint and search URIs.
      
      This will allow the code that searches for annotations to later extract
      the set of search URIs just before it sends the query, at a point when
      the client has feature flag information.
      58ee6ee2
    • Robert Knight's avatar
      Add basic test for `<help-panel>` component. · a31ca792
      Robert Knight authored
      In particular add a test for the `documentFingerprint` property in
      preparation for changing the structure of frames objects in the app
      state.
      a31ca792
    • Sean Hammond's avatar
      Move extract-annotation-query.js to settings.js · b9860ff6
      Sean Hammond authored
      extract-annotation-query.js is purely about reading a couple of config
      settings and is only used by config/config.js, so move it from the util/
      dir into a new config/settings.js file.
      
      config/settings.js is going to become a file containing all of the
      different functions for reading different config settings. These
      functions are imported and used by config/settings.js. For a start, move
      extract-annotation-query.js's two functions into settings.js, but later
      we'll be adding more functions to this file.
      
      These functions are in a separate settings.js file, rather than just in
      the config.js file that uses them, so that they can be unit tested
      separately.
      b9860ff6
    • Sean Hammond's avatar
      Move config.js into config/ dir · b6f282c8
      Sean Hammond authored
      Add a src/annotator/config/ directory to contain all config-related code
      for the src/annotator/ part of the code. Move config.js into the
      directory.  We're going to be adding more config-related files in this
      directory later.
      b6f282c8
    • Sean Hammond's avatar
      Merge pull request #410 from hypothesis/ext-ignore-host-config · 0d8dbabb
      Sean Hammond authored
      Ignore all config other than direct linked ID  from host page.
      0d8dbabb
    • Sheetal Umesh Kumar's avatar
      When the client is injected by the browser extension, it should ignore most · 2e72d312
      Sheetal Umesh Kumar authored
      configuration on the host page other than the query and annotations.
      
      Fixes https://github.com/hypothesis/product-backlog/issues/209
      2e72d312
  3. 02 Jun, 2017 1 commit
  4. 01 Jun, 2017 12 commits
  5. 31 May, 2017 10 commits
    • Sean Hammond's avatar
      Merge pull request #406 from hypothesis/add-tests-for-shared-settings · c31cbbe4
      Sean Hammond authored
      Tests and other tweaks to shared/settings.js
      c31cbbe4
    • Sean Hammond's avatar
      Simplify a line of code · 5a33ce1d
      Sean Hammond authored
      5a33ce1d
    • Sean Hammond's avatar
      Improve parseJSONConfigsFrom() docstring · d0efb080
      Sean Hammond authored
      d0efb080
    • Sean Hammond's avatar
      Improve shared/settings.js tests · e0303a31
      Sean Hammond authored
      Add a new set of unit tests that test more cases.
      e0303a31
    • Sean Hammond's avatar
      Rename settings() to jsonConfigsFrom() · 6eccb5de
      Sean Hammond authored
      6eccb5de
    • Sean Hammond's avatar
      Merge pull request #404 from hypothesis/rename-options-to-config-in-annotator · 6ba3b75d
      Sean Hammond authored
      Rename options to config in annotator
      6ba3b75d
    • Sean Hammond's avatar
      Fix a comment · 4ecd8cc5
      Sean Hammond authored
      4ecd8cc5
    • Sean Hammond's avatar
      Rename `options` to `config` in `src/annotator/` · de7cc8c3
      Sean Hammond authored
      There are two reasons for renaming the `options` object to `config`:
      
      **First**, it's more consistent. The file that creates this object is
      called `config.js`, and the function that creates the object is called
      `configFrom()`, and yet the object ends up getting called `options` (but
      you have to look in another file, `main.js`, to find this out).
      
      `config` is also used elsewhere as the name for the main configuration
      object, for example in Pyramid/h, in the client docs ("Configuring the
      Client", "configuration settings") and public API
      (`class="js-hypothesis-config"` scripts and `window.hypothesisConfig()`
      functions), etc.
      
      These "options" that the `src/annotator/` code reads from the host page
      also end up getting renamed to `hostPageConfig` when they get passed
      over in to the `src/sidebar/` code.
      
      **Second**, it's more unique. There are a number of other objects in the
      `src/annotator/` code that are called options, sometimes the main
      options object and another local options object are even used in the
      same function. There's no other objects called config.
      de7cc8c3
    • Sean Hammond's avatar
      Use configFrom() as configFrom() · ec6c8cc5
      Sean Hammond authored
      This makes it easier to grep for uses of this function.
      ec6c8cc5
    • Sean Hammond's avatar
      Rename config() to configFrom() · 8623b940
      Sean Hammond authored
      Rename the `config()` function that creates the `options` object to
      `configFrom()`.
      
      This is because I want to rename the `options` object to `config` in a
      future commit, so I need the `config()` function to be called something
      else.
      
      I think `configFrom(window)` is also clearer (that this is a function
      that returns a `config` object created from the given window) than
      `config(window)` (which could be read as configuring the window, for
      example).
      8623b940
  6. 25 May, 2017 1 commit