This file is indexed.

/usr/share/games/flightgear/Phi/instruments/DualArcGauge.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
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
define([
        'jquery', 'knockout', 'text!./DualArcGauge.svg', 'sprintf'
], function(jquery, ko, svgString, sprintf) {

    function getXY(positionNorm, r) {
        var a = (120*positionNorm-60)/180*Math.PI;
        return {
            'x':  50+r*Math.sin(a),
            'y':  52-r*Math.cos(a)
        }
    }
    
    function Tick( width, positionNorm, color ) {
        var self = this;

        self.width = width;
        self.color = color;

        var xy = getXY( positionNorm, 45 );
        self.getStartXY = xy.x.toString()+","+ xy.y.toString();

        xy = getXY( positionNorm, 50 );
        self.getEndXY = xy.x.toString()+","+ xy.y.toString();
    }

    function Marker( label, positionNorm, color ) {
        var self = this;

        self.label = label;
        self.color = color;
        
        var xy = getXY( positionNorm, 52 );
        self.getX = xy.x;
        self.getY = xy.y;
        
        self.anchor = 'middle';
        if( positionNorm < 0.4 ) self.anchor = 'end';
        if( positionNorm > 0.6 ) self.anchor = 'start';
    }
    
    function Arc( color, start, end ) {
        var self = this;
        self.color = color;

        if( start == end ) {
            start -= 0.005;
            end += 0.005;
        }
        
        var xy = getXY( start, 47.5 );
        self.getStartXY = xy.x.toString()+","+ xy.y.toString();
        
        xy = getXY( end, 47.5 );
        self.getEndXY = xy.x.toString()+","+ xy.y.toString();
    }
    
    function ViewModel(params) {
        var self = this;

        self.config = {
            label : params.label || '',
            min : params.min || 0,
            max : params.max || 1,
            left : {
                value : params.left.value || 0,
                format : params.left.format || '%d',
            },
            right : {
                value : params.right.value || 0,
                format : params.right.format || '%d',
            },
        }

        function getRotationNorm(value) {
            if (value < self.config.min)
                return 0;
            if (value > self.config.max)
                return 1;
            return (value - self.config.min) / (self.config.max - self.config.min);
        }

        self.leftRotationNorm = ko.pureComputed(function() {
            return getRotationNorm(ko.utils.unwrapObservable(self.config.left.value));
        });

        self.rightRotationNorm = ko.pureComputed(function() {
            return getRotationNorm(ko.utils.unwrapObservable(self.config.right.value));
        });

        self.leftText = ko.pureComputed(function() {
            return sprintf.sprintf(self.config.left.format, ko.utils.unwrapObservable(self.config.left.value));
        });

        self.rightText = ko.pureComputed(function() {
            return sprintf.sprintf(self.config.right.format, ko.utils.unwrapObservable(self.config.right.value));
        });

        self.label = self.config.label;

        self.markers = [];
        self.ticks = [];
        self.arcs = [];
        
        for ( var pos in params.marker) {
            var m = params.marker[pos];
            self.markers.push( new Marker( pos, getRotationNorm(Number(pos)), m) );
        }
        
        for ( var pos in params.ticks) {
            var t = params.ticks[pos];
            self.ticks.push( new Tick( t.width || 1, getRotationNorm(Number(pos)), t.color || 'white' ) );
        }
        
        if( params.arcs ) params.arcs.forEach(function(arc) {
            var end = arc.end || arc.start;
            self.arcs.push( new Arc(arc.color,getRotationNorm(Number(arc.start)),getRotationNorm(Number(end))));
        });

    }

    // Return component definition
    return {
        viewModel : ViewModel,
        template : svgString
    };
});