Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- retina = window.devicePixelRatio > 1
- images = document.querySelectorAll('img')
- if retina
- search_file_format = (file) ->
- file_match = file.match(/(.+?)(\.\b\w{1,4}$)/)
- if file_match
- file_match[1] + "@2X" + file_match[2]
- [].forEach.call images, (image) ->
- image.src = search_file_format(image.src)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement