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-24 11:16:07 +00:00

29 lines
764 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",
urls: {
now: "http://tubefeed.herokuapp.com/now.json",
tomorrow: "http://tubefeed.herokuapp.com/tomorrow.json",
weekend: "http://tubefeed.herokuapp.com/weekend.json"
},
model: Line,
sync: MySync,
parse: function(data) {
return data.response.lines;
}
});
return LinesCollection;
});