Created
March 2, 2014 18:48
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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