Skip to content

Commit

Permalink
Taiga.io support
Browse files Browse the repository at this point in the history
  • Loading branch information
ol-lo committed Jan 12, 2015
1 parent d6dc347 commit 90f5705
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"*://bugs.jquery.com/*",
"*://*.wunderlist.com/*",
"*://*.teamwork.com/*",
"*://*.teamworkpm.net/*"
"*://*.teamworkpm.net/*",
"*://*.taiga.io/*"
],
"icons": {
"16": "images/icon-16.png",
Expand Down Expand Up @@ -93,7 +94,8 @@
"*://*.toodledo.com/*",
"*://*.teamwork.com/*",
"*://*.teamworkpm.net/*",
"*://mail.google.com/*"
"*://mail.google.com/*",
"*://*.taiga.io/*"
],
"css": ["styles/style.css"],
"js": ["scripts/common.js"]
Expand Down Expand Up @@ -229,6 +231,10 @@
{
"matches": ["*://mail.google.com/*"],
"js": ["scripts/content/google-mail.js"]
},
{
"matches": ["*://*.taiga.io/*"],
"js": ["scripts/content/taiga.js"]
}
]
}
38 changes: 38 additions & 0 deletions src/scripts/content/taiga.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*jslint indent: 2 */
/*global $: false, document: false, togglbutton: false, createTag:false*/

'use strict';

/* User story details button */
togglbutton.render('body:not(.loader-active) .us-detail:not(.toggl)', {observe: true}, function (elem) {
var link, container = createTag('div', ''),
titleElem = $('.view-subject', elem),
projectElem = $('.project-name', elem),
buttonInsertionPoint = $('.us-story-main-data', elem);

link = togglbutton.createTimerLink({
className: 'taiga',
description: titleElem.innerText,
projectName: projectElem.innerText
});

container.appendChild(link);
buttonInsertionPoint.appendChild(link);
});

/* Backlog list buttons */
togglbutton.render('.user-story-name:not(.toggl)', {observe: true}, function (elem) {
var link,
projectElem = $('.project-name'),
//titleElem = $('.window-title-text'),
taskElem = $('a > span:nth-child(2)', elem);

link = togglbutton.createTimerLink({
className: 'taiga-backlog',
buttonType: 'minimal',
projectName: projectElem.innerText,
description: taskElem.innerText
});

elem.insertBefore(link, $('a', elem));
});
12 changes: 12 additions & 0 deletions src/styles/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 90f5705

Please sign in to comment.