FileDiff.coffee 416 B

1234567891011121314
  1. define ["libs/backbone"], () ->
  2. FileDiff = Backbone.Model.extend
  3. url: -> "/project/#{window.userSettings.project_id}/version/#{@get("version_id")}/file/#{@get("path")}"
  4. sync: (method, model, options) ->
  5. throw "FileDiffs can only be read" unless method == "read"
  6. options ||= {}
  7. params =
  8. url: @url()
  9. type: "GET"
  10. $.ajax(_.extend(params, options))
  11. parse: (response) ->
  12. content : response