This is useful if you are using Asana with Github and need to quickly generate commit messages like Put status indications on left-hand side #246986491925487
README.md
This bookmarklet is probably overkill and doesn't work with subtasks. Instead, just copy and paste the Asana task's link into your commit message and the relevant task will show up in Asana.
To quickly copy and paste your browser's current link: command-L then command-C. Works on any page ;-)
---
# old stuff:
1) Install [Github Services Asana integration](https://github.com/github/github-services/blob/master/docs/asana)
This file has been truncated. show original
asana-task-to-github.bookmarklet.js
javascript:(function()%7Bfunction%20isValid(a)%7Breturn%20Number.isInteger(Number(a))%7Dvar%20target%3Ddocument.querySelector(%22.SingleTaskTitleRow-taskName%20textarea%22)%3Btarget%7C%7C(target%3Ddocument.getElementById(%22details_property_sheet_title%22))%3Bfor(var%20title%3Dtarget%3Ftarget.value%3Awindow.document.title%2Cparts%3Dlocation.href.trim(%22%2F%22).split(%22%2F%22)%2Cid%3Dnull%2Ci%3Dparts.length-1%3Bi%3E0%3Bi--)if(isValid(parts%5Bi%5D))%7Bid%3Dparts%5Bi%5D%3Bbreak%7Dif(id)%7Bvar%20text%3Dtitle%2B%22%20%23%22%2Bid%2Ctextarea%3Ddocument.createElement(%22textarea%22)%3Btextarea.textContent%3Dtext%2Ctextarea.style.position%3D%22fixed%22%2Cdocument.body.appendChild(textarea)%2Ctextarea.select()%3Btry%7Bdocument.execCommand(%22copy%22)%7Dcatch(a)%7Bwindow.prompt(%22Copy%20to%20clipboard%3A%20Ctrl%2BC%2C%20Enter%22%2Ctext)%7Dfinally%7Bdocument.body.removeChild(textarea)%7D%7D%7D)()
asana-task-to-github.js
// copies to clipboard "task title #taskid"
// as used by Github services Asana integration
// https://github.com/github/github-services/blob/master/docs/asana
// To build:
// 1) process with https://jscompress.com
// 2) process with http://mrcoles.com/bookmarklet/
var target = document.querySelector('.SingleTaskTitleRow-taskName textarea')
if (!target) {
This file has been truncated. show original