Commit d76fe380 authored by Vincent's avatar Vincent

Merge branch '149-add-support-for-peerj-in-the-extension' into 'master'

Add support for PeerJ in the extension

Closes #149

See merge request !129
parents ff7d3905 2d2c462a
Pipeline #58152469 passed with stages
in 31 minutes and 12 seconds
......@@ -23,6 +23,7 @@ import { inject as injectToFrontiers } from './frontiersin';
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 { FoundDoisMessage, ProvideDoiMessage, isRequestDoiMessage, ExtensionMessage } from '../interfaces';
const osfHosts = [
......@@ -156,6 +157,8 @@ function initialise() {
// 'asm.org'.length === 7:
document.location.host.substring(document.location.host.length - 7) === 'asm.org') {
injectToAsm();
} else if (document.location.host === 'peerj.com') {
injectToPeerJ();
}
}
......
import { generateWidget } from './generateWidget';
import { detectElementById, detectElementByClassName } from './detectElement';
export function inject() {
detectElementByClassName('article-meta', injectPlaudit);
}
function injectPlaudit(sidebar: HTMLElement) {
const container = document.createElement('div');
container.style.marginTop = '20px';
const widget = generateWidget();
container.appendChild(widget);
const articleInfo = document.getElementById('article-item-article-information-container');
if (articleInfo) {
articleInfo.insertAdjacentElement('beforebegin', container);
}
}
{
"manifest_version": 2,
"name": "Plaudit",
"version": "0.1.24",
"version": "0.1.25",
"description": "View and add endorsements to scholarly articles",
"icons": {
"16": "icon-16.png",
......
{
"name": "plaudit-extension",
"version": "0.1.24",
"version": "0.1.25",
"description": "View and add endorsements to scholarly articles",
"scripts": {
"start": "rm -r build/*; webpack --mode=development;",
......
......@@ -92,6 +92,7 @@ const initialise = async () => {
'https://journals.plos.org',
'https://*.biomedcentral.com',
'https://*.asm.org',
'https://peerj.com',
'moz-extension:',
'chrome-extension:'
],
......
......@@ -32,15 +32,15 @@
},
"devDependencies": {
"@types/body-parser": "^1.17.0",
"@types/cheerio": "^0.22.9",
"@types/express": "^4.11.1",
"@types/express-session": "^1.15.11",
"@types/node": "^10.12.0",
"@types/node-fetch": "^2.1.2",
"@types/passport": "^0.4.5",
"@types/passport-oauth2": "^1.4.7",
"ts-node-dev": "^1.0.0-pre.22",
"tslint": "^5.10.0",
"typescript": "^2.8.3"
"@types/cheerio": "^0.22.11",
"@types/express": "^4.16.1",
"@types/express-session": "^1.15.12",
"@types/node": "^11.13.4",
"@types/node-fetch": "^2.3.2",
"@types/passport": "^1.0.0",
"@types/passport-oauth2": "^1.4.8",
"ts-node-dev": "^1.0.0-pre.32",
"tslint": "^5.15.0",
"typescript": "^3.4.3"
}
}
This diff is collapsed.
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