Skip to content

Instantly share code, notes, and snippets.

@koduki
Created November 6, 2008 11:31
Show Gist options
  • Save koduki/22563 to your computer and use it in GitHub Desktop.
Save koduki/22563 to your computer and use it in GitHub Desktop.
var document = FireGestures.sourceNode.ownerDocument;
var window = document.defaultView;
var x,a,u,q,qq,qg,g='',w=window,d=document,l=d.location,e=encodeURIComponent;
var h=l.href,hs=h.split('?'),i,b,o=new Image,m=d.images;
if(/[^\w\-\.\!\~\*\'\(\)\;\/\?\:\@\&\=\+\$\,\%\#]/.test(hs[0])){
h=encodeURI(hs[0])+(hs[1]?hs[1]:'');
}
b=h.match(/(.*)\/.*$/)[1];
if(m){
for(i=0;i<m.length;i++){
if(m[i].offsetWidth*m[i].offsetHeight>99*99){
o.src=m[i].src;
p=o.src.replace(b,'');
o.src='#';
g+=p+'#'+m[i].offsetWidth+'#'+m[i].offsetHeight+'#';
}
}
}
u='http://clipp.in/bookmarklet/add';
q='?v=1&u='+e(h)+'&t='+e(d.title);
qq='&q='+e(w.getSelection());
qg='&g='+e(g)+'&b='+e(b);
q=((u+q+qq+qg).length<8000)?q+qq+qg:((u+q+qq).length<8000)?q+qq:((u+q+qg).length<8000)?q+qg:q;
var win = OpenBrowserWindow();
win.open(u+q,'','toolbar=0,resizable=1,scrollbars=1,status=1,width=640,height=550');
win.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment