Verified Commit 97fed440 authored by Vincent's avatar Vincent

Also inject the widget into Pubpub

parent a047eeb8
......@@ -24,6 +24,7 @@ import { inject as injectToPlos } from './plos';
import { inject as injectToBmc } from './bmc';
import { inject as injectToAsm } from './asm';
import { inject as injectToPeerJ } from './peerj';
import { inject as injectToPubpub } from './pubpub';
import { FoundDoisMessage, ProvideDoiMessage, isRequestDoiMessage, ExtensionMessage } from '../interfaces';
const osfHosts = [
......@@ -164,6 +165,8 @@ function initialise() {
injectToAsm();
} else if (document.location.host === 'peerj.com') {
injectToPeerJ();
} else if (document.location.host.substring(document.location.host.length - 'pubpub.org'.length) === 'pubpub.org') {
injectToPubpub();
}
}
......
import { generateWidget } from './generateWidget';
import { detectElementByClassName } from './detectElement';
export function inject() {
detectElementByClassName('side-content', injectPlaudit);
}
function injectPlaudit(sidebar: HTMLElement) {
const widget = generateWidget();
const widgetContainer = document.createElement('div');
widgetContainer.style.paddingTop = '20px';
sidebar.insertAdjacentElement('afterbegin', widgetContainer);
widgetContainer.appendChild(widget);
}
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