Skip to content

Instantly share code, notes, and snippets.

@papanikge
Forked from JoelBesada/README.md
Last active August 29, 2015 13:56
Show Gist options
  • Save papanikge/9169047 to your computer and use it in GitHub Desktop.
Save papanikge/9169047 to your computer and use it in GitHub Desktop.
document.ondragstart=function(){return false};dst=function(e){return (p=Math.pow)(p(e.clientX-(rc=e.target.getBoundingClientRect()).left,2)+p(e.clientY-rc.top,2),.5)};$("[href\x2a=imgur]").not($(t="[href$=jpeg],[href$=gif],[href$=png],[href$=jpg]")).each(function(){this.href+='.jpg'});void($(t).not(".EGraw,.click-gadget a,.domain a,.thumbnail").attr({'class':'EGraw',target:'blank'}).each(function(){$(this).append($('<span />').toggle(function(e){$(this).html(' [-]').nextAll().show();return false},function(e){$(this).html(' [+]').nextAll().hide();return false}).click()).append($('<img>').attr({src:this.href,style:'display:block;max-width:780px;height:auto',title:'Drag to resize'}).mousedown(function(e){(t=this).iw=t.width;t.d=dst(e);t.dr=false;e.preventDefault();}).mousemove(function(e){if((t=this).d){t.style.maxWidth=t.style.width=((dst(e))%2At.iw/t.d)+"px";this.dr=true}}).mouseout(f=function(e){this.d=false;if(this.dr)return false}).click(f)).append($('<span />').html('%26#8635;').click(function(e){(i=$(t=this).prev()).css({MozTransform:r='rotate('+(t.rot=(t.rot?(++t.rot):1)%4)%2A90+'deg)',WebkitTransform:r,filter:'progid:DXImageTransform.Microsoft.BasicImage(rotation='+t.rot+')',marginBottom:(m=t.rot%2?(i.attr('width')-i.attr('height'))/(1+(nie=!$.browser.msie)):0)+'px',marginTop:(m=nie%2Am)+'px',marginLeft:-m+'px',marginRight:-m+'px'});return false}))}))
{
"name": "reddit-pics",
"description": "reddit pics",
"icon": "",
"link": ""
}
@AstraLuma
Copy link

This doesn't work. Chrome throws syntax errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment