Skip to content

Commit

Permalink
Include GitHub issue number in Harvest description, refs #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Sieg authored and calmyournerves committed Jun 11, 2014
1 parent 344fe16 commit e370735
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ div.style['border-radius']='3px';
var href = window.location.href;
var pattern = /^https:\/\/github.com\/(.*?)\/(.*?)\/(.*\d+)$/
var m = href.match(pattern);
var issue_title = el.innerHTML + ' ' + document.getElementsByClassName('js-issue-title')[0].innerHTML;
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('js-issue-title')[0].innerHTML}));
div.setAttribute('data-item', JSON.stringify({'id':m[3],'name':issue_title}));
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;
Expand Down

0 comments on commit e370735

Please sign in to comment.