/usr/share/games/flightgear/Phi/widgets/AircraftMarker.js is in flightgear-phi 2016.4.2+dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | define([
'jquery', 'knockout', 'text!./AircraftMarker.html', 'text!../images/aircraft.svg'
], function(jquery, ko, htmlString, aircraftSvgFileContent ) {
// extract root element which should be <svg> from image xml (strip pi) and convert to string
// what an easy way to make Safari happy :-P
var iconSvgString = jquery('<div>') // wrap into detached <div> to get it's innerHTML
.append(
jquery( aircraftSvgFileContent ) // parse the file content
.filter(":first")[0]) // get root element
.html();
function ViewModel(params) {
var self = this;
self.iconSvg = iconSvgString;
self.rotate = 0;
self.label = [];
if( params && params.rotate ) {
self.rotate = params.rotate;
}
if( params && params.label ) {
self.label = params.label;
}
self.transformCss = function() {
return 'rotate(' + ko.unwrap(self.rotate) + 'deg)';
}
}
// ViewModel.prototype.dispose = function() {
// }
// Return component definition
return {
viewModel : ViewModel,
template : htmlString
};
});
|