Skip to content

Instantly share code, notes, and snippets.

@t2
Last active February 29, 2016 19:41
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 t2/7b13da5eccb589f00e96 to your computer and use it in GitHub Desktop.
Save t2/7b13da5eccb589f00e96 to your computer and use it in GitHub Desktop.
onPhotoSourceReq: (request, callback)->
photos = []
$.getJSON('/api/v1/moments/photos', (moments)->
if moments.length > 0
photos = _.flatten(_.map(moments, (m)->
return _.map(m.photos, (p)->
return p
)
))
callback(
id: ''
page: 1
totalPages: 1
items: _.map(photos, (p)->
return { thumb: p.thumb, picture: p.original }
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment