Phi: first incomplete aircraft selection/install
requires latest flightgear source patch introducing /pkg/ uri handler
This commit is contained in:
parent
d37966b0d1
commit
32d99af20a
3 changed files with 72 additions and 7 deletions
|
@ -21,7 +21,7 @@ define([
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.topics = [
|
self.topics = [
|
||||||
/*'Select', */'Mass & Balance', 'Checklists', 'Failures', 'Panel', 'Help'
|
'Select', 'Mass & Balance', 'Checklists', 'Failures', 'Panel', 'Help'
|
||||||
];
|
];
|
||||||
|
|
||||||
self.selectedTopic = ko.observable();
|
self.selectedTopic = ko.observable();
|
||||||
|
|
|
@ -1,2 +1,44 @@
|
||||||
<h1>Select another Aircraft</h1>
|
<div data-bind="foreach: catalogs">
|
||||||
TBD.
|
<h3>Package <span data-bind="text: id"></span></h3>
|
||||||
|
<!--
|
||||||
|
<div>
|
||||||
|
Source <span data-bind="text: url"></span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
Installed at <span data-bind="text: installRoot"></span>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<table class="phi-aircraft-package-table ui-widget-content ui-corner-all">
|
||||||
|
<caption class="ui-widget-header ui-corner-all" data-bind="text: description"></caption>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Aircraft</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>FDM</th>
|
||||||
|
<th>Systems</th>
|
||||||
|
<th>Cockpit</th>
|
||||||
|
<th>Model</th>
|
||||||
|
<th>kB</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody data-bind="foreach: packages">
|
||||||
|
<tr>
|
||||||
|
<td colspan="5"><span data-bind="text: name"></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><img data-bind="attr: { src: thumbnails[0], alt: name, title: name }" width="171"></img></td>
|
||||||
|
<td><span data-bind="text: description"></span></td>
|
||||||
|
<td><span data-bind="text: ratingFdm"></span></td>
|
||||||
|
<td><span data-bind="text: ratingSystems"></span></td>
|
||||||
|
<td><span data-bind="text: ratingCockpit"></span></td>
|
||||||
|
<td><span data-bind="text: ratingModel"></span></td>
|
||||||
|
<td><span data-bind="text: (fileSize/1024).toFixed(0)"></span></td>
|
||||||
|
<td data-bind="if: installed">installed</td>
|
||||||
|
<td data-bind="ifnot: installed">
|
||||||
|
<button data-bind=" click: $parents[1].install">Install</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
|
@ -1,12 +1,35 @@
|
||||||
define([
|
define([
|
||||||
'knockout', 'text!./Select.html'
|
'jquery', 'knockout', 'text!./Select.html', 'fgcommand', 'kojqui/button'
|
||||||
], function(ko, htmlString) {
|
], function(jquery, ko, htmlString,fgcommand) {
|
||||||
|
|
||||||
function ViewModel(params) {
|
function ViewModel(params) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
self.catalogs = ko.observableArray([]);
|
||||||
|
|
||||||
|
self.install = function(pack) {
|
||||||
|
console.log("install", pack);
|
||||||
|
// jquery.get('/pkg/install/'+pack.id);
|
||||||
|
fgcommand.switchAircraft(pack.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.uninstall = function(pack) {
|
||||||
|
console.log("uninstall", pack);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.select = function(pack) {
|
||||||
|
console.log("select", pack );
|
||||||
|
}
|
||||||
|
|
||||||
|
jquery.get('/pkg/catalogs', null, function(data) {
|
||||||
|
if( data.catalogs )
|
||||||
|
self.catalogs(data.catalogs);
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewModel.prototype.dispose = function() {
|
// ViewModel.prototype.dispose = function() {
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Return component definition
|
// Return component definition
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Reference in a new issue