Skip to content

Commit

Permalink
Support for Google Mail
Browse files Browse the repository at this point in the history
The button will appear next to the labels and tries to match project on the last label. toggl#131
  • Loading branch information
hhermsen committed Jan 3, 2015
1 parent 13cc679 commit c4135af
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Add Toggl one-click time tracking to popular web tools.
- [Wunderlist][26]
- [Toodledo][27]
- [Teamwork.com][28]
- [Google Mail][29]

## Installing from the Web Store

Expand All @@ -47,7 +48,8 @@ https://chrome.google.com/webstore/detail/toggl-button/oejgccbfbmkkpaidnkphaiaec
2. Go to your [TeamWeek][2], [Pivotal Tracker][3], [Github][4], [Asana][5], [Unfuddle][6], [Gitlab][7],
[Trello][8], [Worksection][9], [Redbooth][10], [Podio][11], [Basecamp][12], [JIRA][13], [Producteev][14],
[Bitbucket][15], [Stifer][16], [Google Docs][17], [Redmine][18], [YouTrack][19], [CapsuleCRM][20],
[Xero][21], [Zendesk][22], [Any.do][23], [Todoist][24], [Trac][25], [Wunderlist][26], [Toodledo][27], [Teamwork.com][28] account and start your Toggl timer there.
[Xero][21], [Zendesk][22], [Any.do][23], [Todoist][24], [Trac][25], [Wunderlist][26], [Toodledo][27],
[Teamwork.com][28], [Google Mail][29] account and start your Toggl timer there.
3. To stop the current running timer:
- press the button again
- start another time entry inside your account.
Expand Down Expand Up @@ -89,6 +91,7 @@ Don't know how to start? Just check out the [user requested services][97] that h
[26]: https://www.wunderlist.com
[27]: https://www.toodledo.com/
[28]: https://www.teamwork.com/
[29]: https://mail.google.com
[97]: https://github.com/toggl/toggl-button/wiki/User-requested-buttons
[98]: https://github.com/toggl/toggl-button/wiki/Adding-custom-domains
[99]: https://github.com/toggl/toggl-button/pulls
17 changes: 17 additions & 0 deletions src/scripts/content/google-mail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*jslint indent: 2 */
/*global $: false, document: false, togglbutton: false*/
'use strict';

togglbutton.render('.ha:not(.toggl)', {observe: true}, function (elem) {
var link,
description = $('h2', elem).textContent,
project = $('.hX:last-of-type .hN', elem).textContent.split('/').pop();

link = togglbutton.createTimerLink({
className: 'google-mail',
description: description,
projectName: project
});

elem.appendChild(link);
});
Loading

0 comments on commit c4135af

Please sign in to comment.