1. 01 Jun, 2017 8 commits
  2. 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
  3. 25 May, 2017 2 commits
    • Sean Hammond's avatar
      Merge pull request #400 from hypothesis/improve-annotator-config-tests · c990769f
      Sean Hammond authored
      Improve the `src/annotator/config.js` unit tests
      c990769f
    • Sean Hammond's avatar
      Improve the `src/annotator/config.js` unit tests · 1eb44b03
      Sean Hammond authored
      The main change is to make the tests much more detailed by adding more
      unit tests describing and testing more of the code's behaviour. But
      also:
      
      * Remove some test fakes which implemented non-trivial fake behaviour:
        `fakeScriptConfig`, `fakeQuerySelector`, `fakeWindowBase`. Just use
        simple stubs instead.
      
      * Make each test test just one thing (previously many of the tests for
        one part of the code could fail if another part of `config.js` was broken).
      
      * Isolate the `config.js` unit tests from `src/shared/settings.js` and
        `extract-annotation-query.js`. Previously the `config.js` tests could
        fail if `settings.js` or `extract-annotation-query.js` were broken,
        and implementation details of `settings.js` and `extract-annotation-query.js`
        were coded into the `config.js` tests.
      
      * Fix an issue with one test that if it failed a `window.document` would
        be left modified
      1eb44b03
  4. 23 May, 2017 6 commits
  5. 22 May, 2017 12 commits
  6. 20 May, 2017 1 commit
    • Robert Knight's avatar
      Update jQuery to current version & slim build · 8f5c9b83
      Robert Knight authored
      Update our horrifically old jQuery build which included workarounds for
      browsers we no longer support to the current stable version of jQuery.
      
      Also switch to using the slim build which excludes features we don't
      use.
      
      This reduces the size of the minified jQuery bundle from 96KB to 68KB.
      8f5c9b83
  7. 19 May, 2017 1 commit