mirror of
https://github.com/danbee/tube-status-server
synced 2025-03-04 08:39:12 +00:00
24 lines
566 B
JavaScript
24 lines
566 B
JavaScript
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;
|
||
|
||
});
|