• Sean Hammond's avatar
    Use hostPageSetting() instead of Object.assign() · b8cff0a2
    Sean Hammond authored
    Use the new `settings.hostPageSetting()` method in `index.js`.
    
    This means that `index.js` no longer uses `shared/settings.js`
    (`jsonConfigsFrom()`) or `configFuncSettingsFrom()`. These are both
    encapsulated in `hostPageSetting()`.
    
    Previously `index.js` blindly assigned a lot of property names and
    values fo the `config` object using a couple of `Object.assign()` calls:
    
        Object.assign(config, sharedSettings.jsonConfigsFrom(window_.document));
        Object.assign(config, configFuncSettingsFrom(window_));
    
    These `Object.assign()`s are now gone, and instead it explicitly assigns
    each property to the `config` object by name:
    
        var config = {
          app: settings.app,
          query: settings.query,
          ...
          openLoginForm: settings.hostPageSetting('openLoginForm'),
          openSidebar: settings.hostPageSetting('openSidebar'),
          ...
        };
    
    (Some of these settings were already being assigned in this way, but the
    ones that uses `hostPageSetting()` are new.)
    
    This also means that `index.js` no longer uses `isBrowserExtension()`.
    Previously `index.js` contained logic to return early, declining to read
    various config settings from the host page using its `Object.assign()`s,
    if the client was running in a browser extension. This logic is also now
    encapsulated in the new `settings.hostPageSetting()` method and so is
    removed from `index.js`.
    b8cff0a2
Name
Last commit
Last update
..
anchoring Loading commit data...
config Loading commit data...
plugin Loading commit data...
test Loading commit data...
util Loading commit data...
vendor Loading commit data...
.eslintrc.js Loading commit data...
adder.html Loading commit data...
adder.js Loading commit data...
annotation-counts.js Loading commit data...
annotation-sync.js Loading commit data...
delegator.coffee Loading commit data...
guest.coffee Loading commit data...
highlighter.coffee Loading commit data...
host.coffee Loading commit data...
main.js Loading commit data...
pdf-sidebar.coffee Loading commit data...
pdfjs-rendering-states.js Loading commit data...
plugin.coffee Loading commit data...
range-util.js Loading commit data...
selections.js Loading commit data...
sidebar-trigger.js Loading commit data...
sidebar.coffee Loading commit data...