Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 0.4 - cleaning, added Firefox Add-On support. Deployed and an…
- Loading branch information
Showing
14 changed files
with
55 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
github-time-tracking | ||
==================== | ||
|
||
Add time tracking to the GitHub Issue Tracker (Issues 2.0) with Harvest Platform. | ||
Add time tracking to the GitHub Issue Tracker (Issues 2.0) with Harvest Platform. | ||
|
||
Firefox Add-on: | ||
$ cfx xpi | ||
|
||
Chrome Extension: | ||
$ zip -r github-time-tracking.zip manifest.json data img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
var div = document.createElement('div'); | ||
div.className='harvest-timer'; | ||
var el = document.getElementsByClassName('number')[0]; | ||
if (!el) { | ||
el = document.getElementsByClassName('pull-number')[0]; | ||
div.setAttribute('style','margin-top:8px;'); | ||
} | ||
var href = window.location.href; | ||
var pattern = /^https:\/\/github.com\/(.*?)\/(.*?)\/(.*\d+)$/ | ||
var m = href.match(pattern); | ||
div.setAttribute('data-account', JSON.stringify({'id':m[1]})); | ||
div.setAttribute('data-project', JSON.stringify({'id':m[2],'name':m[2]})); | ||
div.setAttribute('data-item', JSON.stringify({'id':m[3],'name':document.getElementsByClassName('discussion-topic-title')[0].innerHTML})); | ||
el.appendChild(div); | ||
var init = "window._harvestPlatformConfig = { 'applicationName': 'GitHub', 'permalink': 'https://github.com/%ACCOUNT_ID%/%PROJECT_ID%/%ITEM_ID%'}; var s = document.createElement('script');s.src = '//platform.harvestapp.com/assets/platform.js';s.async = true;var ph = document.getElementsByTagName('script')[0];ph.parentNode.insertBefore(s, ph);"; | ||
var s = document.createElement('script');s.type = 'text/javascript';s.innerHTML = init; | ||
var ph = document.getElementsByTagName('script')[0]; | ||
var div = document.createElement('div'); | ||
div.className='harvest-timer'; | ||
var el = document.getElementsByClassName('number')[0]; | ||
if (!el) { | ||
el = document.getElementsByClassName('pull-number')[0]; | ||
div.setAttribute('style','margin-top:8px;'); | ||
} | ||
var href = window.location.href; | ||
var pattern = /^https:\/\/github.com\/(.*?)\/(.*?)\/(.*\d+)$/ | ||
var m = href.match(pattern); | ||
div.setAttribute('data-account', JSON.stringify({'id':m[1]})); | ||
div.setAttribute('data-project', JSON.stringify({'id':m[2],'name':m[2]})); | ||
div.setAttribute('data-item', JSON.stringify({'id':m[3],'name':document.getElementsByClassName('discussion-topic-title')[0].innerHTML})); | ||
el.appendChild(div); | ||
var init = "window._harvestPlatformConfig = { 'applicationName': 'GitHub', 'permalink': 'https://github.com/%ACCOUNT_ID%/%PROJECT_ID%/%ITEM_ID%', 'referral': '66lx'}; var s = document.createElement('script');s.src = '//platform.harvestapp.com/assets/platform.js';s.async = true;var ph = document.getElementsByTagName('script')[0];ph.parentNode.insertBefore(s, ph);"; | ||
var s = document.createElement('script');s.type = 'text/javascript';s.innerHTML = init; | ||
var ph = document.getElementsByTagName('script')[0]; | ||
ph.parentNode.insertBefore(s, ph); |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var data = require("self").data; | ||
var pageMod = require("page-mod"); | ||
|
||
pageMod.PageMod({ | ||
include: [ /.*github.com\/.*\/issues\/.*/, /.*github.com\/.*\/pull\/.*/ ], | ||
contentScriptFile: data.url("index.js"), | ||
contentScriptWhen: "ready" | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"fullName": "GitHub Time Tracking", | ||
"name": "github-time-tracking", | ||
"description": "Add time tracking to the GitHub Issue Tracker with Harvest.", | ||
"license": "", | ||
"contributors": [], | ||
"author": "Petr Pridal Klokan Technologies GmbH", | ||
"url": "", | ||
"icon": "img/github-time-tracking-48.png", | ||
"icon64": "img/github-time-tracking-128.png", | ||
"homepage": "http://try.hrv.st/66lx", | ||
"dependencies": ["api-utils", "addon-kit"], | ||
"version": "0.4", | ||
"lib": "lib", | ||
"main": "main", | ||
"id": "jid0-bAfvy46pqbx8KSUnGc156Ng6bVM" | ||
} |