delicious.comへのブックマークレット

先日書いたdel.icio.us リニューアルの続き。
よく見たらURLも、delicious.comになったっぽい。
ブックマーク画面も、新しくなっていてこんな風になっていた。

ブックマークレット新しくなっていて、

■ 旧

javascript:location.href='http://del.icio.us/new/yukiex?v=2&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);

■ 新

javascript:(function(){f='http://delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&v=5&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()

こんな風になっていた。
選択しているテキストをNotesの項目に入れたいので、少し改造してこうした。

javascript:(function(){f='http://delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&notes='+encodeURIComponent(getSelection())+'&v=5&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()

ということで使い心地はどうかな〜。