mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 10:04:10 -05:00
16 lines
439 B
CoffeeScript
16 lines
439 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?
|
|
if entry.meta.user?
|
|
entry.meta.user = User.findOrBuild(entry.meta.user.id, entry.meta.user)
|
|
else
|
|
entry.meta.user = User.getAnonymousUser()
|
|
return diff
|