summaryrefslogtreecommitdiffstats
path: root/src/js/buttons.js
blob: 3730d9f689e72f6c3ae6bc4757dc046cd7ecdb48 (plain)
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
var buttons = {
    ac: false,
    auto: false,
    circulation: false,
    down: false,
    up: false,
    right: false,
    rear: false,
    front: false
};

module.exports = {
    update: function() {
        for( var button in buttons ) {
            document.getElementById(button+'button').setAttribute('value', buttons[button]);
        }
    },
    ac: function() {
        buttons.ac = !buttons.ac;
        this.update();
    },
    auto: function() {
        buttons.auto = !buttons.auto;
        this.update();
    },
    circulation: function() {
        buttons.circulation = !buttons.circulation;
        this.update();
    },
    down: function() {
        buttons.down = !buttons.down;
        this.update();
    },
    up: function() {
        buttons.up = !buttons.up;
        this.update();
    },
    right: function() {
        buttons.right = !buttons.right;
        this.update();
    },
    rear: function() {
        buttons.rear = !buttons.rear;
        this.update();
    },
    front: function() {
        buttons.front = !buttons.front;
        this.update();
    }
}