Skip to content

Instantly share code, notes, and snippets.

@markjaquith
Created March 2, 2014 18:48
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 markjaquith/9311540 to your computer and use it in GitHub Desktop.
Save markjaquith/9311540 to your computer and use it in GitHub Desktop.
dotjs-zen script to make Cloudup images link to the raw image URL (for dragging, easy direct sharing, etc)
require 'jqueryify'
jQuery ($) ->
waitForImgLoad = ->
collection = $ '.collection-item.complete.loaded'
if collection.length
img = $ '.img-wrapper img', collection
if img.length
return img.each (n,i) ->
$i = $ i
$i.wrap "<a href='#{$i.attr 'src'}'>"
setTimeout waitForImgLoad, 100
setTimeout waitForImgLoad, 250 # The first attempt is always going to fail, so wait a little
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment