1
0
mirror of https://github.com/danbee/tube-status-server synced 2025-03-04 08:39:12 +00:00
tube-status-server/javascripts/collections/lines.js
2013-01-23 11:22:11 +00:00

24 lines
566 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

define(['backbone', 'models/line'], function(Backbone, Line) {
var MySync = function (method, collection, options) {
   options.timeout = 10000; // required, or the application won't pick up on 404 responses
   options.dataType = "jsonp";
   return Backbone.sync(method, collection, options);
};
var LinesCollection = Backbone.Collection.extend({
url: "http://api.tubeupdates.com/?method=get.status",
model: Line,
sync: MySync,
parse: function(data) {
return data.response.lines;
}
});
return LinesCollection;
});