diff --git a/src/content/backlog.js b/src/content/backlog.js index 8a19619eb..850be44b3 100644 --- a/src/content/backlog.js +++ b/src/content/backlog.js @@ -1,23 +1,33 @@ -'use strict'; +/** + * @name Backlog + * @urlAlias backlog.com + * @urlRegex *://*.backlog.com/* + */ -togglbutton.render('#issueArea:not(.toggl)', { observe: true }, function (elem) { - const container = createTag('span', ''); - const ticketNumElem = $('.ticket__key .ticket__key-number', elem); - const titleElem = $('#summary .title-group__title-text', elem); - const projectElem = $('.project-header .header-icon-set__name'); - const containerElem = $('#summary *:first-child'); +'use strict' - const descFunc = function () { - return ticketNumElem.textContent + ' ' + titleElem.textContent; - }; +togglbutton.render( + '#issueArea:not(.toggl)', + { observe: true }, + function (elem) { + const container = createTag('span', '') + const ticketNumElem = $('.ticket__key .ticket__key-number', elem) + const titleElem = $('#summary .title-group__title-text', elem) + const projectElem = $('.project-header .header-icon-set__name') + const containerElem = $('#summary *:first-child') - const link = togglbutton.createTimerLink({ - className: 'Backlog', - description: descFunc, - projectName: projectElem.textContent, - calculateTotal: true - }); + const descFunc = function () { + return ticketNumElem.textContent + ' ' + titleElem.textContent + } - container.appendChild(link); - containerElem.parentNode.appendChild(container, containerElem); -}); + const link = togglbutton.createTimerLink({ + className: 'Backlog', + description: descFunc, + projectName: projectElem.textContent, + calculateTotal: true, + }) + + container.appendChild(link) + containerElem.parentNode.appendChild(container, containerElem) + }, +) diff --git a/src/origins.js b/src/origins.js index f285612f3..9565e839e 100644 --- a/src/origins.js +++ b/src/origins.js @@ -38,6 +38,11 @@ export default { url: '*://*.backlog.jp/*', name: 'Backlog' }, + 'backlog.com': { + url: '*://*.backlog.com/*', + name: 'Backlog', + file: 'backlog.js' + }, 'basecamp.com': { url: '*://*.basecamp.com/*', name: 'Basecamp'