Skip to content

Instantly share code, notes, and snippets.

@pid
Created April 18, 2013 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pid/5410885 to your computer and use it in GitHub Desktop.
Save pid/5410885 to your computer and use it in GitHub Desktop.
Asana Bookmarklet
// Replace <PROJECT-ID> with your project id
javascript: var trim12 = function trim12(str) {
var str = str.replace(/^\s\s*/, ''),
ws = /\s/,
i = str.length;
while (ws.test(str.charAt(--i)));
return str.slice(0, i + 1);
};
location.href = 'mailto:x+<PROJECT-ID>@mail.asana.com?SUBJECT=' + encodeURIComponent(trim12('' + document.title)) + '&BODY=' + encodeURIComponent(trim12(document.title)) + encodeURIComponent('\n\n' + location.href) + encodeURIComponent('\n\n%3E' + window.getSelection());
javascript:var trim12=function trim12(a){for(var a=a.replace(/^\s\s*/,""),b=/\s/,c=a.length;b.test(a.charAt(--c)););return a.slice(0,c+1)};location.href="mailto:x+<PROJECT-ID>@mail.asana.com?SUBJECT="+encodeURIComponent(trim12(""+document.title))+"&BODY="+encodeURIComponent(trim12(document.title))+encodeURIComponent("\n\n"+location.href)+encodeURIComponent("\n\n%3E"+window.getSelection());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment