This file is indexed.

/usr/share/games/flightgear/Phi/widgets/Stopwatch.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
define([
        'jquery', 'knockout', 'text!./Stopwatch.html', 'kojqui/button'
], function(jquery, ko, htmlString) {

    function ViewModel(params) {
        var self = this;

        self.MODE = {
            STOPPED : 0,
            PAUSED : 1,
            RUNNING : 2,
        };

        self.mode = ko.observable(self.MODE.STOPPED);
        self.elapsedTime = ko.observable(0);
        self.elapsedTimeSeconds = ko.pureComputed(function() {
            return (self.elapsedTime() / 1000).toFixed(0);
        });

        self.startLabel = ko.pureComputed(function() {
            return self.mode() == self.MODE.RUNNING ? "Pause" : "Start";
        });

        self.startIcons = ko.pureComputed(function() {
            return self.mode() == self.MODE.RUNNING ? {
                primary : 'ui-icon-pause'
            } : {
                primary : 'ui-icon-play'
            };
        });

        function twoDigits(n) {
            if (n >= 10)
                return n.toString();
            else
                return '0' + n.toString();
        }

        self.hoursDisplay = ko.pureComputed(function() {
            return twoDigits(Math.floor(self.elapsedTimeSeconds() / 3600));
        });

        self.minutesDisplay = ko.pureComputed(function() {
            return twoDigits(Math.floor(self.elapsedTimeSeconds() / 60) % 60);
        });

        self.secondsDisplay = ko.pureComputed(function() {
            return twoDigits(self.elapsedTimeSeconds() % 60);
        });

        self.startTime = 0;
        self.runTime = 0;
        self.cumulatedTime = 50;

        self.startStopPause = function() {
            switch (self.mode()) {
            case self.MODE.STOPPED:
            case self.MODE.PAUSED:
                self.mode(self.MODE.RUNNING);
                break;
            case self.MODE.RUNNING:
                self.mode(self.MODE.PAUSED);
                self.cumulatedTime = self.elapsedTime();
                break;

            }

            if (self.mode() == self.MODE.RUNNING) {
                self.startTime = new Date();
                self.update();
            }
        }

        self.update = function() {
            if (self.mode() != self.MODE.RUNNING)
                return;

            var now = new Date();
            self.elapsedTime(self.cumulatedTime + (now - self.startTime));
            setTimeout(function() {
                self.update();
            }, 100);
        }

        self.clear = function() {
            self.cumulatedTime = 0;
            self.startTime = new Date();
            self.elapsedTime(0);
        }
    }

    ViewModel.prototype.dispose = function() {
    }

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