overleaf/services/web/public/coffee/track-changes/models/Diff.coffee
2014-03-07 12:00:31 +00:00

13 lines
376 B
CoffeeScript

define [
"models/User"
"libs/backbone"
], (User) ->
Diff = Backbone.Model.extend
url: () ->
"/project/#{@get("project_id")}/doc/#{@get("doc_id")}/diff?from=#{@get("from")}&to=#{@get("to")}"
parse: (diff) ->
for entry in diff.diff
if entry.meta? and entry.meta.user?
entry.meta.user = User.findOrBuild(entry.meta.user.id, entry.meta.user)
return diff