Commit e7b4b5dc authored by Vincent's avatar Vincent

Merge branch '169-support-pubpub' into 'master'

Support PubPub in the extension

Closes #169

See merge request !141
parents 53998710 2d5786ea
Pipeline #76408402 passed with stages
in 3 minutes and 34 seconds
......@@ -9,7 +9,7 @@
"dependencies": {
"@types/iframe-resizer": "^3.5.6",
"@types/node": "^10.12.9",
"get-dois": "^1.0.1",
"get-dois": "^2.0.0",
"iframe-resizer": "^3.6.3",
"ts-loader": "^5.3.0",
"typescript": "^3.2.2",
......
......@@ -1053,10 +1053,10 @@ get-caller-file@^1.0.1:
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
get-dois@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/get-dois/-/get-dois-1.0.1.tgz#fbd1d8dadfcd157b73e7a8322f7070a4932c2662"
integrity sha512-4nQiKQoZmaVdJDyZPipZbPwkGSABWZ4bVHd9/W873KaYqwphpPISblclLBxiZFHGbD+b03nKKJoudrXm5Vf5Vw==
get-dois@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/get-dois/-/get-dois-2.0.0.tgz#33e769b550ef3daeee9f254a427f80330aa7e3f8"
integrity sha512-s0hjfIyNN/qKCHtN0qTCqRPl/8vownHkNW9PNsod6qLfLynmfdbOfmoPmvE/Y9loLq0xaLkuRycTSI/9q0lOmQ==
get-stream@^3.0.0:
version "3.0.0"
......
......@@ -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);
}
{
"manifest_version": 2,
"name": "Plaudit",
"version": "0.1.28",
"version": "0.1.29",
"description": "View and add endorsements to scholarly articles",
"icons": {
"16": "icon-16.png",
......
{
"name": "plaudit-extension",
"version": "0.1.28",
"version": "0.1.29",
"description": "View and add endorsements to scholarly articles",
"scripts": {
"start": "rm -r build/*; webpack --mode=development;",
......@@ -25,7 +25,7 @@
"webpack-cli": "^3.1.2"
},
"dependencies": {
"get-dois": "^1.1.1",
"get-dois": "^2.0.0",
"iframe-resizer": "^3.6.3",
"webextension-polyfill": "^0.4.0"
}
......
......@@ -2878,10 +2878,10 @@ get-caller-file@^2.0.1:
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
get-dois@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/get-dois/-/get-dois-1.1.1.tgz#3df870084f99892919d86853e54999116929962f"
integrity sha512-ECMYtmYDpH2xo3c2vyluZVQ5Y1IBHY22DYto4Bviddi6o21FZJD+wvJ/cTyGoyoHmVl5SB57McRvnVRsApnwOA==
get-dois@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/get-dois/-/get-dois-2.0.0.tgz#33e769b550ef3daeee9f254a427f80330aa7e3f8"
integrity sha512-s0hjfIyNN/qKCHtN0qTCqRPl/8vownHkNW9PNsod6qLfLynmfdbOfmoPmvE/Y9loLq0xaLkuRycTSI/9q0lOmQ==
get-stream@^3.0.0:
version "3.0.0"
......
......@@ -95,6 +95,7 @@ const initialise = async () => {
'https://*.biomedcentral.com',
'https://*.asm.org',
'https://peerj.com',
'https://*.pubpub.org',
'moz-extension:',
'chrome-extension:'
],
......
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