overleaf/services/web/public/coffee/history/FileDiff.coffee

15 lines
416 B
CoffeeScript
Raw Normal View History

2014-02-12 05:23:40 -05:00
define ["libs/backbone"], () ->
FileDiff = Backbone.Model.extend
url: -> "/project/#{window.userSettings.project_id}/version/#{@get("version_id")}/file/#{@get("path")}"
sync: (method, model, options) ->
throw "FileDiffs can only be read" unless method == "read"
options ||= {}
params =
url: @url()
type: "GET"
$.ajax(_.extend(params, options))
parse: (response) ->
content : response