Skip to content

Commit

Permalink
fix(backlog): add new origin (#2359)
Browse files Browse the repository at this point in the history
* chore(backlog): apply formatting

* fix(backlog): add new origin

* Update origins.js
  • Loading branch information
askides authored Dec 5, 2024
1 parent a14088e commit 84df839
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 19 deletions.
48 changes: 29 additions & 19 deletions src/content/backlog.js
Original file line number Diff line number Diff line change
@@ -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)
},
)
5 changes: 5 additions & 0 deletions src/origins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 84df839

Please sign in to comment.