Refactor
This commit is contained in:
@@ -11,28 +11,23 @@ export default {
|
|||||||
document.querySelector(".ItemRow--highlighted textarea")?.textContent?.trim() ||
|
document.querySelector(".ItemRow--highlighted textarea")?.textContent?.trim() ||
|
||||||
document.querySelector(".ItemRow--focused textarea")?.textContent?.trim() ||
|
document.querySelector(".ItemRow--focused textarea")?.textContent?.trim() ||
|
||||||
document.querySelector(".SingleTaskPane textarea")?.textContent?.trim(),
|
document.querySelector(".SingleTaskPane textarea")?.textContent?.trim(),
|
||||||
projectId: document => {
|
projectId: document =>
|
||||||
const match = document
|
document
|
||||||
.querySelector(".TaskProjectPill-projectName")
|
.querySelector(".TaskProjectPill-projectName")
|
||||||
?.textContent?.trim()
|
?.textContent?.trim()
|
||||||
?.match(projectRegex)
|
?.match(projectRegex)?.[1],
|
||||||
return match && match[1]
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"github-pr": {
|
"github-pr": {
|
||||||
name: "github",
|
name: "github",
|
||||||
urlPatterns: ["https\\://github.com/:org/:repo/pull/:id(/:tab)"],
|
urlPatterns: ["https\\://github.com/:org/:repo/pull/:id(/:tab)"],
|
||||||
id: (document, service, { org, repo, id }) => [service.key, org, repo, id].join("."),
|
id: (document, service, { org, repo, id }) => [service.key, org, repo, id].join("."),
|
||||||
description: (document, service, { org, repo, id }) =>
|
description: document => document.querySelector(".js-issue-title")?.textContent?.trim(),
|
||||||
document.querySelector(".js-issue-title")?.textContent?.trim(),
|
projectId: document =>
|
||||||
projectId: document => {
|
document
|
||||||
const match = document
|
|
||||||
.querySelector(".js-issue-title")
|
.querySelector(".js-issue-title")
|
||||||
?.textContent.trim()
|
?.textContent.trim()
|
||||||
?.match(projectRegex)
|
?.match(projectRegex)?.[1],
|
||||||
return match && match[1]
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"github-issue": {
|
"github-issue": {
|
||||||
@@ -107,13 +102,11 @@ export default {
|
|||||||
id: ["t", "ot"],
|
id: ["t", "ot"],
|
||||||
},
|
},
|
||||||
description: document => document.querySelector(".title-field-ghost")?.textContent?.trim(),
|
description: document => document.querySelector(".title-field-ghost")?.textContent?.trim(),
|
||||||
projectId: document => {
|
projectId: document =>
|
||||||
const match = document
|
document
|
||||||
.querySelector(".header-title__main")
|
.querySelector(".header-title__main")
|
||||||
?.textContent?.trim()
|
?.textContent?.trim()
|
||||||
?.match(projectRegex)
|
?.match(projectRegex)?.[1],
|
||||||
return match && match[1]
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
wunderlist: {
|
wunderlist: {
|
||||||
|
|||||||
Reference in New Issue
Block a user