Skip to content

Commit

Permalink
feat: Add support for shortuct (previously clubhouse) (#2006)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidankinzett committed Nov 22, 2021
1 parent 6742ec1 commit 208fe9c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/scripts/content/shortcut.js
@@ -0,0 +1,31 @@
'use strict';

togglbutton.render('.story-state:not(.toggl)', { observe: true }, function (
elem
) {
const wrap = createTag('div');
const element = elem;
elem = elem.parentNode.parentNode.parentNode;

const getDescription = function () {
const storyId = $('.story-id > input', elem).value;
const title = $('h2.story-name', elem).textContent;

return `#${storyId} - ${title}`;
};

const getProject = function () {
return $('.story-project .value', elem).textContent;
};

const link = togglbutton.createTimerLink({
className: 'toggl-shortcut',
description: getDescription,
projectName: getProject
});

wrap.className = 'attribute editable-attribute toggl-button-shortcut-wrapper';
wrap.appendChild(link);

element.parentNode.insertBefore(wrap, element.nextSibling);
});
4 changes: 4 additions & 0 deletions src/scripts/origins.js
Expand Up @@ -507,6 +507,10 @@ export default {
url: '*://*.sentry.io/*',
name: 'Sentry'
},
'app.shortcut.com': {
url: '*://app.shortcut.com/*',
name: 'Shortcut'
},
'sifterapp.com': {
url: '*://*.sifterapp.com/*',
name: 'Sifterapp'
Expand Down
23 changes: 23 additions & 0 deletions src/styles/style.css
Expand Up @@ -1180,6 +1180,29 @@ a.toggl-button.workfront.min {
padding-left: 27px;
}

/********* SHORTCUT *********/
.toggl-button.toggl-shortcut:not(.toggl-button-edit-form-button) {
width: 100%;
margin: 6px;
height: 23px;
}

.toggl-button.toggl-shortcut svg {
height: 24px;
width: 24px;
margin-left: 1px;
}

.toggl-button.toggl-shortcut span {
padding-left: 4px;
font-size: 12px;
font-weight: 700;
}

.toggl-button-shortcut-wrapper {
padding: 0 !important;
}

/********* TEAMLEADER *********/
.toggl-button.teamleader {
background: none;
Expand Down

0 comments on commit 208fe9c

Please sign in to comment.