Skip to content

Instantly share code, notes, and snippets.

@brianhanifin
Created February 24, 2009 02:50
Show Gist options
  • Save brianhanifin/69364 to your computer and use it in GitHub Desktop.
Save brianhanifin/69364 to your computer and use it in GitHub Desktop.
Tumblr
CmdUtils.makeBookmarkletCommand({
name: "tumblr",
url: "javascript:var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://www.tumblr.com/share',l=d.location,e=encodeURIComponent,p='?v=3&u='+e(l.href)%20+'&t='+e(d.title)%20+'&s='+e(s),u=f+p;try{if(!/^(.*\.)?tumblr[^.]*$/.test(l.host))throw(0);tstbklt();}catch(z){a%20=function(){if(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=450,height=430'))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();}void(0)"
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment