Commit 010c44fd authored by Robert Knight's avatar Robert Knight

Add `contentPartner` configuration option

Add an option that enables the embedder to configure a content
provider/partner banner to be shown in the client, indicating who is
providing the content.
parent d0039747
......@@ -29,7 +29,7 @@ import { urlFromLinkTag } from './url-from-link-tag';
*/
function configurationKeys(appContext) {
const contexts = {
annotator: ['clientUrl', 'subFrameIdentifier'],
annotator: ['clientUrl', 'contentPartner', 'subFrameIdentifier'],
sidebar: [
'appType',
'annotations',
......@@ -106,6 +106,11 @@ const configDefinitions = {
defaultValue: null,
getValue: settings => settings.clientUrl,
},
contentPartner: {
allowInBrowserExt: false,
defaultValue: null,
getValue: getHostPageSetting,
},
enableExperimentalNewNoteButton: {
allowInBrowserExt: false,
defaultValue: null,
......
......@@ -180,7 +180,9 @@ export class Guest {
* Integration that handles document-type specific functionality in the
* guest.
*/
this._integration = createIntegration(this);
this._integration = createIntegration(this, {
contentPartner: config.contentPartner,
});
/**
* Channel for host-guest communication.
......
......@@ -7,6 +7,7 @@ import {
/**
* @typedef {import('../../types/annotator').Annotator} Annotator
* @typedef {import('../../types/annotator').ContentPartner} ContentPartner
* @typedef {import('../../types/annotator').Integration} Integration
*/
......@@ -15,11 +16,14 @@ import {
* guest functionality.
*
* @param {Annotator} annotator
* @param {object} options
* @param {ContentPartner} [options.contentPartner] - Content partner banner to show,
* if supported by the integration.
* @return {Integration}
*/
export function createIntegration(annotator) {
export function createIntegration(annotator, { contentPartner } = {}) {
if (isPDF()) {
return new PDFIntegration(annotator);
return new PDFIntegration(annotator, { contentPartner });
}
const vsFrameRole = vitalSourceFrameRole();
......
......@@ -174,7 +174,7 @@
*/
/**
* Name of a content partner to show branding for.
* Specifies a content partner/provider to show branding for.
*
* @typedef {'jstor'} ContentPartner
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment