• Sean Hammond's avatar
    Rename config.app to sidebarAppUrl · 1fcb15cf
    Sean Hammond authored
    The code in `src/boot/` reads the `sidebarAppUrl` setting from
    `js-hypothesis-config` JSON objects in the host page (defaulting to the
    value of the build-time `__SIDEBAR_APP_URL__` template variable, if there's
    no `sidebarAppUrl` setting in the host page).
    
    `boot/` then writes `sidebarAppUrl` as the value of the `href` of a
    `<link type="application/annotator+html">` element that it injects into
    the host page.
    
    Later, the code in `src/annotator/` reads this `<link>` element's `href`
    in as the `config.app` setting, which it uses as the `src` of the
    sidebar app's `<iframe>` that it injects into the host page.
    
    So the variable that's named `sidebarAppUrl` / `__SIDEBAR_APP_URL__` at
    boot / build time* gets renamed to `config.app` when it makes it into
    the `src/annotator` code.
    
    Fix this by renaming `config.app` in `src/annotator` to
    `config.sidebarAppUrl` so that the variable is named consistently.
    
    `*` In the build-time code there's also a `defaultSidebarAppUrl`
    variable, and an `H_SERVICE_URL` environment variable, which also belong to
    the same sidebarAppUrl config setting.
    1fcb15cf
settings.js 3.92 KB