silvrgit/app/js/todayv2.js

40 lines
868 B
JavaScript
Raw Permalink Normal View History

2016-09-09 14:48:22 +00:00
/**
*
* User: Martin Donnelly
* Date: 2016-09-09
* Time: 15:11
*
*/
(function($) {
2017-04-18 09:06:39 +00:00
let TodayDataModel = Backbone.Model.extend({
2016-10-05 14:09:12 +00:00
initialize: function() {
this.set('url', '/today/data');
console.log(this.get('url'));
//this.update();
}
});
2017-04-18 09:06:39 +00:00
const webSocketModel = new SOCKETMANAGER();
2016-10-05 14:09:12 +00:00
webSocketModel.turnOn();
2017-04-18 09:06:39 +00:00
window.clock = new Clock({model: new ClockModel()});
let weatherModel = new WeatherModel({geo:{coords:{latitude: 55.95, longitude: -4.5666667}}});
window.weather = new Weather({model: weatherModel});
2016-10-05 14:09:12 +00:00
2017-04-18 09:06:39 +00:00
let trainModel = new TrainModel({from:'hym', to:'dbe'});
window.train = new Train({model: trainModel});
2016-10-05 14:09:12 +00:00
webSocketModel.setWeather(weatherModel);
webSocketModel.setTrain(trainModel);
setTimeout(function(){
console.log('request update');
webSocketModel.getUpdate();
}, 500);
2016-09-09 14:48:22 +00:00
})(jQuery);
2017-04-18 09:06:39 +00:00