From 29db681e1c43078711f0fc729ab2c7e48c299b29 Mon Sep 17 00:00:00 2001 From: Manuel Bouza Date: Tue, 26 Mar 2019 10:01:58 +0100 Subject: [PATCH] Set default Bubble position to bottom right. --- package.json | 9 ++++----- src/js/remoteServices.js | 12 ++++-------- src/js/utils/urlMatcher.js | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index e562130..4203bb0 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,16 @@ { "name": "moco-browser-extensions", "description": "Browser plugin for MOCO", - "version": "1.0.18", + "version": "1.0.19", "scripts": { "start": "yarn start:chrome", "start:chrome": "node_modules/.bin/webpack --config webpack.chrome.config.js --watch --env.browser chrome --env.NODE_ENV development", "start:firefox": "node_modules/.bin/webpack --config webpack.firefox.config.js --watch --env.browser firefox --env.NODE_ENV development", - "build:chrome": "node_modules/.bin/webpack -p --config webpack.chrome.config.js --env.browser chrome --env.NODE_ENV production", - "build:firefox": "node_modules/.bin/webpack -p --config webpack.firefox.config.js --env.browser firefox --env.NODE_ENV production", + "build:chrome": "node_modules/.bin/webpack -p --config webpack.chrome.config.js --env.browser chrome --env.NODE_ENV production && zip -r build/chrome/moco-bx-source.zip src", + "build:firefox": "node_modules/.bin/webpack -p --config webpack.firefox.config.js --env.browser firefox --env.NODE_ENV production && zip -r build/firefox/moco-bx-source.zip src", "build": "yarn run build:firefox && yarn run build:chrome", "test": "node_modules/.bin/jest", - "test:watch": "node_modules/.bin/jest --watch", - "release": "copyfiles main.css main.min.js background.min.js manifest.json popup.html options.html node_modules/jquery/dist/jquery.min.js node_modules/select2/select2.js src/images/* release" + "test:watch": "node_modules/.bin/jest --watch" }, "dependencies": { "@bugsnag/js": "^5.2.0", diff --git a/src/js/remoteServices.js b/src/js/remoteServices.js index e448133..bfd1d9c 100644 --- a/src/js/remoteServices.js +++ b/src/js/remoteServices.js @@ -31,8 +31,7 @@ export default { ?.textContent.trim() ?.match(/^\[(\d+)\]/) return match && match[1] - }, - position: { right: "2rem" } + } }, "github-issue": { @@ -41,8 +40,7 @@ export default { id: (document, service, { org, repo, id }) => [service.key, org, repo, id].join("."), description: (document, service, { org, repo, id }) => - document.querySelector(".js-issue-title")?.textContent?.trim(), - position: { right: "2rem" } + document.querySelector(".js-issue-title")?.textContent?.trim() }, jira: { @@ -74,8 +72,7 @@ export default { name: "trello", urlPatterns: ["https\\://trello.com/c/:id/:title"], description: (document, service, { title }) => - document.querySelector(".js-title-helper")?.textContent?.trim() || title, - position: { right: "calc(2rem + 4px)" } + document.querySelector(".js-title-helper")?.textContent?.trim() || title }, youtrack: { @@ -91,7 +88,6 @@ export default { description: document => document .querySelector(".taskItem.selected .taskItem-titleWrapper-title") - ?.textContent?.trim(), - position: { right: "calc(2rem + 4px)" } + ?.textContent?.trim() } } diff --git a/src/js/utils/urlMatcher.js b/src/js/utils/urlMatcher.js index c6f6b77..bb78865 100644 --- a/src/js/utils/urlMatcher.js +++ b/src/js/utils/urlMatcher.js @@ -57,7 +57,7 @@ export const createEnhancer = document => service => { description: evaluate(service.description), projectId: evaluate(service.projectId), taskId: evaluate(service.taskId), - position: service.position || { left: "50%", transform: "translateX(-50%)" } + position: service.position || { right: "calc(2rem + 5px)" } } }