2015-02-06 12:08:32 +00:00
|
|
|
define([
|
|
|
|
'knockout', 'text!./Weather.html', 'kojqui/buttonset'
|
|
|
|
], function(ko, htmlString) {
|
|
|
|
|
|
|
|
ko.components.register('Environment/Weather/METAR', {
|
|
|
|
require : 'topics/Environment/Weather/METAR'
|
|
|
|
});
|
|
|
|
|
|
|
|
ko.components.register('Environment/Weather/Clouds', {
|
2015-11-18 19:19:10 +00:00
|
|
|
require : 'topics/Environment/Weather/CloudLayers'
|
2015-02-06 12:08:32 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
ko.components.register('Environment/Weather/Boundary', {
|
|
|
|
require : 'topics/Environment/Weather/Boundary'
|
|
|
|
});
|
|
|
|
|
|
|
|
ko.components.register('Environment/Weather/Aloft', {
|
|
|
|
require : 'topics/Environment/Weather/Aloft'
|
|
|
|
});
|
|
|
|
|
|
|
|
function ViewModel(params) {
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
self.topics = [
|
|
|
|
'METAR',
|
|
|
|
'Clouds',
|
|
|
|
'Boundary',
|
|
|
|
'Aloft',
|
|
|
|
];
|
|
|
|
|
|
|
|
self.selectedTopic = ko.observable();
|
|
|
|
|
|
|
|
self.selectedComponent = ko.pureComputed(function() {
|
|
|
|
return "Environment/Weather/" + self.selectedTopic();
|
|
|
|
});
|
|
|
|
|
|
|
|
self.selectTopic = function(topic) {
|
|
|
|
self.selectedTopic(topic);
|
|
|
|
}
|
|
|
|
|
|
|
|
self.selectTopic(self.topics[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
ViewModel.prototype.dispose = function() {
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return component definition
|
|
|
|
return {
|
|
|
|
viewModel : ViewModel,
|
|
|
|
template : htmlString
|
|
|
|
};
|
|
|
|
});
|